Jump to content

Recommended Posts

Posted

Hello modders,

I have some questions about rendering the player. Since forge 1.8 RenderPlayerEvents are useless. So now there are ayers.

1. If I want to change the player model and the rendering stuff (like Entities), will I have to redo all layers or is there a better solution?

2. The RenderLivingEntity event still exists, so can I render the EntityPlayer there without doing all the stuff with layers? (I think this wouldn`t work but I better asked)

3. Are the layers cancelable? I don`t want currently armor being rendered. (What else option do I have?)

4. Can I just copy paste minecraft/minecraftforge`s code for layers and just change some values, or is "expands" better?

5. If I have to add my own Layers, where can I register them? And how can I check if the layer, which is currently rendered, if it is my own layer?

6. If i have more models  (3 different types and for every type 2 different texture) can I just make 3 different Layers which have 2 different texture registered (register a layer with texture 1, set ResourceLocation to texture 2 and register the same layer with a different texture a second time?

 

I am currently looking in the source code to find the answers, but if somebody can answer it faster, please do.

If I found an answer, I will post it.

Sorry for my bad English and thanks for your help.

Androm

Posted

Bump.

I am confused with the Layers and how it`s rendered. :o

But I think, I just need an own RenderManager and an own RenderPlayer which holds the models and textures, check which textures are needed and then apply it.. Is there a better way? :-\

Posted

I managed to write some LayerRenderers and apply them to all players, but do I really have to delete the LayerRenderers which I don't need, or is there an event where I can cancel special LayerRenderers?

Some of my classes: (If you have problems to understand it, tell it me please)

 

  Reveal hidden contents

 

Posted

If I go in the Thirdperson view, minecraft crashes with following error:

 

  Reveal hidden contents

 

Something is null, but I don`t what because the doRender(....) is called and the arguments aren`t null...

Event, where it happens:

@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onRenderLiving(RenderLivingEvent.Pre rlep) {
	if(rlep.entity instanceof EntityPlayer) {
		EntityPlayer player = (EntityPlayer)rlep.entity;
		LayerRenderer lr = new M_LayerDwarfFemale(new RenderManagerUtils().getValueOfSkinMap("default"));
		lr.doRenderLayer((EntityLivingBase)player, 1F, 1F, ClientEvents.partialTicks, (float)player.posX, (float)player.posY, (float)player.posZ, 1F);
		System.out.println("Tried to render player");
	}
}

No class changed since I posted them. Anyone can help me?

 

 

 

Posted

M_ModelRenderer.mRs should be null.

Move following code in M_ModelRenderer's constructor to the static{}:

	mRs = new HashMap<ModelBase, ModelRenderer>();
	ArrayList<ModelBase> mBs = new ArrayList<ModelBase>();
	mBs.add(new ModelDwarfFemale());
	mBs.add(new ModelDwarfMale());
	mBs.add(new ModelElfFemale());
	mBs.add(new ModelElfMale());
	mBs.add(new ModelOrkFemale());
	mBs.add(new ModelOrkMale());

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Posted

No, M_ModelRenderer.mRs wasn't null, but it couldn't get the value for the key. In the hashmap is an object called new ModelDwarFemale, but if i used the key new ModelDwarfFemale or cast it to ModelBase the key doesn't exist. I solved the problem with adding a '.getClass().getName()'. Now there is no error, but nothing is rendered..

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.