(ItemStack stack, World worldIn)
| 43 | } |
| 44 | |
| 45 | public MapData getMapData(ItemStack stack, World worldIn) |
| 46 | { |
| 47 | String s = "map_" + stack.getMetadata(); |
| 48 | MapData mapdata = (MapData)worldIn.loadItemData(MapData.class, s); |
| 49 | |
| 50 | if (mapdata == null && !worldIn.isRemote) |
| 51 | { |
| 52 | stack.setItemDamage(worldIn.getUniqueDataId("map")); |
| 53 | s = "map_" + stack.getMetadata(); |
| 54 | mapdata = new MapData(s); |
| 55 | mapdata.scale = 3; |
| 56 | mapdata.calculateMapCenter(worldIn.getWorldInfo().getSpawnX(), worldIn.getWorldInfo().getSpawnZ(), mapdata.scale); |
| 57 | mapdata.dimension = (byte)worldIn.provider.getDimensionId(); |
| 58 | mapdata.markDirty(); |
| 59 | worldIn.setItemData(s, mapdata); |
| 60 | } |
| 61 | |
| 62 | return mapdata; |
| 63 | } |
| 64 | |
| 65 | public void updateMapData(World worldIn, Entity viewer, MapData data) |
| 66 | { |
no test coverage detected