Updated Upstream (Bukkit/CraftBukkit)

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:
01bb6ba7 PR-936: Add new PersistentDataContainer methods and clean up docs
bc145b90 PR-940: Create registry for banner pattern and cat type

CraftBukkit Changes:
cb2ea54de SPIGOT-7440, PR-1292: Fire EntityTeleportEvent for end gateways
4fea66e44 PR-1299: Add new PersistentDataContainer methods and clean up docs
b483a20db PR-1303: Create registry for banner pattern and cat type
4642dd526 SPIGOT-7535: Fix maps not having an ID and also call MapInitializeEvent in more places
This commit is contained in:
Jake Potrebic 2023-12-08 11:00:39 -08:00
parent f9edc4b1cd
commit 2f92d4e00e
No known key found for this signature in database
GPG Key ID: ECE0B3C133C016C5
146 changed files with 141 additions and 223 deletions

View File

@ -474,10 +474,10 @@ index 26d02aa5da444112f8fa84c07e3080bb669983a1..0cb15350704955f4a1aeff184a8b60d9
private final NamespacedKey key; private final NamespacedKey key;
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
index 3be4214348e72e90f8b59225b3e31db0e6ba7e09..79d1ed1750d9ed843da128a0d047ae455f12ae38 100644 index 6455163261082c444985bc58b188d224517d4529..613cd9c2e91a851c86e339d2be86981b57669311 100644
--- a/src/main/java/org/bukkit/Registry.java --- a/src/main/java/org/bukkit/Registry.java
+++ b/src/main/java/org/bukkit/Registry.java +++ b/src/main/java/org/bukkit/Registry.java
@@ -184,14 +184,14 @@ public interface Registry<T extends Keyed> extends Iterable<T> { @@ -198,14 +198,14 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* *
* @see TrimMaterial * @see TrimMaterial
*/ */
@ -494,7 +494,7 @@ index 3be4214348e72e90f8b59225b3e31db0e6ba7e09..79d1ed1750d9ed843da128a0d047ae45
Registry<TrimPattern> TRIM_PATTERN = Bukkit.getRegistry(TrimPattern.class); Registry<TrimPattern> TRIM_PATTERN = Bukkit.getRegistry(TrimPattern.class);
/** /**
* Villager profession. * Villager profession.
@@ -273,8 +273,11 @@ public interface Registry<T extends Keyed> extends Iterable<T> { @@ -287,8 +287,11 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* *
* @param input non-null input * @param input non-null input
* @return registered object or null if does not exist * @return registered object or null if does not exist

View File

@ -505,10 +505,10 @@ index 0000000000000000000000000000000000000000..1e7b53f9bc13dcd5a0a4a40004591e4f
+ } + }
+} +}
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
index 79d1ed1750d9ed843da128a0d047ae455f12ae38..4a9c196a2caeb7f1b180347b480ed48056ad6a00 100644 index 613cd9c2e91a851c86e339d2be86981b57669311..4331acfc9efd08011e339a1bc0a5190abc197506 100644
--- a/src/main/java/org/bukkit/Registry.java --- a/src/main/java/org/bukkit/Registry.java
+++ b/src/main/java/org/bukkit/Registry.java +++ b/src/main/java/org/bukkit/Registry.java
@@ -248,6 +248,17 @@ public interface Registry<T extends Keyed> extends Iterable<T> { @@ -262,6 +262,17 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* @see GameEvent * @see GameEvent
*/ */
Registry<GameEvent> GAME_EVENT = Objects.requireNonNull(Bukkit.getRegistry(GameEvent.class), "No registry present for GameEvent. This is a bug."); Registry<GameEvent> GAME_EVENT = Objects.requireNonNull(Bukkit.getRegistry(GameEvent.class), "No registry present for GameEvent. This is a bug.");

View File

@ -323,12 +323,12 @@ index adb20a9abba33c32d553f620fa82b27dff64ab5f..1f6702b0de00b87dbed7f6d93e911655
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/entity/Cat.java b/src/main/java/org/bukkit/entity/Cat.java diff --git a/src/main/java/org/bukkit/entity/Cat.java b/src/main/java/org/bukkit/entity/Cat.java
index c2a566b864c82ffb094b7334d9e6e25a1bfc87d1..c340fecb61bac66baf0f44189d21bc85289b1269 100644 index d1327761a4b95eba97877f1991fc19b298b48eaf..9bc385682472418c787481bbc809f238194d5918 100644
--- a/src/main/java/org/bukkit/entity/Cat.java --- a/src/main/java/org/bukkit/entity/Cat.java
+++ b/src/main/java/org/bukkit/entity/Cat.java +++ b/src/main/java/org/bukkit/entity/Cat.java
@@ -54,4 +54,36 @@ public interface Cat extends Tameable, Sittable { @@ -68,4 +68,36 @@ public interface Cat extends Tameable, Sittable {
JELLIE, return key;
ALL_BLACK; }
} }
+ +
+ // Paper Start - More cat api + // Paper Start - More cat api

