Update to Minecraft 1.17

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-06-11 15:00:00 +10:00
parent 75faba7fde
commit b3a8254758
619 changed files with 10708 additions and 8451 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/item/ItemWorldMap.java
+++ b/net/minecraft/world/item/ItemWorldMap.java
@@ -30,6 +30,11 @@
@@ -34,6 +34,11 @@
import net.minecraft.world.level.material.MaterialMapColor;
import net.minecraft.world.level.saveddata.maps.WorldMap;
@@ -11,25 +11,24 @@
+
public class ItemWorldMap extends ItemWorldMapBase {
public ItemWorldMap(Item.Info item_info) {
@@ -62,7 +67,7 @@
public static int d(ItemStack itemstack) {
public static final int IMAGE_WIDTH = 128;
@@ -68,7 +73,7 @@
public static Integer d(ItemStack itemstack) {
NBTTagCompound nbttagcompound = itemstack.getTag();
- return nbttagcompound != null && nbttagcompound.hasKeyOfType("map", 99) ? nbttagcompound.getInt("map") : 0;
- 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 WorldMap a(ItemStack itemstack, World world, int i, int j, int k, boolean flag, boolean flag1, ResourceKey<World> resourcekey) {
@@ -72,6 +77,11 @@
worldmap.a(i, j, k, flag, flag1, resourcekey);
world.a(worldmap);
itemstack.getOrCreateTag().setInt("map", l);
+
private static int a(World world, int i, int j, int k, boolean flag, boolean flag1, ResourceKey<World> resourcekey) {
@@ -76,6 +81,10 @@
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 worldmap;
return l;
}