MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / onUpdate

Method onUpdate

src/main/java/net/minecraft/item/ItemMap.java:235–252  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 3

getMapDataMethod · 0.95
updateVisiblePlayersMethod · 0.95
updateMapDataMethod · 0.95

Tested by

no test coverage detected