Posted May 11, 201510 yr So, I have a tile entity called TileEntityEnergizer and I have a TESR that renders it just fine, but I want to have it change the texture based on the isMultiblock() and getMultiblockSize() properties of my TileEntityEnergizer. For some reason, when I print out isMultiblock() and getMultiblockSize() from the TESR, they end up with values they never should have, such as 0 for getMultiblockSize(). I know that the method updateTileEntityAt() is passing me a TileEntityEnergizer because I had it check it and it worked. I'm not sure why im not getting the correct values from my methods... TESR: https://github.com/AnZaNaMa/ExpTools/blob/master/src/main/java/com/AnZaNaMa/ExpTools/Entity/TileEntity/EnergyToolsTESR.java TileEntityEnergizer: https://github.com/AnZaNaMa/ExpTools/blob/master/src/main/java/com/AnZaNaMa/ExpTools/Entity/TileEntity/TileEntityEnergizer.java - Just because things are the way they are doesn't mean they can't be the way you want them to be. Unless they're aspen trees. You can tell they're aspens 'cause the way they are.
May 11, 201510 yr if(some_value == something) { //bind texture 1 } else { //bind texture 2 } Now then, here's your code. if(tileEntity instanceof TileEntityEnergizer){ //this should be true TileEntityEnergizer energizer = (TileEntityEnergizer)tileEntity; LogHelper.info(energizer.getMultiplier()); //lets just not do anything useful with this value image = new ResourceLocation(Reference.MODID + ":textures/blocks/energizer.png"); //bind texture 1 } else{ //this will never happen image = new ResourceLocation(Reference.MODID + ":textures/blocks/energizer.png"); //bind texture 2 } Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
May 12, 201510 yr Author oh sorry i changed my code when i was troubleshooting. I originally had if(tileEntity instanceof TileEntityEnergizer){ TileEntityEnergizer energizer = (TileEntityEnergizer)tileEntity; if(energizer.getMultiblockSize() == 3){ image = new ResourceLocation(Reference.MODID + ":textures/blocks/energizer2.png"); } else if(energizer.getMultiblockSize() == 5){ image = new ResourceLocation(Reference.MODID + ":textures/blocks/energizer3.png"); } else if(energizer.getMultiblockSize() == 7){ image = new ResourceLocation(Reference.MODID + ":textures/blocks/energizer4.png"); } else{ image = new ResourceLocation(Reference.MODID + ":textures/blocks/energizer.png"); } } - Just because things are the way they are doesn't mean they can't be the way you want them to be. Unless they're aspen trees. You can tell they're aspens 'cause the way they are.
May 12, 201510 yr Hi This link might be useful https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe60_network_messages/Notes.txt and this working example https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe20_tileentity_data/Notes.txt -TGG
May 13, 201510 yr Author thanks diesieben and GreyGhost. I used the tutorial on the forge wiki to sync client and server and got it working. - Just because things are the way they are doesn't mean they can't be the way you want them to be. Unless they're aspen trees. You can tell they're aspens 'cause the way they are.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.