From 351402accf282c2c9a74d8b14e5a59dec3eb9d7a Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Wed, 18 Dec 2019 08:00:00 +1100 Subject: [PATCH] Update to Minecraft 1.15.1 By: md_5 --- paper-server/nms-patches/BiomeStorage.patch | 18 +++++------ paper-server/nms-patches/EntityVillager.patch | 8 ++--- paper-server/nms-patches/ItemStack.patch | 18 ++--------- paper-server/nms-patches/PlayerChunkMap.patch | 30 +++++++++---------- paper-server/nms-patches/World.patch | 8 ++--- paper-server/nms-patches/WorldUpgrader.patch | 2 +- paper-server/pom.xml | 4 +-- .../java/org/bukkit/craftbukkit/Main.java | 2 +- .../craftbukkit/util/CraftMagicNumbers.java | 2 +- 9 files changed, 40 insertions(+), 52 deletions(-) diff --git a/paper-server/nms-patches/BiomeStorage.patch b/paper-server/nms-patches/BiomeStorage.patch index ccb86d85a2..a3c6902bc7 100644 --- a/paper-server/nms-patches/BiomeStorage.patch +++ b/paper-server/nms-patches/BiomeStorage.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/server/BiomeStorage.java +++ b/net/minecraft/server/BiomeStorage.java -@@ -77,7 +77,7 @@ - int[] aint = new int[this.f.length]; +@@ -88,7 +88,7 @@ + int[] aint = new int[this.g.length]; - for (int i = 0; i < this.f.length; ++i) { -- aint[i] = IRegistry.BIOME.a((Object) this.f[i]); -+ aint[i] = IRegistry.BIOME.a(this.f[i]); // CraftBukkit - decompile error + for (int i = 0; i < this.g.length; ++i) { +- aint[i] = IRegistry.BIOME.a((Object) this.g[i]); ++ aint[i] = IRegistry.BIOME.a(this.g[i]); // CraftBukkit - decompile error } return aint; -@@ -90,7 +90,7 @@ +@@ -101,7 +101,7 @@ for (int j = 0; j < i; ++j) { BiomeBase biomebase = abiomebase[j]; @@ -18,9 +18,9 @@ } } -@@ -107,4 +107,14 @@ +@@ -118,4 +118,14 @@ - return this.f[i1 << BiomeStorage.d + BiomeStorage.d | j1 << BiomeStorage.d | l]; + return this.g[i1 << BiomeStorage.e + BiomeStorage.e | j1 << BiomeStorage.e | l]; } + + // CraftBukkit start @@ -29,7 +29,7 @@ + int i1 = MathHelper.clamp(j, 0, BiomeStorage.c); + int j1 = k & BiomeStorage.b; + -+ this.f[i1 << BiomeStorage.d + BiomeStorage.d | j1 << BiomeStorage.d | l] = biome; ++ this.g[i1 << BiomeStorage.e + BiomeStorage.e | j1 << BiomeStorage.e | l] = biome; + } + // CraftBukkit end } diff --git a/paper-server/nms-patches/EntityVillager.patch b/paper-server/nms-patches/EntityVillager.patch index 0c0d32adb7..68e55bc514 100644 --- a/paper-server/nms-patches/EntityVillager.patch +++ b/paper-server/nms-patches/EntityVillager.patch @@ -60,7 +60,7 @@ } } -@@ -658,7 +675,12 @@ +@@ -661,7 +678,12 @@ entitywitch.setCustomNameVisible(this.getCustomNameVisible()); } @@ -74,7 +74,7 @@ this.die(); } -@@ -808,7 +830,7 @@ +@@ -811,7 +833,7 @@ } private void b(long i) { @@ -83,7 +83,7 @@ } private boolean c(long i) { -@@ -857,7 +879,7 @@ +@@ -860,7 +882,7 @@ if (entityirongolem != null) { if (entityirongolem.a((GeneratorAccess) this.world, EnumMobSpawn.MOB_SUMMONED) && entityirongolem.a((IWorldReader) this.world)) { @@ -92,7 +92,7 @@ return entityirongolem; } -@@ -919,13 +941,13 @@ +@@ -922,13 +944,13 @@ @Override public void entitySleep(BlockPosition blockposition) { super.entitySleep(blockposition); diff --git a/paper-server/nms-patches/ItemStack.patch b/paper-server/nms-patches/ItemStack.patch index dd08a662b4..cb4f74213b 100644 --- a/paper-server/nms-patches/ItemStack.patch +++ b/paper-server/nms-patches/ItemStack.patch @@ -287,19 +287,7 @@ public NBTTagCompound getOrCreateTag() { if (this.tag == null) { this.setTag(new NBTTagCompound()); -@@ -386,6 +595,11 @@ - - public void setTag(@Nullable NBTTagCompound nbttagcompound) { - this.tag = nbttagcompound; -+ // CraftBukkit start - ensure null tags do not get inappropriately used (SpigotCraft#463) -+ if (this.tag == null && this.item != null && this.item.usesDurability()) { -+ this.setDamage(this.getDamage()); -+ } -+ // CraftBukkit end - } - - public IChatBaseComponent getName() { -@@ -494,6 +708,12 @@ +@@ -498,6 +707,12 @@ } public void setRepairCost(int i) { @@ -312,7 +300,7 @@ this.getOrCreateTag().setInt("RepairCost", i); } -@@ -516,7 +736,7 @@ +@@ -520,7 +735,7 @@ object = this.getItem().a(enumitemslot); } @@ -321,7 +309,7 @@ attributemodifier1.a(false); }); return (Multimap) object; -@@ -539,6 +759,13 @@ +@@ -543,6 +758,13 @@ nbttaglist.add(nbttagcompound); } diff --git a/paper-server/nms-patches/PlayerChunkMap.patch b/paper-server/nms-patches/PlayerChunkMap.patch index 2cb57d0cc1..34f403e0c4 100644 --- a/paper-server/nms-patches/PlayerChunkMap.patch +++ b/paper-server/nms-patches/PlayerChunkMap.patch @@ -55,7 +55,7 @@ final Either either = (Either) iterator.next(); Optional optional = either.left(); -@@ -293,7 +322,7 @@ +@@ -297,7 +326,7 @@ PlayerChunkMap.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.w.getName()); } else { this.visibleChunks.values().stream().filter(PlayerChunk::hasBeenLoaded).forEach((playerchunk) -> { @@ -64,7 +64,7 @@ if (ichunkaccess instanceof ProtoChunkExtension || ichunkaccess instanceof Chunk) { this.saveChunk(ichunkaccess); -@@ -304,7 +333,6 @@ +@@ -308,7 +337,6 @@ } } @@ -72,7 +72,7 @@ protected void unloadChunks(BooleanSupplier booleansupplier) { GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler(); -@@ -343,7 +371,7 @@ +@@ -347,7 +375,7 @@ private void a(long i, PlayerChunk playerchunk) { CompletableFuture completablefuture = playerchunk.getChunkSave(); @@ -81,7 +81,7 @@ CompletableFuture completablefuture1 = playerchunk.getChunkSave(); if (completablefuture1 != completablefuture) { -@@ -492,7 +520,7 @@ +@@ -496,7 +524,7 @@ return CompletableFuture.completedFuture(Either.right(playerchunk_failure)); }); }, (runnable) -> { @@ -90,7 +90,7 @@ }); } -@@ -550,8 +578,15 @@ +@@ -554,8 +582,15 @@ while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); @@ -107,7 +107,7 @@ if (list == null) { list = Lists.newArrayList(new Entity[]{entity}); } else { -@@ -573,7 +608,7 @@ +@@ -577,7 +612,7 @@ long i = playerchunk.i().pair(); playerchunk.getClass(); @@ -116,7 +116,7 @@ }); } -@@ -590,7 +625,7 @@ +@@ -594,7 +629,7 @@ return Either.left(chunk); }); }, (runnable) -> { @@ -125,7 +125,7 @@ }); completablefuture1.thenAcceptAsync((either) -> { -@@ -604,7 +639,7 @@ +@@ -608,7 +643,7 @@ return Either.left(chunk); }); }, (runnable) -> { @@ -134,7 +134,7 @@ }); return completablefuture1; } -@@ -618,7 +653,7 @@ +@@ -622,7 +657,7 @@ return chunk; }); }, (runnable) -> { @@ -143,7 +143,7 @@ }); } -@@ -742,7 +777,8 @@ +@@ -746,7 +781,8 @@ return ichunkaccess instanceof Chunk ? Optional.of((Chunk) ichunkaccess) : Optional.empty(); }); @@ -153,7 +153,7 @@ return Stream.of(chunk.getEntitySlices()).mapToInt(EntitySlice::size).sum(); }).orElse(0), optional1.map((chunk) -> { return chunk.getTileEntities().size(); -@@ -753,7 +789,7 @@ +@@ -757,7 +793,7 @@ private static String a(CompletableFuture> completablefuture) { try { @@ -162,7 +162,7 @@ return either != null ? (String) either.map((chunk) -> { return "done"; -@@ -771,7 +807,7 @@ +@@ -775,7 +811,7 @@ private NBTTagCompound readChunkData(ChunkCoordIntPair chunkcoordintpair) throws IOException { NBTTagCompound nbttagcompound = this.read(chunkcoordintpair); @@ -171,7 +171,7 @@ } boolean isOutsideOfRange(ChunkCoordIntPair chunkcoordintpair) { -@@ -1105,7 +1141,7 @@ +@@ -1109,7 +1145,7 @@ public final Set trackedPlayers = Sets.newHashSet(); public EntityTracker(Entity entity, int i, int j, boolean flag) { @@ -180,7 +180,7 @@ this.tracker = entity; this.trackingDistance = i; this.e = SectionPosition.a(entity); -@@ -1158,7 +1194,7 @@ +@@ -1162,7 +1198,7 @@ public void updatePlayer(EntityPlayer entityplayer) { if (entityplayer != this.tracker) { @@ -189,7 +189,7 @@ int i = Math.min(this.b(), (PlayerChunkMap.this.viewDistance - 1) * 16); boolean flag = vec3d.x >= (double) (-i) && vec3d.x <= (double) i && vec3d.z >= (double) (-i) && vec3d.z <= (double) i && this.tracker.a(entityplayer); -@@ -1174,6 +1210,17 @@ +@@ -1178,6 +1214,17 @@ } } diff --git a/paper-server/nms-patches/World.patch b/paper-server/nms-patches/World.patch index d50b9309fe..481df1e926 100644 --- a/paper-server/nms-patches/World.patch +++ b/paper-server/nms-patches/World.patch @@ -298,14 +298,14 @@ @@ -306,11 +510,11 @@ } - public boolean J() { + public boolean isDay() { - return this.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD && this.c < 4; + return this.worldProvider.getDimensionManager().getType() == DimensionManager.OVERWORLD && this.c < 4; // CraftBukkit } - public boolean K() { -- return this.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD && !this.J(); -+ return this.worldProvider.getDimensionManager().getType() == DimensionManager.OVERWORLD && !this.J(); // CraftBukkit + public boolean isNight() { +- return this.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD && !this.isDay(); ++ return this.worldProvider.getDimensionManager().getType() == DimensionManager.OVERWORLD && !this.isDay(); // CraftBukkit } @Override diff --git a/paper-server/nms-patches/WorldUpgrader.patch b/paper-server/nms-patches/WorldUpgrader.patch index 38e8c64796..16ab0d5fd6 100644 --- a/paper-server/nms-patches/WorldUpgrader.patch +++ b/paper-server/nms-patches/WorldUpgrader.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/WorldUpgrader.java +++ b/net/minecraft/server/WorldUpgrader.java -@@ -123,7 +123,7 @@ +@@ -124,7 +124,7 @@ int j = IChunkLoader.a(nbttagcompound); NBTTagCompound nbttagcompound1 = ichunkloader.getChunkData(dimensionmanager2, () -> { return this.q; diff --git a/paper-server/pom.xml b/paper-server/pom.xml index bd679d38d6..99d738b70a 100644 --- a/paper-server/pom.xml +++ b/paper-server/pom.xml @@ -4,7 +4,7 @@ org.bukkit craftbukkit jar - 1.15-R0.1-SNAPSHOT + 1.15.1-R0.1-SNAPSHOT CraftBukkit https://www.spigotmc.org/ @@ -12,7 +12,7 @@ true UTF-8 unknown - 1.15 + 1.15.1 1_15_R1 git-Bukkit- diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/Main.java b/paper-server/src/main/java/org/bukkit/craftbukkit/Main.java index 60287d72c7..509d2865ec 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/Main.java @@ -177,7 +177,7 @@ public class Main { useConsole = false; } - if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { + if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { Date buildDate = new SimpleDateFormat("yyyyMMdd-HHmm").parse(Main.class.getPackage().getImplementationVendor()); Calendar deadline = Calendar.getInstance(); diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/paper-server/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java index 8e23c47502..adad3a0fa7 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -188,7 +188,7 @@ public final class CraftMagicNumbers implements UnsafeValues { * @return string */ public String getMappingsVersion() { - return "e50e3dd1d07234cc9c09cb516a951227"; + return "d2fa25e37d6e69667dc7f4a33d7644e1"; } @Override