diff options
Diffstat (limited to 'patches/api')
17 files changed, 152 insertions, 111 deletions
diff --git a/patches/api/0006-Adventure.patch b/patches/api/0006-Adventure.patch index c67a70e9a9..dbb8f58c58 100644 --- a/patches/api/0006-Adventure.patch +++ b/patches/api/0006-Adventure.patch @@ -4880,10 +4880,10 @@ index bd512a7840d4686759097ee4cbd8b375c530956b..f2242ddc4085f7e7cdd748d860857822 + // Paper end - adventure } diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java -index e645a65dbd3340a86f5325dbfd515e0a99f31ab0..940066ec529acc4cb9c8136f15345f100ea9467e 100644 +index 8250821fe7be7987c92edbc36911f88875c470fc..2aadb995ab512086ac41b48df4c724722697e166 100644 --- a/src/main/java/org/bukkit/map/MapCursor.java +++ b/src/main/java/org/bukkit/map/MapCursor.java -@@ -13,7 +13,7 @@ public final class MapCursor { +@@ -17,7 +17,7 @@ public final class MapCursor { private byte x, y; private byte direction; private boolean visible; @@ -4892,7 +4892,7 @@ index e645a65dbd3340a86f5325dbfd515e0a99f31ab0..940066ec529acc4cb9c8136f15345f10 private Type type; /** -@@ -28,7 +28,7 @@ public final class MapCursor { +@@ -32,7 +32,7 @@ public final class MapCursor { */ @Deprecated public MapCursor(byte x, byte y, byte direction, byte type, boolean visible) { @@ -4901,7 +4901,7 @@ index e645a65dbd3340a86f5325dbfd515e0a99f31ab0..940066ec529acc4cb9c8136f15345f10 } /** -@@ -41,7 +41,7 @@ public final class MapCursor { +@@ -45,7 +45,7 @@ public final class MapCursor { * @param visible Whether the cursor is visible by default. */ public MapCursor(byte x, byte y, byte direction, @NotNull Type type, boolean visible) { @@ -4910,7 +4910,7 @@ index e645a65dbd3340a86f5325dbfd515e0a99f31ab0..940066ec529acc4cb9c8136f15345f10 } /** -@@ -53,7 +53,7 @@ public final class MapCursor { +@@ -57,7 +57,7 @@ public final class MapCursor { * @param type The type (color/style) of the map cursor. * @param visible Whether the cursor is visible by default. * @param caption cursor caption @@ -4919,7 +4919,7 @@ index e645a65dbd3340a86f5325dbfd515e0a99f31ab0..940066ec529acc4cb9c8136f15345f10 */ @Deprecated public MapCursor(byte x, byte y, byte direction, byte type, boolean visible, @Nullable String caption) { -@@ -62,8 +62,42 @@ public final class MapCursor { +@@ -66,8 +66,42 @@ public final class MapCursor { setDirection(direction); setRawType(type); this.visible = visible; @@ -4963,7 +4963,7 @@ index e645a65dbd3340a86f5325dbfd515e0a99f31ab0..940066ec529acc4cb9c8136f15345f10 /** * Initialize the map cursor. -@@ -81,7 +115,7 @@ public final class MapCursor { +@@ -85,7 +119,7 @@ public final class MapCursor { setDirection(direction); this.type = type; this.visible = visible; @@ -4972,7 +4972,7 @@ index e645a65dbd3340a86f5325dbfd515e0a99f31ab0..940066ec529acc4cb9c8136f15345f10 } /** -@@ -200,23 +234,45 @@ public final class MapCursor { +@@ -204,23 +238,45 @@ public final class MapCursor { this.visible = visible; } diff --git a/patches/api/0053-Fix-upstream-javadocs.patch b/patches/api/0053-Fix-upstream-javadocs.patch index 97336e4d94..25d3e035cf 100644 --- a/patches/api/0053-Fix-upstream-javadocs.patch +++ b/patches/api/0053-Fix-upstream-javadocs.patch @@ -607,18 +607,18 @@ index af5110b4160979c39cc1e5de6fa3bd7957b21403..15a0a733b0e5804655b5957cbf208312 * @param location the location to remove * @see #getExploredLocations() diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java -index 6bf3af3ed81b66f61e53105d3591165ea74dba0e..a91400cd8bb4c72d1f3200a17f6de025540fe09d 100644 +index 45dd54afa6d6f3d9895ef52f13076d3351036e4b..cfa0d4809f9bb4ac150251efa85ba4d1808ab1b2 100644 --- a/src/main/java/org/bukkit/entity/Villager.java +++ b/src/main/java/org/bukkit/entity/Villager.java -@@ -202,7 +202,7 @@ public interface Villager extends AbstractVillager { +@@ -228,7 +228,7 @@ public interface Villager extends AbstractVillager { */ - NITWIT, + Profession NITWIT = getProfession("nitwit"); /** - * Sheperd profession. Wears a brown robe. Shepherds primarily trade for + * Shepherd profession. Wears a brown robe. Shepherds primarily trade for * wool items, and shears. */ - SHEPHERD, + Profession SHEPHERD = getProfession("shepherd"); diff --git a/src/main/java/org/bukkit/event/block/BlockDropItemEvent.java b/src/main/java/org/bukkit/event/block/BlockDropItemEvent.java index a0f6f1af304190b4c5db4b284d460f625eeb7801..7e21548cac8515c281ec86853e9272ab7695b24f 100644 --- a/src/main/java/org/bukkit/event/block/BlockDropItemEvent.java @@ -647,10 +647,10 @@ index a0f6f1af304190b4c5db4b284d460f625eeb7801..7e21548cac8515c281ec86853e9272ab * The Block is already broken as this event is called, so #getBlock() will be * AIR in most cases. Use #getBlockState() for more Information about the broken diff --git a/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java b/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java -index e534954457a9961a26dbec7ac035bec07e1d6694..a7c297364805c58ae16895055d8eae0484384b7d 100644 +index 1df172c0bb48de3b143179a3f0c63d6ecc30649e..254d549f956053af4264ca3a52d34a97ede4273d 100644 --- a/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java -@@ -13,6 +13,9 @@ import org.jetbrains.annotations.NotNull; +@@ -14,6 +14,9 @@ import org.jetbrains.annotations.NotNull; * Note that due to the nature of explosions, {@link #getBlock()} will always be * an air block. {@link #getExplodedBlockState()} should be used to get * information about the block state that exploded. @@ -660,14 +660,6 @@ index e534954457a9961a26dbec7ac035bec07e1d6694..a7c297364805c58ae16895055d8eae04 */ public class BlockExplodeEvent extends BlockEvent implements Cancellable { private static final HandlerList handlers = new HandlerList(); -@@ -29,6 +32,7 @@ public class BlockExplodeEvent extends BlockEvent implements Cancellable { - this.cancel = false; - } - -+ @io.papermc.paper.annotation.DoNotUse // Paper - @Deprecated(forRemoval = true) - public BlockExplodeEvent(@NotNull final Block what, @NotNull final List<Block> blocks, final float yield) { - this(what, what.getState(), blocks, yield); diff --git a/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java b/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java index 340fa397e68c024df380a28db21545a0c83d9fa6..79ac8a5db689cf9f8e2ff4cb7c06df6989128d10 100644 --- a/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java @@ -721,7 +713,7 @@ index a37febd0d4dd5b733e9ee72628fdf9395fec4367..9cee218b9ee14688356f16b1f5851218 */ public class AreaEffectCloudApplyEvent extends EntityEvent implements Cancellable { diff --git a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java -index 90b287cd2cc6f05bb0c588d8be397cf52a7822de..15cb5ea4b68eca070f73d2b899543274415ad240 100644 +index d3f93163fb3108f42e542c22e437c9cb8289f0e8..1e2bb345d19ebe03589d85bdab13021b6fa2ed98 100644 --- a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java +++ b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java @@ -158,11 +158,12 @@ public class CreatureSpawnEvent extends EntitySpawnEvent { @@ -765,10 +757,10 @@ index 573165ddf3368a96e1ffc6476eb27c9e29a6f86e..148c4aad384ae8e3b8b22d264a84bddf * @return the block state */ diff --git a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java -index 10d0e18dfd423b108fe381e8142867eb10399359..099efafa14c10910e4ed04abb1823f0c1a96b6a6 100644 +index fc2158793aec67310bc8d06ac1f0bac39d2a5c3d..50161d313cfcc9e61441589685c3d0e1f057dd86 100644 --- a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java -@@ -9,7 +9,9 @@ import org.bukkit.event.HandlerList; +@@ -10,7 +10,9 @@ import org.bukkit.event.HandlerList; import org.jetbrains.annotations.NotNull; /** diff --git a/patches/api/0165-Fixes-and-additions-to-the-spawn-reason-API.patch b/patches/api/0165-Fixes-and-additions-to-the-spawn-reason-API.patch index 703394db19..db12377963 100644 --- a/patches/api/0165-Fixes-and-additions-to-the-spawn-reason-API.patch +++ b/patches/api/0165-Fixes-and-additions-to-the-spawn-reason-API.patch @@ -30,7 +30,7 @@ index 99e1f17fddf9cebe7057998d1635804c55f18312..c3387a88a16cfd9157ade5d8a06eae25 // Paper end } diff --git a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java -index 15cb5ea4b68eca070f73d2b899543274415ad240..2de81ee445824562aec7b52b7369b75280aab959 100644 +index 1e2bb345d19ebe03589d85bdab13021b6fa2ed98..6ff1988092de06f9d751cd40da521c2ed6e2e4bd 100644 --- a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java +++ b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java @@ -206,6 +206,12 @@ public class CreatureSpawnEvent extends EntitySpawnEvent { @@ -44,5 +44,5 @@ index 15cb5ea4b68eca070f73d2b899543274415ad240..2de81ee445824562aec7b52b7369b752 + OMINOUS_ITEM_SPAWNER, + // Paper end - Fixes and additions to the SpawnReason API /** - * When a creature is spawned by plugins - */ + * When a creature is spawned by a potion effect, for example: + * {@link org.bukkit.potion.PotionType#OOZING}, {@link org.bukkit.potion.PotionType#INFESTED} diff --git a/patches/api/0166-Fix-Spigot-annotation-mistakes.patch b/patches/api/0166-Fix-Spigot-annotation-mistakes.patch index a496266a07..da580bdf21 100644 --- a/patches/api/0166-Fix-Spigot-annotation-mistakes.patch +++ b/patches/api/0166-Fix-Spigot-annotation-mistakes.patch @@ -453,7 +453,7 @@ index 48aecc9421c500137bbef1dfe3bec8de277c3ff9..aff858346776386f1288b648b221404f return note; } diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java -index f1a7f3b3e20963fa9d97bcc0686a35863de2b60f..3effaea369d9c7a6a22979fbfc270f55f9f25cf2 100644 +index 3bd96bbd35b657a6030d744e86622e616c2c3b08..5529e227781cd2411de9c6581a1cb1255ce9bb20 100644 --- a/src/main/java/org/bukkit/Registry.java +++ b/src/main/java/org/bukkit/Registry.java @@ -220,14 +220,12 @@ public interface Registry<T extends Keyed> extends Iterable<T> { @@ -471,7 +471,7 @@ index f1a7f3b3e20963fa9d97bcc0686a35863de2b60f..3effaea369d9c7a6a22979fbfc270f55 Registry<TrimPattern> TRIM_PATTERN = Bukkit.getRegistry(TrimPattern.class); /** * Damage types. -@@ -336,8 +334,11 @@ public interface Registry<T extends Keyed> extends Iterable<T> { +@@ -335,8 +333,11 @@ public interface Registry<T extends Keyed> extends Iterable<T> { * * @param input non-null input * @return registered object or null if does not exist @@ -1823,10 +1823,10 @@ index edef478786bb7456af29ca960009873095830050..e8ac449e6280827beb6d2699df75b1d5 /** diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java -index 940066ec529acc4cb9c8136f15345f100ea9467e..82993302cb3cf62ad4a94a0ebaa7711cc4d8e550 100644 +index 2aadb995ab512086ac41b48df4c724722697e166..4d96cf385fa5c6d80097bdf6282be5f0eed73307 100644 --- a/src/main/java/org/bukkit/map/MapCursor.java +++ b/src/main/java/org/bukkit/map/MapCursor.java -@@ -159,9 +159,9 @@ public final class MapCursor { +@@ -163,9 +163,9 @@ public final class MapCursor { * Get the type of this cursor. * * @return The type (color/style) of the map cursor. @@ -1836,9 +1836,9 @@ index 940066ec529acc4cb9c8136f15345f100ea9467e..82993302cb3cf62ad4a94a0ebaa7711c - @Deprecated + @org.jetbrains.annotations.ApiStatus.Internal // Paper public byte getRawType() { - return type.value; + return type.getValue(); } -@@ -216,9 +216,9 @@ public final class MapCursor { +@@ -220,9 +220,9 @@ public final class MapCursor { * Set the type of this cursor. * * @param type The type (color/style) of the map cursor. @@ -1850,7 +1850,7 @@ index 940066ec529acc4cb9c8136f15345f100ea9467e..82993302cb3cf62ad4a94a0ebaa7711c public void setRawType(byte type) { Type enumType = Type.byValue(type); Preconditions.checkArgument(enumType != null, "Unknown type by id %s", type); -@@ -337,9 +337,9 @@ public final class MapCursor { +@@ -336,9 +336,9 @@ public final class MapCursor { * Gets the internal value of the cursor. * * @return the value @@ -1859,10 +1859,10 @@ index 940066ec529acc4cb9c8136f15345f100ea9467e..82993302cb3cf62ad4a94a0ebaa7711c */ - @Deprecated + @org.jetbrains.annotations.ApiStatus.Internal // Paper - public byte getValue() { - return value; - } -@@ -349,9 +349,9 @@ public final class MapCursor { + byte getValue(); + + /** +@@ -346,9 +346,9 @@ public final class MapCursor { * * @param value the value * @return the matching type @@ -1872,7 +1872,7 @@ index 940066ec529acc4cb9c8136f15345f100ea9467e..82993302cb3cf62ad4a94a0ebaa7711c - @Deprecated + @org.jetbrains.annotations.ApiStatus.Internal // Paper @Nullable - public static Type byValue(byte value) { + static Type byValue(byte value) { for (Type t : values()) { diff --git a/src/main/java/org/bukkit/map/MapPalette.java b/src/main/java/org/bukkit/map/MapPalette.java index 3a9aaca2e76411a9c27f9f5e0f22d060d5a66d06..c80faa079eca1564847070f0338fc98024639829 100644 diff --git a/patches/api/0186-Villager-Restocks-API.patch b/patches/api/0186-Villager-Restocks-API.patch index 5b3898429d..39c67cae0f 100644 --- a/patches/api/0186-Villager-Restocks-API.patch +++ b/patches/api/0186-Villager-Restocks-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Villager Restocks API diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java -index a91400cd8bb4c72d1f3200a17f6de025540fe09d..4128b848ec739308694d54d9e859c28185f42a63 100644 +index cfa0d4809f9bb4ac150251efa85ba4d1808ab1b2..ecb0f32a4449f8000248c4bebf89a56df186899f 100644 --- a/src/main/java/org/bukkit/entity/Villager.java +++ b/src/main/java/org/bukkit/entity/Villager.java -@@ -78,6 +78,20 @@ public interface Villager extends AbstractVillager { +@@ -82,6 +82,20 @@ public interface Villager extends AbstractVillager { */ public void setVillagerExperience(int experience); diff --git a/patches/api/0188-Add-villager-reputation-API.patch b/patches/api/0188-Add-villager-reputation-API.patch index c1e5f71d27..407a8007aa 100644 --- a/patches/api/0188-Add-villager-reputation-API.patch +++ b/patches/api/0188-Add-villager-reputation-API.patch @@ -110,20 +110,20 @@ index 0000000000000000000000000000000000000000..5600fcdc9795a9f49091db48d73bbd49 + TRADING, +} diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java -index 4128b848ec739308694d54d9e859c28185f42a63..49db82ceff5e2c5f6414045648d68bd384c857c8 100644 +index ecb0f32a4449f8000248c4bebf89a56df186899f..d839630d7b2e51629e52edf24e7c6dd86b5f58f6 100644 --- a/src/main/java/org/bukkit/entity/Villager.java +++ b/src/main/java/org/bukkit/entity/Villager.java -@@ -1,6 +1,8 @@ - package org.bukkit.entity; - +@@ -3,6 +3,8 @@ package org.bukkit.entity; + import com.google.common.base.Preconditions; + import com.google.common.collect.Lists; import java.util.Locale; +import java.util.Map; // Paper +import java.util.UUID; // Paper import org.bukkit.Keyed; import org.bukkit.Location; import org.bukkit.NamespacedKey; -@@ -242,4 +244,50 @@ public interface Villager extends AbstractVillager { - return key; +@@ -289,4 +291,50 @@ public interface Villager extends AbstractVillager { + return Lists.newArrayList(Registry.VILLAGER_PROFESSION).toArray(new Profession[0]); } } + diff --git a/patches/api/0202-Add-methods-to-get-translation-keys.patch b/patches/api/0202-Add-methods-to-get-translation-keys.patch index fa62b17b92..0cc7a454f5 100644 --- a/patches/api/0202-Add-methods-to-get-translation-keys.patch +++ b/patches/api/0202-Add-methods-to-get-translation-keys.patch @@ -420,27 +420,27 @@ index d248069adfc67eb840951f7ab4a1fa5d30214dec..976f701ed9b9873945a5628173c580e2 * Gets if this EntityType is enabled by feature in a world. * diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java -index 49db82ceff5e2c5f6414045648d68bd384c857c8..b3957b3ff64f35fdeb2daa2ed1fb34fd65e24693 100644 +index d839630d7b2e51629e52edf24e7c6dd86b5f58f6..0759f66986cec2c7e3f765aaa5b1654b5ed9f4b5 100644 --- a/src/main/java/org/bukkit/entity/Villager.java +++ b/src/main/java/org/bukkit/entity/Villager.java -@@ -160,7 +160,7 @@ public interface Villager extends AbstractVillager { +@@ -185,7 +185,7 @@ public interface Villager extends AbstractVillager { * Represents the various different Villager professions there may be. * Villagers have different trading options depending on their profession, */ -- public enum Profession implements Keyed { -+ public enum Profession implements Keyed, net.kyori.adventure.translation.Translatable { // Paper - NONE, +- interface Profession extends OldEnum<Profession>, Keyed { ++ interface Profession extends OldEnum<Profession>, Keyed, net.kyori.adventure.translation.Translatable { + + Profession NONE = getProfession("none"); /** - * Armorer profession. Wears a black apron. Armorers primarily trade for -@@ -243,6 +243,13 @@ public interface Villager extends AbstractVillager { - public NamespacedKey getKey() { - return key; +@@ -290,6 +290,13 @@ public interface Villager extends AbstractVillager { + static Profession[] values() { + return Lists.newArrayList(Registry.VILLAGER_PROFESSION).toArray(new Profession[0]); } + + // Paper start + @Override -+ public @NotNull String translationKey() { -+ return "entity.minecraft.villager." + this.key.getKey(); ++ default @NotNull String translationKey() { ++ return "entity.minecraft.villager." + this.getKey().getKey(); + } + // Paper end } diff --git a/patches/api/0236-Add-RegistryAccess-for-managing-registries.patch b/patches/api/0236-Add-RegistryAccess-for-managing-registries.patch index 768538fece..f0864c18fa 100644 --- a/patches/api/0236-Add-RegistryAccess-for-managing-registries.patch +++ b/patches/api/0236-Add-RegistryAccess-for-managing-registries.patch @@ -206,7 +206,7 @@ index e0f652117e585882693736de8165ae9c689e1d68..fbe14c327ee9c1ac07893853ca7c699e return server.getRegistry(tClass); } diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java -index 3effaea369d9c7a6a22979fbfc270f55f9f25cf2..93e898c14728491a59bb2d08aff0dd678feef26a 100644 +index 5529e227781cd2411de9c6581a1cb1255ce9bb20..f99e68f160deba42e2833fa0f81df4c17bf68ec7 100644 --- a/src/main/java/org/bukkit/Registry.java +++ b/src/main/java/org/bukkit/Registry.java @@ -102,7 +102,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> { @@ -218,7 +218,13 @@ index 3effaea369d9c7a6a22979fbfc270f55f9f25cf2..93e898c14728491a59bb2d08aff0dd67 /** * Custom boss bars. * -@@ -139,8 +139,10 @@ public interface Registry<T extends Keyed> extends Iterable<T> { +@@ -134,13 +134,15 @@ public interface Registry<T extends Keyed> extends Iterable<T> { + * + * @see Cat.Type + */ +- Registry<Cat.Type> CAT_VARIANT = Objects.requireNonNull(Bukkit.getRegistry(Cat.Type.class), "No registry present for Cat Type. This is a bug."); ++ Registry<Cat.Type> CAT_VARIANT = io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(io.papermc.paper.registry.RegistryKey.CAT_VARIANT); // Paper + /** * Server enchantments. * * @see Enchantment @@ -276,7 +282,7 @@ index 3effaea369d9c7a6a22979fbfc270f55f9f25cf2..93e898c14728491a59bb2d08aff0dd67 /** * Sound keys. * -@@ -219,28 +223,35 @@ public interface Registry<T extends Keyed> extends Iterable<T> { +@@ -219,40 +223,47 @@ public interface Registry<T extends Keyed> extends Iterable<T> { * Trim materials. * * @see TrimMaterial @@ -317,7 +323,27 @@ index 3effaea369d9c7a6a22979fbfc270f55f9f25cf2..93e898c14728491a59bb2d08aff0dd67 /** * Villager profession. * -@@ -294,8 +305,10 @@ public interface Registry<T extends Keyed> extends Iterable<T> { + * @see Villager.Profession + */ +- Registry<Villager.Profession> VILLAGER_PROFESSION = Objects.requireNonNull(Bukkit.getRegistry(Villager.Profession.class), "No registry present for Villager Profession. This is a bug."); ++ Registry<Villager.Profession> VILLAGER_PROFESSION = io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(io.papermc.paper.registry.RegistryKey.VILLAGER_PROFESSION); // Paper + /** + * Villager type. + * + * @see Villager.Type + */ +- Registry<Villager.Type> VILLAGER_TYPE = Objects.requireNonNull(Bukkit.getRegistry(Villager.Type.class), "No registry present for Villager Type. This is a bug."); ++ Registry<Villager.Type> VILLAGER_TYPE = io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(io.papermc.paper.registry.RegistryKey.VILLAGER_TYPE); // Paper + /** + * Memory Keys. + * +@@ -289,25 +300,27 @@ public interface Registry<T extends Keyed> extends Iterable<T> { + * + * @see Frog.Variant + */ +- Registry<Frog.Variant> FROG_VARIANT = Objects.requireNonNull(Bukkit.getRegistry(Frog.Variant.class), "No registry present for Frog Variant. This is a bug."); ++ Registry<Frog.Variant> FROG_VARIANT = io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(io.papermc.paper.registry.RegistryKey.FROG_VARIANT); // Paper + /** * Wolf variants. * * @see Wolf.Variant @@ -329,7 +355,12 @@ index 3effaea369d9c7a6a22979fbfc270f55f9f25cf2..93e898c14728491a59bb2d08aff0dd67 /** * Map cursor types. * -@@ -308,7 +321,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> { + * @see MapCursor.Type + */ +- Registry<MapCursor.Type> MAP_DECORATION_TYPE = Objects.requireNonNull(Bukkit.getRegistry(MapCursor.Type.class), "No registry present for MapCursor Type. This is a bug."); ++ Registry<MapCursor.Type> MAP_DECORATION_TYPE = io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(io.papermc.paper.registry.RegistryKey.MAP_DECORATION_TYPE); // Paper + /** + * Game events. * * @see GameEvent */ diff --git a/patches/api/0287-Missing-Entity-API.patch b/patches/api/0287-Missing-Entity-API.patch index 806c30e4a0..a6478a10f4 100644 --- a/patches/api/0287-Missing-Entity-API.patch +++ b/patches/api/0287-Missing-Entity-API.patch @@ -258,11 +258,11 @@ index adb20a9abba33c32d553f620fa82b27dff64ab5f..1f6702b0de00b87dbed7f6d93e911655 + // Paper end } diff --git a/src/main/java/org/bukkit/entity/Cat.java b/src/main/java/org/bukkit/entity/Cat.java -index d1327761a4b95eba97877f1991fc19b298b48eaf..0534fbc228f64cf3b361ab097d9b88212bdb0f36 100644 +index 117e3e8c63e56247213b2a9cf9908915d4c65665..70cc76f0c1f4ba23bfa78591e8144bbf8d3f0868 100644 --- a/src/main/java/org/bukkit/entity/Cat.java +++ b/src/main/java/org/bukkit/entity/Cat.java -@@ -68,4 +68,36 @@ public interface Cat extends Tameable, Sittable { - return key; +@@ -94,4 +94,36 @@ public interface Cat extends Tameable, Sittable { + return Lists.newArrayList(Registry.CAT_VARIANT).toArray(new Type[0]); } } + diff --git a/patches/api/0329-More-PotionEffectType-API.patch b/patches/api/0329-More-PotionEffectType-API.patch index 7a43cc36d6..d80151aec0 100644 --- a/patches/api/0329-More-PotionEffectType-API.patch +++ b/patches/api/0329-More-PotionEffectType-API.patch @@ -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 -index 93e898c14728491a59bb2d08aff0dd678feef26a..17714f04fdd87ed4332ea62bcfab7063560bf1be 100644 +index a583d26883c8b7012203e128cd64113df94307c1..4d3e0b90579b33ff93fc565e8ee99a01b690c62b 100644 --- a/src/main/java/org/bukkit/Registry.java +++ b/src/main/java/org/bukkit/Registry.java -@@ -322,6 +322,33 @@ public interface Registry<T extends Keyed> extends Iterable<T> { +@@ -321,6 +321,33 @@ public interface Registry<T extends Keyed> extends Iterable<T> { * @see GameEvent */ Registry<GameEvent> GAME_EVENT = io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(io.papermc.paper.registry.RegistryKey.GAME_EVENT); // Paper diff --git a/patches/api/0346-Add-EntityDyeEvent-and-CollarColorable-interface.patch b/patches/api/0346-Add-EntityDyeEvent-and-CollarColorable-interface.patch index e7a4ad2089..1f45df36c7 100644 --- a/patches/api/0346-Add-EntityDyeEvent-and-CollarColorable-interface.patch +++ b/patches/api/0346-Add-EntityDyeEvent-and-CollarColorable-interface.patch @@ -123,10 +123,10 @@ index 0000000000000000000000000000000000000000..c43a3ad32902dbb13287e80137521374 + } +} diff --git a/src/main/java/org/bukkit/entity/Cat.java b/src/main/java/org/bukkit/entity/Cat.java -index 0534fbc228f64cf3b361ab097d9b88212bdb0f36..d03adfaa4176617ef2ace2754fe02b63860e3aee 100644 +index 70cc76f0c1f4ba23bfa78591e8144bbf8d3f0868..60cf07bff0898176c8d7af84b3e65d7a1ee8cf2e 100644 --- a/src/main/java/org/bukkit/entity/Cat.java +++ b/src/main/java/org/bukkit/entity/Cat.java -@@ -8,7 +8,7 @@ import org.jetbrains.annotations.NotNull; +@@ -13,7 +13,7 @@ import org.jetbrains.annotations.NotNull; /** * Meow. */ @@ -135,7 +135,7 @@ index 0534fbc228f64cf3b361ab097d9b88212bdb0f36..d03adfaa4176617ef2ace2754fe02b63 /** * Gets the current type of this cat. -@@ -31,6 +31,7 @@ public interface Cat extends Tameable, Sittable { +@@ -36,6 +36,7 @@ public interface Cat extends Tameable, Sittable { * @return the color of the collar */ @NotNull @@ -143,7 +143,7 @@ index 0534fbc228f64cf3b361ab097d9b88212bdb0f36..d03adfaa4176617ef2ace2754fe02b63 public DyeColor getCollarColor(); /** -@@ -38,6 +39,7 @@ public interface Cat extends Tameable, Sittable { +@@ -43,6 +44,7 @@ public interface Cat extends Tameable, Sittable { * * @param color the color to apply */ diff --git a/patches/api/0374-More-vanilla-friendly-methods-to-update-trades.patch b/patches/api/0374-More-vanilla-friendly-methods-to-update-trades.patch index 94bc35ba9a..dcad21ff69 100644 --- a/patches/api/0374-More-vanilla-friendly-methods-to-update-trades.patch +++ b/patches/api/0374-More-vanilla-friendly-methods-to-update-trades.patch @@ -5,10 +5,10 @@ Subject: [PATCH] More vanilla friendly methods to update trades diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java -index b3957b3ff64f35fdeb2daa2ed1fb34fd65e24693..48c8af31b2bdc849b5269784ff3829ba31fb3f47 100644 +index 0759f66986cec2c7e3f765aaa5b1654b5ed9f4b5..444744ea6f5921b0ae229995f8b15ea9d980c402 100644 --- a/src/main/java/org/bukkit/entity/Villager.java +++ b/src/main/java/org/bukkit/entity/Villager.java -@@ -60,8 +60,11 @@ public interface Villager extends AbstractVillager { +@@ -64,8 +64,11 @@ public interface Villager extends AbstractVillager { * A villager with a level of 1 and no experience is liable to lose its * profession. * @@ -20,7 +20,7 @@ index b3957b3ff64f35fdeb2daa2ed1fb34fd65e24693..48c8af31b2bdc849b5269784ff3829ba */ public void setVillagerLevel(int level); -@@ -81,6 +84,34 @@ public interface Villager extends AbstractVillager { +@@ -85,6 +88,34 @@ public interface Villager extends AbstractVillager { public void setVillagerExperience(int experience); // Paper start diff --git a/patches/api/0384-Improve-PortalEvents.patch b/patches/api/0384-Improve-PortalEvents.patch index 87e49ffb0e..88c76230fd 100644 --- a/patches/api/0384-Improve-PortalEvents.patch +++ b/patches/api/0384-Improve-PortalEvents.patch @@ -84,13 +84,21 @@ index 6818e9f0ba32ca1a1e612703f7526b29f5a6438f..d3724db0a5a67cde15b05fecd32b2ca3 @Override public HandlerList getHandlers() { diff --git a/src/main/java/org/bukkit/event/entity/EntityPortalEvent.java b/src/main/java/org/bukkit/event/entity/EntityPortalEvent.java -index 67fb9d93e808e907fa980f3004d415ae5d0a53fc..97e36c7f6e09276fbae20eaeee0965566332ca46 100644 +index d70400236b08217ba675e560877f951ea4f143ca..4544e7e155619a6ae31cbb2999ae3dedfd3b5f4b 100644 --- a/src/main/java/org/bukkit/event/entity/EntityPortalEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityPortalEvent.java -@@ -15,15 +15,58 @@ import org.jetbrains.annotations.Nullable; - public class EntityPortalEvent extends EntityTeleportEvent { - private static final HandlerList handlers = new HandlerList(); +@@ -3,6 +3,7 @@ package org.bukkit.event.entity; + import org.bukkit.Location; + import org.bukkit.entity.Entity; + import org.bukkit.event.HandlerList; ++import org.jetbrains.annotations.ApiStatus; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + +@@ -17,23 +18,68 @@ public class EntityPortalEvent extends EntityTeleportEvent { private int searchRadius = 128; + private boolean canCreatePortal = true; + private int creationRadius = 16; + private final org.bukkit.PortalType type; // Paper public EntityPortalEvent(@NotNull final Entity entity, @NotNull final Location from, @Nullable final Location to) { @@ -102,15 +110,24 @@ index 67fb9d93e808e907fa980f3004d415ae5d0a53fc..97e36c7f6e09276fbae20eaeee096556 super(entity, from, to); this.searchRadius = searchRadius; + this.type = org.bukkit.PortalType.CUSTOM; // Paper + } + + public EntityPortalEvent(@NotNull Entity entity, @NotNull Location from, @Nullable Location to, int searchRadius, boolean canCreatePortal, int creationRadius) { ++ // Paper start ++ this(entity, from, to, searchRadius, canCreatePortal, creationRadius, org.bukkit.PortalType.CUSTOM); + } + -+ // Paper start -+ public EntityPortalEvent(@NotNull Entity entity, @NotNull Location from, @Nullable Location to, int searchRadius, final @NotNull org.bukkit.PortalType portalType) { -+ super(entity, from, to); -+ this.searchRadius = searchRadius; ++ @ApiStatus.Internal ++ public EntityPortalEvent(@NotNull Entity entity, @NotNull Location from, @Nullable Location to, int searchRadius, boolean canCreatePortal, int creationRadius, final @NotNull org.bukkit.PortalType portalType) { + super(entity, from, to); + this.type = portalType; -+ } -+ ++ // Paper end + this.searchRadius = searchRadius; + this.canCreatePortal = canCreatePortal; + this.creationRadius = creationRadius; + } + ++ // Paper start + /** + * Get the portal type relating to this event. + * @@ -142,11 +159,12 @@ index 67fb9d93e808e907fa980f3004d415ae5d0a53fc..97e36c7f6e09276fbae20eaeee096556 + @Override + public void setTo(@Nullable final Location to) { + super.setTo(to); - } ++ } + // Paper end - ++ /** * Set the Block radius to search in for available portals. + * diff --git a/src/main/java/org/bukkit/event/player/PlayerPortalEvent.java b/src/main/java/org/bukkit/event/player/PlayerPortalEvent.java index 57eeeafae84f83a939925820e827769749ff27ec..929a997671de8202efb9da97fbf9b4a0bf7c37e8 100644 --- a/src/main/java/org/bukkit/event/player/PlayerPortalEvent.java diff --git a/patches/api/0430-Experimental-annotations-change.patch b/patches/api/0430-Experimental-annotations-change.patch index 5144abda5f..59788de534 100644 --- a/patches/api/0430-Experimental-annotations-change.patch +++ b/patches/api/0430-Experimental-annotations-change.patch @@ -196,33 +196,33 @@ index e404cd1e2ba44e4c2d09524bc7cf730d8ffbdabd..cea0ebf50876dd32ab7fba6025b30f29 public interface BundleMeta extends ItemMeta { diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java -index 82993302cb3cf62ad4a94a0ebaa7711cc4d8e550..bd37310d27e73bfe65d680594f3a9be8577a72a0 100644 +index 4d96cf385fa5c6d80097bdf6282be5f0eed73307..fb6b1491202bbc1ea0d5475c9c6574b0c16943b4 100644 --- a/src/main/java/org/bukkit/map/MapCursor.java +++ b/src/main/java/org/bukkit/map/MapCursor.java -@@ -309,12 +309,26 @@ public final class MapCursor { - BANNER_RED(24, "banner_red"), - BANNER_BLACK(25, "banner_black"), - RED_X(26, "red_x"), +@@ -314,12 +314,26 @@ public final class MapCursor { + Type BANNER_RED = getType("banner_red"); + Type BANNER_BLACK = getType("banner_black"); + Type RED_X = getType("red_x"); + @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.TRADE_REBALANCE) // Paper - add missing annotation + @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation - VILLAGE_DESERT(27, "village_desert"), + Type VILLAGE_DESERT = getType("village_desert"); + @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.TRADE_REBALANCE) // Paper - add missing annotation + @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation - VILLAGE_PLAINS(28, "village_plains"), + Type VILLAGE_PLAINS = getType("village_plains"); + @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.TRADE_REBALANCE) // Paper - add missing annotation + @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation - VILLAGE_SAVANNA(29, "village_savanna"), + Type VILLAGE_SAVANNA = getType("village_savanna"); + @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.TRADE_REBALANCE) // Paper - add missing annotation + @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation - VILLAGE_SNOWY(30, "village_snowy"), + Type VILLAGE_SNOWY = getType("village_snowy"); + @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.TRADE_REBALANCE) // Paper - add missing annotation + @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation - VILLAGE_TAIGA(31, "village_taiga"), + Type VILLAGE_TAIGA = getType("village_taiga"); + @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.TRADE_REBALANCE) // Paper - add missing annotation + @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation - JUNGLE_TEMPLE(32, "jungle_temple"), + Type JUNGLE_TEMPLE = getType("jungle_temple"); + @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.TRADE_REBALANCE) // Paper - add missing annotation + @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation - SWAMP_HUT(33, "swamp_hut"), - TRIAL_CHAMBERS(34, "trial_chambers") - ; + Type SWAMP_HUT = getType("swamp_hut"); + Type TRIAL_CHAMBERS = getType("trial_chambers"); + diff --git a/patches/api/0432-Improve-Registry.patch b/patches/api/0432-Improve-Registry.patch index d5cb134c45..4c5275651a 100644 --- a/patches/api/0432-Improve-Registry.patch +++ b/patches/api/0432-Improve-Registry.patch @@ -31,10 +31,10 @@ index 62d2b3f950860dee0898d77b0a29635c3f9a7e23..704dba92f9246ef398ed8d162ebee3cf @Override public @NotNull String translationKey() { diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java -index 17714f04fdd87ed4332ea62bcfab7063560bf1be..27b987db385a594fede4e884b6437dc363f6e817 100644 +index 4d3e0b90579b33ff93fc565e8ee99a01b690c62b..36a8f6082f111a1cbb25e0ff3c968a89f02611a0 100644 --- a/src/main/java/org/bukkit/Registry.java +++ b/src/main/java/org/bukkit/Registry.java -@@ -358,6 +358,79 @@ public interface Registry<T extends Keyed> extends Iterable<T> { +@@ -357,6 +357,79 @@ public interface Registry<T extends Keyed> extends Iterable<T> { @Nullable T get(@NotNull NamespacedKey key); @@ -114,7 +114,7 @@ index 17714f04fdd87ed4332ea62bcfab7063560bf1be..27b987db385a594fede4e884b6437dc3 /** * Returns a new stream, which contains all registry items, which are registered to the registry. * -@@ -432,5 +505,12 @@ public interface Registry<T extends Keyed> extends Iterable<T> { +@@ -431,5 +504,12 @@ public interface Registry<T extends Keyed> extends Iterable<T> { public Class<T> getType() { return this.type; } diff --git a/patches/api/0452-Clone-mutables-to-prevent-unexpected-issues.patch b/patches/api/0452-Clone-mutables-to-prevent-unexpected-issues.patch index e99c290635..86b3ab4bcf 100644 --- a/patches/api/0452-Clone-mutables-to-prevent-unexpected-issues.patch +++ b/patches/api/0452-Clone-mutables-to-prevent-unexpected-issues.patch @@ -37,10 +37,10 @@ index 1a9575ad4c81aefa5ef0b927f6ac8f7064b55c49..24e1a49e48dd8f9eb2515b2ffe472a0c @NotNull diff --git a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java -index 099efafa14c10910e4ed04abb1823f0c1a96b6a6..8506fa03293c575c35b55b052224807470fdbd98 100644 +index 50161d313cfcc9e61441589685c3d0e1f057dd86..e468e55d426b8f81f87c0a08451d02b3866c226f 100644 --- a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java -@@ -59,7 +59,7 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable { +@@ -72,7 +72,7 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable { */ @NotNull public Location getLocation() { diff --git a/patches/api/0475-Registry-Modification-API.patch b/patches/api/0475-Registry-Modification-API.patch index 9ad8ef719b..6dbb9e7e65 100644 --- a/patches/api/0475-Registry-Modification-API.patch +++ b/patches/api/0475-Registry-Modification-API.patch @@ -790,10 +790,10 @@ index 0000000000000000000000000000000000000000..11d19e339c7c62f2eb4467277552c27e +record TagKeyImpl<T>(RegistryKey<T> registryKey, Key key) implements TagKey<T> { +} diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java -index 27b987db385a594fede4e884b6437dc363f6e817..9725580b6458e5d37fbc6059869604f9883bd6d1 100644 +index 36a8f6082f111a1cbb25e0ff3c968a89f02611a0..ff4997c6c5cecf7caf957e1aedaafb22df647e7d 100644 --- a/src/main/java/org/bukkit/Registry.java +++ b/src/main/java/org/bukkit/Registry.java -@@ -357,6 +357,27 @@ public interface Registry<T extends Keyed> extends Iterable<T> { +@@ -356,6 +356,27 @@ public interface Registry<T extends Keyed> extends Iterable<T> { */ @Nullable T get(@NotNull NamespacedKey key); @@ -821,7 +821,7 @@ index 27b987db385a594fede4e884b6437dc363f6e817..9725580b6458e5d37fbc6059869604f9 // Paper start - improve Registry /** -@@ -431,6 +452,34 @@ public interface Registry<T extends Keyed> extends Iterable<T> { +@@ -430,6 +451,34 @@ public interface Registry<T extends Keyed> extends Iterable<T> { } // Paper end - improve Registry @@ -856,7 +856,7 @@ index 27b987db385a594fede4e884b6437dc363f6e817..9725580b6458e5d37fbc6059869604f9 /** * Returns a new stream, which contains all registry items, which are registered to the registry. * -@@ -512,5 +561,23 @@ public interface Registry<T extends Keyed> extends Iterable<T> { +@@ -511,5 +560,23 @@ public interface Registry<T extends Keyed> extends Iterable<T> { return value.getKey(); } // Paper end - improve Registry |