Jump to content

Whyneb360

Members
  • Posts

    84
  • Joined

  • Last visited

Everything posted by Whyneb360

  1. I see... Hmm... If you were to make just a super basic block emit particle effects, how would you go about doing it?
  2. As I am not fluent in Java, or particularly good at Modding (yet , your class file doesn't help me much (also because you seem to be doing something more complicated than I am). I did manage to dig up my old mod - the on the worked with block particles, and launch it with the latest forge, but it doesn't work any more. Is there a new way to do particle effects?
  3. It had the green arrow next to it, indicating an Override, but I put one on top anyway - no difference. Thanks anyway though
  4. Thanks for your reply, I just tried messing around with that, but found that it didn't help me - particles still aren't appearing
  5. Hey everyone, I am trying to make particles spawn at a block, and have done it before in a mod I no longer have, but I can't seem to replicate it. My code is as follows: import java.util.Random; import com.descon.mod.DesconCreativeTabs; import com.descon.mod.Main; import com.descon.tileentity.TileEntityCampFire; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; public class CampfireProp extends BlockContainer{ public CampfireProp(Material material) { super(material); this.setCreativeTab(DesconCreativeTabs.tabGeneral); this.setLightLevel(0.7F); this.setHarvestLevel("axe", 1); this.setHardness(1F); this.setBlockBounds(0F, 0F, 0F, 1F, 0.125F, 1F); this.setBlockTextureName(Main.modID + ":" + "textures/blocks/campfire.png"); } public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) { float f = (float)p_149734_2_ + 0.5F; float f1 = (float)p_149734_3_ + 0.2F + p_149734_5_.nextFloat() * 3.0F / 8.0F; float f2 = (float)p_149734_4_ + 0.5F; float f3 = 0.0F; float f4 = p_149734_5_.nextFloat() * 0.0F - 0.0F; p_149734_1_.spawnParticle("smoke", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("flame", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("flame", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("flame", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("smoke", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); p_149734_1_.spawnParticle("flame", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); } public int getRenderType() { return -1; } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } @Override public TileEntity createNewTileEntity(World var1, int var2) { return new TileEntityCampFire(); } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister) { this.blockIcon = iconRegister.registerIcon(Main.modID + ":" + this.getUnlocalizedName().substring(5)); } } Do I need to reference it somewhere or add some extra code? Any help would be appreciated, -Whyneb
  6. Hello again everyone, I've taken a break from my armour modelling, but I have come back to it ready to make it work. As it stands, the model mostly works, but there are a couple of bits in the wrong places (for no reason I could figure out - not the rotation point) and the textures are being very weird Here are some pics(Click on them to see the full thing): http://elemental-imperium.wikia.com/wiki/Temp_Files As you can see, some of the textures are messed up especially on the head and legs, and bits of the helmet and shoes are a bit wonky. Here is my code also: Armour-Model Class: public class ElementalArmor extends ItemArmor{ public ElementalArmor(ArmorMaterial var1, int var2, int var3) { super(var1, var2, var3); } @Override @SideOnly(Side.CLIENT) public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { ModelBiped armorModel = null; if(itemStack != null){ if(itemStack.getItem() instanceof ElementalArmor){ int type = ((ItemArmor)itemStack.getItem()).armorType; if(type == 0) { armorModel = ElementalImperium.proxy.getArmorModel(0); } if(type == 1) { armorModel = ElementalImperium.proxy.getArmorModel(1); } if(type == 2) { armorModel = ElementalImperium.proxy.getArmorModel(2); } if(type == 3) { armorModel = ElementalImperium.proxy.getArmorModel(3); } } if(armorModel != null) { armorModel.bipedHead.showModel = armorSlot == 0; armorModel.bipedHeadwear.showModel = armorSlot == 0; armorModel.bipedBody.showModel = armorSlot == 1 || armorSlot == 2; armorModel.bipedRightArm.showModel = armorSlot == 1; armorModel.bipedLeftArm.showModel = armorSlot == 1; armorModel.bipedRightLeg.showModel = armorSlot == 2 || armorSlot == 3; armorModel.bipedLeftLeg.showModel = armorSlot == 2 || armorSlot == 3; armorModel.isSneak = entityLiving.isSneaking(); armorModel.isRiding = entityLiving.isRiding(); armorModel.isChild = entityLiving.isChild(); if(entityLiving instanceof EntityPlayer) { armorModel.aimedBow =((EntityPlayer)entityLiving).getItemInUseDuration() > 2; } } } return armorModel; } @Override public String getArmorTexture(ItemStack itemstack, Entity entity, int slot, String type) { if(itemstack != null) { if(itemstack.getItem() instanceof ElementalArmor) { int type1 = ((ItemArmor)itemstack.getItem()).armorType; if(type1 == 0) { return Constants.MODID + ":textures/armor/policeArmorHelmet.png"; } if(type1 == 1) { return Constants.MODID + ":textures/armor/policeArmorChest.png"; } if(type1 == 2) { return null; } if(type1 == 3) { return Constants.MODID + ":textures/armor/policeArmorBoots.png"; } } } return null; } } ClientProxy: private static final ModelRCPHelmet Helmet = new ModelRCPHelmet(1.3f); private static final ModelRCPChest Chest = new ModelRCPChest(1.0f); private static final ModelRCPChest Legs = new ModelRCPChest(0.5f); private static final ModelRCPBoots Boots = new ModelRCPBoots(1.0f); @Override public ModelBiped getArmorModel(int id) { switch (id) { case 0: return Helmet; case 1: return Chest; case 2: return Legs; case 3: return Boots; default: break; } return null; } } Helmet: public class ModelRCPHelmet extends ModelBiped { //fields ModelRenderer shape1; ModelRenderer shape2; ModelRenderer shape3; ModelRenderer shape4; ModelRenderer shape5; ModelRenderer shape6; ModelRenderer shape7; ModelRenderer shape8; ModelRenderer shape9; ModelRenderer shape10; ModelRenderer shape11; ModelRenderer shape12; ModelRenderer shape13; ModelRenderer shape14; ModelRenderer shape15; ModelRenderer shape16; ModelRenderer shape17; public ModelRCPHelmet(float f) { textureWidth = 64; textureHeight = 32; shape1 = new ModelRenderer(this, 42, 13); shape1.addBox(4.5F, -7.3F, -4.9F, 1, 8, 9); shape1.setRotationPoint(0F, 0F, 0F); shape1.setTextureSize(64, 32); shape1.mirror = true; setRotation(shape1, 0F, 0F, -0.1791871F); this.bipedHead.addChild(shape1); shape2 = new ModelRenderer(this, 42, 13); shape2.addBox(-5.5F, -7.3F, -4.9F, 1, 8, 9); shape2.setRotationPoint(0F, 0F, 0F); shape2.setTextureSize(64, 32); shape2.mirror = true; setRotation(shape2, 0F, 0F, 0.1826778F); this.bipedHead.addChild(shape2); shape3 = new ModelRenderer(this, 4, 13); shape3.addBox(-4.5F, -8F, -4.5F, 9, 1, 9); shape3.setRotationPoint(0F, 0F, 0F); shape3.setTextureSize(64, 32); shape3.mirror = true; setRotation(shape3, 0F, 0F, 0F); this.bipedHead.addChild(shape3); shape4 = new ModelRenderer(this, 7, 24); shape4.addBox(4F, -6.1F, 3.7F, 1, 7, 1); shape4.setRotationPoint(0F, 0F, 0F); shape4.setTextureSize(64, 32); shape4.mirror = true; setRotation(shape4, 0.1128646F, -1.583595F, -0.1477712F); this.bipedHead.addChild(shape4); shape5 = new ModelRenderer(this, 2, 24); shape5.addBox(3.8F, -6.1F, 3.7F, 1, 7, 1); shape5.setRotationPoint(0F, 0F, 0F); shape5.setTextureSize(64, 32); shape5.mirror = true; setRotation(shape5, 0.1128646F, 0F, -0.1245002F); this.bipedHead.addChild(shape5); shape6 = new ModelRenderer(this, 52, 1); shape6.addBox(-2F, -6F, -9F, 4, 1, 1); shape6.setRotationPoint(0F, 0F, 0F); shape6.setTextureSize(64, 32); shape6.mirror = true; setRotation(shape6, -0.6155194F, 0F, 0F); this.bipedHead.addChild(shape6); shape7 = new ModelRenderer(this, 58, 1); shape7.addBox(-1.5F, -5.2F, -9F, 1, 1, 1); shape7.setRotationPoint(0F, 0F, 0F); shape7.setTextureSize(64, 32); shape7.mirror = true; setRotation(shape7, -0.6155194F, 0F, 0F); this.bipedHead.addChild(shape7); shape8 = new ModelRenderer(this, 58, 1); shape8.addBox(0.5F, -5.2F, -9F, 1, 1, 1); shape8.setRotationPoint(0F, 0F, 0F); shape8.setTextureSize(64, 32); shape8.mirror = true; setRotation(shape8, -0.6155194F, 0F, 0F); this.bipedHead.addChild(shape8); shape9 = new ModelRenderer(this, 52, 1); shape9.addBox(-2F, -4.5F, -9F, 1, 1, 1); shape9.setRotationPoint(0F, 0F, 0F); shape9.setTextureSize(64, 32); shape9.mirror = true; setRotation(shape9, -0.6155194F, 0F, 0F); this.bipedHead.addChild(shape9); shape10 = new ModelRenderer(this, 55, 1); shape10.addBox(-1.5F, -3.8F, -9F, 1, 1, 1); shape10.setRotationPoint(0F, 0F, 0F); shape10.setTextureSize(64, 32); shape10.mirror = true; setRotation(shape10, -0.6155194F, 0F, 0F); this.bipedHead.addChild(shape10); shape11 = new ModelRenderer(this, 52, 1); shape11.addBox(1F, -4.5F, -9F, 1, 1, 1); shape11.setRotationPoint(0F, 0F, 0F); shape11.setTextureSize(64, 32); shape11.mirror = true; setRotation(shape11, -0.6155194F, 0F, 0F); this.bipedHead.addChild(shape11); shape12 = new ModelRenderer(this, 6, 13); shape12.addBox(-4F, -9.5F, -4F, 8, 1, ; shape12.setRotationPoint(0F, 0F, 0F); shape12.setTextureSize(64, 32); shape12.mirror = true; setRotation(shape12, 0F, 0F, 0F); this.bipedHead.addChild(shape12); shape13 = new ModelRenderer(this, 4, 13); shape13.addBox(-4.5F, -9F, -4.5F, 9, 1, 9); shape13.setRotationPoint(0F, 0F, 0F); shape13.setTextureSize(64, 32); shape13.mirror = true; setRotation(shape13, 0F, 0F, 0F); this.bipedHead.addChild(shape13); shape14 = new ModelRenderer(this, 44, 5); shape14.addBox(-2.5F, -9F, -0.5F, 5, 1, 4); shape14.setRotationPoint(0F, 0F, 0F); shape14.setTextureSize(64, 32); shape14.mirror = true; setRotation(shape14, 0.6981317F, 0F, 0F); this.bipedHead.addChild(shape14); shape15 = new ModelRenderer(this, 53, 1); shape15.addBox(0.5F, -3.8F, -9F, 1, 1, 1); shape15.setRotationPoint(0F, 0F, 0F); shape15.setTextureSize(64, 32); shape15.mirror = true; setRotation(shape15, -0.6155194F, 0F, 0F); this.bipedHead.addChild(shape15); shape16 = new ModelRenderer(this, 23, 24); shape16.addBox(-4F, -6.5F, 4.5F, 8, 7, 1); shape16.setRotationPoint(0F, 0F, 0F); shape16.setTextureSize(64, 32); shape16.mirror = true; setRotation(shape16, 0.1628974F, 0F, 0F); this.bipedHead.addChild(shape16); shape17 = new ModelRenderer(this, 0, 0); shape17.addBox(-5F, -8.5F, -5F, 10, 1, 10); shape17.setRotationPoint(0F, 0F, 0F); shape17.setTextureSize(64, 32); shape17.mirror = true; setRotation(shape17, 0F, 0F, 0F); this.bipedHead.addChild(shape17); } 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); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); } } Boots: public class ModelRCPBoots extends ModelBiped { //fields ModelRenderer shape1; ModelRenderer shape2; ModelRenderer shape3; ModelRenderer shape4; ModelRenderer shape5; ModelRenderer shape6; ModelRenderer shape7; ModelRenderer shape8; public ModelRCPBoots(float f) { textureWidth = 64; textureHeight = 32; shape1 = new ModelRenderer(this, 1, 22); shape1.addBox(-2.7F, 9F, -2.8F, 5, 3, 6); shape1.setRotationPoint(0F, 0F, 0F); shape1.setTextureSize(64, 32); shape1.mirror = true; setRotation(shape1, 0F, 0F, 0F); this.bipedRightLeg.addChild(shape1); shape2 = new ModelRenderer(this, 1, 12); shape2.addBox(-2.3F, 9F, -2.8F, 5, 3, 6); shape2.setRotationPoint(0F, 0F, 0F); shape2.setTextureSize(64, 32); shape2.mirror = true; setRotation(shape2, 0F, 0F, 0F); this.bipedLeftLeg.addChild(shape2); shape3 = new ModelRenderer(this, 24, 13); shape3.addBox(-1.5F, 7.5F, -3F, 3, 2, 1); shape3.setRotationPoint(0F, 0F, 0F); shape3.setTextureSize(64, 32); shape3.mirror = true; setRotation(shape3, 0F, 0F, 0F); this.bipedRightLeg.addChild(shape3); shape4 = new ModelRenderer(this, 24, 13); shape4.addBox(-1.5F, 7.5F, -3F, 3, 2, 1); shape4.setRotationPoint(0F, 0F, 0F); shape4.setTextureSize(64, 32); shape4.mirror = true; setRotation(shape4, 0F, 0F, 0F); this.bipedLeftLeg.addChild(shape4); shape5 = new ModelRenderer(this, 16, 2); shape5.addBox(-2.1F, 9.3F, -7.7F, 4, 1, 3); shape5.setRotationPoint(0F, 0F, 0F); shape5.setTextureSize(64, 32); shape5.mirror = true; setRotation(shape5, 0.1919862F, 0F, 0F); this.bipedRightLeg.addChild(shape5); shape6 = new ModelRenderer(this, 1, 2); shape6.addBox(-1.8F, 11F, -5.7F, 4, 1, 3); shape6.setRotationPoint(0F, 0F, 0F); shape6.setTextureSize(64, 32); shape6.mirror = true; setRotation(shape6, 0F, 0F, 0F); this.bipedLeftLeg.addChild(shape6); shape7 = new ModelRenderer(this, 1, 2); shape7.addBox(-6.2F, 11F, -5.7F, 4, 1, 3); shape7.setRotationPoint(0F, 0F, 0F); shape7.setTextureSize(64, 32); shape7.mirror = true; setRotation(shape7, 0F, 0F, 0F); this.bipedRightLeg.addChild(shape7); shape8 = new ModelRenderer(this, 16, 2); shape8.addBox(-1.9F, 9.3F, -7.7F, 4, 1, 3); shape8.setRotationPoint(0F, 0F, 0F); shape8.setTextureSize(64, 32); shape8.mirror = true; setRotation(shape8, 0.1919862F, 0F, 0F); this.bipedLeftLeg.addChild(shape8); } 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); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); } } Chest: public class ModelRCPChest extends ModelBiped { //fields ModelRenderer shape1; ModelRenderer shape2; ModelRenderer shape3; ModelRenderer shape4; ModelRenderer shape5; ModelRenderer shape6; ModelRenderer shape7; ModelRenderer shape8; ModelRenderer shape9; ModelRenderer shape10; ModelRenderer shpae11; ModelRenderer shpae12; ModelRenderer shpae13; ModelRenderer shape14; ModelRenderer shpaer15; ModelRenderer shpae16; ModelRenderer shpaer17; public ModelRCPChest(float f) { textureWidth = 64; textureHeight = 32; shape1 = new ModelRenderer(this, 38, 1); shape1.addBox(-4.5F, -4F, -3.5F, 6, 5, 7); shape1.setRotationPoint(0F, 0F, 0F); shape1.setTextureSize(64, 32); shape1.mirror = true; setRotation(shape1, 0F, 0F, -0.3490659F); this.bipedRightArm.addChild(shape1); shape2 = new ModelRenderer(this, 38, 1); shape2.addBox(-1.5F, -4F, -3.5F, 6, 5, 7); shape2.setRotationPoint(0F, 0F, 0F); shape2.setTextureSize(64, 32); shape2.mirror = true; setRotation(shape2, 0F, 0F, 0.3490659F); this.bipedLeftArm.addChild(shape2); shape3 = new ModelRenderer(this, 45, 14); shape3.addBox(-1.5F, 0F, -2.5F, 5, 7, 5); shape3.setRotationPoint(0F, 0F, 0F); shape3.setTextureSize(64, 32); shape3.mirror = true; setRotation(shape3, 0F, 0F, 0F); this.bipedLeftArm.addChild(shape3); shape4 = new ModelRenderer(this, 45, 14); shape4.addBox(-3.5F, 0F, -2.5F, 5, 7, 5); shape4.setRotationPoint(0F, 0F, 0F); shape4.setTextureSize(64, 32); shape4.mirror = true; setRotation(shape4, 0F, 0F, 0F); this.bipedRightArm.addChild(shape4); shape5 = new ModelRenderer(this, 1, 15); shape5.addBox(-4.5F, 0F, -2.5F, 9, 11, 5); shape5.setRotationPoint(0F, 0F, 0F); shape5.setTextureSize(64, 32); shape5.mirror = true; setRotation(shape5, 0F, 0F, 0F); this.bipedBody.addChild(shape5); shape6 = new ModelRenderer(this, 1, 7); shape6.addBox(-5F, 8F, -3F, 10, 1, 6); shape6.setRotationPoint(0F, 0F, 0F); shape6.setTextureSize(64, 32); shape6.mirror = true; setRotation(shape6, 0F, 0F, 0F); this.bipedBody.addChild(shape6); shape7 = new ModelRenderer(this, 1, 7); shape7.addBox(-5F, 5F, -3F, 10, 1, 6); shape7.setRotationPoint(0F, 0F, 0F); shape7.setTextureSize(64, 32); shape7.mirror = true; setRotation(shape7, 0F, 0F, 0F); this.bipedBody.addChild(shape7); shape8 = new ModelRenderer(this, 1, 7); shape8.addBox(-5F, 2F, -3F, 10, 1, 6); shape8.setRotationPoint(0F, 0F, 0F); shape8.setTextureSize(64, 32); shape8.mirror = true; setRotation(shape8, 0F, 0F, 0F); this.bipedBody.addChild(shape8); shape9 = new ModelRenderer(this, 1, 7); shape9.addBox(-5F, 11F, -3F, 10, 1, 6); shape9.setRotationPoint(0F, 0F, 0F); shape9.setTextureSize(64, 32); shape9.mirror = true; setRotation(shape9, 0F, 0F, 0F); this.bipedBody.addChild(shape9); shape10 = new ModelRenderer(this, 1, 0); shape10.addBox(2.4F, 3.4F, -6.4F, 1, 3, 3); shape10.setRotationPoint(0F, 0F, 0F); shape10.setTextureSize(64, 32); shape10.mirror = true; setRotation(shape10, 0.7853982F, 0F, 0F); this.bipedLeftArm.addChild(shape10); shpae11 = new ModelRenderer(this, 1, 0); shpae11.addBox(-3.4F, 3.4F, -6.4F, 1, 3, 3); shpae11.setRotationPoint(0F, 0F, 0F); shpae11.setTextureSize(64, 32); shpae11.mirror = true; setRotation(shpae11, 0.7853982F, 0F, 0F); this.bipedRightArm.addChild(shpae11); shpae12 = new ModelRenderer(this, 10, 1); shpae12.addBox(3F, -0.5F, 3F, 2, 2, 1); shpae12.setRotationPoint(0F, 0F, 0F); shpae12.setTextureSize(64, 32); shpae12.mirror = true; setRotation(shpae12, 0F, 0F, 0.7853982F); this.bipedBody.addChild(shpae12); shpae13 = new ModelRenderer(this, 10, 1); shpae13.addBox(5F, 2F, 3F, 2, 2, 1); shpae13.setRotationPoint(0F, 0F, 0F); shpae13.setTextureSize(64, 32); shpae13.mirror = true; setRotation(shpae13, 0F, 0F, 0.7853982F); this.bipedBody.addChild(shpae13); shape14 = new ModelRenderer(this, 10, 1); shape14.addBox(-0.2F, 2.7F, 3F, 2, 2, 1); shape14.setRotationPoint(0F, 0F, 0F); shape14.setTextureSize(64, 32); shape14.mirror = true; setRotation(shape14, 0F, 0F, 0.7853982F); this.bipedBody.addChild(shape14); shpaer15 = new ModelRenderer(this, 10, 1); shpaer15.addBox(2.3F, 4.8F, 3F, 2, 2, 1); shpaer15.setRotationPoint(0F, 0F, 0F); shpaer15.setTextureSize(64, 32); shpaer15.mirror = true; setRotation(shpaer15, 0F, 0F, 0.7853982F); this.bipedBody.addChild(shpaer15); shpae16 = new ModelRenderer(this, 31, 15); shpae16.addBox(-2.8F, 12F, -2.5F, 1, 5, 5); shpae16.setRotationPoint(0F, 0F, 0F); shpae16.setTextureSize(64, 32); shpae16.mirror = true; setRotation(shpae16, 0F, 0F, 0.1745329F); this.bipedBody.addChild(shpae16); shpaer17 = new ModelRenderer(this, 31, 15); shpaer17.addBox(1.8F, 11.9F, -2.5F, 1, 5, 5); shpaer17.setRotationPoint(0F, 0F, 0F); shpaer17.setTextureSize(64, 32); shpaer17.mirror = true; setRotation(shpaer17, 0F, 0F, -0.1745329F); this.bipedBody.addChild(shpaer17); } 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); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); } } and that should be it Thanks in advance, -Whyneb360
  7. Okay guys, I figured it out. Thank you so much for your help, and if anyone at all wants to know how to do this, I will post a tutorial on my mod's wikia page (Though it may take a week or so) Thanks - Whyneb360
  8. Sure thing: http://elemental-imperium.wikia.com/wiki/Temp_Files This should be all you need By the way, I have discovered that the arms of the armor don't move with my arms. Is there a way to fix this? Thanks, - Whyneb360
  9. Okay, so after lots of trial and error, I have this: public class ElementalArmor extends ItemArmor{ public ElementalArmor(ArmorMaterial var1, int var2, int var3) { super(var1, var2, var3); } public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { if(itemStack != null) { if(itemStack.getItem() instanceof ElementalArmor) { int type = ((ItemArmor)itemStack.getItem()).armorType; if(type == 0) { return null; } if(type == 1) { return new ModelRCPChest(); } if(type == 2) { return null; } if(type == 3) { return null; } } } return null; } @Override public String getArmorTexture(ItemStack itemstack, Entity entity, int slot, String type) { if(itemstack != null) { if(itemstack.getItem() instanceof ElementalArmor) { int type1 = ((ItemArmor)itemstack.getItem()).armorType; if(type1 == 0) { return null; } if(type1 == 1) { return Constants.MODID + ":textures/armor/policeArmorChest.png"; } if(type1 == 2) { return null; } if(type1 == 3) { return null; } } } return null; } } and it works... sort of. The texture is working, and the model is there, but aside from rendering the model that I want for the chest, it also adds random parts of the textures to the legs and head. So to summarise, model and texture work, but extra stuff appears for no apparent reason.
  10. Sure: public class ModelRCPChest extends ModelBiped { //fields ModelRenderer shape1; ModelRenderer shape2; ModelRenderer shape3; ModelRenderer shape4; ModelRenderer shape5; ModelRenderer shape6; ModelRenderer shape7; ModelRenderer shape8; ModelRenderer shape9; ModelRenderer shape10; ModelRenderer shpae11; ModelRenderer shpae12; ModelRenderer shpae13; ModelRenderer shape14; ModelRenderer shpaer15; ModelRenderer shpae16; ModelRenderer shpaer17; public ModelRCPChest() { textureWidth = 64; textureHeight = 32; shape1 = new ModelRenderer(this, 38, 1); shape1.addBox(-4.5F, -4F, -3.5F, 6, 5, 7); shape1.setRotationPoint(-5F, 2F, 0F); shape1.setTextureSize(64, 32); shape1.mirror = true; setRotation(shape1, 0F, 0F, -0.3490659F); shape2 = new ModelRenderer(this, 38, 1); shape2.addBox(-1.5F, -4F, -3.5F, 6, 5, 7); shape2.setRotationPoint(5F, 2F, 0F); shape2.setTextureSize(64, 32); shape2.mirror = true; setRotation(shape2, 0F, 0F, 0.3490659F); shape3 = new ModelRenderer(this, 45, 14); shape3.addBox(-0.5F, 0F, -2.5F, 4, 7, 5); shape3.setRotationPoint(5F, 2F, 0F); shape3.setTextureSize(64, 32); shape3.mirror = true; setRotation(shape3, 0F, 0F, 0F); shape4 = new ModelRenderer(this, 45, 14); shape4.addBox(-3.5F, 0F, -2.5F, 4, 7, 5); shape4.setRotationPoint(-5F, 2F, 0F); shape4.setTextureSize(64, 32); shape4.mirror = true; setRotation(shape4, 0F, 0F, 0F); shape5 = new ModelRenderer(this, 1, 15); shape5.addBox(-4.5F, 0F, -2.5F, 9, 11, 5); shape5.setRotationPoint(0F, 0F, 0F); shape5.setTextureSize(64, 32); shape5.mirror = true; setRotation(shape5, 0F, 0F, 0F); shape6 = new ModelRenderer(this, 1, 7); shape6.addBox(-5F, 8F, -3F, 10, 1, 6); shape6.setRotationPoint(0F, 0F, 0F); shape6.setTextureSize(64, 32); shape6.mirror = true; setRotation(shape6, 0F, 0F, 0F); shape7 = new ModelRenderer(this, 1, 7); shape7.addBox(-5F, 5F, -3F, 10, 1, 6); shape7.setRotationPoint(0F, 0F, 0F); shape7.setTextureSize(64, 32); shape7.mirror = true; setRotation(shape7, 0F, 0F, 0F); shape8 = new ModelRenderer(this, 1, 7); shape8.addBox(-5F, 2F, -3F, 10, 1, 6); shape8.setRotationPoint(0F, 0F, 0F); shape8.setTextureSize(64, 32); shape8.mirror = true; setRotation(shape8, 0F, 0F, 0F); shape9 = new ModelRenderer(this, 1, 7); shape9.addBox(-5F, 11F, -3F, 10, 1, 6); shape9.setRotationPoint(0F, 0F, 0F); shape9.setTextureSize(64, 32); shape9.mirror = true; setRotation(shape9, 0F, 0F, 0F); shape10 = new ModelRenderer(this, 1, 0); shape10.addBox(2.4F, 3.4F, -6.4F, 1, 3, 3); shape10.setRotationPoint(5F, 2F, 0F); shape10.setTextureSize(64, 32); shape10.mirror = true; setRotation(shape10, 0.7853982F, 0F, 0F); shpae11 = new ModelRenderer(this, 1, 0); shpae11.addBox(-3.4F, 3.4F, -6.4F, 1, 3, 3); shpae11.setRotationPoint(-5F, 2F, 0F); shpae11.setTextureSize(64, 32); shpae11.mirror = true; setRotation(shpae11, 0.7853982F, 0F, 0F); shpae12 = new ModelRenderer(this, 10, 1); shpae12.addBox(3F, -0.5F, 3F, 2, 2, 1); shpae12.setRotationPoint(0F, 0F, 0F); shpae12.setTextureSize(64, 32); shpae12.mirror = true; setRotation(shpae12, 0F, 0F, 0.7853982F); shpae13 = new ModelRenderer(this, 10, 1); shpae13.addBox(5F, 2F, 3F, 2, 2, 1); shpae13.setRotationPoint(0F, 0F, 0F); shpae13.setTextureSize(64, 32); shpae13.mirror = true; setRotation(shpae13, 0F, 0F, 0.7853982F); shape14 = new ModelRenderer(this, 10, 1); shape14.addBox(-0.2F, 2.7F, 3F, 2, 2, 1); shape14.setRotationPoint(0F, 0F, 0F); shape14.setTextureSize(64, 32); shape14.mirror = true; setRotation(shape14, 0F, 0F, 0.7853982F); shpaer15 = new ModelRenderer(this, 10, 1); shpaer15.addBox(2.3F, 4.8F, 3F, 2, 2, 1); shpaer15.setRotationPoint(0F, 0F, 0F); shpaer15.setTextureSize(64, 32); shpaer15.mirror = true; setRotation(shpaer15, 0F, 0F, 0.7853982F); shpae16 = new ModelRenderer(this, 31, 15); shpae16.addBox(-2.8F, 12F, -2.5F, 1, 5, 5); shpae16.setRotationPoint(0F, 0F, 0F); shpae16.setTextureSize(64, 32); shpae16.mirror = true; setRotation(shpae16, 0F, 0F, 0.1745329F); shpaer17 = new ModelRenderer(this, 31, 15); shpaer17.addBox(1.8F, 11.9F, -2.5F, 1, 5, 5); shpaer17.setRotationPoint(0F, 0F, 0F); shpaer17.setTextureSize(64, 32); shpaer17.mirror = true; setRotation(shpaer17, 0F, 0F, -0.1745329F); } 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); shape1.render(f5); shape2.render(f5); shape3.render(f5); shape4.render(f5); shape5.render(f5); shape6.render(f5); shape7.render(f5); shape8.render(f5); shape9.render(f5); shape10.render(f5); shpae11.render(f5); shpae12.render(f5); shpae13.render(f5); shape14.render(f5); shpaer15.render(f5); shpae16.render(f5); shpaer17.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); } } There you go EDIT: Okay, so I redid the model code (and changed it above), and now it renders the model, but it is a bit small, the arms don't move, and it is still textured as the white leather armour
  11. As a result of the getArmorModel method? I am now. Tested that out in the game, and odd things ensued - The default white leather armor became part of my skin, but that was sadly not what I was looking for.
  12. I can't make the model class static, but I am also unsure as to what you mean when you say 'bipedHeadwear' Is this another method I have to create, or something I have to reference? Thanks
  13. No, should it be? EDIT: Sorry, I thought you were referring to the method. Yes, my Model class is public, but not static: public ModelRCPChest() { textureWidth = 64; textureHeight = 32;
  14. How do I reference my model? When I try and return it, it comes back saying that it can't be resolved to a variable even after I imported it. Any suggestions?
  15. Do I put the method in the armour class, or under the item itself in my items class (that has all the items for my mod)? Also, where do I translate it and set the texture? P.S. If you could supply some example code, it would definitely help Thanks, - Whyneb360
  16. Thanks, but could you please explain this further?
  17. Hello again everyone As the title says, I was wandering how you would give a piece of armour a custom model. I already have the armour piece, and it can be equipped/is working fine, and I have a Techne model that I have imported into eclipse and fixed up, but where do I go from there? Any help is greatly appreciated, -Whyneb360
  18. How would I register a keybinding in the ClientProxy?
  19. Thank you, Could you please supply a link to where I can learn more about these packets?
  20. When I try and launch my mod from a server, it just crashes and says that it can't find the keybindings class. My class is as follows: public static final int TOGGLEBENDING = 0; private static final String[] desc = {"Toggle Bending"}; private static final int[] keyValues = {Keyboard.KEY_X}; private final KeyBinding[] keys; public static boolean BendingActive; public ToggleBending() { keys = new KeyBinding[desc.length]; for (int i = 0; i < desc.length; ++i) { keys[i] = new KeyBinding(desc[i], keyValues[i], "Elemental Imperium"); ClientRegistry.registerKeyBinding(keys[i]); } } @SideOnly(Side.CLIENT) @SubscribeEvent public void onKeyInput(KeyInputEvent event) { if (keys[TOGGLEBENDING].isPressed()) { if (BendingActive) { BendingActive = false; System.out.println("Bending Activated"); Minecraft.getMinecraft().thePlayer.sendChatMessage("Bending Activated"); }else{ BendingActive = true; System.out.println("Bending Dectivated"); Minecraft.getMinecraft().thePlayer.sendChatMessage("Bending Deactivated"); } } } And my crash report from the server is: ---- Minecraft Crash Report ---- // Don't do that. Time: 26/10/14 12:12 PM Description: Exception in server tick loop cpw.mods.fml.common.LoaderException: java.lang.NoClassDefFoundError: net/minecraft/client/settings/KeyBinding at cpw.mods.fml.common.LoadController.transition(LoadController.java:162) at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:515) at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:88) at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:314) at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:117) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:387) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685) Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/settings/KeyBinding at com.elementalimperium.bending.ToggleBending.<init>(ToggleBending.java:27) at com.elementalimperium.ElementalImperium.preInit(ElementalImperium.java:47) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118) at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:513) ... 5 more Caused by: java.lang.ClassNotFoundException: net.minecraft.client.settings.KeyBinding at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 34 more Caused by: java.lang.NullPointerException A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.7.0_67, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 244839904 bytes (233 MB) / 376963072 bytes (359 MB) up to 1908932608 bytes (1820 MB) JVM Flags: 2 total; -Xmx2G -XX:MaxPermSize=256M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.05 FML v7.10.85.1232 Minecraft Forge 10.13.2.1232 4 mods loaded, 4 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized FML{7.10.85.1232} [Forge Mod Loader] (forge-1.7.10-10.13.2.1232-universal.jar) Unloaded->Constructed->Pre-initialized Forge{10.13.2.1232} [Minecraft Forge] (forge-1.7.10-10.13.2.1232-universal.jar) Unloaded->Constructed->Pre-initialized elementalimperium{Dev Build 0.1.0.0} [Elemental Imperium] (Elemental_Imperium_DevBuild-0.1.0.7.jar) Unloaded->Constructed->Errored Profiler Position: N/A (disabled) Is Modded: Definitely; Server brand changed to 'fml,forge' Type: Dedicated Server (map_server.txt) Also, does anyone know how to send a chat message TO the player (Instead of from the player)? Thanks in advance -Whyneb360
  21. So, my code is as follows: public class Glider extends Item { private String[] name = {"staff", "glider"}; @SideOnly(Side.CLIENT) private IIcon[] icons; public static final int TOGGLEGLIDER = 0; private static final String[] desc = {"Open/Close Glider"}; private static final int[] keyValues = {Keyboard.KEY_R}; private final KeyBinding[] keys; public static boolean GliderActive; private ItemStack Glider; public Glider() { keys = new KeyBinding[desc.length]; for (int i = 0; i < desc.length; ++i) { keys[i] = new KeyBinding(desc[i], keyValues[i], "Elemental Imperium"); ClientRegistry.registerKeyBinding(keys[i]); setUnlocalizedName(Constants.MODID + "_" + "test"); setHasSubtypes(true); setCreativeTab(ElementalCreativeTab.elementalimperium); setMaxStackSize(1); setFull3D(); } } @Override public String getUnlocalizedName(ItemStack par1ItemStack) { int metadata = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, 15); return super.getUnlocalizedName() + "." + name[metadata]; } @SideOnly(Side.CLIENT) @Override public void registerIcons(IIconRegister par1IconRegister) { icons = new IIcon[name.length]; for (int i = 0; i < icons.length; i++) { icons [i] = par1IconRegister.registerIcon(Constants.MODID + ":" + "test" + " " + name[i]); } } @Override public IIcon getIconFromDamage(int par1) { return icons[par1]; } @SuppressWarnings ({"unchecked", "rawtypes" }) @SideOnly(Side.CLIENT) @Override public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { for (int x = 0; x < name.length; x++) { par3List.add(new ItemStack(this, 1, x)); } } @SubscribeEvent public void onKeyInput(KeyInputEvent event) { if (keys[TOGGLEGLIDER].isPressed()) { if (GliderActive) { GliderActive = false; System.out.println("Glider Deployed"); }else{ GliderActive = true; System.out.println("Glider Restracted"); } } } } Okay, so what I am trying to do in the last bit is change the metadata on the key-press of 'R'. I've been told I need to use a packet, and was wondering if anyone could link me to, or supply something that would help me. Any help would be useful Thanks in advance -Whyneb360
  22. Now I have done this: @SubscribeEvent public void onKeyInput(KeyInputEvent event) { if (keys[TOGGLEGLIDER].isPressed()) { if (GliderActive) { GliderActive = false; setDamage(ElementalImperium.Test, 0); System.out.println("Glider Deployed"); }else{ GliderActive = true; setDamage(ElementalImperium.Test, 1); System.out.println("Glider Restracted"); } } } public void setDamage(Item test, int i) { } } and that works for the println, but not the setDamage. Did I reference the item wrong? Thanks for bearing with me
  23. When I try to do that, it gives an error in eclipse: x Incompatible operand types ItemStack and Glider Any suggestions?
  24. Thanks, but how would I go about doing this?
  25. My problem is as the title says. I am trying to change an items metadata on a key-press. My current code is as follows (apologies in advance, but I can't seem to get the insert code function to work): public class GliderKeybinding { public static final int TOGGLEGLIDER = 0; private static final String[] desc = {"Open/Close Glider"}; private static final int[] keyValues = {Keyboard.KEY_R}; private final KeyBinding[] keys; public boolean GliderActive; public GliderKeybinding() { keys = new KeyBinding[desc.length]; for (int i = 0; i < desc.length; ++i) { keys = new KeyBinding(desc, keyValues, "Elemental Imperium"); ClientRegistry.registerKeyBinding(keys); } } public void onKeyInput(KeyInputEvent event, ItemStack par1itemstack, World par2world, EntityPlayer par3player) { if (keys[TOGGLEGLIDER].isPressed() && Minecraft.getMinecraft().thePlayer.inventory.getItemStack() == par1itemstack) { if (GliderActive) { GliderActive = false; setDamage(par1itemstack, 1); }else{ GliderActive = true; setDamage(par1itemstack, 0); } } } private void setDamage(ItemStack par1itemstack, int i) { } } ===== And I have registered it as:====== FMLCommonHandler.instance().bus().register(new GliderKeybinding()); What have I done wrong? Many thanks in advance, - Whyneb360
×
×
  • Create New...

Important Information

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