View File

@ -1,30 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: u9g <winworkswow@gmail.com>
Date: Mon, 3 Jan 2022 23:27:21 -0500
Subject: [PATCH] Add new overload to PersistentDataContainer#has
Adds the new overload: PersistentDataContainer#has(NamespacedKey key)
diff --git a/src/main/java/org/bukkit/persistence/PersistentDataContainer.java b/src/main/java/org/bukkit/persistence/PersistentDataContainer.java
index bf2a957be52d86d07d7d303c86bd3da5fe0a16c0..eebb3da156e2d95efbe22d4afa470b977ce19f10 100644
--- a/src/main/java/org/bukkit/persistence/PersistentDataContainer.java
+++ b/src/main/java/org/bukkit/persistence/PersistentDataContainer.java
@@ -151,4 +151,18 @@ public interface PersistentDataContainer {
*/
@NotNull
PersistentDataAdapterContext getAdapterContext();
+
+ // Paper start
+ /**
+ * Returns if the persistent metadata provider has metadata registered
+ * matching the provided key.
+ *
+ * @param key the key for which existence should be checked.
+ *
+ * @return whether the key exists
+ *
+ * @throws NullPointerException if the key to look up is null
+ */
+ boolean has(@NotNull NamespacedKey key);
+ // Paper end
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] More PotionEffectType API
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
index 4a9c196a2caeb7f1b180347b480ed48056ad6a00..7eef8ba452c7a35d70d07782f288d51b061a2d03 100644 index 4331acfc9efd08011e339a1bc0a5190abc197506..800d23bb249e19d5cf924e7ba36684068624da02 100644
--- a/src/main/java/org/bukkit/Registry.java --- a/src/main/java/org/bukkit/Registry.java
+++ b/src/main/java/org/bukkit/Registry.java +++ b/src/main/java/org/bukkit/Registry.java
@@ -257,6 +257,31 @@ public interface Registry<T extends Keyed> extends Iterable<T> { @@ -271,6 +271,31 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
*/ */
@Deprecated(forRemoval = true) @Deprecated(forRemoval = true)
Registry<io.papermc.paper.world.structure.ConfiguredStructure> CONFIGURED_STRUCTURE = Bukkit.getRegistry(io.papermc.paper.world.structure.ConfiguredStructure.class); Registry<io.papermc.paper.world.structure.ConfiguredStructure> CONFIGURED_STRUCTURE = Bukkit.getRegistry(io.papermc.paper.world.structure.ConfiguredStructure.class);

View File

@ -117,10 +117,10 @@ index 0000000000000000000000000000000000000000..aefbaccd32f1ab25a4da63bdc878922e
+ } + }
+} +}
diff --git a/src/main/java/org/bukkit/entity/Cat.java b/src/main/java/org/bukkit/entity/Cat.java diff --git a/src/main/java/org/bukkit/entity/Cat.java b/src/main/java/org/bukkit/entity/Cat.java
index c340fecb61bac66baf0f44189d21bc85289b1269..97b0d8ccd3fd3a711ec5fa4ce3d8703515895081 100644 index 9bc385682472418c787481bbc809f238194d5918..4ea1027c8540cdba82acf829d0720846b3a13e3e 100644
--- a/src/main/java/org/bukkit/entity/Cat.java --- a/src/main/java/org/bukkit/entity/Cat.java
+++ b/src/main/java/org/bukkit/entity/Cat.java +++ b/src/main/java/org/bukkit/entity/Cat.java
@@ -6,7 +6,7 @@ import org.jetbrains.annotations.NotNull; @@ -8,7 +8,7 @@ import org.jetbrains.annotations.NotNull;
/** /**
* Meow. * Meow.
*/ */
@ -129,7 +129,7 @@ index c340fecb61bac66baf0f44189d21bc85289b1269..97b0d8ccd3fd3a711ec5fa4ce3d87035
/** /**
* Gets the current type of this cat. * Gets the current type of this cat.
@@ -29,6 +29,7 @@ public interface Cat extends Tameable, Sittable { @@ -31,6 +31,7 @@ public interface Cat extends Tameable, Sittable {
* @return the color of the collar * @return the color of the collar
*/ */
@NotNull @NotNull
@ -137,7 +137,7 @@ index c340fecb61bac66baf0f44189d21bc85289b1269..97b0d8ccd3fd3a711ec5fa4ce3d87035
public DyeColor getCollarColor(); public DyeColor getCollarColor();
/** /**
@@ -36,6 +37,7 @@ public interface Cat extends Tameable, Sittable { @@ -38,6 +39,7 @@ public interface Cat extends Tameable, Sittable {
* *
* @param color the color to apply * @param color the color to apply
*/ */

