mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 11:44:19 +01:00
9ee989ea81
By: md_5 <git@md-5.net>
34 lines
1.3 KiB
Diff
34 lines
1.3 KiB
Diff
--- a/net/minecraft/world/item/ItemWorldMap.java
|
|
+++ b/net/minecraft/world/item/ItemWorldMap.java
|
|
@@ -32,6 +32,11 @@
|
|
import net.minecraft.world.level.material.MaterialMapColor;
|
|
import net.minecraft.world.level.saveddata.maps.WorldMap;
|
|
|
|
+// CraftBukkit start
|
|
+import org.bukkit.Bukkit;
|
|
+import org.bukkit.event.server.MapInitializeEvent;
|
|
+// CraftBukkit end
|
|
+
|
|
public class ItemWorldMap extends ItemWorldMapBase {
|
|
|
|
public static final int IMAGE_WIDTH = 128;
|
|
@@ -66,7 +71,7 @@
|
|
public static Integer getMapId(ItemStack itemstack) {
|
|
NBTTagCompound nbttagcompound = itemstack.getTag();
|
|
|
|
- return nbttagcompound != null && nbttagcompound.contains("map", 99) ? nbttagcompound.getInt("map") : null;
|
|
+ return nbttagcompound != null && nbttagcompound.contains("map", 99) ? nbttagcompound.getInt("map") : -1; // CraftBukkit - make new maps for no tag
|
|
}
|
|
|
|
public static int createNewSavedData(World world, int i, int j, int k, boolean flag, boolean flag1, ResourceKey<World> resourcekey) {
|
|
@@ -74,6 +79,10 @@
|
|
int l = world.getFreeMapId();
|
|
|
|
world.setMapData(makeKey(l), worldmap);
|
|
+ // CraftBukkit start
|
|
+ MapInitializeEvent event = new MapInitializeEvent(worldmap.mapView);
|
|
+ Bukkit.getServer().getPluginManager().callEvent(event);
|
|
+ // CraftBukkit end
|
|
return l;
|
|
}
|
|
|