Do you have a certain item or slot or something that you want to give the player an armor-like overlay without putting it in the armor slot? Then this is your tutorial!
ClientProxy:
This is where we register our Renderer. If you don't have a ClientProxy look up how to make one.
public static void registerRenders(){
RenderingRegistry.registerEntityRenderingHandler(EntityPlayer.class, new RenderTutorialPlayer());
}
Thank you, but I thought this was going to show how to add a "slot" like an armor slot, it just adds a texture over the player model?
Umm no. The tutorial is about making a custom player overlay. A custom slot tutorial has already been made Here. And this is completely overriding the player renderer.
Yeah dude seriously though it still doesnt give us enough information... Like what the hell. You didn't explain about the RenderPlayerGC so we're here left to guess what to do with it.
RenderPlayerGC is underscored red and is therefore undefined for us because you didnt post what to do withthat! This being so, your post is pretty useless to us, until you actually help us with that.
Sorry for anger, just hate when people decide to be vague.
Yeah dude seriously though it still doesnt give us enough information... Like what the hell. You didn't explain about the RenderPlayerGC so we're here left to guess what to do with it.
RenderPlayerGC is underscored red and is therefore undefined for us because you didnt post what to do withthat! This being so, your post is pretty useless to us, until you actually help us with that.
Sorry for anger, just hate when people decide to be vague.
its code from galactic craft as the next bit after it is thermalpaddingtexture which is used on mars
removing that whole line will get rid of error and the code still works
its code from galactic craft as the next bit after it is thermalpaddingtexture which is used on mars
removing that whole line will get rid of error and the code still works
So you are saying this tutorial is just a copy of code from galactic craft? I assume it has no comments there either, which is maybe why this poster didn't explain any of why this works or how it works (because they probably don't know how it works)?
I'm curious about this, as I've added changing the player model to a dragon in my mod, but now I want to change a few more things, and the method I used doesn't allow for that. I could switch to this method, but need to understand how it works.
Like other posters, I agree a few more details could be included to make this be a better "tutorial".
this tutorial allows you to override the player skins that get sent to the server via minecraft site so no matter what skin a player has you can force it to be your skin
public ResourceLocation texture = new ResourceLocation(Main.MODID + "Put your texture path here"); change the part which says put texture here to
something like this Main.MODID + "textures/yourskinname.png");
if you copy and paste both codes it will give a working skin override. to add more skins / change the actual player model you will have to mess with the Gl11 stuff
havent tested it but if you place this as the whole code for the render who can probably eliminate half the code since the gl11 stuff is for the model
public class RenderTutorialPlayer extends RenderPlayer{
public ResourceLocation texture = new ResourceLocation(Main.MODID + "Put your texture path here");
public ModelBiped tutModel;
public RenderTutorialPlayer() {
super();
this.mainModel = new ModelBiped(0.0F);
this.modelBipedMain = (ModelBiped) this.mainModel;
this.modelArmorChestplate = new ModelBiped(1.0F);
this.modelArmor = new ModelBiped(0.5F);
this.tutModel = new ModelBiped(0.5f);
Do you have a certain item or slot or something that you want to give the player an armor-like overlay without putting it in the armor slot? Then this is your tutorial!
ClientProxy:
public static void registerRenders(){
RenderingRegistry.registerEntityRenderingHandler(EntityPlayer.class, new RenderTutorialPlayer());
}
RenderTutorialPlayer:
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
public class RenderTutorialPlayer extends RenderPlayer{
public ResourceLocation texture = new ResourceLocation(Main.MODID + "Put your texture path here");
public ModelBiped tutModel;
public RenderTutorialPlayer() {
super();
this.mainModel = new ModelBiped(0.0F);
this.modelBipedMain = (ModelBiped) this.mainModel;
this.modelArmorChestplate = new ModelBiped(1.0F);
this.modelArmor = new ModelBiped(0.5F);
this.tutModel = new ModelBiped(0.5f);
}
@Override
public void renderModel(EntityLivingBase entity, float par2, float par3, float par4, float par5, float par6, float par7){
super.renderModel(entity, par2, par3, par4, par5, par6, par7);
if(Conditions for the overlay to be rendered){
ModelBiped modelBiped;
for (int i = 0; i < 4; ++i)
{
modelBiped = this.tutModel;
GL11.glColor4f(1, 1, 1, 1);
this.bindTexture(texture);
modelBiped.bipedHead.showModel = i == 0;
modelBiped.bipedHeadwear.showModel = i == 0;
modelBiped.bipedBody.showModel = i == 1 || i == 2;
modelBiped.bipedRightArm.showModel = i == 1;
modelBiped.bipedLeftArm.showModel = i == 1;
modelBiped.bipedRightLeg.showModel = i == 2 || i == 3;
modelBiped.bipedLeftLeg.showModel = i == 2 || i == 3;
modelBiped.onGround = this.mainModel.onGround;
modelBiped.isRiding = this.mainModel.isRiding;
modelBiped.isChild = this.mainModel.isChild;
if (this.mainModel instanceof ModelBiped)
{
modelBiped.heldItemLeft = ((ModelBiped) this.mainModel).heldItemLeft;
modelBiped.heldItemRight = ((ModelBiped) this.mainModel).heldItemRight;
modelBiped.isSneak = ((ModelBiped) this.mainModel).isSneak;
modelBiped.aimedBow = ((ModelBiped) this.mainModel).aimedBow;
}
modelBiped.setLivingAnimations(entity, par2, par3, 0.0F);
modelBiped.render(entity, par2, par3, par4, par5, par6, par7);
// Start alpha render
GL11.glDisable(GL11.GL_LIGHTING);
this.bindTexture(texture);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_BLEND);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.0F);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
float time = entity.ticksExisted / 10.0F;
float sTime = (float) Math.sin(time) * 0.5F + 0.5F;
float r = 0.2F * sTime;
float g = 1.0F * sTime;
float b = 0.2F * sTime;
modelBiped.render(entity, par2, par3, par4, par5, par6, par7);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glColor4f(1, 1, 1, 1);
GL11.glEnable(GL11.GL_LIGHTING);
}
}
}
}
}
And that's it! Just fix the texture and rename some stuff and you're done!
Make Sure to check out my MyFit mod!
Umm no. The tutorial is about making a custom player overlay. A custom slot tutorial has already been made Here. And this is completely overriding the player renderer.
Awesome! This renderer is completely customizable, and the limit is your imagination!
Will try this and hopefully post back with my results
RenderPlayerGC is underscored red and is therefore undefined for us because you didnt post what to do withthat! This being so, your post is pretty useless to us, until you actually help us with that.
Sorry for anger, just hate when people decide to be vague.
its code from galactic craft as the next bit after it is thermalpaddingtexture which is used on mars
removing that whole line will get rid of error and the code still works
So you are saying this tutorial is just a copy of code from galactic craft? I assume it has no comments there either, which is maybe why this poster didn't explain any of why this works or how it works (because they probably don't know how it works)?
I'm curious about this, as I've added changing the player model to a dragon in my mod, but now I want to change a few more things, and the method I used doesn't allow for that. I could switch to this method, but need to understand how it works.
Like other posters, I agree a few more details could be included to make this be a better "tutorial".
[url=2482915-wip-arkcraft-survival-evolved-dinos-taming]
the whole tut isnt from galacticraft just one line that gives an error without it
this.bindTexture(RenderPlayerGC.thermalPaddingTexture1);
that one there.
this tutorial allows you to override the player skins that get sent to the server via minecraft site so no matter what skin a player has you can force it to be your skin
public ResourceLocation texture = new ResourceLocation(Main.MODID + "Put your texture path here"); change the part which says put texture here to
something like this Main.MODID + "textures/yourskinname.png");
if you copy and paste both codes it will give a working skin override. to add more skins / change the actual player model you will have to mess with the Gl11 stuff
Ah, I see. This code uses the player model (doesn't change it), and is just changing the skin (the texture).
Still, at some point I'll take a look at it and see if it can be useful for changing the model also.
Seems like a lot of code to just change the skin. I would have thought just replacing the render class would do that and with a lot less code
[url=2482915-wip-arkcraft-survival-evolved-dinos-taming]
havent tested it but if you place this as the whole code for the render who can probably eliminate half the code since the gl11 stuff is for the model
public class RenderTutorialPlayer extends RenderPlayer{
public ResourceLocation texture = new ResourceLocation(Main.MODID + "Put your texture path here");
public ModelBiped tutModel;
public RenderTutorialPlayer() {
super();
this.mainModel = new ModelBiped(0.0F);
this.modelBipedMain = (ModelBiped) this.mainModel;
this.modelArmorChestplate = new ModelBiped(1.0F);
this.modelArmor = new ModelBiped(0.5F);
this.tutModel = new ModelBiped(0.5f);
}
}
what Conditions for the overlay to be rendered ?
if someone anyone could please help me I'm really about to quit
even if someone sees this post months or years later respond anyways what Conditions for the overlay to be rendered
?
for me the Condition for the overlay to be rendered is whether or not a boolean is set to true in another class.