Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and update it's contents.
(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected)
| 233 | * update it's contents. |
| 234 | */ |
| 235 | public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) |
| 236 | { |
| 237 | if (!worldIn.isRemote) |
| 238 | { |
| 239 | MapData mapdata = this.getMapData(stack, worldIn); |
| 240 | |
| 241 | if (entityIn instanceof EntityPlayer) |
| 242 | { |
| 243 | EntityPlayer entityplayer = (EntityPlayer)entityIn; |
| 244 | mapdata.updateVisiblePlayers(entityplayer, stack); |
| 245 | } |
| 246 | |
| 247 | if (isSelected) |
| 248 | { |
| 249 | this.updateMapData(worldIn, entityIn, mapdata); |
| 250 | } |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | public Packet createMapDataPacket(ItemStack stack, World worldIn, EntityPlayer player) |
| 255 | { |
nothing calls this directly
no test coverage detected