Posted March 20, 20169 yr When I use my item (IICopperCable), it places the block perfectly, but, It requires me to place a block next to it(block update) to actually see the block. In other words, when I right click with it, it places a block cable (custom model) with only a hit box.... Code: public class IItemCopperCable extends Item { public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { if (world.getBlock(x, y, z) != Blocks.snow_layer) { if (side == 0) { --y; } if (side == 1) { ++y; } if (side == 2) { --z; } if (side == 3) { ++z; } if (side == 4) { --x; } if (side == 5) { ++x; } if (!world.isAirBlock(x, y, z)) { return false; } } if (!player.canPlayerEdit(x, y, z, side, stack)) { return false; } else { if (MBlocks.CABLE.canPlaceBlockAt(world, x, y, z)) { --stack.stackSize; world.setBlock(x, y, z, MBlocks.CABLE, 1, 0); } return true; } } } eKoop Creator: http://lumtech.byethost33.com/mods/eKoop/modinfo.html
March 20, 20169 yr Wrap whole thing with if (!world.isRemote). 1.7.10 is no longer supported by forge, you are on your own.
March 20, 20169 yr Author Thank you so much! eKoop Creator: http://lumtech.byethost33.com/mods/eKoop/modinfo.html
March 20, 20169 yr Also might help if you used the setBlock flag 3 like its supposed to be used: world.setBlock(x, y, z, MBlocks.CABLE, 1, 0); //flag 0: don't send to client, don't inform neighbors world.setBlock(x, y, z, MBlocks.CABLE, 1, 3); //flag 3: send to client, inform neighbors 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.
March 20, 20169 yr Author Also might help if you used the setBlock flag 3 like its supposed to be used: world.setBlock(x, y, z, MBlocks.CABLE, 1, 0); //flag 0: don't send to client, don't inform neighbors world.setBlock(x, y, z, MBlocks.CABLE, 1, 3); //flag 3: send to client, inform neighbors Thanks, I will remember that in the future! eKoop Creator: http://lumtech.byethost33.com/mods/eKoop/modinfo.html
March 20, 20169 yr Hooray for (not) reading the javadocs! 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.
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.