2021-03-15 23:00:00 +01:00
--- a/net/minecraft/world/item/ItemWorldMap.java
+++ b/net/minecraft/world/item/ItemWorldMap.java
2021-06-11 07:00:00 +02:00
@@ -34,6 +34,11 @@
2021-03-15 23:00:00 +01:00
import net.minecraft.world.level.material.MaterialMapColor;
import net.minecraft.world.level.saveddata.maps.WorldMap;
2014-11-25 22:32:16 +01:00
+// CraftBukkit start
+import org.bukkit.Bukkit;
+import org.bukkit.event.server.MapInitializeEvent;
+// CraftBukkit end
+
public class ItemWorldMap extends ItemWorldMapBase {
2021-06-11 07:00:00 +02:00
public static final int IMAGE_WIDTH = 128;
2021-07-06 16:00:00 +02:00
@@ -68,7 +73,7 @@
2021-06-11 07:00:00 +02:00
public static Integer d(ItemStack itemstack) {
2018-07-15 02:00:00 +02:00
NBTTagCompound nbttagcompound = itemstack.getTag();
2021-06-11 07:00:00 +02:00
- return nbttagcompound != null && nbttagcompound.hasKeyOfType("map", 99) ? nbttagcompound.getInt("map") : null;
2018-07-15 02:00:00 +02:00
+ return nbttagcompound != null && nbttagcompound.hasKeyOfType("map", 99) ? nbttagcompound.getInt("map") : -1; // CraftBukkit - make new maps for no tag
2016-11-17 02:41:03 +01:00
}
2021-07-06 16:00:00 +02:00
public static int createNewSavedData(World world, int i, int j, int k, boolean flag, boolean flag1, ResourceKey<World> resourcekey) {
@@ -76,6 +81,10 @@
2021-06-11 07:00:00 +02:00
int l = world.getWorldMapCount();
world.a(a(l), worldmap);
2018-07-15 02:00:00 +02:00
+ // CraftBukkit start
+ MapInitializeEvent event = new MapInitializeEvent(worldmap.mapView);
+ Bukkit.getServer().getPluginManager().callEvent(event);
+ // CraftBukkit end
2021-06-11 07:00:00 +02:00
return l;
2018-07-15 02:00:00 +02:00
}