Jump to content

TinMan216

Members
  • Posts

    2
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • URL
    http://www.DanielMcMahon.uk
  • Location
    United Kingdom
  • Personal Text
    Web Developer

TinMan216's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Ah thanks, ill give that a try tonight and update with any code.
  2. Evening guys. Ive been following multiple series online ; Pahimar's Lets mod and VsweGoesMinecraft's summer lecture courses for minecraft modding. While many practices in these series have not changed, some have for instance, changing an items texture, both series use the icon register however with the new introduction of 1.8 it now needs JSON files to accompany the texture and a renderer. My problem is, is that the second texture for the item is not getting changed when the code is called. However it happily changes it back to the original texture when instructed to do so. Ive checked the both JSON files and are identical (copied one from another and renamed the texture its looking for) and in the same directory. Wand Class public class ItemWand extends CustomItem { public ItemWand() { super("wand", CreativeTabs.tabCombat, 1, 10); this.RegisterRenderer("wand"); } //TODO: change icon based on if it is charged or not. for this use the renderer but it acts odd. @Override public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target) { if (!target.worldObj.isRemote) { target.motionY = 2; if (isCharged(stack.getItemDamage())) { this.RegisterRenderer("wand2"); //will not change to second texture. target.motionX = (target.posX - playerIn.posX)*2; target.motionZ = (target.posZ - playerIn.posZ)*2; } else { stack.setItemDamage(stack.getItemDamage() + 1); } stack.damageItem(1, target); } return false; } public boolean isCharged(int dmgVal) { return dmgVal >= 3; } Register renderer method call public void RegisterRenderer(String name) { System.out.println("Initialising Renderer For : " + name); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(this, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + name, "inventory")); } JSON file (i'll provide one since the only difference between the two is names 'stevesexample:items/wand' and 'stevesexample:items/wand2') { "parent": "builtin/generated", "textures": { "layer0": "stevesexample:items/wand" }, "display": { "thirdperson": { "rotation": [-90, 0, 0], "translation": [0, 1, -3], "scale": [0.55, 0.55, 0.55 ] }, "firstperson": { "rotation": [0, -135, 25 ], "translation": [0, 4, 2 ], "scale": [1.7, 1.7, 1.7] } } } what am I missing here or is it not that simple any more? Thanks
×
×
  • Create New...

Important Information

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