View File

@ -1,40 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Date: Wed, 8 Jun 2022 18:23:17 -0400
Subject: [PATCH] Keyed Cat Type
diff --git a/src/main/java/org/bukkit/entity/Cat.java b/src/main/java/org/bukkit/entity/Cat.java
index 97b0d8ccd3fd3a711ec5fa4ce3d8703515895081..bd74b47879b69b7a2e078a5aca460e5c97b0a919 100644
--- a/src/main/java/org/bukkit/entity/Cat.java
+++ b/src/main/java/org/bukkit/entity/Cat.java
@@ -43,7 +43,7 @@ public interface Cat extends Tameable, Sittable, io.papermc.paper.entity.CollarC
/**
* Represents the various different cat types there are.
*/
- public enum Type {
+ public enum Type implements org.bukkit.Keyed { // Paper
TABBY,
BLACK,
RED,
@@ -55,6 +55,20 @@ public interface Cat extends Tameable, Sittable, io.papermc.paper.entity.CollarC
WHITE,
JELLIE,
ALL_BLACK;
+
+ // Paper start
+ private final org.bukkit.NamespacedKey key;
+
+ Type() {
+ this.key = org.bukkit.NamespacedKey.minecraft(name().toLowerCase(java.util.Locale.ROOT));
+ }
+
+ @NotNull
+ @Override
+ public org.bukkit.NamespacedKey getKey() {
+ return key;
+ }
+ // Paper end
}
// Paper Start - More cat api

View File

@ -6,14 +6,15 @@ Subject: [PATCH] Added byte array serialization/deserialization for
diff --git a/src/main/java/org/bukkit/persistence/PersistentDataContainer.java b/src/main/java/org/bukkit/persistence/PersistentDataContainer.java diff --git a/src/main/java/org/bukkit/persistence/PersistentDataContainer.java b/src/main/java/org/bukkit/persistence/PersistentDataContainer.java
index eebb3da156e2d95efbe22d4afa470b977ce19f10..57609b7793122e135fa0c3b926500849379637b2 100644 index 6c156faf0148da13a44dabba7a807f68b3d50a36..da59e75267f43581bec6df73dda9f889347617d4 100644
--- a/src/main/java/org/bukkit/persistence/PersistentDataContainer.java --- a/src/main/java/org/bukkit/persistence/PersistentDataContainer.java
+++ b/src/main/java/org/bukkit/persistence/PersistentDataContainer.java +++ b/src/main/java/org/bukkit/persistence/PersistentDataContainer.java
@@ -164,5 +164,38 @@ public interface PersistentDataContainer { @@ -184,4 +184,39 @@ public interface PersistentDataContainer {
* @throws NullPointerException if the key to look up is null
*/ */
boolean has(@NotNull NamespacedKey key); @NotNull
PersistentDataAdapterContext getAdapterContext();
+ +
+ // Paper start - byte array serialization
+ /** + /**
+ * Serialize this {@link PersistentDataContainer} instance to a + * Serialize this {@link PersistentDataContainer} instance to a
+ * byte array. + * byte array.
@ -43,8 +44,8 @@ index eebb3da156e2d95efbe22d4afa470b977ce19f10..57609b7793122e135fa0c3b926500849
+ * @param bytes the byte array to read from + * @param bytes the byte array to read from
+ * @throws java.io.IOException if the byte array has an invalid format + * @throws java.io.IOException if the byte array has an invalid format
+ */ + */
+ default void readFromBytes(byte @NotNull [] bytes) throws java.io.IOException { + default void readFromBytes(final byte @NotNull [] bytes) throws java.io.IOException {
+ this.readFromBytes(bytes, true); + this.readFromBytes(bytes, true);
+ } + }
// Paper end + // Paper end - byte array serialization
} }

Some files were not shown because too many files have changed in this diff Show More