3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-20 21:40:06 +01:00
Paper/nms-patches/ItemMapEmpty.patch

26 Zeilen
1.3 KiB
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/ItemMapEmpty.java
+++ b/net/minecraft/server/ItemMapEmpty.java
@@ -7,15 +7,19 @@
}
public ItemStack a(ItemStack itemstack, World world, EntityHuman entityhuman) {
- ItemStack itemstack1 = new ItemStack(Items.FILLED_MAP, 1, world.b("map"));
+ World worldMain = world.getServer().getServer().worlds.get(0); // CraftBukkit - store reference to primary world
+ ItemStack itemstack1 = new ItemStack(Items.FILLED_MAP, 1, worldMain.b("map")); // CraftBukkit - use primary world for maps
String s = "map_" + itemstack1.getData();
WorldMap worldmap = new WorldMap(s);
- world.a(s, (PersistentBase) worldmap);
2015-02-26 23:41:06 +01:00
+ worldMain.a(s, (PersistentBase) worldmap); // CraftBukkit
worldmap.scale = 0;
worldmap.a(entityhuman.locX, entityhuman.locZ, worldmap.scale);
- worldmap.map = (byte) world.worldProvider.getDimension();
+ worldmap.map = (byte) ((WorldServer) world).dimension; // CraftBukkit - use bukkit dimension
worldmap.c();
2015-02-26 23:41:06 +01:00
+
+ org.bukkit.craftbukkit.event.CraftEventFactory.callEvent(new org.bukkit.event.server.MapInitializeEvent(worldmap.mapView)); // CraftBukkit
2015-02-26 23:41:06 +01:00
+
--itemstack.count;
if (itemstack.count <= 0) {
return itemstack1;