Jump to content

Oscarita25

Members
  • Posts

    143
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Oscarita25

  1. i would approach this differently it is also possible (but a bit tedious) to just replace the armor model in the item class of the armor if you override in your class that extends ItemArmor @Override @SideOnly(Side.CLIENT) public ModelBiped getArmorModel(EntityLivingBase living, ItemStack stack, EntityEquipmentSlot armorSlot, ModelBiped defaultModel) { if(!stack.isEmpty()) { if(stack.getItem() instanceof ItemArmor) { EntityEquipmentSlot type = ((ItemArmor) stack.getItem()).armorType; ModelBiped armorModel = null; switch (type) { case HEAD: armorModel = new MODEL(1f); break; case LEGS: armorModel = new MODEL(1f); break; case FEET: armorModel = new MODEL(0.5f); break; case CHEST: armorModel = new MODEL(0.5f); break; default: break; } armorModel.bipedHead.showModel = armorSlot == EntityEquipmentSlot.HEAD; armorModel.bipedHeadwear.showModel = armorSlot == EntityEquipmentSlot.HEAD; armorModel.bipedBody.showModel = (armorSlot == EntityEquipmentSlot.CHEST) || (armorSlot == EntityEquipmentSlot.CHEST); armorModel.bipedRightArm.showModel = armorSlot == EntityEquipmentSlot.CHEST; armorModel.bipedLeftArm.showModel = armorSlot == EntityEquipmentSlot.CHEST; armorModel.bipedRightLeg.showModel = (armorSlot == EntityEquipmentSlot.LEGS) || (armorSlot == EntityEquipmentSlot.FEET); armorModel.bipedLeftLeg.showModel = (armorSlot == EntityEquipmentSlot.LEGS) || (armorSlot == EntityEquipmentSlot.FEET); armorModel.isSneak = defaultModel.isSneak; armorModel.isRiding = defaultModel.isRiding; armorModel.isChild = defaultModel.isChild; armorModel.rightArmPose = defaultModel.rightArmPose; armorModel.leftArmPose = defaultModel.leftArmPose; return armorModel; } } return null; }
  2. Okay i created a RenderLayer it works 100% in SinglePlayer but it doesn't in multiplayer for other Players i think its because i use capabilities .. or at least i use them wrong for this :0 so the RenderLayer is shown if (int)capability x of Player is equal to (int)y @SideOnly(Side.CLIENT) public class LayerEntityOnPlayerBack implements LayerRenderer<EntityLivingBase>{ private final RenderManager renderManager; protected RenderLivingBase <? extends EntityLivingBase > Renderer; private ModelBase Model = new ModelParrot(); private ResourceLocation Resource = RenderParrot.PARROT_TEXTURES[2]; public LayerEntityOnPlayerBack(RenderManager rendermanager) { this.renderManager = rendermanager; } public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) { IModelID model = entitylivingbaseIn.getCapability(ModelProvider.MODEL_CAP, null); BNHA.NETWORK.sendToServer(new MessageRequestModel()); if (model.getModelID() == Reference.tail) { GlStateManager.enableRescaleNormal(); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); if(Renderer == null) Renderer = new RenderParrot(this.renderManager); Renderer.bindTexture(Resource); GlStateManager.pushMatrix(); float f = entitylivingbaseIn.isSneaking() ? -1.3F : -1.5F; GlStateManager.translate(0.0F, f, 0.0F); ageInTicks = 0.0F; Model.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks); Model.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entitylivingbaseIn); Model.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale); GlStateManager.popMatrix(); GlStateManager.disableRescaleNormal(); } } public boolean shouldCombineTextures() { return false; } }
  3. yeah he should try running it without sudo .. as far as i know if it used with superuser rights it will write the files for superusers ... sooo eclipse can't open it because it would need superuser rights also if you do that delete the already written files before hand .. it might cause issues !
  4. as i said this file is the installer for 1.12.2 Forge you need a different installer to install 1.13.2 Forge! you can download this installer from the official Forge site here: https://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.13.2.html
  5. i suppose you did not download the right installer? i am certain that you are not using the right installer for minecraft forge 1.13 this is how the installer for 1.13.2 looks like you downloaded the wrong one what is the file name of the installer you are opening? download the installer here: https://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.13.2.html
  6. uhm you know the forge version you install depends on which you downloaded at https://files.minecraftforge.net/
  7. you can download one from the official minecraft forge site: https://files.minecraftforge.net/ download the installer!(its a .jar) not the Windows Installer!
  8. try out to use the latest version of forge (most times this works for me ¯\_(ツ)_/¯)
  9. can you provide a full log and which exact forge version are you using?
  10. could you share bit more information what is actually happening to you? or a screenshot if that is possible?
  11. just read your own post again.. if it outputs you as name : tile.ruby_block.name then it would not be block.ruby_block.name=Block of Ruby change it to tile.ruby_block.name=Block of Ruby and it should work hope that helped
  12. i know this is a bit late but i know the solution to this problem (for other players that trying the same): BestialArmorModel armorModel = new BestialArmorModel(0.25f); don't create a new model everytime "getArmorModel" is called
  13. then how would i get the renderer of the player.... from the postinit? thats the main point why i thought i should use the renderplayerevent
  14. Thanks!... ofc it would ... actually.. which event should i use then ?
  15. ok i wanted to make a renderlayer (on the player) that renders a model / entity on the player ... i have done all of this but the renderlayer causes Frame drops over time .... after like 1 minute of looking on anything that renders on it the fps are 0-4 fps here a screen of the Lag o Meter of minecraft when i am in thirdperson: ^^ Slowly going up and getting Frame drops ^^ here is the relevant code(i am using a parrot as placeholder just to test): My Render Layer Class: @SideOnly(Side.CLIENT) public class LayerEntityOnPlayerBack implements LayerRenderer<EntityLivingBase>{ private final RenderManager renderManager; protected RenderLivingBase <? extends EntityLivingBase > Renderer; private ModelBase Model = new ModelParrot(); private ResourceLocation Resource = RenderParrot.PARROT_TEXTURES[2]; public LayerEntityOnPlayerBack(RenderManager rendermanager) { this.renderManager = rendermanager; } public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) { if (entitylivingbaseIn.getCapability(ModelProvider.MODEL_CAP, null).getModelID() != 0) { GlStateManager.enableRescaleNormal(); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); if (entitylivingbaseIn.getCapability(ModelProvider.MODEL_CAP, null).getModelID() == 1) { if(Renderer == null) Renderer = new RenderParrot(this.renderManager); Renderer.bindTexture(Resource); GlStateManager.pushMatrix(); float f = entitylivingbaseIn.isSneaking() ? -1.3F : -1.5F; GlStateManager.translate(0.0F, f, 0.0F); ageInTicks = 0.0F; Model.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks); Model.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entitylivingbaseIn); Model.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale); GlStateManager.popMatrix(); } GlStateManager.disableRescaleNormal(); } } public boolean shouldCombineTextures() { return false; } } RenderPlayerEvent.Pre: @SubscribeEvent public void RenderPlayerEvent(RenderPlayerEvent.Pre event) { LayerEntityOnPlayerBack layer = new LayerEntityOnPlayerBack(event.getRenderer().getRenderManager()); event.getRenderer().addLayer(layer); }
  16. i am creating right now an entity that is being spawned by the player and makes damage to anything that touches it... but i want to change the source of when it kills something to the player... is there a method to do this and if not how would i do this?
  17. @Corey thank you very much this was the solution! btw this is the code i used to register the textures! @SubscribeEvent public static void TextureStiching(TextureStitchEvent.Pre event) { TextureMap map = event.getMap(); map.registerSprite(new ResourceLocation(Reference.MOD_ID,"tail/tailskincolour")); map.registerSprite(new ResourceLocation(Reference.MOD_ID,"tail/tailhaircolour")); }
  18. i figured that much myself! also thanks for pointing out the Event because thats what i've been searching for the last half hour XD
  19. actually it only doesn't work for the textures that has not been loaded by a item or anything like that before ... like i can load my textures i use for ANY item in my mod but not the ones i want to use for the model
  20. i am actually not sure if it is really my code because if i use normal minecraft textures it shows (i edited what i said before)
  21. interesting .. i changed my textures to : "0": "blocks/iron_block", "1": "blocks/iron_block", "particle": "blocks/iron_block" nothing changed the textures are still not showing :0 edit THEY DO SHOW !! ... it works with normal textures! (didn't reload the json before)
×
×
  • Create New...

Important Information

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