2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/item/ItemWorldMap.java
|
|
|
|
+++ b/net/minecraft/world/item/ItemWorldMap.java
|
2022-06-07 18:00:00 +02:00
|
|
|
@@ -33,6 +33,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;
|
2022-12-07 17:00:00 +01:00
|
|
|
@@ -69,7 +74,7 @@
|
2021-11-21 23:00:00 +01:00
|
|
|
public static Integer getMapId(ItemStack itemstack) {
|
2018-07-15 02:00:00 +02:00
|
|
|
NBTTagCompound nbttagcompound = itemstack.getTag();
|
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
- 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
|
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) {
|
2022-12-07 17:00:00 +01:00
|
|
|
@@ -77,6 +82,10 @@
|
2021-11-21 23:00:00 +01:00
|
|
|
int l = world.getFreeMapId();
|
2021-06-11 07:00:00 +02:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
world.setMapData(makeKey(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
|
|
|
}
|
|
|
|
|