Jump to content

Phonixe

Members
  • Posts

    34
  • Joined

  • Last visited

Everything posted by Phonixe

  1. I do have an eventhandler that changes it to 1 when the player is rendered @SubscribeEvent public void onPlayerRendered(RenderPlayerEvent event) { EntityPlayer player = event.getEntityPlayer(); Entity entity = event.getEntity(); IRender rendered = entity.getCapability(RenderProvider.IS_RENDERED, null); rendered.setIsRendered(1); }
  2. IRender rendered = entityIn.getCapability(RenderProvider.IS_RENDERED, null); if (PhoenixCraftKeyBindings.flyWings.isKeyDown() && rendered.getIsRendered() == 1) { this.body1.rotateAngleY = 0.5F + MathHelper.cos(ageInTicks * 0.6662F) * 0.4F / 1.0F;} this seems to cause the armor to not render when the button is pressed ._.
  3. I tried looking through tutorials about capabilities and i couldn't figure out a way to store if the Armor should be animated on a specific entity. ._.
  4. How could i check which armor is being rendered?
  5. Hello, i'm trying to make an armor model only animated when a player presses a button. The issue is that when the player presses the button the animation is done on the armor for all the entities that are wearing this armor (ArmorStand, Player, etc) while i want it to only animate for the player that pressed the button. @Override public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) { super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn); this.body1.rotateAngleY = 0.0F; if (PhoenixCraftKeyBindings.flyWings.isKeyDown()) { ModelBiped armorModel = PhoenixCraft.proxy.getArmorModel(0); this.body1.rotateAngleY = 0.5F + MathHelper.cos(ageInTicks * 0.6662F) * 0.4F / 1.0F; } }
  6. Model Class: package phonixe.phoenixcraft.client.model; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class ModelRedFirePhoenixArmor extends ModelBiped { private ModelRenderer Head1; private ModelRenderer Head2; private ModelRenderer Head3; private ModelRenderer Head4; private ModelRenderer Head5; private ModelRenderer Head6; private ModelRenderer Head7; private ModelRenderer Head8; private ModelRenderer Head9; private ModelRenderer Head10; private ModelRenderer Head11; private ModelRenderer Head12; private ModelRenderer Head13; private ModelRenderer Head14; private ModelRenderer Head15; private ModelRenderer Head16; private ModelRenderer Head17; private ModelRenderer Head18; private ModelRenderer Head19; private ModelRenderer Head20; private ModelRenderer Head21; private ModelRenderer Head22; private ModelRenderer head_23; private ModelRenderer leftarm1; private ModelRenderer rightarm1; private ModelRenderer leftarm2; private ModelRenderer rightarm2; private ModelRenderer body1; private ModelRenderer body2; private ModelRenderer body3; private ModelRenderer body4; private ModelRenderer body5; private ModelRenderer body6; private ModelRenderer body7; private ModelRenderer body8; private ModelRenderer body9; private ModelRenderer body10; private ModelRenderer body11; private ModelRenderer body12; private ModelRenderer body13; private ModelRenderer body14; private ModelRenderer body15; private ModelRenderer body16; private ModelRenderer body17; private ModelRenderer body18; private ModelRenderer body19; private ModelRenderer body20; private ModelRenderer body21; private ModelRenderer rightleg1; private ModelRenderer leftleg1; private ModelRenderer leftleg2; private ModelRenderer leftleg3; private ModelRenderer rightleg2; private ModelRenderer rightleg3; public ModelRedFirePhoenixArmor(float par1) { super(par1, 0, 128, 64); textureWidth = 128; textureHeight = 64; bipedHead.addChild(Head1); bipedHead.addChild(Head2); bipedHead.addChild(Head3); bipedHead.addChild(Head4); bipedHead.addChild(Head5); bipedHead.addChild(Head6); bipedHead.addChild(Head7); bipedHead.addChild(Head8); bipedHead.addChild(Head9); bipedHead.addChild(Head10); bipedHead.addChild(Head11); bipedHead.addChild(Head12); bipedHead.addChild(Head13); bipedHead.addChild(Head14); bipedHead.addChild(Head15); bipedHead.addChild(Head16); bipedHead.addChild(Head17); bipedHead.addChild(Head18); bipedHead.addChild(Head19); bipedHead.addChild(Head20); bipedHead.addChild(Head21); bipedHead.addChild(Head22); bipedHead.addChild(head_23); bipedBody.addChild(body1); bipedBody.addChild(body2); bipedBody.addChild(body3); body3.addChild(body4); body3.addChild(body5); body3.addChild(body6); body3.addChild(body7); body3.addChild(body8); body3.addChild(body9); body3.addChild(body10); body3.addChild(body11); body3.addChild(body12); body1.addChild(body13); body1.addChild(body14); body1.addChild(body15); body1.addChild(body16); body1.addChild(body17); body1.addChild(body18); body1.addChild(body19); body1.addChild(body20); body1.addChild(body21); bipedRightArm.addChild(rightarm1); bipedRightArm.addChild(rightarm2); bipedLeftArm.addChild(leftarm1); bipedLeftArm.addChild(leftarm2); bipedRightLeg.addChild(rightleg1); bipedRightLeg.addChild(rightleg2); bipedRightLeg.addChild(rightleg3); bipedLeftLeg.addChild(leftleg1); bipedLeftLeg.addChild(leftleg2); bipedLeftLeg.addChild(leftleg3); Head1 = new ModelRenderer(this, 0, 32); Head1.addBox(-2.5F, -7.5F, -8.5F, 1, 7, 1); Head1.setRotationPoint(0F, 0F, 0F); Head1.setTextureSize(64, 32); Head1.mirror = true; setRotation(Head1, -1.152537F, 0F, 0F); Head2 = new ModelRenderer(this, 4, 32); Head2.addBox(-3.5F, -9.5F, -8F, 1, 8, 1); Head2.setRotationPoint(0F, 0F, 0F); Head2.setTextureSize(64, 32); Head2.mirror = true; setRotation(Head2, -1.152537F, 0F, 0F); Head3 = new ModelRenderer(this, 8, 32); Head3.addBox(-1.5F, -9.5F, -8F, 1, 8, 1); Head3.setRotationPoint(0F, 0F, 0F); Head3.setTextureSize(64, 32); Head3.mirror = true; setRotation(Head3, -1.152537F, 0F, 0F); Head4 = new ModelRenderer(this, 12, 32); Head4.addBox(-0.5F, -7.5F, -8.5F, 1, 7, 1); Head4.setRotationPoint(0F, 0F, 0F); Head4.setTextureSize(64, 32); Head4.mirror = true; setRotation(Head4, -1.152537F, 0F, 0F); Head5 = new ModelRenderer(this, 16, 32); Head5.addBox(0.5F, -9.5F, -8F, 1, 8, 1); Head5.setRotationPoint(0F, 0F, 0F); Head5.setTextureSize(64, 32); Head5.mirror = true; setRotation(Head5, -1.152537F, 0F, 0F); Head6 = new ModelRenderer(this, 20, 32); Head6.addBox(1.5F, -7.5F, -8.5F, 1, 7, 1); Head6.setRotationPoint(0F, 0F, 0F); Head6.setTextureSize(64, 32); Head6.mirror = true; setRotation(Head6, -1.152537F, 0F, 0F); Head7 = new ModelRenderer(this, 24, 32); Head7.addBox(2.5F, -9.5F, -8F, 1, 8, 1); Head7.setRotationPoint(0F, 0F, 0F); Head7.setTextureSize(64, 32); Head7.mirror = true; setRotation(Head7, -1.152537F, 0F, 0F); Head8 = new ModelRenderer(this, 28, 32); Head8.addBox(3F, -8.5F, -7F, 1, 7, 1); Head8.setRotationPoint(0F, 0F, 0F); Head8.setTextureSize(64, 32); Head8.mirror = true; setRotation(Head8, -1.152537F, 0F, 0F); Head9 = new ModelRenderer(this, 32, 32); Head9.addBox(2.5F, -10.5F, -6F, 1, 7, 1); Head9.setRotationPoint(0F, 0F, 0F); Head9.setTextureSize(64, 32); Head9.mirror = true; setRotation(Head9, -1.152537F, 0F, 0F); Head10 = new ModelRenderer(this, 36, 32); Head10.addBox(-3.5F, -10.5F, -6F, 1, 7, 1); Head10.setRotationPoint(0F, 0F, 0F); Head10.setTextureSize(64, 32); Head10.mirror = true; setRotation(Head10, -1.152537F, 0F, 0F); Head11 = new ModelRenderer(this, 40, 32); Head11.addBox(-4F, -8.5F, -7F, 1, 7, 1); Head11.setRotationPoint(0F, 0F, 0F); Head11.setTextureSize(64, 32); Head11.mirror = true; setRotation(Head11, -1.152537F, 0F, 0F); Head12 = new ModelRenderer(this, 44, 32); Head12.addBox(-1.5F, -10.5F, -6F, 1, 7, 1); Head12.setRotationPoint(0F, 0F, 0F); Head12.setTextureSize(64, 32); Head12.mirror = true; setRotation(Head12, -1.152537F, 0F, 0F); Head13 = new ModelRenderer(this, 48, 32); Head13.addBox(-2.5F, -9.5F, -5.5F, 1, 7, 1); Head13.setRotationPoint(0F, 0F, 0F); Head13.setTextureSize(64, 32); Head13.mirror = true; setRotation(Head13, -1.152537F, 0F, 0F); Head14 = new ModelRenderer(this, 52, 32); Head14.addBox(-0.5F, -9.5F, -5.5F, 1, 7, 1); Head14.setRotationPoint(0F, 0F, 0F); Head14.setTextureSize(64, 32); Head14.mirror = true; setRotation(Head14, -1.152537F, 0F, 0F); Head15 = new ModelRenderer(this, 56, 32); Head15.addBox(1.5F, -9.5F, -5.5F, 1, 7, 1); Head15.setRotationPoint(0F, 0F, 0F); Head15.setTextureSize(64, 32); Head15.mirror = true; setRotation(Head15, -1.152537F, 0F, 0F); Head16 = new ModelRenderer(this, 60, 32); Head16.addBox(0.5F, -10.5F, -6F, 1, 7, 1); Head16.setRotationPoint(0F, 0F, 0F); Head16.setTextureSize(64, 32); Head16.mirror = true; setRotation(Head16, -1.152537F, 0F, 0F); Head17 = new ModelRenderer(this, 0, 41); Head17.addBox(-3F, -6F, -7F, 6, 1, 1); Head17.setRotationPoint(0F, 0F, 0F); Head17.setTextureSize(64, 32); Head17.mirror = true; setRotation(Head17, -1.152546F, 0F, 0F); Head18 = new ModelRenderer(this, 0, 43); Head18.addBox(-2F, -7.5F, -5.5F, 4, 1, 1); Head18.setRotationPoint(0F, 0F, 0F); Head18.setTextureSize(64, 32); Head18.mirror = true; setRotation(Head18, 0F, 0F, 0F); Head19 = new ModelRenderer(this, 0, 45); Head19.addBox(-3F, -8F, -5F, 6, 1, 1); Head19.setRotationPoint(0F, 0F, 0F); Head19.setTextureSize(64, 32); Head19.mirror = true; setRotation(Head19, 0F, 0F, 0F); Head20 = new ModelRenderer(this, 0, 47); Head20.addBox(-4F, -8.5F, -3F, 8, 1, 1); Head20.setRotationPoint(0F, 0F, 0F); Head20.setTextureSize(64, 32); Head20.mirror = true; setRotation(Head20, 0F, 0F, 0F); Head21 = new ModelRenderer(this, 0, 49); Head21.addBox(-4F, -8.75F, 2.75F, 8, 8, 1); Head21.setRotationPoint(0F, 0F, 0F); Head21.setTextureSize(64, 32); Head21.mirror = true; setRotation(Head21, -0.2230717F, 0F, 0F); Head22 = new ModelRenderer(this, 14, 41); Head22.addBox(-4F, -8F, 3.75F, 8, 4, 1); Head22.setRotationPoint(0F, 0F, 0F); Head22.setTextureSize(64, 32); Head22.mirror = true; setRotation(Head22, 0F, 0F, 0F); head_23 = new ModelRenderer(this, 0, 58); head_23.addBox(-1F, -7F, -6F, 2, 1, 1); head_23.setRotationPoint(0F, 0F, 0F); head_23.setTextureSize(64, 32); head_23.mirror = true; setRotation(head_23, 0F, 0F, 0F); leftarm1 = new ModelRenderer(this, 32, 41); leftarm1.addBox(-1.5F, -3.5F, -2.5F, 5, 4, 5); leftarm1.setRotationPoint(0F, 0F, 0F); leftarm1.setTextureSize(64, 32); leftarm1.mirror = true; setRotation(leftarm1, 0F, 0F, 0F); rightarm1 = new ModelRenderer(this, 32, 50); rightarm1.addBox(-3.5F, -2.5F, -2.5F, 5, 4, 5); rightarm1.setRotationPoint(0F, 0F, 0F); rightarm1.setTextureSize(64, 32); rightarm1.mirror = true; setRotation(rightarm1, 0F, 0F, 0F); leftarm2 = new ModelRenderer(this, 32, 59); leftarm2.addBox(-1F, -3F, -2F, 4, 1, 4); leftarm2.setRotationPoint(0F, 0F, 0F); leftarm2.setTextureSize(64, 32); leftarm2.mirror = true; setRotation(leftarm2, 0F, 0F, 0F); rightarm2 = new ModelRenderer(this, 16, 59); rightarm2.addBox(-3F, -3F, -2F, 4, 1, 4); rightarm2.setRotationPoint(0F, 0F, 0F); rightarm2.setTextureSize(64, 32); rightarm2.mirror = true; setRotation(rightarm2, 0F, 0F, 0F); body1 = new ModelRenderer(this, 32, 0); body1.addBox(-12.5F, 2.5F, 3.75F, 12, 1, 1); body1.setRotationPoint(0F, 0F, 0F); body1.setTextureSize(64, 32); body1.mirror = true; setRotation(body1, 0F, 0F, 0.5235988F); body2 = new ModelRenderer(this, 32, 2); body2.addBox(-1F, 4F, 2F, 2, 2, 2); body2.setRotationPoint(0F, 0F, 0F); body2.setTextureSize(64, 32); body2.mirror = true; setRotation(body2, 0F, 0F, 0F); body3 = new ModelRenderer(this, 32, 6); body3.addBox(0.5F, 5.5F, 4.25F, 10, 1, 1); body3.setRotationPoint(0F, 0F, 0F); body3.setTextureSize(64, 32); body3.mirror = true; setRotation(body3, 0F, 0F, -0.5235988F); body4 = new ModelRenderer(this, 32, ; body4.addBox(0.5F, 4.5F, 3.75F, 12, 1, 1); body4.setRotationPoint(0F, 0F, 0F); body4.setTextureSize(64, 32); body4.mirror = true; setRotation(body4, 0F, 0F, -0.5235988F); body5 = new ModelRenderer(this, 32, 10); body5.addBox(0.5F, 3.5F, 4.25F, 10, 1, 1); body5.setRotationPoint(0F, 0F, 0F); body5.setTextureSize(64, 32); body5.mirror = true; setRotation(body5, 0F, 0F, -0.5235988F); body6 = new ModelRenderer(this, 32, 12); body6.addBox(0.5F, 6.5F, 3.75F, 12, 1, 1); body6.setRotationPoint(0F, 0F, 0F); body6.setTextureSize(64, 32); body6.mirror = true; setRotation(body6, 0F, 0F, -0.5235988F); body7 = new ModelRenderer(this, 32, 14); body7.addBox(0.5F, 1.5F, 4.25F, 9, 1, 1); body7.setRotationPoint(0F, 0F, 0F); body7.setTextureSize(64, 32); body7.mirror = true; setRotation(body7, 0F, 0F, -0.5235988F); body8 = new ModelRenderer(this, 40, 2); body8.addBox(0.5F, 7.5F, 4.25F, 9, 1, 1); body8.setRotationPoint(0F, 0F, 0F); body8.setTextureSize(64, 32); body8.mirror = true; setRotation(body8, 0F, 0F, -0.5235988F); body9 = new ModelRenderer(this, 56, 16); body9.addBox(0.5F, 2F, 4.25F, 1, 6, 1); body9.setRotationPoint(0F, 0F, 0F); body9.setTextureSize(64, 32); body9.mirror = true; setRotation(body9, 0F, 0F, -0.5235988F); body10 = new ModelRenderer(this, 56, 23); body10.addBox(1.75F, -1F, 4F, 1, 6, 1); body10.setRotationPoint(0F, 0F, 0F); body10.setTextureSize(64, 32); body10.mirror = true; setRotation(body10, 0F, 0F, 0.3315078F); body11 = new ModelRenderer(this, 48, 59); body11.addBox(2F, 1F, 4F, 6, 4, 1); body11.setRotationPoint(0F, 0F, 0F); body11.setTextureSize(64, 32); body11.mirror = true; setRotation(body11, 0F, 0F, 0.3315078F); body12 = new ModelRenderer(this, 58, 0); body12.addBox(0.5F, 2.5F, 3.75F, 12, 1, 1); body12.setRotationPoint(0F, 0F, 0F); body12.setTextureSize(64, 32); body12.mirror = true; setRotation(body12, 0F, 0F, -0.5235988F); body13 = new ModelRenderer(this, 84, 0); body13.addBox(-10.5F, 3.5F, 4.25F, 10, 1, 1); body13.setRotationPoint(0F, 0F, 0F); body13.setTextureSize(64, 32); body13.mirror = true; setRotation(body13, 0F, 0F, 0.5235988F); body14 = new ModelRenderer(this, 60, 2); body14.addBox(-12.5F, 4.5F, 3.75F, 12, 1, 1); body14.setRotationPoint(0F, 0F, 0F); body14.setTextureSize(64, 32); body14.mirror = true; setRotation(body14, 0F, 0F, 0.5235988F); body15 = new ModelRenderer(this, 86, 2); body15.addBox(-10.5F, 5.5F, 4.25F, 10, 1, 1); body15.setRotationPoint(0F, 0F, 0F); body15.setTextureSize(64, 32); body15.mirror = true; setRotation(body15, 0F, 0F, 0.5235988F); body16 = new ModelRenderer(this, 40, 4); body16.addBox(-12.5F, 6.5F, 3.75F, 12, 1, 1); body16.setRotationPoint(0F, 0F, 0F); body16.setTextureSize(64, 32); body16.mirror = true; setRotation(body16, 0F, 0F, 0.5235988F); body17 = new ModelRenderer(this, 54, 6); body17.addBox(-9.5F, 7.5F, 4.25F, 9, 1, 1); body17.setRotationPoint(0F, 0F, 0F); body17.setTextureSize(64, 32); body17.mirror = true; setRotation(body17, 0F, 0F, 0.5235988F); body18 = new ModelRenderer(this, 66, 4); body18.addBox(-9.5F, 1.5F, 4.25F, 9, 1, 1); body18.setRotationPoint(0F, 0F, 0F); body18.setTextureSize(64, 32); body18.mirror = true; setRotation(body18, 0F, 0F, 0.5235988F); body19 = new ModelRenderer(this, 58, ; body19.addBox(-1.5F, 2F, 4.25F, 1, 6, 1); body19.setRotationPoint(0F, 0F, 0F); body19.setTextureSize(64, 32); body19.mirror = true; setRotation(body19, 0F, 0F, 0.5235988F); body20 = new ModelRenderer(this, 62, ; body20.addBox(-2.75F, -1F, 4F, 1, 6, 1); body20.setRotationPoint(0F, 0F, 0F); body20.setTextureSize(64, 32); body20.mirror = true; setRotation(body20, 0F, 0F, -0.3315093F); body21 = new ModelRenderer(this, 86, 4); body21.addBox(-8F, 1F, 4F, 6, 4, 1); body21.setRotationPoint(0F, 0F, 0F); body21.setTextureSize(64, 32); body21.mirror = true; setRotation(body21, 0F, 0F, -0.3315093F); rightleg1 = new ModelRenderer(this, 66, ; rightleg1.addBox(-0.5F, 11F, 2F, 1, 1, 1); rightleg1.setRotationPoint(0F, 0F, 0F); rightleg1.setTextureSize(64, 32); rightleg1.mirror = true; setRotation(rightleg1, 0F, 0F, 0F); leftleg1 = new ModelRenderer(this, 66, 11); leftleg1.addBox(-1.5F, 11F, -3F, 1, 1, 1); leftleg1.setRotationPoint(0F, 0F, 0F); leftleg1.setTextureSize(64, 32); leftleg1.mirror = true; setRotation(leftleg1, 0F, 0F, 0F); leftleg2 = new ModelRenderer(this, 66, 13); leftleg2.addBox(3.5F, 11F, 2F, 1, 1, 1); leftleg2.setRotationPoint(0F, 0F, 0F); leftleg2.setTextureSize(64, 32); leftleg2.mirror = true; setRotation(leftleg2, 0F, 0F, 0F); leftleg3 = new ModelRenderer(this, 66, 15); leftleg3.addBox(0.5F, 11F, -3F, 1, 1, 1); leftleg3.setRotationPoint(0F, 0F, 0F); leftleg3.setTextureSize(64, 32); leftleg3.mirror = true; setRotation(leftleg3, 0F, 0F, 0F); rightleg2 = new ModelRenderer(this, 66, 17); rightleg2.addBox(0.5F, 11F, -3F, 1, 1, 1); rightleg2.setRotationPoint(0F, 0F, 0F); rightleg2.setTextureSize(64, 32); rightleg2.mirror = true; setRotation(rightleg2, 0F, 0F, 0F); rightleg3 = new ModelRenderer(this, 66, 19); rightleg3.addBox(-1.5F, 11F, -3F, 1, 1, 1); rightleg3.setRotationPoint(0F, 0F, 0F); rightleg3.setTextureSize(64, 32); rightleg3.mirror = true; setRotation(rightleg3, 0F, 0F, 0F); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); Head1.render(f5); Head2.render(f5); Head3.render(f5); Head4.render(f5); Head5.render(f5); Head6.render(f5); Head7.render(f5); Head8.render(f5); Head9.render(f5); Head10.render(f5); Head11.render(f5); Head12.render(f5); Head13.render(f5); Head14.render(f5); Head15.render(f5); Head16.render(f5); Head17.render(f5); Head18.render(f5); Head19.render(f5); Head20.render(f5); Head21.render(f5); Head22.render(f5); head_23.render(f5); leftarm1.render(f5); rightarm1.render(f5); leftarm2.render(f5); rightarm2.render(f5); body1.render(f5); body2.render(f5); body3.render(f5); body4.render(f5); body5.render(f5); body6.render(f5); body7.render(f5); body8.render(f5); body9.render(f5); body10.render(f5); body11.render(f5); body12.render(f5); body13.render(f5); body14.render(f5); body15.render(f5); body16.render(f5); body17.render(f5); body18.render(f5); body19.render(f5); body20.render(f5); body21.render(f5); rightleg1.render(f5); leftleg1.render(f5); leftleg2.render(f5); leftleg3.render(f5); rightleg2.render(f5); rightleg3.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } }
  7. Hello, I'm trying to make a custom armor that has a 3D model.. And i've been getting a crash on game startup.... Crash Report: http://pastebin.com/YqKcBjKg Client Proxy: public class ClientProxy extends ServerProxy{ private static final ModelRedFirePhoenixArmor redFirePhoenixArmorChest = new ModelRedFirePhoenixArmor(1.0f); private static final ModelRedFirePhoenixArmor redFirePhoenixArmor = new ModelRedFirePhoenixArmor(0.5f); public void init() { PhoenixCraftItems.registerRenders(); PhoenixCraftBlocks.registerRenders(); PhoenixCraftKeyBindings.init(); } @Override public ModelBiped getArmorModel(int id){ switch (id) { case 0: return redFirePhoenixArmorChest; case 1: return redFirePhoenixArmor; } return null; } } Server Proxy: public class ServerProxy{ public void init() { } public ModelBiped getArmorModel(int id){ return null; } }
  8. Alright i got the effect to activate when the button is pressed, but i'm still unsure how i could make sure that the player is wearing the chestplate ._.
  9. Well here's my current InputHandler, I'm pretty sure i'm messing this up royally as i'm not sure how to do this. Also how could i let the server know of this? package phonixe.phoenixcraft.network; import javax.annotation.Nullable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.InputEvent; import phonixe.phoenixcraft.init.PhoenixCraftItems; import phonixe.phoenixcraft.items.RedFirePhoenix_Chestplate; public class PhoenixCraftKeyInputHandler { private ItemStack ItemStack; @SubscribeEvent public void onKeyInput(InputEvent.KeyInputEvent event) { ItemStack itemstack = this.getItemStackFromSlot(EntityEquipmentSlot.CHEST); if(PhoenixCraftKeyBindings.flyWings.isPressed()) { if (itemstack.getItem() == PhoenixCraftItems.redfirephoenix_chestplate){ } } } public ItemStack getItemStackFromSlot(EntityEquipmentSlot slotIn) { return ItemStack; } public void setItemStackToSlot(EntityEquipmentSlot slotIn, @Nullable ItemStack stack) { } }
  10. Hello, I created a custom chestplate and i'd like to make the chestplate provide a special effect when a certain button is pressed, I'm not sure how could i do this.. KeyBindings Class: package phonixe.phoenixcraft.network; import org.lwjgl.input.Keyboard; import net.minecraft.client.settings.KeyBinding; import net.minecraftforge.fml.client.registry.ClientRegistry; public class PhoenixCraftKeyBindings { public static KeyBinding flyWings; public static void init() { flyWings = new KeyBinding("key.flyWings", Keyboard.KEY_R, "key.categories.phoenixcraft"); ClientRegistry.registerKeyBinding(flyWings); } } InputHandler: package phonixe.phoenixcraft.network; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemArmor; import net.minecraft.world.World; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.InputEvent; import phonixe.phoenixcraft.items.RedFirePhoenix_Chestplate; public class PhoenixCraftKeyInputHandler { @SubscribeEvent public void onKeyInput(InputEvent.KeyInputEvent event) { if(PhoenixCraftKeyBindings.flyWings.isPressed()) { } } }
  11. Thank you! I just ran the server again and it worked, I must've fixed it without realising.
  12. Reference : package phonixe.phoenixcraft; public class Reference { public static final String MOD_ID = "pc"; public static final String MOD_NAME = "PhoenixCraft"; public static final String VERSION = "0.1"; public static final String CLIENT_PROXY_CLASS = "phonixe.phoenixcraft.proxy.ClientProxy"; public static final String SERVER_PROXY_CLASS = "phonixe.phoenixcraft.proxy.ServerProxy"; } ClientProxy : package phonixe.phoenixcraft.proxy; import phonixe.phoenixcraft.init.PhoenixCraftBlocks; import phonixe.phoenixcraft.init.PhoenixCraftItems; public class ClientProxy implements CommonProxy { @Override public void init() { PhoenixCraftItems.registerRenders(); PhoenixCraftBlocks.registerRenders(); } } ServerProxy : package phonixe.phoenixcraft.proxy; import phonixe.phoenixcraft.init.PhoenixCraftEntities; import phonixe.phoenixcraft.init.PhoenixCraftTileEntities; import phonixe.phoenixcraft.network.GuiHandler; public class ServerProxy implements CommonProxy { @Override public void init() { } }
  13. I believe i have done everything correctly but here is the main class: package phonixe.phoenixcraft; import net.minecraft.creativetab.CreativeTabs; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.network.NetworkRegistry; import phonixe.phoenixcraft.init.PhoenixCraftBlocks; import phonixe.phoenixcraft.init.PhoenixCraftEntities; import phonixe.phoenixcraft.init.PhoenixCraftItems; import phonixe.phoenixcraft.init.PhoenixCraftTileEntities; import phonixe.phoenixcraft.network.GuiHandler; import phonixe.phoenixcraft.proxy.CommonProxy; @Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION) public class PhoenixCraft { @SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS) public static CommonProxy proxy; public static final CreativeTabs CREATIVE_TAB = new PhoenixCraftTab(); @Instance public static PhoenixCraft INSTANCE; @EventHandler public void preInit(FMLPreInitializationEvent event) { PhoenixCraftBlocks.init(); PhoenixCraftBlocks.register(); PhoenixCraftItems.init(); PhoenixCraftItems.register(); PhoenixCraftEntities.register(); PhoenixCraftTileEntities.register(); } @EventHandler public void Init(FMLInitializationEvent event) { NetworkRegistry.INSTANCE.registerGuiHandler(PhoenixCraft.INSTANCE, new GuiHandler()); proxy.init(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } } And here's the CommonProxy Class : package phonixe.phoenixcraft.proxy; public interface CommonProxy { public void init(); }
  14. Hello, I tried running my mod in a server and i got the following crash and i have no idea what could be causing this.. Crash Report: http://pastebin.com/bm83wwU3
  15. Well i updated to 1.10.2 from 1.8.9 and besides the endless number of other errors, i couldn't figure out a way to replace the old super.setBlockBounds from 1.8.9.
  16. I don't really have a reason, I just randomly went with 1.8. Should i switch to 1.10?
  17. Hello, so i tried to create a custom block that has an inventory with a gui, however whenever i right click the block the game crashes. Crash report : http://pastebin.com/vr4JeQwP Custom Block : Gui : Gui Handler : TE : Container :
  18. u_u Interractions: @Override public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { if (!worldIn.isRemote) { Entity entity = new EntityChair(worldIn, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D); worldIn.spawnEntityInWorld(entity); } super.onBlockPlacedBy(worldIn, pos, state, placer, stack); } @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn,EnumFacing side, float hitX, float hitY, float hitZ) { if (!worldIn.isRemote) { TileEntityChair id = (TileEntityChair) worldIn.getTileEntity(pos); WorldServer worldserver = (WorldServer) worldIn; playerIn.mountEntity(worldserver.getEntityFromUuid(id.ChairUUID)); } return super.onBlockActivated(worldIn, pos, state, playerIn, side, hitX, hitY, hitZ); } @Override public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { TileEntityChair id = (TileEntityChair) worldIn.getTileEntity(pos); WorldServer worldserver = (WorldServer) worldIn; worldserver.getEntityFromUuid(id.ChairUUID).setDead(); } super.onBlockDestroyedByPlayer(worldIn, pos, state); } TE: public class TileEntityChair extends TileEntity { public UUID ChairUUID; public void TileEntityChairID(UUID uuid, World world, int id) { EntityChair entity = (EntityChair) world.getEntityByID(id); uuid = entity.getPersistentID(); ChairUUID = uuid; } }
  19. Okay, this is embarassing but it still doesn't work ._. Here's the TE: public class TileEntityChair extends TileEntity { public UUID ChairUUID; public void TileEntityChairID(UUID uuid, World world, int id) { EntityChair entity = (EntityChair) world.getEntityByID(id); uuid = entity.getPersistentID(); ChairUUID = uuid; } And here's one of the interractions : @Override public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { if (!worldIn.isRemote) { TileEntityChair id = (TileEntityChair) worldIn.getTileEntity(pos); WorldServer worldserver = (WorldServer) worldIn; worldIn.spawnEntityInWorld(worldserver.getEntityFromUuid(id.ChairUUID)); } super.onBlockPlacedBy(worldIn, pos, state, placer, stack); }
  20. Sorry, I don't think i know how to do that..
×
×
  • Create New...

Important Information

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