-
Bug
-
Resolution: Fixed
-
Minecraft 1.9, Minecraft 1.9.4, Minecraft 16w39c, Minecraft 1.11.2, Minecraft 1.12.2, Minecraft 18w16a, Minecraft 1.13.1, 20w07a
-
Confirmed
-
(Unassigned)
The bug
When you have already a map with id 0 and create a new map, the map with id 0 stops updating. Reloading the world fixes this.
How top reproduce
- If a map with id 0 exists already you can use
/give @p filled_map
Otherwise create a new map by right clicking with an empty map
- Make sure the player marker moves when you move
- Create another map
- Look at the map with id 0 again and move around
→ It does not update anymore
The reason
The following is based on a decompiled version of Minecraft 1.10 using MCP 9.30.
The reason for this is that the method net.minecraft.item.ItemEmptyMap.onItemRightClick(ItemStack, World, EntityPlayer, EnumHand) currently creates server- and client-side a MapData object and stores it. This should not happen client-side because the client does not store the map id and uses therefor always 0. The problem is that if a map with the id 0 already existed, the net.minecraft.client.gui.MapItemRenderer registered it already, but because of the new map being generated with the id 0, the old map gets overridden. The MapItemRenderer refers however still to the old MapData which is not updated anymore (intended). The client should probably not create a MapData object in the first place.
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand) { // The following is the new method content --itemStackIn.stackSize; if (worldIn.isRemote) { return new ActionResult(EnumActionResult.SUCCESS, itemStackIn); } else { ItemStack itemstack = new ItemStack(Items.FILLED_MAP, 1, worldIn.getUniqueDataId("map")); String s = "map_" + itemstack.getMetadata(); MapData mapdata = new MapData(s); worldIn.setItemData(s, mapdata); mapdata.scale = 0; mapdata.calculateMapCenter(playerIn.posX, playerIn.posZ, mapdata.scale); mapdata.dimension = (byte)worldIn.provider.getDimensionType().getId(); mapdata.trackingPosition = true; mapdata.markDirty(); if (itemStackIn.stackSize <= 0) { return new ActionResult(EnumActionResult.SUCCESS, itemstack); } else { if (!playerIn.inventory.addItemStackToInventory(itemstack.copy())) { playerIn.dropItem(itemstack, false); } playerIn.addStat(StatList.getObjectUseStats(this)); return new ActionResult(EnumActionResult.SUCCESS, itemStackIn); } } }
- is duplicated by
-
MC-101782 Unresponsive maps
- Resolved
-
MC-106922 Map cursor works until a new map is made
- Resolved
-
MC-107766 Ocean Explorer Map does not update
- Resolved
-
MC-123101 Old Maps not updating when new maps created
- Resolved
-
MC-128807 Map 0 stops updating if Map 1 is created
- Resolved
- relates to
-
MC-143821 Using empty map in creative mode can create additional map with ID 0
- Resolved
-
MC-99378 Copy of placed Map not showing player icon
- Resolved
-
MC-99429 ALL maps stopped updating
- Resolved