mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 10:17:38 +01:00
0e95cf49fe
By: DerFrZocker <derrieple@gmail.com>
36 lines
1.5 KiB
Diff
36 lines
1.5 KiB
Diff
--- a/net/minecraft/world/item/ItemWorldMap.java
|
|
+++ b/net/minecraft/world/item/ItemWorldMap.java
|
|
@@ -34,6 +34,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;
|
|
@@ -68,14 +73,18 @@
|
|
public static Integer d(ItemStack itemstack) {
|
|
NBTTagCompound nbttagcompound = itemstack.getTag();
|
|
|
|
- return nbttagcompound != null && nbttagcompound.hasKeyOfType("map", 99) ? nbttagcompound.getInt("map") : null;
|
|
+ return nbttagcompound != null && nbttagcompound.hasKeyOfType("map", 99) ? nbttagcompound.getInt("map") : -1; // CraftBukkit - make new maps for no tag
|
|
}
|
|
|
|
- private static int a(World world, int i, int j, int k, boolean flag, boolean flag1, ResourceKey<World> resourcekey) {
|
|
+ public static int a(World world, int i, int j, int k, boolean flag, boolean flag1, ResourceKey<World> resourcekey) { // PAIL private -> public
|
|
WorldMap worldmap = WorldMap.a((double) i, (double) j, (byte) k, flag, flag1, resourcekey);
|
|
int l = world.getWorldMapCount();
|
|
|
|
world.a(a(l), worldmap);
|
|
+ // CraftBukkit start
|
|
+ MapInitializeEvent event = new MapInitializeEvent(worldmap.mapView);
|
|
+ Bukkit.getServer().getPluginManager().callEvent(event);
|
|
+ // CraftBukkit end
|
|
return l;
|
|
}
|
|
|