From 5fba40cc67871203677254aecb76f62a78fd1ff0 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Tue, 7 Feb 2023 07:55:53 -0800 Subject: [PATCH] Updated Upstream (Bukkit/CraftBukkit) (#8823) --- ...ile-Entities-from-a-chunk-without-sn.patch | 19 ++----------------- .../api/Fix-Spigot-annotation-mistakes.patch | 4 ++-- ...t-isSectionEmpty-int-and-optimize-Pa.patch | 8 ++++---- ...x-checkReach-check-for-Shulker-boxes.patch | 18 ------------------ work/Bukkit | 2 +- work/CraftBukkit | 2 +- 6 files changed, 10 insertions(+), 43 deletions(-) delete mode 100644 patches/server/Fix-checkReach-check-for-Shulker-boxes.patch diff --git a/patches/api/Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch b/patches/api/Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch index b74f35fc79..00ee9d4176 100644 --- a/patches/api/Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch +++ b/patches/api/Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch @@ -8,27 +8,12 @@ diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chun index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/Chunk.java +++ b/src/main/java/org/bukkit/Chunk.java -@@ -0,0 +0,0 @@ - package org.bukkit; - - import java.util.Collection; -+import java.util.function.Predicate; -+ - import org.bukkit.block.Block; - import org.bukkit.block.BlockState; - import org.bukkit.block.data.BlockData; @@ -0,0 +0,0 @@ public interface Chunk extends PersistentDataHolder { - @NotNull - Entity[] getEntities(); - -+ // Paper start - /** - * Get a list of all tile entities in the chunk. - * * @return The tile entities. */ @NotNull - BlockState[] getTileEntities(); ++ // Paper start + default BlockState[] getTileEntities() { + return getTileEntities(true); + } @@ -50,7 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @return The tile entities. + */ + @NotNull -+ Collection getTileEntities(@NotNull Predicate blockPredicate, boolean useSnapshot); ++ Collection getTileEntities(java.util.function.@NotNull Predicate blockPredicate, boolean useSnapshot); + // Paper end /** diff --git a/patches/api/Fix-Spigot-annotation-mistakes.patch b/patches/api/Fix-Spigot-annotation-mistakes.patch index b8b362d303..0c4ad19f14 100644 --- a/patches/api/Fix-Spigot-annotation-mistakes.patch +++ b/patches/api/Fix-Spigot-annotation-mistakes.patch @@ -126,8 +126,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 */ - @Deprecated public NamespacedKey(@NotNull String namespace, @NotNull String key) { - Preconditions.checkArgument(namespace != null && VALID_NAMESPACE.matcher(namespace).matches(), "Invalid namespace. Must be [a-z0-9._-]: %s", namespace); - Preconditions.checkArgument(key != null && VALID_KEY.matcher(key).matches(), "Invalid key. Must be [a-z0-9/._-]: %s", key); + Preconditions.checkArgument(namespace != null && isValidNamespace(namespace), "Invalid namespace. Must be [a-z0-9._-]: %s", namespace); + Preconditions.checkArgument(key != null && isValidKey(key), "Invalid key. Must be [a-z0-9/._-]: %s", key); diff --git a/src/main/java/org/bukkit/NetherWartsState.java b/src/main/java/org/bukkit/NetherWartsState.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/NetherWartsState.java diff --git a/patches/server/Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch b/patches/server/Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch index 5a0fd9bde9..f5a2793375 100644 --- a/patches/server/Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch +++ b/patches/server/Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch @@ -10,10 +10,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java @@ -0,0 +0,0 @@ public class CraftChunk implements Chunk { - PalettedContainerRO>[] biome = (includeBiome || includeBiomeTempRain) ? new PalettedContainer[cs.length] : null; + PalettedContainerRO>[] biome = (includeBiome || includeBiomeTempRain) ? new PalettedContainer[cs.length] : null; - Registry iregistry = this.worldServer.registryAccess().registryOrThrow(Registries.BIOME); -- Codec>> biomeCodec = PalettedContainer.codecRO(iregistry.asHolderIdMap(), iregistry.holderByNameCodec(), PalettedContainer.Strategy.SECTION_BIOMES, iregistry.getHolderOrThrow(Biomes.PLAINS)); + Registry iregistry = this.worldServer.registryAccess().registryOrThrow(Registries.BIOME); +- Codec>> biomeCodec = PalettedContainer.codecRO(iregistry.asHolderIdMap(), iregistry.holderByNameCodec(), PalettedContainer.Strategy.SECTION_BIOMES, iregistry.getHolderOrThrow(Biomes.PLAINS)); for (int i = 0; i < cs.length; i++) { - CompoundTag data = new CompoundTag(); @@ -37,7 +37,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (biome != null) { - data.put("biomes", biomeCodec.encodeStart(NbtOps.INSTANCE, cs[i].getBiomes()).get().left().get()); - biome[i] = biomeCodec.parse(NbtOps.INSTANCE, data.getCompound("biomes")).get().left().get(); -+ biome[i] = ((PalettedContainer>) cs[i].getBiomes()).copy(); // Paper - use copy instead of round tripping with codecs ++ biome[i] = ((PalettedContainer>) cs[i].getBiomes()).copy(); // Paper - use copy instead of round tripping with codecs } } diff --git a/patches/server/Fix-checkReach-check-for-Shulker-boxes.patch b/patches/server/Fix-checkReach-check-for-Shulker-boxes.patch deleted file mode 100644 index 3038e2a4a3..0000000000 --- a/patches/server/Fix-checkReach-check-for-Shulker-boxes.patch +++ /dev/null @@ -1,18 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> -Date: Sun, 4 Apr 2021 14:25:04 -0400 -Subject: [PATCH] Fix checkReach check for Shulker boxes - - -diff --git a/src/main/java/net/minecraft/world/inventory/ShulkerBoxMenu.java b/src/main/java/net/minecraft/world/inventory/ShulkerBoxMenu.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/inventory/ShulkerBoxMenu.java -+++ b/src/main/java/net/minecraft/world/inventory/ShulkerBoxMenu.java -@@ -0,0 +0,0 @@ public class ShulkerBoxMenu extends AbstractContainerMenu { - - @Override - public boolean stillValid(Player player) { -+ if (!this.checkReachable) return true; // Paper - Add reachable override for ContainerShulkerBox - return this.container.stillValid(player); - } - diff --git a/work/Bukkit b/work/Bukkit index 79e3967192..22f8c20898 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 79e3967192566bce29eb6688fc3abafa69a2be24 +Subproject commit 22f8c20898698bdd5fe348404a49d0cad36fef0b diff --git a/work/CraftBukkit b/work/CraftBukkit index ab8ace6857..39462a8985 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit ab8ace68577ab6c0eb2f84b19bbf1adf3ad4a01d +Subproject commit 39462a898595280d1a1c6197c2ad66082434ba80