From ed7396781e6a9dafc332d3815537766a8741628e Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sat, 16 Apr 2022 10:29:50 +0200 Subject: [PATCH] Updated Upstream (Bukkit/CraftBukkit/Spigot) Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: fc460d1b PR-735: Add Villager#zombify c8c8331e PR-690: Add method to read ItemStack input 62845f2f SPIGOT-6829: Add per-player world border API CraftBukkit Changes: a459f4d4 PR-1033: Add Villager#zombify d65d1430 PR-975: Add method to read ItemStack input b5559f8c SPIGOT-6990: Fix setRepairCost(0) in Anvil 6c308e1b SPIGOT-6829: Add per-player world border API Spigot Changes: 42b61526 SPIGOT-7000: Generation and /locate issues when using custom structure seeds --- patches/api/Add-villager-reputation-API.patch | 5 ----- .../api/Fix-Spigot-annotation-mistakes.patch | 10 +--------- patches/api/Implement-Keyed-on-World.patch | 6 +++--- .../Add-config-for-stronghold-seed.patch | 4 ++-- .../server/Add-villager-reputation-API.patch | 6 +++--- .../server/Complete-resource-pack-API.patch | 4 ++-- ...epare-event-not-working-with-zero-xp.patch | 19 ------------------- .../server/Player.setPlayerProfile-API.patch | 2 +- ...nt-tile-entity-copies-loading-chunks.patch | 7 +------ work/Bukkit | 2 +- work/CraftBukkit | 2 +- work/Spigot | 2 +- 12 files changed, 16 insertions(+), 53 deletions(-) delete mode 100644 patches/server/Fix-anvil-prepare-event-not-working-with-zero-xp.patch diff --git a/patches/api/Add-villager-reputation-API.patch b/patches/api/Add-villager-reputation-API.patch index 83d5df036..6eb59f431 100644 --- a/patches/api/Add-villager-reputation-API.patch +++ b/patches/api/Add-villager-reputation-API.patch @@ -119,11 +119,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import org.bukkit.Keyed; import org.bukkit.Location; import org.bukkit.NamespacedKey; - import org.jetbrains.annotations.NotNull; -+import org.jetbrains.annotations.Nullable; // Paper - - /** - * Represents a villager NPC @@ -0,0 +0,0 @@ public interface Villager extends AbstractVillager { return key; } diff --git a/patches/api/Fix-Spigot-annotation-mistakes.patch b/patches/api/Fix-Spigot-annotation-mistakes.patch index ca5317654..25652b96c 100644 --- a/patches/api/Fix-Spigot-annotation-mistakes.patch +++ b/patches/api/Fix-Spigot-annotation-mistakes.patch @@ -202,20 +202,12 @@ diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java -@@ -0,0 +0,0 @@ package org.bukkit.inventory; - import org.bukkit.Color; - import org.bukkit.Material; - import org.bukkit.Server; -+import org.bukkit.UndefinedNullability; - import org.bukkit.inventory.meta.BookMeta; - import org.bukkit.inventory.meta.ItemMeta; - import org.bukkit.inventory.meta.SkullMeta; @@ -0,0 +0,0 @@ public interface ItemFactory { * @return a new ItemMeta that could be applied to an item stack of the * specified material */ - @Nullable -+ @UndefinedNullability // Paper ++ @org.bukkit.UndefinedNullability // Paper ItemMeta getItemMeta(@NotNull final Material material); /** diff --git a/patches/api/Implement-Keyed-on-World.patch b/patches/api/Implement-Keyed-on-World.patch index ff132eb26..e0a850be7 100644 --- a/patches/api/Implement-Keyed-on-World.patch +++ b/patches/api/Implement-Keyed-on-World.patch @@ -26,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end /** - * Gets the map from the given item ID. + * Create a new virtual {@link WorldBorder}. diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/Server.java @@ -47,8 +47,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end + /** - * Gets the map from the given item ID. - * + * Create a new virtual {@link WorldBorder}. + *

diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/World.java diff --git a/patches/server/Add-config-for-stronghold-seed.patch b/patches/server/Add-config-for-stronghold-seed.patch index fe8cf4819..2fb9bf472 100644 --- a/patches/server/Add-config-for-stronghold-seed.patch +++ b/patches/server/Add-config-for-stronghold-seed.patch @@ -9,11 +9,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java @@ -0,0 +0,0 @@ public abstract class ChunkGenerator implements BiomeManager.NoiseBiomeSource { - int k = placement.spread(); + int k = concentricringsstructureplacement.spread(); Random random = new Random(); + // Paper start -+ if (strongholdSet.is(net.minecraft.world.level.levelgen.structure.BuiltinStructureSets.STRONGHOLDS) && this.conf.strongholdSeed != null) { ++ if (this.conf.strongholdSeed != null && this.structureSets.getResourceKey(holder).orElse(null) == net.minecraft.world.level.levelgen.structure.BuiltinStructureSets.STRONGHOLDS) { + random.setSeed(this.conf.strongholdSeed); + } else { + // Paper end diff --git a/patches/server/Add-villager-reputation-API.patch b/patches/server/Add-villager-reputation-API.patch index d52bc02ab..5070f4cd9 100644 --- a/patches/server/Add-villager-reputation-API.patch +++ b/patches/server/Add-villager-reputation-API.patch @@ -65,9 +65,9 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/sr index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java -@@ -0,0 +0,0 @@ import org.bukkit.entity.Villager; - import org.bukkit.entity.Villager.Profession; - import org.bukkit.entity.Villager.Type; +@@ -0,0 +0,0 @@ import org.bukkit.entity.EntityType; + import org.bukkit.entity.Villager; + import org.bukkit.entity.ZombieVillager; +// Paper start +import com.destroystokyo.paper.entity.villager.Reputation; diff --git a/patches/server/Complete-resource-pack-API.patch b/patches/server/Complete-resource-pack-API.patch index 6c416ac93..66829dd41 100644 --- a/patches/server/Complete-resource-pack-API.patch +++ b/patches/server/Complete-resource-pack-API.patch @@ -35,9 +35,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import net.md_5.bungee.api.chat.BaseComponent; // Spigot @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - private double health = 20; - private boolean scaledHealth = false; private double healthScale = 20; + private CraftWorldBorder clientWorldBorder = null; + private BorderChangeListener clientWorldBorderListener = this.createWorldBorderListener(); + // Paper start + private org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus; + private String resourcePackHash; diff --git a/patches/server/Fix-anvil-prepare-event-not-working-with-zero-xp.patch b/patches/server/Fix-anvil-prepare-event-not-working-with-zero-xp.patch deleted file mode 100644 index 5fa8b4fd6..000000000 --- a/patches/server/Fix-anvil-prepare-event-not-working-with-zero-xp.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jan Tuck -Date: Mon, 15 Nov 2021 15:20:41 -0500 -Subject: [PATCH] Fix anvil prepare event not working with zero xp - - -diff --git a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java -+++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java -@@ -0,0 +0,0 @@ public class AnvilMenu extends ItemCombinerMenu { - - @Override - protected boolean mayPickup(Player player, boolean present) { -- return (player.getAbilities().instabuild || player.experienceLevel >= this.cost.get()) && this.cost.get() > 0; -+ return (player.getAbilities().instabuild || player.experienceLevel >= this.cost.get()) && this.cost.get() >= 0; // Paper - fix anvil prepare event not working with 0 xp - } - - @Override diff --git a/patches/server/Player.setPlayerProfile-API.patch b/patches/server/Player.setPlayerProfile-API.patch index cc6fa3ee5..e80ec0a1b 100644 --- a/patches/server/Player.setPlayerProfile-API.patch +++ b/patches/server/Player.setPlayerProfile-API.patch @@ -33,8 +33,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.biome.BiomeManager; import net.minecraft.world.level.block.entity.SignBlockEntity; + import net.minecraft.world.level.border.BorderChangeListener; import net.minecraft.world.level.saveddata.maps.MapDecoration; - import net.minecraft.world.level.saveddata.maps.MapItemSavedData; @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return server.getPlayer(getUniqueId()) != null; } diff --git a/patches/server/Prevent-tile-entity-copies-loading-chunks.patch b/patches/server/Prevent-tile-entity-copies-loading-chunks.patch index 3a94f795b..7be93ada7 100644 --- a/patches/server/Prevent-tile-entity-copies-loading-chunks.patch +++ b/patches/server/Prevent-tile-entity-copies-loading-chunks.patch @@ -15,13 +15,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - BlockEntity tileentity = this.player.level.getBlockEntity(blockposition); + // Paper start + BlockEntity tileentity = null; -+ if (this.player.getLevel().isLoadedAndInBounds(blockposition)) { ++ if (this.player.distanceToSqr(blockposition.getX(), blockposition.getY(), blockposition.getZ()) < 32 * 32 && this.player.getLevel().isLoadedAndInBounds(blockposition)) { + tileentity = this.player.level.getBlockEntity(blockposition); -+ } else { -+ // failed to find, cleanup -+ nbttagcompound.remove("x"); -+ nbttagcompound.remove("y"); -+ nbttagcompound.remove("z"); + } + // Paper end diff --git a/work/Bukkit b/work/Bukkit index 7902647a6..fc460d1bb 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 7902647a668318b7e04f817e07ae9b955d7c0485 +Subproject commit fc460d1bb8d5f2bc9ff07dad1b7b402eed06d7c4 diff --git a/work/CraftBukkit b/work/CraftBukkit index 2542945ef..a459f4d4f 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 2542945ef49093f6e1041dd817d6f640b7fc25b5 +Subproject commit a459f4d4f5f89e6266be8db2e7facea1cb00b5d0 diff --git a/work/Spigot b/work/Spigot index ffceeae31..42b61526f 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit ffceeae314d56fe07395e3e8f8262c0484d2bbd1 +Subproject commit 42b61526f13ff472e32714d8e7b75fce31cf1151