Everything posted by SorenCabral
-
Custom PlayerRender/ModelBiped/ArmorLayers - 1.12.2
I`m using Forge.2808
-
Custom PlayerRender/ModelBiped/ArmorLayers - 1.12.2
Hi, I don't know if it is possible, but... I want to create one full or partial customized player model, changing or creating one new ModelBiped.class vanilla copy. This is only to adjust the LEGS and BOOTS vanilla armor position/format in my custom body. (Using the "MorePlayerModels" mod, changing only the legs) To make this, I tried: [1] - Full copied In my mod src the RenderPlayer.class and package dir from Vanilla (when I run in eclipse, the game read this instead the vanilla) and add one if() in RenderPlayer.class before layers additions, kinda: ... public RenderPlayer(RenderManager renderManager, boolean useSmallArms) { super(renderManager, new ModelPlayer(0.0F, useSmallArms), 0.5F); this.smallArms = useSmallArms; if (Minecraft.getMinecraft().getSession().getUsername().contains("[myPlayerName]")) { // if me, open my new LayerBipedArmor this.addLayer(new LayerBipedArmorCustom(this)); } else { // if not me, open the normal LayerBipedArmor this.addLayer(new LayerBipedArmor(this)); } ... [2] - Same thing in the LayerBipedArmor, but changing the name to LayerBipedArmorCustom for my exclusive use, (how viewed in the if() above), but here, hiding or showing my model/ vanilla parts: package net.minecraft.client.renderer.entity.layers; // my mod package, with same name import net.minecraft.client.model.ModelBiped; import net.minecraft.client.renderer.entity.RenderLivingBase; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class LayerBipedArmorCustom extends LayerArmorBase<ModelBiped> { public LayerBipedArmorCustom (RenderLivingBase<?> rendererIn) { super(rendererIn); } protected void initArmor() { this.modelLeggings = new ModelBiped(0.5F); this.modelArmor = new ModelBiped(1.0F); } @SuppressWarnings("incomplete-switch") protected void setModelSlotVisible(ModelBiped equipment, EntityEquipmentSlot slotIn) { this.setModelVisible(equipment); switch (slotIn) { case HEAD: equipment.bipedHead.showModel = true; equipment.bipedHeadwear.showModel = true; break; case CHEST: equipment.bipedBody.showModel = true; equipment.bipedRightArm.showModel = true; equipment.bipedLeftArm.showModel = true; break; case LEGS: equipment.bipedBody.showModel = false; equipment.bipedRightLeg.showModel = false; equipment.bipedLeftLeg.showModel = false; equipment.leftleg.showModel = true; // new part equipment.rightleg.showModel = true; // new part break; case FEET: equipment.bipedRightLeg.showModel = false; equipment.bipedLeftLeg.showModel = false; equipment.leftboot.showModel = true; // new part equipment.rightboot.showModel = true; // new part } } protected void setModelVisible(ModelBiped model) { model.setVisible(false); } @Override protected ModelBiped getArmorModelHook(net.minecraft.entity.EntityLivingBase entity, net.minecraft.item.ItemStack itemStack, EntityEquipmentSlot slot, ModelBiped model) { return net.minecraftforge.client.ForgeHooksClient.getArmorModel(entity, itemStack, slot, model); } } [3] - At last, added the new models parts on the vanilla model for class above read (All in the same model), but hiding the new parts to be only used to armor generator (If not hide, all parts appear at same time, looks one monster o_O, but in this try, I don't need from the legs, because am using from the MPM mod), see a little of the changes: ... public class ModelBiped extends ModelBase { public ModelRenderer bipedHead; /** The Biped's Headwear. Used for the outer layer of player skins. */ public ModelRenderer bipedHeadwear; public ModelRenderer bipedBody; /** The Biped's Right Arm */ public ModelRenderer bipedRightArm; /** The Biped's Left Arm */ public ModelRenderer bipedLeftArm; /** The Biped's Right Leg */ public ModelRenderer bipedRightLeg; /** The Biped's Left Leg */ public ModelRenderer bipedLeftLeg; public ModelBiped.ArmPose leftArmPose; public ModelBiped.ArmPose rightArmPose; public boolean isSneak; public ModelRenderer rightleg; // new part public ModelRenderer rightleg2; // new part public ModelRenderer rightleglow; // new part public ModelRenderer rightdetail; // new part public ModelRenderer leftleg; // new part public ModelRenderer leftleg2; // new part public ModelRenderer leftleglow; // new part public ModelRenderer leftdetail; // new part public ModelRenderer rightboot; // new part public ModelRenderer leftboot; // new part public ModelRenderer rightleglowfoot; // new part public ModelRenderer leftleglowfoot; // new part public ModelBiped() { this(0.0F); } .... this.leftleg.showModel = false; this.rightleg.showModel = false; this.leftboot.showModel = false; this.rightboot.showModel = false; .... ------------------ These are all the changes that I made, It work, when I equip any armor in my model, it appear with new legs/foots format, but: > Not work in multiplayer,I join in the game: - In my vision, the other playes legs/foots armor, when equipped are equal mys, not the vanilla; - In they vision is the opposite, they see me with the vanilla armor... > When compiled by Forge (with 'gradlew build') and putted in game out of the eclipse, this changes in vanilla classes don't work, even with the classes in the mod.jar. I ask, have one way to my idea work? (Out of Eclipse and in Multiplayer) To only create one new ModelBiped.class in one new non vanilla package named to call, from some way, by my player render, keeping the new legs parts name equal vanilla, to don't need to do any one more change in anywhere or from any another way. Thanks a lot!
IPS spam blocked by CleanTalk.