Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Awex

Members
  • Posts

    11
  • Joined

  • Last visited

1 Follower

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Awex's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. Is there anyway I could get support on fixing this NPE that's thrown? https://github.com/Awex0101/Justice-MC/issues/1
  2. I think I might just make it so you equip armor by right clicking it then.
  3. Thanks, I was updating from 1.7.10 to 1.11.2 if you couldn't tell :P. Anyway, do you know anything about having one piece equip the full model?
  4. I want to make it so when you equip a chest plate it shows the model for the entire suit of armor. Armor Handler package com.awex.handlers; import com.awex.heros.HalJordan; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.Item; import net.minecraftforge.fml.common.registry.GameRegistry; import static com.awex.Main.HJArmor; public class ArmorHandler { public static Item HalJordanArmor; public static void CreateItems() { GameRegistry.register(HalJordanArmor = new HalJordan("HJArmor", HJArmor, "HJ", EntityEquipmentSlot.CHEST)); } } HalJordan.java package com.awex.heros; import com.awex.Main; import com.awex.proxy.ClientProxy; import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class HalJordan extends ItemArmor{ public String textureName; public HalJordan(String unlocalizedName, ArmorMaterial material, String textureName, EntityEquipmentSlot slot) { super(material, 0, slot); this.textureName = textureName; this.setUnlocalizedName(unlocalizedName); this.setRegistryName(Main.MODID + ":" + unlocalizedName); } @Override public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) { return Main.MODID + ":textures/items/armor/hj.png"; } @Override @SideOnly(Side.CLIENT) public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, EntityEquipmentSlot armorSlot, ModelBiped original) { ModelBiped armorModel; if (itemStack != null) { armorModel = ClientProxy.getArmorModel(0); if (armorModel != null) { armorModel.setModelAttributes(original); return armorModel; } } return null; } } HalJordanModel.java package com.awex.heros; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class HalJordanModel extends ModelBiped { public ModelRenderer LeftArm; public ModelRenderer RightLeg; public ModelRenderer Head; public ModelRenderer Torso; public ModelRenderer RightArm; public ModelRenderer LeftLeg; public HalJordanModel(float scale) { super(scale, 0, 64, 64); this.textureWidth = 64; this.textureHeight = 32; showModel(); this.RightLeg = new ModelRenderer(this, 0, 16); this.RightLeg.mirror = true; this.RightLeg.setRotationPoint(1.9F, 12.0F, 0.0F); this.RightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F); this.RightArm = new ModelRenderer(this, 40, 16); this.RightArm.mirror = true; this.RightArm.setRotationPoint(5.0F, 2.0F, 0.0F); this.RightArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, 0.0F); this.LeftArm = new ModelRenderer(this, 40, 16); this.LeftArm.setRotationPoint(-5.0F, 2.0F, 0.0F); this.LeftArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, 0.0F); this.LeftLeg = new ModelRenderer(this, 0, 16); this.LeftLeg.setRotationPoint(-1.9F, 12.0F, 0.0F); this.LeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F); this.Head = new ModelRenderer(this, 0, 0); this.Head.setRotationPoint(0.0F, 0.0F, 0.0F); this.Head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.0F); this.Torso = new ModelRenderer(this, 16, 16); this.Torso.setRotationPoint(0.0F, 0.0F, 0.0F); this.Torso.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, 0.0F); } @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { showModel(); setRotationAngles(f, f1, f2, f3, f4, f5, entity); super.render(entity, f, f1, f2, f3, f4, f5); } public void showModel(){ this.bipedHead.showModel = true; this.bipedHeadwear.showModel = true; this.bipedBody.showModel = true; this.bipedRightArm.showModel = true; this.bipedLeftArm.showModel = true; this.bipedRightLeg.showModel = true; this.bipedLeftLeg.showModel = true; } public void setRotation(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; } } ClientProxy.java package com.awex.proxy; import com.awex.Main; import com.awex.heros.HalJordanModel; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; public class ClientProxy extends CommonProxy { private static final ModelBiped bipedBase = new ModelBiped(0.2F); private static final HalJordanModel haljordan = new HalJordanModel(0.2F); @Override public void preInit(FMLPreInitializationEvent e) { super.preInit(e); } @Override public void init(FMLInitializationEvent e) { super.init(e); } @Override public void postInit(FMLPostInitializationEvent e) { super.postInit(e); } public static ModelBiped getArmorModel(int id) { switch (id) { case 0: return bipedBase; case 1: return haljordan; default: break; } return bipedBase; //default, if whenever you should have passed on a wrong id } } } @Override public void registerItemRenderer(Item item, int meta, String id) { ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(Main.MODID + ":" + id, "inventory")); } } Main.java package com.awex; import com.awex.tabs.DCMultiverse; import com.awex.proxy.CommonProxy; import net.minecraft.init.SoundEvents; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor; import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.fml.common.Mod; 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; @Mod(modid = Main.MODID, version = Main.VERSION) public class Main { public static final String MODID = "awex"; public static final String VERSION = "1.0.1"; public static final DCMultiverse DC_MULTIVERSE = new DCMultiverse(); /** * ============== * Tools Sections * ============== */ public static final Item.ToolMaterial NthmetalToolMaterial = EnumHelper.addToolMaterial("nthmetalToolMaterial", 5, 4096, 14.0F, 5.0F, 40); public static final ItemArmor.ArmorMaterial HJArmor = EnumHelper.addArmorMaterial("HJArmor", MODID + ";hjarmor", 0, new int[] {0, 0, 12, 0}, 0, SoundEvents.ENTITY_FIREWORK_TWINKLE_FAR, 0.0F); /** ============== * Proxy ==============*/ @SidedProxy(clientSide="com.awex.proxy.ClientProxy", serverSide="com.awex.proxy.ServerProxy") public static CommonProxy proxy; /** * ============== * Initialization * ============== */ @Mod.EventHandler public void preInit(FMLPreInitializationEvent e) { proxy.preInit(e); } @Mod.EventHandler public void init(FMLInitializationEvent e) { proxy.init(e); } @Mod.EventHandler public void postInit(FMLPostInitializationEvent e) { proxy.postInit(e); } /** * ============== * End :) * ============== */ }
  5. It's no different in 1.10.2 It actually is more annoying.
  6. package com.awex; import com.awex.tabs.MaterialTab; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import com.awex.proxy.CommonProxy; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor; import net.minecraftforge.common.util.EnumHelper; @Mod(modid = Main.MODID, version = Main.VERSION) public class Main { public static final String MODID = "awex"; public static final String VERSION = "1.0.1"; public static final MaterialTab creativeTabMaterial = new MaterialTab(); /** * ============== * Tools Sections * ============== */ public static final Item.ToolMaterial AluminiumToolMaterial = EnumHelper.addToolMaterial("aluminiumToolMaterial", 2, 512, 5.0F, 1.0F, 14); public static final Item.ToolMaterial TinToolMaterial = EnumHelper.addToolMaterial("tinToolMaterial", 2, 768, 5.0F, 1.4F, 19); public static final Item.ToolMaterial CopperToolMaterial = EnumHelper.addToolMaterial("copperToolMaterial", 2, 1024, 6.0F, 1.8F, 19); public static final Item.ToolMaterial LimoniteToolMaterial = EnumHelper.addToolMaterial("limoniteToolMaterial", 2, 1280, 6.0F, 2.2F, 19); public static final Item.ToolMaterial BronzeToolMaterial = EnumHelper.addToolMaterial("bronzeToolMaterial", 3, 1536, 7.0F, 2.6F, 17); public static final Item.ToolMaterial TungstenToolMaterial = EnumHelper.addToolMaterial("tungstenToolMaterial", 3, 1792, 8.0F, 3.0F, 22); public static final Item.ToolMaterial MagnesiumToolMaterial = EnumHelper.addToolMaterial("magnesiumToolMaterial", 3, 2048, 9.0F, 3.4F, 22); public static final Item.ToolMaterial SteelToolMaterial = EnumHelper.addToolMaterial("steelToolMaterial", 3, 2304, 10.0F, 3.8F, 15); public static final Item.ToolMaterial TitaniumToolMaterial = EnumHelper.addToolMaterial("titaniumToolMaterial", 4, 2560, 11.0F, 4.2F, 20); public static final Item.ToolMaterial PlatinumToolMaterial = EnumHelper.addToolMaterial("platinumToolMaterial", 4, 3072, 12.0F, 4.6F, 22); public static final Item.ToolMaterial NthmetalToolMaterial = EnumHelper.addToolMaterial("nthmetalToolMaterial", 5, 4096, 14.0F, 5.0F, 40); public static ItemArmor.ArmorMaterial HJArmor = EnumHelper.addArmorMaterial("HJArmor", 42, new int[] {5, 10, 8, 4}, 5); /** * ============== * Proxy * ============== */ @SidedProxy(clientSide="com.awex.proxy.ClientProxy", serverSide="com.awex.proxy.ServerProxy") public static CommonProxy proxy; /** * ============== * Initialization * ============== */ @EventHandler public void preInit(FMLPreInitializationEvent e) { proxy.preInit(e); } @EventHandler public void init(FMLInitializationEvent e) { proxy.init(e); } @EventHandler public void postInit(FMLPostInitializationEvent e) { proxy.postInit(e); } /** * ============== * End :) * ============== */ } Main Class ^ package com.awex.proxy; import com.awex.heros.HalJordanModel; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import net.minecraft.client.model.ModelBiped; public class ClientProxy extends CommonProxy { private static final ModelBiped bipedBase = new ModelBiped(0.2F); private static final HalJordanModel haljordan = new HalJordanModel(0.2F); @Override public void preInit(FMLPreInitializationEvent e) { super.preInit(e); } @Override public void init(FMLInitializationEvent e) { super.init(e); } @Override public void postInit(FMLPostInitializationEvent e) { super.postInit(e); } public static ModelBiped getArmorModel(int id) { switch (id) { case 0: return bipedBase; case 1: return haljordan; default: break; } return bipedBase; //default, if whenever you should have passed on a wrong id } } } } ClientProxy ^ package com.awex.heros; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class HalJordanModel extends ModelBiped { public ModelRenderer LeftArm; public ModelRenderer RightLeg; public ModelRenderer Head; public ModelRenderer Torso; public ModelRenderer RightArm; public ModelRenderer LeftLeg; public HalJordanModel(float scale){ super(scale, 0, 64, 64); this.textureWidth = 64; this.textureHeight = 64; this.RightLeg = new ModelRenderer(this, 0, 16); this.RightLeg.mirror = true; this.RightLeg.setRotationPoint(1.9F, 12.0F, 0.0F); this.RightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F); this.RightArm = new ModelRenderer(this, 40, 16); this.RightArm.mirror = true; this.RightArm.setRotationPoint(5.0F, 2.0F, 0.0F); this.RightArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, 0.0F); this.LeftArm = new ModelRenderer(this, 40, 16); this.LeftArm.setRotationPoint(-5.0F, 2.0F, 0.0F); this.LeftArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, 0.0F); this.LeftLeg = new ModelRenderer(this, 0, 16); this.LeftLeg.setRotationPoint(-1.9F, 12.0F, 0.0F); this.LeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F); this.Head = new ModelRenderer(this, 0, 0); this.Head.setRotationPoint(0.0F, 0.0F, 0.0F); this.Head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.0F); this.Torso = new ModelRenderer(this, 16, 16); this.Torso.setRotationPoint(0.0F, 0.0F, 0.0F); this.Torso.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, 0.0F); bipedHeadwear.addChild(Head); bipedHead.addChild(Head); bipedBody.addChild(Torso); bipedLeftArm.addChild(LeftArm); bipedRightArm.addChild(RightArm); bipedLeftLeg.addChild(LeftLeg); bipedRightLeg.addChild(RightLeg); } @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { this.RightLeg.render(f5); this.RightArm.render(f5); this.LeftArm.render(f5); this.LeftLeg.render(f5); this.Head.render(f5); this.Torso.render(f5); } /** * This is a helper function from Tabula to set the rotation of model parts */ public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; } } Model File ^ package com.awex.heros; import com.awex.Main; import com.awex.handlers.ArmorHandler; import com.awex.proxy.ClientProxy; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; public class HalJordan extends ItemArmor{ public String textureName; public HalJordan(String unlocalizedName, ArmorMaterial material, String textureName, int type) { super(material, 0, type); this.textureName = textureName; this.setUnlocalizedName(unlocalizedName); this.setTextureName(Main.MODID + ":" + unlocalizedName); } @Override public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layer) { if (stack.getItem().equals(ArmorHandler.hjHelmet) || stack.getItem().equals(ArmorHandler.hjPlate) || stack.getItem().equals(ArmorHandler.hjBoots)) { return Main.MODID + ":textures/items/armor/HJ.png"; } if (stack.getItem().equals(ArmorHandler.hjLeggings)) { return Main.MODID + ":textures/items/armor/HJ.png"; } else return null; } @Override @SideOnly(Side.CLIENT) public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { ModelBiped armorModel = new ModelBiped(); if (itemStack != null) { if (itemStack.getItem() instanceof HalJordan) { int type = ((ItemArmor) itemStack.getItem()).armorType; if (type == 1 || type == 3) { armorModel = ClientProxy.getArmorModel(1); } else { armorModel = ClientProxy.getArmorModel(1); } } 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(); armorModel.heldItemRight = ((EntityPlayer) entityLiving).getCurrentArmor(0) != null ? 1 : 0; // for armorModel.heldItemRight = ((EntityPlayer) entityLiving).getCurrentEquippedItem() != null ? 1 : 0; // for armorModel.aimedBow = false; if ((entityLiving instanceof EntityPlayer)) { if (((EntityPlayer) entityLiving).getItemInUseDuration() > 0) { EnumAction enumaction = ((EntityPlayer) entityLiving).getCurrentEquippedItem() .getItemUseAction(); if (enumaction == EnumAction.block) { armorModel.heldItemRight = 3; } else if (enumaction == EnumAction.bow) { armorModel.aimedBow = true; } } } return armorModel; } } return null; } @Override public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { if (player.getCurrentArmor(3) != null && player.getCurrentArmor(2) != null && player.getCurrentArmor(1) != null && player.getCurrentArmor(0) != null) { if (player.getCurrentArmor(3).getItem().equals(ArmorHandler.hjHelmet) && player.getCurrentArmor(2).getItem().equals(ArmorHandler.hjPlate) && player.getCurrentArmor(1).getItem().equals(ArmorHandler.hjLeggings) && player.getCurrentArmor(0).getItem().equals(ArmorHandler.hjBoots)) { player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 10, 0)); player.fallDistance = 0.0f; } } } } ItemArmor Class ^ http://imgur.com/szxFV7P Located at assets.awex.textures.items.armor Every time I launch and put this armor on it loads very oddly. If I sneak I can see a snippet of the armor, but that's about it. It also doesn't move with the player.
  7. I don't want to do normal armor, I want to basically replace the skin of the player with the armor skin file.
  8. What else would I do though... whats inside of getarmormodel
  9. This is my current code: public class ItemArmor extends net.minecraft.item.ItemArmor{ private String name; public ItemArmor(ArmorMaterial material, EntityEquipmentSlot slot, String name) { super(material, 0, slot); setRegistryName(name); setUnlocalizedName(name); this.name = name; } public void registerItemModel(Item item) { DCMC.proxy.registerItemRenderer(this, 0, name); } } Only problem is I cannot use skin files. Is there a way to use a file like I attached?
  10. How could I use armor files from 1.8+ skins in 1.7.10 modding?
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.