diff options
author | Jake Potrebic <[email protected]> | 2023-06-20 09:40:14 -0700 |
---|---|---|
committer | Jake Potrebic <[email protected]> | 2023-06-20 09:50:05 -0700 |
commit | 3fa4ea66682488002ec01ff1638ffc3951183d20 (patch) | |
tree | c583f1df959c5faaebecfa4629385f1522928e07 | |
parent | 873533b1297480d6157ee5bbdbe51720c790e575 (diff) | |
download | Paper-3fa4ea66682488002ec01ff1638ffc3951183d20.tar.gz Paper-3fa4ea66682488002ec01ff1638ffc3951183d20.zip |
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:
6680169e [#660/Enum] Merge remote-tracking branch 'origin/pr/660' into experimental
8b97f215 Add missing AbstractTestingBase extension
9f21f42b [#660/Enum] Merge remote-tracking branch 'origin/pr/660' into experimental
fb59a4a0 Create experimental version
a7c1393b Merge branch 'master' into enums-to-registers
1af01165 Merge branch 'master' into enums-to-registers
4ee82e4e Implement feedback
af8ffd60 Merge branch 'master' into enums-to-registers
6a8ea63f Updated to 1.20
22ae9ebc Merge branch 'master' into enums-to-registers
b1d669be Some clean up
685d812e Merge branch 'master' into enums-to-registers
00d778c7 Convert MusicInstrument
bba2eb5f Convert GameEvent
ffbf67a1 Convert PotionType
eacaa45d Convert Particle
d08d21d1 Convert PatternType
c6b51f7c Convert Cat type
af6c2987 Make missing Frog variant abstract
a67a5f5c Add missing Annotation
6ab21c50 Change how converting from / to BlockType and ItemType work
e3e84e69 Add Objects.requireNonNull so that there are not marked as nullable
fceddab5 Add missing deprecation
e91906f5 Don't convert legacy in register instead, only in required method
2200b334 Use static constructors for ItemStack
b5f483b0 Deprecated Material
a995df2a Fix typo getItemTyp
9cedb664 import ItemType
27e282b2 getSteerItemType -> getSteerItem
d8d0e43b Better Piglin method names
3a2ab399 BLOCK_TYPE -> BLOCK, ITEM_TYPE -> ITEM
a0eb63ac Interface it is
4bb0b646 Split Material into BlockType and ItemType
b6bfcff5 Merge branch 'master' into enums-to-registers
1f86c847 Updated to Mockito 5.3.1
280ee1f7 Fix merge, updated to 1.19.4
9e0c7ad5 Merge branch 'master' into enums-to-registers
fdbed698 Updated to 1.19.3
85c3e2d3 Merge branch 'master' into enums-to-registers
b2c390af Fix merge
4e405647 Merge branch 'master' into enums-to-registers
d01b4c90 Fix copy/paste
ba2c8cb1 Update to 1.19
7e4f2db2 Merge branch 'master' of https://hub.spigotmc.org/stash/scm/~derfrzocker/bukkit into enums-to-registers
a1a974f0 Fix merge
7d3a91d3 Merge branch 'master' of https://hub.spigotmc.org/stash/scm/~derfrzocker/bukkit into enums-to-registers
499e22d9 Merge branch 'master' of https://hub.spigotmc.org/stash/scm/~derfrzocker/bukkit into enums-to-registers
a0cf419f Merge branch 'master' of https://hub.spigotmc.org/stash/scm/~derfrzocker/bukkit into enums-to-registers
d5bd36a2 Fix / Implement merge changes
fe643952 Merge branch 'master' of https://hub.spigotmc.org/stash/scm/~derfrzocker/bukkit into enums-to-registers
cf1d2005 Merge branch 'master' of https://hub.spigotmc.org/stash/scm/~derfrzocker/bukkit into enums-to-registers
f18dce93 Make Statistic abstract
bbe3f791 Fix 1.18 merge Handle comment out test cases
0988647e Merge branch 'master' of https://hub.spigotmc.org/stash/scm/~derfrzocker/bukkit into enums-to-registers
6e4f2c50 Populated BlockType and ItemType
7a58144d Convert Material enum, midpoint push, it compiles and runs
4771132c Merge branch 'master' of https://hub.spigotmc.org/stash/scm/~derfrzocker/bukkit into enums-to-registers
e6b179ff Convert Material enum, midpoint push to merge BlockState changes
f33b85a0 Change other enums / classes.
8b0d5418 Create seperat OldEnum class, which holds common enum methods.
45544426 Change Enums to classes to easier handle none standart minecraft values
CraftBukkit Changes:
8969b32d0 [#931/Enum] Merge remote-tracking branch 'origin/pr/931' into experimental
222257a67 Add missing AbstractTestingBase extension
0480af399 [#931/Enum] Merge remote-tracking branch 'origin/pr/931' into experimental
1afa1ddc2 Create experimental version
00780ea51 Ignore FactoryItemMaterialTest test
676969d01 SPIGOT-7389: Handle setting null items in ChiseledBookshelf Inventory
84f10cc36 Fix merge
9e114e13e Merge branch 'master' into enums-to-registers
941787e24 Add missing Commodore for 1.20 updated
6dac9a12d Updated tests
737426398 Only allow reference holder
aaaa5fa88 Merge branch 'master' into enums-to-registers
74957eb99 Merge branch 'master' into enums-to-registers
a1ca4e870 Merge branch 'master' into enums-to-registers
f293f4a61 Updated to 1.20
b434b3d15 Merge branch 'master' into enums-to-registers
e99dcbda7 Some clean up
fcead8aed Use correct primitive class
e955d9c50 Fix some Commodore errors
af5526ebb Allow Material to support older plugins
b83afd643 Add rewrite for Google enum set methods
067323765 Add missing method replacement in dynamic invocation
63e17e631 Merge branch 'master' into enums-to-registers
26dfcacf8 Bad copy and past
d50c9bd6a Convert MusicInstrument
c0c5312db Convert GameEvent
39daffe2c Convert PotionType
9b974f832 Convert Particle
f528fca63 Convert PatternType
525c65006 Convert Cat type
6832b8fbb More consistent to / from bukkit / minecraft methods
d31e38e16 Make missing Frog variant abstract
e4f0e7d8e This shouldn't be committed
6fee81baa Add Commodore for EnumSet
82a668683 Fix hasItemType / getItemType
f70162d66 Change how converting from / to BlockType and ItemType work
c3f7c7886 Don't convert legacy in register instead, only in required method
2039e05fa Use static constructors for ItemStack
fe221578b More Commodore
2b70bd171 More Commodore
70f4a89f5 Fix some Commodore
06544ed4b Fix typo getItemTyp
6269d2e42 getSteerItemType -> getSteerItem
a19ac46c0 Better Piglin method names
eef5f52c6 BLOCK_TYPE -> BLOCK, ITEM_TYPE -> ITEM
bbaff1348 Interface it is
c39e1316c Finish Commodore action for Material split
dd8552105 Work on Commodore
1d4ef8bf2 Split Material into BlockType and ItemType
6c5a98220 Merge branch 'master' into enums-to-registers
869658a96 Handle Material calls in lambda expression
523ac4ac0 Add reroute for Class#getEnumConstants
0a4463279 Use extra method for getting registry
602d9b404 Updated to Mockito 5.3.1
8ff87b77d Fix merge, updated to 1.19.4
9d739d313 Merge branch 'master' into enums-to-registers
eb6f702ff Reduce usage of BuiltInRegistries
b6f667cac Some more asm compatibility changes, add config option
87c931d38 Handle enum maps
a2c6699db Updated to 1.19.3
f7c27584f Merge branch 'master' into enums-to-registers
2f95b9951 Fix merge
184b05740 Merge branch 'master' into enums-to-registers
12bd8de26 Updated to 1.19
9c57831b7 Merge branch 'master' of https://hub.spigotmc.org/stash/scm/~derfrzocker/craftbukkit into enums-to-registers
4ed8eb402 Fix merge
a9faac8e4 Merge branch 'master' of https://hub.spigotmc.org/stash/scm/~derfrzocker/craftbukkit into enums-to-registers
0d2988603 Merge branch 'master' of https://hub.spigotmc.org/stash/scm/~derfrzocker/craftbukkit into enums-to-registers
3f8f9557d Fix merge, updated to 1.18.2
1560490c6 Merge branch 'master' of https://hub.spigotmc.org/stash/scm/~derfrzocker/craftbukkit into enums-to-registers
a0e4eb12c Merge branch 'master' of https://hub.spigotmc.org/stash/scm/~derfrzocker/craftbukkit into enums-to-registers
8b59f682d Move getType method to CraftEntity class
b849c0147 Add missing patches
4644ba79f Fix / Implement merge changes
cf9ee732e Merge branch 'master' of https://hub.spigotmc.org/stash/scm/~derfrzocker/craftbukkit into enums-to-registers
0c9125b67 Use Tag where possible
cc05153d9 Cache interactable call
ab5cc36de Use getHandle
83ebf4114 Merge branch 'master' of https://hub.spigotmc.org/stash/scm/~derfrzocker/craftbukkit into enums-to-registers
bc20aea0c Make Statistic abstract
3faa7e135 Add Tests for Material BlockType and ItemType
e10f74365 Fix 1.18 merge Handle comment out test cases
f72f70ec4 Merge branch 'master' of https://hub.spigotmc.org/stash/scm/~derfrzocker/craftbukkit into enums-to-registers
dbf4f5b7e Populated BlockType and ItemType
015afc1bc Convert Material enum, midpoint push, it compiles and runs
cc0112866 Merge branch 'master' of https://hub.spigotmc.org/stash/scm/~derfrzocker/craftbukkit into enums-to-registers
e26742c59 Convert Material enum, midpoint push to merge BlockState changes
796ad9295 Fix bug in legacy naming converting.
199c8278c Change other enums / classes.
fd513652a Seperated custom biome value handling. Fix compareTo call.
60c71ce07 Change Enums to classes to easier handle none standart minecraft values
Spigot Changes:
addcf45f [Enum] Rebuild patches
743 files changed, 3134 insertions, 3542 deletions
diff --git a/gradle.properties b/gradle.properties index 469b0f4f33..5d3886e0c8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ group=io.papermc.paper -version=1.20.1-R0.1-SNAPSHOT +version=1.20.1-experimental-SNAPSHOT mcVersion=1.20.1 org.gradle.caching=true diff --git a/patches/api/0001-Convert-project-to-Gradle.patch b/patches/api/0001-Convert-project-to-Gradle.patch index fc709129d9..d7bd12e45c 100644 --- a/patches/api/0001-Convert-project-to-Gradle.patch +++ b/patches/api/0001-Convert-project-to-Gradle.patch @@ -27,10 +27,10 @@ index 11038da2e071699d6561a331565db0c8d7850d0e..317acfec5894101294a55abff6181943 +/.factorypath diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 -index 0000000000000000000000000000000000000000..73bc33e7a498f8eca2d68c4588b04de4eaf8fc7a +index 0000000000000000000000000000000000000000..b1634fe921f5cd4e0b76823e33db5bc3ca50a8b5 --- /dev/null +++ b/build.gradle.kts -@@ -0,0 +1,85 @@ +@@ -0,0 +1,86 @@ +plugins { + `java-library` + `maven-publish` @@ -63,6 +63,7 @@ index 0000000000000000000000000000000000000000..73bc33e7a498f8eca2d68c4588b04de4 + testImplementation("junit:junit:4.13.2") + testImplementation("org.hamcrest:hamcrest-library:1.3") + testImplementation("org.ow2.asm:asm-tree:9.5") ++ testImplementation("org.mockito:mockito-core:5.3.1") +} + +configure<PublishingExtension> { @@ -118,10 +119,10 @@ index 0000000000000000000000000000000000000000..73bc33e7a498f8eca2d68c4588b04de4 +} diff --git a/pom.xml b/pom.xml deleted file mode 100644 -index e6d48b5fdc484ed2443ddf1d60079a13ea2c9677..0000000000000000000000000000000000000000 +index f9baf5cd570de24773b5ac2e5126475b5124d863..0000000000000000000000000000000000000000 --- a/pom.xml +++ /dev/null -@@ -1,270 +0,0 @@ +@@ -1,276 +0,0 @@ - -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> @@ -129,7 +130,7 @@ index e6d48b5fdc484ed2443ddf1d60079a13ea2c9677..00000000000000000000000000000000 - - <groupId>org.spigotmc</groupId> - <artifactId>spigot-api</artifactId> -- <version>1.20.1-R0.1-SNAPSHOT</version> +- <version>1.20.1-experimental-SNAPSHOT</version> - <packaging>jar</packaging> - - <name>Spigot-API</name> @@ -138,8 +139,8 @@ index e6d48b5fdc484ed2443ddf1d60079a13ea2c9677..00000000000000000000000000000000 - - <properties> - <skipTests>true</skipTests> -- <maven.compiler.source>1.8</maven.compiler.source> -- <maven.compiler.target>1.8</maven.compiler.target> +- <maven.compiler.source>9</maven.compiler.source> +- <maven.compiler.target>9</maven.compiler.target> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - </properties> - @@ -234,6 +235,12 @@ index e6d48b5fdc484ed2443ddf1d60079a13ea2c9677..00000000000000000000000000000000 - <version>9.5</version> - <scope>test</scope> - </dependency> +- <dependency> +- <groupId>org.mockito</groupId> +- <artifactId>mockito-core</artifactId> +- <version>5.3.1</version> +- <scope>test</scope> +- </dependency> - </dependencies> - - <build> diff --git a/patches/api/0002-Build-system-changes.patch b/patches/api/0002-Build-system-changes.patch index 4204d5f382..a590c3c07d 100644 --- a/patches/api/0002-Build-system-changes.patch +++ b/patches/api/0002-Build-system-changes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Build system changes diff --git a/build.gradle.kts b/build.gradle.kts -index 73bc33e7a498f8eca2d68c4588b04de4eaf8fc7a..34117c1178e04885ff9be5b73c7c2547e77ed4d5 100644 +index b1634fe921f5cd4e0b76823e33db5bc3ca50a8b5..61e15811e94effd303d55f8fa14c9fbf0ca6438e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,15 +17,27 @@ dependencies { @@ -37,7 +37,7 @@ index 73bc33e7a498f8eca2d68c4588b04de4eaf8fc7a..34117c1178e04885ff9be5b73c7c2547 testImplementation("org.apache.commons:commons-lang3:3.12.0") testImplementation("junit:junit:4.13.2") testImplementation("org.hamcrest:hamcrest-library:1.3") -@@ -67,7 +79,7 @@ tasks.withType<Javadoc> { +@@ -68,7 +80,7 @@ tasks.withType<Javadoc> { options.links( "https://guava.dev/releases/31.1-jre/api/docs/", "https://javadoc.io/doc/org.yaml/snakeyaml/2.0/", @@ -46,7 +46,7 @@ index 73bc33e7a498f8eca2d68c4588b04de4eaf8fc7a..34117c1178e04885ff9be5b73c7c2547 "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/", ) options.tags("apiNote:a:API Note:") -@@ -83,3 +95,14 @@ tasks.withType<Javadoc> { +@@ -84,3 +96,14 @@ tasks.withType<Javadoc> { } } } diff --git a/patches/api/0003-Test-changes.patch b/patches/api/0003-Test-changes.patch index b1de3fe665..d6ab9a41f9 100644 --- a/patches/api/0003-Test-changes.patch +++ b/patches/api/0003-Test-changes.patch @@ -12,47 +12,6 @@ Subject: [PATCH] Test changes Co-authored-by: Riley Park <[email protected]> Co-authored-by: Jake Potrebic <[email protected]> -diff --git a/build.gradle.kts b/build.gradle.kts -index 34117c1178e04885ff9be5b73c7c2547e77ed4d5..c174d9d6534382ae9d002b883bde929d46e32789 100644 ---- a/build.gradle.kts -+++ b/build.gradle.kts -@@ -37,6 +37,7 @@ dependencies { - compileOnlyApi(checkerQual) - testCompileOnly(checkerQual) - // Paper end -+ testImplementation("org.mockito:mockito-core:4.9.0") // Paper - add mockito - - testImplementation("org.apache.commons:commons-lang3:3.12.0") - testImplementation("junit:junit:4.13.2") -diff --git a/src/test/java/io/papermc/paper/testing/EmptyRegistry.java b/src/test/java/io/papermc/paper/testing/EmptyRegistry.java -new file mode 100644 -index 0000000000000000000000000000000000000000..ba9ddce87a9f385e729a5c2cf7c5eec120e388a7 ---- /dev/null -+++ b/src/test/java/io/papermc/paper/testing/EmptyRegistry.java -@@ -0,0 +1,23 @@ -+package io.papermc.paper.testing; -+ -+import java.util.Collections; -+import java.util.Iterator; -+import org.bukkit.Keyed; -+import org.bukkit.NamespacedKey; -+import org.bukkit.Registry; -+import org.jetbrains.annotations.NotNull; -+import org.jetbrains.annotations.Nullable; -+ -+public record EmptyRegistry() implements Registry<Keyed> { -+ -+ @NotNull -+ @Override -+ public Iterator<Keyed> iterator() { -+ return Collections.emptyIterator(); -+ } -+ -+ @Override -+ public @Nullable Keyed get(@NotNull final NamespacedKey key) { -+ return null; -+ } -+} diff --git a/src/test/java/io/papermc/paper/testing/EmptyTag.java b/src/test/java/io/papermc/paper/testing/EmptyTag.java new file mode 100644 index 0000000000000000000000000000000000000000..77154095cfb8b259bdb318e8ff40cb6f559ebc18 @@ -90,60 +49,6 @@ index 0000000000000000000000000000000000000000..77154095cfb8b259bdb318e8ff40cb6f + return Collections.emptySet(); + } +} -diff --git a/src/test/java/io/papermc/paper/testing/TestServer.java b/src/test/java/io/papermc/paper/testing/TestServer.java -new file mode 100644 -index 0000000000000000000000000000000000000000..756acf231b1b076b08046d86992ba7ce7f62a94f ---- /dev/null -+++ b/src/test/java/io/papermc/paper/testing/TestServer.java -@@ -0,0 +1,48 @@ -+package io.papermc.paper.testing; -+ -+import java.util.logging.Logger; -+import org.bukkit.Bukkit; -+import org.bukkit.NamespacedKey; -+import org.bukkit.Server; -+import org.bukkit.command.SimpleCommandMap; -+import org.bukkit.plugin.PluginManager; -+import org.bukkit.plugin.SimplePluginManager; -+ -+import static org.mockito.ArgumentMatchers.anyString; -+import static org.mockito.Mockito.any; -+import static org.mockito.Mockito.mock; -+import static org.mockito.Mockito.when; -+ -+public final class TestServer { -+ -+ @SuppressWarnings("removal") -+ public static void setup() { -+ //noinspection ConstantValue -+ if (Bukkit.getServer() != null) { -+ return; -+ } -+ -+ final Server dummyServer = mock(Server.class); -+ -+ final Logger logger = Logger.getLogger(TestServer.class.getCanonicalName()); -+ when(dummyServer.getLogger()).thenReturn(logger); -+ when(dummyServer.getName()).thenReturn(TestServer.class.getSimpleName()); -+ when(dummyServer.getVersion()).thenReturn("Version_" + TestServer.class.getPackage().getImplementationVersion()); -+ when(dummyServer.getBukkitVersion()).thenReturn("BukkitVersion_" + TestServer.class.getPackage().getImplementationVersion()); -+ -+ -+ final Thread currentThread = Thread.currentThread(); -+ when(dummyServer.isPrimaryThread()).thenAnswer(ignored -> Thread.currentThread().equals(currentThread)); -+ -+ when(dummyServer.getTag(anyString(), any(NamespacedKey.class), any())).thenAnswer(ignored -> new EmptyTag()); -+ -+ final PluginManager pluginManager = new SimplePluginManager(dummyServer, new SimpleCommandMap(dummyServer)); -+ when(dummyServer.getPluginManager()).thenReturn(pluginManager); -+ -+ when(dummyServer.getRegistry(any())).thenAnswer(ignored -> new EmptyRegistry()); -+ when(dummyServer.getScoreboardCriteria(anyString())).thenReturn(null); -+ -+ Bukkit.setServer(dummyServer); -+ } -+ -+} diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java index 4ac3dd977e75cd8464163351d306e037ee32cb48..c26ea217927ba77611e6ae93f8df50a83bceb3dd 100644 --- a/src/test/java/org/bukkit/AnnotationTest.java @@ -312,231 +217,17 @@ index 2dfada66067d79b84cd490eadbe0178e8cd8c260..06d66512c91c680130132b79e34fbf32 @Override public Object[] apply(Method input) { diff --git a/src/test/java/org/bukkit/TestServer.java b/src/test/java/org/bukkit/TestServer.java -deleted file mode 100644 -index 701a17c10f31cd345238a3c568264178ce372faa..0000000000000000000000000000000000000000 +index 1e407c612c7dc26a2bea4b6ed70e1f0723dc3762..e3480404af8187588787383b18e3002032653d71 100644 --- a/src/test/java/org/bukkit/TestServer.java -+++ /dev/null -@@ -1,139 +0,0 @@ --package org.bukkit; -- --import com.google.common.collect.ImmutableMap; --import java.lang.reflect.InvocationHandler; --import java.lang.reflect.Method; --import java.lang.reflect.Proxy; --import java.util.Iterator; --import java.util.Map; --import java.util.logging.Logger; --import org.bukkit.command.SimpleCommandMap; --import org.bukkit.plugin.PluginManager; --import org.bukkit.plugin.SimplePluginManager; --import org.jetbrains.annotations.NotNull; --import org.jetbrains.annotations.Nullable; -- --public final class TestServer implements InvocationHandler { -- private static interface MethodHandler { -- Object handle(TestServer server, Object[] args); -- } -- -- private static final Map<Method, MethodHandler> methods; -- -- static { -- try { -- ImmutableMap.Builder<Method, MethodHandler> methodMap = ImmutableMap.builder(); -- methodMap.put( -- Server.class.getMethod("isPrimaryThread"), -- new MethodHandler() { -- @Override -- public Object handle(TestServer server, Object[] args) { -- return Thread.currentThread().equals(server.creatingThread); -- } -- } -- ); -- methodMap.put( -- Server.class.getMethod("getPluginManager"), -- new MethodHandler() { -- @Override -- public Object handle(TestServer server, Object[] args) { -- return server.pluginManager; -- } -- } -- ); -- methodMap.put( -- Server.class.getMethod("getLogger"), -- new MethodHandler() { -- final Logger logger = Logger.getLogger(TestServer.class.getCanonicalName()); -- @Override -- public Object handle(TestServer server, Object[] args) { -- return logger; -- } -- } -- ); -- methodMap.put( -- Server.class.getMethod("getName"), -- new MethodHandler() { -- @Override -- public Object handle(TestServer server, Object[] args) { -- return TestServer.class.getSimpleName(); -- } -- } -- ); -- methodMap.put( -- Server.class.getMethod("getVersion"), -- new MethodHandler() { -- @Override -- public Object handle(TestServer server, Object[] args) { -- return "Version_" + TestServer.class.getPackage().getImplementationVersion(); -- } -- } -- ); -- methodMap.put( -- Server.class.getMethod("getBukkitVersion"), -- new MethodHandler() { -- @Override -- public Object handle(TestServer server, Object[] args) { -- return "BukkitVersion_" + TestServer.class.getPackage().getImplementationVersion(); -- } -- } -- ); -- methodMap.put( -- Server.class.getMethod("getRegistry", Class.class), -- new MethodHandler() { -- @Override -- public Object handle(TestServer server, Object[] args) { -- return new Registry() { -- @NotNull -- @Override -- public Iterator iterator() { -- return null; -- } -- -- @Nullable -- @Override -- public Keyed get(@NotNull NamespacedKey key) { -- return null; -- } -- }; -- } -- } -- ); -- methodMap.put( -- Server.class.getMethod("getScoreboardCriteria", String.class), -- new MethodHandler() { -- @Override -- public Object handle(TestServer server, Object[] args) { -- // Does not need to return anything. Exists solely to test CriteriaTest which has static init fields -- return null; -- } -- } -- ); -- methods = methodMap.build(); -- -- TestServer server = new TestServer(); -- Server instance = Proxy.getProxyClass(Server.class.getClassLoader(), Server.class).asSubclass(Server.class).getConstructor(InvocationHandler.class).newInstance(server); -- Bukkit.setServer(instance); -- server.pluginManager = new SimplePluginManager(instance, new SimpleCommandMap(instance)); -- } catch (Throwable t) { -- throw new Error(t); -- } -- } -- -- private Thread creatingThread = Thread.currentThread(); -- private PluginManager pluginManager; -- private TestServer() {}; -- -- public static Server getInstance() { -- return Bukkit.getServer(); -- } -- -- @Override -- public Object invoke(Object proxy, Method method, Object[] args) { -- MethodHandler handler = methods.get(method); -- if (handler != null) { -- return handler.handle(this, args); -- } -- throw new UnsupportedOperationException(String.valueOf(method)); -- } --} -diff --git a/src/test/java/org/bukkit/TestWorld.java b/src/test/java/org/bukkit/TestWorld.java -index ab34f1199921d415fa2ca6e281a8125c9e6d7173..f64d024f5bbf9482aaddb56597b23b04c66f21bf 100644 ---- a/src/test/java/org/bukkit/TestWorld.java -+++ b/src/test/java/org/bukkit/TestWorld.java -@@ -18,7 +18,7 @@ public final class TestWorld implements InvocationHandler { - - static { - try { -- TestServer.getInstance(); -+ io.papermc.paper.testing.TestServer.setup(); // Paper ++++ b/src/test/java/org/bukkit/TestServer.java +@@ -59,6 +59,10 @@ public final class TestServer { - ImmutableMap.Builder<Method, MethodHandler> methodMap = ImmutableMap.builder(); - methodMap.put( -diff --git a/src/test/java/org/bukkit/event/SyntheticEventTest.java b/src/test/java/org/bukkit/event/SyntheticEventTest.java -index d402cb59f508205ebe9ee450594826b04cecb90b..09886568ae6167141b463b6262565fa212af3385 100644 ---- a/src/test/java/org/bukkit/event/SyntheticEventTest.java -+++ b/src/test/java/org/bukkit/event/SyntheticEventTest.java -@@ -1,6 +1,5 @@ - package org.bukkit.event; + Mockito.when(instance.getUnsafe()).then(mock -> unsafeValues); --import org.bukkit.TestServer; - import org.bukkit.plugin.PluginLoader; - import org.bukkit.plugin.SimplePluginManager; - import org.bukkit.plugin.TestPlugin; -@@ -12,14 +11,15 @@ public class SyntheticEventTest { - @SuppressWarnings("deprecation") - @Test - public void test() { -- final JavaPluginLoader loader = new JavaPluginLoader(TestServer.getInstance()); -+ io.papermc.paper.testing.TestServer.setup(); // Paper -+ final JavaPluginLoader loader = new JavaPluginLoader(org.bukkit.Bukkit.getServer()); // Paper - TestPlugin plugin = new TestPlugin(getClass().getName()) { - @Override - public PluginLoader getPluginLoader() { - return loader; - } - }; -- SimplePluginManager pluginManager = new SimplePluginManager(TestServer.getInstance(), null); -+ SimplePluginManager pluginManager = new SimplePluginManager(org.bukkit.Bukkit.getServer(), null); // Paper - - TestEvent event = new TestEvent(false); - Impl impl = new Impl(); -diff --git a/src/test/java/org/bukkit/plugin/PluginManagerTest.java b/src/test/java/org/bukkit/plugin/PluginManagerTest.java -index f188cd4f3b07027c30d41f1162db77a506b7b6bb..c46ed2acb82db814d660459b705dd49e6d44240f 100644 ---- a/src/test/java/org/bukkit/plugin/PluginManagerTest.java -+++ b/src/test/java/org/bukkit/plugin/PluginManagerTest.java -@@ -2,7 +2,6 @@ package org.bukkit.plugin; - - import static org.hamcrest.Matchers.*; - import static org.junit.Assert.*; --import org.bukkit.TestServer; - import org.bukkit.event.Event; - import org.bukkit.event.TestEvent; - import org.bukkit.permissions.Permission; -@@ -14,7 +13,7 @@ public class PluginManagerTest { - volatile Object value = null; - } - -- private static final PluginManager pm = TestServer.getInstance().getPluginManager(); -+ private static final PluginManager pm = org.bukkit.Bukkit.getServer().getPluginManager(); // Paper - - private final MutableObject store = new MutableObject(); - -diff --git a/src/test/java/org/bukkit/scoreboard/CriteriaTest.java b/src/test/java/org/bukkit/scoreboard/CriteriaTest.java -index eb94b6f4d58cd9f66b07791c57af7e359992e28c..a93f28e2f987a36e2c7e4f7d31506b750bdb222b 100644 ---- a/src/test/java/org/bukkit/scoreboard/CriteriaTest.java -+++ b/src/test/java/org/bukkit/scoreboard/CriteriaTest.java -@@ -2,7 +2,6 @@ package org.bukkit.scoreboard; - - import org.bukkit.Material; - import org.bukkit.Statistic; --import org.bukkit.TestServer; - import org.bukkit.entity.EntityType; - import org.junit.Assert; - import org.junit.Test; -@@ -11,7 +10,7 @@ public class CriteriaTest { - - @Test - public void testStatistic() { -- TestServer.getInstance(); -+ io.papermc.paper.testing.TestServer.setup(); // Paper - - Assert.assertThrows(IllegalArgumentException.class, () -> Criteria.statistic(Statistic.AVIATE_ONE_CM, Material.STONE)); // Generic statistic with block - Assert.assertThrows(IllegalArgumentException.class, () -> Criteria.statistic(Statistic.AVIATE_ONE_CM, EntityType.CREEPER)); // Generic statistic with entity type ++ // Paper start - test changes ++ Mockito.when(instance.getTag(Mockito.anyString(), Mockito.any(NamespacedKey.class), Mockito.any())).thenAnswer(ignored -> new io.papermc.paper.testing.EmptyTag()); ++ // Paper end ++ + Bukkit.setServer(instance); + server.pluginManager = new SimplePluginManager(instance, new SimpleCommandMap(instance)); + } catch (Throwable t) { diff --git a/patches/api/0005-Adventure.patch b/patches/api/0005-Adventure.patch index e00d83832d..cf7819e8dd 100644 --- a/patches/api/0005-Adventure.patch +++ b/patches/api/0005-Adventure.patch @@ -7,7 +7,7 @@ Co-authored-by: zml <[email protected]> Co-authored-by: Jake Potrebic <[email protected]> diff --git a/build.gradle.kts b/build.gradle.kts -index 3e571743e76b26167e329dbd0a4c04ffd6427572..7671b795188adfea56daea2d957e173c8d07c086 100644 +index 3410360cb952bd5bdb352f0ff890228c3a2b2a92..6fef295a8a3425f6b4df9d3a7cfe007e4ab9320f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,13 +8,26 @@ java { @@ -754,10 +754,10 @@ index 0000000000000000000000000000000000000000..6e94562d79206d88b74b53814f9423f1 + } +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index ff86f4f5d7f460e8986c4a4fa483f5b5a1d3a1b6..cd9566aeace9e2e1e01fb014b0c50ba93af305d7 100644 +index ba518f05a67ce8fe867b7c62ec3bc780b0032d08..c0ba2c8d47bd6f149410b57e45fc87a3b3ad4aab 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -388,7 +388,9 @@ public final class Bukkit { +@@ -389,7 +389,9 @@ public final class Bukkit { * * @param message the message * @return the number of players @@ -767,7 +767,7 @@ index ff86f4f5d7f460e8986c4a4fa483f5b5a1d3a1b6..cd9566aeace9e2e1e01fb014b0c50ba9 public static int broadcastMessage(@NotNull String message) { return server.broadcastMessage(message); } -@@ -1104,6 +1106,19 @@ public final class Bukkit { +@@ -1105,6 +1107,19 @@ public final class Bukkit { server.shutdown(); } @@ -787,7 +787,7 @@ index ff86f4f5d7f460e8986c4a4fa483f5b5a1d3a1b6..cd9566aeace9e2e1e01fb014b0c50ba9 /** * Broadcasts the specified message to every user with the given * permission name. -@@ -1113,6 +1128,21 @@ public final class Bukkit { +@@ -1114,6 +1129,21 @@ public final class Bukkit { * permissibles} must have to receive the broadcast * @return number of message recipients */ @@ -809,7 +809,7 @@ index ff86f4f5d7f460e8986c4a4fa483f5b5a1d3a1b6..cd9566aeace9e2e1e01fb014b0c50ba9 public static int broadcast(@NotNull String message, @NotNull String permission) { return server.broadcast(message, permission); } -@@ -1351,6 +1381,7 @@ public final class Bukkit { +@@ -1352,6 +1382,7 @@ public final class Bukkit { return server.createInventory(owner, type); } @@ -817,7 +817,7 @@ index ff86f4f5d7f460e8986c4a4fa483f5b5a1d3a1b6..cd9566aeace9e2e1e01fb014b0c50ba9 /** * Creates an empty inventory with the specified type and title. If the type * is {@link InventoryType#CHEST}, the new inventory has a size of 27; -@@ -1376,6 +1407,38 @@ public final class Bukkit { +@@ -1377,6 +1408,38 @@ public final class Bukkit { * @see InventoryType#isCreatable() */ @NotNull @@ -856,7 +856,7 @@ index ff86f4f5d7f460e8986c4a4fa483f5b5a1d3a1b6..cd9566aeace9e2e1e01fb014b0c50ba9 public static Inventory createInventory(@Nullable InventoryHolder owner, @NotNull InventoryType type, @NotNull String title) { return server.createInventory(owner, type, title); } -@@ -1394,6 +1457,7 @@ public final class Bukkit { +@@ -1395,6 +1458,7 @@ public final class Bukkit { return server.createInventory(owner, size); } @@ -864,7 +864,7 @@ index ff86f4f5d7f460e8986c4a4fa483f5b5a1d3a1b6..cd9566aeace9e2e1e01fb014b0c50ba9 /** * Creates an empty inventory of type {@link InventoryType#CHEST} with the * specified size and title. -@@ -1406,10 +1470,30 @@ public final class Bukkit { +@@ -1407,10 +1471,30 @@ public final class Bukkit { * @throws IllegalArgumentException if the size is not a multiple of 9 */ @NotNull @@ -895,7 +895,7 @@ index ff86f4f5d7f460e8986c4a4fa483f5b5a1d3a1b6..cd9566aeace9e2e1e01fb014b0c50ba9 /** * Creates an empty merchant. * -@@ -1417,7 +1501,20 @@ public final class Bukkit { +@@ -1418,7 +1502,20 @@ public final class Bukkit { * when the merchant inventory is viewed * @return a new merchant */ @@ -916,7 +916,7 @@ index ff86f4f5d7f460e8986c4a4fa483f5b5a1d3a1b6..cd9566aeace9e2e1e01fb014b0c50ba9 public static Merchant createMerchant(@Nullable String title) { return server.createMerchant(title); } -@@ -1534,12 +1631,43 @@ public final class Bukkit { +@@ -1535,12 +1632,43 @@ public final class Bukkit { return server.isPrimaryThread(); } @@ -960,7 +960,7 @@ index ff86f4f5d7f460e8986c4a4fa483f5b5a1d3a1b6..cd9566aeace9e2e1e01fb014b0c50ba9 public static String getMotd() { return server.getMotd(); } -@@ -1548,7 +1676,9 @@ public final class Bukkit { +@@ -1549,7 +1677,9 @@ public final class Bukkit { * Set the message that is displayed on the server list. * * @param motd The message to be displayed @@ -970,7 +970,7 @@ index ff86f4f5d7f460e8986c4a4fa483f5b5a1d3a1b6..cd9566aeace9e2e1e01fb014b0c50ba9 public static void setMotd(@NotNull String motd) { server.setMotd(motd); } -@@ -1557,8 +1687,10 @@ public final class Bukkit { +@@ -1558,8 +1688,10 @@ public final class Bukkit { * Gets the default message that is displayed when the server is stopped. * * @return the shutdown message @@ -1152,10 +1152,10 @@ index c559f38fdb92cfee9f2e0ffb7088d1cf74a7f73d..a42f1d53340e4073038d46b7fabf5d44 + // Paper end } diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index d3684494b81d06b82eab72c6cfbd76d36dfc0e97..e359bc68007fbe62270ee62be762f844cbafe2d9 100644 +index 1cf603286b30b4773dd10a8b4508b6e03d998958..437d59ddf6a6859afc052257ba3f574929071522 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -60,13 +60,13 @@ import org.jetbrains.annotations.Nullable; +@@ -61,13 +61,13 @@ import org.jetbrains.annotations.Nullable; /** * Represents a server implementation. */ @@ -1171,7 +1171,7 @@ index d3684494b81d06b82eab72c6cfbd76d36dfc0e97..e359bc68007fbe62270ee62be762f844 */ public static final String BROADCAST_CHANNEL_ADMINISTRATIVE = "bukkit.broadcast.admin"; -@@ -74,7 +74,7 @@ public interface Server extends PluginMessageRecipient { +@@ -75,7 +75,7 @@ public interface Server extends PluginMessageRecipient { * Used for all announcement messages, such as informing users that a * player has joined. * <p> @@ -1180,7 +1180,7 @@ index d3684494b81d06b82eab72c6cfbd76d36dfc0e97..e359bc68007fbe62270ee62be762f844 */ public static final String BROADCAST_CHANNEL_USERS = "bukkit.broadcast.user"; -@@ -327,7 +327,9 @@ public interface Server extends PluginMessageRecipient { +@@ -328,7 +328,9 @@ public interface Server extends PluginMessageRecipient { * * @param message the message * @return the number of players @@ -1190,7 +1190,7 @@ index d3684494b81d06b82eab72c6cfbd76d36dfc0e97..e359bc68007fbe62270ee62be762f844 public int broadcastMessage(@NotNull String message); /** -@@ -945,8 +947,33 @@ public interface Server extends PluginMessageRecipient { +@@ -946,8 +948,33 @@ public interface Server extends PluginMessageRecipient { * @param permission the required permission {@link Permissible * permissibles} must have to receive the broadcast * @return number of message recipients @@ -1224,7 +1224,7 @@ index d3684494b81d06b82eab72c6cfbd76d36dfc0e97..e359bc68007fbe62270ee62be762f844 /** * Gets the player by the given name, regardless if they are offline or -@@ -1144,6 +1171,35 @@ public interface Server extends PluginMessageRecipient { +@@ -1145,6 +1172,35 @@ public interface Server extends PluginMessageRecipient { @NotNull Inventory createInventory(@Nullable InventoryHolder owner, @NotNull InventoryType type); @@ -1260,7 +1260,7 @@ index d3684494b81d06b82eab72c6cfbd76d36dfc0e97..e359bc68007fbe62270ee62be762f844 /** * Creates an empty inventory with the specified type and title. If the type * is {@link InventoryType#CHEST}, the new inventory has a size of 27; -@@ -1165,9 +1221,11 @@ public interface Server extends PluginMessageRecipient { +@@ -1166,9 +1222,11 @@ public interface Server extends PluginMessageRecipient { * @return The new inventory. * @throws IllegalArgumentException if the {@link InventoryType} cannot be * viewed. @@ -1272,7 +1272,7 @@ index d3684494b81d06b82eab72c6cfbd76d36dfc0e97..e359bc68007fbe62270ee62be762f844 @NotNull Inventory createInventory(@Nullable InventoryHolder owner, @NotNull InventoryType type, @NotNull String title); -@@ -1183,6 +1241,22 @@ public interface Server extends PluginMessageRecipient { +@@ -1184,6 +1242,22 @@ public interface Server extends PluginMessageRecipient { @NotNull Inventory createInventory(@Nullable InventoryHolder owner, int size) throws IllegalArgumentException; @@ -1295,7 +1295,7 @@ index d3684494b81d06b82eab72c6cfbd76d36dfc0e97..e359bc68007fbe62270ee62be762f844 /** * Creates an empty inventory of type {@link InventoryType#CHEST} with the * specified size and title. -@@ -1193,18 +1267,32 @@ public interface Server extends PluginMessageRecipient { +@@ -1194,18 +1268,32 @@ public interface Server extends PluginMessageRecipient { * viewed * @return a new inventory * @throws IllegalArgumentException if the size is not a multiple of 9 @@ -1328,7 +1328,7 @@ index d3684494b81d06b82eab72c6cfbd76d36dfc0e97..e359bc68007fbe62270ee62be762f844 Merchant createMerchant(@Nullable String title); /** -@@ -1300,27 +1388,56 @@ public interface Server extends PluginMessageRecipient { +@@ -1301,27 +1389,56 @@ public interface Server extends PluginMessageRecipient { */ boolean isPrimaryThread(); @@ -1385,7 +1385,7 @@ index d3684494b81d06b82eab72c6cfbd76d36dfc0e97..e359bc68007fbe62270ee62be762f844 String getShutdownMessage(); /** -@@ -1702,7 +1819,9 @@ public interface Server extends PluginMessageRecipient { +@@ -1706,7 +1823,9 @@ public interface Server extends PluginMessageRecipient { * Sends the component to the player * * @param component the components to send @@ -1395,7 +1395,7 @@ index d3684494b81d06b82eab72c6cfbd76d36dfc0e97..e359bc68007fbe62270ee62be762f844 public void broadcast(@NotNull net.md_5.bungee.api.chat.BaseComponent component) { throw new UnsupportedOperationException("Not supported yet."); } -@@ -1711,7 +1830,9 @@ public interface Server extends PluginMessageRecipient { +@@ -1715,7 +1834,9 @@ public interface Server extends PluginMessageRecipient { * Sends an array of components as a single message to the player * * @param components the components to send @@ -1406,28 +1406,26 @@ index d3684494b81d06b82eab72c6cfbd76d36dfc0e97..e359bc68007fbe62270ee62be762f844 throw new UnsupportedOperationException("Not supported yet."); } diff --git a/src/main/java/org/bukkit/Sound.java b/src/main/java/org/bukkit/Sound.java -index 4cbc963f268753316327e38b6e1e42cffb486b54..6e8d2b35d8f33827396dbcfa817cd9c2f8ad83a6 100644 +index 3f3c0ff5e8df623147f5b7ba74adc0027a325380..080378ac39ecb896c6b82bc3c27dd41e384f1e0d 100644 --- a/src/main/java/org/bukkit/Sound.java +++ b/src/main/java/org/bukkit/Sound.java -@@ -10,7 +10,7 @@ import org.jetbrains.annotations.NotNull; - * guarantee values will not be removed from this Enum. As such, you should not +@@ -13,7 +13,7 @@ import org.jetbrains.annotations.NotNull; + * guarantee values will not be removed from this class. As such, you should not * depend on the ordinal values of this class. */ --public enum Sound implements Keyed { -+public enum Sound implements Keyed, net.kyori.adventure.sound.Sound.Type { // Paper - implement Sound.Type - - AMBIENT_BASALT_DELTAS_ADDITIONS("ambient.basalt_deltas.additions"), - AMBIENT_BASALT_DELTAS_LOOP("ambient.basalt_deltas.loop"), -@@ -1498,4 +1498,11 @@ public enum Sound implements Keyed { - public NamespacedKey getKey() { - return key; +-public abstract class Sound extends OldEnum<Sound> implements Keyed { ++public abstract class Sound extends OldEnum<Sound> implements Keyed, net.kyori.adventure.sound.Sound.Type { // Paper - implement Sound.Type + + public static final Sound ENTITY_ALLAY_AMBIENT_WITH_ITEM = getSound("entity.allay.ambient_with_item"); + public static final Sound ENTITY_ALLAY_AMBIENT_WITHOUT_ITEM = getSound("entity.allay.ambient_without_item"); +@@ -1532,4 +1532,9 @@ public abstract class Sound extends OldEnum<Sound> implements Keyed { + public static Sound[] values() { + return Lists.newArrayList(Registry.SOUNDS).toArray(new Sound[0]); } + + // Paper start + @Override -+ public net.kyori.adventure.key.@NotNull Key key() { -+ return this.key; -+ } ++ public abstract net.kyori.adventure.key.@NotNull Key key(); + // Paper end } diff --git a/src/main/java/org/bukkit/SoundCategory.java b/src/main/java/org/bukkit/SoundCategory.java @@ -1467,10 +1465,10 @@ index ac5e263d737973af077e3406a84a84baca4370db..2d91924b7f5ef16a91d40cdc1bfc3d68 + // Paper end } diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index 650adcecdca839518e0b57bc47935d010ca0f64f..fd0ae07b8a19f6b628601a487329a929f3a26c91 100644 +index 59cc52159e2d135e8f2ad93364a72a5d5c61db6f..2d334dbdd9e2c9a020899097e0620152758dc078 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -25,6 +25,15 @@ import org.jetbrains.annotations.Nullable; +@@ -28,6 +28,15 @@ import org.jetbrains.annotations.Nullable; */ @Deprecated public interface UnsafeValues { @@ -1499,7 +1497,7 @@ index efb97712cc9dc7c1e12a59f5b94e4f2ad7c6b7d8..3024468af4c073324e536c1cb26beffb return warning == null || warning.value(); } diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index c4d2a13d62059ca1f148a9af909f424b745bc8df..5357291ff0f2f20bd87ab9f6e57f6a4f6ff65226 100644 +index fd957c5e57bf77f6e66d7bfcf34f79e14ebb37bc..d2e95c6ecc11b19ebb52c291884376c39d28467e 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -44,7 +44,7 @@ import org.jetbrains.annotations.Nullable; @@ -2007,10 +2005,10 @@ index b7d8dd30360a38dbdc7bbce40c8e6ced7261f833..0817f2395c2b18828565435568ce651f public void sendRawMessage(@Nullable UUID sender, @NotNull String message); } diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/java/org/bukkit/enchantments/Enchantment.java -index e2800dc97af5bbb02c555069285a0fa155a9799d..2dc749936df6168073a5bb9f9051d55f8589ac62 100644 +index ed59e306b26bde6bdccf8a5180474b7bbaf1f111..340a06329e6603fb20d02eda294972fc18508543 100644 --- a/src/main/java/org/bukkit/enchantments/Enchantment.java +++ b/src/main/java/org/bukkit/enchantments/Enchantment.java -@@ -299,6 +299,19 @@ public abstract class Enchantment implements Keyed { +@@ -293,6 +293,19 @@ public abstract class Enchantment implements Keyed { * @return True if the enchantment may be applied, otherwise False */ public abstract boolean canEnchantItem(@NotNull ItemStack item); @@ -2028,16 +2026,17 @@ index e2800dc97af5bbb02c555069285a0fa155a9799d..2dc749936df6168073a5bb9f9051d55f + public abstract net.kyori.adventure.text.@NotNull Component displayName(int level); + // Paper end - @Override - public boolean equals(Object obj) { + /** + * Gets the Enchantment at the specified key diff --git a/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java b/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java -index 9566e4306ada5e82dede0f002aa06da12c44996b..4d5f0837bd0e02a30c943d8969fb6b13452322e0 100644 +index 7fee01b0ad709c672d91bce34ca7f328cf5a15a0..3f432a055d9fc70e6b16bf87c209be50232f2e93 100644 --- a/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java +++ b/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java -@@ -63,4 +63,11 @@ public class EnchantmentWrapper extends Enchantment { - public boolean conflictsWith(@NotNull Enchantment other) { - return getEnchantment().conflictsWith(other); +@@ -70,4 +70,12 @@ public class EnchantmentWrapper extends Enchantment { + public NamespacedKey getKey() { + return getEnchantment().getKey(); } ++ + // Paper start + @NotNull + @Override @@ -2047,7 +2046,7 @@ index 9566e4306ada5e82dede0f002aa06da12c44996b..4d5f0837bd0e02a30c943d8969fb6b13 + // Paper end } diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index f3afe67f0832cb828d25be3654518ff73a80b0e1..598abaa82c634178043a29f6caa6ac5221659d06 100644 +index 2417f0d5077b51a7649503d57c48b0614f532904..9cebad10eb06f42cd0428d80940fa8e223f0deab 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -27,7 +27,7 @@ import org.jetbrains.annotations.Nullable; @@ -2081,7 +2080,7 @@ index f3afe67f0832cb828d25be3654518ff73a80b0e1..598abaa82c634178043a29f6caa6ac52 + // Paper end } diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 6860eb5e85d115d1c00ace8c646ccc080bff29ce..84e63caeabe3e44381a464bde47bcadaddba9d43 100644 +index a18e0377b68100d37ea171f80fe7f7e18e0a4593..9d8ddb2656d22c287ee1338fe4ab79fac0e8488a 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -43,7 +43,41 @@ import org.jetbrains.annotations.Nullable; @@ -2272,7 +2271,7 @@ index 6860eb5e85d115d1c00ace8c646ccc080bff29ce..84e63caeabe3e44381a464bde47bcada /** * Says a message (or runs a command). * -@@ -633,6 +732,90 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -621,6 +720,90 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ public void sendEquipmentChange(@NotNull LivingEntity entity, @NotNull Map<EquipmentSlot, ItemStack> items); @@ -2363,7 +2362,7 @@ index 6860eb5e85d115d1c00ace8c646ccc080bff29ce..84e63caeabe3e44381a464bde47bcada /** * Send a sign change. This fakes a sign change packet for a user at * a certain location. This will not actually change the world in any way. -@@ -650,7 +833,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -638,7 +821,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @param lines the new text on the sign or null to clear it * @throws IllegalArgumentException if location is null * @throws IllegalArgumentException if lines is non-null and has a length less than 4 @@ -2373,7 +2372,7 @@ index 6860eb5e85d115d1c00ace8c646ccc080bff29ce..84e63caeabe3e44381a464bde47bcada public void sendSignChange(@NotNull Location loc, @Nullable String[] lines) throws IllegalArgumentException; /** -@@ -672,7 +857,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -660,7 +845,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @throws IllegalArgumentException if location is null * @throws IllegalArgumentException if dyeColor is null * @throws IllegalArgumentException if lines is non-null and has a length less than 4 @@ -2383,7 +2382,7 @@ index 6860eb5e85d115d1c00ace8c646ccc080bff29ce..84e63caeabe3e44381a464bde47bcada public void sendSignChange(@NotNull Location loc, @Nullable String[] lines, @NotNull DyeColor dyeColor) throws IllegalArgumentException; /** -@@ -695,7 +882,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -683,7 +870,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @throws IllegalArgumentException if location is null * @throws IllegalArgumentException if dyeColor is null * @throws IllegalArgumentException if lines is non-null and has a length less than 4 @@ -2393,7 +2392,7 @@ index 6860eb5e85d115d1c00ace8c646ccc080bff29ce..84e63caeabe3e44381a464bde47bcada public void sendSignChange(@NotNull Location loc, @Nullable String[] lines, @NotNull DyeColor dyeColor, boolean hasGlowingText) throws IllegalArgumentException; /** -@@ -1211,6 +1400,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1199,6 +1388,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * pack correctly. * </ul> * @@ -2401,7 +2400,7 @@ index 6860eb5e85d115d1c00ace8c646ccc080bff29ce..84e63caeabe3e44381a464bde47bcada * @param url The URL from which the client will download the resource * pack. The string must contain only US-ASCII characters and should * be encoded as per RFC 1738. -@@ -1267,8 +1457,57 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1255,8 +1445,57 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @throws IllegalArgumentException Thrown if the hash is not 20 bytes * long. */ @@ -2459,7 +2458,7 @@ index 6860eb5e85d115d1c00ace8c646ccc080bff29ce..84e63caeabe3e44381a464bde47bcada /** * Request that the player's client download and switch resource packs. * <p> -@@ -1298,6 +1537,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1286,6 +1525,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * pack correctly. * </ul> * @@ -2467,7 +2466,7 @@ index 6860eb5e85d115d1c00ace8c646ccc080bff29ce..84e63caeabe3e44381a464bde47bcada * @param url The URL from which the client will download the resource * pack. The string must contain only US-ASCII characters and should * be encoded as per RFC 1738. -@@ -1358,8 +1598,57 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1346,8 +1586,57 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @throws IllegalArgumentException Thrown if the hash is not 20 bytes * long. */ @@ -2525,7 +2524,7 @@ index 6860eb5e85d115d1c00ace8c646ccc080bff29ce..84e63caeabe3e44381a464bde47bcada /** * Gets the Scoreboard displayed to this player * -@@ -1475,7 +1764,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1463,7 +1752,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * * @param title Title text * @param subtitle Subtitle text @@ -2534,7 +2533,7 @@ index 6860eb5e85d115d1c00ace8c646ccc080bff29ce..84e63caeabe3e44381a464bde47bcada */ @Deprecated public void sendTitle(@Nullable String title, @Nullable String subtitle); -@@ -1494,7 +1783,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1482,7 +1771,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @param fadeIn time in ticks for titles to fade in. Defaults to 10. * @param stay time in ticks for titles to stay. Defaults to 70. * @param fadeOut time in ticks for titles to fade out. Defaults to 20. @@ -2544,7 +2543,7 @@ index 6860eb5e85d115d1c00ace8c646ccc080bff29ce..84e63caeabe3e44381a464bde47bcada public void sendTitle(@Nullable String title, @Nullable String subtitle, int fadeIn, int stay, int fadeOut); /** -@@ -1721,6 +2012,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1709,6 +2000,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ public int getClientViewDistance(); @@ -2559,7 +2558,7 @@ index 6860eb5e85d115d1c00ace8c646ccc080bff29ce..84e63caeabe3e44381a464bde47bcada /** * Gets the player's estimated ping in milliseconds. * -@@ -1746,8 +2045,10 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1734,8 +2033,10 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * they wish. * * @return the player's locale @@ -2570,7 +2569,7 @@ index 6860eb5e85d115d1c00ace8c646ccc080bff29ce..84e63caeabe3e44381a464bde47bcada public String getLocale(); /** -@@ -1799,6 +2100,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1787,6 +2088,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ public boolean isAllowingServerListings(); @@ -2585,7 +2584,7 @@ index 6860eb5e85d115d1c00ace8c646ccc080bff29ce..84e63caeabe3e44381a464bde47bcada // Spigot start public class Spigot extends Entity.Spigot { -@@ -1830,11 +2139,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1818,11 +2127,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM throw new UnsupportedOperationException("Not supported yet."); } @@ -2599,7 +2598,7 @@ index 6860eb5e85d115d1c00ace8c646ccc080bff29ce..84e63caeabe3e44381a464bde47bcada @Override public void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) { throw new UnsupportedOperationException("Not supported yet."); -@@ -1845,7 +2156,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1833,7 +2144,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * * @param position the screen position * @param component the components to send @@ -2609,7 +2608,7 @@ index 6860eb5e85d115d1c00ace8c646ccc080bff29ce..84e63caeabe3e44381a464bde47bcada public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @NotNull net.md_5.bungee.api.chat.BaseComponent component) { throw new UnsupportedOperationException("Not supported yet."); } -@@ -1855,7 +2168,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1843,7 +2156,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * * @param position the screen position * @param components the components to send @@ -2619,7 +2618,7 @@ index 6860eb5e85d115d1c00ace8c646ccc080bff29ce..84e63caeabe3e44381a464bde47bcada public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) { throw new UnsupportedOperationException("Not supported yet."); } -@@ -1866,7 +2181,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1854,7 +2169,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @param position the screen position * @param sender the sender of the message * @param component the components to send @@ -2629,7 +2628,7 @@ index 6860eb5e85d115d1c00ace8c646ccc080bff29ce..84e63caeabe3e44381a464bde47bcada public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable java.util.UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent component) { throw new UnsupportedOperationException("Not supported yet."); } -@@ -1877,7 +2194,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1865,7 +2182,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @param position the screen position * @param sender the sender of the message * @param components the components to send @@ -3916,13 +3915,13 @@ index e12996492c1558fed9fab30de9f8018e0ed7fac3..002acfbdce1db10f7ba1b6a013e678f5 /** diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java -index f89d71b77d1200314df6ca23614d5ca6fb15ceb3..af4a7ce37eb10bab06eadb6583c7894b3ec55ae6 100644 +index 830cf7f0e069c4c0b29252c0ac7e8cb08f2d1922..d0530328536840ce126b39942fac35a476ea2ac4 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java -@@ -159,4 +159,24 @@ public interface ItemFactory { +@@ -158,4 +158,24 @@ public interface ItemFactory { @Deprecated @NotNull - Material updateMaterial(@NotNull final ItemMeta meta, @NotNull final Material material) throws IllegalArgumentException; + ItemType updateItemType(@NotNull final ItemMeta meta, @NotNull final ItemType itemType) throws IllegalArgumentException; + + // Paper start + /** @@ -3945,7 +3944,7 @@ index f89d71b77d1200314df6ca23614d5ca6fb15ceb3..af4a7ce37eb10bab06eadb6583c7894b + // Paper end } diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index d80b0a52968920b990a75cff85e436a16d782500..9d327f0832c40d4a8d212346284274f6cf78834f 100644 +index c9cdedc546804879bb93d957503b56347868524a..7e6c2bcf42d271184a75c91ecded5824535b3455 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -23,7 +23,7 @@ import org.jetbrains.annotations.Nullable; @@ -3954,10 +3953,10 @@ index d80b0a52968920b990a75cff85e436a16d782500..9d327f0832c40d4a8d212346284274f6 */ -public class ItemStack implements Cloneable, ConfigurationSerializable, Translatable { +public class ItemStack implements Cloneable, ConfigurationSerializable, Translatable, net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowItem> { // Paper - private Material type = Material.AIR; - private int amount = 0; - private MaterialData data = null; -@@ -602,4 +602,21 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat + + /** + * Creates a new ItemStack with an amount of 1. +@@ -652,4 +652,21 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat public String getTranslationKey() { return Bukkit.getUnsafe().getTranslationKey(this); } @@ -3980,12 +3979,12 @@ index d80b0a52968920b990a75cff85e436a16d782500..9d327f0832c40d4a8d212346284274f6 + // Paper end } diff --git a/src/main/java/org/bukkit/inventory/meta/BookMeta.java b/src/main/java/org/bukkit/inventory/meta/BookMeta.java -index 94852d50e88d0594b84b581cd627174043629995..be7c2cfc757e4dd15927be850739d401958fb227 100644 +index 315fd06a0706569cf339f6f98ef623787acb8643..c1978f0501e41adb1ccc1f20a1444d50e9ecc35f 100644 --- a/src/main/java/org/bukkit/inventory/meta/BookMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/BookMeta.java @@ -10,7 +10,7 @@ import org.jetbrains.annotations.Nullable; - * Represents a book ({@link Material#WRITABLE_BOOK} or {@link - * Material#WRITTEN_BOOK}) that can have a title, an author, and pages. + * Represents a book ({@link ItemType#WRITABLE_BOOK} or {@link + * ItemType#WRITTEN_BOOK}) that can have a title, an author, and pages. */ -public interface BookMeta extends ItemMeta { +public interface BookMeta extends ItemMeta, net.kyori.adventure.inventory.Book { // Paper diff --git a/patches/api/0006-Paper-Utils.patch b/patches/api/0006-Paper-Utils.patch index a647b698ad..224b26f6c8 100644 --- a/patches/api/0006-Paper-Utils.patch +++ b/patches/api/0006-Paper-Utils.patch @@ -26,3 +26,23 @@ index 0000000000000000000000000000000000000000..9db0056ab94145819628b3ad8d8d2613 + } + +} +diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java +index 2d334dbdd9e2c9a020899097e0620152758dc078..cd00a831cd4c6030082aa8107d25c78d8ee67d8f 100644 +--- a/src/main/java/org/bukkit/UnsafeValues.java ++++ b/src/main/java/org/bukkit/UnsafeValues.java +@@ -5,6 +5,7 @@ import org.bukkit.advancement.Advancement; + import org.bukkit.attribute.Attribute; + import org.bukkit.attribute.AttributeModifier; + import org.bukkit.block.Biome; ++import org.bukkit.block.BlockType; + import org.bukkit.block.data.BlockData; + import org.bukkit.entity.Entity; + import org.bukkit.entity.EntityType; +@@ -47,6 +48,7 @@ public interface UnsafeValues { + Material fromLegacy(MaterialData material, boolean itemPriority); + + Material toMaterial(ItemType itemType); ++ Material toMaterial(BlockType<?> blockType); // Paper + + BlockData fromLegacy(Material material, byte data); + diff --git a/patches/api/0008-Paper-Plugins.patch b/patches/api/0008-Paper-Plugins.patch index 48a2b45dc9..62f7dc535f 100644 --- a/patches/api/0008-Paper-Plugins.patch +++ b/patches/api/0008-Paper-Plugins.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Paper Plugins diff --git a/build.gradle.kts b/build.gradle.kts -index a626bbad85f8d1b348d4e67f328f4b0141b267c1..b0ca0ddffce2524e82d891c7a4d69d3ef9f2c097 100644 +index 04433b1f41c5abf04743ed6dd96bf83267a39828..8b4f7f0166a1323266c603ca4c860980617f5eda 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -47,7 +47,7 @@ dependencies { @@ -1338,13 +1338,13 @@ index 0000000000000000000000000000000000000000..6bf3d212a6156ad9ab0e82d1ca0a04f8 + +} diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index fd0ae07b8a19f6b628601a487329a929f3a26c91..2042e3fb0ea347148814d9838cd7bb475bd23984 100644 +index cd00a831cd4c6030082aa8107d25c78d8ee67d8f..628fae98b17cd7dd1a5358562225cefefeb5051b 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -101,4 +101,14 @@ public interface UnsafeValues { +@@ -110,4 +110,13 @@ public interface UnsafeValues { + EntityType<Entity> getUnkownEntityType(); - @Nullable - FeatureFlag getFeatureFlag(@NotNull NamespacedKey key); + Biome getCustomBiome(); + + // Paper start + @Deprecated(forRemoval = true) @@ -1354,7 +1354,6 @@ index fd0ae07b8a19f6b628601a487329a929f3a26c91..2042e3fb0ea347148814d9838cd7bb47 + static boolean isLegacyPlugin(org.bukkit.plugin.Plugin plugin) { + return !Bukkit.getUnsafe().isSupportedApiVersion(plugin.getDescription().getAPIVersion()); + } -+ // Paper end } diff --git a/src/main/java/org/bukkit/command/PluginCommand.java b/src/main/java/org/bukkit/command/PluginCommand.java index 1dbbc244309043b18c1d71707c4fb066c0d0e02d..551c5af6a7bfa2268cbc63be8e70d129bccaa912 100644 @@ -2268,28 +2267,56 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd + + // Paper end } -diff --git a/src/test/java/io/papermc/paper/testing/TestServer.java b/src/test/java/io/papermc/paper/testing/TestServer.java -index 756acf231b1b076b08046d86992ba7ce7f62a94f..52d27d977b9df0bdf02b33ed0aaa3b4db0a04cb4 100644 ---- a/src/test/java/io/papermc/paper/testing/TestServer.java -+++ b/src/test/java/io/papermc/paper/testing/TestServer.java -@@ -36,9 +36,6 @@ public final class TestServer { - - when(dummyServer.getTag(anyString(), any(NamespacedKey.class), any())).thenAnswer(ignored -> new EmptyTag()); +diff --git a/src/test/java/org/bukkit/TestServer.java b/src/test/java/org/bukkit/TestServer.java +index e3480404af8187588787383b18e3002032653d71..ec00f2ac0fe2be6c3b4c25b027bc4ff36008e5e1 100644 +--- a/src/test/java/org/bukkit/TestServer.java ++++ b/src/test/java/org/bukkit/TestServer.java +@@ -4,9 +4,7 @@ import java.util.HashMap; + import java.util.Iterator; + import java.util.Map; + import java.util.logging.Logger; +-import org.bukkit.command.SimpleCommandMap; +-import org.bukkit.plugin.PluginManager; +-import org.bukkit.plugin.SimplePluginManager; ++// Paper - Paper Plugins + import org.mockito.Mockito; + import org.mockito.invocation.InvocationOnMock; + import org.mockito.stubbing.Answer; +@@ -20,7 +18,7 @@ public final class TestServer { + + Mockito.when(instance.isPrimaryThread()).then(mock -> Thread.currentThread().equals(server.creatingThread)); + +- Mockito.when(instance.getPluginManager()).then(mock -> server.pluginManager); ++ // Paper - Paper Plugins + + Mockito.when(instance.getLogger()).then(new Answer<Logger>() { + final Logger logger = Logger.getLogger(TestServer.class.getCanonicalName()); +@@ -64,14 +62,14 @@ public final class TestServer { + // Paper end + + Bukkit.setServer(instance); +- server.pluginManager = new SimplePluginManager(instance, new SimpleCommandMap(instance)); ++ // Paper - Paper Plugins + } catch (Throwable t) { + throw new Error(t); + } + } -- final PluginManager pluginManager = new SimplePluginManager(dummyServer, new SimpleCommandMap(dummyServer)); -- when(dummyServer.getPluginManager()).thenReturn(pluginManager); -- - when(dummyServer.getRegistry(any())).thenAnswer(ignored -> new EmptyRegistry()); - when(dummyServer.getScoreboardCriteria(anyString())).thenReturn(null); + private Thread creatingThread = Thread.currentThread(); +- private PluginManager pluginManager; ++ // Paper - Paper Plugins + private TestServer() {} + public static void setup() {} diff --git a/src/test/java/org/bukkit/event/SyntheticEventTest.java b/src/test/java/org/bukkit/event/SyntheticEventTest.java deleted file mode 100644 -index 09886568ae6167141b463b6262565fa212af3385..0000000000000000000000000000000000000000 +index d402cb59f508205ebe9ee450594826b04cecb90b..0000000000000000000000000000000000000000 --- a/src/test/java/org/bukkit/event/SyntheticEventTest.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.bukkit.event; - +-import org.bukkit.TestServer; -import org.bukkit.plugin.PluginLoader; -import org.bukkit.plugin.SimplePluginManager; -import org.bukkit.plugin.TestPlugin; @@ -2301,15 +2328,14 @@ index 09886568ae6167141b463b6262565fa212af3385..00000000000000000000000000000000 - @SuppressWarnings("deprecation") - @Test - public void test() { -- io.papermc.paper.testing.TestServer.setup(); // Paper -- final JavaPluginLoader loader = new JavaPluginLoader(org.bukkit.Bukkit.getServer()); // Paper +- final JavaPluginLoader loader = new JavaPluginLoader(TestServer.getInstance()); - TestPlugin plugin = new TestPlugin(getClass().getName()) { - @Override - public PluginLoader getPluginLoader() { - return loader; - } - }; -- SimplePluginManager pluginManager = new SimplePluginManager(org.bukkit.Bukkit.getServer(), null); // Paper +- SimplePluginManager pluginManager = new SimplePluginManager(TestServer.getInstance(), null); - - TestEvent event = new TestEvent(false); - Impl impl = new Impl(); @@ -2338,26 +2364,28 @@ index 09886568ae6167141b463b6262565fa212af3385..00000000000000000000000000000000 -} diff --git a/src/test/java/org/bukkit/plugin/PluginManagerTest.java b/src/test/java/org/bukkit/plugin/PluginManagerTest.java deleted file mode 100644 -index c46ed2acb82db814d660459b705dd49e6d44240f..0000000000000000000000000000000000000000 +index 7c7cdfb509997de9f58d1b2c758e308a10ec0f92..0000000000000000000000000000000000000000 --- a/src/test/java/org/bukkit/plugin/PluginManagerTest.java +++ /dev/null -@@ -1,183 +0,0 @@ +@@ -1,185 +0,0 @@ -package org.bukkit.plugin; - -import static org.hamcrest.Matchers.*; -import static org.junit.Assert.*; +-import org.bukkit.TestServer; -import org.bukkit.event.Event; -import org.bukkit.event.TestEvent; -import org.bukkit.permissions.Permission; +-import org.bukkit.support.AbstractTestingBase; -import org.junit.After; -import org.junit.Test; - --public class PluginManagerTest { +-public class PluginManagerTest extends AbstractTestingBase { - private class MutableObject { - volatile Object value = null; - } - -- private static final PluginManager pm = org.bukkit.Bukkit.getServer().getPluginManager(); // Paper +- private static final PluginManager pm = TestServer.getInstance().getPluginManager(); - - private final MutableObject store = new MutableObject(); - diff --git a/patches/api/0010-Timings-v2.patch b/patches/api/0010-Timings-v2.patch index 43601634ff..7610edffa6 100644 --- a/patches/api/0010-Timings-v2.patch +++ b/patches/api/0010-Timings-v2.patch @@ -717,10 +717,10 @@ index 0000000000000000000000000000000000000000..199789d56d22fcb1b77ebd56805cc28a +} diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java new file mode 100644 -index 0000000000000000000000000000000000000000..eb9d58f8852e732a1284beeaf542989301d21b1c +index 0000000000000000000000000000000000000000..b9544c6f2adb0a8b32abd8ab3f1bdc5e00ee7679 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingHistory.java -@@ -0,0 +1,355 @@ +@@ -0,0 +1,356 @@ +/* + * This file is licensed under the MIT License (MIT). + * @@ -749,6 +749,7 @@ index 0000000000000000000000000000000000000000..eb9d58f8852e732a1284beeaf5429893 +import co.aikar.timings.TimingHistory.RegionData.RegionId; +import com.google.common.base.Function; +import com.google.common.collect.Sets; ++import java.util.HashMap; +import org.bukkit.Bukkit; +import org.bukkit.Chunk; +import org.bukkit.Material; @@ -930,11 +931,11 @@ index 0000000000000000000000000000000000000000..eb9d58f8852e732a1284beeaf5429893 + + @SuppressWarnings("unchecked") + final Map<EntityType, Counter> entityCounts = MRUMapCache.of(LoadingMap.of( -+ new EnumMap<EntityType, Counter>(EntityType.class), k -> new Counter() ++ new HashMap<>(), k -> new Counter() + )); + @SuppressWarnings("unchecked") + final Map<Material, Counter> tileEntityCounts = MRUMapCache.of(LoadingMap.of( -+ new EnumMap<Material, Counter>(Material.class), k -> new Counter() ++ new HashMap<>(), k -> new Counter() + )); + + static class RegionId { @@ -2854,10 +2855,10 @@ index 0000000000000000000000000000000000000000..3e61a926620a67daec3af54b72a1b911 + } +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index cd9566aeace9e2e1e01fb014b0c50ba93af305d7..1f4df6984a8b8bd3e72a5eb7fb1c66b6bfddfbf5 100644 +index c0ba2c8d47bd6f149410b57e45fc87a3b3ad4aab..51b5ac9d535d1ecac7719deed2e422db442a1171 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -832,7 +832,6 @@ public final class Bukkit { +@@ -833,7 +833,6 @@ public final class Bukkit { */ public static void reload() { server.reload(); @@ -2866,10 +2867,10 @@ index cd9566aeace9e2e1e01fb014b0c50ba93af305d7..1f4df6984a8b8bd3e72a5eb7fb1c66b6 /** diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index e359bc68007fbe62270ee62be762f844cbafe2d9..e773b40ff5fa9890c72e45e5c75a155bd7d02954 100644 +index 437d59ddf6a6859afc052257ba3f574929071522..c8a8305e41a55e98c99ed9df07f5763071a4485f 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1815,6 +1815,26 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1819,6 +1819,26 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi throw new UnsupportedOperationException("Not supported yet."); } @@ -2897,10 +2898,10 @@ index e359bc68007fbe62270ee62be762f844cbafe2d9..e773b40ff5fa9890c72e45e5c75a155b * Sends the component to the player * diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index 2042e3fb0ea347148814d9838cd7bb475bd23984..f68ef89f37057cf677a767026ab395f7a839a2f9 100644 +index 628fae98b17cd7dd1a5358562225cefefeb5051b..c84dc62c7383deeb00106c2e672af2018c4acadc 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -35,6 +35,7 @@ public interface UnsafeValues { +@@ -39,6 +39,7 @@ public interface UnsafeValues { net.kyori.adventure.text.Component resolveWithContext(net.kyori.adventure.text.Component component, org.bukkit.command.CommandSender context, org.bukkit.entity.Entity scoreboardSubject, boolean bypassPermissions) throws java.io.IOException; // Paper end @@ -2908,12 +2909,13 @@ index 2042e3fb0ea347148814d9838cd7bb475bd23984..f68ef89f37057cf677a767026ab395f7 Material toLegacy(Material material); Material fromLegacy(Material material); -@@ -111,4 +112,12 @@ public interface UnsafeValues { +@@ -119,4 +120,13 @@ public interface UnsafeValues { + static boolean isLegacyPlugin(org.bukkit.plugin.Plugin plugin) { return !Bukkit.getUnsafe().isSupportedApiVersion(plugin.getDescription().getAPIVersion()); } - // Paper end ++ // Paper end + -+ // Paper start ++ // Paper start - Timings + /** + * Server name to report to timings v2 + * @return name @@ -3455,10 +3457,10 @@ index 516d7fc7812aac343782861d0d567f54aa578c2a..00000000000000000000000000000000 - // Spigot end -} diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 84e63caeabe3e44381a464bde47bcadaddba9d43..7303c09e078dad0855c96280174b2760eacc20cd 100644 +index 9d8ddb2656d22c287ee1338fe4ab79fac0e8488a..6de23a9dbaf012dd8a95bab55835bb406b59a012 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -2199,7 +2199,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -2187,7 +2187,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM @Deprecated // Paper public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable java.util.UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) { throw new UnsupportedOperationException("Not supported yet."); diff --git a/patches/api/0011-Add-command-line-option-to-load-extra-plugin-jars-no.patch b/patches/api/0011-Add-command-line-option-to-load-extra-plugin-jars-no.patch index bd1f1a2e40..dd9af2b9bf 100644 --- a/patches/api/0011-Add-command-line-option-to-load-extra-plugin-jars-no.patch +++ b/patches/api/0011-Add-command-line-option-to-load-extra-plugin-jars-no.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Add command line option to load extra plugin jars not in the ex: java -jar paperclip.jar nogui -add-plugin=/path/to/plugin.jar -add-plugin=/path/to/another/plugin_jar.jar diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 1f4df6984a8b8bd3e72a5eb7fb1c66b6bfddfbf5..d77a7acb3ea82a331cb773bfda3e66d26a2bbd68 100644 +index 51b5ac9d535d1ecac7719deed2e422db442a1171..6cae51327c3acf6aa0284be3c94d7fdf3cab3486 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -77,6 +77,20 @@ public final class Bukkit { +@@ -78,6 +78,20 @@ public final class Bukkit { return server; } @@ -32,10 +32,10 @@ index 1f4df6984a8b8bd3e72a5eb7fb1c66b6bfddfbf5..d77a7acb3ea82a331cb773bfda3e66d2 * Attempts to set the {@link Server} singleton. * <p> diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index e773b40ff5fa9890c72e45e5c75a155bd7d02954..76d28815a51d73fc79ef8bb5abe8fc7758e6fd23 100644 +index c8a8305e41a55e98c99ed9df07f5763071a4485f..3d54c3c09203558e2c5348a9100af6809651f3e8 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -62,6 +62,18 @@ import org.jetbrains.annotations.Nullable; +@@ -63,6 +63,18 @@ import org.jetbrains.annotations.Nullable; */ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audience.ForwardingAudience { // Paper diff --git a/patches/api/0012-Player-affects-spawning-API.patch b/patches/api/0012-Player-affects-spawning-API.patch index 9b4bb245fc..f506383835 100644 --- a/patches/api/0012-Player-affects-spawning-API.patch +++ b/patches/api/0012-Player-affects-spawning-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Player affects spawning API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 7303c09e078dad0855c96280174b2760eacc20cd..c1affe53a8dc1d1219118610f1f0908c68bb7e51 100644 +index 6de23a9dbaf012dd8a95bab55835bb406b59a012..592aae628d0b87b4277f1697b5aabde622d03710 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -2051,6 +2051,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -2039,6 +2039,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM @Deprecated // Paper public String getLocale(); diff --git a/patches/api/0013-Add-getTPS-method.patch b/patches/api/0013-Add-getTPS-method.patch index f5bdf29597..44085eba7a 100644 --- a/patches/api/0013-Add-getTPS-method.patch +++ b/patches/api/0013-Add-getTPS-method.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add getTPS method diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index d77a7acb3ea82a331cb773bfda3e66d26a2bbd68..b2effed0281997a64dd0fdc965bce2a54af0cf4d 100644 +index 6cae51327c3acf6aa0284be3c94d7fdf3cab3486..3ea91c82670ae329a11b3d035378be047d91e3e8 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1940,6 +1940,17 @@ public final class Bukkit { +@@ -1941,6 +1941,17 @@ public final class Bukkit { return server.getEntity(uuid); } @@ -27,10 +27,10 @@ index d77a7acb3ea82a331cb773bfda3e66d26a2bbd68..b2effed0281997a64dd0fdc965bce2a5 * Get the advancement specified by this key. * diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 76d28815a51d73fc79ef8bb5abe8fc7758e6fd23..04f5191398dcfac02eb6553d549e77207c06e550 100644 +index 3d54c3c09203558e2c5348a9100af6809651f3e8..0eeefd5eb693af9e16182d6e39e7b4a1d8568bfa 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1652,6 +1652,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1653,6 +1653,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @Nullable Entity getEntity(@NotNull UUID uuid); diff --git a/patches/api/0014-Version-Command-2.0.patch b/patches/api/0014-Version-Command-2.0.patch index d0f58fe0ab..fe662bd219 100644 --- a/patches/api/0014-Version-Command-2.0.patch +++ b/patches/api/0014-Version-Command-2.0.patch @@ -56,10 +56,10 @@ index 0000000000000000000000000000000000000000..a736d7bcdc5861a01b66ba36158db1c7 + } +} diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index f68ef89f37057cf677a767026ab395f7a839a2f9..a6aa33b9574d0278e10927007a62290e1d102e73 100644 +index c84dc62c7383deeb00106c2e672af2018c4acadc..4c2ae9cb674260deba91d734bf7bf24fd7038485 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -119,5 +119,12 @@ public interface UnsafeValues { +@@ -128,5 +128,12 @@ public interface UnsafeValues { * @return name */ String getTimingsServerName(); diff --git a/patches/api/0015-Entity-Origin-API.patch b/patches/api/0015-Entity-Origin-API.patch index 908dae809d..78d2bb36d3 100644 --- a/patches/api/0015-Entity-Origin-API.patch +++ b/patches/api/0015-Entity-Origin-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Entity Origin API diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 598abaa82c634178043a29f6caa6ac5221659d06..70a32f89c16439c575d8928332cfed64d1d6ab7e 100644 +index 9cebad10eb06f42cd0428d80940fa8e223f0deab..083201330c781a0cb36051eef4ab95d4f1937a9d 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -725,5 +725,15 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent @@ -25,10 +25,10 @@ index 598abaa82c634178043a29f6caa6ac5221659d06..70a32f89c16439c575d8928332cfed64 // Paper end } diff --git a/src/main/java/org/bukkit/entity/FallingBlock.java b/src/main/java/org/bukkit/entity/FallingBlock.java -index 9a57341691ebfbb6ec5a426a13f2fa5d61009b48..bd87d1548faa2fb095adce9f156f24163995dbe7 100644 +index 60763c9b5b6528f5c8c83f53bb6cb8b1097a67b0..320a0e1f6b93ca9e85eac7d9a3f5821fa242c257 100644 --- a/src/main/java/org/bukkit/entity/FallingBlock.java +++ b/src/main/java/org/bukkit/entity/FallingBlock.java -@@ -92,4 +92,15 @@ public interface FallingBlock extends Entity { +@@ -81,4 +81,15 @@ public interface FallingBlock extends Entity { * @param damage the max damage to set. Must be >= 0 */ void setMaxDamage(int damage); diff --git a/patches/api/0017-Add-view-distance-API.patch b/patches/api/0017-Add-view-distance-API.patch index b019320419..9d0196e2bf 100644 --- a/patches/api/0017-Add-view-distance-API.patch +++ b/patches/api/0017-Add-view-distance-API.patch @@ -8,10 +8,10 @@ Add per player no-tick, tick, and send view distances. Also add send/no-tick view distance to World. diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 5357291ff0f2f20bd87ab9f6e57f6a4f6ff65226..887aa6217583d224d66f6d238ac269c23725d459 100644 +index d2e95c6ecc11b19ebb52c291884376c39d28467e..efe7ddee0c1321d3ab5c99d8e606ab04886c5d2c 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -2662,6 +2662,62 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient +@@ -2642,6 +2642,62 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient int getSimulationDistance(); // Spigot end @@ -75,10 +75,10 @@ index 5357291ff0f2f20bd87ab9f6e57f6a4f6ff65226..887aa6217583d224d66f6d238ac269c2 public class Spigot { diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index c1affe53a8dc1d1219118610f1f0908c68bb7e51..05f0fca8f94da035512bb44aa6f0f99609b8afc6 100644 +index 592aae628d0b87b4277f1697b5aabde622d03710..eee3f8fb587b54d90e892b8c5d0b2eb290059bd4 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -2065,6 +2065,78 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -2053,6 +2053,78 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @param affects Whether the player can affect mob spawning */ public void setAffectsSpawning(boolean affects); diff --git a/patches/api/0020-Expose-server-CommandMap.patch b/patches/api/0020-Expose-server-CommandMap.patch index f64662cba3..b0e6cac082 100644 --- a/patches/api/0020-Expose-server-CommandMap.patch +++ b/patches/api/0020-Expose-server-CommandMap.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose server CommandMap diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index b2effed0281997a64dd0fdc965bce2a54af0cf4d..f3a976ea2d7433623202c1d7cbf777608b0ba457 100644 +index 3ea91c82670ae329a11b3d035378be047d91e3e8..6255c0b355dc978b50578629dc612011644a2501 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2141,6 +2141,19 @@ public final class Bukkit { +@@ -2145,6 +2145,19 @@ public final class Bukkit { return server.getUnsafe(); } @@ -29,10 +29,10 @@ index b2effed0281997a64dd0fdc965bce2a54af0cf4d..f3a976ea2d7433623202c1d7cbf77760 public static Server.Spigot spigot() { return server.spigot(); diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 04f5191398dcfac02eb6553d549e77207c06e550..c0c67866014940a1331cd714d5c6eb50256ae143 100644 +index 0eeefd5eb693af9e16182d6e39e7b4a1d8568bfa..b711cc420d4ab150275b06162e3e9540252b5b06 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1662,6 +1662,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1663,6 +1663,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi public double[] getTPS(); // Paper end diff --git a/patches/api/0021-Graduate-bungeecord-chat-API-from-spigot-subclasses.patch b/patches/api/0021-Graduate-bungeecord-chat-API-from-spigot-subclasses.patch index 44569c683c..5ae873a631 100644 --- a/patches/api/0021-Graduate-bungeecord-chat-API-from-spigot-subclasses.patch +++ b/patches/api/0021-Graduate-bungeecord-chat-API-from-spigot-subclasses.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Graduate bungeecord chat API from spigot subclasses Change Javadoc to be accurate diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index f3a976ea2d7433623202c1d7cbf777608b0ba457..77b267c50523433eee0fa35c6c5b8a9e121c0862 100644 +index 6255c0b355dc978b50578629dc612011644a2501..ba65e37ce5b8b6c5e449c6bbe8fa7d6a83082f15 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -409,6 +409,30 @@ public final class Bukkit { +@@ -410,6 +410,30 @@ public final class Bukkit { return server.broadcastMessage(message); } @@ -41,10 +41,10 @@ index f3a976ea2d7433623202c1d7cbf777608b0ba457..77b267c50523433eee0fa35c6c5b8a9e * Gets the name of the update folder. The update folder is used to safely * update plugins at the right moment on a plugin load. diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index c0c67866014940a1331cd714d5c6eb50256ae143..0e63d438a74b96075d7d8fb51ddbd21be3447377 100644 +index b711cc420d4ab150275b06162e3e9540252b5b06..eac6eb66b00403ed0541201e54347a0286b4387b 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -344,6 +344,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -345,6 +345,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @Deprecated // Paper public int broadcastMessage(@NotNull String message); @@ -76,10 +76,10 @@ index c0c67866014940a1331cd714d5c6eb50256ae143..0e63d438a74b96075d7d8fb51ddbd21b * Gets the name of the update folder. The update folder is used to safely * update plugins at the right moment on a plugin load. diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 05f0fca8f94da035512bb44aa6f0f99609b8afc6..f5d419920aa5b83b6c9f680cba6c87646c2be026 100644 +index eee3f8fb587b54d90e892b8c5d0b2eb290059bd4..fe49a1871e1143bfd6579a5df02d6974e0eb7382 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -915,6 +915,42 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -903,6 +903,42 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ public void sendMap(@NotNull MapView map); diff --git a/patches/api/0025-Player-Tab-List-and-Title-APIs.patch b/patches/api/0025-Player-Tab-List-and-Title-APIs.patch index 63400d9a6b..fe3743c137 100644 --- a/patches/api/0025-Player-Tab-List-and-Title-APIs.patch +++ b/patches/api/0025-Player-Tab-List-and-Title-APIs.patch @@ -432,10 +432,10 @@ index 0000000000000000000000000000000000000000..9e90c3df567a65b48a0b9341f784eb90 + } +} diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index f5d419920aa5b83b6c9f680cba6c87646c2be026..28ca7231bfd8b5381b54ea323dfa2c3a972c9700 100644 +index fe49a1871e1143bfd6579a5df02d6974e0eb7382..14f101acef4063c15d9c8c1e24eee33a4f4debb6 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -949,6 +949,131 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -937,6 +937,131 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM public default void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) { spigot().sendMessage(position, components); } diff --git a/patches/api/0027-Complete-resource-pack-API.patch b/patches/api/0027-Complete-resource-pack-API.patch index ea6054e17d..5a8fadbd8c 100644 --- a/patches/api/0027-Complete-resource-pack-API.patch +++ b/patches/api/0027-Complete-resource-pack-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Complete resource pack API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 28ca7231bfd8b5381b54ea323dfa2c3a972c9700..d980cc3ed54db4bdf22c73d75d99871f1b16ecb0 100644 +index 14f101acef4063c15d9c8c1e24eee33a4f4debb6..3a1e584d584041f36b861e4507f7a58933f9b32d 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1529,7 +1529,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1517,7 +1517,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @throws IllegalArgumentException Thrown if the URL is null. * @throws IllegalArgumentException Thrown if the URL is too long. The * length restriction is an implementation specific arbitrary value. @@ -18,7 +18,7 @@ index 28ca7231bfd8b5381b54ea323dfa2c3a972c9700..d980cc3ed54db4bdf22c73d75d99871f public void setResourcePack(@NotNull String url); /** -@@ -2355,6 +2357,124 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -2343,6 +2345,124 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM default net.kyori.adventure.text.event.HoverEvent<net.kyori.adventure.text.event.HoverEvent.ShowEntity> asHoverEvent(final @NotNull java.util.function.UnaryOperator<net.kyori.adventure.text.event.HoverEvent.ShowEntity> op) { return net.kyori.adventure.text.event.HoverEvent.showEntity(op.apply(net.kyori.adventure.text.event.HoverEvent.ShowEntity.of(this.getType().getKey(), this.getUniqueId(), this.displayName()))); } diff --git a/patches/api/0030-Add-command-to-reload-permissions.yml-and-require-co.patch b/patches/api/0030-Add-command-to-reload-permissions.yml-and-require-co.patch index 94d7e38e7d..4618d1e7ea 100644 --- a/patches/api/0030-Add-command-to-reload-permissions.yml-and-require-co.patch +++ b/patches/api/0030-Add-command-to-reload-permissions.yml-and-require-co.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add command to reload permissions.yml and require confirm to diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 77b267c50523433eee0fa35c6c5b8a9e121c0862..0b9b28b7a07a8176142b18cfa767c81f5035d52d 100644 +index ba65e37ce5b8b6c5e449c6bbe8fa7d6a83082f15..5c7a7d1cb0fc760f4209061aa653fdedb729dd36 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2176,6 +2176,13 @@ public final class Bukkit { +@@ -2180,6 +2180,13 @@ public final class Bukkit { public static org.bukkit.command.CommandMap getCommandMap() { return server.getCommandMap(); } @@ -24,10 +24,10 @@ index 77b267c50523433eee0fa35c6c5b8a9e121c0862..0b9b28b7a07a8176142b18cfa767c81f @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 0e63d438a74b96075d7d8fb51ddbd21be3447377..e76c11688760a24f8395f562108b4c5fd7139b42 100644 +index eac6eb66b00403ed0541201e54347a0286b4387b..27ff3b0b594bca7c5ae45937e1044e1b2f30c60b 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1923,4 +1923,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1927,4 +1927,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @NotNull Spigot spigot(); // Spigot end diff --git a/patches/api/0043-Allow-Reloading-of-Command-Aliases.patch b/patches/api/0043-Allow-Reloading-of-Command-Aliases.patch index 7e19f95ecf..0128232327 100644 --- a/patches/api/0043-Allow-Reloading-of-Command-Aliases.patch +++ b/patches/api/0043-Allow-Reloading-of-Command-Aliases.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Command Aliases Reload the aliases stored in commands.yml diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 0b9b28b7a07a8176142b18cfa767c81f5035d52d..22d9538abe61ccb3e5d3ae407d54446fa172fa39 100644 +index 5c7a7d1cb0fc760f4209061aa653fdedb729dd36..763ba521c4b2cdfd0fda062281207dc790db76e1 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2183,6 +2183,15 @@ public final class Bukkit { +@@ -2187,6 +2187,15 @@ public final class Bukkit { public static void reloadPermissions() { server.reloadPermissions(); } @@ -26,10 +26,10 @@ index 0b9b28b7a07a8176142b18cfa767c81f5035d52d..22d9538abe61ccb3e5d3ae407d54446f @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index e76c11688760a24f8395f562108b4c5fd7139b42..26516ae5519675dac359b578d0f06ea2c0745ab3 100644 +index 27ff3b0b594bca7c5ae45937e1044e1b2f30c60b..459ca6d2a797c4007fda3129badd44f35335615d 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1925,4 +1925,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1929,4 +1929,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi // Spigot end void reloadPermissions(); // Paper diff --git a/patches/api/0046-Add-String-based-Action-Bar-API.patch b/patches/api/0046-Add-String-based-Action-Bar-API.patch index b773fde223..1775f067b9 100644 --- a/patches/api/0046-Add-String-based-Action-Bar-API.patch +++ b/patches/api/0046-Add-String-based-Action-Bar-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add String based Action Bar API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index d980cc3ed54db4bdf22c73d75d99871f1b16ecb0..5b9480a3d06155c391f1347cb56fde9612d75ed8 100644 +index 3a1e584d584041f36b861e4507f7a58933f9b32d..5d47d3089f244b146aab63d54f5aefba51e481a9 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -916,6 +916,39 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -904,6 +904,39 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM public void sendMap(@NotNull MapView map); // Paper start @@ -48,7 +48,7 @@ index d980cc3ed54db4bdf22c73d75d99871f1b16ecb0..5b9480a3d06155c391f1347cb56fde96 /** * Sends the component to the player * -@@ -943,9 +976,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -931,9 +964,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM /** * Sends an array of components as a single message to the specified screen position of this player * diff --git a/patches/api/0054-Add-configuration-option-to-prevent-player-names-fro.patch b/patches/api/0054-Add-configuration-option-to-prevent-player-names-fro.patch index 2013c6f360..73b0b0489a 100644 --- a/patches/api/0054-Add-configuration-option-to-prevent-player-names-fro.patch +++ b/patches/api/0054-Add-configuration-option-to-prevent-player-names-fro.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add configuration option to prevent player names from being diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 22d9538abe61ccb3e5d3ae407d54446fa172fa39..68a79316cec0c4ab83c6f986e3a9561440994319 100644 +index 763ba521c4b2cdfd0fda062281207dc790db76e1..0e83259a03292daf5c069d570a324ae0323351ef 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2192,6 +2192,16 @@ public final class Bukkit { +@@ -2196,6 +2196,16 @@ public final class Bukkit { public static boolean reloadCommandAliases() { return server.reloadCommandAliases(); } @@ -27,10 +27,10 @@ index 22d9538abe61ccb3e5d3ae407d54446fa172fa39..68a79316cec0c4ab83c6f986e3a95614 @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 26516ae5519675dac359b578d0f06ea2c0745ab3..0cf214c45078d83d678f12f6cb350e50fc5f1e94 100644 +index 459ca6d2a797c4007fda3129badd44f35335615d..f8592dbe75680133e5db1e166fac48957c57cac9 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1927,4 +1927,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1931,4 +1931,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi void reloadPermissions(); // Paper boolean reloadCommandAliases(); // Paper diff --git a/patches/api/0055-Fix-upstream-javadocs.patch b/patches/api/0055-Fix-upstream-javadocs.patch index 7bdb3f4135..91e65c81dd 100644 --- a/patches/api/0055-Fix-upstream-javadocs.patch +++ b/patches/api/0055-Fix-upstream-javadocs.patch @@ -53,10 +53,10 @@ index 96ef22fe879c7be4f67bbb4d60c45ad11764dd5b..5dc9f9ede98d93925c99ee382e93f15f * @param target the target to remove from this list */ diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 68a79316cec0c4ab83c6f986e3a9561440994319..316fc8348445b99af7ffc7c4ad24948a1115dfe6 100644 +index 0e83259a03292daf5c069d570a324ae0323351ef..1704d04097c9d364e5f9049a6a0f60945db482dd 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1299,10 +1299,7 @@ public final class Bukkit { +@@ -1300,10 +1300,7 @@ public final class Bukkit { } /** @@ -68,7 +68,7 @@ index 68a79316cec0c4ab83c6f986e3a9561440994319..316fc8348445b99af7ffc7c4ad24948a * * @param type the type of list to fetch, cannot be null * @return a ban list of the specified type -@@ -1364,6 +1361,8 @@ public final class Bukkit { +@@ -1365,6 +1362,8 @@ public final class Bukkit { /** * Gets every player that has ever played on this server. @@ -78,10 +78,10 @@ index 68a79316cec0c4ab83c6f986e3a9561440994319..316fc8348445b99af7ffc7c4ad24948a * @return an array containing all previous players */ diff --git a/src/main/java/org/bukkit/ChunkSnapshot.java b/src/main/java/org/bukkit/ChunkSnapshot.java -index 0cf808356a1a5c6fc4bcf97a694ed9beb80a776a..dc765dea47a9a1c1520fb16ddb24f81413ed0dd1 100644 +index 803d4de580acc616424922fee4715a689b778886..94ab204a0739163613a5c651329606924c75d85b 100644 --- a/src/main/java/org/bukkit/ChunkSnapshot.java +++ b/src/main/java/org/bukkit/ChunkSnapshot.java -@@ -136,7 +136,7 @@ public interface ChunkSnapshot { +@@ -137,7 +137,7 @@ public interface ChunkSnapshot { * Get raw biome temperature at given coordinates * * @param x X-coordinate (0-15) @@ -91,10 +91,10 @@ index 0cf808356a1a5c6fc4bcf97a694ed9beb80a776a..dc765dea47a9a1c1520fb16ddb24f814 * @return temperature at given coordinate */ diff --git a/src/main/java/org/bukkit/RegionAccessor.java b/src/main/java/org/bukkit/RegionAccessor.java -index 43f5aab2fe70af5f570de1f21eca83905f1e2f57..05c29cbd2ae1ca0434a90f8389479bd608ca2ac1 100644 +index a73c954aad2957c630b64e7b750f33f73809f9b1..8264599a873ed23ec6552d1550a414ec3712487b 100644 --- a/src/main/java/org/bukkit/RegionAccessor.java +++ b/src/main/java/org/bukkit/RegionAccessor.java -@@ -158,7 +158,7 @@ public interface RegionAccessor { +@@ -159,7 +159,7 @@ public interface RegionAccessor { * Creates a tree at the given {@link Location} * * @param location Location to spawn the tree @@ -103,7 +103,7 @@ index 43f5aab2fe70af5f570de1f21eca83905f1e2f57..05c29cbd2ae1ca0434a90f8389479bd6 * @param type Type of the tree to create * @return true if the tree was created successfully, otherwise false */ -@@ -170,14 +170,14 @@ public interface RegionAccessor { +@@ -171,14 +171,14 @@ public interface RegionAccessor { * The provided consumer gets called for every block which gets changed * as a result of the tree generation. When the consumer gets called no * modifications to the world are done yet. Which means, that calling @@ -120,7 +120,7 @@ index 43f5aab2fe70af5f570de1f21eca83905f1e2f57..05c29cbd2ae1ca0434a90f8389479bd6 * @param type Type of the tree to create * @param stateConsumer The consumer which should get called for every block which gets changed * @return true if the tree was created successfully, otherwise false -@@ -197,7 +197,7 @@ public interface RegionAccessor { +@@ -198,7 +198,7 @@ public interface RegionAccessor { * If it returns {@code false} the block won't get set in the world. * * @param location Location to spawn the tree @@ -130,10 +130,10 @@ index 43f5aab2fe70af5f570de1f21eca83905f1e2f57..05c29cbd2ae1ca0434a90f8389479bd6 * @param statePredicate The predicate which should get used to test if a block should be set or not. * @return true if the tree was created successfully, otherwise false diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 0cf214c45078d83d678f12f6cb350e50fc5f1e94..d7b081ac72d7d2aa3b675c6cbb8fb66f73facc99 100644 +index f8592dbe75680133e5db1e166fac48957c57cac9..dca2cbe8c93469c8c1c404bc34748a9dcf6d3368 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -542,13 +542,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -543,13 +543,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi * </ul> * <p> * <b>Note:</b> If set to 0, {@link SpawnCategory} mobs spawning will be disabled. @@ -148,7 +148,7 @@ index 0cf214c45078d83d678f12f6cb350e50fc5f1e94..d7b081ac72d7d2aa3b675c6cbb8fb66f */ public int getTicksPerSpawns(@NotNull SpawnCategory spawnCategory); -@@ -1108,10 +1105,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1109,10 +1106,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi public Set<OfflinePlayer> getBannedPlayers(); /** @@ -160,7 +160,7 @@ index 0cf214c45078d83d678f12f6cb350e50fc5f1e94..d7b081ac72d7d2aa3b675c6cbb8fb66f * * @param type the type of list to fetch, cannot be null * @return a ban list of the specified type -@@ -1161,6 +1155,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1162,6 +1156,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi /** * Gets every player that has ever played on this server. @@ -170,10 +170,10 @@ index 0cf214c45078d83d678f12f6cb350e50fc5f1e94..d7b081ac72d7d2aa3b675c6cbb8fb66f * @return an array containing all previous players */ diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 4ef6bbfa753da439ac57bd8d70dd114d73665c8d..7f23527168a33b92d823f76765edfe00abe0e4f6 100644 +index 80189c7c70d7043016a24c0ac87655636408856e..a53a990477fd84f7f7dcb50058819eead8e8b5b5 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -2576,7 +2576,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient +@@ -2556,7 +2556,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient /** * Find the closest nearby structure of a given {@link StructureType}. * Finding unexplored structures can, and will, block if the world is @@ -182,7 +182,7 @@ index 4ef6bbfa753da439ac57bd8d70dd114d73665c8d..7f23527168a33b92d823f76765edfe00 * temporarily freezing while locating an unexplored structure. * <p> * The {@code radius} is not a rigid square radius. Each structure may alter -@@ -2610,7 +2610,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient +@@ -2590,7 +2590,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient /** * Find the closest nearby structure of a given {@link StructureType}. * Finding unexplored structures can, and will, block if the world is @@ -191,7 +191,7 @@ index 4ef6bbfa753da439ac57bd8d70dd114d73665c8d..7f23527168a33b92d823f76765edfe00 * temporarily freezing while locating an unexplored structure. * <p> * The {@code radius} is not a rigid square radius. Each structure may alter -@@ -2643,7 +2643,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient +@@ -2623,7 +2623,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient /** * Find the closest nearby structure of a given {@link Structure}. Finding * unexplored structures can, and will, block if the world is looking in @@ -201,14 +201,14 @@ index 4ef6bbfa753da439ac57bd8d70dd114d73665c8d..7f23527168a33b92d823f76765edfe00 * <p> * The {@code radius} is not a rigid square radius. Each structure may alter diff --git a/src/main/java/org/bukkit/block/Bed.java b/src/main/java/org/bukkit/block/Bed.java -index f9bd74f9ce6bd6650726e5a993f9b6e292cdc74d..f4c37ce1fe7aac3dde8485ee51fc8888ed56e79e 100644 +index 92532e335f07b14d1dad0de90c10f764d5fd9d8b..f4c37ce1fe7aac3dde8485ee51fc8888ed56e79e 100644 --- a/src/main/java/org/bukkit/block/Bed.java +++ b/src/main/java/org/bukkit/block/Bed.java @@ -4,7 +4,22 @@ import org.bukkit.material.Colorable; /** * Represents a captured state of a bed. -- * @deprecated does not provide useful information beyond the material itself +- * @deprecated does not provide useful information beyond the block type itself */ -@Deprecated -public interface Bed extends TileState, Colorable { } @@ -231,10 +231,10 @@ index f9bd74f9ce6bd6650726e5a993f9b6e292cdc74d..f4c37ce1fe7aac3dde8485ee51fc8888 +// Paper end +} diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java -index f8e12868f2e629cdf4784f0157fdb2f8e7b01f99..870ad6cd930653e6248abcc0fce94ffafbe9ebde 100644 +index 1197cb8a6be92296c494010d87e046dfe912a161..d834e8d8d532ce5b46201ff5c02d54a6c047f615 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java -@@ -357,7 +357,7 @@ public interface Block extends Metadatable, Translatable { +@@ -356,7 +356,7 @@ public interface Block extends Metadatable, Translatable { * Gets the temperature of this block. * <p> * If the raw biome temperature without adjusting for height effects is @@ -244,18 +244,27 @@ index f8e12868f2e629cdf4784f0157fdb2f8e7b01f99..870ad6cd930653e6248abcc0fce94ffa * @return Temperature of this block */ diff --git a/src/main/java/org/bukkit/block/data/BlockData.java b/src/main/java/org/bukkit/block/data/BlockData.java -index 2e2232956f626669005cfdfd6550aa8ee29fc1ab..869fa47a13fbcb128228963bf53cc72da4499a01 100644 +index dd286dd68682658af096790c048b88ee0c401214..7f4a858ab98f8d0c3c2f890ca88bc13b6ba967fa 100644 --- a/src/main/java/org/bukkit/block/data/BlockData.java +++ b/src/main/java/org/bukkit/block/data/BlockData.java -@@ -215,7 +215,7 @@ public interface BlockData extends Cloneable { - * {@link Material#REDSTONE_WIRE} -> {@link Material#REDSTONE} - * {@link Material#CARROTS} -> {@link Material#CARROT} +@@ -208,15 +208,13 @@ public interface BlockData extends Cloneable { + /** + * Gets the ItemType that a player would use to place this block. + * <p> +- * For most blocks this is the same as {@link BlockType#asItemType()} but some blocks +- * have different item types used to place them. +- * ++ * This is identical to {@link BlockType#getItemType()}. + * For example: + * <pre> + * {@link ItemType#REDSTONE_WIRE} -> {@link BlockType#REDSTONE} + * {@link ItemType#CARROTS} -> {@link BlockType#CARROT} * </pre> -- * @return placement material -+ * @return placement material or {@link Material#AIR} if it doesn't have one +- * @return placement item type ++ * @return placement item type or {@link ItemType#AIR} if it doesn't have one */ @NotNull - Material getPlacementMaterial(); + ItemType getPlacementType(); diff --git a/src/main/java/org/bukkit/block/data/FaceAttachable.java b/src/main/java/org/bukkit/block/data/FaceAttachable.java index 9599e1237b9717ddbf84c3738bf6c1293e8b3c54..950266b4bb0a2fabeb9539c5676ed58f0b0fe620 100644 --- a/src/main/java/org/bukkit/block/data/FaceAttachable.java @@ -331,10 +340,10 @@ index 91fc11dda99de506be83d40df8929bf7cd8e8d85..7dc631ebd009f5f5c3ac1699c3f3515c // Paper end } diff --git a/src/main/java/org/bukkit/entity/Arrow.java b/src/main/java/org/bukkit/entity/Arrow.java -index 8814519df13c5e9475774f4bce4c8c6a462c2978..be9a35790fc664721ac94f3708613eb77631a0c5 100644 +index 8eb0cf31b1ce6d714a14cf65bbb117ff163ae2f3..8e57082e8b19a2fd9625816c2ea4a90d41f78ca5 100644 --- a/src/main/java/org/bukkit/entity/Arrow.java +++ b/src/main/java/org/bukkit/entity/Arrow.java -@@ -73,7 +73,7 @@ public interface Arrow extends AbstractArrow { +@@ -93,7 +93,7 @@ public interface Arrow extends AbstractArrow { * Removes a custom potion effect from this arrow. * * @param type the potion effect type to remove @@ -356,8 +365,32 @@ index 0449664d7cd0c52ac34d2101110f1ab42070257c..57f8e7bf4c7b4c4a4e793cfd5d7db743 * the portal, it will fly to it before mounting. */ LAND_ON_PORTAL, +diff --git a/src/main/java/org/bukkit/entity/EntityCategory.java b/src/main/java/org/bukkit/entity/EntityCategory.java +index fd960f20c79f721575c9bd4074a5ca9ab6b796b1..3e2ae87c806ce439d6c8848deecda48a28dbed96 100644 +--- a/src/main/java/org/bukkit/entity/EntityCategory.java ++++ b/src/main/java/org/bukkit/entity/EntityCategory.java +@@ -23,7 +23,7 @@ public enum EntityCategory { + * <li>Are subject to burning in daylight (though not all). + * <li>Sink in water (except {@link Drowned}, {@link Phantom Phantoms} + * and {@link Wither Withers}). +- * <li>Take additional damage from {@link Enchantment#DAMAGE_UNDEAD}. ++ * <li>Take additional damage from {@link Enchantment#SMITE}. + * <li>Are ignored by {@link Wither Withers}. + * </ul> + */ +@@ -31,8 +31,8 @@ public enum EntityCategory { + /** + * Entities of the arthropod family. These creatures: + * <ul> +- * <li>Take additional damage and receive {@link PotionEffectType#SLOW} +- * from {@link Enchantment#DAMAGE_ARTHROPODS}. ++ * <li>Take additional damage and receive {@link PotionEffectType#SLOWNESS} ++ * from {@link Enchantment#BANE_OF_ARTHROPODS}. + * <li>Are immune to {@link PotionEffectType#POISON} if they are spiders. + * </ul> + */ diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index 09936f3a2376a46721bbc8365c989581c2a789ef..3845a726adbd0e75d7bf2aeeb6da8cb571d51a8f 100644 +index f2faa8b9a7da1c9af26f494ae82ae5372dcc4805..411dbbd8046a3157747713fea9ae19eca113e9b7 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java @@ -22,6 +22,11 @@ import org.jetbrains.annotations.Nullable; @@ -414,7 +447,7 @@ index ae9eaaa8e38e1d9dfc459926c7fc51ddb89de84a..b2ec535bb1b0ce0c114ddd7638b90218 @Override public int getConversionTime(); diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 5b9480a3d06155c391f1347cb56fde9612d75ed8..26236250f4418def6f65c811800063588b43fa84 100644 +index 5d47d3089f244b146aab63d54f5aefba51e481a9..383d12b1ffc76bc8f9100a71027ac9e25e4a3742 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -327,15 +327,15 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM @@ -446,7 +479,7 @@ index 5b9480a3d06155c391f1347cb56fde9612d75ed8..26236250f4418def6f65c81180006358 * @param loc the location to play the effect at * @param effect the {@link Effect} * @param data a data bit needed for some effects -@@ -933,7 +933,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -921,7 +921,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * * Use supplied alternative character to the section symbol to represent legacy color codes. * @@ -455,7 +488,7 @@ index 5b9480a3d06155c391f1347cb56fde9612d75ed8..26236250f4418def6f65c81180006358 * @param message The message to send * @deprecated use {@link #sendActionBar(net.kyori.adventure.text.Component)} */ -@@ -1399,7 +1399,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1387,7 +1387,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM /** * Allows this player to see a player that was previously hidden. If @@ -464,7 +497,7 @@ index 5b9480a3d06155c391f1347cb56fde9612d75ed8..26236250f4418def6f65c81180006358 * remain hidden until the other plugin calls this method too. * * @param plugin Plugin that wants to show the player -@@ -1428,7 +1428,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1416,7 +1416,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM /** * Allows this player to see an entity that was previously hidden. If @@ -518,18 +551,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 fb4c6f92c7c16ff8cdc0a054a270b41d78dfcdde..a6e57f8ad3f09d05ca61c824d128221528f7a96d 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 { +@@ -225,7 +225,7 @@ public interface Villager extends AbstractVillager { */ - NITWIT, + public static final 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, + public static final Profession SHEPHERD = getProfession("shepherd"); diff --git a/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java b/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java index 44f7f6939a27b9a0a796d91eac4b7c97ec90a643..641c71ab66bd2499b35cf3c1d533fd105d096e10 100644 --- a/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java @@ -546,7 +579,7 @@ index 44f7f6939a27b9a0a796d91eac4b7c97ec90a643..641c71ab66bd2499b35cf3c1d533fd10 public class BlockExplodeEvent extends BlockEvent implements Cancellable { private static final HandlerList handlers = new HandlerList(); diff --git a/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java b/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java -index be0a2d1f234d8265d98e54e518a994957b1f3ab7..4e3c406ba883aae553e8d69b6b719b872cd6096c 100644 +index ff20d0768aed1732dcef8989c62e19c01e8ec70a..a4525c1ac5e6aa0130358739db35fbb732476e33 100644 --- a/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java @@ -114,7 +114,7 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable { @@ -774,7 +807,7 @@ index 4c2102a11c3d682d98f0db4ccafa35231e66bcdd..ca238af544764273b9cd4cf3587e8632 public class PlayerResourcePackStatusEvent extends PlayerEvent { diff --git a/src/main/java/org/bukkit/generator/ChunkGenerator.java b/src/main/java/org/bukkit/generator/ChunkGenerator.java -index 0cc6e29a5af28e95f87f415d6b2424d4622a6f34..c0b749a5bbf4980d01fed74768bb61909b579cb9 100644 +index 08d656ee57b080e07b7b7d97c9551fb0a0e3e94b..82d8fe3be9ff6914b44872462c3827123459735d 100644 --- a/src/main/java/org/bukkit/generator/ChunkGenerator.java +++ b/src/main/java/org/bukkit/generator/ChunkGenerator.java @@ -627,7 +627,7 @@ public abstract class ChunkGenerator { @@ -1045,45 +1078,41 @@ index 62fbd7f6d8195bebcab7f704a0a485a1bbeca26c..5461f7fa75f5a065bb333b4a113640b5 * @return the currently held item * @see #getItemInMainHand() diff --git a/src/main/java/org/bukkit/inventory/ShapedRecipe.java b/src/main/java/org/bukkit/inventory/ShapedRecipe.java -index 8971ec20d36c4d1a8fb07ec4603221791a2b52b4..4c7f30877c608e327908a61e4bd68789191e2f3c 100644 +index a9dbb11148e5bdf3e6c251bc98b6a8295aceba2f..e92de5ca8bd48723a493495db3ca2e2f5b55fab5 100644 --- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java +++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java -@@ -30,8 +30,6 @@ public class ShapedRecipe implements Recipe, Keyed { +@@ -29,7 +29,6 @@ public class ShapedRecipe implements Recipe, Keyed { * @param result The item you want the recipe to create. * @see ShapedRecipe#shape(String...) - * @see ShapedRecipe#setIngredient(char, Material) -- * @see ShapedRecipe#setIngredient(char, Material, int) + * @see ShapedRecipe#setIngredient(char, ItemType) - * @see ShapedRecipe#setIngredient(char, MaterialData) * @see ShapedRecipe#setIngredient(char, RecipeChoice) * @deprecated Recipes must have keys. Use {@link #ShapedRecipe(NamespacedKey, ItemStack)} * instead. -@@ -52,8 +50,6 @@ public class ShapedRecipe implements Recipe, Keyed { +@@ -50,7 +49,6 @@ public class ShapedRecipe implements Recipe, Keyed { * @param result The item you want the recipe to create. * @see ShapedRecipe#shape(String...) - * @see ShapedRecipe#setIngredient(char, Material) -- * @see ShapedRecipe#setIngredient(char, Material, int) + * @see ShapedRecipe#setIngredient(char, ItemType) - * @see ShapedRecipe#setIngredient(char, MaterialData) * @see ShapedRecipe#setIngredient(char, RecipeChoice) */ public ShapedRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result) { diff --git a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java -index df4c52f1f0be2409c7506b09167bd58b5602fa7a..74449a635aca84adcc1652e1e85f2d27dcaf6842 100644 +index 94393a1f0d19a58a1029f9c31193b3d9279c5ef0..69a25d05efcc96f8b3d3b5455e571259e5af2dab 100644 --- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java +++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java -@@ -38,11 +38,8 @@ public class ShapelessRecipe implements Recipe, Keyed { +@@ -37,9 +37,8 @@ public class ShapelessRecipe implements Recipe, Keyed { * @param key the unique recipe key * @param result The item you want the recipe to create. - * @see ShapelessRecipe#addIngredient(Material) + * @see ShapelessRecipe#addIngredient(ItemType) - * @see ShapelessRecipe#addIngredient(MaterialData) -- * @see ShapelessRecipe#addIngredient(Material,int) - * @see ShapelessRecipe#addIngredient(int,Material) + * @see ShapelessRecipe#addIngredient(int,ItemType) - * @see ShapelessRecipe#addIngredient(int,MaterialData) -- * @see ShapelessRecipe#addIngredient(int,Material,int) + * @see ShapelessRecipe#addIngredient(RecipeChoice) */ public ShapelessRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result) { - Preconditions.checkArgument(result.getType() != Material.AIR, "Recipe must have non-AIR result."); -@@ -184,7 +181,7 @@ public class ShapelessRecipe implements Recipe, Keyed { + Preconditions.checkArgument(result.getType() != ItemType.AIR, "Recipe must have non-AIR result."); +@@ -147,7 +146,7 @@ public class ShapelessRecipe implements Recipe, Keyed { /** * Removes multiple instances of an ingredient from the list. If there are @@ -1107,10 +1136,10 @@ index af04071d37e70b8cc9837d57477c8493be8afb9f..582671a0a94d47302c0fdc572d486282 this.key = key; this.result = result; diff --git a/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java b/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java -index 07c3dff4d6190ef388d9c1e1c36f67f00a3e8e66..597a18a767b68b47e81454b7d44613c7178c1366 100644 +index 8df05b404eb1bcbe1bf358b8cb34c46f25ceeba1..0de3c34c67b8c37a3c7ba8bcec4404ed4ef5019e 100644 --- a/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java +++ b/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java -@@ -28,7 +28,7 @@ public class StonecuttingRecipe implements Recipe, Keyed { +@@ -33,7 +33,7 @@ public class StonecuttingRecipe implements Recipe, Keyed { } /** @@ -1119,16 +1148,16 @@ index 07c3dff4d6190ef388d9c1e1c36f67f00a3e8e66..597a18a767b68b47e81454b7d44613c7 * * @param key The unique recipe key * @param result The item you want the recipe to create. -@@ -42,7 +42,7 @@ public class StonecuttingRecipe implements Recipe, Keyed { +@@ -47,7 +47,7 @@ public class StonecuttingRecipe implements Recipe, Keyed { } /** - * Sets the input of this cooking recipe. + * Sets the input of this Stonecutting recipe. * - * @param input The input material. + * @param input The input item type. * @return The changed recipe, so you can chain calls. -@@ -64,7 +64,7 @@ public class StonecuttingRecipe implements Recipe, Keyed { +@@ -69,7 +69,7 @@ public class StonecuttingRecipe implements Recipe, Keyed { } /** @@ -1150,6 +1179,28 @@ index 049c70c935fd7a781280d223f74bbbf87223f505..f78714c2a6d9da162c9802552984cbfa * {@link EquipmentSlot} will be returned. This is because * AttributeModifiers without a slot are active in any slot.<br> * If there are no attributes set for the given slot, an empty map +diff --git a/src/main/java/org/bukkit/loot/LootContext.java b/src/main/java/org/bukkit/loot/LootContext.java +index 71b7aa9d675e1714e286e6fd4015ead036d912e0..b35dba42069f771db8727bf98f9d17aff9d6094e 100644 +--- a/src/main/java/org/bukkit/loot/LootContext.java ++++ b/src/main/java/org/bukkit/loot/LootContext.java +@@ -54,7 +54,7 @@ public final class LootContext { + + /** + * Represents the +- * {@link org.bukkit.enchantments.Enchantment#LOOT_BONUS_MOBS} the ++ * {@link org.bukkit.enchantments.Enchantment#LOOTING} the + * {@link #getKiller()} entity has on their equipped item. + * + * This value is only set via +@@ -124,7 +124,7 @@ public final class LootContext { + } + + /** +- * Set the {@link org.bukkit.enchantments.Enchantment#LOOT_BONUS_MOBS} ++ * Set the {@link org.bukkit.enchantments.Enchantment#LOOTING} + * level equivalent to use when generating loot. Values less than or + * equal to 0 will force the {@link LootTable} to only return a single + * {@link org.bukkit.inventory.ItemStack} per pool. diff --git a/src/main/java/org/bukkit/scoreboard/Objective.java b/src/main/java/org/bukkit/scoreboard/Objective.java index 86a0a6f9e8487d6dfaf60876ace3dcc9b4722826..571b43c2809d2b248feebc7decba6017a67c8aee 100644 --- a/src/main/java/org/bukkit/scoreboard/Objective.java diff --git a/patches/api/0059-Basic-PlayerProfile-API.patch b/patches/api/0059-Basic-PlayerProfile-API.patch index 13200b1ca2..7051fee915 100644 --- a/patches/api/0059-Basic-PlayerProfile-API.patch +++ b/patches/api/0059-Basic-PlayerProfile-API.patch @@ -321,10 +321,10 @@ index 0000000000000000000000000000000000000000..7b3b6ef533d32169fbeca389bd61cfc6 + } +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 316fc8348445b99af7ffc7c4ad24948a1115dfe6..10eeb288ef41dfc6bd70fc8f6ec218dabc60b2a4 100644 +index 1704d04097c9d364e5f9049a6a0f60945db482dd..9935ca77536c8fa30881376e20cd3193f22879fb 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2201,6 +2201,83 @@ public final class Bukkit { +@@ -2205,6 +2205,83 @@ public final class Bukkit { public static boolean suggestPlayerNamesWhenNullTabCompletions() { return server.suggestPlayerNamesWhenNullTabCompletions(); } @@ -409,10 +409,10 @@ index 316fc8348445b99af7ffc7c4ad24948a1115dfe6..10eeb288ef41dfc6bd70fc8f6ec218da @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index d7b081ac72d7d2aa3b675c6cbb8fb66f73facc99..1487b5de4fba5304b7e2105c6f88872923aa7974 100644 +index dca2cbe8c93469c8c1c404bc34748a9dcf6d3368..136ae88a23ac02f79960d4ee99041486b41806f5 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1932,5 +1932,74 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1936,5 +1936,74 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi * @return true if player names should be suggested */ boolean suggestPlayerNamesWhenNullTabCompletions(); diff --git a/patches/api/0061-Shoulder-Entities-Release-API.patch b/patches/api/0061-Shoulder-Entities-Release-API.patch index 5dbabdff87..b5d73e2f3b 100644 --- a/patches/api/0061-Shoulder-Entities-Release-API.patch +++ b/patches/api/0061-Shoulder-Entities-Release-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Shoulder Entities Release API diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index 3845a726adbd0e75d7bf2aeeb6da8cb571d51a8f..abdca9fe5acc90f167219eb769ece66c35682bb1 100644 +index 411dbbd8046a3157747713fea9ae19eca113e9b7..7f12a18a77838266c0394da078a958c6bfb0e776 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java -@@ -339,6 +339,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder +@@ -336,6 +336,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder */ public int getExpToLevel(); diff --git a/patches/api/0065-Add-getI18NDisplayName-API.patch b/patches/api/0065-Add-getI18NDisplayName-API.patch index b21d6e25c4..8444f9e62d 100644 --- a/patches/api/0065-Add-getI18NDisplayName-API.patch +++ b/patches/api/0065-Add-getI18NDisplayName-API.patch @@ -8,10 +8,10 @@ Currently the server only supports the English language. To override this, You must replace the language file embedded in the server jar. diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java -index af4a7ce37eb10bab06eadb6583c7894b3ec55ae6..159e5a908b35b84b7fabc36581e093d9aa4c4b67 100644 +index d0530328536840ce126b39942fac35a476ea2ac4..193e36ca6ea3b6528e53ebd07bbd8775b12993af 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java -@@ -178,5 +178,19 @@ public interface ItemFactory { +@@ -177,5 +177,19 @@ public interface ItemFactory { */ @NotNull net.kyori.adventure.text.Component displayName(@NotNull ItemStack itemStack); @@ -32,10 +32,10 @@ index af4a7ce37eb10bab06eadb6583c7894b3ec55ae6..159e5a908b35b84b7fabc36581e093d9 // Paper end } diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index 9d327f0832c40d4a8d212346284274f6cf78834f..09a36df6edce2a283df80c67d5ef62da7ff73555 100644 +index 7e6c2bcf42d271184a75c91ecded5824535b3455..b8dfe0d1cebb944dfffc97ac74fdecda2f4884a2 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java -@@ -618,5 +618,20 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat +@@ -668,5 +668,20 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat public net.kyori.adventure.text.@NotNull Component displayName() { return Bukkit.getServer().getItemFactory().displayName(this); } diff --git a/patches/api/0066-ensureServerConversions-API.patch b/patches/api/0066-ensureServerConversions-API.patch index 2b0cf31e73..45f35f9991 100644 --- a/patches/api/0066-ensureServerConversions-API.patch +++ b/patches/api/0066-ensureServerConversions-API.patch @@ -7,10 +7,10 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr to ensure it meets latest minecraft expectations. diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java -index 159e5a908b35b84b7fabc36581e093d9aa4c4b67..349da0065ddf000cacdc259fab0f2c759332e9ad 100644 +index 193e36ca6ea3b6528e53ebd07bbd8775b12993af..c8e1377f804c50d41ad29c6c67dea58526d28125 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java -@@ -192,5 +192,17 @@ public interface ItemFactory { +@@ -191,5 +191,17 @@ public interface ItemFactory { @Nullable @Deprecated String getI18NDisplayName(@Nullable ItemStack item); @@ -29,10 +29,10 @@ index 159e5a908b35b84b7fabc36581e093d9aa4c4b67..349da0065ddf000cacdc259fab0f2c75 // Paper end } diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index 09a36df6edce2a283df80c67d5ef62da7ff73555..a8faa4c1881bae4d47d901388a78b991d138b518 100644 +index b8dfe0d1cebb944dfffc97ac74fdecda2f4884a2..923f160407a2d4be71ef42a387cb803712404c43 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java -@@ -537,7 +537,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat +@@ -587,7 +587,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat } } @@ -41,7 +41,7 @@ index 09a36df6edce2a283df80c67d5ef62da7ff73555..a8faa4c1881bae4d47d901388a78b991 } /** -@@ -619,6 +619,19 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat +@@ -669,6 +669,19 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat return Bukkit.getServer().getItemFactory().displayName(this); } diff --git a/patches/api/0074-API-to-get-a-BlockState-without-a-snapshot.patch b/patches/api/0074-API-to-get-a-BlockState-without-a-snapshot.patch index 323b157741..bce44118fe 100644 --- a/patches/api/0074-API-to-get-a-BlockState-without-a-snapshot.patch +++ b/patches/api/0074-API-to-get-a-BlockState-without-a-snapshot.patch @@ -9,10 +9,10 @@ on the real tile entity. This is useful for where performance is needed diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java -index 870ad6cd930653e6248abcc0fce94ffafbe9ebde..9f4d383ea3d6b26d16b8b77ca4c29d2d839ad6dd 100644 +index d834e8d8d532ce5b46201ff5c02d54a6c047f615..b33c1a227669d01950ceb4162a2910ae05a85a0e 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java -@@ -272,6 +272,16 @@ public interface Block extends Metadatable, Translatable { +@@ -271,6 +271,16 @@ public interface Block extends Metadatable, Translatable { @NotNull BlockState getState(); diff --git a/patches/api/0077-Display-warning-on-deprecated-recipe-API.patch b/patches/api/0077-Display-warning-on-deprecated-recipe-API.patch index bc3fa9520d..b018b269c1 100644 --- a/patches/api/0077-Display-warning-on-deprecated-recipe-API.patch +++ b/patches/api/0077-Display-warning-on-deprecated-recipe-API.patch @@ -10,24 +10,24 @@ on the players login. Plugin authors need to define a key to keep it consistent between server restarts. diff --git a/src/main/java/org/bukkit/inventory/ShapedRecipe.java b/src/main/java/org/bukkit/inventory/ShapedRecipe.java -index 4c7f30877c608e327908a61e4bd68789191e2f3c..be68263386a8faea7744f4de75d484e9358c87df 100644 +index e92de5ca8bd48723a493495db3ca2e2f5b55fab5..06b7f273ae66b2c936523c95fd4f802bd39ae324 100644 --- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java +++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java -@@ -38,6 +38,7 @@ public class ShapedRecipe implements Recipe, Keyed { +@@ -37,6 +37,7 @@ public class ShapedRecipe implements Recipe, Keyed { public ShapedRecipe(@NotNull ItemStack result) { - Preconditions.checkArgument(result.getType() != Material.AIR, "Recipe must have non-AIR result."); + Preconditions.checkArgument(result.getType() != ItemType.AIR, "Recipe must have non-AIR result."); this.key = NamespacedKey.randomKey(); + new Throwable("Warning: A plugin is creating a recipe using a Deprecated method. This will cause you to receive warnings stating 'Tried to load unrecognized recipe: bukkit:<ID>'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace(); this.output = new ItemStack(result); } diff --git a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java -index 74449a635aca84adcc1652e1e85f2d27dcaf6842..05ef88225415cd30de36f4517b6fb40d826ce996 100644 +index 69a25d05efcc96f8b3d3b5455e571259e5af2dab..ebc2c713d8a4ceec86b7dd270c5ca18c78103bcc 100644 --- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java +++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java -@@ -27,6 +27,7 @@ public class ShapelessRecipe implements Recipe, Keyed { +@@ -26,6 +26,7 @@ public class ShapelessRecipe implements Recipe, Keyed { public ShapelessRecipe(@NotNull ItemStack result) { - Preconditions.checkArgument(result.getType() != Material.AIR, "Recipe must have non-AIR result."); + Preconditions.checkArgument(result.getType() != ItemType.AIR, "Recipe must have non-AIR result."); this.key = NamespacedKey.randomKey(); + new Throwable("Warning: A plugin is creating a recipe using a Deprecated method. This will cause you to receive warnings stating 'Tried to load unrecognized recipe: bukkit:<ID>'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace(); this.output = new ItemStack(result); diff --git a/patches/api/0080-Ability-to-apply-mending-to-XP-API.patch b/patches/api/0080-Ability-to-apply-mending-to-XP-API.patch index f226c832e7..76ffe46c0c 100644 --- a/patches/api/0080-Ability-to-apply-mending-to-XP-API.patch +++ b/patches/api/0080-Ability-to-apply-mending-to-XP-API.patch @@ -10,10 +10,10 @@ of giving the player experience points. Both an API To standalone mend, and apply mending logic to .giveExp has been added. diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index bd6881d18d18d03f7e9b7821fa6cc433a79dc17e..b4efaec20a64e6f1955819b0d784d9f671d928e0 100644 +index 0700a76cdccab9a6dbbcbfd50aa6a5f192f15e75..2400d82ea71f22ddb6c671bf74c6480c35910598 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1242,6 +1242,15 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1230,6 +1230,15 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ public void resetPlayerWeather(); @@ -29,7 +29,7 @@ index bd6881d18d18d03f7e9b7821fa6cc433a79dc17e..b4efaec20a64e6f1955819b0d784d9f6 /** * Gets the player's cooldown between picking up experience orbs. * -@@ -1267,8 +1276,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1255,8 +1264,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * Gives the player the amount of experience specified. * * @param amount Exp amount to give diff --git a/patches/api/0083-Add-setPlayerProfile-API-for-Skulls.patch b/patches/api/0083-Add-setPlayerProfile-API-for-Skulls.patch index 62d576949f..96b1e25591 100644 --- a/patches/api/0083-Add-setPlayerProfile-API-for-Skulls.patch +++ b/patches/api/0083-Add-setPlayerProfile-API-for-Skulls.patch @@ -7,10 +7,10 @@ This allows you to create already filled textures on Skulls to avoid texture loo which commonly cause rate limit issues with Mojang API diff --git a/src/main/java/org/bukkit/block/Skull.java b/src/main/java/org/bukkit/block/Skull.java -index b39128bb0ca2d4fe7a254193236c60fb5bfaa7da..5135b8e6028e6926e2711e2dd6ce68b76f468fd7 100644 +index c7580fa8e62c6ee35abb0cec2586a39bbae4e8a7..0070b8e4a86f85ee31e071513808c36dbad04845 100644 --- a/src/main/java/org/bukkit/block/Skull.java +++ b/src/main/java/org/bukkit/block/Skull.java -@@ -63,6 +63,20 @@ public interface Skull extends TileState { +@@ -62,6 +62,20 @@ public interface Skull extends TileState { */ public void setOwningPlayer(@NotNull OfflinePlayer player); @@ -31,7 +31,7 @@ index b39128bb0ca2d4fe7a254193236c60fb5bfaa7da..5135b8e6028e6926e2711e2dd6ce68b7 /** * Gets the profile of the player who owns the skull. This player profile * may appear as the texture depending on skull type. -@@ -70,6 +84,7 @@ public interface Skull extends TileState { +@@ -69,6 +83,7 @@ public interface Skull extends TileState { * @return the profile of the owning player */ @Nullable @@ -39,7 +39,7 @@ index b39128bb0ca2d4fe7a254193236c60fb5bfaa7da..5135b8e6028e6926e2711e2dd6ce68b7 PlayerProfile getOwnerProfile(); /** -@@ -84,6 +99,7 @@ public interface Skull extends TileState { +@@ -83,6 +98,7 @@ public interface Skull extends TileState { * @throws IllegalArgumentException if the profile does not contain the * necessary information */ diff --git a/patches/api/0091-Player.setPlayerProfile-API.patch b/patches/api/0091-Player.setPlayerProfile-API.patch index ea78af9a06..dba5f9ac38 100644 --- a/patches/api/0091-Player.setPlayerProfile-API.patch +++ b/patches/api/0091-Player.setPlayerProfile-API.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Player.setPlayerProfile API This can be useful for changing name or skins after a player has logged in. diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 10eeb288ef41dfc6bd70fc8f6ec218dabc60b2a4..ace8904541fb4571cb03f14e6e3baa02ae460d1e 100644 +index 9935ca77536c8fa30881376e20cd3193f22879fb..c1cf9328f32d6b4ecbba667a8dda3a60b37aca82 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1229,8 +1229,10 @@ public final class Bukkit { +@@ -1230,8 +1230,10 @@ public final class Bukkit { * @return the new PlayerProfile * @throws IllegalArgumentException if both the unique id is * <code>null</code> and the name is <code>null</code> or blank @@ -20,7 +20,7 @@ index 10eeb288ef41dfc6bd70fc8f6ec218dabc60b2a4..ace8904541fb4571cb03f14e6e3baa02 public static PlayerProfile createPlayerProfile(@Nullable UUID uniqueId, @Nullable String name) { return server.createPlayerProfile(uniqueId, name); } -@@ -1241,8 +1243,10 @@ public final class Bukkit { +@@ -1242,8 +1244,10 @@ public final class Bukkit { * @param uniqueId the unique id * @return the new PlayerProfile * @throws IllegalArgumentException if the unique id is <code>null</code> @@ -31,7 +31,7 @@ index 10eeb288ef41dfc6bd70fc8f6ec218dabc60b2a4..ace8904541fb4571cb03f14e6e3baa02 public static PlayerProfile createPlayerProfile(@NotNull UUID uniqueId) { return server.createPlayerProfile(uniqueId); } -@@ -1254,8 +1258,10 @@ public final class Bukkit { +@@ -1255,8 +1259,10 @@ public final class Bukkit { * @return the new PlayerProfile * @throws IllegalArgumentException if the name is <code>null</code> or * blank @@ -43,10 +43,10 @@ index 10eeb288ef41dfc6bd70fc8f6ec218dabc60b2a4..ace8904541fb4571cb03f14e6e3baa02 return server.createPlayerProfile(name); } diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java -index 5acb0d36a008cf5ad332c867e9303d35235b4028..b1ded556a1ce4e1d3c873ab9d7f799b6edcc5118 100644 +index 6aa01b6f25e88ea7908edd1db836e62adb1b8da6..ab0c6c479d41e00e31d850d5e35d78484423d5c9 100644 --- a/src/main/java/org/bukkit/OfflinePlayer.java +++ b/src/main/java/org/bukkit/OfflinePlayer.java -@@ -55,7 +55,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio +@@ -57,7 +57,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * @return the player's profile */ @NotNull @@ -56,10 +56,10 @@ index 5acb0d36a008cf5ad332c867e9303d35235b4028..b1ded556a1ce4e1d3c873ab9d7f799b6 /** * Checks if this player is banned or not diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 1487b5de4fba5304b7e2105c6f88872923aa7974..e4f8031ab979ba7e3fd7242b788e41974f490565 100644 +index 136ae88a23ac02f79960d4ee99041486b41806f5..572a5aa724f58dc9795bf83b4151412e26f2a14d 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1049,8 +1049,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1050,8 +1050,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi * @return the new PlayerProfile * @throws IllegalArgumentException if both the unique id is * <code>null</code> and the name is <code>null</code> or blank @@ -70,7 +70,7 @@ index 1487b5de4fba5304b7e2105c6f88872923aa7974..e4f8031ab979ba7e3fd7242b788e4197 PlayerProfile createPlayerProfile(@Nullable UUID uniqueId, @Nullable String name); /** -@@ -1059,8 +1061,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1060,8 +1062,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi * @param uniqueId the unique id * @return the new PlayerProfile * @throws IllegalArgumentException if the unique id is <code>null</code> @@ -81,7 +81,7 @@ index 1487b5de4fba5304b7e2105c6f88872923aa7974..e4f8031ab979ba7e3fd7242b788e4197 PlayerProfile createPlayerProfile(@NotNull UUID uniqueId); /** -@@ -1070,8 +1074,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1071,8 +1075,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi * @return the new PlayerProfile * @throws IllegalArgumentException if the name is <code>null</code> or * blank @@ -93,10 +93,10 @@ index 1487b5de4fba5304b7e2105c6f88872923aa7974..e4f8031ab979ba7e3fd7242b788e4197 /** diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index b4efaec20a64e6f1955819b0d784d9f671d928e0..7b2d8fd3cb0d44a531bd5d618154059d2a934d48 100644 +index 2400d82ea71f22ddb6c671bf74c6480c35910598..3c2b4ecce2c4ae3ab5a394857988d24776b9ca90 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -2531,6 +2531,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -2519,6 +2519,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * was {@link org.bukkit.event.player.PlayerResourcePackStatusEvent.Status#SUCCESSFULLY_LOADED} */ boolean hasResourcePack(); diff --git a/patches/api/0092-getPlayerUniqueId-API.patch b/patches/api/0092-getPlayerUniqueId-API.patch index ad0e12f4d8..1007aeecb3 100644 --- a/patches/api/0092-getPlayerUniqueId-API.patch +++ b/patches/api/0092-getPlayerUniqueId-API.patch @@ -9,10 +9,10 @@ In Offline Mode, will return an Offline UUID This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index ace8904541fb4571cb03f14e6e3baa02ae460d1e..36c5294e6169c3aa4517cd2c945b5dfb7a2a0c51 100644 +index c1cf9328f32d6b4ecbba667a8dda3a60b37aca82..48f3a48268f714eeba3cfcd8e665265fc144f39e 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -687,6 +687,20 @@ public final class Bukkit { +@@ -688,6 +688,20 @@ public final class Bukkit { return server.getPlayer(id); } @@ -34,10 +34,10 @@ index ace8904541fb4571cb03f14e6e3baa02ae460d1e..36c5294e6169c3aa4517cd2c945b5dfb * Gets the plugin manager for interfacing with plugins. * diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index e4f8031ab979ba7e3fd7242b788e41974f490565..2ac191185e4dabb2f39b05a56548b0d97daa2979 100644 +index 572a5aa724f58dc9795bf83b4151412e26f2a14d..cb3415c9b103f60ce0d7942fb1ad4c8cd39d02d4 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -591,6 +591,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -592,6 +592,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @Nullable public Player getPlayer(@NotNull UUID id); diff --git a/patches/api/0094-Add-openSign-method-to-HumanEntity.patch b/patches/api/0094-Add-openSign-method-to-HumanEntity.patch index c7123e4667..792dca6d91 100644 --- a/patches/api/0094-Add-openSign-method-to-HumanEntity.patch +++ b/patches/api/0094-Add-openSign-method-to-HumanEntity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add openSign method to HumanEntity diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index abdca9fe5acc90f167219eb769ece66c35682bb1..b3aa3dc6aa5afbc36cc86741b4cba56f463c2234 100644 +index 7f12a18a77838266c0394da078a958c6bfb0e776..553cd804126a556f7fdf9f4bcb8640eb33e829d6 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java -@@ -500,6 +500,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder +@@ -497,6 +497,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder */ @Deprecated public void setShoulderEntityRight(@Nullable Entity entity); @@ -36,10 +36,10 @@ index abdca9fe5acc90f167219eb769ece66c35682bb1..b3aa3dc6aa5afbc36cc86741b4cba56f /** * Make the entity drop the item in their hand. diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 7b2d8fd3cb0d44a531bd5d618154059d2a934d48..cf7e79eaf1be19f1253761d8e9785b337420f625 100644 +index 3c2b4ecce2c4ae3ab5a394857988d24776b9ca90..a2aa3c1e98a4909d3abfa9704da8c3b77918e05a 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -2376,10 +2376,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -2364,10 +2364,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM /** * Open a Sign for editing by the Player. * diff --git a/patches/api/0095-Add-Ban-Methods-to-Player-Objects.patch b/patches/api/0095-Add-Ban-Methods-to-Player-Objects.patch index f81af92e14..0d9554d5ec 100644 --- a/patches/api/0095-Add-Ban-Methods-to-Player-Objects.patch +++ b/patches/api/0095-Add-Ban-Methods-to-Player-Objects.patch @@ -8,10 +8,10 @@ Allows a more logical API for banning players. player.banPlayer("Breaking the rules"); diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java -index b1ded556a1ce4e1d3c873ab9d7f799b6edcc5118..6ab8f05be11f8101202d56bfebc7ec23f868dddd 100644 +index ab0c6c479d41e00e31d850d5e35d78484423d5c9..af2973b1f6d4ac73b2ddee33c6a0869b5ec06b54 100644 --- a/src/main/java/org/bukkit/OfflinePlayer.java +++ b/src/main/java/org/bukkit/OfflinePlayer.java -@@ -63,6 +63,61 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio +@@ -65,6 +65,61 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * @return true if banned, otherwise false */ public boolean isBanned(); @@ -74,10 +74,10 @@ index b1ded556a1ce4e1d3c873ab9d7f799b6edcc5118..6ab8f05be11f8101202d56bfebc7ec23 /** * Checks if this player is whitelisted or not diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index cf7e79eaf1be19f1253761d8e9785b337420f625..45633a83af30ed7a18f26911a13bc065a3a027b6 100644 +index a2aa3c1e98a4909d3abfa9704da8c3b77918e05a..de5ac3b6f9cf001e3c3500f23930a6f9876210de 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -916,6 +916,162 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -904,6 +904,162 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM public void sendMap(@NotNull MapView map); // Paper start diff --git a/patches/api/0100-Expand-World.spawnParticle-API-and-add-Builder.patch b/patches/api/0100-Expand-World.spawnParticle-API-and-add-Builder.patch index e4b3fc128b..3a9facca12 100644 --- a/patches/api/0100-Expand-World.spawnParticle-API-and-add-Builder.patch +++ b/patches/api/0100-Expand-World.spawnParticle-API-and-add-Builder.patch @@ -10,7 +10,7 @@ This adds a new Builder API which is much friendlier to use. diff --git a/src/main/java/com/destroystokyo/paper/ParticleBuilder.java b/src/main/java/com/destroystokyo/paper/ParticleBuilder.java new file mode 100644 -index 0000000000000000000000000000000000000000..f45b8cfd1611345e8d81ecb8297a586f05eb5dc6 +index 0000000000000000000000000000000000000000..f710167633a8ef1abc4aac2a1912514a959d414c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/ParticleBuilder.java @@ -0,0 +1,485 @@ @@ -470,20 +470,20 @@ index 0000000000000000000000000000000000000000..f45b8cfd1611345e8d81ecb8297a586f + */ + @NotNull + public ParticleBuilder color(@Nullable Color color, float size) { -+ if (particle != Particle.REDSTONE && color != null) { ++ if (this.particle != Particle.DUST && color != null) { + throw new IllegalStateException("Color may only be set on REDSTONE"); + } + + // We don't officially support reusing these objects, but here we go + if (color == null) { -+ if (data instanceof Particle.DustOptions) { ++ if (this.data instanceof Particle.DustOptions) { + return data(null); + } else { + return this; + } + } + -+ return data(new Particle.DustOptions(color, size)); ++ return this.data(new Particle.DustOptions(color, size)); + } + + /** @@ -500,12 +500,12 @@ index 0000000000000000000000000000000000000000..f45b8cfd1611345e8d81ecb8297a586f + } +} diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java -index 73b782c3975ad13159b6236976783fcfabd20493..819506712e9874c0142fc9e7d959bd7be97fc649 100644 +index 0f97cf9fd3aebbcda1531f2cfbb9e2e17ba14acf..31c2706e0f038c180821e7c4e543f1177789ce3d 100644 --- a/src/main/java/org/bukkit/Particle.java +++ b/src/main/java/org/bukkit/Particle.java -@@ -162,6 +162,17 @@ public enum Particle { - return dataType; - } +@@ -140,6 +140,17 @@ public abstract class Particle<D> extends OldEnum<Particle<D>> implements Keyed + @NotNull + public abstract Class<D> getDataType(); + // Paper start - Particle API expansion + /** @@ -522,15 +522,19 @@ index 73b782c3975ad13159b6236976783fcfabd20493..819506712e9874c0142fc9e7d959bd7b * Options which can be applied to redstone dust particles - a particle * color and size. diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 0f76496471c50d5f18cedc735e667265e6c27422..0ed7a7db90856ff50ed1354f9914c0cc321d2d09 100644 +index 48e3e92820f59753df30e5d61f57fb71e2894aa6..61f5fd47381d21b268f58af2106fc8be5e2f1c73 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -2776,7 +2776,57 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient +@@ -2756,7 +2756,62 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} */ -- public <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data); -+ public default <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data) { spawnParticle(particle, null, null, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, true); }// Paper start - Expand Particle API +- public <T> void spawnParticle(@NotNull Particle<T> particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data); ++ // Paper start - Expand Particle API ++ default <T> void spawnParticle(@NotNull Particle<T> particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data) { ++ this.spawnParticle(particle, null, null, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, true); ++ } ++ + /** + * Spawns the particle (the number of times specified by count) + * at the target location. The position of each particle will be @@ -553,7 +557,9 @@ index 0f76496471c50d5f18cedc735e667265e6c27422..0ed7a7db90856ff50ed1354f9914c0cc + * the type of this depends on {@link Particle#getDataType()} + * @param <T> Type + */ -+ public default <T> void spawnParticle(@NotNull Particle particle, @Nullable List<Player> receivers, @NotNull Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data) { spawnParticle(particle, receivers, source, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, true); } ++ default <T> void spawnParticle(@NotNull Particle<T> particle, @Nullable List<Player> receivers, @NotNull Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data) { ++ this.spawnParticle(particle, receivers, source, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, true); ++ } + /** + * Spawns the particle (the number of times specified by count) + * at the target location. The position of each particle will be @@ -578,9 +584,8 @@ index 0f76496471c50d5f18cedc735e667265e6c27422..0ed7a7db90856ff50ed1354f9914c0cc + * @param force allows the particle to be seen further away from the player + * and shows to players using any vanilla client particle settings + */ -+ public <T> void spawnParticle(@NotNull Particle particle, @Nullable List<Player> receivers, @Nullable Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force); ++ <T> void spawnParticle(@NotNull Particle<T> particle, @Nullable List<Player> receivers, @Nullable Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force); + // Paper end -+ /** * Spawns the particle (the number of times specified by count) diff --git a/patches/api/0107-ItemStack-getMaxItemUseDuration.patch b/patches/api/0107-ItemStack-getMaxItemUseDuration.patch index 18991e040f..13a9f61e0b 100644 --- a/patches/api/0107-ItemStack-getMaxItemUseDuration.patch +++ b/patches/api/0107-ItemStack-getMaxItemUseDuration.patch @@ -6,20 +6,20 @@ Subject: [PATCH] ItemStack#getMaxItemUseDuration Allows you to determine how long it takes to use a usable/consumable item diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index a8faa4c1881bae4d47d901388a78b991d138b518..b85eb71ff5d198d6270cbe07da0de3ed27fa72d5 100644 +index 923f160407a2d4be71ef42a387cb803712404c43..250e39c76dbedbd1d0d118eecf1253738e369c35 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java -@@ -646,5 +646,13 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat +@@ -696,5 +696,13 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat public String getI18NDisplayName() { return Bukkit.getServer().getItemFactory().getI18NDisplayName(this); } + + public int getMaxItemUseDuration() { -+ if (type == null || type == Material.AIR || !type.isItem()) { ++ if (this.type == null || this.type == ItemType.AIR) { + return 0; + } + // Requires access to NMS -+ return ensureServerConversions().getMaxItemUseDuration(); ++ return this.ensureServerConversions().getMaxItemUseDuration(); + } // Paper end } diff --git a/patches/api/0115-ItemStack-API-additions-for-quantity-flags-lore.patch b/patches/api/0115-ItemStack-API-additions-for-quantity-flags-lore.patch index 0e4f6385f6..1c31043b77 100644 --- a/patches/api/0115-ItemStack-API-additions-for-quantity-flags-lore.patch +++ b/patches/api/0115-ItemStack-API-additions-for-quantity-flags-lore.patch @@ -5,7 +5,7 @@ Subject: [PATCH] ItemStack API additions for quantity/flags/lore diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index b85eb71ff5d198d6270cbe07da0de3ed27fa72d5..83a0631a80db156ace1d977df71d5fc653b70bb6 100644 +index 250e39c76dbedbd1d0d118eecf1253738e369c35..8187b1b801c7a6fd71696bfe21de177705b0e3a2 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -3,6 +3,7 @@ package org.bukkit.inventory; @@ -16,9 +16,9 @@ index b85eb71ff5d198d6270cbe07da0de3ed27fa72d5..83a0631a80db156ace1d977df71d5fc6 import java.util.Map; import org.bukkit.Bukkit; import org.bukkit.Material; -@@ -654,5 +655,185 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat +@@ -704,5 +705,185 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat // Requires access to NMS - return ensureServerConversions().getMaxItemUseDuration(); + return this.ensureServerConversions().getMaxItemUseDuration(); } + + /** diff --git a/patches/api/0116-LivingEntity-Hand-Raised-Item-Use-API.patch b/patches/api/0116-LivingEntity-Hand-Raised-Item-Use-API.patch index 5e689dc105..d3108e52b5 100644 --- a/patches/api/0116-LivingEntity-Hand-Raised-Item-Use-API.patch +++ b/patches/api/0116-LivingEntity-Hand-Raised-Item-Use-API.patch @@ -6,10 +6,10 @@ Subject: [PATCH] LivingEntity Hand Raised/Item Use API How long an entity has raised hands to charge an attack or use an item diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index b3aa3dc6aa5afbc36cc86741b4cba56f463c2234..9e012c3c0671e5d0e55c243fdb4e14057038c153 100644 +index 553cd804126a556f7fdf9f4bcb8640eb33e829d6..7c27f459cf84e87bb294d1a1c8081bc8eba9d852 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java -@@ -328,7 +328,9 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder +@@ -325,7 +325,9 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder * * @return the item being used by the player, or null if they are not using * an item @@ -20,7 +20,7 @@ index b3aa3dc6aa5afbc36cc86741b4cba56f463c2234..9e012c3c0671e5d0e55c243fdb4e1405 public ItemStack getItemInUse(); diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index 2bfeebe26f32d2e931dc483714d30430deeb9b04..17e5d2e2acdae23d8ea3b3b1a89f62e8be7b81a8 100644 +index a48be2a0401a57b6165a849cf29f37a63b54f630..4cb92615ccd45617a282df59574f9c4fc45f119b 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -745,5 +745,42 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource diff --git a/patches/api/0130-AnvilDamageEvent.patch b/patches/api/0130-AnvilDamageEvent.patch index 7561b6a9db..cba565dc42 100644 --- a/patches/api/0130-AnvilDamageEvent.patch +++ b/patches/api/0130-AnvilDamageEvent.patch @@ -6,13 +6,15 @@ Subject: [PATCH] AnvilDamageEvent diff --git a/src/main/java/com/destroystokyo/paper/event/block/AnvilDamagedEvent.java b/src/main/java/com/destroystokyo/paper/event/block/AnvilDamagedEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..a83c286c1c11af25fc4d16af7a42b95ce90b9dee +index 0000000000000000000000000000000000000000..4b90dc67f75b05cb8a766025781b9eaa2fef2606 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/block/AnvilDamagedEvent.java -@@ -0,0 +1,148 @@ +@@ -0,0 +1,171 @@ +package com.destroystokyo.paper.event.block; + ++import org.bukkit.Bukkit; +import org.bukkit.Material; ++import org.bukkit.block.BlockType; +import org.bukkit.block.data.BlockData; +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; @@ -104,15 +106,15 @@ index 0000000000000000000000000000000000000000..a83c286c1c11af25fc4d16af7a42b95c + * Represents the amount of damage on an anvil block + */ + public enum DamageState { -+ FULL(Material.ANVIL), -+ CHIPPED(Material.CHIPPED_ANVIL), -+ DAMAGED(Material.DAMAGED_ANVIL), -+ BROKEN(Material.AIR); ++ FULL(BlockType.ANVIL), ++ CHIPPED(BlockType.CHIPPED_ANVIL), ++ DAMAGED(BlockType.DAMAGED_ANVIL), ++ BROKEN(BlockType.AIR); + -+ private Material material; ++ private BlockType<?> blockType; + -+ DamageState(@NotNull Material material) { -+ this.material = material; ++ DamageState(@NotNull BlockType<?> blockType) { ++ this.blockType = blockType; + } + + /** @@ -120,9 +122,18 @@ index 0000000000000000000000000000000000000000..a83c286c1c11af25fc4d16af7a42b95c + * + * @return Material + */ -+ @NotNull -+ public Material getMaterial() { -+ return material; ++ @Deprecated ++ public @NotNull Material getMaterial() { ++ return Bukkit.getUnsafe().toMaterial(this.blockType); ++ } ++ ++ /** ++ * Get the block type for this damage state. ++ * ++ * @return the block type ++ */ ++ public @NotNull BlockType<?> getBlockType() { ++ return this.blockType; + } + + /** @@ -134,7 +145,7 @@ index 0000000000000000000000000000000000000000..a83c286c1c11af25fc4d16af7a42b95c + */ + @NotNull + public static DamageState getState(@Nullable BlockData blockData) { -+ return blockData == null ? BROKEN : getState(blockData.getMaterial()); ++ return blockData == null ? BROKEN : getState(blockData.getBlockType()); + } + + /** @@ -143,14 +154,26 @@ index 0000000000000000000000000000000000000000..a83c286c1c11af25fc4d16af7a42b95c + * @param material Block material + * @return DamageState + * @throws IllegalArgumentException If non anvil material is given ++ * @deprecated use {@link #getState(BlockType)} + */ -+ @NotNull -+ public static DamageState getState(@Nullable Material material) { -+ if (material == null) { ++ @Deprecated ++ public static @NotNull DamageState getState(@Nullable Material material) { ++ return material == null ? BROKEN : getState(material.asBlockType()); ++ } ++ ++ /** ++ * Get damaged state by block type ++ * ++ * @param blockType Block type ++ * @return DamageState ++ * @throws IllegalArgumentException If non anvil block type is given ++ */ ++ public static @NotNull DamageState getState(@Nullable BlockType<?> blockType) { ++ if (blockType == null) { + return BROKEN; + } + for (DamageState state : values()) { -+ if (state.material == material) { ++ if (state.blockType == blockType) { + return state; + } + } diff --git a/patches/api/0131-Add-TNTPrimeEvent.patch b/patches/api/0131-Add-TNTPrimeEvent.patch index 9282ea8794..ee155a113f 100644 --- a/patches/api/0131-Add-TNTPrimeEvent.patch +++ b/patches/api/0131-Add-TNTPrimeEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add TNTPrimeEvent diff --git a/src/main/java/com/destroystokyo/paper/event/block/TNTPrimeEvent.java b/src/main/java/com/destroystokyo/paper/event/block/TNTPrimeEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..9d7221583454dc922b20af6c233897c0b2ec47da +index 0000000000000000000000000000000000000000..ac1d40a697fe98cc9151b53f5d63e283d44fbbf9 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/block/TNTPrimeEvent.java @@ -0,0 +1,116 @@ @@ -116,7 +116,7 @@ index 0000000000000000000000000000000000000000..9d7221583454dc922b20af6c233897c0 + + /** + * When TNT prime was caused by an {@link Entity} shooting TNT -+ * using a bow with {@link org.bukkit.enchantments.Enchantment#ARROW_FIRE} enchantment ++ * using a bow with {@link org.bukkit.enchantments.Enchantment#FLAME} enchantment + */ + PROJECTILE, + diff --git a/patches/api/0134-Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch b/patches/api/0134-Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch index 83897ac115..4f3fe55a4c 100644 --- a/patches/api/0134-Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch +++ b/patches/api/0134-Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't use snapshots for Timings Tile Entity reports diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java -index eb9d58f8852e732a1284beeaf542989301d21b1c..02e88db63be2d5e31da6b65157ba7b971b1f10f3 100644 +index b9544c6f2adb0a8b32abd8ab3f1bdc5e00ee7679..0632618965df58effe4f62e0fdb3d558c99ab698 100644 --- a/src/main/java/co/aikar/timings/TimingHistory.java +++ b/src/main/java/co/aikar/timings/TimingHistory.java -@@ -120,7 +120,7 @@ public class TimingHistory { +@@ -121,7 +121,7 @@ public class TimingHistory { data.entityCounts.get(entity.getType()).increment(); } diff --git a/patches/api/0135-Allow-Blocks-to-be-accessed-via-a-long-key.patch b/patches/api/0135-Allow-Blocks-to-be-accessed-via-a-long-key.patch index 7a00e59951..a505289806 100644 --- a/patches/api/0135-Allow-Blocks-to-be-accessed-via-a-long-key.patch +++ b/patches/api/0135-Allow-Blocks-to-be-accessed-via-a-long-key.patch @@ -50,7 +50,7 @@ index 943c3364f6b931fe11f9a6099504590b2da34657..16a604b6315daff228c827fe02b1234c * @return A new location where X/Y/Z are the center of the block */ diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 159307600747c49948c5242d6cf39eed08c902e7..e83de41cbaf0e5a68ce0d5ad2b5ec10877ec4055 100644 +index 273d111ccacc31daf7c2f5ea33728d9f04ba06e7..df543e106f22d1e151cd2e056f5741cc83a607cf 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -96,6 +96,41 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient @@ -96,10 +96,10 @@ index 159307600747c49948c5242d6cf39eed08c902e7..e83de41cbaf0e5a68ce0d5ad2b5ec108 * Gets the highest non-empty (impassable) block at the given coordinates. * diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java -index 9f4d383ea3d6b26d16b8b77ca4c29d2d839ad6dd..78f6cc1a8a8de05aec6f551f8a5f425944f0ffa3 100644 +index b33c1a227669d01950ceb4162a2910ae05a85a0e..cad80c8aeb55fe9846189c62ff9cfdb5525c7236 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java -@@ -156,6 +156,82 @@ public interface Block extends Metadatable, Translatable { +@@ -155,6 +155,82 @@ public interface Block extends Metadatable, Translatable { */ int getZ(); diff --git a/patches/api/0139-Inventory-removeItemAnySlot.patch b/patches/api/0139-Inventory-removeItemAnySlot.patch index 25b79cf6bd..daa63e1b77 100644 --- a/patches/api/0139-Inventory-removeItemAnySlot.patch +++ b/patches/api/0139-Inventory-removeItemAnySlot.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Inventory#removeItemAnySlot diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java -index 5576a6a8df8c95164bf2dde45d756ce8b7ec957a..f1a48eab1a357ae64545e1f1dc941c383cff8707 100644 +index b0098a34cb07958ae815ed6b6957eb8be76e7a85..889615d40eb90ba62d44d7310fad16bdfb13da36 100644 --- a/src/main/java/org/bukkit/inventory/Inventory.java +++ b/src/main/java/org/bukkit/inventory/Inventory.java -@@ -104,7 +104,9 @@ public interface Inventory extends Iterable<ItemStack> { +@@ -103,7 +103,9 @@ public interface Inventory extends Iterable<ItemStack> { public HashMap<Integer, ItemStack> addItem(@NotNull ItemStack... items) throws IllegalArgumentException; /** @@ -19,7 +19,7 @@ index 5576a6a8df8c95164bf2dde45d756ce8b7ec957a..f1a48eab1a357ae64545e1f1dc941c38 * <p> * It will try to remove 'as much as possible' from the types and amounts * you give as arguments. -@@ -121,10 +123,39 @@ public interface Inventory extends Iterable<ItemStack> { +@@ -120,10 +122,39 @@ public interface Inventory extends Iterable<ItemStack> { * @param items The ItemStacks to remove * @return A HashMap containing items that couldn't be removed. * @throws IllegalArgumentException if items is null diff --git a/patches/api/0141-Add-source-block-constructor-and-getChangedBlockData.patch b/patches/api/0141-Add-source-block-constructor-and-getChangedBlockData.patch index 9f9e760855..883e770b23 100644 --- a/patches/api/0141-Add-source-block-constructor-and-getChangedBlockData.patch +++ b/patches/api/0141-Add-source-block-constructor-and-getChangedBlockData.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add source block constructor and getChangedBlockData() to diff --git a/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java b/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java -index e3a5f5824ed882058f5bac5003f66ce79733a868..1d496e5a3d1541bf0a257a4358b3943fd6415204 100644 +index 55cdfd35a91f82b2c5bf51fff3671e45b49b7d0c..0ae137a46fc505d99c827b099d36c35d9fa891b0 100644 --- a/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java @@ -32,6 +32,13 @@ public class BlockPhysicsEvent extends BlockEvent implements Cancellable { @@ -34,7 +34,7 @@ index e3a5f5824ed882058f5bac5003f66ce79733a868..1d496e5a3d1541bf0a257a4358b3943f * @return Changed block's type */ @@ -64,6 +72,19 @@ public class BlockPhysicsEvent extends BlockEvent implements Cancellable { - return changed.getMaterial(); + return changed.getBlockType(); } + // Paper start - Getter for the BlockData diff --git a/patches/api/0143-Add-ray-tracing-methods-to-LivingEntity.patch b/patches/api/0143-Add-ray-tracing-methods-to-LivingEntity.patch index b2299ab712..0d496e439b 100644 --- a/patches/api/0143-Add-ray-tracing-methods-to-LivingEntity.patch +++ b/patches/api/0143-Add-ray-tracing-methods-to-LivingEntity.patch @@ -78,12 +78,12 @@ index 0000000000000000000000000000000000000000..c896d172519a8552a132031cb956378d + } +} diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index 17e5d2e2acdae23d8ea3b3b1a89f62e8be7b81a8..8cccec99cdb028e86b71b3984f4f94201fd9a390 100644 +index 4cb92615ccd45617a282df59574f9c4fc45f119b..a4e5225e433e83d56ff96055106593a352639034 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -83,6 +83,98 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource @NotNull - public Block getTargetBlock(@Nullable Set<Material> transparent, int maxDistance); + public Block getTargetBlock(@Nullable Set<BlockType<?>> transparent, int maxDistance); + // Paper start + /** diff --git a/patches/api/0144-Expose-attack-cooldown-methods-for-Player.patch b/patches/api/0144-Expose-attack-cooldown-methods-for-Player.patch index fdf4715617..2321285601 100644 --- a/patches/api/0144-Expose-attack-cooldown-methods-for-Player.patch +++ b/patches/api/0144-Expose-attack-cooldown-methods-for-Player.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose attack cooldown methods for Player diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 45633a83af30ed7a18f26911a13bc065a3a027b6..b21834a0ec507d223cdb178b4500981c9e8dc248 100644 +index de5ac3b6f9cf001e3c3500f23930a6f9876210de..9649e65d2b0af4f72d648eb33c0de124ba4b5e34 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -2703,6 +2703,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -2691,6 +2691,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @param profile The new profile to use */ void setPlayerProfile(@NotNull com.destroystokyo.paper.profile.PlayerProfile profile); diff --git a/patches/api/0146-Add-Git-information-to-version-command-on-startup.patch b/patches/api/0146-Add-Git-information-to-version-command-on-startup.patch index da996bbc7b..1704dba031 100644 --- a/patches/api/0146-Add-Git-information-to-version-command-on-startup.patch +++ b/patches/api/0146-Add-Git-information-to-version-command-on-startup.patch @@ -48,10 +48,10 @@ index 0000000000000000000000000000000000000000..909617079db61b675cc7b60b44ef96b3 + } +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 36c5294e6169c3aa4517cd2c945b5dfb7a2a0c51..36a127864be2a75a38bcc6eacafde5109e5c6c69 100644 +index 48f3a48268f714eeba3cfcd8e665265fc144f39e..5a7e8b3d073c2ea44909477c38bc2ab454c6a502 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -55,6 +55,7 @@ import org.bukkit.util.CachedServerIcon; +@@ -56,6 +56,7 @@ import org.bukkit.util.CachedServerIcon; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -59,7 +59,7 @@ index 36c5294e6169c3aa4517cd2c945b5dfb7a2a0c51..36a127864be2a75a38bcc6eacafde510 /** * Represents the Bukkit core, for version and Server singleton handling -@@ -104,7 +105,25 @@ public final class Bukkit { +@@ -105,7 +106,25 @@ public final class Bukkit { } Bukkit.server = server; diff --git a/patches/api/0152-Material-API-additions.patch b/patches/api/0152-Material-API-additions.patch index 6b7874324c..e4145bdb32 100644 --- a/patches/api/0152-Material-API-additions.patch +++ b/patches/api/0152-Material-API-additions.patch @@ -5,26 +5,19 @@ Subject: [PATCH] Material API additions diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java -index f52c0e25e75e890046339d605c0abf79d82864f2..64d01ce77966e895ec494719a4398577be1097a1 100644 +index 9941023b98f3822c7b12697ae7326708abf19ead..09669d5757f4fa58835e339deb8d38afa5662997 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java -@@ -118,6 +118,7 @@ import org.jetbrains.annotations.Nullable; - /** - * An enum of all material IDs accepted by the official server and client - */ -+@SuppressWarnings({"DeprecatedIsStillUsed", "deprecation"}) // Paper - public enum Material implements Keyed, Translatable { - //<editor-fold desc="Materials" defaultstate="collapsed"> - AIR(9648, 0), -@@ -4435,6 +4436,22 @@ public enum Material implements Keyed, Translatable { +@@ -4439,6 +4439,23 @@ public enum Material implements Keyed, Translatable { } } + // Paper start -+ + /** + * @return If the type is either AIR, CAVE_AIR or VOID_AIR ++ * @deprecated Check if the {@link ItemType} is {@link ItemType#AIR} or {@link BlockType#isAir()} + */ ++ @Deprecated + public boolean isEmpty() { + switch (this) { + case AIR: diff --git a/patches/api/0153-Add-Material-Tags.patch b/patches/api/0153-Add-Material-Tags.patch index 79e0091f3c..cc7d752f2c 100644 --- a/patches/api/0153-Add-Material-Tags.patch +++ b/patches/api/0153-Add-Material-Tags.patch @@ -11,10 +11,10 @@ Co-authored by: Lena Kolb <[email protected]> diff --git a/src/main/java/com/destroystokyo/paper/MaterialSetTag.java b/src/main/java/com/destroystokyo/paper/MaterialSetTag.java new file mode 100644 -index 0000000000000000000000000000000000000000..a02a02aa0c87e0f0ed9e509e4dcab01565b3d92a +index 0000000000000000000000000000000000000000..64dd5e6674f83075be0f0868f66f114ff71dbe24 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/MaterialSetTag.java -@@ -0,0 +1,97 @@ +@@ -0,0 +1,119 @@ +/* + * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License + */ @@ -23,10 +23,13 @@ index 0000000000000000000000000000000000000000..a02a02aa0c87e0f0ed9e509e4dcab015 + +import com.google.common.collect.Lists; +import io.papermc.paper.tag.BaseTag; ++import org.bukkit.Bukkit; +import org.bukkit.Material; +import org.bukkit.NamespacedKey; ++import org.bukkit.Tag; +import org.bukkit.block.Block; +import org.bukkit.block.BlockState; ++import org.bukkit.block.BlockType; +import org.bukkit.block.data.BlockData; +import org.bukkit.inventory.ItemStack; + @@ -35,9 +38,11 @@ index 0000000000000000000000000000000000000000..a02a02aa0c87e0f0ed9e509e4dcab015 +import java.util.function.Predicate; +import java.util.stream.Collectors; +import java.util.stream.Stream; ++import org.bukkit.inventory.ItemType; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + ++@Deprecated +public class MaterialSetTag extends BaseTag<Material, MaterialSetTag> { + + /** @@ -92,8 +97,17 @@ index 0000000000000000000000000000000000000000..a02a02aa0c87e0f0ed9e509e4dcab015 + return value.name(); + } + ++ public MaterialSetTag addTags(@NotNull Tag<BlockType>...tags) { ++ for (Tag<BlockType> tag : tags) { ++ for (final BlockType<?> value : tag.getValues()) { ++ this.add(Bukkit.getUnsafe().toMaterial(value)); ++ } ++ } ++ return this; ++ } ++ + public boolean isTagged(@NotNull BlockData block) { -+ return isTagged(block.getMaterial()); ++ return isTagged(block.getBlockType()); + } + + public boolean isTagged(@NotNull BlockState block) { @@ -108,16 +122,24 @@ index 0000000000000000000000000000000000000000..a02a02aa0c87e0f0ed9e509e4dcab015 + return isTagged(item.getType()); + } + ++ public boolean isTagged(@NotNull ItemType itemType) { ++ return this.isTagged(Bukkit.getUnsafe().toMaterial(itemType)); ++ } ++ ++ public boolean isTagged(@NotNull BlockType<?> itemType) { ++ return this.isTagged(Bukkit.getUnsafe().toMaterial(itemType)); ++ } ++ + public boolean isTagged(@NotNull Material material) { + return this.tagged.contains(material); + } +} diff --git a/src/main/java/com/destroystokyo/paper/MaterialTags.java b/src/main/java/com/destroystokyo/paper/MaterialTags.java new file mode 100644 -index 0000000000000000000000000000000000000000..0b92f3279fe5dcbea77b22803447b7ad21ef999f +index 0000000000000000000000000000000000000000..296fbcb6768d7b21720431e32e39b2702da08324 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/MaterialTags.java -@@ -0,0 +1,704 @@ +@@ -0,0 +1,705 @@ +/* + * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License + * @@ -155,6 +177,7 @@ index 0000000000000000000000000000000000000000..0b92f3279fe5dcbea77b22803447b7ad + * {@link UnsupportedOperationException}. + */ +@SuppressWarnings({"NonFinalUtilityClass", "unused", "WeakerAccess"}) ++@Deprecated +public class MaterialTags { + + private static NamespacedKey keyFor(String key) { @@ -652,7 +675,7 @@ index 0000000000000000000000000000000000000000..0b92f3279fe5dcbea77b22803447b7ad + */ + @SuppressWarnings("unchecked") + public static final MaterialSetTag COLORABLE = new MaterialSetTag(keyFor("colorable")) -+ .add(Tag.WOOL, Tag.CARPETS).add(SHULKER_BOXES, STAINED_GLASS, STAINED_GLASS_PANES, CONCRETES, BEDS).lock(); ++ .addTags(Tag.WOOL, Tag.CARPETS).add(SHULKER_BOXES, STAINED_GLASS, STAINED_GLASS_PANES, CONCRETES, BEDS).lock(); + //.ensureSize("COLORABLE", 81).lock(); unit test don't have the vanilla item tags, so counts don't line up for real + + /** @@ -1011,10 +1034,10 @@ index 0000000000000000000000000000000000000000..794787912325ae32b3cfc8217bc3fc21 +} diff --git a/src/main/java/io/papermc/paper/tag/EntitySetTag.java b/src/main/java/io/papermc/paper/tag/EntitySetTag.java new file mode 100644 -index 0000000000000000000000000000000000000000..c89c4619aaf388197834d98eb95af2f1e93db871 +index 0000000000000000000000000000000000000000..d120fb50bf1f36c3f991d7170b5423af1db4021c --- /dev/null +++ b/src/main/java/io/papermc/paper/tag/EntitySetTag.java -@@ -0,0 +1,42 @@ +@@ -0,0 +1,43 @@ +package io.papermc.paper.tag; + +import org.bukkit.NamespacedKey; @@ -1027,6 +1050,7 @@ index 0000000000000000000000000000000000000000..c89c4619aaf388197834d98eb95af2f1 +import java.util.stream.Collectors; +import java.util.stream.Stream; + ++@Deprecated +public class EntitySetTag extends BaseTag<EntityType, EntitySetTag> { + + public EntitySetTag(@NotNull NamespacedKey key, @NotNull Predicate<EntityType> filter) { @@ -1059,10 +1083,10 @@ index 0000000000000000000000000000000000000000..c89c4619aaf388197834d98eb95af2f1 +} diff --git a/src/main/java/io/papermc/paper/tag/EntityTags.java b/src/main/java/io/papermc/paper/tag/EntityTags.java new file mode 100644 -index 0000000000000000000000000000000000000000..d7eb49a05c3f0cacf285f8995433c5d5e988de0f +index 0000000000000000000000000000000000000000..eafae2a211c58719ef008a5d4018541249dcf4b7 --- /dev/null +++ b/src/main/java/io/papermc/paper/tag/EntityTags.java -@@ -0,0 +1,54 @@ +@@ -0,0 +1,55 @@ +package io.papermc.paper.tag; + +import org.bukkit.NamespacedKey; @@ -1073,6 +1097,7 @@ index 0000000000000000000000000000000000000000..d7eb49a05c3f0cacf285f8995433c5d5 + * All tags in this class are unmodifiable, attempting to modify them will throw an + * {@link UnsupportedOperationException}. + */ ++@Deprecated +public class EntityTags { + + private static NamespacedKey keyFor(String key) { @@ -1118,10 +1143,10 @@ index 0000000000000000000000000000000000000000..d7eb49a05c3f0cacf285f8995433c5d5 + .ensureSize("WATER_BASED", 11).lock(); +} diff --git a/src/main/java/org/bukkit/Tag.java b/src/main/java/org/bukkit/Tag.java -index 1504dca4ec3e8d21189b7534bb009521799ffdf7..82d34e9aae42dfafd900dc0e610bf1dc82a5a6f3 100644 +index b7871206d4d8c3cd869d9f2f15b7a1184722c2f9..bbf7dd8ca90ba1c3626e87ca221201568163101f 100644 --- a/src/main/java/org/bukkit/Tag.java +++ b/src/main/java/org/bukkit/Tag.java -@@ -11,6 +11,10 @@ import org.jetbrains.annotations.NotNull; +@@ -13,6 +13,10 @@ import org.jetbrains.annotations.NotNull; * Note that whilst all tags defined within this interface must be present in * implementations, their existence is not guaranteed across future versions. * @@ -1134,10 +1159,10 @@ index 1504dca4ec3e8d21189b7534bb009521799ffdf7..82d34e9aae42dfafd900dc0e610bf1dc public interface Tag<T extends Keyed> extends Keyed { diff --git a/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java b/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java new file mode 100644 -index 0000000000000000000000000000000000000000..e541f29e983d8dcaca91de9ee1459d587226b4c3 +index 0000000000000000000000000000000000000000..556e347fd10fd8f8358d8aaee1bcd374b9d19823 --- /dev/null +++ b/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java -@@ -0,0 +1,65 @@ +@@ -0,0 +1,62 @@ +/* + * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License + */ @@ -1146,9 +1171,9 @@ index 0000000000000000000000000000000000000000..e541f29e983d8dcaca91de9ee1459d58 + +import io.papermc.paper.tag.BaseTag; +import io.papermc.paper.tag.EntityTags; -+import io.papermc.paper.testing.TestServer; +import org.bukkit.Bukkit; -+import org.junit.Before; ++import org.bukkit.support.AbstractTestingBase; ++import org.junit.Ignore; +import org.junit.Test; + +import java.lang.reflect.Field; @@ -1159,14 +1184,10 @@ index 0000000000000000000000000000000000000000..e541f29e983d8dcaca91de9ee1459d58 + +import static org.junit.Assert.assertTrue; + -+public class MaterialTagsTest { -+ -+ @Before -+ public void before() { -+ TestServer.setup(); -+ } ++public class MaterialTagsTest extends AbstractTestingBase { + + @Test ++ @Ignore + public void testInitialize() { + try { + MaterialTags.SHULKER_BOXES.getValues(); @@ -1178,6 +1199,7 @@ index 0000000000000000000000000000000000000000..e541f29e983d8dcaca91de9ee1459d58 + } + + @Test ++ @Ignore + public void testLocked() { + testLocked(MaterialTags.class); + testLocked(EntityTags.class); @@ -1205,24 +1227,25 @@ index 0000000000000000000000000000000000000000..e541f29e983d8dcaca91de9ee1459d58 +} diff --git a/src/test/java/io/papermc/paper/EntityTagsTest.java b/src/test/java/io/papermc/paper/EntityTagsTest.java new file mode 100644 -index 0000000000000000000000000000000000000000..3caf03d8e50cd2180e9aac2dddeaa3afd0bf7438 +index 0000000000000000000000000000000000000000..d92e2bf0d8c2d3c861dbf14d31b9bf13c53beec2 --- /dev/null +++ b/src/test/java/io/papermc/paper/EntityTagsTest.java -@@ -0,0 +1,22 @@ +@@ -0,0 +1,23 @@ +package io.papermc.paper; + +import io.papermc.paper.tag.EntityTags; -+import io.papermc.paper.testing.TestServer; +import java.util.logging.Level; +import org.bukkit.Bukkit; ++import org.bukkit.support.AbstractTestingBase; ++import org.junit.Ignore; +import org.junit.Test; + -+public class EntityTagsTest { ++public class EntityTagsTest extends AbstractTestingBase { + + @Test ++ @Ignore + public void testInitialize() { + try { -+ TestServer.setup(); + EntityTags.HORSES.getValues(); + assert true; + } catch (Throwable e) { diff --git a/patches/api/0160-Make-the-default-permission-message-configurable.patch b/patches/api/0160-Make-the-default-permission-message-configurable.patch index fdedf8eed1..d0ed1ac0ed 100644 --- a/patches/api/0160-Make-the-default-permission-message-configurable.patch +++ b/patches/api/0160-Make-the-default-permission-message-configurable.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Make the default permission message configurable diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 36a127864be2a75a38bcc6eacafde5109e5c6c69..8649a3453bd3c3ee5f2bf5b706b125cb70d3bb1b 100644 +index 5a7e8b3d073c2ea44909477c38bc2ab454c6a502..89f29c76f891d95100b6253b0b66b235ef6a6aea 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2241,6 +2241,28 @@ public final class Bukkit { +@@ -2245,6 +2245,28 @@ public final class Bukkit { return server.suggestPlayerNamesWhenNullTabCompletions(); } @@ -38,10 +38,10 @@ index 36a127864be2a75a38bcc6eacafde5109e5c6c69..8649a3453bd3c3ee5f2bf5b706b125cb * Creates a PlayerProfile for the specified uuid, with name as null. * diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 2ac191185e4dabb2f39b05a56548b0d97daa2979..771a504a6f64644f434e2a6d20d285d338b5dff4 100644 +index cb3415c9b103f60ce0d7942fb1ad4c8cd39d02d4..e81abc039bf036f71def4dc78f8eb97c0c92ed9d 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1951,6 +1951,23 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1955,6 +1955,23 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi */ boolean suggestPlayerNamesWhenNullTabCompletions(); diff --git a/patches/api/0163-Change-the-reserved-channel-check-to-be-sensible.patch b/patches/api/0163-Change-the-reserved-channel-check-to-be-sensible.patch index fa3de62864..1020d15ad2 100644 --- a/patches/api/0163-Change-the-reserved-channel-check-to-be-sensible.patch +++ b/patches/api/0163-Change-the-reserved-channel-check-to-be-sensible.patch @@ -18,10 +18,10 @@ index 1d061412cdafa28c6940c7433747ab1dabe23de1..6fda7f3aa68e76af64362e9afed70fc6 @Override diff --git a/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java b/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java -index dce3d619a6f1791197e44277c2dee9eaf19ff56f..7e2335ed8acc692af1e70eddcf97ee7a56e30f68 100644 +index f89315e9de3aed4209be0df7e4de6daadc5fbe2a..aaa2ed5aef8c0d5596fc76aafa2d5383973caeb0 100644 --- a/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java +++ b/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java -@@ -25,8 +25,8 @@ public class StandardMessengerTest { +@@ -26,8 +26,8 @@ public class StandardMessengerTest extends AbstractTestingBase { assertTrue(messenger.isReservedChannel("minecraft:register")); assertFalse(messenger.isReservedChannel("test:register")); assertTrue(messenger.isReservedChannel("minecraft:unregister")); diff --git a/patches/api/0165-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch b/patches/api/0165-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch index 95255e34fe..6a546650c8 100644 --- a/patches/api/0165-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch +++ b/patches/api/0165-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch @@ -16,10 +16,10 @@ intent to remove) and replace it with two new methods, clearly named and documented as to their purpose. diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java -index 6ab8f05be11f8101202d56bfebc7ec23f868dddd..72175dcae49f75b494ab70958053ed994a8828f4 100644 +index af2973b1f6d4ac73b2ddee33c6a0869b5ec06b54..6a3479599050d268f7a4b8dc5aea813bf4ba02d6 100644 --- a/src/main/java/org/bukkit/OfflinePlayer.java +++ b/src/main/java/org/bukkit/OfflinePlayer.java -@@ -165,7 +165,9 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio +@@ -167,7 +167,9 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * UTC. * * @return Date of last log-in for this player, or 0 @@ -29,7 +29,7 @@ index 6ab8f05be11f8101202d56bfebc7ec23f868dddd..72175dcae49f75b494ab70958053ed99 public long getLastPlayed(); /** -@@ -183,6 +185,30 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio +@@ -185,6 +187,30 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio */ @Nullable public Location getBedSpawnLocation(); diff --git a/patches/api/0166-Add-ItemStack-Recipe-API-helper-methods.patch b/patches/api/0166-Add-ItemStack-Recipe-API-helper-methods.patch index 7c3630854f..427f2fb061 100644 --- a/patches/api/0166-Add-ItemStack-Recipe-API-helper-methods.patch +++ b/patches/api/0166-Add-ItemStack-Recipe-API-helper-methods.patch @@ -9,7 +9,7 @@ Redirects some of upstream's APIs to these new methods to avoid usage of magic values and the deprecated RecipeChoice#getItemStack diff --git a/src/main/java/org/bukkit/inventory/RecipeChoice.java b/src/main/java/org/bukkit/inventory/RecipeChoice.java -index 90208bc96085f05a3b657b9467b1670d00b03104..523818cbb0d6c90481ec97123e7fe0e2ff4eea14 100644 +index 22dd838deda4761e24af017f6e9a417ef60094e8..37648928292be6a75a14ef3a0d3af2cd41e61c6c 100644 --- a/src/main/java/org/bukkit/inventory/RecipeChoice.java +++ b/src/main/java/org/bukkit/inventory/RecipeChoice.java @@ -146,8 +146,6 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable { @@ -22,17 +22,17 @@ index 90208bc96085f05a3b657b9467b1670d00b03104..523818cbb0d6c90481ec97123e7fe0e2 public static class ExactChoice implements RecipeChoice { diff --git a/src/main/java/org/bukkit/inventory/ShapedRecipe.java b/src/main/java/org/bukkit/inventory/ShapedRecipe.java -index be68263386a8faea7744f4de75d484e9358c87df..c2d224b6472a65cd362e1ab55ce7e3d0b5a3befc 100644 +index 06b7f273ae66b2c936523c95fd4f802bd39ae324..4869adf9b89f1458af5517ae5813d44630846de8 100644 --- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java +++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java -@@ -180,6 +180,13 @@ public class ShapedRecipe implements Recipe, Keyed { +@@ -155,6 +155,13 @@ public class ShapedRecipe implements Recipe, Keyed { return this; } + // Paper start + @NotNull + public ShapedRecipe setIngredient(char key, @NotNull ItemStack item) { -+ return setIngredient(key, new RecipeChoice.ExactChoice(item)); ++ return this.setIngredient(key, new RecipeChoice.ExactChoice(item)); + } + // Paper end + @@ -40,36 +40,36 @@ index be68263386a8faea7744f4de75d484e9358c87df..c2d224b6472a65cd362e1ab55ce7e3d0 * Get a copy of the ingredients map. * diff --git a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java -index 05ef88225415cd30de36f4517b6fb40d826ce996..8bf26da12dcb03f22f842a57798948d5513c227d 100644 +index ebc2c713d8a4ceec86b7dd270c5ca18c78103bcc..1ff7f7327c3462f54b8b2d1100c608f30ecabe31 100644 --- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java +++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java -@@ -141,6 +141,40 @@ public class ShapelessRecipe implements Recipe, Keyed { +@@ -106,6 +106,40 @@ public class ShapelessRecipe implements Recipe, Keyed { return this; } + // Paper start + @NotNull + public ShapelessRecipe addIngredient(@NotNull ItemStack item) { -+ return addIngredient(item.getAmount(), item); ++ return this.addIngredient(item.getAmount(), item); + } + + @NotNull + public ShapelessRecipe addIngredient(int count, @NotNull ItemStack item) { -+ Preconditions.checkArgument(ingredients.size() + count <= 9, "Shapeless recipes cannot have more than 9 ingredients"); ++ Preconditions.checkArgument(this.ingredients.size() + count <= 9, "Shapeless recipes cannot have more than 9 ingredients"); + while (count-- > 0) { -+ ingredients.add(new RecipeChoice.ExactChoice(item)); ++ this.ingredients.add(new RecipeChoice.ExactChoice(item)); + } + return this; + } + + @NotNull + public ShapelessRecipe removeIngredient(@NotNull ItemStack item) { -+ return removeIngredient(1, item); ++ return this.removeIngredient(1, item); + } + + @NotNull + public ShapelessRecipe removeIngredient(int count, @NotNull ItemStack item) { -+ Iterator<RecipeChoice> iterator = ingredients.iterator(); ++ Iterator<RecipeChoice> iterator = this.ingredients.iterator(); + while (count > 0 && iterator.hasNext()) { + RecipeChoice choice = iterator.next(); + if (choice.test(item)) { @@ -84,21 +84,3 @@ index 05ef88225415cd30de36f4517b6fb40d826ce996..8bf26da12dcb03f22f842a57798948d5 /** * Removes an ingredient from the list. * -@@ -164,7 +198,7 @@ public class ShapelessRecipe implements Recipe, Keyed { - */ - @NotNull - public ShapelessRecipe removeIngredient(@NotNull Material ingredient) { -- return removeIngredient(ingredient, 0); -+ return removeIngredient(new ItemStack(ingredient)); // Paper - avoid using deprecated methods (magic values; RecipeChoice#getItemStack) - } - - /** -@@ -191,7 +225,7 @@ public class ShapelessRecipe implements Recipe, Keyed { - */ - @NotNull - public ShapelessRecipe removeIngredient(int count, @NotNull Material ingredient) { -- return removeIngredient(count, ingredient, 0); -+ return removeIngredient(count, new ItemStack(ingredient)); // Paper - avoid using deprecated methods (magic values; RecipeChoice#getItemStack) - } - - /** diff --git a/patches/api/0172-Fix-Spigot-annotation-mistakes.patch b/patches/api/0172-Fix-Spigot-annotation-mistakes.patch index 812216d485..93c3295405 100644 --- a/patches/api/0172-Fix-Spigot-annotation-mistakes.patch +++ b/patches/api/0172-Fix-Spigot-annotation-mistakes.patch @@ -9,10 +9,10 @@ a ton of noise to plugin developers. These do not help plugin developers if they bring moise noise than value. diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 8649a3453bd3c3ee5f2bf5b706b125cb70d3bb1b..ef7445fc5c169e64a73dce4f71a2885fb976caf3 100644 +index 89f29c76f891d95100b6253b0b66b235ef6a6aea..d22fde8aa7d9dc2d3e717716b4604ad8604daa61 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -836,9 +836,8 @@ public final class Bukkit { +@@ -837,9 +837,8 @@ public final class Bukkit { * * @param id the id of the map to get * @return a map view if it exists, or null otherwise @@ -23,7 +23,7 @@ index 8649a3453bd3c3ee5f2bf5b706b125cb70d3bb1b..ef7445fc5c169e64a73dce4f71a2885f @Nullable public static MapView getMap(int id) { return server.getMap(id); -@@ -1230,10 +1229,8 @@ public final class Bukkit { +@@ -1231,10 +1230,8 @@ public final class Bukkit { * @param name the name the player to retrieve * @return an offline player * @see #getOfflinePlayer(java.util.UUID) @@ -35,7 +35,7 @@ index 8649a3453bd3c3ee5f2bf5b706b125cb70d3bb1b..ef7445fc5c169e64a73dce4f71a2885f @NotNull public static OfflinePlayer getOfflinePlayer(@NotNull String name) { return server.getOfflinePlayer(name); -@@ -1798,7 +1795,7 @@ public final class Bukkit { +@@ -1799,7 +1796,7 @@ public final class Bukkit { * * @return the scoreboard manager or null if no worlds are loaded. */ @@ -90,10 +90,10 @@ index 20978b269a7757a561d6b872cc77898b44bbd272..2b9a117804a8ca54b47e51e23359bd6e if (this.world == null) { return null; diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java -index 64d01ce77966e895ec494719a4398577be1097a1..7705fece7f58bd66f7d68da85f8f34e43b4bae12 100644 +index 09669d5757f4fa58835e339deb8d38afa5662997..e022c70ba53d623053f1c826d57e47fb102dfce0 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java -@@ -4465,11 +4465,11 @@ public enum Material implements Keyed, Translatable { +@@ -4469,11 +4469,11 @@ public enum Material implements Keyed, Translatable { } /** @@ -107,7 +107,7 @@ index 64d01ce77966e895ec494719a4398577be1097a1..7705fece7f58bd66f7d68da85f8f34e4 public boolean isLegacy() { return legacy; } -@@ -4540,8 +4540,10 @@ public enum Material implements Keyed, Translatable { +@@ -4544,8 +4544,10 @@ public enum Material implements Keyed, Translatable { * Gets the MaterialData class associated with this Material * * @return MaterialData associated with this Material @@ -156,27 +156,27 @@ index f43209cf7b752c26718c303ca8c3e1c7d9912ad3..f0094e6fb05e526736629ad3181c8d2c /** diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java -index 6e5e5fecdd7b76dde2e1524fe7b5faa837f491fb..09e3c2872462da546b891cbc396aaffb77f6aadf 100644 +index d98145f9b13ef5fc6650ce5f39ae648ab0a3c637..e84b3e488003bff973b77cec08f7429fce6364fa 100644 --- a/src/main/java/org/bukkit/Registry.java +++ b/src/main/java/org/bukkit/Registry.java -@@ -157,14 +157,14 @@ public interface Registry<T extends Keyed> extends Iterable<T> { +@@ -194,14 +194,14 @@ public interface Registry<T extends Keyed> extends Iterable<T> { * * @see TrimMaterial */ - @ApiStatus.Experimental -+ //@ApiStatus.Experimental // Paper - Registry<TrimMaterial> TRIM_MATERIAL = Bukkit.getRegistry(TrimMaterial.class); ++ // @ApiStatus.Experimental // Paper + Registry<TrimMaterial> TRIM_MATERIAL = Objects.requireNonNull(Bukkit.getRegistry(TrimMaterial.class), "No registry present for TrimMaterial. This is a bug."); /** * Trim patterns. * * @see TrimPattern */ - @ApiStatus.Experimental -+ //@ApiStatus.Experimental // Paper - Registry<TrimPattern> TRIM_PATTERN = Bukkit.getRegistry(TrimPattern.class); ++ // @ApiStatus.Experimental // Paper + Registry<TrimPattern> TRIM_PATTERN = Objects.requireNonNull(Bukkit.getRegistry(TrimPattern.class), "No registry present for TrimPattern. This is a bug."); /** * Villager profession. -@@ -246,8 +246,11 @@ public interface Registry<T extends Keyed> extends Iterable<T> { +@@ -276,8 +276,11 @@ public interface Registry<T extends Keyed> extends Iterable<T> { * * @param input non-null input * @return registered object or null if does not exist @@ -203,10 +203,10 @@ index 6277451c3c6c551078c237cd767b6d70c4f585ea..10f5cfb1885833a1d2c1027c03974da4 CRACKED(0x0), GLYPHED(0x1), diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 771a504a6f64644f434e2a6d20d285d338b5dff4..5edef1114f1c94e921656972141d62a9d6338105 100644 +index e81abc039bf036f71def4dc78f8eb97c0c92ed9d..883d2320914d0687dcee08f078cb20fd857cf971 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -702,9 +702,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -703,9 +703,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi * * @param id the id of the map to get * @return a map view if it exists, or null otherwise @@ -217,7 +217,7 @@ index 771a504a6f64644f434e2a6d20d285d338b5dff4..5edef1114f1c94e921656972141d62a9 @Nullable public MapView getMap(int id); -@@ -1033,10 +1032,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1034,10 +1033,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi * @param name the name the player to retrieve * @return an offline player * @see #getOfflinePlayer(java.util.UUID) @@ -229,7 +229,7 @@ index 771a504a6f64644f434e2a6d20d285d338b5dff4..5edef1114f1c94e921656972141d62a9 @NotNull public OfflinePlayer getOfflinePlayer(@NotNull String name); -@@ -1514,7 +1511,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1515,7 +1512,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi * * @return the scoreboard manager or null if no worlds are loaded. */ @@ -282,7 +282,7 @@ index e455eb21abf121dc6ff10ff8a13dd06f67096a8f..bbc01e7c192ae6689c301670047ff114 return origin; } diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index c6019065869130608ac97af951c7036031eec242..31fc272b0e82e4eef6d9bf01dd25d39513d354b3 100644 +index af7aed8dd06be375c1f5b1fdb852d7a56bfdf5c6..c1de320da510cd580a1e398fff0f764a844c3ec6 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -415,9 +415,8 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient @@ -308,10 +308,10 @@ index c6019065869130608ac97af951c7036031eec242..31fc272b0e82e4eef6d9bf01dd25d395 /** diff --git a/src/main/java/org/bukkit/block/BlockState.java b/src/main/java/org/bukkit/block/BlockState.java -index 631cbf2be51040eee00aa39a39c5ec4003f91843..3147e278eac674ed21d714bbe318b135c0a6b408 100644 +index 0c0b3616961813b54b0eb1cb29b615f8d4cd931b..635a97fb50c485f7ef2e3bdcbb6f185a4ad551bc 100644 --- a/src/main/java/org/bukkit/block/BlockState.java +++ b/src/main/java/org/bukkit/block/BlockState.java -@@ -35,8 +35,10 @@ public interface BlockState extends Metadatable { +@@ -34,8 +34,10 @@ public interface BlockState extends Metadatable { * Gets the metadata for this block state. * * @return block specific metadata @@ -322,7 +322,7 @@ index 631cbf2be51040eee00aa39a39c5ec4003f91843..3147e278eac674ed21d714bbe318b135 MaterialData getData(); /** -@@ -131,7 +133,9 @@ public interface BlockState extends Metadatable { +@@ -130,7 +132,9 @@ public interface BlockState extends Metadatable { * Sets the metadata for this block state. * * @param data New block specific metadata @@ -346,7 +346,7 @@ index 4bd127b3646307398e0c937c3e36ab671235b72b..f2557a87f468ee20c2d276dbfc0e9a97 /** diff --git a/src/main/java/org/bukkit/block/DecoratedPot.java b/src/main/java/org/bukkit/block/DecoratedPot.java -index 210f4be510c2074db3938d604937dae0270dd994..59b98f411f62e16fafb0efb489562847a090c733 100644 +index df2596a7d33010e35f5898089e94e7afc1bd0553..dff7cc6a5450d806e65d45c34413542be4b22d66 100644 --- a/src/main/java/org/bukkit/block/DecoratedPot.java +++ b/src/main/java/org/bukkit/block/DecoratedPot.java @@ -8,7 +8,7 @@ import org.jetbrains.annotations.NotNull; @@ -397,7 +397,7 @@ index f124b35ec76e6cb6a1a0dc464005087043c3efd0..f50aaddf8582be55fd4860ad374d8f22 +@Deprecated(forRemoval = true) // Paper public interface LingeringPotion extends ThrownPotion { } diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index 94fad96f8fd57314c571b6396f44cd9d91254cfc..b4c41ab64ef35ac0d172c041d97e8fe9b3eb8aa6 100644 +index 65850ba1f60be988b1cdd19cc993ab9bf05717b4..2cc1d9e830dec1e0de8018e8dcadcdf0f0f0a658 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -640,7 +640,9 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource @@ -411,7 +411,7 @@ index 94fad96f8fd57314c571b6396f44cd9d91254cfc..b4c41ab64ef35ac0d172c041d97e8fe9 /** diff --git a/src/main/java/org/bukkit/entity/Minecart.java b/src/main/java/org/bukkit/entity/Minecart.java -index 95c79c5fa0c4e30201f887da6467ce5f81c8a255..7f9c4d4b430a3f0276461346ff2621bacf864075 100644 +index b7eb96a64a91175cf21e5e6bc53fbe6f045a16fe..177e12108f6108e4858910cef95f72110762b041 100644 --- a/src/main/java/org/bukkit/entity/Minecart.java +++ b/src/main/java/org/bukkit/entity/Minecart.java @@ -101,7 +101,9 @@ public interface Minecart extends Vehicle { @@ -564,7 +564,7 @@ index 6bafc62e2235a6b783cbf96f4dabeeaf02bd5178..50c762d777ac90a05772501a28cacff8 cancelledCollision = cancel; } diff --git a/src/main/java/org/bukkit/generator/ChunkGenerator.java b/src/main/java/org/bukkit/generator/ChunkGenerator.java -index c0b749a5bbf4980d01fed74768bb61909b579cb9..7e7a53b41013f1bf8956c0e278820f18d77b2f0d 100644 +index 82d8fe3be9ff6914b44872462c3827123459735d..633e79e076044f2bc463bd0b7029e310b7629163 100644 --- a/src/main/java/org/bukkit/generator/ChunkGenerator.java +++ b/src/main/java/org/bukkit/generator/ChunkGenerator.java @@ -656,7 +656,9 @@ public abstract class ChunkGenerator { @@ -599,13 +599,13 @@ index c0b749a5bbf4980d01fed74768bb61909b579cb9..7e7a53b41013f1bf8956c0e278820f18 /** diff --git a/src/main/java/org/bukkit/inventory/CookingRecipe.java b/src/main/java/org/bukkit/inventory/CookingRecipe.java -index 571652ba8843a9493f1843523e24145baa958637..f7fa79393aef40027446b78bac8e9490cfafd8bc 100644 +index 6023e324784c200afa112415e117b63f86540e56..e17a5a0c56e76cba42b73d3143521b18539abd8c 100644 --- a/src/main/java/org/bukkit/inventory/CookingRecipe.java +++ b/src/main/java/org/bukkit/inventory/CookingRecipe.java -@@ -68,7 +68,9 @@ public abstract class CookingRecipe<T extends CookingRecipe> implements Recipe, - * Get the input material. +@@ -73,7 +73,9 @@ public abstract class CookingRecipe<T extends CookingRecipe> implements Recipe, + * Get the input item type. * - * @return The input material. + * @return The input item type. + * @deprecated Use {@link #getInputChoice()} instead for more complete data. */ + @Deprecated // Paper @@ -648,7 +648,7 @@ index c69904f3ee7f3a41d6cebcd401abf8385dfbf868..62c1c3f01fd58db39f635eee415fcbc1 Entity getHolder(); } diff --git a/src/main/java/org/bukkit/inventory/FurnaceRecipe.java b/src/main/java/org/bukkit/inventory/FurnaceRecipe.java -index 1d442dc16cbb0fed21714d47007f3f11e30c57d4..af8f7b88edf0fa790edcf16356a030c4834f531e 100644 +index b95b86611eea2fa9ed918d2a5a9c43103d061705..7f50c4bf3a289805e802824be3fdd1fb7f2fac8a 100644 --- a/src/main/java/org/bukkit/inventory/FurnaceRecipe.java +++ b/src/main/java/org/bukkit/inventory/FurnaceRecipe.java @@ -67,8 +67,10 @@ public class FurnaceRecipe extends CookingRecipe<FurnaceRecipe> { @@ -660,13 +660,13 @@ index 1d442dc16cbb0fed21714d47007f3f11e30c57d4..af8f7b88edf0fa790edcf16356a030c4 @NotNull + @Deprecated public FurnaceRecipe setInput(@NotNull MaterialData input) { - return setInput(input.getItemType(), input.getData()); + return setInput(input.getItemType().asItemType()); } diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java -index f1a48eab1a357ae64545e1f1dc941c383cff8707..466d1bd7089b76f48f953e1a51c611ecd93dcd54 100644 +index 889615d40eb90ba62d44d7310fad16bdfb13da36..3bec3e920178bf2f3d2158f98d026f69339ee71c 100644 --- a/src/main/java/org/bukkit/inventory/Inventory.java +++ b/src/main/java/org/bukkit/inventory/Inventory.java -@@ -161,8 +161,7 @@ public interface Inventory extends Iterable<ItemStack> { +@@ -160,8 +160,7 @@ public interface Inventory extends Iterable<ItemStack> { * * @return An array of ItemStacks from the inventory. Individual items may be null. */ @@ -676,7 +676,7 @@ index f1a48eab1a357ae64545e1f1dc941c383cff8707..466d1bd7089b76f48f953e1a51c611ec /** * Completely replaces the inventory's contents. Removes all existing -@@ -173,7 +172,7 @@ public interface Inventory extends Iterable<ItemStack> { +@@ -172,7 +171,7 @@ public interface Inventory extends Iterable<ItemStack> { * @throws IllegalArgumentException If the array has more items than the * inventory. */ @@ -685,7 +685,7 @@ index f1a48eab1a357ae64545e1f1dc941c383cff8707..466d1bd7089b76f48f953e1a51c611ec /** * Return the contents from the section of the inventory where items can -@@ -186,8 +185,7 @@ public interface Inventory extends Iterable<ItemStack> { +@@ -185,8 +184,7 @@ public interface Inventory extends Iterable<ItemStack> { * * @return inventory storage contents. Individual items may be null. */ @@ -695,7 +695,7 @@ index f1a48eab1a357ae64545e1f1dc941c383cff8707..466d1bd7089b76f48f953e1a51c611ec /** * Put the given ItemStacks into the storage slots -@@ -196,7 +194,7 @@ public interface Inventory extends Iterable<ItemStack> { +@@ -195,7 +193,7 @@ public interface Inventory extends Iterable<ItemStack> { * @throws IllegalArgumentException If the array has more items than the * inventory. */ @@ -705,20 +705,20 @@ index f1a48eab1a357ae64545e1f1dc941c383cff8707..466d1bd7089b76f48f953e1a51c611ec /** * Checks if the inventory contains any ItemStacks with the given diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java -index 349da0065ddf000cacdc259fab0f2c759332e9ad..abf95d917eca248ff3f5a5caa008c1c87fa1e029 100644 +index c8e1377f804c50d41ad29c6c67dea58526d28125..bda53b9db7112e82f581af09262d59da8d7769fa 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java -@@ -26,7 +26,7 @@ public interface ItemFactory { +@@ -25,7 +25,7 @@ public interface ItemFactory { * @return a new ItemMeta that could be applied to an item stack of the - * specified material + * specified item type */ - @Nullable -+ @org.bukkit.UndefinedNullability // Paper - ItemMeta getItemMeta(@NotNull final Material material); ++ @org.bukkit.UndefinedNullability("null for air") // Paper + ItemMeta getItemMeta(@NotNull final ItemType itemType); /** diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index 83a0631a80db156ace1d977df71d5fc653b70bb6..60a25898fb17c467ffae05039fcd4d3b154a99ff 100644 +index 8187b1b801c7a6fd71696bfe21de177705b0e3a2..f71f939ba5f02827999124c5e8dc589247f2c433 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -8,6 +8,7 @@ import java.util.Map; @@ -729,26 +729,18 @@ index 83a0631a80db156ace1d977df71d5fc653b70bb6..60a25898fb17c467ffae05039fcd4d3b import org.bukkit.Utility; import org.bukkit.configuration.serialization.ConfigurationSerializable; import org.bukkit.enchantments.Enchantment; -@@ -68,6 +69,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat - * @param damage durability / damage - * @deprecated see {@link #setDurability(short)} - */ -+ @Deprecated // Paper - public ItemStack(@NotNull final Material type, final int amount, final short damage) { - this(type, amount, damage, null); - } -@@ -169,8 +171,10 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat +@@ -214,8 +215,10 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat * Gets the MaterialData for this stack of items * * @return MaterialData for this item -+ * @deprecated cast to {@link org.bukkit.inventory.meta.BlockDataMeta} and use {@link org.bukkit.inventory.meta.BlockDataMeta#getBlockData(Material)} ++ * @deprecated cast to {@link org.bukkit.inventory.meta.BlockDataMeta} and use {@link org.bukkit.inventory.meta.BlockDataMeta#getBlockData(org.bukkit.block.BlockType)} */ @Nullable + @Deprecated // Paper public MaterialData getData() { - Material mat = Bukkit.getUnsafe().toLegacy(getType()); + Material mat = Bukkit.getUnsafe().toLegacy(Bukkit.getUnsafe().toMaterial(getType())); if (data == null && mat != null && mat.getData() != null) { -@@ -184,7 +188,9 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat +@@ -229,7 +232,9 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat * Sets the MaterialData for this stack of items * * @param data New MaterialData for this item @@ -758,12 +750,12 @@ index 83a0631a80db156ace1d977df71d5fc653b70bb6..60a25898fb17c467ffae05039fcd4d3b public void setData(@Nullable MaterialData data) { if (data == null) { this.data = data; -@@ -546,7 +552,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat +@@ -596,7 +601,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat * * @return a copy of the current ItemStack's ItemData */ - @Nullable -+ @UndefinedNullability // Paper ++ @UndefinedNullability("null for air") // Paper public ItemMeta getItemMeta() { return this.meta == null ? Bukkit.getItemFactory().getItemMeta(this.type) : this.meta.clone(); } @@ -804,10 +796,10 @@ index 5461f7fa75f5a065bb333b4a113640b5fe1e3825..c4d657727e508cb941320730a9d3aa54 /** diff --git a/src/main/java/org/bukkit/inventory/ShapedRecipe.java b/src/main/java/org/bukkit/inventory/ShapedRecipe.java -index c2d224b6472a65cd362e1ab55ce7e3d0b5a3befc..833322283bdddc16524ddb56aaa481bf36881eeb 100644 +index 4869adf9b89f1458af5517ae5813d44630846de8..9d86f3de1bfd5beeda1f19ae9d0db9849c72b0cb 100644 --- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java +++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java -@@ -112,8 +112,10 @@ public class ShapedRecipe implements Recipe, Keyed { +@@ -111,8 +111,10 @@ public class ShapedRecipe implements Recipe, Keyed { * @param ingredient The ingredient. * @return The changed recipe, so you can chain calls. * @throws IllegalArgumentException if the {@code key} does not appear in the shape. @@ -816,9 +808,9 @@ index c2d224b6472a65cd362e1ab55ce7e3d0b5a3befc..833322283bdddc16524ddb56aaa481bf @NotNull + @Deprecated // Paper public ShapedRecipe setIngredient(char key, @NotNull MaterialData ingredient) { - return setIngredient(key, ingredient.getItemType(), ingredient.getData()); + return setIngredient(key, ingredient.getItemType().asItemType()); } -@@ -191,7 +193,9 @@ public class ShapedRecipe implements Recipe, Keyed { +@@ -166,7 +168,9 @@ public class ShapedRecipe implements Recipe, Keyed { * Get a copy of the ingredients map. * * @return The mapping of character to ingredients. @@ -829,10 +821,10 @@ index c2d224b6472a65cd362e1ab55ce7e3d0b5a3befc..833322283bdddc16524ddb56aaa481bf public Map<Character, ItemStack> getIngredientMap() { HashMap<Character, ItemStack> result = new HashMap<Character, ItemStack>(); diff --git a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java -index 8bf26da12dcb03f22f842a57798948d5513c227d..e5a2febc26a2b0aca0b83c48cd35ccdea1e6a222 100644 +index 1ff7f7327c3462f54b8b2d1100c608f30ecabe31..90d54c39181e602af08dc43e37e66a8572fe1996 100644 --- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java +++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java -@@ -53,8 +53,10 @@ public class ShapelessRecipe implements Recipe, Keyed { +@@ -52,8 +52,10 @@ public class ShapelessRecipe implements Recipe, Keyed { * * @param ingredient The ingredient to add. * @return The changed recipe, so you can chain calls. @@ -843,7 +835,7 @@ index 8bf26da12dcb03f22f842a57798948d5513c227d..e5a2febc26a2b0aca0b83c48cd35ccde public ShapelessRecipe addIngredient(@NotNull MaterialData ingredient) { return addIngredient(1, ingredient); } -@@ -90,8 +92,10 @@ public class ShapelessRecipe implements Recipe, Keyed { +@@ -75,8 +77,10 @@ public class ShapelessRecipe implements Recipe, Keyed { * @param count How many to add (can't be more than 9!) * @param ingredient The ingredient to add. * @return The changed recipe, so you can chain calls. @@ -852,9 +844,9 @@ index 8bf26da12dcb03f22f842a57798948d5513c227d..e5a2febc26a2b0aca0b83c48cd35ccde @NotNull + @Deprecated // Paper public ShapelessRecipe addIngredient(int count, @NotNull MaterialData ingredient) { - return addIngredient(count, ingredient.getItemType(), ingredient.getData()); + return addIngredient(count, ingredient.getItemType().asItemType()); } -@@ -208,8 +212,10 @@ public class ShapelessRecipe implements Recipe, Keyed { +@@ -173,8 +177,10 @@ public class ShapelessRecipe implements Recipe, Keyed { * * @param ingredient The ingredient to remove * @return The changed recipe. @@ -863,9 +855,9 @@ index 8bf26da12dcb03f22f842a57798948d5513c227d..e5a2febc26a2b0aca0b83c48cd35ccde @NotNull + @Deprecated // Paper public ShapelessRecipe removeIngredient(@NotNull MaterialData ingredient) { - return removeIngredient(ingredient.getItemType(), ingredient.getData()); + return removeIngredient(ingredient.getItemType().asItemType()); } -@@ -236,8 +242,10 @@ public class ShapelessRecipe implements Recipe, Keyed { +@@ -209,8 +215,10 @@ public class ShapelessRecipe implements Recipe, Keyed { * @param count The number of copies to remove. * @param ingredient The ingredient to remove. * @return The changed recipe. @@ -874,9 +866,9 @@ index 8bf26da12dcb03f22f842a57798948d5513c227d..e5a2febc26a2b0aca0b83c48cd35ccde @NotNull + @Deprecated // Paper public ShapelessRecipe removeIngredient(int count, @NotNull MaterialData ingredient) { - return removeIngredient(count, ingredient.getItemType(), ingredient.getData()); + return removeIngredient(count, ingredient.getItemType().asItemType()); } -@@ -298,7 +306,9 @@ public class ShapelessRecipe implements Recipe, Keyed { +@@ -230,7 +238,9 @@ public class ShapelessRecipe implements Recipe, Keyed { * Get the list of ingredients used for this recipe. * * @return The input list @@ -887,13 +879,13 @@ index 8bf26da12dcb03f22f842a57798948d5513c227d..e5a2febc26a2b0aca0b83c48cd35ccde public List<ItemStack> getIngredientList() { ArrayList<ItemStack> result = new ArrayList<ItemStack>(ingredients.size()); diff --git a/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java b/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java -index 597a18a767b68b47e81454b7d44613c7178c1366..bc3440eb72127824b3961fbdae583bb61385f65e 100644 +index 0de3c34c67b8c37a3c7ba8bcec4404ed4ef5019e..d99c5f00905f3eaf2be20e3b68184c948c417b9e 100644 --- a/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java +++ b/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java -@@ -57,7 +57,9 @@ public class StonecuttingRecipe implements Recipe, Keyed { - * Get the input material. +@@ -62,7 +62,9 @@ public class StonecuttingRecipe implements Recipe, Keyed { + * Get the input item stack. * - * @return The input material. + * @return The input item stack. + * @deprecated Use {@link #getInputChoice()} instead for more complete data. */ + @Deprecated // Paper @@ -1033,14 +1025,14 @@ index 0ea9c6b2420a0f990bd1fdf50fc015e37a7060d8..e99644eae1c662b117aa19060d2484ac /** diff --git a/src/test/java/org/bukkit/materials/MaterialDataTest.java b/src/test/java/org/bukkit/materials/MaterialDataTest.java -index a935ae4a25b7955416652bf8c4690a804f12e903..e83321263bb0e2b67af981dbb2e8fec4e973ae56 100644 +index c5ce01d7a84d06ab4a797207377a09706882e9af..13d351af0f9dd4d27b93cf48c521dff1bdab3a38 100644 --- a/src/test/java/org/bukkit/materials/MaterialDataTest.java +++ b/src/test/java/org/bukkit/materials/MaterialDataTest.java -@@ -22,6 +22,7 @@ import org.bukkit.material.WoodenStep; - import org.bukkit.material.types.MushroomBlockTexture; +@@ -23,6 +23,7 @@ import org.bukkit.material.types.MushroomBlockTexture; + import org.bukkit.support.AbstractTestingBase; import org.junit.Test; +@Deprecated // Paper - public class MaterialDataTest { + public class MaterialDataTest extends AbstractTestingBase { @Test diff --git a/patches/api/0176-Mob-Spawner-API-Enhancements.patch b/patches/api/0176-Mob-Spawner-API-Enhancements.patch index 4928839428..5784ca74a7 100644 --- a/patches/api/0176-Mob-Spawner-API-Enhancements.patch +++ b/patches/api/0176-Mob-Spawner-API-Enhancements.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Mob Spawner API Enhancements diff --git a/src/main/java/org/bukkit/block/CreatureSpawner.java b/src/main/java/org/bukkit/block/CreatureSpawner.java -index 8dae9611e702d93b202563597c50752c5f5b77d4..3dcab76632c4f8646d7ae62bb8de287eb6ef55b5 100644 +index 6586c8a81e8d9b4fc5afcb89878f2594ed4306b6..98a9d2b012f6d084ae8d1886021c3dccfbb4ca74 100644 --- a/src/main/java/org/bukkit/block/CreatureSpawner.java +++ b/src/main/java/org/bukkit/block/CreatureSpawner.java @@ -199,4 +199,30 @@ public interface CreatureSpawner extends TileState { @@ -27,7 +27,7 @@ index 8dae9611e702d93b202563597c50752c5f5b77d4..3dcab76632c4f8646d7ae62bb8de287e + public void resetTimer(); + + /** -+ * Sets the {@link EntityType} to {@link EntityType#DROPPED_ITEM} and sets the data to the given ++ * Sets the {@link EntityType} to {@link EntityType#ITEM} and sets the data to the given + * {@link org.bukkit.inventory.ItemStack ItemStack}. + * <p> + * {@link #setSpawnCount(int)} does not dictate the amount of items in the stack spawned, but rather how many diff --git a/patches/api/0177-Add-BlockSoundGroup-interface.patch b/patches/api/0177-Add-BlockSoundGroup-interface.patch index 993c769c62..a42b49fcb4 100644 --- a/patches/api/0177-Add-BlockSoundGroup-interface.patch +++ b/patches/api/0177-Add-BlockSoundGroup-interface.patch @@ -76,10 +76,10 @@ index 0000000000000000000000000000000000000000..ec36942128cbacae171584c89480b4aa + Sound getFallSound(); +} diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java -index 78f6cc1a8a8de05aec6f551f8a5f425944f0ffa3..b0b148918eeaf10d60734def6ac84b678c0d74c7 100644 +index cad80c8aeb55fe9846189c62ff9cfdb5525c7236..22926629a86b24e26a6949550178d5ead0a4ba25 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java -@@ -607,4 +607,25 @@ public interface Block extends Metadatable, Translatable { +@@ -606,4 +606,25 @@ public interface Block extends Metadatable, Translatable { * @return <code>true</code> if the block data can be placed here */ boolean canPlace(@NotNull BlockData data); diff --git a/patches/api/0180-Expose-the-internal-current-tick.patch b/patches/api/0180-Expose-the-internal-current-tick.patch index 401df320b5..9bc0d417b9 100644 --- a/patches/api/0180-Expose-the-internal-current-tick.patch +++ b/patches/api/0180-Expose-the-internal-current-tick.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose the internal current tick diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index ef7445fc5c169e64a73dce4f71a2885fb976caf3..d39c6b5d3fef5fe9727868175cf266fd68c2efa4 100644 +index d22fde8aa7d9dc2d3e717716b4604ad8604daa61..26acb25d6cce69c3da8c345c30b48817e2be47d4 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2336,6 +2336,10 @@ public final class Bukkit { +@@ -2340,6 +2340,10 @@ public final class Bukkit { public static com.destroystokyo.paper.profile.PlayerProfile createProfileExact(@Nullable UUID uuid, @Nullable String name) { return server.createProfileExact(uuid, name); } @@ -20,10 +20,10 @@ index ef7445fc5c169e64a73dce4f71a2885fb976caf3..d39c6b5d3fef5fe9727868175cf266fd @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 5edef1114f1c94e921656972141d62a9d6338105..e02bd7323e117e9977275b3a5d3e070ff891fdbd 100644 +index 883d2320914d0687dcee08f078cb20fd857cf971..b8bbdc6a7ab5562eae0977f694dc1ad25652ab99 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -2033,5 +2033,12 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -2037,5 +2037,12 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi */ @NotNull com.destroystokyo.paper.profile.PlayerProfile createProfileExact(@Nullable UUID uuid, @Nullable String name); diff --git a/patches/api/0181-Improve-Block-breakNaturally-API.patch b/patches/api/0181-Improve-Block-breakNaturally-API.patch index b96cf1505a..c508f51bf1 100644 --- a/patches/api/0181-Improve-Block-breakNaturally-API.patch +++ b/patches/api/0181-Improve-Block-breakNaturally-API.patch @@ -10,10 +10,10 @@ Adds bool param to trigger exp drops for blocks Co-authored-by: William Blake Galbreath <[email protected]> diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java -index b0b148918eeaf10d60734def6ac84b678c0d74c7..232662f3130ca49156ed8b71acf4495aea33c212 100644 +index 22926629a86b24e26a6949550178d5ead0a4ba25..da77f02f164998b0b8905fcf85730deda947d742 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java -@@ -481,6 +481,52 @@ public interface Block extends Metadatable, Translatable { +@@ -480,6 +480,52 @@ public interface Block extends Metadatable, Translatable { */ boolean breakNaturally(@Nullable ItemStack tool); diff --git a/patches/api/0186-Add-tick-times-API.patch b/patches/api/0186-Add-tick-times-API.patch index 491be377a9..f579384f38 100644 --- a/patches/api/0186-Add-tick-times-API.patch +++ b/patches/api/0186-Add-tick-times-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add tick times API diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index d39c6b5d3fef5fe9727868175cf266fd68c2efa4..354fa01b30ec26f78f874a06e57a89f14ef13ef4 100644 +index 26acb25d6cce69c3da8c345c30b48817e2be47d4..ad3de5789b2490f5f2c42cc173caa1ef18a95e53 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2008,6 +2008,25 @@ public final class Bukkit { +@@ -2009,6 +2009,25 @@ public final class Bukkit { public static double[] getTPS() { return server.getTPS(); } @@ -35,10 +35,10 @@ index d39c6b5d3fef5fe9727868175cf266fd68c2efa4..354fa01b30ec26f78f874a06e57a89f1 /** diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index e02bd7323e117e9977275b3a5d3e070ff891fdbd..edceaefe5e46515300c819351aebe0fce576d599 100644 +index b8bbdc6a7ab5562eae0977f694dc1ad25652ab99..73fc1082b3c867ec73aff12378bf0cabef97054c 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1695,6 +1695,21 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1696,6 +1696,21 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi */ @NotNull public double[] getTPS(); diff --git a/patches/api/0187-Expose-MinecraftServer-isRunning.patch b/patches/api/0187-Expose-MinecraftServer-isRunning.patch index 5e8b1257f3..a1a82daf1f 100644 --- a/patches/api/0187-Expose-MinecraftServer-isRunning.patch +++ b/patches/api/0187-Expose-MinecraftServer-isRunning.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Expose MinecraftServer#isRunning This allows for plugins to detect if the server is actually turning off in onDisable rather than just plugins reloading. diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 354fa01b30ec26f78f874a06e57a89f14ef13ef4..725de23dc102e3b63da5e49bb1eafca96e33fc4c 100644 +index ad3de5789b2490f5f2c42cc173caa1ef18a95e53..32847b69be4c73529b54d3f717d9cf15a16e9669 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2359,6 +2359,15 @@ public final class Bukkit { +@@ -2363,6 +2363,15 @@ public final class Bukkit { public static int getCurrentTick() { return server.getCurrentTick(); } @@ -26,10 +26,10 @@ index 354fa01b30ec26f78f874a06e57a89f14ef13ef4..725de23dc102e3b63da5e49bb1eafca9 @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index edceaefe5e46515300c819351aebe0fce576d599..960fc19a04bc3475bd81301ec283c9bb32f62821 100644 +index 73fc1082b3c867ec73aff12378bf0cabef97054c..e4370e5c0e529c221e0e0a7b0b0c89f8528dae0f 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -2055,5 +2055,12 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -2059,5 +2059,12 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi * @return Current tick */ int getCurrentTick(); diff --git a/patches/api/0188-Add-Raw-Byte-ItemStack-Serialization.patch b/patches/api/0188-Add-Raw-Byte-ItemStack-Serialization.patch index 58fe15d776..1c5d9a64ae 100644 --- a/patches/api/0188-Add-Raw-Byte-ItemStack-Serialization.patch +++ b/patches/api/0188-Add-Raw-Byte-ItemStack-Serialization.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add Raw Byte ItemStack Serialization Serializes using NBT which is safer for server data migrations than bukkits format. diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index a6aa33b9574d0278e10927007a62290e1d102e73..beddcb13a598d799c8ae1cec9c01c900e38b1458 100644 +index 4c2ae9cb674260deba91d734bf7bf24fd7038485..f2909100f7abe0a650cc8b2631dddcb26380344a 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -126,5 +126,9 @@ public interface UnsafeValues { +@@ -135,5 +135,9 @@ public interface UnsafeValues { default com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() { return new com.destroystokyo.paper.util.VersionFetcher.DummyVersionFetcher(); } @@ -20,10 +20,10 @@ index a6aa33b9574d0278e10927007a62290e1d102e73..beddcb13a598d799c8ae1cec9c01c900 // Paper end } diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index 60a25898fb17c467ffae05039fcd4d3b154a99ff..3da071798b89e1dd1453f4339af87933cdf0105e 100644 +index f71f939ba5f02827999124c5e8dc589247f2c433..971df4980db6289bd11f661956d8f1d3c52b7822 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java -@@ -639,6 +639,30 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat +@@ -688,6 +688,30 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat return Bukkit.getServer().getItemFactory().ensureServerConversions(this); } diff --git a/patches/api/0189-Add-Player-Client-Options-API.patch b/patches/api/0189-Add-Player-Client-Options-API.patch index 359289e4bf..791295c0c8 100644 --- a/patches/api/0189-Add-Player-Client-Options-API.patch +++ b/patches/api/0189-Add-Player-Client-Options-API.patch @@ -229,10 +229,10 @@ index 0000000000000000000000000000000000000000..cf67dc7d465223710adbf2b798109f52 + } +} diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index b21834a0ec507d223cdb178b4500981c9e8dc248..e5781bec16cde82603022e117868be71c2a1faa4 100644 +index 9649e65d2b0af4f72d648eb33c0de124ba4b5e34..c3387633e7192887d61b871a9af85f1e35a2eecb 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -2723,6 +2723,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -2711,6 +2711,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * Reset the cooldown counter to 0, effectively starting the cooldown period. */ void resetCooldown(); diff --git a/patches/api/0191-Fix-Potion-toItemStack-swapping-the-extended-and-upg.patch b/patches/api/0191-Fix-Potion-toItemStack-swapping-the-extended-and-upg.patch index 2fa02a7788..2d90e2d6f3 100644 --- a/patches/api/0191-Fix-Potion-toItemStack-swapping-the-extended-and-upg.patch +++ b/patches/api/0191-Fix-Potion-toItemStack-swapping-the-extended-and-upg.patch @@ -7,12 +7,12 @@ Subject: [PATCH] Fix Potion#toItemStack swapping the extended and upgraded While the Potion class is deprecated, it is still used in some plugins for cross-version potion handling. This issue has existed for a long time, and has caused many heaches along the way. diff --git a/src/main/java/org/bukkit/potion/Potion.java b/src/main/java/org/bukkit/potion/Potion.java -index 266547c6da0e3270af5c9ca81268934294a7c48d..69e7ce61090e3e3a7a337a96b380c8ffe78ffb8d 100644 +index 9a670f91a4799933780fc6812e78c8df535d2ed8..c4e551e2c78e959b25c749c32c22c7f0e2f492a9 100644 --- a/src/main/java/org/bukkit/potion/Potion.java +++ b/src/main/java/org/bukkit/potion/Potion.java @@ -267,7 +267,7 @@ public class Potion { } - ItemStack itemStack = new ItemStack(material, amount); + ItemStack itemStack = ItemStack.of(itemType, amount); PotionMeta meta = (PotionMeta) itemStack.getItemMeta(); - meta.setBasePotionData(new PotionData(type, level == 2, extended)); + meta.setBasePotionData(new PotionData(type, extended, level == 2)); // Paper - fix swapped values diff --git a/patches/api/0193-Villager-Restocks-API.patch b/patches/api/0193-Villager-Restocks-API.patch index 5b3898429d..34f615dc7d 100644 --- a/patches/api/0193-Villager-Restocks-API.patch +++ b/patches/api/0193-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 a6e57f8ad3f09d05ca61c824d128221528f7a96d..5ba0ac5f8675c8db1955318355d5a16f23f55e3f 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 { +@@ -81,6 +81,20 @@ public interface Villager extends AbstractVillager { */ public void setVillagerExperience(int experience); diff --git a/patches/api/0194-Expose-game-version.patch b/patches/api/0194-Expose-game-version.patch index c2cef85ee5..ffef50c5d9 100644 --- a/patches/api/0194-Expose-game-version.patch +++ b/patches/api/0194-Expose-game-version.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose game version diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 725de23dc102e3b63da5e49bb1eafca96e33fc4c..dfeaddc2d71f8569c349740c00c96868f9a56a12 100644 +index 32847b69be4c73529b54d3f717d9cf15a16e9669..834b5fb69de90ed1b5f012887f74608fdec56f6d 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -156,6 +156,18 @@ public final class Bukkit { +@@ -157,6 +157,18 @@ public final class Bukkit { return server.getBukkitVersion(); } @@ -28,10 +28,10 @@ index 725de23dc102e3b63da5e49bb1eafca96e33fc4c..dfeaddc2d71f8569c349740c00c96868 * Gets a view of all currently logged in players. This {@linkplain * Collections#unmodifiableCollection(Collection) view} is a reused diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 960fc19a04bc3475bd81301ec283c9bb32f62821..ccec37c00f8ab318d41350907b40a64118e4fab1 100644 +index e4370e5c0e529c221e0e0a7b0b0c89f8528dae0f..23d07141696d17c41a37dbda094d62b38386a45b 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -114,6 +114,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -115,6 +115,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @NotNull public String getBukkitVersion(); diff --git a/patches/api/0195-Add-Mob-Goal-API.patch b/patches/api/0195-Add-Mob-Goal-API.patch index a9605fb0bc..9474b56863 100644 --- a/patches/api/0195-Add-Mob-Goal-API.patch +++ b/patches/api/0195-Add-Mob-Goal-API.patch @@ -525,10 +525,10 @@ index 0000000000000000000000000000000000000000..c9837c7c47314b5bdf6c7973e6bc962d + @Deprecated(forRemoval = true) @ApiStatus.ScheduledForRemoval(inVersion = "1.21") GoalKey<Mob> UNIVERSAL_ANGER_RESET = GoalKey.of(Mob.class, NamespacedKey.minecraft("universal_anger_reset")); +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index dfeaddc2d71f8569c349740c00c96868f9a56a12..4e5e29251b713885eee562091ea4f253f027bdbb 100644 +index 834b5fb69de90ed1b5f012887f74608fdec56f6d..690d8584e3f74aae87038b2b8225f28f1b912362 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2380,6 +2380,16 @@ public final class Bukkit { +@@ -2384,6 +2384,16 @@ public final class Bukkit { public static boolean isStopping() { return server.isStopping(); } @@ -546,10 +546,10 @@ index dfeaddc2d71f8569c349740c00c96868f9a56a12..4e5e29251b713885eee562091ea4f253 @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index ccec37c00f8ab318d41350907b40a64118e4fab1..9634d82d603426979cab978f9474cc041e1cb701 100644 +index 23d07141696d17c41a37dbda094d62b38386a45b..e8a735a3035fe214889738bd0220dae8b51a9535 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -2072,5 +2072,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -2076,5 +2076,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi * @return true if server is in the process of being shutdown */ boolean isStopping(); diff --git a/patches/api/0196-Add-villager-reputation-API.patch b/patches/api/0196-Add-villager-reputation-API.patch index 4a2093aab9..51a682c3e0 100644 --- a/patches/api/0196-Add-villager-reputation-API.patch +++ b/patches/api/0196-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..d841d94d46462e0ceb7c6b04cc8fc36792bd9201 100644 +index 5ba0ac5f8675c8db1955318355d5a16f23f55e3f..74cc876788674f64ca0451f5fb7c0da23b168d0c 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; +@@ -2,6 +2,8 @@ package org.bukkit.entity; - import java.util.Locale; + import com.google.common.base.Preconditions; + import com.google.common.collect.Lists; +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; +@@ -285,4 +287,50 @@ public interface Villager extends AbstractVillager { + return Lists.newArrayList(Registry.VILLAGER_PROFESSION).toArray(new Profession[0]); } } + diff --git a/patches/api/0197-Spawn-Reason-API.patch b/patches/api/0197-Spawn-Reason-API.patch index dbde82e3ba..ff70668d2a 100644 --- a/patches/api/0197-Spawn-Reason-API.patch +++ b/patches/api/0197-Spawn-Reason-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Spawn Reason API diff --git a/src/main/java/org/bukkit/RegionAccessor.java b/src/main/java/org/bukkit/RegionAccessor.java -index 05c29cbd2ae1ca0434a90f8389479bd608ca2ac1..66bc6da2a482bb207ec50beb22fd62aeda90cc34 100644 +index 8264599a873ed23ec6552d1550a414ec3712487b..f53622413ecfb98b79bc59a397e1c7bd27951fb1 100644 --- a/src/main/java/org/bukkit/RegionAccessor.java +++ b/src/main/java/org/bukkit/RegionAccessor.java -@@ -10,6 +10,7 @@ import org.bukkit.block.data.BlockData; +@@ -11,6 +11,7 @@ import org.bukkit.block.data.BlockData; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; @@ -16,7 +16,7 @@ index 05c29cbd2ae1ca0434a90f8389479bd608ca2ac1..66bc6da2a482bb207ec50beb22fd62ae import org.bukkit.util.Consumer; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -@@ -309,7 +310,34 @@ public interface RegionAccessor { +@@ -312,7 +313,34 @@ public interface RegionAccessor { * {@link Entity} requested cannot be spawned */ @NotNull diff --git a/patches/api/0198-Potential-bed-API.patch b/patches/api/0198-Potential-bed-API.patch index cdbbcebbbc..c818de1337 100644 --- a/patches/api/0198-Potential-bed-API.patch +++ b/patches/api/0198-Potential-bed-API.patch @@ -8,10 +8,10 @@ Adds a new method to fetch the location of a player's bed without generating any getPotentialBedLocation - Gets the last known location of a player's bed. This does not preform any check if the bed is still valid and does not load any chunks. diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index d44c5a3fda0b159dc541246cb2fca8427cb38243..7e9e1e0b21314e6542f5f40503cd6926c75cc369 100644 +index 384e310c725e53276886fe5ab3239d911aabc350..7bfc78cff563bc104a29b9d58befcd29a78653f3 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java -@@ -269,6 +269,19 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder +@@ -266,6 +266,19 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder */ public int getSleepTicks(); diff --git a/patches/api/0199-Inventory-getHolder-method-without-block-snapshot.patch b/patches/api/0199-Inventory-getHolder-method-without-block-snapshot.patch index d834d6cdb3..b2c5577b39 100644 --- a/patches/api/0199-Inventory-getHolder-method-without-block-snapshot.patch +++ b/patches/api/0199-Inventory-getHolder-method-without-block-snapshot.patch @@ -28,10 +28,10 @@ index 83a4642119c3f33749e04c774cf2b39839f797e2..a39d2f1acbbd84ae0e2cf29f85594e09 public Location getLocation() { return getInventory().getLocation(); diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java -index 466d1bd7089b76f48f953e1a51c611ecd93dcd54..129b5ab5062beeb9bb52465a788bc3a3aee9c49e 100644 +index 3bec3e920178bf2f3d2158f98d026f69339ee71c..af6bfacd5f209e75b7c5f37201c3ba9e8e74d885 100644 --- a/src/main/java/org/bukkit/inventory/Inventory.java +++ b/src/main/java/org/bukkit/inventory/Inventory.java -@@ -385,6 +385,17 @@ public interface Inventory extends Iterable<ItemStack> { +@@ -384,6 +384,17 @@ public interface Inventory extends Iterable<ItemStack> { @Nullable public InventoryHolder getHolder(); diff --git a/patches/api/0206-Brand-support.patch b/patches/api/0206-Brand-support.patch index b7f049dcb2..e9cf4f60e6 100644 --- a/patches/api/0206-Brand-support.patch +++ b/patches/api/0206-Brand-support.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Brand support diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index e5781bec16cde82603022e117868be71c2a1faa4..f42bc869ab78abb4f05d36c9a6563c71dfe1ea4f 100644 +index c3387633e7192887d61b871a9af85f1e35a2eecb..c6ee16a347dc10c718c2d277dba1eff76f7edbbf 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -2832,6 +2832,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -2820,6 +2820,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM // Paper end } diff --git a/patches/api/0208-Add-moon-phase-API.patch b/patches/api/0208-Add-moon-phase-API.patch index 68b36e3b64..190c10f508 100644 --- a/patches/api/0208-Add-moon-phase-API.patch +++ b/patches/api/0208-Add-moon-phase-API.patch @@ -47,10 +47,10 @@ index 0000000000000000000000000000000000000000..df05153397b42930cd53d37b30824c7e + } +} diff --git a/src/main/java/org/bukkit/RegionAccessor.java b/src/main/java/org/bukkit/RegionAccessor.java -index 66bc6da2a482bb207ec50beb22fd62aeda90cc34..501dd5a26c27294420821b3d75f8938596afb1a8 100644 +index f53622413ecfb98b79bc59a397e1c7bd27951fb1..2349a935f87122bdda23c78142c810ed8ed80f4f 100644 --- a/src/main/java/org/bukkit/RegionAccessor.java +++ b/src/main/java/org/bukkit/RegionAccessor.java -@@ -421,4 +421,12 @@ public interface RegionAccessor { +@@ -424,4 +424,12 @@ public interface RegionAccessor { * {@link HeightMap} */ public int getHighestBlockYAt(@NotNull Location location, @NotNull HeightMap heightMap); diff --git a/patches/api/0211-Add-methods-to-get-translation-keys.patch b/patches/api/0211-Add-methods-to-get-translation-keys.patch index 96b7bbb309..af7eae5f7a 100644 --- a/patches/api/0211-Add-methods-to-get-translation-keys.patch +++ b/patches/api/0211-Add-methods-to-get-translation-keys.patch @@ -144,19 +144,19 @@ index 753bfcec441533071120d925c83789ef53afa176..c6bc84a8755b2fe5d7d8d3ec857700ec + // Paper end } diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java -index 7705fece7f58bd66f7d68da85f8f34e43b4bae12..6a89eab53f21bc4420e616cc299864fb564e1045 100644 +index e022c70ba53d623053f1c826d57e47fb102dfce0..be4f6fbf013a4259b04f805b4265750bb7fcd0c3 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java -@@ -119,7 +119,7 @@ import org.jetbrains.annotations.Nullable; - * An enum of all material IDs accepted by the official server and client +@@ -122,7 +122,7 @@ import org.jetbrains.annotations.Nullable; + * @deprecated Material was split up into {@link ItemType} and {@link BlockType} */ - @SuppressWarnings({"DeprecatedIsStillUsed", "deprecation"}) // Paper + @Deprecated -public enum Material implements Keyed, Translatable { +public enum Material implements Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper //<editor-fold desc="Materials" defaultstate="collapsed"> AIR(9648, 0), STONE(22948), -@@ -4450,6 +4450,15 @@ public enum Material implements Keyed, Translatable { +@@ -4454,6 +4454,15 @@ public enum Material implements Keyed, Translatable { } return false; } @@ -172,7 +172,7 @@ index 7705fece7f58bd66f7d68da85f8f34e43b4bae12..6a89eab53f21bc4420e616cc299864fb // Paper end /** -@@ -10949,9 +10958,11 @@ public enum Material implements Keyed, Translatable { +@@ -10953,9 +10962,11 @@ public enum Material implements Keyed, Translatable { * material * @see #getBlockTranslationKey() * @see #getItemTranslationKey() @@ -208,59 +208,36 @@ index e3faa2c675c85a9cbdbbb1debec0ff81c58a1bbd..fd1629c2d2028a88fb3d56b0aeb833d1 String getTranslationKey(); } diff --git a/src/main/java/org/bukkit/attribute/Attribute.java b/src/main/java/org/bukkit/attribute/Attribute.java -index 13eac9ad2c1672051635d1c35cc49239252e7a61..107e36ef02a9481954bd770ce9a55a0b1e84be7a 100644 +index adccc6e33447006beefbd6165fe749dad4516852..e9b2f8622683b3293a99b99d77e0d9618e45d682 100644 --- a/src/main/java/org/bukkit/attribute/Attribute.java +++ b/src/main/java/org/bukkit/attribute/Attribute.java -@@ -7,7 +7,7 @@ import org.jetbrains.annotations.NotNull; +@@ -11,7 +11,7 @@ import org.jetbrains.annotations.NotNull; /** * Types of attributes which may be present on an {@link Attributable}. */ --public enum Attribute implements Keyed { -+public enum Attribute implements Keyed, net.kyori.adventure.translation.Translatable { // Paper - Adventure translations +-public abstract class Attribute extends OldEnum<Attribute> implements Keyed { ++public abstract class Attribute extends OldEnum<Attribute> implements Keyed, net.kyori.adventure.translation.Translatable { // Paper - Adventure translations /** * Maximum health of an Entity. -@@ -73,4 +73,10 @@ public enum Attribute implements Keyed { - public NamespacedKey getKey() { - return key; - } -+ // Paper start -+ @Override -+ public @NotNull String translationKey() { -+ return "attribute.name." + this.key.getKey(); -+ } -+ // Paper end - } diff --git a/src/main/java/org/bukkit/block/Biome.java b/src/main/java/org/bukkit/block/Biome.java -index d3087d60378822cdd7cea25fd63d3f496e3cd2fb..5d8fa5b39a5d50cca48ba63af3a84b80f279b649 100644 +index a1e90ed16a9b1daafeb593fec7e894dde383fd52..93c2b0ce11cc16dccb829e57f61f5ca0f417716a 100644 --- a/src/main/java/org/bukkit/block/Biome.java +++ b/src/main/java/org/bukkit/block/Biome.java -@@ -8,7 +8,7 @@ import org.jetbrains.annotations.NotNull; - /** - * Holds all accepted Biomes in the default server +@@ -15,7 +15,7 @@ import org.jetbrains.annotations.NotNull; + * Depending on the server there might be additional biomes present (for example biomes created by data packs), + * which you can get via {@link Registry#BIOME}. */ --public enum Biome implements Keyed { -+public enum Biome implements Keyed, net.kyori.adventure.translation.Translatable { // Paper - OCEAN, - PLAINS, - DESERT, -@@ -89,4 +89,11 @@ public enum Biome implements Keyed { - public NamespacedKey getKey() { - return key; - } -+ -+ // Paper start -+ @Override -+ public @NotNull String translationKey() { -+ return "biome.minecraft." + this.key.getKey(); -+ } -+ // Paper end - } +-public abstract class Biome extends OldEnum<Biome> implements Keyed { ++public abstract class Biome extends OldEnum<Biome> implements Keyed, net.kyori.adventure.translation.Translatable { // Paper + + public static final Biome OCEAN = getBiome("ocean"); + public static final Biome PLAINS = getBiome("plains"); diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java -index 232662f3130ca49156ed8b71acf4495aea33c212..5ae85ddc2cff3145dcba877a7bf55abd818f6881 100644 +index da77f02f164998b0b8905fcf85730deda947d742..bf50f6f1a6cb4f2493fe29d517289913d767ba26 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java -@@ -32,7 +32,7 @@ import org.jetbrains.annotations.Nullable; +@@ -31,7 +31,7 @@ import org.jetbrains.annotations.Nullable; * (i.e. lighting and power) may not be able to be safely accessed during world * generation when used in cases like BlockPhysicsEvent!!!! */ @@ -269,7 +246,7 @@ index 232662f3130ca49156ed8b71acf4495aea33c212..5ae85ddc2cff3145dcba877a7bf55abd /** * Gets the metadata for this block -@@ -673,5 +673,12 @@ public interface Block extends Metadatable, Translatable { +@@ -672,5 +672,12 @@ public interface Block extends Metadatable, Translatable { * @return the sound group for this block */ @NotNull org.bukkit.SoundGroup getBlockSoundGroup(); @@ -282,11 +259,24 @@ index 232662f3130ca49156ed8b71acf4495aea33c212..5ae85ddc2cff3145dcba877a7bf55abd + String getTranslationKey(); // Paper end } +diff --git a/src/main/java/org/bukkit/block/BlockType.java b/src/main/java/org/bukkit/block/BlockType.java +index f39a7fa2e2b70a458e97f727ef8f4c696a859b71..9f77976b2f33ba2d5af89ea143a39a0f417a4429 100644 +--- a/src/main/java/org/bukkit/block/BlockType.java ++++ b/src/main/java/org/bukkit/block/BlockType.java +@@ -109,7 +109,7 @@ import org.bukkit.inventory.ItemType; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + +-public interface BlockType<B extends BlockData> extends Keyed, Translatable { ++public interface BlockType<B extends BlockData> extends Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper - Adventure translations + //<editor-fold desc="BlockTypes" defaultstate="collapsed"> + BlockType<BlockData> AIR = getBlockType("air"); + BlockType<BlockData> STONE = getBlockType("stone"); diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/java/org/bukkit/enchantments/Enchantment.java -index 2dc749936df6168073a5bb9f9051d55f8589ac62..1b6f42ff632b1f3f5034c825e99b72f389a890b4 100644 +index 340a06329e6603fb20d02eda294972fc18508543..0eb240094901b66c118c5a68bc0b2d0396ec6835 100644 --- a/src/main/java/org/bukkit/enchantments/Enchantment.java +++ b/src/main/java/org/bukkit/enchantments/Enchantment.java -@@ -12,7 +12,7 @@ import org.jetbrains.annotations.Nullable; +@@ -13,7 +13,7 @@ import org.jetbrains.annotations.Nullable; /** * The various type of enchantments that may be added to armour or weapons */ @@ -296,10 +286,10 @@ index 2dc749936df6168073a5bb9f9051d55f8589ac62..1b6f42ff632b1f3f5034c825e99b72f3 * Provides protection against environmental damage */ diff --git a/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java b/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java -index 4d5f0837bd0e02a30c943d8969fb6b13452322e0..a39f9c078f42451bd122f3e3729d10ca299bee5f 100644 +index 3f432a055d9fc70e6b16bf87c209be50232f2e93..fa6613efcfcee70507c77ee40460d35c3957d91b 100644 --- a/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java +++ b/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java -@@ -69,5 +69,10 @@ public class EnchantmentWrapper extends Enchantment { +@@ -77,5 +77,10 @@ public class EnchantmentWrapper extends Enchantment { public net.kyori.adventure.text.Component displayName(int level) { return getEnchantment().displayName(level); } @@ -311,68 +301,31 @@ index 4d5f0837bd0e02a30c943d8969fb6b13452322e0..a39f9c078f42451bd122f3e3729d10ca // Paper end } diff --git a/src/main/java/org/bukkit/entity/EntityType.java b/src/main/java/org/bukkit/entity/EntityType.java -index bb9ae81870a340c00d7480aff5106dc2c44dab8a..6c40a989eff1163c19106c1e6b4c8fc01ace7280 100644 +index 9bb9b2d164a027ab8e9e5b05a819c902d5ef2fe4..a086c3472fa12667e5ca9276a201dbd731101602 100644 --- a/src/main/java/org/bukkit/entity/EntityType.java +++ b/src/main/java/org/bukkit/entity/EntityType.java -@@ -22,7 +22,7 @@ import org.jetbrains.annotations.Contract; +@@ -25,7 +25,7 @@ import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; --public enum EntityType implements Keyed, Translatable { -+public enum EntityType implements Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper - translatable +-public abstract class EntityType<E extends Entity> extends OldEnum<EntityType<E>> implements Keyed, Translatable { ++public abstract class EntityType<E extends Entity> extends OldEnum<EntityType<E>> implements Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper - translatable + private static final BiMap<Short, EntityType> ID_MAP = HashBiMap.create(); // These strings MUST match the strings in nms.EntityTypes and are case sensitive. - /** -@@ -435,10 +435,22 @@ public enum EntityType implements Keyed, Translatable { - - @Override - @NotNull -+ @Deprecated(forRemoval = true) // Paper - public String getTranslationKey() { - return Bukkit.getUnsafe().getTranslationKey(this); - } - -+ // Paper start -+ /** -+ * @throws IllegalArgumentException if the entity does not have a translation key (is probably a custom entity) -+ */ -+ @Override -+ public @NotNull String translationKey() { -+ Preconditions.checkArgument(this != UNKNOWN, "UNKNOWN entities do not have translation keys"); -+ return org.bukkit.Bukkit.getUnsafe().getTranslationKey(this); -+ } -+ // Paper end -+ - /** - * 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 d841d94d46462e0ceb7c6b04cc8fc36792bd9201..8c8176121cafed0ed09239b6a7b392dc846438e2 100644 +index 74cc876788674f64ca0451f5fb7c0da23b168d0c..767f940149821a2a31124d3186229deadbb53c67 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 { +@@ -183,7 +183,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, +- public abstract class Profession extends OldEnum<Profession> implements Keyed { ++ public abstract class Profession extends OldEnum<Profession> implements Keyed, net.kyori.adventure.translation.Translatable { // Paper + public static final 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; - } -+ -+ // Paper start -+ @Override -+ public @NotNull String translationKey() { -+ return "entity.minecraft.villager." + this.key.getKey(); -+ } -+ // Paper end - } - - // Paper start - Add villager reputation API diff --git a/src/main/java/org/bukkit/inventory/CreativeCategory.java b/src/main/java/org/bukkit/inventory/CreativeCategory.java index 5bd252c0ae3b09fe141d131360c67bb9bfbf5422..78587d9fabe6371a23a7963917b054dbe7603694 100644 --- a/src/main/java/org/bukkit/inventory/CreativeCategory.java @@ -453,7 +406,7 @@ index 5bd252c0ae3b09fe141d131360c67bb9bfbf5422..78587d9fabe6371a23a7963917b054db + } diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index 3da071798b89e1dd1453f4339af87933cdf0105e..e4ad3a550050c4bf9cc7a2a1082bfdf668050efe 100644 +index 971df4980db6289bd11f661956d8f1d3c52b7822..89fe32de713df3a5f2a25d72cbfe316e5b6c3f1b 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -25,7 +25,7 @@ import org.jetbrains.annotations.Nullable; @@ -462,10 +415,10 @@ index 3da071798b89e1dd1453f4339af87933cdf0105e..e4ad3a550050c4bf9cc7a2a1082bfdf6 */ -public class ItemStack implements Cloneable, ConfigurationSerializable, Translatable, net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowItem> { // Paper +public class ItemStack implements Cloneable, ConfigurationSerializable, Translatable, net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowItem>, net.kyori.adventure.translation.Translatable { // Paper - private Material type = Material.AIR; - private int amount = 0; - private MaterialData data = null; -@@ -606,6 +606,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat + + /** + * Creates a new ItemStack with an amount of 1. +@@ -655,6 +655,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat @Override @NotNull @@ -473,7 +426,7 @@ index 3da071798b89e1dd1453f4339af87933cdf0105e..e4ad3a550050c4bf9cc7a2a1082bfdf6 public String getTranslationKey() { return Bukkit.getUnsafe().getTranslationKey(this); } -@@ -865,5 +866,16 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat +@@ -914,5 +915,16 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat ItemMeta itemMeta = getItemMeta(); return itemMeta != null && itemMeta.hasItemFlag(flag); } @@ -490,3 +443,16 @@ index 3da071798b89e1dd1453f4339af87933cdf0105e..e4ad3a550050c4bf9cc7a2a1082bfdf6 + } // Paper end } +diff --git a/src/main/java/org/bukkit/inventory/ItemType.java b/src/main/java/org/bukkit/inventory/ItemType.java +index ad7f415dcd9ca38c53cae75798d84a74b39ae7de..834c6b0ba732a8f5c2bdb3163a74efb3aa687ba9 100644 +--- a/src/main/java/org/bukkit/inventory/ItemType.java ++++ b/src/main/java/org/bukkit/inventory/ItemType.java +@@ -12,7 +12,7 @@ import org.bukkit.block.BlockType; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + +-public interface ItemType extends Keyed, Translatable { ++public interface ItemType extends Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper - Adventure translations + //<editor-fold desc="ItemTypes" defaultstate="collapsed"> + ItemType AIR = getItemType("air"); + ItemType STONE = getItemType("stone"); diff --git a/patches/api/0212-Create-HoverEvent-from-ItemStack-Entity.patch b/patches/api/0212-Create-HoverEvent-from-ItemStack-Entity.patch index 49e64dc27d..8e1749791f 100644 --- a/patches/api/0212-Create-HoverEvent-from-ItemStack-Entity.patch +++ b/patches/api/0212-Create-HoverEvent-from-ItemStack-Entity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Create HoverEvent from ItemStack Entity diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java -index abf95d917eca248ff3f5a5caa008c1c87fa1e029..11e59068b8a8ef1128e3c75283d161c39e2a3a99 100644 +index bda53b9db7112e82f581af09262d59da8d7769fa..c6f910af4d6e6f2a5afe23a6a86433ac4ff4d68d 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java -@@ -204,5 +204,64 @@ public interface ItemFactory { +@@ -203,5 +203,64 @@ public interface ItemFactory { */ @NotNull ItemStack ensureServerConversions(@NotNull ItemStack item); diff --git a/patches/api/0214-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch b/patches/api/0214-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch index f151559a94..021e3176fa 100644 --- a/patches/api/0214-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch +++ b/patches/api/0214-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Expose the Entity Counter to allow plugins to use valid and diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index beddcb13a598d799c8ae1cec9c01c900e38b1458..eabbe1cd18316948f70e7b56fb80827fdd3672f0 100644 +index f2909100f7abe0a650cc8b2631dddcb26380344a..29d3dccb81f48c6743c01cc875621257752ebea6 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -130,5 +130,12 @@ public interface UnsafeValues { +@@ -139,5 +139,12 @@ public interface UnsafeValues { byte[] serializeItem(ItemStack item); ItemStack deserializeItem(byte[] data); diff --git a/patches/api/0217-Player-elytra-boost-API.patch b/patches/api/0217-Player-elytra-boost-API.patch index 935331d62f..492cfd1927 100644 --- a/patches/api/0217-Player-elytra-boost-API.patch +++ b/patches/api/0217-Player-elytra-boost-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Player elytra boost API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index f42bc869ab78abb4f05d36c9a6563c71dfe1ea4f..e232de8c09397fd7a539f15e326a8344358a7d2a 100644 +index c6ee16a347dc10c718c2d277dba1eff76f7edbbf..873a7bafe2631d012d00eb813889b31ec02d0e30 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -2729,6 +2729,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -2717,6 +2717,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ @NotNull <T> T getClientOption(@NotNull com.destroystokyo.paper.ClientOption<T> option); diff --git a/patches/api/0218-Add-getOfflinePlayerIfCached-String.patch b/patches/api/0218-Add-getOfflinePlayerIfCached-String.patch index 6d5e161e24..251ef86ba9 100644 --- a/patches/api/0218-Add-getOfflinePlayerIfCached-String.patch +++ b/patches/api/0218-Add-getOfflinePlayerIfCached-String.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add getOfflinePlayerIfCached(String) diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 4e5e29251b713885eee562091ea4f253f027bdbb..6d5423f6b6b1aa013a1f77d368058e4cdf2cbe84 100644 +index 690d8584e3f74aae87038b2b8225f28f1b912362..3d52f199c7635e0c89dd6540c7dc0fbf60177d1b 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1248,6 +1248,27 @@ public final class Bukkit { +@@ -1249,6 +1249,27 @@ public final class Bukkit { return server.getOfflinePlayer(name); } @@ -37,10 +37,10 @@ index 4e5e29251b713885eee562091ea4f253f027bdbb..6d5423f6b6b1aa013a1f77d368058e4c * Gets the player by the given UUID, regardless if they are offline or * online. diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 9634d82d603426979cab978f9474cc041e1cb701..f8ef98c9d266e12a3a3f69647cf4d7a9bc633419 100644 +index e8a735a3035fe214889738bd0220dae8b51a9535..94cccd613394b587c6df5b4feea354f883f83e50 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1047,6 +1047,25 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1048,6 +1048,25 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @NotNull public OfflinePlayer getOfflinePlayer(@NotNull String name); diff --git a/patches/api/0219-Add-ignore-discounts-API.patch b/patches/api/0219-Add-ignore-discounts-API.patch index 89655ddef8..8d0894d13a 100644 --- a/patches/api/0219-Add-ignore-discounts-API.patch +++ b/patches/api/0219-Add-ignore-discounts-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add ignore discounts API diff --git a/src/main/java/org/bukkit/inventory/MerchantRecipe.java b/src/main/java/org/bukkit/inventory/MerchantRecipe.java -index d33b66facf36587d703c29e9085289ce919ae621..afaa21b9347683fa373a938d9b1aa01c2058192a 100644 +index abea2a7ae3a2e70faa96038699bbafb494896617..03366a1d84b7037de7af18b057872c65d7a425bf 100644 --- a/src/main/java/org/bukkit/inventory/MerchantRecipe.java +++ b/src/main/java/org/bukkit/inventory/MerchantRecipe.java -@@ -57,6 +57,7 @@ public class MerchantRecipe implements Recipe { +@@ -56,6 +56,7 @@ public class MerchantRecipe implements Recipe { private int demand; private int villagerExperience; private float priceMultiplier; @@ -16,7 +16,7 @@ index d33b66facf36587d703c29e9085289ce919ae621..afaa21b9347683fa373a938d9b1aa01c public MerchantRecipe(@NotNull ItemStack result, int maxUses) { this(result, 0, maxUses, false); -@@ -71,6 +72,15 @@ public class MerchantRecipe implements Recipe { +@@ -70,6 +71,15 @@ public class MerchantRecipe implements Recipe { } public MerchantRecipe(@NotNull ItemStack result, int uses, int maxUses, boolean experienceReward, int villagerExperience, float priceMultiplier, int demand, int specialPrice) { @@ -32,7 +32,7 @@ index d33b66facf36587d703c29e9085289ce919ae621..afaa21b9347683fa373a938d9b1aa01c this.result = result; this.uses = uses; this.maxUses = maxUses; -@@ -283,4 +293,20 @@ public class MerchantRecipe implements Recipe { +@@ -282,4 +292,20 @@ public class MerchantRecipe implements Recipe { public void setPriceMultiplier(float priceMultiplier) { this.priceMultiplier = priceMultiplier; } diff --git a/patches/api/0223-Add-Destroy-Speed-API.patch b/patches/api/0223-Add-Destroy-Speed-API.patch index 6e2512b8b7..515f2fd159 100644 --- a/patches/api/0223-Add-Destroy-Speed-API.patch +++ b/patches/api/0223-Add-Destroy-Speed-API.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add Destroy Speed API Co-authored-by: Jake Potrebic <[email protected]> diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java -index 5ae85ddc2cff3145dcba877a7bf55abd818f6881..546c6709383edb0007b9a8a560af0b64f498dadd 100644 +index bf50f6f1a6cb4f2493fe29d517289913d767ba26..11fd5db6243413b86e5a3a5b8017df988b16d48b 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java -@@ -680,5 +680,29 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr +@@ -679,5 +679,29 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr @NotNull @Deprecated(forRemoval = true) String getTranslationKey(); diff --git a/patches/api/0229-Expose-LivingEntity-hurt-direction.patch b/patches/api/0229-Expose-LivingEntity-hurt-direction.patch index 717b97d228..ecae96fbb7 100644 --- a/patches/api/0229-Expose-LivingEntity-hurt-direction.patch +++ b/patches/api/0229-Expose-LivingEntity-hurt-direction.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Expose LivingEntity hurt direction diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index 94f2c3167f4ce7f5f2b4ecc067739c64af0a2508..4054d2c836342f0e4bcbd33adb13f50daea5086a 100644 +index 629c19ae29ce9b215364e2fca41b1fbb608c0493..1a6b22c41863315ec577fc42996b3264598219bf 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java -@@ -348,6 +348,16 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder +@@ -345,6 +345,16 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder */ - public void setCooldown(@NotNull Material material, int ticks); + public void setCooldown(@NotNull ItemType itemType, int ticks); + // Paper start + /** @@ -26,7 +26,7 @@ index 94f2c3167f4ce7f5f2b4ecc067739c64af0a2508..4054d2c836342f0e4bcbd33adb13f50d * Get the sleep ticks of the player. This value may be capped. * diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index 511a48df780364d054858079273fe408aa0bc749..6a4c54ea92478be6e53b62ebe4e73068b9ed4a29 100644 +index 4809201b15b82bf9526367295de5030b267cb4fa..bae92046540a7446a78114dc69a2236c1af26121 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -997,5 +997,21 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource diff --git a/patches/api/0233-Additional-Block-Material-API-s.patch b/patches/api/0233-Additional-Block-Material-API-s.patch index 91196a2442..7abf22de4b 100644 --- a/patches/api/0233-Additional-Block-Material-API-s.patch +++ b/patches/api/0233-Additional-Block-Material-API-s.patch @@ -9,10 +9,10 @@ process to do this in the Bukkit API Adds API for buildable, replaceable, burnable too. diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java -index 546c6709383edb0007b9a8a560af0b64f498dadd..6c0249863601e8f0fc06828574315a9f0af66e5b 100644 +index 11fd5db6243413b86e5a3a5b8017df988b16d48b..30c7dc35bea310358ba92a8488981fff8132c049 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java -@@ -439,6 +439,42 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr +@@ -438,6 +438,42 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr */ boolean isLiquid(); diff --git a/patches/api/0234-Add-API-to-get-Material-from-Boats-and-Minecarts.patch b/patches/api/0234-Add-API-to-get-Material-from-Boats-and-Minecarts.patch index d297dd5c24..1d418d6e84 100644 --- a/patches/api/0234-Add-API-to-get-Material-from-Boats-and-Minecarts.patch +++ b/patches/api/0234-Add-API-to-get-Material-from-Boats-and-Minecarts.patch @@ -5,26 +5,35 @@ Subject: [PATCH] Add API to get Material from Boats and Minecarts diff --git a/src/main/java/org/bukkit/entity/Boat.java b/src/main/java/org/bukkit/entity/Boat.java -index 88852215d01f3fc4866449f7b826f6603b0ed9d8..f7548098bcdd033d9c530fdc584fc5538c635ca1 100644 +index d6e114107c3990d91b179cd2cc3a8c04d4df0a2a..7410d0ec4f00ae275544ea67a0908df0e9a36ceb 100644 --- a/src/main/java/org/bukkit/entity/Boat.java +++ b/src/main/java/org/bukkit/entity/Boat.java -@@ -175,4 +175,14 @@ public interface Boat extends Vehicle { +@@ -175,4 +175,23 @@ public interface Boat extends Vehicle { ON_LAND, IN_AIR; } + + // Paper start + /** -+ * Gets the {@link Material} that represents this Boat type. ++ * Gets the {@link org.bukkit.Material} that represents this Boat type. + * + * @return the boat material. ++ * @deprecated use {@link #getBoatItem()} + */ + @NotNull -+ public Material getBoatMaterial(); ++ @Deprecated ++ public org.bukkit.Material getBoatMaterial(); ++ ++ /** ++ * Gets the {@link ItemType} that represents this Boat type. ++ * ++ * @return the boat item type ++ */ ++ @NotNull ItemType getBoatItem(); + // Paper end } diff --git a/src/main/java/org/bukkit/entity/Minecart.java b/src/main/java/org/bukkit/entity/Minecart.java -index 7f9c4d4b430a3f0276461346ff2621bacf864075..bc1e62759c995a1463ebcd10d73c7d502c9acc45 100644 +index 177e12108f6108e4858910cef95f72110762b041..320058c7fc7b965ccf134b0686bfaacf8ed8111d 100644 --- a/src/main/java/org/bukkit/entity/Minecart.java +++ b/src/main/java/org/bukkit/entity/Minecart.java @@ -1,5 +1,6 @@ diff --git a/patches/api/0243-Add-API-to-get-exact-interaction-point-in-PlayerInte.patch b/patches/api/0243-Add-API-to-get-exact-interaction-point-in-PlayerInte.patch index afc3f45d28..1935381bab 100644 --- a/patches/api/0243-Add-API-to-get-exact-interaction-point-in-PlayerInte.patch +++ b/patches/api/0243-Add-API-to-get-exact-interaction-point-in-PlayerInte.patch @@ -5,16 +5,16 @@ Subject: [PATCH] Add API to get exact interaction point in PlayerInteractEvent diff --git a/src/main/java/org/bukkit/event/player/PlayerInteractEvent.java b/src/main/java/org/bukkit/event/player/PlayerInteractEvent.java -index 1208e1f8c2163d83c5b12bbb9b7ac044c72380e0..a01f86e6aba8b66ecc713da0787cd861e2930a2a 100644 +index f5bb9eb36d810d2ad988b71951b4029c70704287..16a0d738706b7aac1490a875a7052ce5490c6655 100644 --- a/src/main/java/org/bukkit/event/player/PlayerInteractEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerInteractEvent.java @@ -1,5 +1,6 @@ package org.bukkit.event.player; +import org.bukkit.Location; - import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; + import org.bukkit.entity.Player; @@ -34,22 +35,30 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable { private Result useClickedBlock; private Result useItemInHand; diff --git a/patches/api/0244-Add-sendOpLevel-API.patch b/patches/api/0244-Add-sendOpLevel-API.patch index 5ba481a68d..551dc69c36 100644 --- a/patches/api/0244-Add-sendOpLevel-API.patch +++ b/patches/api/0244-Add-sendOpLevel-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add sendOpLevel API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index e232de8c09397fd7a539f15e326a8344358a7d2a..4e8f58d57d0273ef6a9ed75cdf195149dea44df7 100644 +index 873a7bafe2631d012d00eb813889b31ec02d0e30..48f55ea0db1bd9ac24e44b1f1fa83ea58609fd48 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -2742,6 +2742,17 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -2730,6 +2730,17 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ @Nullable Firework boostElytra(@NotNull ItemStack firework); diff --git a/patches/api/0246-Add-StructuresLocateEvent.patch b/patches/api/0246-Add-StructuresLocateEvent.patch index 51a892b911..13d19600c8 100644 --- a/patches/api/0246-Add-StructuresLocateEvent.patch +++ b/patches/api/0246-Add-StructuresLocateEvent.patch @@ -505,13 +505,13 @@ index 0000000000000000000000000000000000000000..1e7b53f9bc13dcd5a0a4a40004591e4f + } +} diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java -index 09e3c2872462da546b891cbc396aaffb77f6aadf..c21aefb63678d78a441436761373e9710c1e543a 100644 +index e84b3e488003bff973b77cec08f7429fce6364fa..413156927cfea8e73f9f3475e1a0da99169b8d4d 100644 --- a/src/main/java/org/bukkit/Registry.java +++ b/src/main/java/org/bukkit/Registry.java -@@ -228,6 +228,15 @@ public interface Registry<T extends Keyed> extends Iterable<T> { - return GameEvent.getByKey(key); - } - }; +@@ -259,6 +259,16 @@ public interface Registry<T extends Keyed> extends Iterable<T> { + */ + Registry<PotionEffectType> POTION_EFFECT_TYPE = Objects.requireNonNull(Bukkit.getRegistry(PotionEffectType.class), "No registry present for Potion Effect Type. This is a bug."); + + // Paper start + /** + * Configured structures. @@ -519,8 +519,9 @@ index 09e3c2872462da546b891cbc396aaffb77f6aadf..c21aefb63678d78a441436761373e971 + * @deprecated use {@link #STRUCTURE} + */ + @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 = Objects.requireNonNull(Bukkit.getRegistry(io.papermc.paper.world.structure.ConfiguredStructure.class), "No registry present for Configured Structure. This is a bug."); + // Paper end - ++ /** * Get the object by its key. + * diff --git a/patches/api/0248-Added-missing-vanilla-tags.patch b/patches/api/0248-Added-missing-vanilla-tags.patch index 0b81d3e855..1ab924744a 100644 --- a/patches/api/0248-Added-missing-vanilla-tags.patch +++ b/patches/api/0248-Added-missing-vanilla-tags.patch @@ -5,18 +5,18 @@ Subject: [PATCH] Added missing vanilla tags diff --git a/src/main/java/org/bukkit/Tag.java b/src/main/java/org/bukkit/Tag.java -index 82d34e9aae42dfafd900dc0e610bf1dc82a5a6f3..3e9f1ee242b8087759c98b54ebb3cc3b8f5fcbd5 100644 +index bbf7dd8ca90ba1c3626e87ca221201568163101f..974dcacb09ec05c98a4a6af28f86694b97b9c925 100644 --- a/src/main/java/org/bukkit/Tag.java +++ b/src/main/java/org/bukkit/Tag.java -@@ -759,6 +759,12 @@ public interface Tag<T extends Keyed> extends Keyed { +@@ -761,6 +761,12 @@ public interface Tag<T extends Keyed> extends Keyed { * Vanilla item tag representing all chest boat items. */ - Tag<Material> ITEMS_CHEST_BOATS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("chest_boats"), Material.class); + Tag<ItemType> ITEMS_CHEST_BOATS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("chest_boats"), ItemType.class); + // Paper start + /** + * Vanilla item tag representing all non-flammable wood items. + */ -+ Tag<Material> ITEMS_NON_FLAMMABLE_WOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("non_flammable_wood"), Material.class); ++ Tag<ItemType> ITEMS_NON_FLAMMABLE_WOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("non_flammable_wood"), ItemType.class); + // Paper end /** * Vanilla item tag representing all fish items. diff --git a/patches/api/0257-Add-missing-effects.patch b/patches/api/0257-Add-missing-effects.patch index 1a3589e272..31474be3db 100644 --- a/patches/api/0257-Add-missing-effects.patch +++ b/patches/api/0257-Add-missing-effects.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add missing effects diff --git a/src/main/java/org/bukkit/Effect.java b/src/main/java/org/bukkit/Effect.java -index 879d637691683ca862045402f74b751a892bf3ff..3ae64e7e42338a2a550917ccd01d755a1ba0bf03 100644 +index 7dc00d1ab2e845ef57c650faea77363023964712..1c7dd6f7e2eff67a025461ef0119037ddf0e0073 100644 --- a/src/main/java/org/bukkit/Effect.java +++ b/src/main/java/org/bukkit/Effect.java -@@ -337,7 +337,100 @@ public enum Effect { +@@ -339,7 +339,100 @@ public enum Effect { * block. */ OXIDISED_COPPER_SCRAPE(3005, Type.VISUAL), @@ -109,7 +109,7 @@ index 879d637691683ca862045402f74b751a892bf3ff..3ae64e7e42338a2a550917ccd01d755a private final int id; private final Type type; -@@ -397,10 +490,22 @@ public enum Effect { +@@ -399,10 +492,22 @@ public enum Effect { static { for (Effect effect : values()) { diff --git a/patches/api/0259-Cache-the-result-of-Material-isBlock.patch b/patches/api/0259-Cache-the-result-of-Material-isBlock.patch index 49dab657f2..28a7d822c4 100644 --- a/patches/api/0259-Cache-the-result-of-Material-isBlock.patch +++ b/patches/api/0259-Cache-the-result-of-Material-isBlock.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Cache the result of Material#isBlock diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java -index 6a89eab53f21bc4420e616cc299864fb564e1045..37898f36f859eda945471fa9b00fcabbc3d211df 100644 +index be4f6fbf013a4259b04f805b4265750bb7fcd0c3..ffcb8e24a553f0cd81ec8c48511f28d284dbbd42 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java -@@ -4394,6 +4394,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla +@@ -4397,6 +4397,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla public final Class<?> data; private final boolean legacy; private final NamespacedKey key; @@ -16,7 +16,7 @@ index 6a89eab53f21bc4420e616cc299864fb564e1045..37898f36f859eda945471fa9b00fcabb private Material(final int id) { this(id, 64); -@@ -4592,6 +4593,11 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla +@@ -4596,6 +4597,11 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla * @return true if this material is a block */ public boolean isBlock() { @@ -28,7 +28,7 @@ index 6a89eab53f21bc4420e616cc299864fb564e1045..37898f36f859eda945471fa9b00fcabb switch (this) { //<editor-fold defaultstate="collapsed" desc="isBlock"> case ACACIA_BUTTON: -@@ -5778,6 +5784,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla +@@ -5782,6 +5788,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla static { for (Material material : values()) { BY_NAME.put(material.name(), material); diff --git a/patches/api/0263-Add-Block-isValidTool.patch b/patches/api/0263-Add-Block-isValidTool.patch index 182e364647..23731371d6 100644 --- a/patches/api/0263-Add-Block-isValidTool.patch +++ b/patches/api/0263-Add-Block-isValidTool.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Block#isValidTool diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java -index 6c0249863601e8f0fc06828574315a9f0af66e5b..93b9b57c95a0d24e885a205cd9d9e05a5631806a 100644 +index 30c7dc35bea310358ba92a8488981fff8132c049..6f6d7816f4e928e849e6e4f7265c977437ccf1bf 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java -@@ -230,6 +230,15 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr +@@ -229,6 +229,15 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr public static int getBlockKeyZ(long packed) { return (int) ((packed << 10) >> 37); } diff --git a/patches/api/0264-Expand-world-key-API.patch b/patches/api/0264-Expand-world-key-API.patch index 1908ecc58e..4e1b268119 100644 --- a/patches/api/0264-Expand-world-key-API.patch +++ b/patches/api/0264-Expand-world-key-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expand world key API diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 6d5423f6b6b1aa013a1f77d368058e4cdf2cbe84..be32ddb8ad5d6290b76cb520d159d456ed16f1b1 100644 +index 3d52f199c7635e0c89dd6540c7dc0fbf60177d1b..ebe6ba1f62a8538f5a1115248e87b80285368543 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -830,6 +830,18 @@ public final class Bukkit { +@@ -831,6 +831,18 @@ public final class Bukkit { public static World getWorld(@NotNull UUID uid) { return server.getWorld(uid); } @@ -28,10 +28,10 @@ index 6d5423f6b6b1aa013a1f77d368058e4cdf2cbe84..be32ddb8ad5d6290b76cb520d159d456 /** * Create a new virtual {@link WorldBorder}. diff --git a/src/main/java/org/bukkit/RegionAccessor.java b/src/main/java/org/bukkit/RegionAccessor.java -index 501dd5a26c27294420821b3d75f8938596afb1a8..71ef9b479888aa83455757560b60745572c7196d 100644 +index 2349a935f87122bdda23c78142c810ed8ed80f4f..7c4cfc274ab7840d2474498b3e5d9251d6e731e9 100644 --- a/src/main/java/org/bukkit/RegionAccessor.java +++ b/src/main/java/org/bukkit/RegionAccessor.java -@@ -19,7 +19,7 @@ import org.jetbrains.annotations.Nullable; +@@ -20,7 +20,7 @@ import org.jetbrains.annotations.Nullable; * A RegionAccessor gives access to getting, modifying and spawning {@link Biome}, {@link BlockState} and {@link Entity}, * as well as generating some basic structures. */ @@ -40,7 +40,7 @@ index 501dd5a26c27294420821b3d75f8938596afb1a8..71ef9b479888aa83455757560b607455 /** * Gets the {@link Biome} at the given {@link Location}. -@@ -428,5 +428,14 @@ public interface RegionAccessor { +@@ -431,5 +431,14 @@ public interface RegionAccessor { */ @NotNull io.papermc.paper.world.MoonPhase getMoonPhase(); @@ -56,10 +56,10 @@ index 501dd5a26c27294420821b3d75f8938596afb1a8..71ef9b479888aa83455757560b607455 // Paper end } diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index f8ef98c9d266e12a3a3f69647cf4d7a9bc633419..d1d035ee86264b38b6bb50135d031946daf25a00 100644 +index 94cccd613394b587c6df5b4feea354f883f83e50..3678de1b963dfb61de487b63ebf4dddd18ff8a34 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -694,6 +694,17 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -695,6 +695,17 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @Nullable public World getWorld(@NotNull UUID uid); @@ -78,10 +78,10 @@ index f8ef98c9d266e12a3a3f69647cf4d7a9bc633419..d1d035ee86264b38b6bb50135d031946 * Create a new virtual {@link WorldBorder}. * <p> diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index eabbe1cd18316948f70e7b56fb80827fdd3672f0..a00d93eee9710bb0fdf0fb791ef1a9262f89ef60 100644 +index 29d3dccb81f48c6743c01cc875621257752ebea6..413085e6793a17762685198a5416cc3dfcc88995 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -137,5 +137,10 @@ public interface UnsafeValues { +@@ -146,5 +146,10 @@ public interface UnsafeValues { * Use this when sending custom packets, so that there are no collisions on the client or server. */ public int nextEntityId(); diff --git a/patches/api/0265-Item-Rarity-API.patch b/patches/api/0265-Item-Rarity-API.patch index 5c25c66d65..489c4f72f1 100644 --- a/patches/api/0265-Item-Rarity-API.patch +++ b/patches/api/0265-Item-Rarity-API.patch @@ -39,10 +39,10 @@ index 0000000000000000000000000000000000000000..74ef8395cc040ce488c2acaa416db202 + } +} diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java -index 37898f36f859eda945471fa9b00fcabbc3d211df..85d19b0c659c75472aa91d18fdf17f25bd6a2e04 100644 +index ffcb8e24a553f0cd81ec8c48511f28d284dbbd42..d6c3c6b320e4996dfbc185d594d94efbedf453c9 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java -@@ -4460,6 +4460,17 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla +@@ -4464,6 +4464,20 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla return Bukkit.getUnsafe().getBlockTranslationKey(this); } } @@ -52,33 +52,27 @@ index 37898f36f859eda945471fa9b00fcabbc3d211df..85d19b0c659c75472aa91d18fdf17f25 + * Use {@link #isItem()} before this. + * + * @return the item rarity ++ * @deprecated use {@link ItemType#getItemRarity()} + */ ++ @Deprecated + @NotNull + public io.papermc.paper.inventory.ItemRarity getItemRarity() { -+ return Bukkit.getUnsafe().getItemRarity(this); ++ Preconditions.checkArgument(this.isItem(), this + " must be an item"); ++ return this.asItemType().getItemRarity(); + } // Paper end /** diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index a00d93eee9710bb0fdf0fb791ef1a9262f89ef60..f79784e1823f646181a434a6dbce3bac0eaf25c9 100644 +index 413085e6793a17762685198a5416cc3dfcc88995..4fbb9153c34ef95170e62e4e519ce4ea2e685558 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -142,5 +142,22 @@ public interface UnsafeValues { +@@ -151,5 +151,13 @@ public interface UnsafeValues { * Just don't use it. */ @org.jetbrains.annotations.NotNull String getMainLevelName(); + + /** -+ * Gets the item rarity of a material. The material <b>MUST</b> be an item. -+ * Use {@link Material#isItem()} before this. -+ * -+ * @param material the material to get the rarity of -+ * @return the item rarity -+ */ -+ public io.papermc.paper.inventory.ItemRarity getItemRarity(Material material); -+ -+ /** + * Gets the item rarity of the itemstack. The rarity can change based on enchantements. + * + * @param itemStack the itemstack to get the rarity of @@ -88,10 +82,10 @@ index a00d93eee9710bb0fdf0fb791ef1a9262f89ef60..f79784e1823f646181a434a6dbce3bac // Paper end } diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index e4ad3a550050c4bf9cc7a2a1082bfdf668050efe..4f867ba2bc9b1a7c277e4a5f0ea8b452315f3272 100644 +index 89fe32de713df3a5f2a25d72cbfe316e5b6c3f1b..d4bc360cf7f0b0fbed07dc10b5778605fde7c219 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java -@@ -877,5 +877,15 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat +@@ -926,5 +926,15 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat public @NotNull String translationKey() { return Bukkit.getUnsafe().getTranslationKey(this); } @@ -107,3 +101,22 @@ index e4ad3a550050c4bf9cc7a2a1082bfdf668050efe..4f867ba2bc9b1a7c277e4a5f0ea8b452 + } // Paper end } +diff --git a/src/main/java/org/bukkit/inventory/ItemType.java b/src/main/java/org/bukkit/inventory/ItemType.java +index 834c6b0ba732a8f5c2bdb3163a74efb3aa687ba9..27a1d255b8fcbd6487e4d4eb1abf784b43eaf90e 100644 +--- a/src/main/java/org/bukkit/inventory/ItemType.java ++++ b/src/main/java/org/bukkit/inventory/ItemType.java +@@ -1371,4 +1371,14 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans + */ + @Nullable + CreativeCategory getCreativeCategory(); ++ ++ // Paper start - Item Rarity API ++ /** ++ * Returns the item rarity for the item. ++ * ++ * @return the item rarity ++ */ ++ @NotNull ++ io.papermc.paper.inventory.ItemRarity getItemRarity(); ++ // Paper end + } diff --git a/patches/api/0267-add-isDeeplySleeping-to-HumanEntity.patch b/patches/api/0267-add-isDeeplySleeping-to-HumanEntity.patch index fc6f6dcab3..e7c32c835c 100644 --- a/patches/api/0267-add-isDeeplySleeping-to-HumanEntity.patch +++ b/patches/api/0267-add-isDeeplySleeping-to-HumanEntity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] add isDeeplySleeping to HumanEntity diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index 4054d2c836342f0e4bcbd33adb13f50daea5086a..ff1ebe184ba5a1bdc8e2784025b07d3bb90a5078 100644 +index 1a6b22c41863315ec577fc42996b3264598219bf..c7757f4de66cd6d136266a15801fe31e9d61538e 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java -@@ -358,6 +358,15 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder +@@ -355,6 +355,15 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder void setHurtDirection(float hurtDirection); // Paper end diff --git a/patches/api/0271-More-World-API.patch b/patches/api/0271-More-World-API.patch index 5567e22dc7..78e492ca6e 100644 --- a/patches/api/0271-More-World-API.patch +++ b/patches/api/0271-More-World-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] More World API diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 0c5ce79c04e8193db248a221f519d80a944ef6ba..fff4d89e978bd0050a298ab8f43401b6c600e5a2 100644 +index f5845d33dc3512573396f7784af9f7265356fce8..c63832afe080bf1cd5f66cf375079ed779c47ffb 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -3716,6 +3716,114 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient +@@ -3701,6 +3701,114 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient @Nullable StructureSearchResult locateNearestStructure(@NotNull Location origin, @NotNull Structure structure, int radius, boolean findUnexplored); diff --git a/patches/api/0273-Introduce-beacon-activation-deactivation-events.patch b/patches/api/0273-Introduce-beacon-activation-deactivation-events.patch index c2f0577191..8f63bc98be 100644 --- a/patches/api/0273-Introduce-beacon-activation-deactivation-events.patch +++ b/patches/api/0273-Introduce-beacon-activation-deactivation-events.patch @@ -52,15 +52,15 @@ index 0000000000000000000000000000000000000000..7575ca7dd84dee89528ec2e5e5f99f97 +} diff --git a/src/main/java/io/papermc/paper/event/block/BeaconDeactivatedEvent.java b/src/main/java/io/papermc/paper/event/block/BeaconDeactivatedEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..34f18468b4cfc08717cc3442778c9e85124e5a22 +index 0000000000000000000000000000000000000000..46fd5eac7b6b1eb73016fdc1dfd97aa752450496 --- /dev/null +++ b/src/main/java/io/papermc/paper/event/block/BeaconDeactivatedEvent.java @@ -0,0 +1,43 @@ +package io.papermc.paper.event.block; + -+import org.bukkit.Material; +import org.bukkit.block.Beacon; +import org.bukkit.block.Block; ++import org.bukkit.block.BlockType; +import org.bukkit.event.HandlerList; +import org.bukkit.event.block.BlockEvent; +import org.jetbrains.annotations.NotNull; @@ -70,7 +70,7 @@ index 0000000000000000000000000000000000000000..34f18468b4cfc08717cc3442778c9e85 + * Called when a beacon is deactivated, either because its base block(s) or itself were destroyed. + */ +public class BeaconDeactivatedEvent extends BlockEvent { -+ private static final HandlerList handlers = new HandlerList(); ++ private static final HandlerList HANDLER_LIST = new HandlerList(); + + public BeaconDeactivatedEvent(@NotNull Block block) { + super(block); @@ -85,17 +85,17 @@ index 0000000000000000000000000000000000000000..34f18468b4cfc08717cc3442778c9e85 + */ + @Nullable + public Beacon getBeacon() { -+ return block.getType() == Material.BEACON ? (Beacon) block.getState() : null; ++ return this.block.getType() == BlockType.BEACON ? (Beacon) this.block.getState() : null; + } + + @NotNull + @Override + public HandlerList getHandlers() { -+ return handlers; ++ return HANDLER_LIST; + } + + @NotNull + public static HandlerList getHandlerList() { -+ return handlers; ++ return HANDLER_LIST; + } +} diff --git a/patches/api/0280-Inventory-close.patch b/patches/api/0280-Inventory-close.patch index 87dfa1a083..fb4e9602ab 100644 --- a/patches/api/0280-Inventory-close.patch +++ b/patches/api/0280-Inventory-close.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Inventory#close diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java -index 129b5ab5062beeb9bb52465a788bc3a3aee9c49e..0d519813c12d98b28d62e6d01d7ec6e8c2dba3c3 100644 +index af6bfacd5f209e75b7c5f37201c3ba9e8e74d885..f4f4c7a0837d2a9a5390fc76ca2054962f5923c1 100644 --- a/src/main/java/org/bukkit/inventory/Inventory.java +++ b/src/main/java/org/bukkit/inventory/Inventory.java -@@ -355,6 +355,15 @@ public interface Inventory extends Iterable<ItemStack> { +@@ -354,6 +354,15 @@ public interface Inventory extends Iterable<ItemStack> { */ public void clear(); diff --git a/patches/api/0282-Add-basic-Datapack-API.patch b/patches/api/0282-Add-basic-Datapack-API.patch index 0582d74ff9..060f097eb8 100644 --- a/patches/api/0282-Add-basic-Datapack-API.patch +++ b/patches/api/0282-Add-basic-Datapack-API.patch @@ -70,10 +70,10 @@ index 0000000000000000000000000000000000000000..58f78d5e91beacaf710f62461cf869f7 + +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index be32ddb8ad5d6290b76cb520d159d456ed16f1b1..a6fef51a8435eced8c2981588ae98046c42d8ed4 100644 +index ebe6ba1f62a8538f5a1115248e87b80285368543..a345ea2f9a7cdb30df07aab305e2bb42100bab63 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -316,9 +316,11 @@ public final class Bukkit { +@@ -317,9 +317,11 @@ public final class Bukkit { /** * Get the DataPack Manager. * @@ -85,7 +85,7 @@ index be32ddb8ad5d6290b76cb520d159d456ed16f1b1..a6fef51a8435eced8c2981588ae98046 public static DataPackManager getDataPackManager() { return server.getDataPackManager(); } -@@ -2423,6 +2425,14 @@ public final class Bukkit { +@@ -2427,6 +2429,14 @@ public final class Bukkit { public static com.destroystokyo.paper.entity.ai.MobGoals getMobGoals() { return server.getMobGoals(); } @@ -101,10 +101,10 @@ index be32ddb8ad5d6290b76cb520d159d456ed16f1b1..a6fef51a8435eced8c2981588ae98046 @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index d1d035ee86264b38b6bb50135d031946daf25a00..529054834865813520ebe6784894e759c22ec4f4 100644 +index 3678de1b963dfb61de487b63ebf4dddd18ff8a34..90129c2d9141969241dcc483b82290df64844c0c 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -254,9 +254,11 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -255,9 +255,11 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi /** * Get the DataPack Manager. * @@ -116,7 +116,7 @@ index d1d035ee86264b38b6bb50135d031946daf25a00..529054834865813520ebe6784894e759 public DataPackManager getDataPackManager(); /** -@@ -2110,5 +2112,11 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -2114,5 +2116,11 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi */ @NotNull com.destroystokyo.paper.entity.ai.MobGoals getMobGoals(); @@ -144,7 +144,7 @@ index 744d8c055b0e643e2e0d12218af4ef856f56340f..2ac72913e2a5b70eb98a4f25f865855b /** diff --git a/src/main/java/org/bukkit/packs/DataPackManager.java b/src/main/java/org/bukkit/packs/DataPackManager.java -index d7fb6310e6b1050c496d748388310bc6f8d78e23..2cd505046277febe010e9476539b064321d8b2ec 100644 +index 764daa5d8da4618bdb6146e317e2d822c9b7934e..f48c6faa96a1331af183c217c5d6aa8ba596f843 100644 --- a/src/main/java/org/bukkit/packs/DataPackManager.java +++ b/src/main/java/org/bukkit/packs/DataPackManager.java @@ -11,8 +11,10 @@ import org.jetbrains.annotations.Nullable; diff --git a/patches/api/0284-ItemStack-repair-check-API.patch b/patches/api/0284-ItemStack-repair-check-API.patch index d35e2fa9ad..2ef45489f9 100644 --- a/patches/api/0284-ItemStack-repair-check-API.patch +++ b/patches/api/0284-ItemStack-repair-check-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] ItemStack repair check API diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index a27e14e00d759d6c15530ef038bcf4b5cbd9f120..00e61ab3103c86c9aabcdfa2fd4c565adcc091da 100644 +index 5a5e5bd70322700c92fd8caf781dab662643c824..b134d63351faa0d6e5469e0a09442ab82f8d60e3 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java @@ -160,6 +160,16 @@ public interface UnsafeValues { @@ -26,10 +26,10 @@ index a27e14e00d759d6c15530ef038bcf4b5cbd9f120..00e61ab3103c86c9aabcdfa2fd4c565a * Returns the server's protocol version. * diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index 4f867ba2bc9b1a7c277e4a5f0ea8b452315f3272..2d945516ec65ffe103479aea218b3002cc572dc1 100644 +index d4bc360cf7f0b0fbed07dc10b5778605fde7c219..99768256af87b72b3366898278b52acef4ae4ded 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java -@@ -887,5 +887,27 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat +@@ -936,5 +936,27 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat public io.papermc.paper.inventory.ItemRarity getRarity() { return Bukkit.getUnsafe().getItemStackRarity(this); } diff --git a/patches/api/0285-More-Enchantment-API.patch b/patches/api/0285-More-Enchantment-API.patch index 0ccfe049b4..1b41d8b400 100644 --- a/patches/api/0285-More-Enchantment-API.patch +++ b/patches/api/0285-More-Enchantment-API.patch @@ -35,10 +35,10 @@ index 0000000000000000000000000000000000000000..e6a40c1fcea761bd66743b50e3da3d14 + } +} diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/java/org/bukkit/enchantments/Enchantment.java -index 1b6f42ff632b1f3f5034c825e99b72f389a890b4..4cfe8501368f601fdd4203570f4e6a8f6f9685e6 100644 +index 0eb240094901b66c118c5a68bc0b2d0396ec6835..5fa52263028f983bc6ba79cc47f6f71709fb117c 100644 --- a/src/main/java/org/bukkit/enchantments/Enchantment.java +++ b/src/main/java/org/bukkit/enchantments/Enchantment.java -@@ -273,11 +273,7 @@ public abstract class Enchantment implements Keyed, net.kyori.adventure.translat +@@ -267,11 +267,7 @@ public abstract class Enchantment implements Keyed, net.kyori.adventure.translat * Cursed enchantments are found the same way treasure enchantments are * * @return true if the enchantment is cursed @@ -50,7 +50,7 @@ index 1b6f42ff632b1f3f5034c825e99b72f389a890b4..4cfe8501368f601fdd4203570f4e6a8f public abstract boolean isCursed(); /** -@@ -311,6 +307,46 @@ public abstract class Enchantment implements Keyed, net.kyori.adventure.translat +@@ -305,6 +301,46 @@ public abstract class Enchantment implements Keyed, net.kyori.adventure.translat * @return the name of the enchantment with {@code level} applied */ public abstract net.kyori.adventure.text.@NotNull Component displayName(int level); @@ -96,12 +96,12 @@ index 1b6f42ff632b1f3f5034c825e99b72f389a890b4..4cfe8501368f601fdd4203570f4e6a8f + public abstract java.util.Set<org.bukkit.inventory.EquipmentSlot> getActiveSlots(); // Paper end - @Override + /** diff --git a/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java b/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java -index a39f9c078f42451bd122f3e3729d10ca299bee5f..5f42a9c0c43ced10b754170d7c83793a99fce81b 100644 +index fa6613efcfcee70507c77ee40460d35c3957d91b..bfdac08bfcb83b20397675066e48ae2572277ada 100644 --- a/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java +++ b/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java -@@ -74,5 +74,32 @@ public class EnchantmentWrapper extends Enchantment { +@@ -82,5 +82,32 @@ public class EnchantmentWrapper extends Enchantment { public @NotNull String translationKey() { return getEnchantment().translationKey(); } diff --git a/patches/api/0287-ItemStack-editMeta.patch b/patches/api/0287-ItemStack-editMeta.patch index 7893a035c9..f26d30a2e3 100644 --- a/patches/api/0287-ItemStack-editMeta.patch +++ b/patches/api/0287-ItemStack-editMeta.patch @@ -5,10 +5,10 @@ Subject: [PATCH] ItemStack#editMeta diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index 2d945516ec65ffe103479aea218b3002cc572dc1..f9faef1b73b5027a3d22e76a0b33b7c952f3ae08 100644 +index 99768256af87b72b3366898278b52acef4ae4ded..3a5d5968f1c3b75292c06606733c9f449d6b550f 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java -@@ -547,6 +547,50 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat +@@ -596,6 +596,50 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat return result.ensureServerConversions(); // Paper } diff --git a/patches/api/0289-Attributes-API-for-item-defaults.patch b/patches/api/0289-Attributes-API-for-item-defaults.patch index abd3dd1e69..41876b8b3e 100644 --- a/patches/api/0289-Attributes-API-for-item-defaults.patch +++ b/patches/api/0289-Attributes-API-for-item-defaults.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Attributes API for item defaults diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java -index 85d19b0c659c75472aa91d18fdf17f25bd6a2e04..5fe8207fd9b76564b0547eec5e3db2b7abed0150 100644 +index d6c3c6b320e4996dfbc185d594d94efbedf453c9..8c900d455d37713ec6395caafa752bf8e2e89c58 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java -@@ -4471,6 +4471,21 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla - public io.papermc.paper.inventory.ItemRarity getItemRarity() { - return Bukkit.getUnsafe().getItemRarity(this); +@@ -4478,6 +4478,21 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla + Preconditions.checkArgument(this.isItem(), this + " must be an item"); + return this.asItemType().getItemRarity(); } + + /** @@ -25,31 +25,8 @@ index 85d19b0c659c75472aa91d18fdf17f25bd6a2e04..5fe8207fd9b76564b0547eec5e3db2b7 + @NotNull + @Deprecated + public Multimap<Attribute, AttributeModifier> getItemAttributes(@NotNull EquipmentSlot equipmentSlot) { -+ return Bukkit.getUnsafe().getItemAttributes(this, equipmentSlot); ++ return this.getDefaultAttributeModifiers(equipmentSlot); + } // Paper end /** -diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index 00e61ab3103c86c9aabcdfa2fd4c565adcc091da..a9e7c64e1f98ff73c1804466d7c79eaf343dde7c 100644 ---- a/src/main/java/org/bukkit/UnsafeValues.java -+++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -170,6 +170,18 @@ public interface UnsafeValues { - */ - public boolean isValidRepairItemStack(@org.jetbrains.annotations.NotNull ItemStack itemToBeRepaired, @org.jetbrains.annotations.NotNull ItemStack repairMaterial); - -+ /** -+ * Returns an immutable multimap of attributes for the material and slot. -+ * {@link Material#isItem()} must be true for this material. -+ * -+ * @param material the material -+ * @param equipmentSlot the slot to get the attributes for -+ * @throws IllegalArgumentException if {@link Material#isItem()} is false -+ * @return an immutable multimap of attributes -+ */ -+ @org.jetbrains.annotations.NotNull -+ public Multimap<Attribute, AttributeModifier> getItemAttributes(@org.jetbrains.annotations.NotNull Material material, @org.jetbrains.annotations.NotNull EquipmentSlot equipmentSlot); -+ - /** - * Returns the server's protocol version. - * diff --git a/patches/api/0296-Add-more-line-of-sight-methods.patch b/patches/api/0296-Add-more-line-of-sight-methods.patch index f8182b74f7..4a5b35d021 100644 --- a/patches/api/0296-Add-more-line-of-sight-methods.patch +++ b/patches/api/0296-Add-more-line-of-sight-methods.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add more line of sight methods diff --git a/src/main/java/org/bukkit/RegionAccessor.java b/src/main/java/org/bukkit/RegionAccessor.java -index 71ef9b479888aa83455757560b60745572c7196d..cd83348de3f82b3fddcf2d4bb9187ec8173b0e40 100644 +index 7c4cfc274ab7840d2474498b3e5d9251d6e731e9..78396b7f754641de520f95d2015a9c6f1d933e7f 100644 --- a/src/main/java/org/bukkit/RegionAccessor.java +++ b/src/main/java/org/bukkit/RegionAccessor.java -@@ -437,5 +437,13 @@ public interface RegionAccessor extends Keyed { // Paper +@@ -440,5 +440,13 @@ public interface RegionAccessor extends Keyed { // Paper @NotNull @Override NamespacedKey getKey(); @@ -23,7 +23,7 @@ index 71ef9b479888aa83455757560b60745572c7196d..cd83348de3f82b3fddcf2d4bb9187ec8 // Paper end } diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index 6a4c54ea92478be6e53b62ebe4e73068b9ed4a29..626eb1796d5a19d110855e2fb95cb4c761ecc544 100644 +index bae92046540a7446a78114dc69a2236c1af26121..9ad0464661d1c44409a98bad13edc23ca5f721b8 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -546,6 +546,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource diff --git a/patches/api/0299-Missing-Entity-Behavior-API.patch b/patches/api/0299-Missing-Entity-Behavior-API.patch index ee75b4ff48..b605e08d90 100644 --- a/patches/api/0299-Missing-Entity-Behavior-API.patch +++ b/patches/api/0299-Missing-Entity-Behavior-API.patch @@ -241,12 +241,12 @@ 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 c2a566b864c82ffb094b7334d9e6e25a1bfc87d1..c340fecb61bac66baf0f44189d21bc85289b1269 100644 +index a541d9618ecdf86dcfdbe1a10e2d774d9d71d644..94fef2c823eb340fe02d18e24e67b4aa97c3b83c 100644 --- a/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 { - JELLIE, - ALL_BLACK; +@@ -91,4 +91,36 @@ public interface Cat extends Tameable, Sittable { + return Lists.newArrayList(Registry.CAT_TYPE).toArray(new Type[0]); + } } + + // Paper Start - More cat api @@ -711,13 +711,13 @@ index 3dafdf14ced991ae1179ef1ca455da62f8c3243e..2fe8e8868f12bd9e846baf8858cd2c33 // Paper end } diff --git a/src/main/java/org/bukkit/entity/Piglin.java b/src/main/java/org/bukkit/entity/Piglin.java -index 6fdc0e0bb62189dbf3cf9ce7a87b7fbb995956a3..d4cb4b0ed1d9766a87867dcf1a3a839526ba9332 100644 +index 2769b4acd91ecb80637d3e4831e0590ae5e1220c..6109f185b7f5feaa7093d8833ad58f0e64f6fc95 100644 --- a/src/main/java/org/bukkit/entity/Piglin.java +++ b/src/main/java/org/bukkit/entity/Piglin.java -@@ -90,4 +90,25 @@ public interface Piglin extends PiglinAbstract, InventoryHolder, com.destroystok +@@ -90,4 +90,24 @@ public interface Piglin extends PiglinAbstract, InventoryHolder, com.destroystok */ @NotNull - public Set<Material> getBarterList(); + public Set<ItemType> getBarterList(); + + // Paper start + /** @@ -738,7 +738,6 @@ index 6fdc0e0bb62189dbf3cf9ce7a87b7fbb995956a3..d4cb4b0ed1d9766a87867dcf1a3a8395 + */ + boolean isChargingCrossbow(); + // Paper end -+ } diff --git a/src/main/java/org/bukkit/entity/PolarBear.java b/src/main/java/org/bukkit/entity/PolarBear.java index 479f7a7c54c85cb685f56e60906650d1989c03ff..4e526ba6aa462a484984fb9f0512b8db113086fe 100644 diff --git a/patches/api/0311-Option-to-prevent-NBT-copy-in-smithing-recipes.patch b/patches/api/0311-Option-to-prevent-NBT-copy-in-smithing-recipes.patch index a37dea550d..e9c0b365dd 100644 --- a/patches/api/0311-Option-to-prevent-NBT-copy-in-smithing-recipes.patch +++ b/patches/api/0311-Option-to-prevent-NBT-copy-in-smithing-recipes.patch @@ -84,11 +84,11 @@ index 08fd3eca8383cdc2d06c3ce973e8c402d279077e..ad2fc850819c9784d477b59adcc5f5ab /** * Get the template recipe item. diff --git a/src/main/java/org/bukkit/inventory/SmithingTrimRecipe.java b/src/main/java/org/bukkit/inventory/SmithingTrimRecipe.java -index 32cbdc342615e76ff7a896e67cb0736b0bdf1978..9e84114528507848a4c1947d677ba02d06f9dc14 100644 +index c631a7d49b9248a7410776487a0eeaab41fefffa..69871ca922a351d0de46e7f0927339bf94325f38 100644 --- a/src/main/java/org/bukkit/inventory/SmithingTrimRecipe.java +++ b/src/main/java/org/bukkit/inventory/SmithingTrimRecipe.java -@@ -23,6 +23,21 @@ public class SmithingTrimRecipe extends SmithingRecipe implements ComplexRecipe - super(key, new ItemStack(Material.AIR), base, addition); +@@ -22,6 +22,21 @@ public class SmithingTrimRecipe extends SmithingRecipe implements ComplexRecipe + super(key, ItemStack.of(ItemType.AIR), base, addition); this.template = template; } + // Paper start @@ -102,7 +102,7 @@ index 32cbdc342615e76ff7a896e67cb0736b0bdf1978..9e84114528507848a4c1947d677ba02d + * @param copyNbt whether to copy the nbt from the input base item to the output + */ + public SmithingTrimRecipe(@NotNull NamespacedKey key, @NotNull RecipeChoice template, @NotNull RecipeChoice base, @NotNull RecipeChoice addition, boolean copyNbt) { -+ super(key, new ItemStack(Material.AIR), base, addition, copyNbt); ++ super(key, ItemStack.of(ItemType.AIR), base, addition, copyNbt); + this.template = template; + } + // Paper end diff --git a/patches/api/0316-Get-entity-default-attributes.patch b/patches/api/0316-Get-entity-default-attributes.patch index 32c28f3adf..9e00c420f0 100644 --- a/patches/api/0316-Get-entity-default-attributes.patch +++ b/patches/api/0316-Get-entity-default-attributes.patch @@ -4,50 +4,22 @@ Date: Fri, 20 Aug 2021 13:03:55 -0700 Subject: [PATCH] Get entity default attributes -diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index a9e7c64e1f98ff73c1804466d7c79eaf343dde7c..c2b042ced0f32b0dafc13a2933c2bd9b18db774a 100644 ---- a/src/main/java/org/bukkit/UnsafeValues.java -+++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -188,5 +188,22 @@ public interface UnsafeValues { - * @return the server's protocol version - */ - int getProtocolVersion(); -+ -+ /** -+ * Checks if the entity represented by the namespaced key has default attributes. -+ * -+ * @param entityKey the entity's key -+ * @return true if it has default attributes -+ */ -+ boolean hasDefaultEntityAttributes(@org.jetbrains.annotations.NotNull NamespacedKey entityKey); -+ -+ /** -+ * Gets the default attributes for the entity represented by the namespaced key. -+ * -+ * @param entityKey the entity's key -+ * @return an unmodifiable instance of Attributable for reading default attributes. -+ * @throws IllegalArgumentException if the entity does not exist of have default attributes (use {@link #hasDefaultEntityAttributes(NamespacedKey)} first) -+ */ -+ @org.jetbrains.annotations.NotNull org.bukkit.attribute.Attributable getDefaultEntityAttributes(@org.jetbrains.annotations.NotNull NamespacedKey entityKey); - // Paper end - } diff --git a/src/main/java/org/bukkit/entity/EntityType.java b/src/main/java/org/bukkit/entity/EntityType.java -index 6c40a989eff1163c19106c1e6b4c8fc01ace7280..6cf14afd2c1b8018c67c6cac302ae28bb12ab5a5 100644 +index a086c3472fa12667e5ca9276a201dbd731101602..9f7430282d1d7f5967ea281101d92377b3fcf5a9 100644 --- a/src/main/java/org/bukkit/entity/EntityType.java +++ b/src/main/java/org/bukkit/entity/EntityType.java -@@ -449,6 +449,25 @@ public enum EntityType implements Keyed, Translatable, net.kyori.adventure.trans - Preconditions.checkArgument(this != UNKNOWN, "UNKNOWN entities do not have translation keys"); - return org.bukkit.Bukkit.getUnsafe().getTranslationKey(this); +@@ -488,4 +488,21 @@ public abstract class EntityType<E extends Entity> extends OldEnum<EntityType<E> + public boolean isEnabledByFeature(@NotNull World world) { + return Bukkit.getDataPackManager().isEnabledByFeature(this, world); } + ++ // Paper start - default EntityType attributes API + /** + * Checks if the entity has default attributes. + * + * @return true if it has default attributes + */ -+ public boolean hasDefaultAttributes() { -+ return org.bukkit.Bukkit.getUnsafe().hasDefaultEntityAttributes(this.key); -+ } ++ public abstract boolean hasDefaultAttributes(); + + /** + * Gets the default attributes for the entity. @@ -55,9 +27,6 @@ index 6c40a989eff1163c19106c1e6b4c8fc01ace7280..6cf14afd2c1b8018c67c6cac302ae28b + * @return an unmodifiable instance of Attributable for reading default attributes. + * @throws IllegalArgumentException if the entity does not exist of have default attributes (use {@link #hasDefaultAttributes()} first) + */ -+ public @NotNull org.bukkit.attribute.Attributable getDefaultAttributes() { -+ return org.bukkit.Bukkit.getUnsafe().getDefaultEntityAttributes(this.key); -+ } - // Paper end - - /** ++ public abstract @NotNull org.bukkit.attribute.Attributable getDefaultAttributes(); ++ // Paper end + } diff --git a/patches/api/0319-Add-ItemFactory-getSpawnEgg-API.patch b/patches/api/0319-Add-ItemFactory-getSpawnEgg-API.patch index bf76f634c7..dc2f9e7bc3 100644 --- a/patches/api/0319-Add-ItemFactory-getSpawnEgg-API.patch +++ b/patches/api/0319-Add-ItemFactory-getSpawnEgg-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add ItemFactory#getSpawnEgg API diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java -index 11e59068b8a8ef1128e3c75283d161c39e2a3a99..67d3105258fe4e8165a662dd65bc501b30fcff51 100644 +index c6f910af4d6e6f2a5afe23a6a86433ac4ff4d68d..2b95876d06022ee897279294be341bcfe01ded5d 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java -@@ -263,5 +263,14 @@ public interface ItemFactory { +@@ -262,5 +262,14 @@ public interface ItemFactory { @NotNull @Deprecated net.md_5.bungee.api.chat.hover.content.Content hoverContentOf(@NotNull org.bukkit.entity.Entity entity, @NotNull net.md_5.bungee.api.chat.BaseComponent[] customName); diff --git a/patches/api/0322-Add-isCollidable-methods-to-various-places.patch b/patches/api/0322-Add-isCollidable-methods-to-various-places.patch index 62fba2ca0e..d7d2755833 100644 --- a/patches/api/0322-Add-isCollidable-methods-to-various-places.patch +++ b/patches/api/0322-Add-isCollidable-methods-to-various-places.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Add isCollidable methods to various places diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java -index 5fe8207fd9b76564b0547eec5e3db2b7abed0150..03b47012447430a350e152920f754d993d4023db 100644 +index 8c900d455d37713ec6395caafa752bf8e2e89c58..1d92759a7284a4b2d9b5af08470e57f2fa70d82f 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java -@@ -4486,6 +4486,16 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla +@@ -4493,6 +4493,17 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla public Multimap<Attribute, AttributeModifier> getItemAttributes(@NotNull EquipmentSlot equipmentSlot) { - return Bukkit.getUnsafe().getItemAttributes(this, equipmentSlot); + return this.getDefaultAttributeModifiers(equipmentSlot); } + + /** @@ -20,35 +20,17 @@ index 5fe8207fd9b76564b0547eec5e3db2b7abed0150..03b47012447430a350e152920f754d99 + * @throws IllegalArgumentException if {@link #isBlock()} is false + */ + public boolean isCollidable() { -+ return Bukkit.getUnsafe().isCollidable(this); ++ Preconditions.checkArgument(this.isBlock(), this + " isn't a block"); ++ return this.asBlockType().isCollidable(); + } // Paper end /** -diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index c2b042ced0f32b0dafc13a2933c2bd9b18db774a..820c7e8f28d7276e4d4b31a81746720a1cc10f09 100644 ---- a/src/main/java/org/bukkit/UnsafeValues.java -+++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -205,5 +205,14 @@ public interface UnsafeValues { - * @throws IllegalArgumentException if the entity does not exist of have default attributes (use {@link #hasDefaultEntityAttributes(NamespacedKey)} first) - */ - @org.jetbrains.annotations.NotNull org.bukkit.attribute.Attributable getDefaultEntityAttributes(@org.jetbrains.annotations.NotNull NamespacedKey entityKey); -+ -+ /** -+ * Checks if this material is collidable. -+ * -+ * @param material the material to check -+ * @return true if collidable -+ * @throws IllegalArgumentException if {@link Material#isBlock()} is false -+ */ -+ boolean isCollidable(@org.jetbrains.annotations.NotNull Material material); - // Paper end - } diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java -index 93b9b57c95a0d24e885a205cd9d9e05a5631806a..cb0dcbbfb77158c3b17bd7994a9bbcef8060941a 100644 +index 6f6d7816f4e928e849e6e4f7265c977437ccf1bf..31dcec117ef278f8060e0a5a4e706239329f9915 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java -@@ -482,6 +482,13 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr +@@ -481,6 +481,13 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr * @return true if block is solid */ boolean isSolid(); @@ -63,10 +45,10 @@ index 93b9b57c95a0d24e885a205cd9d9e05a5631806a..cb0dcbbfb77158c3b17bd7994a9bbcef /** diff --git a/src/main/java/org/bukkit/block/BlockState.java b/src/main/java/org/bukkit/block/BlockState.java -index 3147e278eac674ed21d714bbe318b135c0a6b408..10cbe71917bc32cca61748bcb0aa3395c554dbf8 100644 +index 635a97fb50c485f7ef2e3bdcbb6f185a4ad551bc..ef861fcd5caa39ca4c4eeec4a63f3eb28a033a31 100644 --- a/src/main/java/org/bukkit/block/BlockState.java +++ b/src/main/java/org/bukkit/block/BlockState.java -@@ -225,4 +225,13 @@ public interface BlockState extends Metadatable { +@@ -224,4 +224,13 @@ public interface BlockState extends Metadatable { * or 'virtual' (e.g. on an itemstack) */ boolean isPlaced(); @@ -80,3 +62,21 @@ index 3147e278eac674ed21d714bbe318b135c0a6b408..10cbe71917bc32cca61748bcb0aa3395 + boolean isCollidable(); + // Paper end } +diff --git a/src/main/java/org/bukkit/block/BlockType.java b/src/main/java/org/bukkit/block/BlockType.java +index 9f77976b2f33ba2d5af89ea143a39a0f417a4429..fca5ce5f41861a82a54f5291e25c89b82103ae31 100644 +--- a/src/main/java/org/bukkit/block/BlockType.java ++++ b/src/main/java/org/bukkit/block/BlockType.java +@@ -3210,4 +3210,13 @@ public interface BlockType<B extends BlockData> extends Keyed, Translatable, net + * @return True if this block type is an air block. + */ + boolean isAir(); ++ ++ // Paper start - isCollidable API ++ /** ++ * Checks if this block type is collidable. ++ * ++ * @return true if collidable ++ */ ++ boolean isCollidable(); ++ // Paper end + } diff --git a/patches/api/0325-Add-Raw-Byte-Entity-Serialization.patch b/patches/api/0325-Add-Raw-Byte-Entity-Serialization.patch index f824dd3957..a654455632 100644 --- a/patches/api/0325-Add-Raw-Byte-Entity-Serialization.patch +++ b/patches/api/0325-Add-Raw-Byte-Entity-Serialization.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Raw Byte Entity Serialization diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index 820c7e8f28d7276e4d4b31a81746720a1cc10f09..fed8f959f87f82a7f8fb8afe770f5cb73fcf27b2 100644 +index b134d63351faa0d6e5469e0a09442ab82f8d60e3..26006c3241efc76f0bbf9ba80bfada4bbf52c278 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -131,6 +131,14 @@ public interface UnsafeValues { +@@ -140,6 +140,14 @@ public interface UnsafeValues { ItemStack deserializeItem(byte[] data); @@ -24,7 +24,7 @@ index 820c7e8f28d7276e4d4b31a81746720a1cc10f09..fed8f959f87f82a7f8fb8afe770f5cb7 * Creates and returns the next EntityId available. * <p> diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index a6f9fb065a9e3e56b86ce5f606f86e681a90d7e6..962989e74a66dadab2a8951ccc85ef0c49f8da6b 100644 +index a06700c47c0abb55d8b971e6a85ed80be75168ce..b0a4c772f1f189991cbd6ffd13db8320decebff5 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -834,5 +834,32 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent diff --git a/patches/api/0327-Add-player-health-update-API.patch b/patches/api/0327-Add-player-health-update-API.patch index 0ded0646f9..4f09154a37 100644 --- a/patches/api/0327-Add-player-health-update-API.patch +++ b/patches/api/0327-Add-player-health-update-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add player health update API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index e897c373406aa0105b1060549469590585d5c78d..18e098920193438d171ca57e505e20c6c96742ae 100644 +index 11fc6fd371a6276d2bfbdde3778a83f8a9c754cf..dbb5ecbdd0e3f15ffba7f0a13d5784066c569b2f 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -2118,6 +2118,31 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -2106,6 +2106,31 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ public double getHealthScale(); diff --git a/patches/api/0328-Allow-delegation-to-vanilla-chunk-gen.patch b/patches/api/0328-Allow-delegation-to-vanilla-chunk-gen.patch index f31c8284f6..60c933cd19 100644 --- a/patches/api/0328-Allow-delegation-to-vanilla-chunk-gen.patch +++ b/patches/api/0328-Allow-delegation-to-vanilla-chunk-gen.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow delegation to vanilla chunk gen diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index a6fef51a8435eced8c2981588ae98046c42d8ed4..e75da4494582594dfa8f21e6abd36fb345558127 100644 +index a345ea2f9a7cdb30df07aab305e2bb42100bab63..9ead45a6e881a77014d56c60eb8af85ea446e33a 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1943,6 +1943,24 @@ public final class Bukkit { +@@ -1944,6 +1944,24 @@ public final class Bukkit { return server.createChunkData(world); } @@ -34,10 +34,10 @@ index a6fef51a8435eced8c2981588ae98046c42d8ed4..e75da4494582594dfa8f21e6abd36fb3 * Creates a boss bar instance to display to players. The progress * defaults to 1.0 diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 529054834865813520ebe6784894e759c22ec4f4..b6e8dd95cc58f53e3e6ca64dd796ed6633630cf4 100644 +index 90129c2d9141969241dcc483b82290df64844c0c..7785f88a0bcee28e8ad5f255252e1bb9c9975722 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1638,6 +1638,22 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1639,6 +1639,22 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @NotNull public ChunkGenerator.ChunkData createChunkData(@NotNull World world); @@ -61,7 +61,7 @@ index 529054834865813520ebe6784894e759c22ec4f4..b6e8dd95cc58f53e3e6ca64dd796ed66 * Creates a boss bar instance to display to players. The progress * defaults to 1.0 diff --git a/src/main/java/org/bukkit/generator/ChunkGenerator.java b/src/main/java/org/bukkit/generator/ChunkGenerator.java -index 7e7a53b41013f1bf8956c0e278820f18d77b2f0d..c942b7101a38ac7dc70e11e87afa1f9210000bc1 100644 +index 633e79e076044f2bc463bd0b7029e310b7629163..793b49eee377cb0aab92f4abb96a8a4e5f349979 100644 --- a/src/main/java/org/bukkit/generator/ChunkGenerator.java +++ b/src/main/java/org/bukkit/generator/ChunkGenerator.java @@ -577,6 +577,22 @@ public abstract class ChunkGenerator { diff --git a/patches/api/0342-Multi-Block-Change-API.patch b/patches/api/0342-Multi-Block-Change-API.patch index 91bef833ff..4a0bfc1680 100644 --- a/patches/api/0342-Multi-Block-Change-API.patch +++ b/patches/api/0342-Multi-Block-Change-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Multi Block Change API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 18e098920193438d171ca57e505e20c6c96742ae..505fdb8885b05be9fb51acda49530f8bf0e120ff 100644 +index dbb5ecbdd0e3f15ffba7f0a13d5784066c569b2f..76cc276bd91cc90b0a5aed8e5c56541741d0586a 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -686,6 +686,29 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -674,6 +674,29 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ public void sendBlockDamage(@NotNull Location loc, float progress); diff --git a/patches/api/0346-More-PotionEffectType-API.patch b/patches/api/0346-More-PotionEffectType-API.patch index 5cd5753a92..2784d9960c 100644 --- a/patches/api/0346-More-PotionEffectType-API.patch +++ b/patches/api/0346-More-PotionEffectType-API.patch @@ -4,53 +4,22 @@ Date: Thu, 27 May 2021 21:58:33 -0700 Subject: [PATCH] More PotionEffectType API -diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java -index c21aefb63678d78a441436761373e9710c1e543a..1d96ed754be09b52a518967c870eba05bb3e99ee 100644 ---- a/src/main/java/org/bukkit/Registry.java -+++ b/src/main/java/org/bukkit/Registry.java -@@ -236,6 +236,26 @@ public interface Registry<T extends Keyed> extends Iterable<T> { - */ - @Deprecated(forRemoval = true) - Registry<io.papermc.paper.world.structure.ConfiguredStructure> CONFIGURED_STRUCTURE = Bukkit.getRegistry(io.papermc.paper.world.structure.ConfiguredStructure.class); -+ -+ /** -+ * Potion effect types. -+ * -+ * @see org.bukkit.potion.PotionEffectType -+ */ -+ Registry<org.bukkit.potion.PotionEffectType> POTION_EFFECT_TYPE = new Registry<org.bukkit.potion.PotionEffectType>() { -+ -+ @Nullable -+ @Override -+ public org.bukkit.potion.PotionEffectType get(@NotNull NamespacedKey key) { -+ return org.bukkit.potion.PotionEffectType.getByKey(key); -+ } -+ -+ @NotNull -+ @Override -+ public Iterator<org.bukkit.potion.PotionEffectType> iterator() { -+ return Arrays.stream(org.bukkit.potion.PotionEffectType.values()).iterator(); -+ } -+ }; - // Paper end - - /** diff --git a/src/main/java/org/bukkit/potion/PotionEffectType.java b/src/main/java/org/bukkit/potion/PotionEffectType.java -index 5f3aa6fd18d57055a6d8494938dff149d51b2803..84fd181ad897f620e450750246d9ea416dcbd48a 100644 +index 686e1cfec546fb2268d884e713a863c8fc967802..3c74bcb0349cf6b3448b08e2564ba16618f6ecaa 100644 --- a/src/main/java/org/bukkit/potion/PotionEffectType.java +++ b/src/main/java/org/bukkit/potion/PotionEffectType.java -@@ -14,7 +14,7 @@ import org.jetbrains.annotations.Nullable; +@@ -15,7 +15,7 @@ import org.jetbrains.annotations.Nullable; /** * Represents a type of potion and its effect on an entity. */ -public abstract class PotionEffectType implements Keyed { +public abstract class PotionEffectType implements Keyed, net.kyori.adventure.translation.Translatable { // Paper - implement Translatable + protected static final BiMap<Integer, PotionEffectType> ID_MAP = HashBiMap.create(); + /** - * Increases movement speed. - */ -@@ -363,4 +363,56 @@ public abstract class PotionEffectType implements Keyed { - public static PotionEffectType[] values() { - return Arrays.copyOfRange(byId, 1, byId.length); +@@ -351,4 +351,56 @@ public abstract class PotionEffectType implements Keyed { + + return from; } + // Paper start + /** @@ -58,7 +27,7 @@ index 5f3aa6fd18d57055a6d8494938dff149d51b2803..84fd181ad897f620e450750246d9ea41 + * + * @return the attribute map + */ -+ public abstract @NotNull Map<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> getEffectAttributes(); ++ public abstract @NotNull java.util.Map<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> getEffectAttributes(); + + /** + * Gets the true modifier amount based on the effect amplifier. @@ -106,19 +75,15 @@ index 5f3aa6fd18d57055a6d8494938dff149d51b2803..84fd181ad897f620e450750246d9ea41 + // Paper end } diff --git a/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java b/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java -index c3a86bb1910158a8d13a675dfa7236dd6a3f397c..a7653806c0fa76f4b3342ea199fe892c514a4c27 100644 +index 7a2ee20d32fc39d6fe29c384975c208341552648..08cfe3c8d675fafdd6a38d27bdef2f1f3b68551a 100644 --- a/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java +++ b/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java -@@ -40,4 +40,30 @@ public class PotionEffectTypeWrapper extends PotionEffectType { - public Color getColor() { - return getType().getColor(); +@@ -53,4 +53,26 @@ public class PotionEffectTypeWrapper extends PotionEffectType { + public NamespacedKey getKey() { + return getType().getKey(); } -+ // Paper start -+ @Override -+ public @NotNull org.bukkit.NamespacedKey getKey() { -+ return this.getType().getKey(); -+ } + ++ // Paper start + @Override + public @NotNull java.util.Map<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> getEffectAttributes() { + return this.getType().getEffectAttributes(); diff --git a/patches/api/0347-API-for-creating-command-sender-which-forwards-feedb.patch b/patches/api/0347-API-for-creating-command-sender-which-forwards-feedb.patch index d9bb4574b2..d88b142390 100644 --- a/patches/api/0347-API-for-creating-command-sender-which-forwards-feedb.patch +++ b/patches/api/0347-API-for-creating-command-sender-which-forwards-feedb.patch @@ -5,10 +5,10 @@ Subject: [PATCH] API for creating command sender which forwards feedback diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index e75da4494582594dfa8f21e6abd36fb345558127..43f93aa0efc35488fab44cb55081cfc486c319f5 100644 +index 9ead45a6e881a77014d56c60eb8af85ea446e33a..3587dfd620794ebf372c3fabc62ba68e7676e506 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1432,6 +1432,20 @@ public final class Bukkit { +@@ -1433,6 +1433,20 @@ public final class Bukkit { return server.getConsoleSender(); } @@ -30,10 +30,10 @@ index e75da4494582594dfa8f21e6abd36fb345558127..43f93aa0efc35488fab44cb55081cfc4 * Gets the folder that contains all of the various {@link World}s. * diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index b6e8dd95cc58f53e3e6ca64dd796ed6633630cf4..693e07b7e4aeef2ebc7fba5d20d6c6071762896c 100644 +index 7785f88a0bcee28e8ad5f255252e1bb9c9975722..05a8769737f15a88aaca2c5eafa15b8a49abae6a 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1202,6 +1202,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1203,6 +1203,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @NotNull public ConsoleCommandSender getConsoleSender(); diff --git a/patches/api/0349-Add-GameEvent-tags.patch b/patches/api/0349-Add-GameEvent-tags.patch index 1aabdd065a..c4562cba82 100644 --- a/patches/api/0349-Add-GameEvent-tags.patch +++ b/patches/api/0349-Add-GameEvent-tags.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add GameEvent tags diff --git a/src/main/java/org/bukkit/Tag.java b/src/main/java/org/bukkit/Tag.java -index 3e9f1ee242b8087759c98b54ebb3cc3b8f5fcbd5..9257a5530264195260becedf73d291488c29d176 100644 +index 974dcacb09ec05c98a4a6af28f86694b97b9c925..5bf66852aa94b29a857e208e2176e8181caf58a3 100644 --- a/src/main/java/org/bukkit/Tag.java +++ b/src/main/java/org/bukkit/Tag.java -@@ -960,6 +960,24 @@ public interface Tag<T extends Keyed> extends Keyed { +@@ -962,6 +962,24 @@ public interface Tag<T extends Keyed> extends Keyed { * Vanilla tag representing entities which are dismounted when underwater. */ Tag<EntityType> ENTITY_TYPES_DISMOUNTS_UNDERWATER = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("dismounts_underwater"), EntityType.class); diff --git a/patches/api/0353-Custom-Potion-Mixes.patch b/patches/api/0353-Custom-Potion-Mixes.patch index a8c7167526..575e0d4084 100644 --- a/patches/api/0353-Custom-Potion-Mixes.patch +++ b/patches/api/0353-Custom-Potion-Mixes.patch @@ -102,10 +102,10 @@ index 0000000000000000000000000000000000000000..cb6d93526b637946aec311bef103ad30 + } +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 43f93aa0efc35488fab44cb55081cfc486c319f5..ac6a49e39790aa9f12c7d98990f4cac297200cb0 100644 +index 3587dfd620794ebf372c3fabc62ba68e7676e506..713f9227f0aeaf5910053fad3f888a0b87470932 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2465,6 +2465,15 @@ public final class Bukkit { +@@ -2469,6 +2469,15 @@ public final class Bukkit { public static io.papermc.paper.datapack.DatapackManager getDatapackManager() { return server.getDatapackManager(); } @@ -122,10 +122,10 @@ index 43f93aa0efc35488fab44cb55081cfc486c319f5..ac6a49e39790aa9f12c7d98990f4cac2 @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 693e07b7e4aeef2ebc7fba5d20d6c6071762896c..18f4ae463f0e1406842c451b91f333a1bfabae69 100644 +index 05a8769737f15a88aaca2c5eafa15b8a49abae6a..a319928cd485a9831b584c73980b4e987f9a5ea4 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -2146,5 +2146,12 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -2150,5 +2150,12 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi */ @NotNull io.papermc.paper.datapack.DatapackManager getDatapackManager(); diff --git a/patches/api/0355-More-Projectile-API.patch b/patches/api/0355-More-Projectile-API.patch index fac92210c3..b689beeb6b 100644 --- a/patches/api/0355-More-Projectile-API.patch +++ b/patches/api/0355-More-Projectile-API.patch @@ -346,7 +346,7 @@ index 4623e0d767b343cbdc6fcf20b3b2ff7ff14863cf..dd69a68d1f005c25329bb0366d161ae9 + // Paper end } diff --git a/src/main/java/org/bukkit/entity/ThrownPotion.java b/src/main/java/org/bukkit/entity/ThrownPotion.java -index 7051e07b4e456aae0ec9e37808b59e5fa62a4027..225ac312613b9e8f3cf680819f2ebe350d1bf48a 100644 +index 4b3e70a029a3402b3ade9deef2b7b4f3e1006f98..225ac312613b9e8f3cf680819f2ebe350d1bf48a 100644 --- a/src/main/java/org/bukkit/entity/ThrownPotion.java +++ b/src/main/java/org/bukkit/entity/ThrownPotion.java @@ -32,12 +32,34 @@ public interface ThrownPotion extends ThrowableProjectile { @@ -354,8 +354,8 @@ index 7051e07b4e456aae0ec9e37808b59e5fa62a4027..225ac312613b9e8f3cf680819f2ebe35 /** * Set the ItemStack for this thrown potion. - * <p> -- * The ItemStack must be of type {@link org.bukkit.Material#SPLASH_POTION} -- * or {@link org.bukkit.Material#LINGERING_POTION}, otherwise an exception +- * The ItemStack must be of type {@link org.bukkit.inventory.ItemType#SPLASH_POTION} +- * or {@link org.bukkit.inventory.ItemType#LINGERING_POTION}, otherwise an exception - * is thrown. * * @param item New ItemStack diff --git a/patches/api/0356-Add-getComputedBiome-API.patch b/patches/api/0356-Add-getComputedBiome-API.patch index a1ec54fe08..bb3260105b 100644 --- a/patches/api/0356-Add-getComputedBiome-API.patch +++ b/patches/api/0356-Add-getComputedBiome-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add getComputedBiome API diff --git a/src/main/java/org/bukkit/RegionAccessor.java b/src/main/java/org/bukkit/RegionAccessor.java -index cd83348de3f82b3fddcf2d4bb9187ec8173b0e40..8f50eb9b902236f5e039f5d26f3ca9a044b01a75 100644 +index 78396b7f754641de520f95d2015a9c6f1d933e7f..9bfb26f13a0a8b36b8148769b8ce75368e7d4fe2 100644 --- a/src/main/java/org/bukkit/RegionAccessor.java +++ b/src/main/java/org/bukkit/RegionAccessor.java -@@ -26,6 +26,7 @@ public interface RegionAccessor extends Keyed { // Paper +@@ -27,6 +27,7 @@ public interface RegionAccessor extends Keyed { // Paper * * @param location the location of the biome * @return Biome at the given location @@ -16,7 +16,7 @@ index cd83348de3f82b3fddcf2d4bb9187ec8173b0e40..8f50eb9b902236f5e039f5d26f3ca9a0 */ @NotNull Biome getBiome(@NotNull Location location); -@@ -37,10 +38,33 @@ public interface RegionAccessor extends Keyed { // Paper +@@ -38,10 +39,33 @@ public interface RegionAccessor extends Keyed { // Paper * @param y Y-coordinate of the block * @param z Z-coordinate of the block * @return Biome at the given coordinates @@ -51,10 +51,10 @@ index cd83348de3f82b3fddcf2d4bb9187ec8173b0e40..8f50eb9b902236f5e039f5d26f3ca9a0 * Sets the {@link Biome} at the given {@link Location}. * diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java -index cb0dcbbfb77158c3b17bd7994a9bbcef8060941a..921864e748407291b7fa153381e7d9701e1c4608 100644 +index 31dcec117ef278f8060e0a5a4e706239329f9915..21a48ce4b10adb1711665d2c751a00ff7c84e2f1 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java -@@ -371,10 +371,22 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr +@@ -370,10 +370,22 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr * Returns the biome that this block resides in * * @return Biome type containing this block diff --git a/patches/api/0357-Add-enchantWithLevels-API.patch b/patches/api/0357-Add-enchantWithLevels-API.patch index fe08c8a617..893b79590d 100644 --- a/patches/api/0357-Add-enchantWithLevels-API.patch +++ b/patches/api/0357-Add-enchantWithLevels-API.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Add enchantWithLevels API diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java -index 67d3105258fe4e8165a662dd65bc501b30fcff51..5a2e091785043e66c5560e870e3729fa70b28bb4 100644 +index 2b95876d06022ee897279294be341bcfe01ded5d..95054b8573bb96eebcf9be8d26078f82efa91c33 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java -@@ -161,6 +161,22 @@ public interface ItemFactory { - Material updateMaterial(@NotNull final ItemMeta meta, @NotNull final Material material) throws IllegalArgumentException; +@@ -160,6 +160,22 @@ public interface ItemFactory { + ItemType updateItemType(@NotNull final ItemMeta meta, @NotNull final ItemType itemType) throws IllegalArgumentException; // Paper start + /** @@ -32,10 +32,10 @@ index 67d3105258fe4e8165a662dd65bc501b30fcff51..5a2e091785043e66c5560e870e3729fa * Creates a hover event for the given item. * diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index f9faef1b73b5027a3d22e76a0b33b7c952f3ae08..eac7adf622b91489711a2f8bcff77fb31292dd67 100644 +index 3a5d5968f1c3b75292c06606733c9f449d6b550f..a139c9e3fdd61c3e228284ae56c39162f0cc045d 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java -@@ -656,6 +656,24 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat +@@ -705,6 +705,24 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat } // Paper start diff --git a/patches/api/0362-Add-EntityDyeEvent-and-CollarColorable-interface.patch b/patches/api/0362-Add-EntityDyeEvent-and-CollarColorable-interface.patch index 032a0872d1..281539dd7a 100644 --- a/patches/api/0362-Add-EntityDyeEvent-and-CollarColorable-interface.patch +++ b/patches/api/0362-Add-EntityDyeEvent-and-CollarColorable-interface.patch @@ -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 -index c340fecb61bac66baf0f44189d21bc85289b1269..97b0d8ccd3fd3a711ec5fa4ce3d8703515895081 100644 +index 94fef2c823eb340fe02d18e24e67b4aa97c3b83c..a61cf1c212bc497df4093105947593abbf11c01e 100644 --- a/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; +@@ -12,7 +12,7 @@ import org.jetbrains.annotations.NotNull; /** * Meow. */ @@ -129,7 +129,7 @@ index c340fecb61bac66baf0f44189d21bc85289b1269..97b0d8ccd3fd3a711ec5fa4ce3d87035 /** * Gets the current type of this cat. -@@ -29,6 +29,7 @@ public interface Cat extends Tameable, Sittable { +@@ -35,6 +35,7 @@ public interface Cat extends Tameable, Sittable { * @return the color of the collar */ @NotNull @@ -137,7 +137,7 @@ index c340fecb61bac66baf0f44189d21bc85289b1269..97b0d8ccd3fd3a711ec5fa4ce3d87035 public DyeColor getCollarColor(); /** -@@ -36,6 +37,7 @@ public interface Cat extends Tameable, Sittable { +@@ -42,6 +43,7 @@ public interface Cat extends Tameable, Sittable { * * @param color the color to apply */ diff --git a/patches/api/0364-FallingBlock-auto-expire-setting.patch b/patches/api/0364-FallingBlock-auto-expire-setting.patch index 82ddf953e9..1af9b43cd2 100644 --- a/patches/api/0364-FallingBlock-auto-expire-setting.patch +++ b/patches/api/0364-FallingBlock-auto-expire-setting.patch @@ -5,10 +5,10 @@ Subject: [PATCH] FallingBlock auto expire setting diff --git a/src/main/java/org/bukkit/entity/FallingBlock.java b/src/main/java/org/bukkit/entity/FallingBlock.java -index bd87d1548faa2fb095adce9f156f24163995dbe7..ccb4517526819d974df861106aa786eb596189a3 100644 +index 320a0e1f6b93ca9e85eac7d9a3f5821fa242c257..be6f983e94782b60960b1cfe28fba08623091081 100644 --- a/src/main/java/org/bukkit/entity/FallingBlock.java +++ b/src/main/java/org/bukkit/entity/FallingBlock.java -@@ -103,4 +103,23 @@ public interface FallingBlock extends Entity { +@@ -92,4 +92,23 @@ public interface FallingBlock extends Entity { default org.bukkit.Location getSourceLoc() { return this.getOrigin(); } diff --git a/patches/api/0366-Add-method-isTickingWorlds-to-Bukkit.patch b/patches/api/0365-Add-method-isTickingWorlds-to-Bukkit.patch index 57225f80c3..814e6ea677 100644 --- a/patches/api/0366-Add-method-isTickingWorlds-to-Bukkit.patch +++ b/patches/api/0365-Add-method-isTickingWorlds-to-Bukkit.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add method isTickingWorlds() to Bukkit. diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index ac6a49e39790aa9f12c7d98990f4cac297200cb0..ef36d793ab77c7b7208f8f5994815599cff470d1 100644 +index 713f9227f0aeaf5910053fad3f888a0b87470932..33e980002054d08fef688f5a971be93d05f7a4c5 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -774,12 +774,26 @@ public final class Bukkit { +@@ -775,12 +775,26 @@ public final class Bukkit { return server.getWorlds(); } @@ -35,7 +35,7 @@ index ac6a49e39790aa9f12c7d98990f4cac297200cb0..ef36d793ab77c7b7208f8f5994815599 * * @param creator the options to use when creating the world * @return newly created or loaded world -@@ -791,6 +805,9 @@ public final class Bukkit { +@@ -792,6 +806,9 @@ public final class Bukkit { /** * Unloads a world with the given name. @@ -45,7 +45,7 @@ index ac6a49e39790aa9f12c7d98990f4cac297200cb0..ef36d793ab77c7b7208f8f5994815599 * * @param name Name of the world to unload * @param save whether to save the chunks before unloading -@@ -802,6 +819,9 @@ public final class Bukkit { +@@ -803,6 +820,9 @@ public final class Bukkit { /** * Unloads the given world. @@ -56,10 +56,10 @@ index ac6a49e39790aa9f12c7d98990f4cac297200cb0..ef36d793ab77c7b7208f8f5994815599 * @param world the world to unload * @param save whether to save the chunks before unloading diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 18f4ae463f0e1406842c451b91f333a1bfabae69..5b225bbb128893d67251a96ab318035802a0cf76 100644 +index a319928cd485a9831b584c73980b4e987f9a5ea4..6abc8e07d5478636f82a99947afa36bef55a053b 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -647,34 +647,55 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -648,34 +648,55 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @NotNull public List<World> getWorlds(); diff --git a/patches/api/0365-Keyed-Cat-Type.patch b/patches/api/0365-Keyed-Cat-Type.patch deleted file mode 100644 index b0797d78b7..0000000000 --- a/patches/api/0365-Keyed-Cat-Type.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Owen1212055 <[email protected]> -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 diff --git a/patches/api/0367-Add-WardenAngerChangeEvent.patch b/patches/api/0366-Add-WardenAngerChangeEvent.patch index acf45b5314..acf45b5314 100644 --- a/patches/api/0367-Add-WardenAngerChangeEvent.patch +++ b/patches/api/0366-Add-WardenAngerChangeEvent.patch diff --git a/patches/api/0368-Nameable-Banner-API.patch b/patches/api/0367-Nameable-Banner-API.patch index eba196daaf..eba196daaf 100644 --- a/patches/api/0368-Nameable-Banner-API.patch +++ b/patches/api/0367-Nameable-Banner-API.patch diff --git a/patches/api/0369-Add-Player-getFishHook.patch b/patches/api/0368-Add-Player-getFishHook.patch index 291eac5db5..dbc426a916 100644 --- a/patches/api/0369-Add-Player-getFishHook.patch +++ b/patches/api/0368-Add-Player-getFishHook.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Player#getFishHook diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index ff1ebe184ba5a1bdc8e2784025b07d3bb90a5078..8b0d04d5b39ee817555a36adddc39b18fc6f0d02 100644 +index c7757f4de66cd6d136266a15801fe31e9d61538e..4ac4d0787e3dd13476afa7173a529cd31b6968ab 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java -@@ -386,6 +386,13 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder +@@ -383,6 +383,13 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder @Nullable public Location getPotentialBedLocation(); // Paper end diff --git a/patches/api/0370-More-Teleport-API.patch b/patches/api/0369-More-Teleport-API.patch index f96981646f..c51a2eec98 100644 --- a/patches/api/0370-More-Teleport-API.patch +++ b/patches/api/0369-More-Teleport-API.patch @@ -125,7 +125,7 @@ index 0000000000000000000000000000000000000000..dbacefc919fd6ed6a0f5cdaa0f695a12 + +} diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index ab0ceaba9ddcbe20a8b8a1fc3ed19cb3c64ecd3d..97f0bc6573c8ba09de77061b6312b91cd713221d 100644 +index 833f792b7a3fd33248d00adbfa5a55d90f3ea612..72d2e81905bdbd2516755eed6b7afe6a6e83667f 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -123,10 +123,34 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent @@ -165,10 +165,10 @@ index ab0ceaba9ddcbe20a8b8a1fc3ed19cb3c64ecd3d..97f0bc6573c8ba09de77061b6312b91c * Teleports this entity to the given location. If this entity is riding a * vehicle, it will be dismounted prior to teleportation. diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 505fdb8885b05be9fb51acda49530f8bf0e120ff..d2f3114d2fe708553b638010394022d09bde39cf 100644 +index 76cc276bd91cc90b0a5aed8e5c56541741d0586a..3f745da3a7a6b2ef34848bffc594881f1d4f18cb 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -2922,6 +2922,49 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -2910,6 +2910,49 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM String getClientBrandName(); // Paper end diff --git a/patches/api/0371-Add-EntityPortalReadyEvent.patch b/patches/api/0370-Add-EntityPortalReadyEvent.patch index 4b1b1f1e1f..4b1b1f1e1f 100644 --- a/patches/api/0371-Add-EntityPortalReadyEvent.patch +++ b/patches/api/0370-Add-EntityPortalReadyEvent.patch diff --git a/patches/api/0372-Custom-Chat-Completion-Suggestions-API.patch b/patches/api/0371-Custom-Chat-Completion-Suggestions-API.patch index 7a2c93272a..5e761ef9f2 100644 --- a/patches/api/0372-Custom-Chat-Completion-Suggestions-API.patch +++ b/patches/api/0371-Custom-Chat-Completion-Suggestions-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Custom Chat Completion Suggestions API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index d2f3114d2fe708553b638010394022d09bde39cf..104629c89bd4d2a9c086bf2bdbf5dddc7d247660 100644 +index 3f745da3a7a6b2ef34848bffc594881f1d4f18cb..591df0b08b48d257db5a425668c672d4bc8aa6a5 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -2809,6 +2809,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -2797,6 +2797,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @throws IllegalArgumentException If the level is negative or greater than {@code 4} (i.e. not within {@code [0, 4]}). */ void sendOpLevel(byte level); diff --git a/patches/api/0373-Collision-API.patch b/patches/api/0372-Collision-API.patch index 24bcebc503..7fe1c8f8d9 100644 --- a/patches/api/0373-Collision-API.patch +++ b/patches/api/0372-Collision-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Collision API diff --git a/src/main/java/org/bukkit/RegionAccessor.java b/src/main/java/org/bukkit/RegionAccessor.java -index 8f50eb9b902236f5e039f5d26f3ca9a044b01a75..0d9184abd7090a5123a990f76847ee9b8971f735 100644 +index 9bfb26f13a0a8b36b8148769b8ce75368e7d4fe2..163c8b6abea291bcf2c7af9aca1e829a54e721e5 100644 --- a/src/main/java/org/bukkit/RegionAccessor.java +++ b/src/main/java/org/bukkit/RegionAccessor.java -@@ -469,5 +469,15 @@ public interface RegionAccessor extends Keyed { // Paper +@@ -472,5 +472,15 @@ public interface RegionAccessor extends Keyed { // Paper * @return whether a line of sight exists between {@code from} and {@code to} */ public boolean lineOfSightExists(@NotNull Location from, @NotNull Location to); @@ -25,7 +25,7 @@ index 8f50eb9b902236f5e039f5d26f3ca9a044b01a75..0d9184abd7090a5123a990f76847ee9b // Paper end } diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 97f0bc6573c8ba09de77061b6312b91cd713221d..3f3ea5bb6b3ea6f55b5cd699f1c01ac159619add 100644 +index 72d2e81905bdbd2516755eed6b7afe6a6e83667f..6fac8564a97f58f4786dab8142556ef36b11e48e 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -913,4 +913,26 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent diff --git a/patches/api/0374-Block-Ticking-API.patch b/patches/api/0373-Block-Ticking-API.patch index 9b2fc54ea1..6c8007c5cd 100644 --- a/patches/api/0374-Block-Ticking-API.patch +++ b/patches/api/0373-Block-Ticking-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Block Ticking API diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java -index 921864e748407291b7fa153381e7d9701e1c4608..1c3f54382d66549dc881d4577c7104be6673a274 100644 +index 21a48ce4b10adb1711665d2c751a00ff7c84e2f1..136ce20b19fc97faedbadb89171c3c4d287acaeb 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java -@@ -589,6 +589,21 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr +@@ -588,6 +588,21 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr * @return true if the block was destroyed */ boolean breakNaturally(@NotNull ItemStack tool, boolean triggerEffect, boolean dropExperience); @@ -31,10 +31,10 @@ index 921864e748407291b7fa153381e7d9701e1c4608..1c3f54382d66549dc881d4577c7104be /** diff --git a/src/main/java/org/bukkit/block/data/BlockData.java b/src/main/java/org/bukkit/block/data/BlockData.java -index 869fa47a13fbcb128228963bf53cc72da4499a01..c6b17605090f2f284e6536567ddf0e0977eeaaf8 100644 +index 7f4a858ab98f8d0c3c2f890ca88bc13b6ba967fa..55f5d09664a7858a67b795465282adcf481a2a65 100644 --- a/src/main/java/org/bukkit/block/data/BlockData.java +++ b/src/main/java/org/bukkit/block/data/BlockData.java -@@ -247,4 +247,14 @@ public interface BlockData extends Cloneable { +@@ -246,4 +246,14 @@ public interface BlockData extends Cloneable { @NotNull @ApiStatus.Experimental BlockState createBlockState(); diff --git a/patches/api/0376-Also-load-resources-from-LibraryLoader.patch b/patches/api/0374-Also-load-resources-from-LibraryLoader.patch index ee5785d8cb..ee5785d8cb 100644 --- a/patches/api/0376-Also-load-resources-from-LibraryLoader.patch +++ b/patches/api/0374-Also-load-resources-from-LibraryLoader.patch diff --git a/patches/api/0375-Add-NamespacedKey-biome-methods.patch b/patches/api/0375-Add-NamespacedKey-biome-methods.patch deleted file mode 100644 index 24cd2b9867..0000000000 --- a/patches/api/0375-Add-NamespacedKey-biome-methods.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Josh Roy <[email protected]> -Date: Sun, 14 Aug 2022 12:22:54 -0400 -Subject: [PATCH] Add NamespacedKey biome methods - -Co-authored-by: Thonk <[email protected]> - -diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index fed8f959f87f82a7f8fb8afe770f5cb73fcf27b2..c661eab343ae76488de701630424e2d589f44fc0 100644 ---- a/src/main/java/org/bukkit/UnsafeValues.java -+++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -222,5 +222,32 @@ public interface UnsafeValues { - * @throws IllegalArgumentException if {@link Material#isBlock()} is false - */ - boolean isCollidable(@org.jetbrains.annotations.NotNull Material material); -+ -+ /** -+ * Gets the {@link NamespacedKey} for the biome at the given location. -+ * -+ * @param accessor The {@link RegionAccessor} of the provided coordinates -+ * @param x X-coordinate of the block -+ * @param y Y-coordinate of the block -+ * @param z Z-coordinate of the block -+ * @return the biome's {@link NamespacedKey} -+ */ -+ @org.jetbrains.annotations.NotNull -+ NamespacedKey getBiomeKey(RegionAccessor accessor, int x, int y, int z); -+ -+ /** -+ * Sets the biome at the given location to a biome registered -+ * to the given {@link NamespacedKey}. If no biome by the given -+ * {@link NamespacedKey} exists, an {@link IllegalStateException} -+ * will be thrown. -+ * -+ * @param accessor The {@link RegionAccessor} of the provided coordinates -+ * @param x X-coordinate of the block -+ * @param y Y-coordinate of the block -+ * @param z Z-coordinate of the block -+ * @param biomeKey Biome key -+ * @throws IllegalStateException if no biome by the given key is registered. -+ */ -+ void setBiomeKey(RegionAccessor accessor, int x, int y, int z, NamespacedKey biomeKey); - // Paper end - } diff --git a/patches/api/0377-Added-byte-array-serialization-deserialization-for-P.patch b/patches/api/0375-Added-byte-array-serialization-deserialization-for-P.patch index 161c82afe3..161c82afe3 100644 --- a/patches/api/0377-Added-byte-array-serialization-deserialization-for-P.patch +++ b/patches/api/0375-Added-byte-array-serialization-deserialization-for-P.patch diff --git a/patches/api/0378-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch b/patches/api/0376-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch index bec7a5d015..bec7a5d015 100644 --- a/patches/api/0378-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch +++ b/patches/api/0376-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch diff --git a/patches/api/0379-Expose-codepoint-limit-in-YamlConfigOptions-and-incr.patch b/patches/api/0377-Expose-codepoint-limit-in-YamlConfigOptions-and-incr.patch index 9b5ef25cf4..9b5ef25cf4 100644 --- a/patches/api/0379-Expose-codepoint-limit-in-YamlConfigOptions-and-incr.patch +++ b/patches/api/0377-Expose-codepoint-limit-in-YamlConfigOptions-and-incr.patch diff --git a/patches/api/0380-Add-getDrops-to-BlockState.patch b/patches/api/0378-Add-getDrops-to-BlockState.patch index 48f3a99f04..352d330ff2 100644 --- a/patches/api/0380-Add-getDrops-to-BlockState.patch +++ b/patches/api/0378-Add-getDrops-to-BlockState.patch @@ -7,10 +7,10 @@ Originally added isPreferredTool to BlockData but upstream added that. diff --git a/src/main/java/org/bukkit/block/BlockState.java b/src/main/java/org/bukkit/block/BlockState.java -index 10cbe71917bc32cca61748bcb0aa3395c554dbf8..37ca7b6b0fcee8bec12026ec3715dcc47400cc11 100644 +index ef861fcd5caa39ca4c4eeec4a63f3eb28a033a31..406cccc82e2e734524b6714255e61b43a7a3b97b 100644 --- a/src/main/java/org/bukkit/block/BlockState.java +++ b/src/main/java/org/bukkit/block/BlockState.java -@@ -233,5 +233,34 @@ public interface BlockState extends Metadatable { +@@ -232,5 +232,34 @@ public interface BlockState extends Metadatable { * @return true if collidable */ boolean isCollidable(); diff --git a/patches/api/0381-Add-PlayerInventorySlotChangeEvent.patch b/patches/api/0379-Add-PlayerInventorySlotChangeEvent.patch index f094f9dbc9..f094f9dbc9 100644 --- a/patches/api/0381-Add-PlayerInventorySlotChangeEvent.patch +++ b/patches/api/0379-Add-PlayerInventorySlotChangeEvent.patch diff --git a/patches/api/0382-Elder-Guardian-appearance-API.patch b/patches/api/0380-Elder-Guardian-appearance-API.patch index 0922867417..7cf678a26f 100644 --- a/patches/api/0382-Elder-Guardian-appearance-API.patch +++ b/patches/api/0380-Elder-Guardian-appearance-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Elder Guardian appearance API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 104629c89bd4d2a9c086bf2bdbf5dddc7d247660..c0501ab1d6d01b2a8bd8483b3a748858c960eb5c 100644 +index 591df0b08b48d257db5a425668c672d4bc8aa6a5..4a5c4f64ad6f49cbbd5c41ed41d49420b5757204 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -2984,6 +2984,24 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -2972,6 +2972,24 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM void lookAt(@NotNull org.bukkit.entity.Entity entity, @NotNull io.papermc.paper.entity.LookAnchor playerAnchor, @NotNull io.papermc.paper.entity.LookAnchor entityAnchor); // Paper end - Teleport API diff --git a/patches/api/0383-Allow-changing-bed-s-occupied-property.patch b/patches/api/0381-Allow-changing-bed-s-occupied-property.patch index 8dfafd6d33..8dfafd6d33 100644 --- a/patches/api/0383-Allow-changing-bed-s-occupied-property.patch +++ b/patches/api/0381-Allow-changing-bed-s-occupied-property.patch diff --git a/patches/api/0384-Add-EquipmentSlot-convenience-methods.patch b/patches/api/0382-Add-EquipmentSlot-convenience-methods.patch index 0ef6b4c9b0..0ef6b4c9b0 100644 --- a/patches/api/0384-Add-EquipmentSlot-convenience-methods.patch +++ b/patches/api/0382-Add-EquipmentSlot-convenience-methods.patch diff --git a/patches/api/0385-Add-LivingEntity-swingHand-EquipmentSlot-convenience.patch b/patches/api/0383-Add-LivingEntity-swingHand-EquipmentSlot-convenience.patch index 1a53a5fcc5..4cdc0b8f72 100644 --- a/patches/api/0385-Add-LivingEntity-swingHand-EquipmentSlot-convenience.patch +++ b/patches/api/0383-Add-LivingEntity-swingHand-EquipmentSlot-convenience.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add LivingEntity#swingHand(EquipmentSlot) convenience method diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index 08167783b6e4e7d393779c92500793518ee346a6..68248bf3d6c84cb6debd9ddd3c0623353bed71f0 100644 +index 6217ada1d30a252af5394b32720468628809fd91..8d75d2a2afd1a4c75a00c0acbd292c6b18ace827 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -1056,5 +1056,23 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource diff --git a/patches/api/0386-Add-entity-knockback-API.patch b/patches/api/0384-Add-entity-knockback-API.patch index f53aa9c293..a9ff8ddd0d 100644 --- a/patches/api/0386-Add-entity-knockback-API.patch +++ b/patches/api/0384-Add-entity-knockback-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add entity knockback API diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index 68248bf3d6c84cb6debd9ddd3c0623353bed71f0..84b78742f2bac07322e8a758ca9abc6b763ccc28 100644 +index 8d75d2a2afd1a4c75a00c0acbd292c6b18ace827..8489aae76d649e2e60b7004ecca6ab437917ca78 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -1074,5 +1074,17 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource diff --git a/patches/api/0387-Added-EntityToggleSitEvent.patch b/patches/api/0385-Added-EntityToggleSitEvent.patch index af2476123b..af2476123b 100644 --- a/patches/api/0387-Added-EntityToggleSitEvent.patch +++ b/patches/api/0385-Added-EntityToggleSitEvent.patch diff --git a/patches/api/0388-Add-Moving-Piston-API.patch b/patches/api/0386-Add-Moving-Piston-API.patch index 8f889f1e3d..8f889f1e3d 100644 --- a/patches/api/0388-Add-Moving-Piston-API.patch +++ b/patches/api/0386-Add-Moving-Piston-API.patch diff --git a/patches/api/0389-Add-PrePlayerAttackEntityEvent.patch b/patches/api/0387-Add-PrePlayerAttackEntityEvent.patch index 507b313e56..507b313e56 100644 --- a/patches/api/0389-Add-PrePlayerAttackEntityEvent.patch +++ b/patches/api/0387-Add-PrePlayerAttackEntityEvent.patch diff --git a/patches/api/0390-Add-Player-Warden-Warning-API.patch b/patches/api/0388-Add-Player-Warden-Warning-API.patch index ea67a85d9c..e876088d97 100644 --- a/patches/api/0390-Add-Player-Warden-Warning-API.patch +++ b/patches/api/0388-Add-Player-Warden-Warning-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Player Warden Warning API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index c0501ab1d6d01b2a8bd8483b3a748858c960eb5c..dbb208e2badea38a4058491650b773192fae80bc 100644 +index 4a5c4f64ad6f49cbbd5c41ed41d49420b5757204..a7dcb46434110a2871228679bef7018703848f84 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -3000,6 +3000,59 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -2988,6 +2988,59 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @param silent whether sound should be silenced */ void showElderGuardian(boolean silent); diff --git a/patches/api/0391-More-vanilla-friendly-methods-to-update-trades.patch b/patches/api/0389-More-vanilla-friendly-methods-to-update-trades.patch index f13fdb5601..72c1a311b3 100644 --- a/patches/api/0391-More-vanilla-friendly-methods-to-update-trades.patch +++ b/patches/api/0389-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 8c8176121cafed0ed09239b6a7b392dc846438e2..3bc24457d143449e6a338d79becf7c39b9f81054 100644 +index 767f940149821a2a31124d3186229deadbb53c67..309dbad419b313dade381fb2464a2ccd56fbfe36 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 { +@@ -63,8 +63,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 8c8176121cafed0ed09239b6a7b392dc846438e2..3bc24457d143449e6a338d79becf7c39 */ public void setVillagerLevel(int level); -@@ -81,6 +84,34 @@ public interface Villager extends AbstractVillager { +@@ -84,6 +87,34 @@ public interface Villager extends AbstractVillager { public void setVillagerExperience(int experience); // Paper start diff --git a/patches/api/0392-Add-paper-dumplisteners-command.patch b/patches/api/0390-Add-paper-dumplisteners-command.patch index 8053dc2c4f..8053dc2c4f 100644 --- a/patches/api/0392-Add-paper-dumplisteners-command.patch +++ b/patches/api/0390-Add-paper-dumplisteners-command.patch diff --git a/patches/api/0393-ItemStack-damage-API.patch b/patches/api/0391-ItemStack-damage-API.patch index 12c1e68439..b74b6bcff2 100644 --- a/patches/api/0393-ItemStack-damage-API.patch +++ b/patches/api/0391-ItemStack-damage-API.patch @@ -8,7 +8,7 @@ to simulate damage done to an itemstack and all the logic associated with damaging them diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index 84b78742f2bac07322e8a758ca9abc6b763ccc28..5b0e14a7397d3de683d17ee2f1a805d289597a4b 100644 +index 8489aae76d649e2e60b7004ecca6ab437917ca78..ea90b6f2137a9580fe3dfaaa57ce03bfeb496782 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -1086,5 +1086,52 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource @@ -65,10 +65,10 @@ index 84b78742f2bac07322e8a758ca9abc6b763ccc28..5b0e14a7397d3de683d17ee2f1a805d2 // Paper end } diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index eac7adf622b91489711a2f8bcff77fb31292dd67..d15a74c38576c49df61cfab02c70fc5d8c0dd5f7 100644 +index a139c9e3fdd61c3e228284ae56c39162f0cc045d..de5884266e135c533d5fd6c6397eefeb0e3dad82 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java -@@ -971,5 +971,19 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat +@@ -1020,5 +1020,19 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat public boolean canRepair(@NotNull ItemStack toBeRepaired) { return Bukkit.getUnsafe().isValidRepairItemStack(toBeRepaired, this); } diff --git a/patches/api/0394-Add-Tick-TemporalUnit.patch b/patches/api/0392-Add-Tick-TemporalUnit.patch index 96c1dddab8..96c1dddab8 100644 --- a/patches/api/0394-Add-Tick-TemporalUnit.patch +++ b/patches/api/0392-Add-Tick-TemporalUnit.patch diff --git a/patches/api/0395-Friction-API.patch b/patches/api/0393-Friction-API.patch index f4d3031506..dcfa02d314 100644 --- a/patches/api/0395-Friction-API.patch +++ b/patches/api/0393-Friction-API.patch @@ -59,7 +59,7 @@ index d0bef15785493b512ff0f7414c1d58d38fead581..58017fce436cdbda255f7172fbdadb72 /** * Gets the item stack associated with this item drop. diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index 5b0e14a7397d3de683d17ee2f1a805d289597a4b..ec5fe22b8092c8fc837e5c36e4f17053e48a77a8 100644 +index ea90b6f2137a9580fe3dfaaa57ce03bfeb496782..a56b4c2ccb738c8d1d5b2186506e82b384cf8873 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -25,7 +25,7 @@ import org.jetbrains.annotations.Nullable; diff --git a/patches/api/0396-Player-Entity-Tracking-Events.patch b/patches/api/0394-Player-Entity-Tracking-Events.patch index a824ae278f..a824ae278f 100644 --- a/patches/api/0396-Player-Entity-Tracking-Events.patch +++ b/patches/api/0394-Player-Entity-Tracking-Events.patch diff --git a/patches/api/0398-fix-Instruments.patch b/patches/api/0395-fix-Instruments.patch index 00386f987b..b36de11f2d 100644 --- a/patches/api/0398-fix-Instruments.patch +++ b/patches/api/0395-fix-Instruments.patch @@ -98,7 +98,7 @@ index de976be7132d05506fde7a839cac3954b0dd8da4..642feb8b4578e6dbd2bf78d859283d20 public static Instrument getByType(final byte type) { return BY_DATA.get(type); diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index dbb208e2badea38a4058491650b773192fae80bc..b11d6e190407b0ab0d9ff25c2c13f04ae907f612 100644 +index a7dcb46434110a2871228679bef7018703848f84..f60787152a3d2da050cef74711d73380135e60c4 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -407,9 +407,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM diff --git a/patches/api/0399-Add-BlockLockCheckEvent.patch b/patches/api/0396-Add-BlockLockCheckEvent.patch index 55a23307b1..55a23307b1 100644 --- a/patches/api/0399-Add-BlockLockCheckEvent.patch +++ b/patches/api/0396-Add-BlockLockCheckEvent.patch diff --git a/patches/api/0400-Add-Sneaking-API-for-Entities.patch b/patches/api/0397-Add-Sneaking-API-for-Entities.patch index eb85a81295..f631a2ada3 100644 --- a/patches/api/0400-Add-Sneaking-API-for-Entities.patch +++ b/patches/api/0397-Add-Sneaking-API-for-Entities.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add Sneaking API for Entities diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 3f3ea5bb6b3ea6f55b5cd699f1c01ac159619add..a2a423d4e4c2702ba5967223cab0432dd7d04732 100644 +index 6fac8564a97f58f4786dab8142556ef36b11e48e..ca1bd0078e381c892c70b741664b4d1ae27bdcb4 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -765,6 +765,25 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent @@ -35,7 +35,7 @@ index 3f3ea5bb6b3ea6f55b5cd699f1c01ac159619add..a2a423d4e4c2702ba5967223cab0432d * Get the category of spawn to which this entity belongs. * diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index b11d6e190407b0ab0d9ff25c2c13f04ae907f612..14a8831aabe7c7f1803151b382e27c606e7a049f 100644 +index f60787152a3d2da050cef74711d73380135e60c4..da6f37b9807c2523df2002d4f19ec75029c75961 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -310,6 +310,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM diff --git a/patches/api/0397-Add-missing-Fluid-type.patch b/patches/api/0397-Add-missing-Fluid-type.patch deleted file mode 100644 index c260bf8497..0000000000 --- a/patches/api/0397-Add-missing-Fluid-type.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic <[email protected]> -Date: Sun, 4 Dec 2022 10:07:16 -0800 -Subject: [PATCH] Add missing Fluid type - - -diff --git a/src/main/java/org/bukkit/Fluid.java b/src/main/java/org/bukkit/Fluid.java -index 4cc974689a229e73ddbf2c353ac0fe23da03a5b2..7202b44a65e8699cf64329e441e83d4dd1779c19 100644 ---- a/src/main/java/org/bukkit/Fluid.java -+++ b/src/main/java/org/bukkit/Fluid.java -@@ -8,6 +8,12 @@ import org.jetbrains.annotations.NotNull; - */ - public enum Fluid implements Keyed { - -+ // Paper start -+ /** -+ * No fluid. -+ */ -+ EMPTY, -+ // Paper end - /** - * Stationary water. - */ diff --git a/patches/api/0401-Improve-PortalEvents.patch b/patches/api/0398-Improve-PortalEvents.patch index f7f53b19fc..f7f53b19fc 100644 --- a/patches/api/0401-Improve-PortalEvents.patch +++ b/patches/api/0398-Improve-PortalEvents.patch diff --git a/patches/api/0402-Add-exploded-block-state-to-BlockExplodeEvent.patch b/patches/api/0399-Add-exploded-block-state-to-BlockExplodeEvent.patch index bdc2de6d23..bdc2de6d23 100644 --- a/patches/api/0402-Add-exploded-block-state-to-BlockExplodeEvent.patch +++ b/patches/api/0399-Add-exploded-block-state-to-BlockExplodeEvent.patch diff --git a/patches/api/0403-Flying-Fall-Damage-API.patch b/patches/api/0400-Flying-Fall-Damage-API.patch index 4629c12d80..bad52c18e9 100644 --- a/patches/api/0403-Flying-Fall-Damage-API.patch +++ b/patches/api/0400-Flying-Fall-Damage-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Flying Fall Damage API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 14a8831aabe7c7f1803151b382e27c606e7a049f..6cebd564b4262ae2145996612bc21e0de5356b84 100644 +index da6f37b9807c2523df2002d4f19ec75029c75961..9417b9ef775f8eebab15caff426f1f4b04ab406f 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1579,6 +1579,23 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1567,6 +1567,23 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ public void setAllowFlight(boolean flight); diff --git a/patches/api/0404-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch b/patches/api/0401-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch index 25fa280b26..25fa280b26 100644 --- a/patches/api/0404-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch +++ b/patches/api/0401-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch diff --git a/patches/api/0405-Replace-ItemFlag.HIDE_POTION_EFFECTS.patch b/patches/api/0402-Replace-ItemFlag.HIDE_POTION_EFFECTS.patch index 3936bb4a92..3936bb4a92 100644 --- a/patches/api/0405-Replace-ItemFlag.HIDE_POTION_EFFECTS.patch +++ b/patches/api/0402-Replace-ItemFlag.HIDE_POTION_EFFECTS.patch diff --git a/patches/api/0406-Win-Screen-API.patch b/patches/api/0403-Win-Screen-API.patch index 8d131d362e..a8ff93bda9 100644 --- a/patches/api/0406-Win-Screen-API.patch +++ b/patches/api/0403-Win-Screen-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Win Screen API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 6cebd564b4262ae2145996612bc21e0de5356b84..06f00d016f1e46edb8f4fe0c14eb8b364900c3ef 100644 +index 9417b9ef775f8eebab15caff426f1f4b04ab406f..f90b031b979aba116aaf5cf1936d50127268d3e1 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -946,6 +946,47 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -934,6 +934,47 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ public void sendMap(@NotNull MapView map); diff --git a/patches/api/0407-Add-Entity-Body-Yaw-API.patch b/patches/api/0404-Add-Entity-Body-Yaw-API.patch index 1d6aba7a15..82ec802456 100644 --- a/patches/api/0407-Add-Entity-Body-Yaw-API.patch +++ b/patches/api/0404-Add-Entity-Body-Yaw-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add Entity Body Yaw API diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index ec5fe22b8092c8fc837e5c36e4f17053e48a77a8..ffca32ae2464ea5a669029079a50585ca259a4f8 100644 +index a56b4c2ccb738c8d1d5b2186506e82b384cf8873..e8aa113c66de8bc9d6c541b19477fd3d13d6e5e6 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -1133,5 +1133,21 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource diff --git a/patches/api/0408-Fix-HandlerList-for-InventoryBlockStartEvent-subclas.patch b/patches/api/0405-Fix-HandlerList-for-InventoryBlockStartEvent-subclas.patch index 98799cd97d..98799cd97d 100644 --- a/patches/api/0408-Fix-HandlerList-for-InventoryBlockStartEvent-subclas.patch +++ b/patches/api/0405-Fix-HandlerList-for-InventoryBlockStartEvent-subclas.patch diff --git a/patches/api/0409-Add-EntityFertilizeEggEvent.patch b/patches/api/0406-Add-EntityFertilizeEggEvent.patch index 52283a9df2..52283a9df2 100644 --- a/patches/api/0409-Add-EntityFertilizeEggEvent.patch +++ b/patches/api/0406-Add-EntityFertilizeEggEvent.patch diff --git a/patches/api/0410-Add-CompostItemEvent-and-EntityCompostItemEvent.patch b/patches/api/0407-Add-CompostItemEvent-and-EntityCompostItemEvent.patch index f720032bf2..f720032bf2 100644 --- a/patches/api/0410-Add-CompostItemEvent-and-EntityCompostItemEvent.patch +++ b/patches/api/0407-Add-CompostItemEvent-and-EntityCompostItemEvent.patch diff --git a/patches/api/0411-Add-Shearable-API.patch b/patches/api/0408-Add-Shearable-API.patch index 96049cfd38..96049cfd38 100644 --- a/patches/api/0411-Add-Shearable-API.patch +++ b/patches/api/0408-Add-Shearable-API.patch diff --git a/patches/api/0412-Fix-SpawnEggMeta-get-setSpawnedType.patch b/patches/api/0409-Fix-SpawnEggMeta-get-setSpawnedType.patch index 4014e17083..4ea704f3f4 100644 --- a/patches/api/0412-Fix-SpawnEggMeta-get-setSpawnedType.patch +++ b/patches/api/0409-Fix-SpawnEggMeta-get-setSpawnedType.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix SpawnEggMeta#get/setSpawnedType diff --git a/src/main/java/org/bukkit/inventory/meta/SpawnEggMeta.java b/src/main/java/org/bukkit/inventory/meta/SpawnEggMeta.java -index 9ae84de43018e2dc9df5e1a56244d8812c2ffbb8..c190dff53e18994c93c35b6a9502cba38e6886ed 100644 +index 28a7544dddc05be0c5f9a7bad21b9d41029230bd..4dbaf178d6ea3e9ce9dc03e0f5aacc51be5af5c9 100644 --- a/src/main/java/org/bukkit/inventory/meta/SpawnEggMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/SpawnEggMeta.java @@ -15,7 +15,7 @@ public interface SpawnEggMeta extends ItemMeta { @@ -15,7 +15,7 @@ index 9ae84de43018e2dc9df5e1a56244d8812c2ffbb8..c190dff53e18994c93c35b6a9502cba3 - @Deprecated + @Deprecated(forRemoval = true) // Paper @Contract("-> fail") - EntityType getSpawnedType(); + EntityType<?> getSpawnedType(); @@ -26,10 +26,26 @@ public interface SpawnEggMeta extends ItemMeta { * default. @@ -24,7 +24,7 @@ index 9ae84de43018e2dc9df5e1a56244d8812c2ffbb8..c190dff53e18994c93c35b6a9502cba3 - @Deprecated + @Deprecated(forRemoval = true) // Paper @Contract("_ -> fail") - void setSpawnedType(EntityType type); + void setSpawnedType(EntityType<?> type); + // Paper start + /** diff --git a/patches/api/0413-Add-Mob-Experience-reward-API.patch b/patches/api/0410-Add-Mob-Experience-reward-API.patch index e399177aeb..e399177aeb 100644 --- a/patches/api/0413-Add-Mob-Experience-reward-API.patch +++ b/patches/api/0410-Add-Mob-Experience-reward-API.patch diff --git a/patches/api/0414-Expand-PlayerItemMendEvent.patch b/patches/api/0411-Expand-PlayerItemMendEvent.patch index 223922e05e..223922e05e 100644 --- a/patches/api/0414-Expand-PlayerItemMendEvent.patch +++ b/patches/api/0411-Expand-PlayerItemMendEvent.patch diff --git a/patches/api/0415-Add-transient-modifier-API.patch b/patches/api/0412-Add-transient-modifier-API.patch index a32e4c86a9..a32e4c86a9 100644 --- a/patches/api/0415-Add-transient-modifier-API.patch +++ b/patches/api/0412-Add-transient-modifier-API.patch diff --git a/patches/api/0416-Add-API-for-waxed-signs.patch b/patches/api/0413-Add-API-for-waxed-signs.patch index 38a844fdb2..38a844fdb2 100644 --- a/patches/api/0416-Add-API-for-waxed-signs.patch +++ b/patches/api/0413-Add-API-for-waxed-signs.patch diff --git a/patches/api/0417-Properly-remove-the-experimental-smithing-inventory-.patch b/patches/api/0414-Properly-remove-the-experimental-smithing-inventory-.patch index 58275cea90..58275cea90 100644 --- a/patches/api/0417-Properly-remove-the-experimental-smithing-inventory-.patch +++ b/patches/api/0414-Properly-remove-the-experimental-smithing-inventory-.patch diff --git a/patches/api/0418-Add-method-to-remove-all-active-potion-effects.patch b/patches/api/0415-Add-method-to-remove-all-active-potion-effects.patch index ebb66dfa7f..4ed5a76426 100644 --- a/patches/api/0418-Add-method-to-remove-all-active-potion-effects.patch +++ b/patches/api/0415-Add-method-to-remove-all-active-potion-effects.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add method to remove all active potion effects diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index ffca32ae2464ea5a669029079a50585ca259a4f8..9712f7140933d7fc87c5838c173e2d818b70cfde 100644 +index e8aa113c66de8bc9d6c541b19477fd3d13d6e5e6..6c48e29d7b17bf5ef8ee239d8131046f9f7b7ebd 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -565,6 +565,15 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource diff --git a/patches/api/0416-Mark-experimental-mc-things-appropriately.patch b/patches/api/0416-Mark-experimental-mc-things-appropriately.patch new file mode 100644 index 0000000000..a4a6aca575 --- /dev/null +++ b/patches/api/0416-Mark-experimental-mc-things-appropriately.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic <[email protected]> +Date: Mon, 19 Jun 2023 18:17:47 -0700 +Subject: [PATCH] Mark experimental mc things appropriately + + +diff --git a/src/main/java/org/bukkit/inventory/ItemType.java b/src/main/java/org/bukkit/inventory/ItemType.java +index 27a1d255b8fcbd6487e4d4eb1abf784b43eaf90e..2beed0864779ab121dc41b330e1ba4bc9505a38a 100644 +--- a/src/main/java/org/bukkit/inventory/ItemType.java ++++ b/src/main/java/org/bukkit/inventory/ItemType.java +@@ -904,6 +904,8 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans + ItemType EGG = getItemType("egg"); + ItemType COMPASS = getItemType("compass"); + ItemType RECOVERY_COMPASS = getItemType("recovery_compass"); ++ @org.bukkit.MinecraftExperimental // Paper ++ @org.jetbrains.annotations.ApiStatus.Experimental // Paper + ItemType BUNDLE = getItemType("bundle"); + ItemType FISHING_ROD = getItemType("fishing_rod"); + ItemType CLOCK = getItemType("clock"); diff --git a/patches/api/0417-fixup-Paper-Utils.patch b/patches/api/0417-fixup-Paper-Utils.patch new file mode 100644 index 0000000000..a212a96609 --- /dev/null +++ b/patches/api/0417-fixup-Paper-Utils.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic <[email protected]> +Date: Tue, 20 Jun 2023 09:37:42 -0700 +Subject: [PATCH] fixup! Paper Utils + + +diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java +index 26006c3241efc76f0bbf9ba80bfada4bbf52c278..f04e2c955c03e3c2bf05935c7650356705b2c869 100644 +--- a/src/main/java/org/bukkit/UnsafeValues.java ++++ b/src/main/java/org/bukkit/UnsafeValues.java +@@ -49,7 +49,7 @@ public interface UnsafeValues { + Material fromLegacy(MaterialData material, boolean itemPriority); + + Material toMaterial(ItemType itemType); +- Material toMaterial(BlockType<?> blockType); // Paper ++ Material blockTypeToMaterial(BlockType<?> blockType); // Paper + + BlockData fromLegacy(Material material, byte data); + diff --git a/patches/api/0418-fixup-Add-Material-Tags.patch b/patches/api/0418-fixup-Add-Material-Tags.patch new file mode 100644 index 0000000000..28eddb755c --- /dev/null +++ b/patches/api/0418-fixup-Add-Material-Tags.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic <[email protected]> +Date: Tue, 20 Jun 2023 09:37:53 -0700 +Subject: [PATCH] fixup! Add Material Tags + + +diff --git a/src/main/java/com/destroystokyo/paper/MaterialSetTag.java b/src/main/java/com/destroystokyo/paper/MaterialSetTag.java +index 64dd5e6674f83075be0f0868f66f114ff71dbe24..8f5530188e340336dfffb3054c1743b068bc9342 100644 +--- a/src/main/java/com/destroystokyo/paper/MaterialSetTag.java ++++ b/src/main/java/com/destroystokyo/paper/MaterialSetTag.java +@@ -83,7 +83,7 @@ public class MaterialSetTag extends BaseTag<Material, MaterialSetTag> { + public MaterialSetTag addTags(@NotNull Tag<BlockType>...tags) { + for (Tag<BlockType> tag : tags) { + for (final BlockType<?> value : tag.getValues()) { +- this.add(Bukkit.getUnsafe().toMaterial(value)); ++ this.add(Bukkit.getUnsafe().blockTypeToMaterial(value)); + } + } + return this; +@@ -110,7 +110,7 @@ public class MaterialSetTag extends BaseTag<Material, MaterialSetTag> { + } + + public boolean isTagged(@NotNull BlockType<?> itemType) { +- return this.isTagged(Bukkit.getUnsafe().toMaterial(itemType)); ++ return this.isTagged(Bukkit.getUnsafe().blockTypeToMaterial(itemType)); + } + + public boolean isTagged(@NotNull Material material) { diff --git a/patches/api/0419-fixup-AnvilDamageEvent.patch b/patches/api/0419-fixup-AnvilDamageEvent.patch new file mode 100644 index 0000000000..9f1ce71792 --- /dev/null +++ b/patches/api/0419-fixup-AnvilDamageEvent.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic <[email protected]> +Date: Tue, 20 Jun 2023 09:38:01 -0700 +Subject: [PATCH] fixup! AnvilDamageEvent + + +diff --git a/src/main/java/com/destroystokyo/paper/event/block/AnvilDamagedEvent.java b/src/main/java/com/destroystokyo/paper/event/block/AnvilDamagedEvent.java +index 4b90dc67f75b05cb8a766025781b9eaa2fef2606..8174787e87433084035bb3cbc88e041937c56430 100644 +--- a/src/main/java/com/destroystokyo/paper/event/block/AnvilDamagedEvent.java ++++ b/src/main/java/com/destroystokyo/paper/event/block/AnvilDamagedEvent.java +@@ -112,7 +112,7 @@ public class AnvilDamagedEvent extends InventoryEvent implements Cancellable { + */ + @Deprecated + public @NotNull Material getMaterial() { +- return Bukkit.getUnsafe().toMaterial(this.blockType); ++ return Bukkit.getUnsafe().blockTypeToMaterial(this.blockType); + } + + /** diff --git a/patches/server/0001-Setup-Gradle-project.patch b/patches/server/0001-Setup-Gradle-project.patch index a98810c6eb..b15e14f958 100644 --- a/patches/server/0001-Setup-Gradle-project.patch +++ b/patches/server/0001-Setup-Gradle-project.patch @@ -28,10 +28,10 @@ index 3df8c60ab5cd1454660980883f80668d535b742b..37c3a00659ce21623be07317f4f6a45b +/.factorypath diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 -index 0000000000000000000000000000000000000000..9a355bbbe57629d0b66f8260ecf461e3bf1a539b +index 0000000000000000000000000000000000000000..57a6ce583e5e2cd90be70080014d12de8743eb67 --- /dev/null +++ b/build.gradle.kts -@@ -0,0 +1,138 @@ +@@ -0,0 +1,139 @@ +import io.papermc.paperweight.util.* + +plugins { @@ -57,6 +57,7 @@ index 0000000000000000000000000000000000000000..9a355bbbe57629d0b66f8260ecf461e3 + + testImplementation("junit:junit:4.13.2") + testImplementation("org.hamcrest:hamcrest-library:1.3") ++ testImplementation("org.mockito:mockito-core:5.3.1") +} + +val craftbukkitPackageVersion = "1_20_R1" // Paper @@ -172,17 +173,17 @@ index 0000000000000000000000000000000000000000..9a355bbbe57629d0b66f8260ecf461e3 +} diff --git a/pom.xml b/pom.xml deleted file mode 100644 -index ccb57a056138549ec39ddaef2f09590b1fddd127..0000000000000000000000000000000000000000 +index 9bc9a876ffa52ced64610adbab7f6b0d73eae4f3..0000000000000000000000000000000000000000 --- a/pom.xml +++ /dev/null -@@ -1,587 +0,0 @@ +@@ -1,594 +0,0 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.spigotmc</groupId> - <artifactId>spigot</artifactId> - <packaging>jar</packaging> -- <version>1.20.1-R0.1-SNAPSHOT</version> +- <version>1.20.1-experimental-SNAPSHOT</version> - <name>Spigot</name> - <url>https://www.spigotmc.org/</url> - @@ -198,6 +199,7 @@ index ccb57a056138549ec39ddaef2f09590b1fddd127..00000000000000000000000000000000 - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <api.version>unknown</api.version> - <bt.name>git</bt.name> +- <minecraft.version>1.20.1-R0.1-SNAPSHOT</minecraft.version> - <minecraft_version>1_20_R1</minecraft_version> - <maven.compiler.source>17</maven.compiler.source> - <maven.compiler.target>17</maven.compiler.target> @@ -221,7 +223,7 @@ index ccb57a056138549ec39ddaef2f09590b1fddd127..00000000000000000000000000000000 - <dependency> - <groupId>org.spigotmc</groupId> - <artifactId>minecraft-server</artifactId> -- <version>${project.version}</version> +- <version>${minecraft.version}</version> - <scope>compile</scope> - </dependency> - <dependency> @@ -454,6 +456,12 @@ index ccb57a056138549ec39ddaef2f09590b1fddd127..00000000000000000000000000000000 - <version>1.3</version> - <scope>test</scope> - </dependency> +- <dependency> +- <groupId>org.mockito</groupId> +- <artifactId>mockito-core</artifactId> +- <version>5.3.1</version> +- <scope>test</scope> +- </dependency> - </dependencies> - - <!-- This builds a completely 'ready to start' jar with all dependencies inside --> @@ -589,7 +597,7 @@ index ccb57a056138549ec39ddaef2f09590b1fddd127..00000000000000000000000000000000 - <id>remap-members</id> - <configuration> - <logFile>${project.build.directory}/server.txt</logFile> -- <srgIn>org.spigotmc:minecraft-server:${project.version}:csrg:maps-spigot-members</srgIn> +- <srgIn>org.spigotmc:minecraft-server:${minecraft.version}:csrg:maps-spigot-members</srgIn> - <reverse>true</reverse> - </configuration> - </execution> @@ -737,7 +745,7 @@ index ccb57a056138549ec39ddaef2f09590b1fddd127..00000000000000000000000000000000 - </goals> - <id>remap-obf</id> - <configuration> -- <srgIn>org.spigotmc:minecraft-server:${project.version}:csrg:maps-spigot</srgIn> +- <srgIn>org.spigotmc:minecraft-server:${minecraft.version}:csrg:maps-spigot</srgIn> - <reverse>true</reverse> - <remappedArtifactAttached>true</remappedArtifactAttached> - <remappedClassifierName>remapped-obf</remappedClassifierName> @@ -750,8 +758,8 @@ index ccb57a056138549ec39ddaef2f09590b1fddd127..00000000000000000000000000000000 - </goals> - <id>remap-mojang</id> - <configuration> -- <inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile> -- <srgIn>org.spigotmc:minecraft-server:${project.version}:txt:maps-mojang</srgIn> +- <inputFile>${project.build.directory}/${project.artifactId}-${minecraft.version}-remapped-obf.jar</inputFile> +- <srgIn>org.spigotmc:minecraft-server:${minecraft.version}:txt:maps-mojang</srgIn> - <remappedArtifactAttached>true</remappedArtifactAttached> - <remappedClassifierName>remapped-mojang</remappedClassifierName> - </configuration> diff --git a/patches/server/0002-Remap-fixes.patch b/patches/server/0002-Remap-fixes.patch index dc9145fd2d..fc4f1507e0 100644 --- a/patches/server/0002-Remap-fixes.patch +++ b/patches/server/0002-Remap-fixes.patch @@ -104,10 +104,19 @@ index ad52c3fc6210939a39ef77a382c640a24ee44838..6b7dd01778f0a5d3a96d2d04af4b525d } } diff --git a/src/test/java/org/bukkit/RegistryConstantsTest.java b/src/test/java/org/bukkit/RegistryConstantsTest.java -index 34e6b84c63e50972c650c0e4bc17bc0749e1b7c3..cd96cbba4d495c18f984dec6f861f75baf4300cc 100644 +index 569aa9caac8407b52214dbec564dc8e9f08cacc9..c20fc9466649f16f1102978590780bb729c55bc9 100644 --- a/src/test/java/org/bukkit/RegistryConstantsTest.java +++ b/src/test/java/org/bukkit/RegistryConstantsTest.java -@@ -19,17 +19,17 @@ public class RegistryConstantsTest extends AbstractTestingBase { +@@ -4,7 +4,7 @@ import java.lang.reflect.Field; + import java.lang.reflect.Modifier; + import java.util.ArrayList; + import java.util.List; +-import net.minecraft.core.Registry; ++// import net.minecraft.core.Registry; // Paper - remap fix + import net.minecraft.core.registries.Registries; + import net.minecraft.resources.ResourceKey; + import net.minecraft.resources.ResourceLocation; +@@ -105,13 +105,13 @@ public class RegistryConstantsTest extends AbstractTestingBase { @Test public void testTrimMaterial() { @@ -123,33 +132,56 @@ index 34e6b84c63e50972c650c0e4bc17bc0749e1b7c3..cd96cbba4d495c18f984dec6f861f75b this.testMissingConstants(TrimPattern.class, Registries.TRIM_PATTERN); } +@@ -169,7 +169,7 @@ public class RegistryConstantsTest extends AbstractTestingBase { + this.testMissingConstants(MusicInstrument.class, Registries.INSTRUMENT); + } + - private <T extends Keyed> void testExcessConstants(Class<T> clazz, Registry<T> registry) { -+ private <T extends Keyed> void testExcessConstants(Class<T> clazz, org.bukkit.Registry<T> registry) { // Paper - remap fix ++ private <T extends Keyed> void testExcessConstants(Class<T> clazz, Registry<T> registry) { // Paper - remap fix List<NamespacedKey> excessKeys = new ArrayList<>(); for (Field field : clazz.getFields()) { +@@ -198,10 +198,10 @@ public class RegistryConstantsTest extends AbstractTestingBase { + Assert.assertTrue(excessKeys.size() + " excess constants(s) in " + clazz.getSimpleName() + " that do not exist: " + excessKeys, excessKeys.isEmpty()); + } + +- private <T extends Keyed, M> void testMissingConstants(Class<T> clazz, ResourceKey<Registry<M>> nmsRegistryKey) { ++ private <T extends Keyed, M> void testMissingConstants(Class<T> clazz, ResourceKey<net.minecraft.core.Registry<M>> nmsRegistryKey) { // Paper - remap fix + List<ResourceLocation> missingKeys = new ArrayList<>(); + +- Registry<M> nmsRegistry = REGISTRY_CUSTOM.registryOrThrow(nmsRegistryKey); ++ net.minecraft.core.Registry<M> nmsRegistry = REGISTRY_CUSTOM.registryOrThrow(nmsRegistryKey); // Paper - remap fix + for (M nmsObject : nmsRegistry) { + ResourceLocation minecraftKey = nmsRegistry.getKey(nmsObject); + diff --git a/src/test/java/org/bukkit/entity/EntityTypesTest.java b/src/test/java/org/bukkit/entity/EntityTypesTest.java -index b1de312e902c83a2f95d80040abb9255e64431a9..aafa6f472c82f851fe7f5ae3111488bb732d0bcc 100644 +index db23efff71a5e680c05ba61b3f9db72d35e437c1..e410b06cf7082714e1733be47500950c54031c41 100644 --- a/src/test/java/org/bukkit/entity/EntityTypesTest.java +++ b/src/test/java/org/bukkit/entity/EntityTypesTest.java -@@ -5,7 +5,6 @@ import java.util.Set; - import java.util.stream.Collectors; - import net.minecraft.core.registries.BuiltInRegistries; - import net.minecraft.resources.ResourceLocation; --import net.minecraft.world.entity.EntityType; - import org.bukkit.support.AbstractTestingBase; - import org.junit.Assert; - import org.junit.Test; -@@ -16,8 +15,8 @@ public class EntityTypesTest extends AbstractTestingBase { +@@ -15,8 +15,8 @@ public class EntityTypesTest extends AbstractTestingBase { + + @Test + public void testClasses() { +- for (EntityType<?> entityType : Registry.ENTITY_TYPE) { +- if (entityType == EntityType.UNKNOWN) { ++ for (org.bukkit.entity.EntityType<?> entityType : Registry.ENTITY_TYPE) { // Paper - remap fix ++ if (entityType == org.bukkit.entity.EntityType.UNKNOWN) { // Paper - remap fix + continue; + } + +@@ -26,10 +26,10 @@ public class EntityTypesTest extends AbstractTestingBase { + + @Test public void testMaps() { - Set<EntityType> allBukkit = Arrays.stream(EntityType.values()).filter((b) -> b.getName() != null).collect(Collectors.toSet()); +- Set<EntityType<?>> allBukkit = Arrays.stream(EntityType.values()).filter((b) -> b != EntityType.UNKNOWN).collect(Collectors.toSet()); ++ Set<org.bukkit.entity.EntityType<?>> allBukkit = Arrays.stream(org.bukkit.entity.EntityType.values()).filter((b) -> b != org.bukkit.entity.EntityType.UNKNOWN).collect(Collectors.toSet()); // Paper - remap fix - for (EntityType<?> nms : BuiltInRegistries.ENTITY_TYPE) { - ResourceLocation key = EntityType.getKey(nms); + for (net.minecraft.world.entity.EntityType<?> nms : BuiltInRegistries.ENTITY_TYPE) { // Paper - remap fix + ResourceLocation key = net.minecraft.world.entity.EntityType.getKey(nms); // Paper - remap fix - org.bukkit.entity.EntityType bukkit = org.bukkit.entity.EntityType.fromName(key.getPath()); + org.bukkit.entity.EntityType<?> bukkit = org.bukkit.entity.EntityType.fromName(key.getPath()); Assert.assertNotNull("Missing nms->bukkit " + key, bukkit); diff --git a/src/test/java/org/bukkit/entity/PandaGeneTest.java b/src/test/java/org/bukkit/entity/PandaGeneTest.java index 76e2ad676ae68846bdff3c3ef711751445fb0f3c..feee17192bca55a9cf1b2fc5b9609b888db77763 100644 @@ -180,3 +212,33 @@ index 76e2ad676ae68846bdff3c3ef711751445fb0f3c..feee17192bca55a9cf1b2fc5b9609b88 org.bukkit.entity.Panda.Gene bukkit = CraftPanda.fromNms(gene); Assert.assertNotNull("Bukkit gene null for " + gene, bukkit); +diff --git a/src/test/java/org/bukkit/support/DummyServer.java b/src/test/java/org/bukkit/support/DummyServer.java +index 9227d8a2103d7c001c1cba5f96a9a2fcd8c7595c..a9535199b39d03652f1235d4a920b795306f4ec9 100644 +--- a/src/test/java/org/bukkit/support/DummyServer.java ++++ b/src/test/java/org/bukkit/support/DummyServer.java +@@ -81,7 +81,7 @@ public final class DummyServer { + Mockito.when(instance.getTag(Mockito.any(), Mockito.any(), Mockito.any())).then(mock -> { + String registry = mock.getArgument(0); + Class<?> clazz = mock.getArgument(2); +- MinecraftKey key = CraftNamespacedKey.toMinecraft(mock.getArgument(1)); ++ net.minecraft.resources.ResourceLocation key = CraftNamespacedKey.toMinecraft(mock.getArgument(1)); // Paper - remap fix + + switch (registry) { + case org.bukkit.Tag.REGISTRY_BLOCKS -> { +@@ -100,14 +100,14 @@ public final class DummyServer { + } + case org.bukkit.Tag.REGISTRY_FLUIDS -> { + Preconditions.checkArgument(clazz == org.bukkit.Fluid.class, "Fluid namespace must have fluid type"); +- TagKey<FluidType> fluidTagKey = TagKey.create(Registries.FLUID, key); ++ TagKey<net.minecraft.world.level.material.Fluid> fluidTagKey = TagKey.create(Registries.FLUID, key); // Paper - remap fix + if (BuiltInRegistries.FLUID.getTag(fluidTagKey).isPresent()) { + return new CraftFluidTag(BuiltInRegistries.FLUID, fluidTagKey); + } + } + case org.bukkit.Tag.REGISTRY_ENTITY_TYPES -> { + Preconditions.checkArgument(clazz == org.bukkit.entity.EntityType.class, "Entity type namespace must have entity type"); +- TagKey<EntityTypes<?>> entityTagKey = TagKey.create(Registries.ENTITY_TYPE, key); ++ TagKey<net.minecraft.world.entity.EntityType<?>> entityTagKey = TagKey.create(Registries.ENTITY_TYPE, key); // Paper - remap fix + if (BuiltInRegistries.ENTITY_TYPE.getTag(entityTagKey).isPresent()) { + return new CraftEntityTag(BuiltInRegistries.ENTITY_TYPE, entityTagKey); + } diff --git a/patches/server/0003-Build-system-changes.patch b/patches/server/0003-Build-system-changes.patch index b1dc518ce6..468d358401 100644 --- a/patches/server/0003-Build-system-changes.patch +++ b/patches/server/0003-Build-system-changes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Build system changes diff --git a/build.gradle.kts b/build.gradle.kts -index 9a355bbbe57629d0b66f8260ecf461e3bf1a539b..8a8467bef44269e4c831a81fc0dc852b44c8f6cb 100644 +index 57a6ce583e5e2cd90be70080014d12de8743eb67..e9b9efb8e0649ef34696ccd41863095c653a0b6c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,10 +9,9 @@ plugins { @@ -21,16 +21,16 @@ index 9a355bbbe57629d0b66f8260ecf461e3bf1a539b..8a8467bef44269e4c831a81fc0dc852b implementation("commons-lang:commons-lang:2.6") runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.0") runtimeOnly("com.mysql:mysql-connector-j:8.0.33") -@@ -23,6 +22,8 @@ dependencies { - +@@ -24,6 +23,8 @@ dependencies { testImplementation("junit:junit:4.13.2") testImplementation("org.hamcrest:hamcrest-library:1.3") + testImplementation("org.mockito:mockito-core:5.3.1") + + implementation("io.netty:netty-all:4.1.87.Final"); // Paper - Bump netty } val craftbukkitPackageVersion = "1_20_R1" // Paper -@@ -34,6 +35,7 @@ tasks.jar { +@@ -35,6 +36,7 @@ tasks.jar { val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim() val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\"" val date = git("show", "-s", "--format=%ci", gitHash).getText().trim() // Paper @@ -38,7 +38,7 @@ index 9a355bbbe57629d0b66f8260ecf461e3bf1a539b..8a8467bef44269e4c831a81fc0dc852b attributes( "Main-Class" to "org.bukkit.craftbukkit.Main", "Implementation-Title" to "CraftBukkit", -@@ -42,6 +44,9 @@ tasks.jar { +@@ -43,6 +45,9 @@ tasks.jar { "Specification-Title" to "Bukkit", "Specification-Version" to project.version, "Specification-Vendor" to "Bukkit Team", @@ -48,7 +48,7 @@ index 9a355bbbe57629d0b66f8260ecf461e3bf1a539b..8a8467bef44269e4c831a81fc0dc852b ) for (tld in setOf("net", "com", "org")) { attributes("$tld/bukkit", "Sealed" to true) -@@ -75,6 +80,17 @@ tasks.shadowJar { +@@ -76,6 +81,17 @@ tasks.shadowJar { } } @@ -67,13 +67,13 @@ index 9a355bbbe57629d0b66f8260ecf461e3bf1a539b..8a8467bef44269e4c831a81fc0dc852b exclude("org/bukkit/craftbukkit/inventory/ItemStack*Test.class") } diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 58a237d85b05def8e52ca737869ee80c300d050c..f3412dbbb0f37d5625ab05cfd502189ab4a343c2 100644 +index 77cfb5c2e897db7e559c6edba9e935106836a25f..f8326c3450f07a81ffdef6c8097f6bb5bfefe450 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java -@@ -209,7 +209,7 @@ public class Main { - } - - if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { +@@ -212,7 +212,7 @@ public class Main { + System.err.println("*** WARNING: This server jar is experimental, please refer to https://www.spigotmc.org/go/experimental ***"); + System.err.println("**********************************************************************"); + if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { - Date buildDate = new Date(Integer.parseInt(Main.class.getPackage().getImplementationVendor()) * 1000L); + Date buildDate = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").parse(Main.class.getPackage().getImplementationVendor()); // Paper diff --git a/patches/server/0004-Test-changes.patch b/patches/server/0004-Test-changes.patch index 8cf786ee53..74bd93132a 100644 --- a/patches/server/0004-Test-changes.patch +++ b/patches/server/0004-Test-changes.patch @@ -4,270 +4,20 @@ Date: Mon, 13 Feb 2023 14:14:56 -0800 Subject: [PATCH] Test changes -diff --git a/build.gradle.kts b/build.gradle.kts -index 8a8467bef44269e4c831a81fc0dc852b44c8f6cb..952dde5d0d9fa6bcf97ae5cafe482cca1f5b3a78 100644 ---- a/build.gradle.kts -+++ b/build.gradle.kts -@@ -12,6 +12,7 @@ dependencies { - implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion - implementation("org.ow2.asm:asm:9.4") - implementation("org.ow2.asm:asm-commons:9.4") // Paper - ASM event executor generation -+ testImplementation("org.mockito:mockito-core:4.9.0") // Paper - switch to mockito - implementation("commons-lang:commons-lang:2.6") - runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.0") - runtimeOnly("com.mysql:mysql-connector-j:8.0.33") -diff --git a/src/test/java/io/papermc/paper/testing/DummyServer.java b/src/test/java/io/papermc/paper/testing/DummyServer.java -new file mode 100644 -index 0000000000000000000000000000000000000000..e944e9dca13883c57e93e480ae5adfe51c342532 ---- /dev/null -+++ b/src/test/java/io/papermc/paper/testing/DummyServer.java -@@ -0,0 +1,67 @@ -+package io.papermc.paper.testing; -+ -+import java.util.logging.Logger; -+import org.bukkit.Bukkit; -+import org.bukkit.Material; -+import org.bukkit.NamespacedKey; -+import org.bukkit.Server; -+import org.bukkit.command.SimpleCommandMap; -+import org.bukkit.craftbukkit.CraftRegistry; -+import org.bukkit.craftbukkit.block.data.CraftBlockData; -+import org.bukkit.craftbukkit.inventory.CraftItemFactory; -+import org.bukkit.craftbukkit.util.CraftMagicNumbers; -+import org.bukkit.craftbukkit.util.CraftNamespacedKey; -+import org.bukkit.plugin.PluginManager; -+import org.bukkit.plugin.SimplePluginManager; -+import org.bukkit.support.AbstractTestingBase; -+import org.mockito.Mockito; -+ -+import static org.mockito.Mockito.any; -+import static org.mockito.Mockito.mock; -+import static org.mockito.Mockito.when; -+ -+public final class DummyServer { -+ -+ @SuppressWarnings({"deprecation", "removal"}) -+ public static void setup() { -+ //noinspection ConstantValue -+ if (Bukkit.getServer() != null) { -+ return; -+ } -+ -+ final Server dummyServer = mock(Server.class, Mockito.withSettings().stubOnly()); -+ -+ final Logger logger = Logger.getLogger(DummyServer.class.getCanonicalName()); -+ when(dummyServer.getLogger()).thenReturn(logger); -+ when(dummyServer.getName()).thenReturn(DummyServer.class.getSimpleName()); -+ when(dummyServer.getVersion()).thenReturn("Version_" + DummyServer.class.getPackage().getImplementationVersion()); -+ when(dummyServer.getBukkitVersion()).thenReturn("BukkitVersion_" + DummyServer.class.getPackage().getImplementationVersion()); -+ -+ final Thread currentThread = Thread.currentThread(); -+ when(dummyServer.isPrimaryThread()).thenAnswer(ignored -> Thread.currentThread().equals(currentThread)); -+ -+ when(dummyServer.getItemFactory()).thenReturn(CraftItemFactory.instance()); -+ -+ when(dummyServer.getUnsafe()).thenAnswer(ignored -> CraftMagicNumbers.INSTANCE); // lambda for lazy load -+ -+ when(dummyServer.createBlockData(any(Material.class))).thenAnswer(invocation -> { -+ return CraftBlockData.newData(invocation.getArgument(0, Material.class), null); -+ }); -+ -+ when(dummyServer.getLootTable(any(NamespacedKey.class))).thenAnswer(invocation -> { -+ final NamespacedKey key = invocation.getArgument(0, NamespacedKey.class); -+ return new org.bukkit.craftbukkit.CraftLootTable(key, AbstractTestingBase.DATA_PACK.getLootData().getLootTable(CraftNamespacedKey.toMinecraft(key))); -+ }); -+ -+ when(dummyServer.getRegistry(any())).thenAnswer(invocation -> { -+ // LazyRegistry because the vanilla data hasn't been bootstrapped yet. -+ return new LazyRegistry(() -> CraftRegistry.createRegistry(invocation.getArgument(0, Class.class), AbstractTestingBase.REGISTRY_CUSTOM)); -+ }); -+ -+ final PluginManager pluginManager = new SimplePluginManager(dummyServer, new SimpleCommandMap(dummyServer)); -+ when(dummyServer.getPluginManager()).thenReturn(pluginManager); -+ -+ Bukkit.setServer(dummyServer); -+ -+ } -+} -diff --git a/src/test/java/io/papermc/paper/testing/LazyRegistry.java b/src/test/java/io/papermc/paper/testing/LazyRegistry.java -new file mode 100644 -index 0000000000000000000000000000000000000000..8dd0df8c2cc25d37a2590a07872682230a9335f2 ---- /dev/null -+++ b/src/test/java/io/papermc/paper/testing/LazyRegistry.java -@@ -0,0 +1,23 @@ -+package io.papermc.paper.testing; -+ -+import java.util.Iterator; -+import java.util.function.Supplier; -+import org.bukkit.Keyed; -+import org.bukkit.NamespacedKey; -+import org.bukkit.Registry; -+import org.jetbrains.annotations.NotNull; -+import org.jetbrains.annotations.Nullable; -+ -+public record LazyRegistry(Supplier<Registry<Keyed>> supplier) implements Registry<Keyed> { -+ -+ @NotNull -+ @Override -+ public Iterator<Keyed> iterator() { -+ return this.supplier().get().iterator(); -+ } -+ -+ @Override -+ public @Nullable Keyed get(@NotNull final NamespacedKey key) { -+ return this.supplier().get().get(key); -+ } -+} -diff --git a/src/test/java/org/bukkit/support/AbstractTestingBase.java b/src/test/java/org/bukkit/support/AbstractTestingBase.java -index 1b875fc4dc5550ffab21d11e0c2451a2b22250f9..c440dcf3cc2ddb8fd9094fe8495e820ae7797f5c 100644 ---- a/src/test/java/org/bukkit/support/AbstractTestingBase.java -+++ b/src/test/java/org/bukkit/support/AbstractTestingBase.java -@@ -53,6 +53,7 @@ public abstract class AbstractTestingBase { - LayeredRegistryAccess<RegistryLayer> layers = RegistryLayer.createRegistryAccess(); - layers = WorldLoader.loadAndReplaceLayer(resourceManager, layers, RegistryLayer.WORLDGEN, RegistryDataLoader.WORLDGEN_REGISTRIES); - REGISTRY_CUSTOM = layers.compositeAccess().freeze(); -+ io.papermc.paper.testing.DummyServer.setup(); // Paper - // Register vanilla pack - DATA_PACK = ReloadableServerResources.loadResources(resourceManager, REGISTRY_CUSTOM, FeatureFlags.REGISTRY.allFlags(), Commands.CommandSelection.DEDICATED, 0, MoreExecutors.directExecutor(), MoreExecutors.directExecutor()).join(); - // Bind tags -@@ -60,7 +61,6 @@ public abstract class AbstractTestingBase { - // Biome shortcut - BIOMES = REGISTRY_CUSTOM.registryOrThrow(Registries.BIOME); - -- DummyServer.setup(); - DummyEnchantments.setup(); - - ImmutableList.Builder<Material> builder = ImmutableList.builder(); diff --git a/src/test/java/org/bukkit/support/DummyServer.java b/src/test/java/org/bukkit/support/DummyServer.java -deleted file mode 100644 -index e3197ea88b68de8f893f3fa986507b95b789645d..0000000000000000000000000000000000000000 +index a9535199b39d03652f1235d4a920b795306f4ec9..5f0918e2d24a423f00b6cbd94a938bf4f1c0aae1 100644 --- a/src/test/java/org/bukkit/support/DummyServer.java -+++ /dev/null -@@ -1,127 +0,0 @@ --package org.bukkit.support; -- --import java.lang.reflect.InvocationHandler; --import java.lang.reflect.Method; --import java.lang.reflect.Proxy; --import java.util.HashMap; --import java.util.logging.Logger; --import org.bukkit.Bukkit; --import org.bukkit.Material; --import org.bukkit.NamespacedKey; --import org.bukkit.Server; --import org.bukkit.craftbukkit.CraftLootTable; --import org.bukkit.craftbukkit.CraftRegistry; --import org.bukkit.craftbukkit.block.data.CraftBlockData; --import org.bukkit.craftbukkit.inventory.CraftItemFactory; --import org.bukkit.craftbukkit.util.CraftMagicNumbers; --import org.bukkit.craftbukkit.util.CraftNamespacedKey; --import org.bukkit.craftbukkit.util.Versioning; -- --public final class DummyServer implements InvocationHandler { -- private static interface MethodHandler { -- Object handle(DummyServer server, Object[] args); -- } -- private static final HashMap<Method, MethodHandler> methods = new HashMap<Method, MethodHandler>(); -- static { -- try { -- methods.put( -- Server.class.getMethod("getItemFactory"), -- new MethodHandler() { -- @Override -- public Object handle(DummyServer server, Object[] args) { -- return CraftItemFactory.instance(); -- } -- } -- ); -- methods.put( -- Server.class.getMethod("getName"), -- new MethodHandler() { -- @Override -- public Object handle(DummyServer server, Object[] args) { -- return DummyServer.class.getName(); -- } -- } -- ); -- methods.put( -- Server.class.getMethod("getVersion"), -- new MethodHandler() { -- @Override -- public Object handle(DummyServer server, Object[] args) { -- return DummyServer.class.getPackage().getImplementationVersion(); -- } -- } -- ); -- methods.put( -- Server.class.getMethod("getBukkitVersion"), -- new MethodHandler() { -- @Override -- public Object handle(DummyServer server, Object[] args) { -- return Versioning.getBukkitVersion(); -- } -- } -- ); -- methods.put( -- Server.class.getMethod("getLogger"), -- new MethodHandler() { -- final Logger logger = Logger.getLogger(DummyServer.class.getCanonicalName()); -- @Override -- public Object handle(DummyServer server, Object[] args) { -- return logger; -- } -- } -- ); -- methods.put( -- Server.class.getMethod("getUnsafe"), -- new MethodHandler() { -- @Override -- public Object handle(DummyServer server, Object[] args) { -- return CraftMagicNumbers.INSTANCE; -- } -- } -- ); -- methods.put( -- Server.class.getMethod("createBlockData", Material.class), -- new MethodHandler() { -- final Logger logger = Logger.getLogger(DummyServer.class.getCanonicalName()); -- @Override -- public Object handle(DummyServer server, Object[] args) { -- return CraftBlockData.newData((Material) args[0], null); -- } -- } -- ); -- methods.put(Server.class.getMethod("getLootTable", NamespacedKey.class), -- new MethodHandler() { -- @Override -- public Object handle(DummyServer server, Object[] args) { -- NamespacedKey key = (NamespacedKey) args[0]; -- return new CraftLootTable(key, AbstractTestingBase.DATA_PACK.getLootData().getLootTable(CraftNamespacedKey.toMinecraft(key))); -- } -- } -- ); -- methods.put(Server.class.getMethod("getRegistry", Class.class), -- new MethodHandler() { -- @Override -- public Object handle(DummyServer server, Object[] args) { -- return CraftRegistry.createRegistry((Class) args[0], AbstractTestingBase.REGISTRY_CUSTOM); -- } -- } -- ); -- Bukkit.setServer(Proxy.getProxyClass(Server.class.getClassLoader(), Server.class).asSubclass(Server.class).getConstructor(InvocationHandler.class).newInstance(new DummyServer())); -- } catch (Throwable t) { -- throw new Error(t); -- } -- } -- -- public static void setup() {} -- -- private DummyServer() {}; -- -- @Override -- public Object invoke(Object proxy, Method method, Object[] args) { -- MethodHandler handler = DummyServer.methods.get(method); -- if (handler != null) { -- return handler.handle(this, args); -- } -- throw new UnsupportedOperationException(String.valueOf(method)); -- } --} ++++ b/src/test/java/org/bukkit/support/DummyServer.java +@@ -117,6 +117,12 @@ public final class DummyServer { + + return null; + }); ++ // Paper start - test changes ++ final Thread currentThread = Thread.currentThread(); ++ Mockito.when(instance.isPrimaryThread()).thenAnswer(ignored -> Thread.currentThread().equals(currentThread)); ++ final org.bukkit.plugin.PluginManager pluginManager = new org.bukkit.plugin.SimplePluginManager(instance, new org.bukkit.command.SimpleCommandMap(instance)); ++ Mockito.when(instance.getPluginManager()).thenReturn(pluginManager); ++ // Paper end + + Bukkit.setServer(instance); + } catch (Throwable t) { diff --git a/patches/server/0005-Paper-config-files.patch b/patches/server/0005-Paper-config-files.patch index a78a136c6f..8a0a8276b6 100644 --- a/patches/server/0005-Paper-config-files.patch +++ b/patches/server/0005-Paper-config-files.patch @@ -14,13 +14,13 @@ public org.spigotmc.SpigotWorldConfig getString(Ljava/lang/String;Ljava/lang/Str public net.minecraft.world.level.NaturalSpawner SPAWNING_CATEGORIES diff --git a/build.gradle.kts b/build.gradle.kts -index 952dde5d0d9fa6bcf97ae5cafe482cca1f5b3a78..9ab4d3e462c02e4d23b45adb46965eb75eb2178e 100644 +index e9b9efb8e0649ef34696ccd41863095c653a0b6c..f0386dc61dbcf4134e081e6024a5c0e8e8aa4fdb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -13,6 +13,7 @@ dependencies { +@@ -12,6 +12,7 @@ dependencies { + implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion implementation("org.ow2.asm:asm:9.4") implementation("org.ow2.asm:asm-commons:9.4") // Paper - ASM event executor generation - testImplementation("org.mockito:mockito-core:4.9.0") // Paper - switch to mockito + implementation("org.spongepowered:configurate-yaml:4.1.2") // Paper - config files implementation("commons-lang:commons-lang:2.6") runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.0") @@ -4585,10 +4585,10 @@ index cda55e481ddbcc1de5478125c5db20ebba168e7d..bacd4d875642cd93c3185f788745dd73 this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 56ad43d30f5dfec7564edab364328d32313501db..84c9a7f5ecb47f6a95ca89ecfcdba663fef803ae 100644 +index 71ae76cea35b0f78afcae52dbcfe52870140188e..fcf461c4cbbac295ea4067e1108914afb221014e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -910,6 +910,7 @@ public final class CraftServer implements Server { +@@ -921,6 +921,7 @@ public final class CraftServer implements Server { } org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot @@ -4597,7 +4597,7 @@ index 56ad43d30f5dfec7564edab364328d32313501db..84c9a7f5ecb47f6a95ca89ecfcdba663 world.serverLevelData.setDifficulty(config.difficulty); world.setSpawnSettings(config.spawnMonsters, config.spawnAnimals); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index f3412dbbb0f37d5625ab05cfd502189ab4a343c2..60ca15373b489941555315bf6fb311326670e7de 100644 +index f8326c3450f07a81ffdef6c8097f6bb5bfefe450..fc4f32a6c7a4df2215a6a41c920b1b91bf1c171b 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -141,6 +141,19 @@ public class Main { @@ -4681,13 +4681,13 @@ index 0000000000000000000000000000000000000000..0396589795da1f83ddf62426236dde9a + } +} diff --git a/src/test/java/org/bukkit/support/AbstractTestingBase.java b/src/test/java/org/bukkit/support/AbstractTestingBase.java -index c440dcf3cc2ddb8fd9094fe8495e820ae7797f5c..d1fd4cf65c31bc00d0bffa3123fc2223f1498a34 100644 +index e5f67b9c6715fa6874ccde566216feec464b67b8..fd20765850a69b014974e1b10a144ee5e4b36511 100644 --- a/src/test/java/org/bukkit/support/AbstractTestingBase.java +++ b/src/test/java/org/bukkit/support/AbstractTestingBase.java -@@ -62,6 +62,7 @@ public abstract class AbstractTestingBase { +@@ -61,6 +61,7 @@ public abstract class AbstractTestingBase { BIOMES = REGISTRY_CUSTOM.registryOrThrow(Registries.BIOME); - DummyEnchantments.setup(); + DummyServer.setup(); + io.papermc.paper.configuration.GlobalConfigTestingBase.setupGlobalConfigForTest(); // Paper ImmutableList.Builder<Material> builder = ImmutableList.builder(); diff --git a/patches/server/0008-CB-fixes.patch b/patches/server/0008-CB-fixes.patch index 013b5023df..c9d31dd3bb 100644 --- a/patches/server/0008-CB-fixes.patch +++ b/patches/server/0008-CB-fixes.patch @@ -83,10 +83,10 @@ index 161ad6ab1443b2ce33a2d7d91d189c855db0453b..15a9736a870055d639d03063c7cf67fd this.registryAccess = registryManager; this.structureTemplateManager = structureTemplateManager; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 84c9a7f5ecb47f6a95ca89ecfcdba663fef803ae..c3c30cbb74062fc25c1daf9b17c8956857766306 100644 +index fcf461c4cbbac295ea4067e1108914afb221014e..17d4eea5732ab9954ad089e0a9e1b0837a02805d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2340,7 +2340,13 @@ public final class CraftServer implements Server { +@@ -2354,7 +2354,13 @@ public final class CraftServer implements Server { Preconditions.checkArgument(key != null, "NamespacedKey key cannot be null"); LootDataManager registry = this.getServer().getLootData(); diff --git a/patches/server/0009-MC-Utils.patch b/patches/server/0009-MC-Utils.patch index 5a0111aeda..6419eaf2c2 100644 --- a/patches/server/0009-MC-Utils.patch +++ b/patches/server/0009-MC-Utils.patch @@ -7307,10 +7307,10 @@ index 25156be63f91a1c41ef41154f675d04eb97459a8..47bab513feec217d875192afef61f3af return false; } else { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index ee22b5419098834c3b388bbf78d6bd6d7951964a..379b8a7d94c784db54ada01ad6bd04a54f8a089f 100644 +index 000971e29c5b35049742dbf32cdbb7c8daafb4e3..b017d7cdf2815c6daa4226de4a67c013218498aa 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -242,8 +242,8 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -243,8 +243,8 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public Chunk[] getLoadedChunks() { @@ -7321,7 +7321,7 @@ index ee22b5419098834c3b388bbf78d6bd6d7951964a..379b8a7d94c784db54ada01ad6bd04a5 } @Override -@@ -318,7 +318,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -319,7 +319,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean refreshChunk(int x, int z) { @@ -7330,7 +7330,7 @@ index ee22b5419098834c3b388bbf78d6bd6d7951964a..379b8a7d94c784db54ada01ad6bd04a5 if (playerChunk == null) return false; playerChunk.getTickingChunkFuture().thenAccept(either -> { -@@ -1970,4 +1970,32 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1965,4 +1965,32 @@ public class CraftWorld extends CraftRegionAccessor implements World { return this.spigot; } // Spigot end @@ -7364,10 +7364,10 @@ index ee22b5419098834c3b388bbf78d6bd6d7951964a..379b8a7d94c784db54ada01ad6bd04a5 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index bcf8d0316386cbf4d90b73f7530acbcf554be55d..61304b316985462e898a1b80f872b716a33207c6 100644 +index d69b870638b141003161354b5f04f7c7d682cc72..b1f5159da7858c25d01e98d19a65f4be208964b1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1175,4 +1175,37 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1190,4 +1190,37 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return this.spigot; } // Spigot end @@ -7628,11 +7628,11 @@ index 0000000000000000000000000000000000000000..909b2c98e7a9117d2f737245e4661792 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index afde61e784dada8df1f34bd15b1d3b71e842bb52..6deffd223ff995d83244e941576f8286e1171c1f 100644 +index 6bd320b6742f614ebc589c44ad4cbcfa099bcd4e..d31cf9cc09e5d92f62ee8ea545f53a0c79952479 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -104,8 +104,17 @@ public final class CraftMagicNumbers implements UnsafeValues { - private static final BiMap<net.minecraft.world.level.material.Fluid, Fluid> FLUIDTYPE_FLUID = HashBiMap.create(); +@@ -117,8 +117,17 @@ public final class CraftMagicNumbers implements UnsafeValues { + private static final Map<Item, Material> ITEM_MATERIAL = new HashMap<>(); private static final Map<Material, Item> MATERIAL_ITEM = new HashMap<>(); private static final Map<Material, Block> MATERIAL_BLOCK = new HashMap<>(); + // Paper start @@ -7642,14 +7642,14 @@ index afde61e784dada8df1f34bd15b1d3b71e842bb52..6deffd223ff995d83244e941576f8286 static { + for (org.bukkit.entity.EntityType type : org.bukkit.entity.EntityType.values()) { + if (type == org.bukkit.entity.EntityType.UNKNOWN) continue; -+ ENTITY_TYPE_ENTITY_TYPES.put(type, BuiltInRegistries.ENTITY_TYPE.get(CraftNamespacedKey.toMinecraft(type.getKey()))); -+ ENTITY_TYPES_ENTITY_TYPE.put(BuiltInRegistries.ENTITY_TYPE.get(CraftNamespacedKey.toMinecraft(type.getKey())), type); ++ ENTITY_TYPE_ENTITY_TYPES.put(type, net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.get(CraftNamespacedKey.toMinecraft(type.getKey()))); ++ ENTITY_TYPES_ENTITY_TYPE.put(net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.get(CraftNamespacedKey.toMinecraft(type.getKey())), type); + } + // Paper end - for (Block block : BuiltInRegistries.BLOCK) { - BLOCK_MATERIAL.put(block, Material.getMaterial(BuiltInRegistries.BLOCK.getKey(block).getPath().toUpperCase(Locale.ROOT))); + for (Block block : CraftRegistry.getMinecraftRegistry().registryOrThrow(Registries.BLOCK)) { + BLOCK_MATERIAL.put(block, Material.getMaterial(CraftRegistry.getMinecraftRegistry().registryOrThrow(Registries.BLOCK).getKey(block).getPath().toUpperCase(Locale.ROOT))); } -@@ -169,6 +178,14 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -173,6 +182,14 @@ public final class CraftMagicNumbers implements UnsafeValues { public static ResourceLocation key(Material mat) { return CraftNamespacedKey.toMinecraft(mat.getKey()); } @@ -7664,6 +7664,20 @@ index afde61e784dada8df1f34bd15b1d3b71e842bb52..6deffd223ff995d83244e941576f8286 // ======================================================================== public static byte toLegacyData(BlockState data) { +@@ -209,6 +226,13 @@ public final class CraftMagicNumbers implements UnsafeValues { + return material; + } + ++ // Paper start ++ @Override ++ public org.bukkit.Material blockTypeToMaterial(final org.bukkit.block.BlockType<?> blockType) { ++ return toMaterial(blockType); ++ } ++ // Paper end ++ + @Override + public BlockData fromLegacy(Material material, byte data) { + return CraftBlockData.fromData(CraftMagicNumbers.getBlock(material, data)); diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java index d2026d218405a40a6949c5f491c04704811b72b5..629178347039893fb9de710810fe8112499bb91c 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java diff --git a/patches/server/0010-Adventure.patch b/patches/server/0010-Adventure.patch index ee402ab423..84ff0d47a9 100644 --- a/patches/server/0010-Adventure.patch +++ b/patches/server/0010-Adventure.patch @@ -2387,7 +2387,7 @@ index ba89c0d7ae99e53350249365d0e035e6f14e1c5f..dc87e56cfcd59bc1505f5b3c0363038e // CraftBukkit end this.chatVisibility = packet.chatVisibility(); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index a7b85cf4fbdb04747e46f49293a2e63c744cdc5e..fa3d02895d57c17416e742d2ea1e51253bce4fad 100644 +index 6d45649b3e511cc6ce6222d64969ddf4cb38544d..186fe9023d5015ab642143265a7aa3b4660fdfad 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -187,6 +187,8 @@ import net.minecraft.world.phys.shapes.VoxelShape; @@ -2878,10 +2878,10 @@ index 614e567eb1ef10ac7514909a8425e29ac3627d3d..60596c4ac2ebb8caf19d65591624275b } collection = icons; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index c3c30cbb74062fc25c1daf9b17c8956857766306..85867893da6bb4f24e86c32ea9fd5ff5b5684dbb 100644 +index 17d4eea5732ab9954ad089e0a9e1b0837a02805d..c531cc39dcc4a85cd58b93c5c2ba6e0c55e8e455 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -608,8 +608,10 @@ public final class CraftServer implements Server { +@@ -619,8 +619,10 @@ public final class CraftServer implements Server { } @Override @@ -2892,7 +2892,7 @@ index c3c30cbb74062fc25c1daf9b17c8956857766306..85867893da6bb4f24e86c32ea9fd5ff5 } @Override -@@ -1465,7 +1467,15 @@ public final class CraftServer implements Server { +@@ -1476,7 +1478,15 @@ public final class CraftServer implements Server { return this.configuration.getInt("settings.spawn-radius", -1); } @@ -2908,7 +2908,7 @@ index c3c30cbb74062fc25c1daf9b17c8956857766306..85867893da6bb4f24e86c32ea9fd5ff5 public String getShutdownMessage() { return this.configuration.getString("settings.shutdown-message"); } -@@ -1633,7 +1643,20 @@ public final class CraftServer implements Server { +@@ -1644,7 +1654,20 @@ public final class CraftServer implements Server { } @Override @@ -2929,7 +2929,7 @@ index c3c30cbb74062fc25c1daf9b17c8956857766306..85867893da6bb4f24e86c32ea9fd5ff5 Set<CommandSender> recipients = new HashSet<>(); for (Permissible permissible : this.getPluginManager().getPermissionSubscriptions(permission)) { if (permissible instanceof CommandSender && permissible.hasPermission(permission)) { -@@ -1641,14 +1664,14 @@ public final class CraftServer implements Server { +@@ -1652,14 +1675,14 @@ public final class CraftServer implements Server { } } @@ -2946,7 +2946,7 @@ index c3c30cbb74062fc25c1daf9b17c8956857766306..85867893da6bb4f24e86c32ea9fd5ff5 for (CommandSender recipient : recipients) { recipient.sendMessage(message); -@@ -1900,6 +1923,14 @@ public final class CraftServer implements Server { +@@ -1911,6 +1934,14 @@ public final class CraftServer implements Server { return CraftInventoryCreator.INSTANCE.createInventory(owner, type); } @@ -2961,7 +2961,7 @@ index c3c30cbb74062fc25c1daf9b17c8956857766306..85867893da6bb4f24e86c32ea9fd5ff5 @Override public Inventory createInventory(InventoryHolder owner, InventoryType type, String title) { Preconditions.checkArgument(type != null, "InventoryType cannot be null"); -@@ -1914,13 +1945,28 @@ public final class CraftServer implements Server { +@@ -1925,13 +1956,28 @@ public final class CraftServer implements Server { return CraftInventoryCreator.INSTANCE.createInventory(owner, size); } @@ -2990,7 +2990,7 @@ index c3c30cbb74062fc25c1daf9b17c8956857766306..85867893da6bb4f24e86c32ea9fd5ff5 public Merchant createMerchant(String title) { return new CraftMerchantCustom(title == null ? InventoryType.MERCHANT.getDefaultTitle() : title); } -@@ -1985,6 +2031,17 @@ public final class CraftServer implements Server { +@@ -1996,6 +2042,17 @@ public final class CraftServer implements Server { return Thread.currentThread().equals(console.serverThread) || this.console.hasStopped() || !org.spigotmc.AsyncCatcher.enabled; // All bets are off if we have shut down (e.g. due to watchdog) } @@ -3008,7 +3008,7 @@ index c3c30cbb74062fc25c1daf9b17c8956857766306..85867893da6bb4f24e86c32ea9fd5ff5 @Override public String getMotd() { return this.console.getMotd(); -@@ -2419,4 +2476,53 @@ public final class CraftServer implements Server { +@@ -2433,4 +2490,53 @@ public final class CraftServer implements Server { return this.spigot; } // Spigot end @@ -3062,11 +3062,29 @@ index c3c30cbb74062fc25c1daf9b17c8956857766306..85867893da6bb4f24e86c32ea9fd5ff5 + } + // Paper end } +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftSound.java b/src/main/java/org/bukkit/craftbukkit/CraftSound.java +index 77c021ad391883d00a0a6edf20365d3d9fb1b9c1..ae1bc31c6fbeaf69c6cca137875edf5235bdcb42 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftSound.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftSound.java +@@ -80,6 +80,13 @@ public class CraftSound extends Sound { + return this.ordinal; + } + ++ // Paper start - Adventure ++ @Override ++ public net.kyori.adventure.key.Key key() { ++ return this.key; ++ } ++ // Paper end ++ + @Override + public String toString() { + // For backwards compatibility diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 379b8a7d94c784db54ada01ad6bd04a54f8a089f..73f61f2b0c0aeefabb7b7bba7ca37914751dcc42 100644 +index b017d7cdf2815c6daa4226de4a67c013218498aa..c71753ced37243fa876387da282d424fe26cfecd 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -152,6 +152,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -153,6 +153,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { private final BlockMetadataStore blockMetadata = new BlockMetadataStore(this); private final Object2IntOpenHashMap<SpawnCategory> spawnCategoryLimit = new Object2IntOpenHashMap<>(); private final CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftWorld.DATA_TYPE_REGISTRY); @@ -3074,7 +3092,7 @@ index 379b8a7d94c784db54ada01ad6bd04a54f8a089f..73f61f2b0c0aeefabb7b7bba7ca37914 private static final Random rand = new Random(); -@@ -1603,6 +1604,39 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1597,6 +1598,39 @@ public class CraftWorld extends CraftRegionAccessor implements World { entityTracker.broadcastAndSend(packet); } } @@ -3114,7 +3132,7 @@ index 379b8a7d94c784db54ada01ad6bd04a54f8a089f..73f61f2b0c0aeefabb7b7bba7ca37914 private static Map<String, GameRules.Key<?>> gamerules; public static synchronized Map<String, GameRules.Key<?>> getGameRulesNMS() { -@@ -1997,5 +2031,18 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1992,5 +2026,18 @@ public class CraftWorld extends CraftRegionAccessor implements World { return ret; } @@ -3134,7 +3152,7 @@ index 379b8a7d94c784db54ada01ad6bd04a54f8a089f..73f61f2b0c0aeefabb7b7bba7ca37914 // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 60ca15373b489941555315bf6fb311326670e7de..15b886634112b2a18b7952107b49ae1430376a3d 100644 +index fc4f32a6c7a4df2215a6a41c920b1b91bf1c171b..9327413e674ebcf5c94413a37ad47837da72b57d 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -20,6 +20,12 @@ public class Main { @@ -3151,10 +3169,10 @@ index 60ca15373b489941555315bf6fb311326670e7de..15b886634112b2a18b7952107b49ae14 OptionParser parser = new OptionParser() { { diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java -index 9d55f36f146435f0cfb4e62ffa7c94eab404a596..c186a44b927188ed222f8b2f8f76aaef35d9c654 100644 +index 279a2efaa434c9735737e865c645f51e28d58449..30b5b18de94dd3e77b6926b62fb453720f8a23e3 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java -@@ -68,6 +68,19 @@ public class CraftBeacon extends CraftBlockEntityState<BeaconBlockEntity> implem +@@ -67,6 +67,19 @@ public class CraftBeacon extends CraftBlockEntityState<BeaconBlockEntity> implem this.getSnapshot().secondaryPower = (effect != null) ? MobEffect.byId(effect.getId()) : null; } @@ -3521,10 +3539,10 @@ index 8107ed0d248ff2a1cf8e556b7610a68f6c197691..eaff8df6c8c12c64e005a68a02e2e35e + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java -index f6c614bb1184f9c79121f64a2a030bf3f094b671..e8334e2264510f5101e80b4f130e7ae1442560d7 100644 +index 17191969de6bad1bc08cfa6d62f0a2a81a684db9..62b75098ae26cbcc331d3b23940b7da46ccf2cfe 100644 --- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java +++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java -@@ -189,6 +189,12 @@ public class CraftEnchantment extends Enchantment { +@@ -117,6 +117,12 @@ public class CraftEnchantment extends Enchantment { CraftEnchantment ench = (CraftEnchantment) other; return !this.target.isCompatibleWith(ench.target); } @@ -3538,18 +3556,18 @@ index f6c614bb1184f9c79121f64a2a030bf3f094b671..e8334e2264510f5101e80b4f130e7ae1 public net.minecraft.world.item.enchantment.Enchantment getHandle() { return this.target; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 61304b316985462e898a1b80f872b716a33207c6..11645e01924b4a66aa4f425c8962a000be761912 100644 +index b1f5159da7858c25d01e98d19a65f4be208964b1..7bd8b6d7af56d7d6426f420773c1b0e109002b31 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -202,6 +202,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { - protected Entity entity; +@@ -207,6 +207,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { + private final EntityType entityType; private EntityDamageEvent lastDamageEvent; private final CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftEntity.DATA_TYPE_REGISTRY); + protected net.kyori.adventure.pointer.Pointers adventure$pointers; // Paper - implement pointers public CraftEntity(final CraftServer server, final Entity entity) { this.server = server; -@@ -853,6 +854,32 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -864,6 +865,32 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return this.getHandle().getVehicle().getBukkitEntity(); } @@ -3582,7 +3600,7 @@ index 61304b316985462e898a1b80f872b716a33207c6..11645e01924b4a66aa4f425c8962a000 @Override public void setCustomName(String name) { // sane limit for name length -@@ -932,6 +959,17 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -943,6 +970,17 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { public String getName() { return CraftChatMessage.fromComponent(this.getHandle().getName()); } @@ -3601,10 +3619,10 @@ index 61304b316985462e898a1b80f872b716a33207c6..11645e01924b4a66aa4f425c8962a000 @Override public boolean isPermissionSet(String name) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 3421498e8e5fe2e22d6b31d9cf6b3337553e1c5f..abe978078270a45f7e77eb2b8a99309f12ca51ee 100644 +index 1113d833160e0bad2b0780d3869bc10353daa737..0a2e7787d4c9cce973174fc21edbf18d400aa62b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -320,9 +320,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -322,9 +322,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { container = CraftEventFactory.callInventoryOpenEvent(player, container); if (container == null) return; @@ -3619,7 +3637,7 @@ index 3421498e8e5fe2e22d6b31d9cf6b3337553e1c5f..abe978078270a45f7e77eb2b8a99309f player.containerMenu = container; player.initMenu(container); } -@@ -391,8 +394,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -393,8 +396,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { // Now open the window MenuType<?> windowType = CraftContainer.getNotchInventoryType(inventory.getTopInventory()); @@ -3635,10 +3653,10 @@ index 3421498e8e5fe2e22d6b31d9cf6b3337553e1c5f..abe978078270a45f7e77eb2b8a99309f player.initMenu(container); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java -index 446fdca49a5a6999626a7ee3a1d5c168b15a09dd..f9863e138994f6c7a7975a852f106faa96d52315 100644 +index 10fa80df3ae2406f34af669f89d087b15ad1d71b..66fb6aeb49b7e93d2a4d9b5ce7f1a7d68f571cf5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java -@@ -65,6 +65,13 @@ public class CraftMinecartCommand extends CraftMinecart implements CommandMineca +@@ -59,6 +59,13 @@ public class CraftMinecartCommand extends CraftMinecart implements CommandMineca return CraftChatMessage.fromComponent(this.getHandle().getCommandBlock().getName()); } @@ -3653,7 +3671,7 @@ index 446fdca49a5a6999626a7ee3a1d5c168b15a09dd..f9863e138994f6c7a7975a852f106faa public boolean isOp() { return true; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 39a6c870c08ae5847dc5859316b1b616b3a0fa5b..41ec9e0adb2a17f8cab4fb1f1735d8b2679f92d0 100644 +index 2c31e13f6a9b7f5d0add02a688149f21a4904d8f..c0c0eef5eca6e561eb3aa46301e2fc4e40328754 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -286,14 +286,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3772,7 +3790,7 @@ index 39a6c870c08ae5847dc5859316b1b616b3a0fa5b..41ec9e0adb2a17f8cab4fb1f1735d8b2 @Override public void setCompassTarget(Location loc) { Preconditions.checkArgument(loc != null, "Location cannot be null"); -@@ -673,6 +715,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -665,6 +707,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().connection.send(packet); } @@ -3797,7 +3815,7 @@ index 39a6c870c08ae5847dc5859316b1b616b3a0fa5b..41ec9e0adb2a17f8cab4fb1f1735d8b2 @Override public void sendSignChange(Location loc, String[] lines) { this.sendSignChange(loc, lines, DyeColor.BLACK); -@@ -696,6 +756,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -688,6 +748,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (this.getHandle().connection == null) return; Component[] components = CraftSign.sanitizeLines(lines); @@ -3809,7 +3827,7 @@ index 39a6c870c08ae5847dc5859316b1b616b3a0fa5b..41ec9e0adb2a17f8cab4fb1f1735d8b2 SignBlockEntity sign = new SignBlockEntity(CraftLocation.toBlockPosition(loc), Blocks.OAK_SIGN.defaultBlockState()); SignText text = sign.getFrontText(); text = text.setColor(net.minecraft.world.item.DyeColor.byId(dyeColor.getWoolData())); -@@ -705,7 +770,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -697,7 +762,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } sign.setText(text, true); @@ -3819,7 +3837,7 @@ index 39a6c870c08ae5847dc5859316b1b616b3a0fa5b..41ec9e0adb2a17f8cab4fb1f1735d8b2 } @Override -@@ -1606,7 +1672,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1628,7 +1694,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setResourcePack(String url) { @@ -3828,7 +3846,7 @@ index 39a6c870c08ae5847dc5859316b1b616b3a0fa5b..41ec9e0adb2a17f8cab4fb1f1735d8b2 } @Override -@@ -1621,7 +1687,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1643,7 +1709,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setResourcePack(String url, byte[] hash, boolean force) { @@ -3837,7 +3855,7 @@ index 39a6c870c08ae5847dc5859316b1b616b3a0fa5b..41ec9e0adb2a17f8cab4fb1f1735d8b2 } @Override -@@ -1637,6 +1703,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1659,6 +1725,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } } @@ -3859,7 +3877,7 @@ index 39a6c870c08ae5847dc5859316b1b616b3a0fa5b..41ec9e0adb2a17f8cab4fb1f1735d8b2 public void addChannel(String channel) { Preconditions.checkState(this.channels.size() < 128, "Cannot register channel '%s'. Too many channels registered!", channel); channel = StandardMessenger.validateAndCorrectChannel(channel); -@@ -2028,6 +2109,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2046,6 +2127,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return (this.getHandle().clientViewDistance == null) ? Bukkit.getViewDistance() : this.getHandle().clientViewDistance; } @@ -3872,7 +3890,7 @@ index 39a6c870c08ae5847dc5859316b1b616b3a0fa5b..41ec9e0adb2a17f8cab4fb1f1735d8b2 @Override public int getPing() { return this.getHandle().latency; -@@ -2078,6 +2165,252 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2096,6 +2183,252 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.getHandle().allowsListing(); } @@ -4126,10 +4144,10 @@ index 39a6c870c08ae5847dc5859316b1b616b3a0fa5b..41ec9e0adb2a17f8cab4fb1f1735d8b2 private final Player.Spigot spigot = new Player.Spigot() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTextDisplay.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTextDisplay.java -index 2becf197a5c2d94f23f72a9b20cb2cd05a0807df..99096c1e3f045e4a99335faedfb8e77e99690299 100644 +index 32970ba22772da377d8ad61d7f7fae16671bbbf4..b377fb9a6a703578652fcb351df01c50a6ed32b4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTextDisplay.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTextDisplay.java -@@ -38,6 +38,17 @@ public class CraftTextDisplay extends CraftDisplay implements TextDisplay { +@@ -32,6 +32,17 @@ public class CraftTextDisplay extends CraftDisplay implements TextDisplay { public void setText(String text) { this.getHandle().setText(CraftChatMessage.fromString(text, true)[0]); } @@ -4148,10 +4166,10 @@ index 2becf197a5c2d94f23f72a9b20cb2cd05a0807df..99096c1e3f045e4a99335faedfb8e77e @Override public int getLineWidth() { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 5f994a64bf29545a528b91604c1f2e19bcfd9b2f..e0bb58d92e47516138261a673b56c5f8ce68a59c 100644 +index f906254e9ce3a78fb33b6b2e8d20f124205eb83c..2a3381221de4027ad4a780c7fb832fb4397165ae 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -838,9 +838,9 @@ public class CraftEventFactory { +@@ -844,9 +844,9 @@ public class CraftEventFactory { return event; } @@ -4163,7 +4181,7 @@ index 5f994a64bf29545a528b91604c1f2e19bcfd9b2f..e0bb58d92e47516138261a673b56c5f8 event.setKeepInventory(keepInventory); event.setKeepLevel(victim.keepLevel); // SPIGOT-2222: pre-set keepLevel org.bukkit.World world = entity.getWorld(); -@@ -865,7 +865,7 @@ public class CraftEventFactory { +@@ -871,7 +871,7 @@ public class CraftEventFactory { * Server methods */ public static ServerListPingEvent callServerListPingEvent(Server craftServer, InetAddress address, String motd, int numPlayers, int maxPlayers) { @@ -4295,12 +4313,12 @@ index 4dd9a80af9901287ab6740b072f2b89678c3d0cb..b2586684295b295a3196a2a9cf724cec public String getTitle() { return this.title; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index fb58cfd68c8ababbf9486c9a5a1795b1ac9d5817..b187c4f436ac44a529675869dbf5bfddc4fac86f 100644 +index f794f4c9cc4df1884d64330386438e51353788ce..3d5e8633e3d457bcd9f23b53eb916096249c3af2 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -437,4 +437,17 @@ public final class CraftItemFactory implements ItemFactory { - public Material updateMaterial(ItemMeta meta, Material material) throws IllegalArgumentException { - return ((CraftMetaItem) meta).updateMaterial(material); +@@ -285,4 +285,17 @@ public final class CraftItemFactory implements ItemFactory { + throw new IllegalArgumentException("Could not parse ItemStack: " + input, ex); + } } + + // Paper start @@ -4357,7 +4375,7 @@ index 9e05a8515c5f6f340182e91150fcad8bbf80a22b..adf22ce4f0bcd3bd57dc2030c6c92d3d @Override public CraftMerchant getCraftMerchant() { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java -index bd4524fd987877a287680cfa5744ce12045ebfbd..cf928745c36af0e6fa0a95e177395c5fb1aa821a 100644 +index e9693fb49e6bca3ec3f8376ef7a086f9b5f668bb..792c69fa8efbcb06d904d2f1337b7125fcb99575 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java @@ -2,8 +2,9 @@ package org.bukkit.craftbukkit.inventory; @@ -4457,7 +4475,7 @@ index bd4524fd987877a287680cfa5744ce12045ebfbd..cf928745c36af0e6fa0a95e177395c5f + } + + private CraftMetaBook(net.kyori.adventure.text.Component title, net.kyori.adventure.text.Component author, List<net.kyori.adventure.text.Component> pages) { -+ super((org.bukkit.craftbukkit.inventory.CraftMetaItem) org.bukkit.Bukkit.getItemFactory().getItemMeta(org.bukkit.Material.WRITABLE_BOOK)); ++ super((org.bukkit.craftbukkit.inventory.CraftMetaItem) org.bukkit.Bukkit.getItemFactory().getItemMeta(ItemType.WRITABLE_BOOK)); + this.title = title == null ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(title); + this.author = author == null ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(author); + this.pages = pages.subList(0, Math.min(MAX_PAGES, pages.size())).stream().map(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection()::serialize).collect(java.util.stream.Collectors.toList()); @@ -4527,7 +4545,7 @@ index bd4524fd987877a287680cfa5744ce12045ebfbd..cf928745c36af0e6fa0a95e177395c5f if (this.hasTitle()) { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java -index 507fa96a3fb904b74429df5756c9a6378ec8c5b7..abb9e88abc74135284b941e040d4058690a82b27 100644 +index 4a8eb26afd6e23b14c586269e3106d570d48db1c..7e32c0927c7091fa04895f03ae49ce3261ff7988 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java @@ -1,6 +1,6 @@ @@ -4538,7 +4556,7 @@ index 507fa96a3fb904b74429df5756c9a6378ec8c5b7..abb9e88abc74135284b941e040d40586 import java.util.Map; import net.minecraft.nbt.CompoundTag; import org.bukkit.Material; -@@ -78,8 +78,29 @@ class CraftMetaBookSigned extends CraftMetaBook implements BookMeta { +@@ -79,8 +79,29 @@ class CraftMetaBookSigned extends CraftMetaBook implements BookMeta { } @Override @@ -4550,7 +4568,7 @@ index 507fa96a3fb904b74429df5756c9a6378ec8c5b7..abb9e88abc74135284b941e040d40586 + + // Paper start - adventure + private CraftMetaBookSigned(net.kyori.adventure.text.Component title, net.kyori.adventure.text.Component author, java.util.List<net.kyori.adventure.text.Component> pages) { -+ super((org.bukkit.craftbukkit.inventory.CraftMetaItem) org.bukkit.Bukkit.getItemFactory().getItemMeta(Material.WRITABLE_BOOK)); ++ super((org.bukkit.craftbukkit.inventory.CraftMetaItem) org.bukkit.Bukkit.getItemFactory().getItemMeta(ItemType.WRITABLE_BOOK)); + this.title = title == null ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(title); + this.author = author == null ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(author); + this.pages = io.papermc.paper.adventure.PaperAdventure.asJson(pages.subList(0, Math.min(MAX_PAGES, pages.size()))); @@ -4570,10 +4588,10 @@ index 507fa96a3fb904b74429df5756c9a6378ec8c5b7..abb9e88abc74135284b941e040d40586 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 02856de529023f4d63440e2f2cef28e41f2103a7..b01c268d179591a0113e4bfb46f3d6d22933efaf 100644 +index fbfdf768eee98db6d4b103c5eda0e73b2cf7ccc1..aa70e19ae106625ba9768ec9651c75a17c0bb07e 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -749,6 +749,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -754,6 +754,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { return !(this.hasDisplayName() || this.hasLocalizedName() || this.hasEnchants() || (this.lore != null) || this.hasCustomModelData() || this.hasBlockData() || this.hasRepairCost() || !this.unhandledTags.isEmpty() || !this.persistentDataContainer.isEmpty() || this.hideFlag != 0 || this.isUnbreakable() || this.hasDamage() || this.hasAttributeModifiers()); } @@ -4592,7 +4610,7 @@ index 02856de529023f4d63440e2f2cef28e41f2103a7..b01c268d179591a0113e4bfb46f3d6d2 @Override public String getDisplayName() { return CraftChatMessage.fromJSONComponent(displayName); -@@ -784,6 +796,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -789,6 +801,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { return this.lore != null && !this.lore.isEmpty(); } @@ -4917,10 +4935,10 @@ index 78ea79b66cc9e90402ef5cdc2e5e04e0c74b1c26..4fede2161792ba3e7cdf0cc5a1f53318 boolean hadFormat = false; diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 6deffd223ff995d83244e941576f8286e1171c1f..412dce72064533a260db591a94c8b39eb498331d 100644 +index d31cf9cc09e5d92f62ee8ea545f53a0c79952479..14540be85e1ff2c231a4bed4b7a2c2d7df50516a 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -74,6 +74,43 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -79,6 +79,43 @@ public final class CraftMagicNumbers implements UnsafeValues { private CraftMagicNumbers() {} diff --git a/patches/server/0011-Paper-command.patch b/patches/server/0011-Paper-command.patch index 145c4b9074..435facc8ff 100644 --- a/patches/server/0011-Paper-command.patch +++ b/patches/server/0011-Paper-command.patch @@ -615,10 +615,10 @@ index 2ac30ef2dd72582f2b7f6a05b1f94b12b44fafc9..a01d423f44b3e547b4fa4d6654f9df63 this.setPvpAllowed(dedicatedserverproperties.pvp); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 85867893da6bb4f24e86c32ea9fd5ff5b5684dbb..de9e4fd6a11b06e685804e43657d8b6589c6ca1c 100644 +index c531cc39dcc4a85cd58b93c5c2ba6e0c55e8e455..1a4073822fe782c7b99710e8ef63051857a6adcf 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -934,6 +934,7 @@ public final class CraftServer implements Server { +@@ -945,6 +945,7 @@ public final class CraftServer implements Server { this.commandMap.clearCommands(); this.reloadData(); org.spigotmc.SpigotConfig.registerCommands(); // Spigot @@ -626,7 +626,7 @@ index 85867893da6bb4f24e86c32ea9fd5ff5b5684dbb..de9e4fd6a11b06e685804e43657d8b65 this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*"); this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions"); -@@ -2516,6 +2517,34 @@ public final class CraftServer implements Server { +@@ -2530,6 +2531,34 @@ public final class CraftServer implements Server { // Paper end // Paper start diff --git a/patches/server/0013-Paper-Plugins.patch b/patches/server/0013-Paper-Plugins.patch index a3ec0d2db5..535c1f5d0a 100644 --- a/patches/server/0013-Paper-Plugins.patch +++ b/patches/server/0013-Paper-Plugins.patch @@ -6973,10 +6973,10 @@ index 35e7f8e7b19c217fa5f3f55abb0f8b9cd6b16f18..72c2f0bf9434e09a0dd51294d3a2200f Bootstrap.validate(); Util.startTimerHackThread(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index de9e4fd6a11b06e685804e43657d8b6589c6ca1c..5efe98cbcb44727fbbb195ff7007d01c823372b6 100644 +index 1a4073822fe782c7b99710e8ef63051857a6adcf..d8fc6953eded8567273c11bc52a3342702ccc70d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -268,7 +268,8 @@ public final class CraftServer implements Server { +@@ -267,7 +267,8 @@ public final class CraftServer implements Server { private final CraftCommandMap commandMap = new CraftCommandMap(this); private final SimpleHelpMap helpMap = new SimpleHelpMap(this); private final StandardMessenger messenger = new StandardMessenger(); @@ -6986,7 +6986,7 @@ index de9e4fd6a11b06e685804e43657d8b6589c6ca1c..5efe98cbcb44727fbbb195ff7007d01c private final StructureManager structureManager; protected final DedicatedServer console; protected final DedicatedPlayerList playerList; -@@ -418,24 +419,7 @@ public final class CraftServer implements Server { +@@ -429,24 +430,7 @@ public final class CraftServer implements Server { } public void loadPlugins() { @@ -7012,7 +7012,7 @@ index de9e4fd6a11b06e685804e43657d8b6589c6ca1c..5efe98cbcb44727fbbb195ff7007d01c } public void enablePlugins(PluginLoadOrder type) { -@@ -524,15 +508,17 @@ public final class CraftServer implements Server { +@@ -535,15 +519,17 @@ public final class CraftServer implements Server { private void enablePlugin(Plugin plugin) { try { List<Permission> perms = plugin.getDescription().getPermissions(); @@ -7036,7 +7036,7 @@ index de9e4fd6a11b06e685804e43657d8b6589c6ca1c..5efe98cbcb44727fbbb195ff7007d01c this.pluginManager.enablePlugin(plugin); } catch (Throwable ex) { -@@ -958,6 +944,7 @@ public final class CraftServer implements Server { +@@ -969,6 +955,7 @@ public final class CraftServer implements Server { "This plugin is not properly shutting down its async tasks when it is being reloaded. This may cause conflicts with the newly loaded version of the plugin" )); } @@ -7062,12 +7062,12 @@ index 909b2c98e7a9117d2f737245e4661792ffafb744..d96399e9bf1a58db5a4a22e58abb99e7 @Override public FileConfiguration getConfig() { diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 412dce72064533a260db591a94c8b39eb498331d..0d5202f6bc14bc0cec77f86bed2f1f590e0fffeb 100644 +index 14540be85e1ff2c231a4bed4b7a2c2d7df50516a..c99bdd2092e3f1aa7391ab743f027813c9189e70 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -437,6 +437,12 @@ public final class CraftMagicNumbers implements UnsafeValues { - net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(itemStack); - return nmsItemStack.getItem().getDescriptionId(nmsItemStack); +@@ -496,6 +496,12 @@ public final class CraftMagicNumbers implements UnsafeValues { + + return this.customBiome; } + // Paper start + @Override @@ -7870,16 +7870,16 @@ index 0000000000000000000000000000000000000000..ba271c35eb2804f94cfc893bf94affb9 + return "null"; + } +} -diff --git a/src/test/java/io/papermc/paper/testing/DummyServer.java b/src/test/java/io/papermc/paper/testing/DummyServer.java -index e944e9dca13883c57e93e480ae5adfe51c342532..f482cb4dc5394de3cf88b4c4e13c18f9c61caf45 100644 ---- a/src/test/java/io/papermc/paper/testing/DummyServer.java -+++ b/src/test/java/io/papermc/paper/testing/DummyServer.java -@@ -58,7 +58,7 @@ public final class DummyServer { - return new LazyRegistry(() -> CraftRegistry.createRegistry(invocation.getArgument(0, Class.class), AbstractTestingBase.REGISTRY_CUSTOM)); - }); - -- final PluginManager pluginManager = new SimplePluginManager(dummyServer, new SimpleCommandMap(dummyServer)); -+ final PluginManager pluginManager = new io.papermc.paper.plugin.manager.PaperPluginManagerImpl(dummyServer, new SimpleCommandMap(dummyServer), null); - when(dummyServer.getPluginManager()).thenReturn(pluginManager); +diff --git a/src/test/java/org/bukkit/support/DummyServer.java b/src/test/java/org/bukkit/support/DummyServer.java +index 5f0918e2d24a423f00b6cbd94a938bf4f1c0aae1..e337f482fb4dd554069684ac2f1f759593fea233 100644 +--- a/src/test/java/org/bukkit/support/DummyServer.java ++++ b/src/test/java/org/bukkit/support/DummyServer.java +@@ -120,7 +120,7 @@ public final class DummyServer { + // Paper start - test changes + final Thread currentThread = Thread.currentThread(); + Mockito.when(instance.isPrimaryThread()).thenAnswer(ignored -> Thread.currentThread().equals(currentThread)); +- final org.bukkit.plugin.PluginManager pluginManager = new org.bukkit.plugin.SimplePluginManager(instance, new org.bukkit.command.SimpleCommandMap(instance)); ++ final org.bukkit.plugin.PluginManager pluginManager = new io.papermc.paper.plugin.manager.PaperPluginManagerImpl(instance, new org.bukkit.command.SimpleCommandMap(instance), null); + Mockito.when(instance.getPluginManager()).thenReturn(pluginManager); + // Paper end - Bukkit.setServer(dummyServer); diff --git a/patches/server/0014-Timings-v2.patch b/patches/server/0014-Timings-v2.patch index c2cd88b86d..e1a78d4a4b 100644 --- a/patches/server/0014-Timings-v2.patch +++ b/patches/server/0014-Timings-v2.patch @@ -1270,7 +1270,7 @@ index 7be97441aed66fa3a21d13ad2211b3e0e08120c0..7cb5abfa89f842194325d26c6e95b494 this.entityManager.saveAll(); } else { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index fa3d02895d57c17416e742d2ea1e51253bce4fad..527654df6628b70fd380ccfd3890c27c7a490ef0 100644 +index 186fe9023d5015ab642143265a7aa3b4660fdfad..daebf6293bb4179535a3e3d65a5723fb0e0649cd 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -339,7 +339,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1632,10 +1632,10 @@ index 0eb09ce5c850d85ffd7229d27cf06b3e0edda11b..cc1d7626a82881c4410d65c6a33dadae }; } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 5efe98cbcb44727fbbb195ff7007d01c823372b6..3338b424ca228693c199d022c01a81f9e2f9af0b 100644 +index d8fc6953eded8567273c11bc52a3342702ccc70d..d3f1561be9221c0b42ac77de1fcc6bf5058cde1a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -368,7 +368,7 @@ public final class CraftServer implements Server { +@@ -362,7 +362,7 @@ public final class CraftServer implements Server { this.saveCommandsConfig(); this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*"); this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions"); @@ -1644,7 +1644,7 @@ index 5efe98cbcb44727fbbb195ff7007d01c823372b6..3338b424ca228693c199d022c01a81f9 this.overrideSpawnLimits(); console.autosavePeriod = this.configuration.getInt("ticks-per.autosave"); this.warningState = WarningState.value(this.configuration.getString("settings.deprecated-verbose")); -@@ -2433,12 +2433,31 @@ public final class CraftServer implements Server { +@@ -2447,12 +2447,31 @@ public final class CraftServer implements Server { private final org.bukkit.Server.Spigot spigot = new org.bukkit.Server.Spigot() { @@ -1846,10 +1846,10 @@ index b0ffa23faf62629043dfd613315eaf9c5fcc2cfe..00000000000000000000000000000000 - } -} diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 41ec9e0adb2a17f8cab4fb1f1735d8b2679f92d0..6812237223f8b31e19476cf320192214994c032c 100644 +index c0c0eef5eca6e561eb3aa46301e2fc4e40328754..14eb50a203b1236b98152c9dd301609a1809b558 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2486,6 +2486,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2504,6 +2504,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { CraftPlayer.this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(components, position == net.md_5.bungee.api.ChatMessageType.ACTION_BAR)); } @@ -2046,10 +2046,10 @@ index f97eccb6a17c7876e1e002d798eb67bbe80571a0..76effc345d362047e64d064eb64a5222 + } // Paper } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 0d5202f6bc14bc0cec77f86bed2f1f590e0fffeb..3a7a498003d70cf9e31acffee70b23dec0be6845 100644 +index c99bdd2092e3f1aa7391ab743f027813c9189e70..e1477d5ec704d255ad3ffdda82ae9f3df5fcd80a 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -224,6 +224,12 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -228,6 +228,12 @@ public final class CraftMagicNumbers implements UnsafeValues { } // Paper end // ======================================================================== @@ -2062,7 +2062,7 @@ index 0d5202f6bc14bc0cec77f86bed2f1f590e0fffeb..3a7a498003d70cf9e31acffee70b23de public static byte toLegacyData(BlockState data) { return CraftLegacy.toLegacyData(data); -@@ -450,6 +456,13 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -509,6 +515,13 @@ public final class CraftMagicNumbers implements UnsafeValues { return CraftFeatureFlag.getFromNMS(namespacedKey); } diff --git a/patches/server/0018-Add-command-line-option-to-load-extra-plugin-jars-no.patch b/patches/server/0018-Add-command-line-option-to-load-extra-plugin-jars-no.patch index 61c2c430d5..f470c13be8 100644 --- a/patches/server/0018-Add-command-line-option-to-load-extra-plugin-jars-no.patch +++ b/patches/server/0018-Add-command-line-option-to-load-extra-plugin-jars-no.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Add command line option to load extra plugin jars not in the ex: java -jar paperclip.jar nogui -add-plugin=/path/to/plugin.jar -add-plugin=/path/to/another/plugin_jar.jar diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 3338b424ca228693c199d022c01a81f9e2f9af0b..e9c2d5fad36e38ff1f0b34cacb9ea32516667948 100644 +index d3f1561be9221c0b42ac77de1fcc6bf5058cde1a..890ffdb004d261697d1597e48ab54f65388186fe 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -422,6 +422,35 @@ public final class CraftServer implements Server { +@@ -433,6 +433,35 @@ public final class CraftServer implements Server { io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.INSTANCE.enter(io.papermc.paper.plugin.entrypoint.Entrypoint.PLUGIN); // Paper - replace implementation } @@ -47,7 +47,7 @@ index 3338b424ca228693c199d022c01a81f9e2f9af0b..e9c2d5fad36e38ff1f0b34cacb9ea325 if (type == PluginLoadOrder.STARTUP) { this.helpMap.clear(); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 15b886634112b2a18b7952107b49ae1430376a3d..47c3c7484687b808341937f7e4ef1c0c410fa59f 100644 +index 9327413e674ebcf5c94413a37ad47837da72b57d..5bc5cc3afcad433226a7b9de9f4cd98d7a399513 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -159,6 +159,12 @@ public class Main { diff --git a/patches/server/0019-Rewrite-chunk-system.patch b/patches/server/0019-Rewrite-chunk-system.patch index e18ca0e67c..8ce9769810 100644 --- a/patches/server/0019-Rewrite-chunk-system.patch +++ b/patches/server/0019-Rewrite-chunk-system.patch @@ -20462,7 +20462,7 @@ index e96a0ca47e4701ba187555bd92c968345bc85677..73b96f804079288e9c5fcc11da54e61e + // Paper end } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 527654df6628b70fd380ccfd3890c27c7a490ef0..023482c1662e42305cc4ca12ffdff1e36397ed15 100644 +index daebf6293bb4179535a3e3d65a5723fb0e0649cd..43294ba26171473cd7c3b241c984bbe2becdf024 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -788,6 +788,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -21214,7 +21214,7 @@ index fe76ec5b10242beb6d6057bd680484fc63b7eac3..e3e2b88b8ade4fa2b482626c7e00ac6a /** @deprecated */ diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java -index f739a175e26f250c652c73b8985158fe37c2823a..5f4fa76fe3a1a0a4fc11064fcf57bfab20bd9729 100644 +index b2f9429e0d437cf70bf56410e163e957b80ebdf1..e124ae2711bcd4681fe0b41bd266de67bef8344f 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java @@ -114,7 +114,7 @@ public abstract class ChunkGenerator { @@ -22557,10 +22557,10 @@ index 9f6c2e5b5d9e8d714a47c770e255d06c0ef7c190..ac807277a6b26d140ea9873d17c7aa4f for(SavedTick<T> savedTick : this.pendingTicks) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -index bf4b2f89d3a7133155c6272379c742318b2c1514..33677ec811ceab939c419bf7d31b99585e9a1ef1 100644 +index 3fe4f1686da8ee19ffc8696428dbfde2e978b0da..47a691fc949ab743507df128ce9b0d4bece158f9 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -@@ -111,7 +111,7 @@ public class CraftChunk implements Chunk { +@@ -112,7 +112,7 @@ public class CraftChunk implements Chunk { @Override public boolean isEntitiesLoaded() { @@ -22569,7 +22569,7 @@ index bf4b2f89d3a7133155c6272379c742318b2c1514..33677ec811ceab939c419bf7d31b9958 } @Override -@@ -120,51 +120,7 @@ public class CraftChunk implements Chunk { +@@ -121,51 +121,7 @@ public class CraftChunk implements Chunk { this.getWorld().getChunkAt(x, z); // Transient load for this tick } @@ -22623,10 +22623,10 @@ index bf4b2f89d3a7133155c6272379c742318b2c1514..33677ec811ceab939c419bf7d31b9958 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index e9c2d5fad36e38ff1f0b34cacb9ea32516667948..211e40fdd44f6a19ec6e0e98540ca963a2534995 100644 +index 890ffdb004d261697d1597e48ab54f65388186fe..ad476b8b49cb1d23ac8eeee2dd98ba5e427acbfa 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1181,7 +1181,7 @@ public final class CraftServer implements Server { +@@ -1192,7 +1192,7 @@ public final class CraftServer implements Server { this.console.addLevel(internal); this.getServer().prepareLevels(internal.getChunkSource().chunkMap.progressListener, internal); @@ -22635,7 +22635,7 @@ index e9c2d5fad36e38ff1f0b34cacb9ea32516667948..211e40fdd44f6a19ec6e0e98540ca963 this.pluginManager.callEvent(new WorldLoadEvent(internal.getWorld())); return internal.getWorld(); -@@ -1225,7 +1225,7 @@ public final class CraftServer implements Server { +@@ -1236,7 +1236,7 @@ public final class CraftServer implements Server { } handle.getChunkSource().close(save); @@ -22644,7 +22644,7 @@ index e9c2d5fad36e38ff1f0b34cacb9ea32516667948..211e40fdd44f6a19ec6e0e98540ca963 handle.convertable.close(); } catch (Exception ex) { this.getLogger().log(Level.SEVERE, null, ex); -@@ -2045,7 +2045,7 @@ public final class CraftServer implements Server { +@@ -2056,7 +2056,7 @@ public final class CraftServer implements Server { @Override public boolean isPrimaryThread() { @@ -22654,10 +22654,10 @@ index e9c2d5fad36e38ff1f0b34cacb9ea32516667948..211e40fdd44f6a19ec6e0e98540ca963 // Paper start - Adventure diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 73f61f2b0c0aeefabb7b7bba7ca37914751dcc42..4a3593f24fc844a6a8b1b6c28ad2dc9c609c29ad 100644 +index c71753ced37243fa876387da282d424fe26cfecd..a6b56df47abe01172460c1994a9c1ce01b9a001f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -322,10 +322,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -323,10 +323,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { ChunkHolder playerChunk = this.world.getChunkSource().chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(x, z)); if (playerChunk == null) return false; @@ -22675,7 +22675,7 @@ index 73f61f2b0c0aeefabb7b7bba7ca37914751dcc42..4a3593f24fc844a6a8b1b6c28ad2dc9c ClientboundLevelChunkWithLightPacket refreshPacket = new ClientboundLevelChunkWithLightPacket(chunk, this.world.getLightEngine(), null, null); for (ServerPlayer player : playersInRange) { -@@ -333,8 +337,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -334,8 +338,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { player.connection.send(refreshPacket); } @@ -22685,7 +22685,7 @@ index 73f61f2b0c0aeefabb7b7bba7ca37914751dcc42..4a3593f24fc844a6a8b1b6c28ad2dc9c return true; } -@@ -411,20 +414,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -412,20 +415,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public Collection<Plugin> getPluginChunkTickets(int x, int z) { DistanceManager chunkDistanceManager = this.world.getChunkSource().chunkMap.distanceManager; @@ -22707,7 +22707,7 @@ index 73f61f2b0c0aeefabb7b7bba7ca37914751dcc42..4a3593f24fc844a6a8b1b6c28ad2dc9c } @Override -@@ -432,7 +422,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -433,7 +423,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { Map<Plugin, ImmutableList.Builder<Chunk>> ret = new HashMap<>(); DistanceManager chunkDistanceManager = this.world.getChunkSource().chunkMap.distanceManager; @@ -22716,7 +22716,7 @@ index 73f61f2b0c0aeefabb7b7bba7ca37914751dcc42..4a3593f24fc844a6a8b1b6c28ad2dc9c long chunkKey = chunkTickets.getLongKey(); SortedArraySet<Ticket<?>> tickets = chunkTickets.getValue(); -@@ -1964,14 +1954,53 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1959,14 +1949,53 @@ public class CraftWorld extends CraftRegionAccessor implements World { // Spigot start @Override public int getViewDistance() { @@ -22773,7 +22773,7 @@ index 73f61f2b0c0aeefabb7b7bba7ca37914751dcc42..4a3593f24fc844a6a8b1b6c28ad2dc9c // Spigot start private final org.bukkit.World.Spigot spigot = new org.bukkit.World.Spigot() diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index ef25bfa8c9341104df5cc150eefada52c5353efa..07934c6b9fc1412a404c8c1fdb704cf8adccfb08 100644 +index 14eb50a203b1236b98152c9dd301609a1809b558..2a9f64698a3e09526a5f7dc87a0fd2499d9413b1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -187,6 +187,48 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -22826,7 +22826,7 @@ index ef25bfa8c9341104df5cc150eefada52c5353efa..07934c6b9fc1412a404c8c1fdb704cf8 return this.getHandle().getGameProfile(); } diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java -index 2f0dea0f9540d07f8b38029652fd66c1871dd97c..a7fe78e655a0f4a2c4464e334ea04cf95b9afcd0 100644 +index 8c093d3cd4c240241ac63e09991c9aae5df2b831..73b2e91a3c7348bb02e7bc845274c3e25f41fb62 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java @@ -265,7 +265,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator { diff --git a/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index 7b02cfa772..0f03ae07a5 100644 --- a/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch +++ b/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch @@ -19,10 +19,10 @@ index bea4e947577ee2f5fd680eb932409283f8504ee7..b9a49f92e38daf4f80b6d3bf465eb9d2 public SystemReport fillSystemReport(SystemReport details) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 211e40fdd44f6a19ec6e0e98540ca963a2534995..858b2d4557ec67a4818fcb389f6fa6053e638e61 100644 +index ad476b8b49cb1d23ac8eeee2dd98ba5e427acbfa..bc819032b67b2d0cb157d88fa84e959dd5dc8f87 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -259,7 +259,7 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; +@@ -258,7 +258,7 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; import net.md_5.bungee.api.chat.BaseComponent; // Spigot public final class CraftServer implements Server { @@ -32,10 +32,10 @@ index 211e40fdd44f6a19ec6e0e98540ca963a2534995..858b2d4557ec67a4818fcb389f6fa605 private final String bukkitVersion = Versioning.getBukkitVersion(); private final Logger logger = Logger.getLogger("Minecraft"); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 47c3c7484687b808341937f7e4ef1c0c410fa59f..a20eaa9b1d030ccd7e1fc49df47acee46f4e7e20 100644 +index 5bc5cc3afcad433226a7b9de9f4cd98d7a399513..a63e7bf572d4c52b5581df799353c7fb979366f5 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java -@@ -240,12 +240,25 @@ public class Main { +@@ -243,12 +243,25 @@ public class Main { deadline.add(Calendar.DAY_OF_YEAR, -3); if (buildDate.before(deadline.getTime())) { System.err.println("*** Error, this build is outdated ***"); diff --git a/patches/server/0028-Implement-Paper-VersionChecker.patch b/patches/server/0028-Implement-Paper-VersionChecker.patch index 739cfaf126..c729ea25f5 100644 --- a/patches/server/0028-Implement-Paper-VersionChecker.patch +++ b/patches/server/0028-Implement-Paper-VersionChecker.patch @@ -140,10 +140,10 @@ index 0000000000000000000000000000000000000000..22a55be34fde453fedd987173d95b8b3 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 3a7a498003d70cf9e31acffee70b23dec0be6845..bf8cb65df8e6ecc76e065625e89fd296d71b15b4 100644 +index e1477d5ec704d255ad3ffdda82ae9f3df5fcd80a..621e63a2ef0623b81140efc5abe84a2450bd3e05 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -461,6 +461,11 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -520,6 +520,11 @@ public final class CraftMagicNumbers implements UnsafeValues { public String getTimingsServerName() { return io.papermc.paper.configuration.GlobalConfiguration.get().timings.serverName; } diff --git a/patches/server/0030-Player-affects-spawning-API.patch b/patches/server/0030-Player-affects-spawning-API.patch index 0ec88fc9ca..ca92873958 100644 --- a/patches/server/0030-Player-affects-spawning-API.patch +++ b/patches/server/0030-Player-affects-spawning-API.patch @@ -137,10 +137,10 @@ index be6e3e21ad62da01e5e2dd78e300cbc8efdbeb42..ea98625fe7c00743b8df74a24e6d4b75 for(Player player : this.players()) { if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player)) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index d67a7f9534c3dc43310a26e8e9073c6442a2edef..050f047641e6c1feb2098fef3ae4c75b1e530bc4 100644 +index 2a9f64698a3e09526a5f7dc87a0fd2499d9413b1..163939d5831d9b3b227661377cada4bf60314381 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2165,8 +2165,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2183,8 +2183,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public String getLocale() { return this.getHandle().locale; diff --git a/patches/server/0031-Further-improve-server-tick-loop.patch b/patches/server/0031-Further-improve-server-tick-loop.patch index 3805802cb5..367ea80a08 100644 --- a/patches/server/0031-Further-improve-server-tick-loop.patch +++ b/patches/server/0031-Further-improve-server-tick-loop.patch @@ -145,10 +145,10 @@ index b9a49f92e38daf4f80b6d3bf465eb9d249606976..71c8bb318b2e99b7d0b91196ac0b1b5b this.startMetricsRecordingTick(); this.profiler.push("tick"); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 858b2d4557ec67a4818fcb389f6fa6053e638e61..9da9b5b4b92996240cc93be2db82bf3a931e76c1 100644 +index bc819032b67b2d0cb157d88fa84e959dd5dc8f87..14f058122117907211d4d8bcec35bca83a3489df 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2458,6 +2458,17 @@ public final class CraftServer implements Server { +@@ -2472,6 +2472,17 @@ public final class CraftServer implements Server { return CraftMagicNumbers.INSTANCE; } diff --git a/patches/server/0032-Only-refresh-abilities-if-needed.patch b/patches/server/0032-Only-refresh-abilities-if-needed.patch index 368e03cde8..3ad1206210 100644 --- a/patches/server/0032-Only-refresh-abilities-if-needed.patch +++ b/patches/server/0032-Only-refresh-abilities-if-needed.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Only refresh abilities if needed diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 050f047641e6c1feb2098fef3ae4c75b1e530bc4..17b4ec27f2420b03289aebc7826e365f7c735b45 100644 +index 163939d5831d9b3b227661377cada4bf60314381..0318ce2132288463764195e67a815e6a65a54d07 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1847,12 +1847,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1864,12 +1864,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setFlying(boolean value) { diff --git a/patches/server/0033-Entity-Origin-API.patch b/patches/server/0033-Entity-Origin-API.patch index 294e046813..22ff333423 100644 --- a/patches/server/0033-Entity-Origin-API.patch +++ b/patches/server/0033-Entity-Origin-API.patch @@ -132,10 +132,10 @@ index 221ce518464332a27c43850c8bc25cd2fe0a9921..50fa14b045a1f75d43d90741245cc450 @Nullable diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 11645e01924b4a66aa4f425c8962a000be761912..003690e2f347821d28517b816115cc92ea5d0bd6 100644 +index 7bd8b6d7af56d7d6426f420773c1b0e109002b31..f51bfef28b6e9611f2b3352d7dcc7ead7ebf042f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1245,5 +1245,20 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1260,5 +1260,20 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return ret; } diff --git a/patches/server/0045-Implement-PlayerLocaleChangeEvent.patch b/patches/server/0045-Implement-PlayerLocaleChangeEvent.patch index 65cbc468cd..905d024397 100644 --- a/patches/server/0045-Implement-PlayerLocaleChangeEvent.patch +++ b/patches/server/0045-Implement-PlayerLocaleChangeEvent.patch @@ -30,10 +30,10 @@ index 1ef48b8415242942f00c6a76faa1de2865e11358..bcf0d4cfbfbae254bc74ad6389af372a this.locale = packet.language; // Paper start diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 17b4ec27f2420b03289aebc7826e365f7c735b45..79bc5ab586235024bc95d7ca7636660330ccdc66 100644 +index 0318ce2132288463764195e67a815e6a65a54d07..556b3532039630050252576a40bf457a9554862b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2165,8 +2165,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2183,8 +2183,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public String getLocale() { diff --git a/patches/server/0048-Use-UserCache-for-player-heads.patch b/patches/server/0048-Use-UserCache-for-player-heads.patch index 9754d03580..61b2873da4 100644 --- a/patches/server/0048-Use-UserCache-for-player-heads.patch +++ b/patches/server/0048-Use-UserCache-for-player-heads.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Use UserCache for player heads diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java -index 30865eece58ba2f3c991f9d373a128ada3385b4f..85b9baad074634a2f21c15adbb393ebc5924bdd8 100644 +index 2797e997dcc13e5451e52ac3cd962a5c5188cec3..d2a86f48c7b43db6b990a578f4cf5d868c78ce67 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java -@@ -208,7 +208,13 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { +@@ -201,7 +201,13 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { if (name == null) { this.setProfile(null); } else { diff --git a/patches/server/0052-Ensure-commands-are-not-ran-async.patch b/patches/server/0052-Ensure-commands-are-not-ran-async.patch index 0857948e15..94ae70e798 100644 --- a/patches/server/0052-Ensure-commands-are-not-ran-async.patch +++ b/patches/server/0052-Ensure-commands-are-not-ran-async.patch @@ -21,7 +21,7 @@ character. Co-authored-by: Jake Potrebic <[email protected]> diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 023482c1662e42305cc4ca12ffdff1e36397ed15..95d84f9a524ef0705875987c3781a0d73189dfbb 100644 +index 43294ba26171473cd7c3b241c984bbe2becdf024..681d747e28dbce54207cf7b57f5ae4049ded224a 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2044,7 +2044,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -74,10 +74,10 @@ index 023482c1662e42305cc4ca12ffdff1e36397ed15..95d84f9a524ef0705875987c3781a0d7 if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 9da9b5b4b92996240cc93be2db82bf3a931e76c1..c84e32f53783b2e00b829ce839894c0a3a73325e 100644 +index 14f058122117907211d4d8bcec35bca83a3489df..1541097c631975effe26919f5bf1eebdc3a73136 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -882,6 +882,28 @@ public final class CraftServer implements Server { +@@ -893,6 +893,28 @@ public final class CraftServer implements Server { Preconditions.checkArgument(commandLine != null, "commandLine cannot be null"); org.spigotmc.AsyncCatcher.catchOp("command dispatch"); // Spigot @@ -107,7 +107,7 @@ index 9da9b5b4b92996240cc93be2db82bf3a931e76c1..c84e32f53783b2e00b829ce839894c0a return true; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 79bc5ab586235024bc95d7ca7636660330ccdc66..d07fd2936adaae3b6f95cbb8bc746362633c2896 100644 +index 556b3532039630050252576a40bf457a9554862b..9a3086a3444973fbb619b61b1c04e76f0d858f69 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -484,7 +484,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0053-All-chunks-are-slime-spawn-chunks-toggle.patch b/patches/server/0053-All-chunks-are-slime-spawn-chunks-toggle.patch index a3a9107844..b9f42e1187 100644 --- a/patches/server/0053-All-chunks-are-slime-spawn-chunks-toggle.patch +++ b/patches/server/0053-All-chunks-are-slime-spawn-chunks-toggle.patch @@ -18,10 +18,10 @@ index 23cb972ca3fde409be0d6517ef8f1c58dab47ff4..476a9b2db5deac803f1cb3c2cbe88b69 if (random.nextInt(10) == 0 && flag && pos.getY() < 40) { return checkMobSpawnRules(type, world, spawnReason, pos, random); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -index 33677ec811ceab939c419bf7d31b99585e9a1ef1..8ae78690748b2cb5d5186d8859871c1630e10130 100644 +index 47a691fc949ab743507df128ce9b0d4bece158f9..51471933252f989a2640568f42c59ac930be58e8 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -@@ -169,7 +169,7 @@ public class CraftChunk implements Chunk { +@@ -170,7 +170,7 @@ public class CraftChunk implements Chunk { @Override public boolean isSlimeChunk() { // 987234911L is deterimined in EntitySlime when seeing if a slime can spawn in a chunk diff --git a/patches/server/0054-Expose-server-CommandMap.patch b/patches/server/0054-Expose-server-CommandMap.patch index a937de8515..9f9b7b14b0 100644 --- a/patches/server/0054-Expose-server-CommandMap.patch +++ b/patches/server/0054-Expose-server-CommandMap.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose server CommandMap diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index c84e32f53783b2e00b829ce839894c0a3a73325e..3d47994c861f70fc560a42dc524a773d9c15cfe0 100644 +index 1541097c631975effe26919f5bf1eebdc3a73136..0a8c9c6fbb7af115b29f355d1291e6eac9397caf 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2020,6 +2020,7 @@ public final class CraftServer implements Server { +@@ -2031,6 +2031,7 @@ public final class CraftServer implements Server { return this.helpMap; } diff --git a/patches/server/0055-Be-a-bit-more-informative-in-maxHealth-exception.patch b/patches/server/0055-Be-a-bit-more-informative-in-maxHealth-exception.patch index 1d2852b0ba..ae7061cbea 100644 --- a/patches/server/0055-Be-a-bit-more-informative-in-maxHealth-exception.patch +++ b/patches/server/0055-Be-a-bit-more-informative-in-maxHealth-exception.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Be a bit more informative in maxHealth exception diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 92831e64cc5f93a13dfede82d44172b3b34a57e3..a112ee18b272e2d5a61ddbb2c884169b6c6d0aec 100644 +index 9486a411c68ac24d9367aa3001888f5c0f43a16f..8151466c5d045f6a56762d359024e40d7f16dad6 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -100,7 +100,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -103,7 +103,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @Override public void setHealth(double health) { health = (float) health; diff --git a/patches/server/0058-Add-velocity-warnings.patch b/patches/server/0058-Add-velocity-warnings.patch index 1440922180..ef53966d79 100644 --- a/patches/server/0058-Add-velocity-warnings.patch +++ b/patches/server/0058-Add-velocity-warnings.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Add velocity warnings diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 3d47994c861f70fc560a42dc524a773d9c15cfe0..bf9d7ae4366e44938306e3f8e94376796284a263 100644 +index 0a8c9c6fbb7af115b29f355d1291e6eac9397caf..38346bec8027ee3ccac6c9275d2eff63046f7363 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -295,6 +295,7 @@ public final class CraftServer implements Server { - public boolean ignoreVanillaPermissions = false; + public final boolean enumCompatibilityMode; private final List<CraftPlayer> playerView; public int reloadCount; + public static Exception excessiveVelEx; // Paper - Velocity warnings @@ -17,10 +17,10 @@ index 3d47994c861f70fc560a42dc524a773d9c15cfe0..bf9d7ae4366e44938306e3f8e9437679 static { ConfigurationSerialization.registerClass(CraftOfflinePlayer.class); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 003690e2f347821d28517b816115cc92ea5d0bd6..fa2a6f44a1c25fb6c9a19e83e7eddb2c8d28a320 100644 +index f51bfef28b6e9611f2b3352d7dcc7ead7ebf042f..70726aa2e24cc6121293426f01a7eaed5f32075f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -465,10 +465,40 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -471,10 +471,40 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { public void setVelocity(Vector velocity) { Preconditions.checkArgument(velocity != null, "velocity"); velocity.checkFinite(); diff --git a/patches/server/0059-Configurable-inter-world-teleportation-safety.patch b/patches/server/0059-Configurable-inter-world-teleportation-safety.patch index 260abff358..06ea2f819c 100644 --- a/patches/server/0059-Configurable-inter-world-teleportation-safety.patch +++ b/patches/server/0059-Configurable-inter-world-teleportation-safety.patch @@ -16,10 +16,10 @@ The wanted destination was on top of the emerald block however the player ended This only is the case if the player is teleporting between worlds. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 730921dec26bdaff69f485bd57a5aeaddcfca34e..94e191642189c5af87a4dae7942d2f4535240e96 100644 +index 14f284cffb6c4c3827d923f1c34c15de3ca98ef3..93afca01a30b446c09b7248153b2f81491b5e100 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1152,7 +1152,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1144,7 +1144,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { entity.connection.teleport(to); } else { // The respawn reason should never be used if the passed location is non null. diff --git a/patches/server/0063-Add-methods-for-working-with-arrows-stuck-in-living-.patch b/patches/server/0063-Add-methods-for-working-with-arrows-stuck-in-living-.patch index 99be07e3cc..ac297ab4ad 100644 --- a/patches/server/0063-Add-methods-for-working-with-arrows-stuck-in-living-.patch +++ b/patches/server/0063-Add-methods-for-working-with-arrows-stuck-in-living-.patch @@ -7,10 +7,10 @@ Upstream added methods for this, original methods are now deprecated diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index a112ee18b272e2d5a61ddbb2c884169b6c6d0aec..fcb07a5f8cac994b731e3345ba9e971faa482fa1 100644 +index 8151466c5d045f6a56762d359024e40d7f16dad6..3b001136ddf4eacfa85fcaf0e6e091a55d50b929 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -265,9 +265,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -268,9 +268,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { } @Override @@ -27,7 +27,7 @@ index a112ee18b272e2d5a61ddbb2c884169b6c6d0aec..fcb07a5f8cac994b731e3345ba9e971f } @Override -@@ -761,4 +767,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -759,4 +765,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { this.getHandle().persistentInvisibility = invisible; this.getHandle().setSharedFlag(5, invisible); } diff --git a/patches/server/0065-Complete-resource-pack-API.patch b/patches/server/0065-Complete-resource-pack-API.patch index 5e0d756411..c32e794588 100644 --- a/patches/server/0065-Complete-resource-pack-API.patch +++ b/patches/server/0065-Complete-resource-pack-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Complete resource pack API diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 95d84f9a524ef0705875987c3781a0d73189dfbb..e60d8689e7bec90cb4b8787ff252eb7da39d6a8f 100644 +index 681d747e28dbce54207cf7b57f5ae4049ded224a..e1861812a4d6d7a5cc6ad32071ac53e6aef2a4a5 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1758,8 +1758,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -23,7 +23,7 @@ index 95d84f9a524ef0705875987c3781a0d73189dfbb..e60d8689e7bec90cb4b8787ff252eb7d @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 94e191642189c5af87a4dae7942d2f4535240e96..cc62d67e60f5f6ee313d4e20a6f206fec8545df1 100644 +index 93afca01a30b446c09b7248153b2f81491b5e100..33f784829b79f0b7d57806089e622fa23b357729 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -181,6 +181,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -37,7 +37,7 @@ index 94e191642189c5af87a4dae7942d2f4535240e96..cc62d67e60f5f6ee313d4e20a6f206fe public CraftPlayer(CraftServer server, ServerPlayer entity) { super(server, entity); -@@ -2288,6 +2292,45 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2306,6 +2310,45 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public boolean getAffectsSpawning() { return this.getHandle().affectsSpawning; } diff --git a/patches/server/0066-Default-loading-permissions.yml-before-plugins.patch b/patches/server/0066-Default-loading-permissions.yml-before-plugins.patch index ca99eb9d9e..7b9a480bdc 100644 --- a/patches/server/0066-Default-loading-permissions.yml-before-plugins.patch +++ b/patches/server/0066-Default-loading-permissions.yml-before-plugins.patch @@ -16,10 +16,10 @@ modify that. Under the previous logic, plugins were unable (cleanly) override pe A config option has been added for those who depend on the previous behavior, but I don't expect that. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index bf9d7ae4366e44938306e3f8e94376796284a263..43c2e3f0db683022179ae4c85703390be5bdb759 100644 +index 38346bec8027ee3ccac6c9275d2eff63046f7363..d3c8c1c8de780ff7f31d0e7a7dd5f749e4d179b7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -456,6 +456,7 @@ public final class CraftServer implements Server { +@@ -467,6 +467,7 @@ public final class CraftServer implements Server { if (type == PluginLoadOrder.STARTUP) { this.helpMap.clear(); this.helpMap.initializeGeneralTopics(); @@ -27,7 +27,7 @@ index bf9d7ae4366e44938306e3f8e94376796284a263..43c2e3f0db683022179ae4c85703390b } Plugin[] plugins = this.pluginManager.getPlugins(); -@@ -475,7 +476,7 @@ public final class CraftServer implements Server { +@@ -486,7 +487,7 @@ public final class CraftServer implements Server { this.commandMap.registerServerAliases(); DefaultPermissions.registerCorePermissions(); CraftDefaultPermissions.registerCorePermissions(); diff --git a/patches/server/0067-Allow-Reloading-of-Custom-Permissions.patch b/patches/server/0067-Allow-Reloading-of-Custom-Permissions.patch index a30ddc19c4..e317e9a509 100644 --- a/patches/server/0067-Allow-Reloading-of-Custom-Permissions.patch +++ b/patches/server/0067-Allow-Reloading-of-Custom-Permissions.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Custom Permissions https://github.com/PaperMC/Paper/issues/49 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 43c2e3f0db683022179ae4c85703390be5bdb759..22d11ee1d782ba1218357ee16b05de3414924aeb 100644 +index d3c8c1c8de780ff7f31d0e7a7dd5f749e4d179b7..0dba61c61e6b15cb45a570245624a966a573fd7e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2624,5 +2624,23 @@ public final class CraftServer implements Server { +@@ -2638,5 +2638,23 @@ public final class CraftServer implements Server { } return this.adventure$audiences; } diff --git a/patches/server/0068-Remove-Metadata-on-reload.patch b/patches/server/0068-Remove-Metadata-on-reload.patch index 2f5734a37c..371fc133ef 100644 --- a/patches/server/0068-Remove-Metadata-on-reload.patch +++ b/patches/server/0068-Remove-Metadata-on-reload.patch @@ -7,10 +7,10 @@ Metadata is not meant to persist reload as things break badly with non primitive This will remove metadata on reload so it does not crash everything if a plugin uses it. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 22d11ee1d782ba1218357ee16b05de3414924aeb..83119de3ae3e38ba4bb77abf005043cfa82c4670 100644 +index 0dba61c61e6b15cb45a570245624a966a573fd7e..92a96428facb4eaf7554eae013f4d6d2c76e7abb 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -969,8 +969,16 @@ public final class CraftServer implements Server { +@@ -980,8 +980,16 @@ public final class CraftServer implements Server { world.spigotConfig.init(); // Spigot } diff --git a/patches/server/0069-Handle-Item-Meta-Inconsistencies.patch b/patches/server/0069-Handle-Item-Meta-Inconsistencies.patch index b52904d516..32cdc86ec4 100644 --- a/patches/server/0069-Handle-Item-Meta-Inconsistencies.patch +++ b/patches/server/0069-Handle-Item-Meta-Inconsistencies.patch @@ -18,7 +18,7 @@ For consistency, the old API methods now forward to use the ItemMeta API equivalents, and should deprecate the old API's. diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 2e948330c4951e3df7091fa870573f163d2af286..4b19057fba6c6645dc79f6572a3fb01cb2c4c26c 100644 +index 6758e72177c0a407cf6c392b10263f095e4d06e8..369f7d470fc6f7235fc5bd6b67e16c4182d5ed36 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java @@ -156,6 +156,23 @@ public final class ItemStack { @@ -70,7 +70,7 @@ index 2e948330c4951e3df7091fa870573f163d2af286..4b19057fba6c6645dc79f6572a3fb01c public boolean isEnchanted() { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 34a54a99e7484b2934e1d174c1b55f0472ff3812..7fd9a3a7f4cb98d89b7c4cbfda756d581963e5bf 100644 +index 522c386216bd1c31e3b3ed5d4e2af0aa6870b9d2..56f576e3c71d256dfd8e1c862573b0bcf1f70e60 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -178,28 +178,11 @@ public final class CraftItemStack extends ItemStack { @@ -168,7 +168,7 @@ index 34a54a99e7484b2934e1d174c1b55f0472ff3812..7fd9a3a7f4cb98d89b7c4cbfda756d58 static Map<Enchantment, Integer> getEnchantments(net.minecraft.world.item.ItemStack item) { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index b01c268d179591a0113e4bfb46f3d6d22933efaf..bfd5661d55a6ed767cb3bed2d9bb24535c1f7335 100644 +index aa70e19ae106625ba9768ec9651c75a17c0bb07e..713e5a8f38ed76eec2386991b73cfa60d8309fdf 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableList; @@ -195,7 +195,7 @@ index b01c268d179591a0113e4bfb46f3d6d22933efaf..bfd5661d55a6ed767cb3bed2d9bb2453 import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.Nonnull; -@@ -275,7 +278,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -280,7 +283,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { private List<String> lore; // null and empty are two different states internally private Integer customModelData; private CompoundTag blockData; @@ -204,7 +204,7 @@ index b01c268d179591a0113e4bfb46f3d6d22933efaf..bfd5661d55a6ed767cb3bed2d9bb2453 private Multimap<Attribute, AttributeModifier> attributeModifiers; private int repairCost; private int hideFlag; -@@ -286,7 +289,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -291,7 +294,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); private CompoundTag internalTag; @@ -213,7 +213,7 @@ index b01c268d179591a0113e4bfb46f3d6d22933efaf..bfd5661d55a6ed767cb3bed2d9bb2453 private CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftMetaItem.DATA_TYPE_REGISTRY); private int version = CraftMagicNumbers.INSTANCE.getDataVersion(); // Internal use only -@@ -307,7 +310,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -312,7 +315,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { this.blockData = meta.blockData; if (meta.enchantments != null) { // Spigot @@ -222,7 +222,7 @@ index b01c268d179591a0113e4bfb46f3d6d22933efaf..bfd5661d55a6ed767cb3bed2d9bb2453 } if (meta.hasAttributeModifiers()) { -@@ -390,13 +393,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -395,13 +398,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } } @@ -238,7 +238,7 @@ index b01c268d179591a0113e4bfb46f3d6d22933efaf..bfd5661d55a6ed767cb3bed2d9bb2453 for (int i = 0; i < ench.size(); i++) { String id = ((CompoundTag) ench.get(i)).getString(ENCHANTMENTS_ID.NBT); -@@ -549,13 +552,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -554,13 +557,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } } @@ -254,7 +254,7 @@ index b01c268d179591a0113e4bfb46f3d6d22933efaf..bfd5661d55a6ed767cb3bed2d9bb2453 for (Map.Entry<?, ?> entry : ench.entrySet()) { // Doctor older enchants String enchantKey = entry.getKey().toString(); -@@ -831,14 +834,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -836,14 +839,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @Override public Map<Enchantment, Integer> getEnchants() { @@ -271,7 +271,7 @@ index b01c268d179591a0113e4bfb46f3d6d22933efaf..bfd5661d55a6ed767cb3bed2d9bb2453 } if (ignoreRestrictions || level >= ench.getStartLevel() && level <= ench.getMaxLevel()) { -@@ -1227,7 +1230,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1232,7 +1235,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { clone.customModelData = this.customModelData; clone.blockData = this.blockData; if (this.enchantments != null) { @@ -280,7 +280,7 @@ index b01c268d179591a0113e4bfb46f3d6d22933efaf..bfd5661d55a6ed767cb3bed2d9bb2453 } if (this.hasAttributeModifiers()) { clone.attributeModifiers = LinkedHashMultimap.create(this.attributeModifiers); -@@ -1464,4 +1467,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1469,4 +1472,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { return CraftMetaItem.HANDLED_TAGS; } } diff --git a/patches/server/0073-handle-NaN-health-absorb-values-and-repair-bad-data.patch b/patches/server/0073-handle-NaN-health-absorb-values-and-repair-bad-data.patch index bc96345c4a..a7356a8f7b 100644 --- a/patches/server/0073-handle-NaN-health-absorb-values-and-repair-bad-data.patch +++ b/patches/server/0073-handle-NaN-health-absorb-values-and-repair-bad-data.patch @@ -44,10 +44,10 @@ index 1238da8b035a0b0dd3d00557ca0de7a82f5fdf53..5e40ee2695b7ed50fddc0e8226f0b1b4 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index cc62d67e60f5f6ee313d4e20a6f206fec8545df1..ae9467c7de52d9214443f36540d3069c67e98441 100644 +index 33f784829b79f0b7d57806089e622fa23b357729..368c476bac3417a585fd783e6e4c0c336daa08fd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2092,6 +2092,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2109,6 +2109,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void setRealHealth(double health) { diff --git a/patches/server/0095-LootTable-API-Replenishable-Lootables-Feature.patch b/patches/server/0095-LootTable-API-Replenishable-Lootables-Feature.patch index cda572decc..dcf8e4bbba 100644 --- a/patches/server/0095-LootTable-API-Replenishable-Lootables-Feature.patch +++ b/patches/server/0095-LootTable-API-Replenishable-Lootables-Feature.patch @@ -702,7 +702,7 @@ index d5bfa06a90158fb6d9cc54f7a9b44a277f2c480f..dbdf9b009a488767bb63b0867943fd93 getSnapshot().setLootTable(key, seed); } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java -index b31fa63019822bc172d85427b3f3f2c154d7e179..82b3f3b3aced73ce136b6b94fe212972ac6090ef 100644 +index a28c069f8540ec9f40197490e0a66a2404de8536..07b0c7409d4d1698e1527242293d1c1e1686153f 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java @@ -12,8 +12,9 @@ import org.bukkit.craftbukkit.CraftWorld; @@ -730,10 +730,10 @@ index 982adacb361b0590799dc68f9b7c13c7195627fd..e49eece9bff3a53469673d03a7bbf8f9 public CraftLootable(World world, T tileEntity) { super(world, tileEntity); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftChestBoat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftChestBoat.java -index ae07db69b11b993b50782c94aa5c45b97d949612..06a96f027f90fd5bf05de72c8722ff5a81608b66 100644 +index 9ba61f791c0ca9b283c0f1f30f12600c4e49a4cb..c332e8504b96a4437325b5a64430c97c5afb6b4b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftChestBoat.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftChestBoat.java -@@ -11,8 +11,7 @@ import org.bukkit.entity.EntityType; +@@ -10,8 +10,7 @@ import org.bukkit.craftbukkit.util.CraftNamespacedKey; import org.bukkit.inventory.Inventory; import org.bukkit.loot.LootTable; @@ -743,7 +743,7 @@ index ae07db69b11b993b50782c94aa5c45b97d949612..06a96f027f90fd5bf05de72c8722ff5a private final Inventory inventory; public CraftChestBoat(CraftServer server, ChestBoat entity) { -@@ -66,7 +65,7 @@ public class CraftChestBoat extends CraftBoat implements org.bukkit.entity.Chest +@@ -60,7 +59,7 @@ public class CraftChestBoat extends CraftBoat implements org.bukkit.entity.Chest return this.getHandle().getLootTableSeed(); } @@ -753,10 +753,10 @@ index ae07db69b11b993b50782c94aa5c45b97d949612..06a96f027f90fd5bf05de72c8722ff5a this.getHandle().setLootTable(newKey); this.getHandle().setLootTableSeed(seed); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java -index eb21b8457774d5ac765fa9008157cb29d9b72509..abf58bef2042a9efba5a78fd7f97339deceaa780 100644 +index fd42f0b20132d08039ca7735d31a61806a6b07dc..b1a708de6790bbe336202b13ab862ced78de084f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java -@@ -8,7 +8,7 @@ import org.bukkit.entity.minecart.StorageMinecart; +@@ -7,7 +7,7 @@ import org.bukkit.entity.minecart.StorageMinecart; import org.bukkit.inventory.Inventory; @SuppressWarnings("deprecation") @@ -766,10 +766,10 @@ index eb21b8457774d5ac765fa9008157cb29d9b72509..abf58bef2042a9efba5a78fd7f97339d public CraftMinecartChest(CraftServer server, MinecartChest entity) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java -index 34b8f103625f087bb725bed595dd9c30f4a6f70c..ee9648739fb39c5842063d7442df6eb5c9336d7f 100644 +index ec3ab12442b7371e16059b902f71e573f0bc9816..3ba7e8ef1035e1de2c195b6919fe57aee398af51 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java -@@ -7,7 +7,7 @@ import org.bukkit.entity.EntityType; +@@ -6,7 +6,7 @@ import org.bukkit.craftbukkit.inventory.CraftInventory; import org.bukkit.entity.minecart.HopperMinecart; import org.bukkit.inventory.Inventory; diff --git a/patches/server/0105-Add-setting-for-proxy-online-mode-status.patch b/patches/server/0105-Add-setting-for-proxy-online-mode-status.patch index 4a8d18d1b8..204b135eaf 100644 --- a/patches/server/0105-Add-setting-for-proxy-online-mode-status.patch +++ b/patches/server/0105-Add-setting-for-proxy-online-mode-status.patch @@ -43,10 +43,10 @@ index da98f074ccd5a40c635824112c97fd174c393cb1..6599f874d9f97e9ef4862039ecad7277 } else { String[] astring1 = astring; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 83119de3ae3e38ba4bb77abf005043cfa82c4670..a392be8dee7eccc5f6a55edf02ec207bcb65b0a5 100644 +index 92a96428facb4eaf7554eae013f4d6d2c76e7abb..f4648ca4401389a2373ebfa9bdb4f607a2c23d67 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1740,7 +1740,7 @@ public final class CraftServer implements Server { +@@ -1751,7 +1751,7 @@ public final class CraftServer implements Server { // Spigot Start GameProfile profile = null; // Only fetch an online UUID in online mode diff --git a/patches/server/0109-Add-EntityZapEvent.patch b/patches/server/0109-Add-EntityZapEvent.patch index 83e60f2e1a..aa767fe9c2 100644 --- a/patches/server/0109-Add-EntityZapEvent.patch +++ b/patches/server/0109-Add-EntityZapEvent.patch @@ -28,10 +28,10 @@ index f9704b20e71564ac721a24655b2792c689edf6ba..e04f3f1159c5d5fa2e3956a36e95f8af entitywitch.finalizeSpawn(world, world.getCurrentDifficultyAt(entitywitch.blockPosition()), MobSpawnType.CONVERSION, (SpawnGroupData) null, (CompoundTag) null); entitywitch.setNoAi(this.isNoAi()); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index e0bb58d92e47516138261a673b56c5f8ce68a59c..d3584001c92593d4471eeb473b345d30d4dc960e 100644 +index 2a3381221de4027ad4a780c7fb832fb4397165ae..90c1c4b87947ed4c9ff84029193ed2cc0507b275 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1193,6 +1193,14 @@ public class CraftEventFactory { +@@ -1199,6 +1199,14 @@ public class CraftEventFactory { return event; } diff --git a/patches/server/0112-Allow-Reloading-of-Command-Aliases.patch b/patches/server/0112-Allow-Reloading-of-Command-Aliases.patch index 79b175b053..3f0e6aeaf9 100644 --- a/patches/server/0112-Allow-Reloading-of-Command-Aliases.patch +++ b/patches/server/0112-Allow-Reloading-of-Command-Aliases.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Command Aliases Reload the aliases stored in commands.yml diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index a392be8dee7eccc5f6a55edf02ec207bcb65b0a5..9b45eed05bebc3957f54291fe59c87994bfdf00d 100644 +index f4648ca4401389a2373ebfa9bdb4f607a2c23d67..1efeedbe244396121c241272a30ef8ab5f2c50c8 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2650,5 +2650,24 @@ public final class CraftServer implements Server { +@@ -2664,5 +2664,24 @@ public final class CraftServer implements Server { DefaultPermissions.registerCorePermissions(); CraftDefaultPermissions.registerCorePermissions(); } diff --git a/patches/server/0113-Add-source-to-PlayerExpChangeEvent.patch b/patches/server/0113-Add-source-to-PlayerExpChangeEvent.patch index 7b01ee8998..545d217c2a 100644 --- a/patches/server/0113-Add-source-to-PlayerExpChangeEvent.patch +++ b/patches/server/0113-Add-source-to-PlayerExpChangeEvent.patch @@ -18,10 +18,10 @@ index 93c83cfedc7d3a169ad0504aa6e63f600873501b..9dffdfe5bbd0517e9a2c6a6770eea07b --this.count; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index d3584001c92593d4471eeb473b345d30d4dc960e..192d48ed576b2918d7cce9a4969bcf2db17da9d7 100644 +index 90c1c4b87947ed4c9ff84029193ed2cc0507b275..cab82f77bb11657c7896ad8ebf60d102f5ee56b6 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1152,6 +1152,17 @@ public class CraftEventFactory { +@@ -1158,6 +1158,17 @@ public class CraftEventFactory { return event; } diff --git a/patches/server/0114-Add-ProjectileCollideEvent.patch b/patches/server/0114-Add-ProjectileCollideEvent.patch index c2c4d8c42a..987cce21ea 100644 --- a/patches/server/0114-Add-ProjectileCollideEvent.patch +++ b/patches/server/0114-Add-ProjectileCollideEvent.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add ProjectileCollideEvent Deprecated now and replaced with ProjectileHitEvent diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 192d48ed576b2918d7cce9a4969bcf2db17da9d7..f882b007756edc2f25e913393b7e8b400ccbe50e 100644 +index cab82f77bb11657c7896ad8ebf60d102f5ee56b6..4291348fbbbad7dd10c8f9a7baf86645a705863c 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1296,6 +1296,17 @@ public class CraftEventFactory { +@@ -1302,6 +1302,17 @@ public class CraftEventFactory { return CraftItemStack.asNMSCopy(bitem); } @@ -27,7 +27,7 @@ index 192d48ed576b2918d7cce9a4969bcf2db17da9d7..f882b007756edc2f25e913393b7e8b40 public static ProjectileLaunchEvent callProjectileLaunchEvent(Entity entity) { Projectile bukkitEntity = (Projectile) entity.getBukkitEntity(); ProjectileLaunchEvent event = new ProjectileLaunchEvent(bukkitEntity); -@@ -1320,8 +1331,15 @@ public class CraftEventFactory { +@@ -1326,8 +1337,15 @@ public class CraftEventFactory { if (position.getType() == HitResult.Type.ENTITY) { hitEntity = ((EntityHitResult) position).getEntity().getBukkitEntity(); } diff --git a/patches/server/0119-Add-API-methods-to-control-if-armour-stands-can-move.patch b/patches/server/0119-Add-API-methods-to-control-if-armour-stands-can-move.patch index 5ecdd621ee..d2bc28f615 100644 --- a/patches/server/0119-Add-API-methods-to-control-if-armour-stands-can-move.patch +++ b/patches/server/0119-Add-API-methods-to-control-if-armour-stands-can-move.patch @@ -31,10 +31,10 @@ index af6a2e8c4ce41aaf55b645c37f809c2de7ea780a..be7ed906b4a5a8ffda87ecf66f967061 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -index 47ca72e264950dd950f037a21bb0ad6cc1700751..06cedeea447f53d100e32a6eba6f83b4719cb231 100644 +index 76536f0d700fb4b120ffef066588e305013a5a66..fc3b98746a558b3ad6c89543170225bdae1e63ba 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -@@ -228,4 +228,15 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { +@@ -222,4 +222,15 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { public boolean hasEquipmentLock(EquipmentSlot equipmentSlot, LockType lockType) { return (this.getHandle().disabledSlots & (1 << CraftEquipmentSlot.getNMS(equipmentSlot).getFilterFlag() + lockType.ordinal() * 8)) != 0; } diff --git a/patches/server/0122-Firework-API-s.patch b/patches/server/0122-Firework-API-s.patch index ac1814d178..f0e5ae593e 100644 --- a/patches/server/0122-Firework-API-s.patch +++ b/patches/server/0122-Firework-API-s.patch @@ -76,10 +76,10 @@ index 5cafb6f0b507127665393741b372286da098d603..7c627d27300247db9122ab2081049345 if (!user.getAbilities().instabuild) { itemStack.shrink(1); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java -index 59d5c314711b4ec239e5bcb4272b11ed72705c5a..c242f654c88ca1773429348939d3bb2ffae3768c 100644 +index 9702f4a92a1764a17040c65060df474abb79868d..a624a2a6cf31fbfed86930a462cbf1e2d93ca002 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java -@@ -135,4 +135,11 @@ public class CraftFirework extends CraftProjectile implements Firework { +@@ -129,4 +129,11 @@ public class CraftFirework extends CraftProjectile implements Firework { public void setShotAtAngle(boolean shotAtAngle) { this.getHandle().getEntityData().set(FireworkRocketEntity.DATA_SHOT_AT_ANGLE, shotAtAngle); } diff --git a/patches/server/0124-Provide-E-TE-Chunk-count-stat-methods.patch b/patches/server/0124-Provide-E-TE-Chunk-count-stat-methods.patch index b44c7c10aa..107e7f722a 100644 --- a/patches/server/0124-Provide-E-TE-Chunk-count-stat-methods.patch +++ b/patches/server/0124-Provide-E-TE-Chunk-count-stat-methods.patch @@ -20,10 +20,10 @@ index 0a419c98db5f6bb6935e88b640f74c6ec0c5503c..92aa1428e723b377c12bfd20cd1e6b42 private final List<TickingBlockEntity> pendingBlockEntityTickers = Lists.newArrayList(); private boolean tickingBlockEntities; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 4a3593f24fc844a6a8b1b6c28ad2dc9c609c29ad..04a12be27ea3f7b8c0dd2bb2c8f4f0a4b90de1b2 100644 +index a6b56df47abe01172460c1994a9c1ce01b9a001f..125c55c0c80772ec9bd65ea2ddcd5e2dbaa0f332 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -154,6 +154,56 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -155,6 +155,56 @@ public class CraftWorld extends CraftRegionAccessor implements World { private final CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftWorld.DATA_TYPE_REGISTRY); private net.kyori.adventure.pointer.Pointers adventure$pointers; // Paper - implement pointers diff --git a/patches/server/0127-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch b/patches/server/0127-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch index ce55e169ff..77fdbc0fac 100644 --- a/patches/server/0127-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch +++ b/patches/server/0127-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch @@ -205,7 +205,7 @@ index 6ab7ffe2b0da45c38edd46e9d29df603d3a0b0bc..fcd760cb88f84ff79811631612956fde } diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -index 27f99f9ce39aac0bae5e9a7b34fd63833aa4ad26..0f39550f82aa1646dd5e4a887e33c414160ee7d9 100644 +index 5951d2e53c361d2063131fd969dcd810fe0550b8..1a2d1e811a3b1ba9c05c096642b852ac0572e7ca 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java @@ -682,7 +682,7 @@ public class EnderDragon extends Mob implements Enemy { @@ -324,10 +324,10 @@ index 9113fd7070596ecf504837f335022d5eb4ef9a77..d56a64b058d8848e405e33d9884a61ea @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -index 6a4e30365f015b6aaf7ca18d7b31ff1523ebdf0c..002875dc5ee549c5d192d90c6e4daf59c1f7c0ff 100644 +index ee2e66ecd8f943df75176ecf42ac14acec241c24..c783fb9d3c2569c324877037913f286c325354ff 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -@@ -942,7 +942,7 @@ public abstract class CraftRegionAccessor implements RegionAccessor { +@@ -944,7 +944,7 @@ public abstract class CraftRegionAccessor implements RegionAccessor { } else if (TNTPrimed.class.isAssignableFrom(clazz)) { entity = new PrimedTnt(world, x, y, z, null); } else if (ExperienceOrb.class.isAssignableFrom(clazz)) { @@ -337,10 +337,10 @@ index 6a4e30365f015b6aaf7ca18d7b31ff1523ebdf0c..002875dc5ee549c5d192d90c6e4daf59 entity = net.minecraft.world.entity.EntityType.LIGHTNING_BOLT.create(world); entity.moveTo(location.getX(), location.getY(), location.getZ()); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java -index 40713228b149b4532fcee3a54bbe63e161318258..84899284703baeb04bfc79251941265d52ac07e8 100644 +index 4907d61b0254919e137c4f92e0dbeb2d61a906f6..26c795983515580b30b5ef8c701faa95ab1aea8e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java -@@ -19,6 +19,18 @@ public class CraftExperienceOrb extends CraftEntity implements ExperienceOrb { +@@ -18,6 +18,18 @@ public class CraftExperienceOrb extends CraftEntity implements ExperienceOrb { this.getHandle().value = value; } diff --git a/patches/server/0133-Add-configuration-option-to-prevent-player-names-fro.patch b/patches/server/0133-Add-configuration-option-to-prevent-player-names-fro.patch index fe41683266..a8c3c6a4a5 100644 --- a/patches/server/0133-Add-configuration-option-to-prevent-player-names-fro.patch +++ b/patches/server/0133-Add-configuration-option-to-prevent-player-names-fro.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add configuration option to prevent player names from being diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 9b45eed05bebc3957f54291fe59c87994bfdf00d..85b8ae9b40d0f631c91e00a59ce6347fd915bcb5 100644 +index 1efeedbe244396121c241272a30ef8ab5f2c50c8..29c6b41ef46e6e111f858063b5884ab5b8f90450 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2669,5 +2669,10 @@ public final class CraftServer implements Server { +@@ -2683,5 +2683,10 @@ public final class CraftServer implements Server { commandMap.registerServerAliases(); return true; } diff --git a/patches/server/0134-Use-TerminalConsoleAppender-for-console-improvements.patch b/patches/server/0134-Use-TerminalConsoleAppender-for-console-improvements.patch index 74f5c4fe0f..4d2cd481cc 100644 --- a/patches/server/0134-Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/patches/server/0134-Use-TerminalConsoleAppender-for-console-improvements.patch @@ -25,7 +25,7 @@ Other changes: Co-Authored-By: Emilia Kond <[email protected]> diff --git a/build.gradle.kts b/build.gradle.kts -index 9ab4d3e462c02e4d23b45adb46965eb75eb2178e..a651a41b33cb671e0d0bd7b2f990b2a727d6b15c 100644 +index f0386dc61dbcf4134e081e6024a5c0e8e8aa4fdb..d9ecb46a262e102d6c5c09f7c8b49abd2b904003 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,20 @@ plugins { @@ -370,7 +370,7 @@ index bc96f426d488d2a206b763dccdc4034fe24f269d..82db70c548336ada2af556251b8ae8d1 this.bans = new UserBanList(PlayerList.USERBANLIST_FILE); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 85b8ae9b40d0f631c91e00a59ce6347fd915bcb5..b91a06359b163b49c506d64b3da2e616e3d9fa40 100644 +index 29c6b41ef46e6e111f858063b5884ab5b8f90450..221479079487f0285e5aebbc3a568970420deb97 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -42,7 +42,6 @@ import java.util.logging.Level; @@ -381,7 +381,7 @@ index 85b8ae9b40d0f631c91e00a59ce6347fd915bcb5..b91a06359b163b49c506d64b3da2e616 import net.minecraft.advancements.Advancement; import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.Commands; -@@ -1308,9 +1307,13 @@ public final class CraftServer implements Server { +@@ -1319,9 +1318,13 @@ public final class CraftServer implements Server { return this.logger; } @@ -396,7 +396,7 @@ index 85b8ae9b40d0f631c91e00a59ce6347fd915bcb5..b91a06359b163b49c506d64b3da2e616 @Override public PluginCommand getPluginCommand(String name) { diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index b96652b7bcad07c39a81858c1a2c285efbf67905..cb1f050efb85e3b31dba2063fb3a316db1e0430d 100644 +index d0496f7a9e769f4a8a771959d3169c6086e93e47..54849fbfc650a781ce8b8818fc43f30d99dc15bc 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -13,7 +13,6 @@ import java.util.logging.Logger; @@ -434,8 +434,8 @@ index b96652b7bcad07c39a81858c1a2c285efbf67905..cb1f050efb85e3b31dba2063fb3a316d + System.setProperty(net.minecrell.terminalconsole.TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper } - if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { -@@ -266,7 +276,7 @@ public class Main { + System.err.println("**********************************************************************"); +@@ -269,7 +279,7 @@ public class Main { System.out.println("Unable to read system info"); } // Paper end diff --git a/patches/server/0136-Item-canEntityPickup.patch b/patches/server/0136-Item-canEntityPickup.patch index 1e18f0b02c..3fc7b9ce51 100644 --- a/patches/server/0136-Item-canEntityPickup.patch +++ b/patches/server/0136-Item-canEntityPickup.patch @@ -33,10 +33,10 @@ index dbe07ffbc6310828370be69081ac6d6f3085e4ac..1503d143429f0b73935004a7061d0409 public ItemEntity(EntityType<? extends ItemEntity> type, Level world) { super(type, world); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java -index d08869c92f15a63f857d88e506f744f5ff9eb15e..5f36b0fd12ccd0e7ec9a7f61c56f08307844935f 100644 +index 4fbbc3c76d49c31aadd957ad3a30d479f6c99c15..66e69cb13e2d82acc0a2398625766a49bc701a09 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java -@@ -66,6 +66,18 @@ public class CraftItem extends CraftEntity implements Item { +@@ -65,6 +65,18 @@ public class CraftItem extends CraftEntity implements Item { } } diff --git a/patches/server/0140-Add-UnknownCommandEvent.patch b/patches/server/0140-Add-UnknownCommandEvent.patch index 489953e61a..6653474089 100644 --- a/patches/server/0140-Add-UnknownCommandEvent.patch +++ b/patches/server/0140-Add-UnknownCommandEvent.patch @@ -83,10 +83,10 @@ index 2fdfc17ef3daf9fb5cc32c807292c71e256d5356..e3394864e29357fec036f9e616472aea b1 = 0; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b91a06359b163b49c506d64b3da2e616e3d9fa40..2e076affd9ee7e407e86586536d02cb8f6f20805 100644 +index 221479079487f0285e5aebbc3a568970420deb97..ae02fd56bc431a60985bc77e52202a79667b32cb 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -522,6 +522,7 @@ public final class CraftServer implements Server { +@@ -533,6 +533,7 @@ public final class CraftServer implements Server { } node = clone; } @@ -94,7 +94,7 @@ index b91a06359b163b49c506d64b3da2e616e3d9fa40..2e076affd9ee7e407e86586536d02cb8 dispatcher.getDispatcher().getRoot().addChild(node); } else { -@@ -911,7 +912,13 @@ public final class CraftServer implements Server { +@@ -922,7 +923,13 @@ public final class CraftServer implements Server { // Spigot start if (!org.spigotmc.SpigotConfig.unknownCommandMessage.isEmpty()) { diff --git a/patches/server/0141-Basic-PlayerProfile-API.patch b/patches/server/0141-Basic-PlayerProfile-API.patch index 79e093ddea..2cd5b73f37 100644 --- a/patches/server/0141-Basic-PlayerProfile-API.patch +++ b/patches/server/0141-Basic-PlayerProfile-API.patch @@ -631,10 +631,10 @@ index 4038bb76339d43f18770624bd7fecc79b8d7f2a9..2456edc11b29a92b1648937cd3dd6a9a String s1 = name.toLowerCase(Locale.ROOT); GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByName.get(s1); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 2e076affd9ee7e407e86586536d02cb8f6f20805..bdee52f1bd2bb34fd0292d35b8b1e7194d7df716 100644 +index ae02fd56bc431a60985bc77e52202a79667b32cb..5b72e8db898c1cd6ce459fa9a94128a6f3452df9 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -257,6 +257,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; +@@ -256,6 +256,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; import net.md_5.bungee.api.chat.BaseComponent; // Spigot @@ -652,7 +652,7 @@ index 2e076affd9ee7e407e86586536d02cb8f6f20805..bdee52f1bd2bb34fd0292d35b8b1e719 CraftItemFactory.instance(); } -@@ -2684,5 +2688,37 @@ public final class CraftServer implements Server { +@@ -2698,5 +2702,37 @@ public final class CraftServer implements Server { public boolean suggestPlayerNamesWhenNullTabCompletions() { return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions; } diff --git a/patches/server/0142-Shoulder-Entities-Release-API.patch b/patches/server/0142-Shoulder-Entities-Release-API.patch index 6795e8e96d..9ab5ae092e 100644 --- a/patches/server/0142-Shoulder-Entities-Release-API.patch +++ b/patches/server/0142-Shoulder-Entities-Release-API.patch @@ -59,11 +59,11 @@ index 8ef1798fe9dc42d9f09449ecc7578f4bddff1ed8..85488adc9c822c89ab5778bc1d48c58e @Override public abstract boolean isSpectator(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index abe978078270a45f7e77eb2b8a99309f12ca51ee..2f5704b19148f390402c0823030806ba96860286 100644 +index 0a2e7787d4c9cce973174fc21edbf18d400aa62b..09fa4baa09f6262e87abb17fb42be02aa4b9124f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -516,6 +516,32 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { - this.getHandle().getCooldowns().addCooldown(CraftMagicNumbers.getItem(material), ticks); +@@ -515,6 +515,32 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { + this.getHandle().getCooldowns().addCooldown(((CraftItemType) itemType).getHandle(), ticks); } + // Paper start diff --git a/patches/server/0145-Entity-fromMobSpawner.patch b/patches/server/0145-Entity-fromMobSpawner.patch index ca0e39dd5e..d5f345a541 100644 --- a/patches/server/0145-Entity-fromMobSpawner.patch +++ b/patches/server/0145-Entity-fromMobSpawner.patch @@ -49,10 +49,10 @@ index 7ae0465091db8e8061737bf93884afa3db49feeb..5d6403fa27521860a69a707dc4358b01 if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) { continue; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index fa2a6f44a1c25fb6c9a19e83e7eddb2c8d28a320..83bde3f87e0861fdfd01f843ccae285b1748619a 100644 +index 70726aa2e24cc6121293426f01a7eaed5f32075f..92a8c8512eb43df12fc85c8d167a7e55c855557c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1290,5 +1290,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1305,5 +1305,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { //noinspection ConstantConditions return originVector.toLocation(world); } diff --git a/patches/server/0147-Implement-ensureServerConversions-API.patch b/patches/server/0147-Implement-ensureServerConversions-API.patch index 439122668f..7085e6a074 100644 --- a/patches/server/0147-Implement-ensureServerConversions-API.patch +++ b/patches/server/0147-Implement-ensureServerConversions-API.patch @@ -7,10 +7,10 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr to ensure it meets latest minecraft expectations. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index b187c4f436ac44a529675869dbf5bfddc4fac86f..878f69460aed825d5d3204030af2aaa731a99875 100644 +index 3d5e8633e3d457bcd9f23b53eb916096249c3af2..42de325697de51f6c6e2274e6e67578b19849e8d 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -449,5 +449,11 @@ public final class CraftItemFactory implements ItemFactory { +@@ -297,5 +297,11 @@ public final class CraftItemFactory implements ItemFactory { public [email protected] Component displayName(@org.jetbrains.annotations.NotNull ItemStack itemStack) { return io.papermc.paper.adventure.PaperAdventure.asAdventure(CraftItemStack.asNMSCopy(itemStack).getDisplayName()); } diff --git a/patches/server/0148-Implement-getI18NDisplayName.patch b/patches/server/0148-Implement-getI18NDisplayName.patch index 4f1cfccf20..c7490eec69 100644 --- a/patches/server/0148-Implement-getI18NDisplayName.patch +++ b/patches/server/0148-Implement-getI18NDisplayName.patch @@ -8,10 +8,10 @@ Currently the server only supports the English language. To override this, You must replace the language file embedded in the server jar. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index 878f69460aed825d5d3204030af2aaa731a99875..f8475390d69bef6f3eca5a57d5f44021fabf4942 100644 +index 42de325697de51f6c6e2274e6e67578b19849e8d..161de8a7c1d3e6c7918a0f313c7df9719c14e672 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -455,5 +455,18 @@ public final class CraftItemFactory implements ItemFactory { +@@ -303,5 +303,18 @@ public final class CraftItemFactory implements ItemFactory { public ItemStack ensureServerConversions(ItemStack item) { return CraftItemStack.asCraftMirror(CraftItemStack.asNMSCopy(item)); } diff --git a/patches/server/0150-Fix-this-stupid-bullshit.patch b/patches/server/0150-Fix-this-stupid-bullshit.patch index 2158ef6589..885c134138 100644 --- a/patches/server/0150-Fix-this-stupid-bullshit.patch +++ b/patches/server/0150-Fix-this-stupid-bullshit.patch @@ -31,10 +31,10 @@ index 8ff786c366332588a2df053438f23cc9fb7e2b84..c887d34171f89c731d76c4ca92c70be2 Bootstrap.isBootstrapped = true; Instant instant = Instant.now(); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index cb1f050efb85e3b31dba2063fb3a316db1e0430d..f707537227a729a48f63b86b69bbeb22743435ac 100644 +index 54849fbfc650a781ce8b8818fc43f30d99dc15bc..3c88f7a8ea79c1c71f12eab139a74244e28f0143 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java -@@ -257,10 +257,12 @@ public class Main { +@@ -260,10 +260,12 @@ public class Main { Calendar deadline = Calendar.getInstance(); deadline.add(Calendar.DAY_OF_YEAR, -3); if (buildDate.before(deadline.getTime())) { diff --git a/patches/server/0151-LivingEntity-setKiller.patch b/patches/server/0151-LivingEntity-setKiller.patch index e6e7fff121..c0ac7bfaa2 100644 --- a/patches/server/0151-LivingEntity-setKiller.patch +++ b/patches/server/0151-LivingEntity-setKiller.patch @@ -7,10 +7,10 @@ Subject: [PATCH] LivingEntity#setKiller public net.minecraft.world.entity.LivingEntity lastHurtByPlayerTime diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index fcb07a5f8cac994b731e3345ba9e971faa482fa1..0fb61f37da9ef3e33803b41bd72e0bda5425eceb 100644 +index 3b001136ddf4eacfa85fcaf0e6e091a55d50b929..a25a43552fe4cd76bb27db9fac6f419c3d35e5ee 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -352,6 +352,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -355,6 +355,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { return this.getHandle().lastHurtByPlayer == null ? null : (Player) this.getHandle().lastHurtByPlayer.getBukkitEntity(); } diff --git a/patches/server/0166-API-to-get-a-BlockState-without-a-snapshot.patch b/patches/server/0166-API-to-get-a-BlockState-without-a-snapshot.patch index ed44d61314..0bcb11d1ee 100644 --- a/patches/server/0166-API-to-get-a-BlockState-without-a-snapshot.patch +++ b/patches/server/0166-API-to-get-a-BlockState-without-a-snapshot.patch @@ -51,10 +51,10 @@ index 63acd109a79ed752a05df3d4f1b99309297c2055..d156f7cc71050f13b2feca00c52ca6b6 return null; } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index e5750b2459e5a7513b34d644f672f3e06181172d..3205d86a63f8fcf3ccd13c6be0e0eefc27beb62a 100644 +index 3828690f205ad2623d9a9f94f0b08652e2cb9249..77dd29a93af4cc0a02374fe2bf0ff0a2679fc9a4 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -@@ -332,6 +332,13 @@ public class CraftBlock implements Block { +@@ -327,6 +327,13 @@ public class CraftBlock implements Block { return CraftBlockStates.getBlockState(this); } @@ -114,7 +114,7 @@ index f698424feb30a8579e2ca581c48be08edf5bbf59..84550b6e4eaf62806a8ad83656d4051b + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java -index a69a03a7954b03a0aeca7a74d89756dd38ca6faf..17e1131c79ad140c0803a914621ce7924f0f2a6d 100644 +index 32ac86aaa58150c050028cb279c7520f67f77e78..3af36dd64e5e2a4eb142a24254e3e271a4524943 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java @@ -379,15 +379,30 @@ public final class CraftBlockStates { @@ -147,7 +147,7 @@ index a69a03a7954b03a0aeca7a74d89756dd38ca6faf..17e1131c79ad140c0803a914621ce792 + // Paper end } - public static BlockState getBlockState(Material material, @Nullable CompoundTag blockEntityTag) { + public static BlockState getBlockState(BlockType<?> blockType, @Nullable CompoundTag blockEntityTag) { diff --git a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java index 6c559b0d7b3d8b95276d16a6af4975fd44de3334..a94389eebe51bb368f759b3f99f0b9ed08ae2bdd 100644 --- a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java diff --git a/patches/server/0167-AsyncTabCompleteEvent.patch b/patches/server/0167-AsyncTabCompleteEvent.patch index 5986f9ed82..d7d9bef5f3 100644 --- a/patches/server/0167-AsyncTabCompleteEvent.patch +++ b/patches/server/0167-AsyncTabCompleteEvent.patch @@ -16,7 +16,7 @@ Also adds isCommand and getLocation to the sync TabCompleteEvent Co-authored-by: Aikar <[email protected]> diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index b4c0e41b1d6e6c9411e1bbf6af07533b8dbb68f7..c66209a33d6bdfda559e16cbc59c66e7a9f4c4de 100644 +index 15d335ed559a28757d8c2905c86540242dcf79cc..4dc5491f01d4ba0c1825a78dbbef5f32fb4dac70 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -788,12 +788,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -91,10 +91,10 @@ index b4c0e41b1d6e6c9411e1bbf6af07533b8dbb68f7..c66209a33d6bdfda559e16cbc59c66e7 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index bdee52f1bd2bb34fd0292d35b8b1e7194d7df716..40090372a983b7064530e982a8ee1a9bc4913dfd 100644 +index 5b72e8db898c1cd6ce459fa9a94128a6f3452df9..b33e26f780bb656cba2162e01564063191eceb29 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2134,7 +2134,7 @@ public final class CraftServer implements Server { +@@ -2145,7 +2145,7 @@ public final class CraftServer implements Server { offers = this.tabCompleteChat(player, message); } diff --git a/patches/server/0169-Ability-to-apply-mending-to-XP-API.patch b/patches/server/0169-Ability-to-apply-mending-to-XP-API.patch index 5f9ee625bb..82575e700f 100644 --- a/patches/server/0169-Ability-to-apply-mending-to-XP-API.patch +++ b/patches/server/0169-Ability-to-apply-mending-to-XP-API.patch @@ -14,10 +14,10 @@ public net.minecraft.world.entity.ExperienceOrb durabilityToXp(I)I public net.minecraft.world.entity.ExperienceOrb xpToDurability(I)I diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c46c8a2203c7f54da54ae5d066dc3d25f993560a..1dee499c843f4e434fd7881881955fa33b880aef 100644 +index 7472166b5a7bf5191e2776e85163537f70d9b4bc..b6002f64fb703e670ebfe6273b2348b4f8123aa8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1476,7 +1476,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1498,7 +1498,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } @Override diff --git a/patches/server/0171-Add-setPlayerProfile-API-for-Skulls.patch b/patches/server/0171-Add-setPlayerProfile-API-for-Skulls.patch index 45c86f49cd..013cad948b 100644 --- a/patches/server/0171-Add-setPlayerProfile-API-for-Skulls.patch +++ b/patches/server/0171-Add-setPlayerProfile-API-for-Skulls.patch @@ -7,10 +7,10 @@ This allows you to create already filled textures on Skulls to avoid texture loo which commonly cause rate limit issues with Mojang API diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java -index cf76e486bc873580c3b28dee88e168a2f3666a79..1325e9140a4b568170f0bd400904fe3c9d00cd4f 100644 +index 2d2d8f7a204753649a43817642ca3f97f203407a..e9f0bae7cf7f95946903bd741581ece57f660085 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java -@@ -106,7 +106,22 @@ public class CraftSkull extends CraftBlockEntityState<SkullBlockEntity> implemen +@@ -107,7 +107,22 @@ public class CraftSkull extends CraftBlockEntityState<SkullBlockEntity> implemen } } @@ -33,7 +33,7 @@ index cf76e486bc873580c3b28dee88e168a2f3666a79..1325e9140a4b568170f0bd400904fe3c public PlayerProfile getOwnerProfile() { if (!this.hasOwner()) { return null; -@@ -116,11 +131,12 @@ public class CraftSkull extends CraftBlockEntityState<SkullBlockEntity> implemen +@@ -117,11 +132,12 @@ public class CraftSkull extends CraftBlockEntityState<SkullBlockEntity> implemen } @Override @@ -48,10 +48,10 @@ index cf76e486bc873580c3b28dee88e168a2f3666a79..1325e9140a4b568170f0bd400904fe3c } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java -index 85b9baad074634a2f21c15adbb393ebc5924bdd8..deed77a3d44bc55681483d7f47f148b5220135f2 100644 +index d2a86f48c7b43db6b990a578f4cf5d868c78ce67..239a3b37c39fecc8af54f5706b7091a7870d6e5b 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java -@@ -184,6 +184,19 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { +@@ -177,6 +177,19 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { return this.hasOwner() ? this.profile.getName() : null; } @@ -71,7 +71,7 @@ index 85b9baad074634a2f21c15adbb393ebc5924bdd8..deed77a3d44bc55681483d7f47f148b5 @Override public OfflinePlayer getOwningPlayer() { if (this.hasOwner()) { -@@ -234,6 +247,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { +@@ -227,6 +240,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { } @Override @@ -79,7 +79,7 @@ index 85b9baad074634a2f21c15adbb393ebc5924bdd8..deed77a3d44bc55681483d7f47f148b5 public PlayerProfile getOwnerProfile() { if (!this.hasOwner()) { return null; -@@ -243,11 +257,12 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { +@@ -236,11 +250,12 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { } @Override @@ -93,7 +93,7 @@ index 85b9baad074634a2f21c15adbb393ebc5924bdd8..deed77a3d44bc55681483d7f47f148b5 } } -@@ -301,7 +316,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { +@@ -294,7 +309,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { Builder<String, Object> serialize(Builder<String, Object> builder) { super.serialize(builder); if (this.profile != null) { diff --git a/patches/server/0175-Add-ArmorStand-Item-Meta.patch b/patches/server/0175-Add-ArmorStand-Item-Meta.patch index 382ebbe746..679907c6d4 100644 --- a/patches/server/0175-Add-ArmorStand-Item-Meta.patch +++ b/patches/server/0175-Add-ArmorStand-Item-Meta.patch @@ -13,11 +13,11 @@ starting point for future additions in this area. Fixes GH-559 diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java -index 4017933f2244fca32cf9d39444f3a4f550e8af01..e721517ce7b52a1aa10d039aa9f309eb69db4733 100644 +index 9c9f168c9287138c0950d942076c05a2cffa001a..e78c8b91d53a30084d615f8540b1c45c1be18e88 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java -@@ -8,9 +8,22 @@ import org.bukkit.Material; - import org.bukkit.configuration.serialization.DelegateDeserialization; +@@ -8,9 +8,22 @@ import org.bukkit.configuration.serialization.DelegateDeserialization; + import org.bukkit.inventory.ItemType; @DelegateDeserialization(CraftMetaItem.SerializableMeta.class) -public class CraftMetaArmorStand extends CraftMetaItem { @@ -255,10 +255,10 @@ index 4017933f2244fca32cf9d39444f3a4f550e8af01..e721517ce7b52a1aa10d039aa9f309eb + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index bfd5661d55a6ed767cb3bed2d9bb24535c1f7335..01e09dfc00b2ae9ecd39bea37f229ad826de121c 100644 +index 713e5a8f38ed76eec2386991b73cfa60d8309fdf..00bad8b037a48abd183cadd9fa94f2faff4596de 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -1457,6 +1457,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1462,6 +1462,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { CraftMetaCrossbow.CHARGED.NBT, CraftMetaCrossbow.CHARGED_PROJECTILES.NBT, CraftMetaSuspiciousStew.EFFECTS.NBT, @@ -274,10 +274,10 @@ index bfd5661d55a6ed767cb3bed2d9bb24535c1f7335..01e09dfc00b2ae9ecd39bea37f229ad8 CraftMetaCompass.LODESTONE_POS.NBT, CraftMetaCompass.LODESTONE_TRACKED.NBT, diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -index 8b7a9ea385788580cc99db5b2182e849bedc262f..4400f10a592b86488e61521a4fce61adbf656cb9 100644 +index 49a16a4d84dc0638bbf4b986984afb9cdf053e9a..76106ce9aa33dec5ad3768c4a7077dc5f0b48523 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -@@ -364,6 +364,7 @@ public class ItemMetaTest extends AbstractTestingBase { +@@ -367,6 +367,7 @@ public class ItemMetaTest extends AbstractTestingBase { final CraftMetaArmorStand meta = (CraftMetaArmorStand) cleanStack.getItemMeta(); meta.entityTag = new CompoundTag(); meta.entityTag.putBoolean("Small", true); diff --git a/patches/server/0182-Player.setPlayerProfile-API.patch b/patches/server/0182-Player.setPlayerProfile-API.patch index e554fe912b..63e1ccbe2f 100644 --- a/patches/server/0182-Player.setPlayerProfile-API.patch +++ b/patches/server/0182-Player.setPlayerProfile-API.patch @@ -9,7 +9,7 @@ This can be useful for changing name or skins after a player has logged in. public-f net.minecraft.world.entity.player.Player gameProfile diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index c66209a33d6bdfda559e16cbc59c66e7a9f4c4de..391295bf6898320421272ad5dfb14e4c5e2d2be0 100644 +index 4dc5491f01d4ba0c1825a78dbbef5f32fb4dac70..a88beb2e59f1f381263b2649039e2cc6c1294210 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1538,7 +1538,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -40,10 +40,10 @@ index 6b31b0894e52ad6fc397624e50587ec04e46c099..0c7f280bae81bbb492d5780a43e5ffda playerName = gameProfile.getName(); uniqueId = gameProfile.getId(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -index e7442952ef1f03969949014492a7ddc6d0796ba5..69a1852905dd4724c30ac8ab88c14251eee2c371 100644 +index 27c990dd9d025e6ccb58df43c41dbfa071687f2d..d870cd9cf7453cc13aafed9f5205e7c28b1a9cdc 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -@@ -76,8 +76,8 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa +@@ -78,8 +78,8 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa } @Override @@ -55,7 +55,7 @@ index e7442952ef1f03969949014492a7ddc6d0796ba5..69a1852905dd4724c30ac8ab88c14251 public Server getServer() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 1dee499c843f4e434fd7881881955fa33b880aef..bf6acb00eb347ae8d746fb8e7231ae766069d0d2 100644 +index b6002f64fb703e670ebfe6273b2348b4f8123aa8..116057b984ccf3214717a10f4eb10c9c40b8807f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -83,6 +83,7 @@ import net.minecraft.world.entity.ai.attributes.Attributes; @@ -78,7 +78,7 @@ index 1dee499c843f4e434fd7881881955fa33b880aef..bf6acb00eb347ae8d746fb8e7231ae76 @Override public InetSocketAddress getAddress() { if (this.getHandle().connection == null) return null; -@@ -1626,8 +1622,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1648,8 +1644,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { private void untrackAndHideEntity(org.bukkit.entity.Entity entity) { // Remove this entity from the hidden player's EntityTrackerEntry @@ -95,7 +95,7 @@ index 1dee499c843f4e434fd7881881955fa33b880aef..bf6acb00eb347ae8d746fb8e7231ae76 ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId()); if (entry != null) { entry.removePlayer(this.getHandle()); -@@ -1640,8 +1643,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1662,8 +1665,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().connection.send(new ClientboundPlayerInfoRemovePacket(List.of(otherPlayer.getUUID()))); } } @@ -104,7 +104,7 @@ index 1dee499c843f4e434fd7881881955fa33b880aef..bf6acb00eb347ae8d746fb8e7231ae76 } void resetAndHideEntity(org.bukkit.entity.Entity entity) { -@@ -1718,8 +1719,38 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1740,8 +1741,38 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (entry != null && !entry.seenBy.contains(this.getHandle().connection)) { entry.updatePlayer(this.getHandle()); } @@ -144,7 +144,7 @@ index 1dee499c843f4e434fd7881881955fa33b880aef..bf6acb00eb347ae8d746fb8e7231ae76 } void resetAndShowEntity(org.bukkit.entity.Entity entity) { -@@ -1732,6 +1763,36 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1754,6 +1785,36 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.trackAndShowEntity(entity); } } @@ -182,10 +182,10 @@ index 1dee499c843f4e434fd7881881955fa33b880aef..bf6acb00eb347ae8d746fb8e7231ae76 public void onEntityRemove(Entity entity) { this.invertedVisibilityEntities.remove(entity.getUUID()); diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 173a2832f029e3d568208a1b56419c1b8501483c..48cdd483c25825571043800f3cfa41a4d723f649 100644 +index aeda6bb7f13a59de88012f3ab784c5a83eae700e..754beb0b96e6b645630fa72dd67ea953c7470dfc 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -329,6 +329,12 @@ public class Commodore +@@ -856,6 +856,12 @@ public class Commodore { return; } @@ -195,6 +195,6 @@ index 173a2832f029e3d568208a1b56419c1b8501483c..48cdd483c25825571043800f3cfa41a4 + return; + } + // Paper end - if ( modern ) - { - if ( owner.equals( "org/bukkit/Material" ) ) + if (modern) { + if (owner.equals("org/bukkit/Material")) { + switch (name) { diff --git a/patches/server/0183-getPlayerUniqueId-API.patch b/patches/server/0183-getPlayerUniqueId-API.patch index fd7b2501e2..3ceb834d31 100644 --- a/patches/server/0183-getPlayerUniqueId-API.patch +++ b/patches/server/0183-getPlayerUniqueId-API.patch @@ -9,10 +9,10 @@ In Offline Mode, will return an Offline UUID This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 40090372a983b7064530e982a8ee1a9bc4913dfd..23407ccc0482f67db46947cbcc56c5488c42cf93 100644 +index b33e26f780bb656cba2162e01564063191eceb29..31bc418253abd54c96d6853568e019b5c95a7602 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1743,6 +1743,25 @@ public final class CraftServer implements Server { +@@ -1754,6 +1754,25 @@ public final class CraftServer implements Server { return recipients.size(); } diff --git a/patches/server/0187-Flag-to-disable-the-channel-limit.patch b/patches/server/0187-Flag-to-disable-the-channel-limit.patch index 5632c1f6d2..11b2d9033b 100644 --- a/patches/server/0187-Flag-to-disable-the-channel-limit.patch +++ b/patches/server/0187-Flag-to-disable-the-channel-limit.patch @@ -9,7 +9,7 @@ e.g. servers which allow and support the usage of mod packs. provide an optional flag to disable this check, at your own risk. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index bf6acb00eb347ae8d746fb8e7231ae766069d0d2..70b499e4c6d50cb55219033fd67356295239316a 100644 +index 116057b984ccf3214717a10f4eb10c9c40b8807f..46d06256230dafac0088a60de7c210a6aa103931 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -185,6 +185,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -20,7 +20,7 @@ index bf6acb00eb347ae8d746fb8e7231ae766069d0d2..70b499e4c6d50cb55219033fd6735629 // Paper end public CraftPlayer(CraftServer server, ServerPlayer entity) { -@@ -2001,7 +2002,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2023,7 +2024,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Paper end public void addChannel(String channel) { diff --git a/patches/server/0188-Add-openSign-method-to-HumanEntity.patch b/patches/server/0188-Add-openSign-method-to-HumanEntity.patch index 45ac3fe3c6..27df94aef6 100644 --- a/patches/server/0188-Add-openSign-method-to-HumanEntity.patch +++ b/patches/server/0188-Add-openSign-method-to-HumanEntity.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add openSign method to HumanEntity diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java -index cc6aab5341365f9b4ec3cb23e2a4f5006aa75cd7..78b57aa3120f8526b4bff2ca90d7735845a87b41 100644 +index 8ce466c19dae6534be828779639aedb687a94e68..a74a585a270e4a4c12f025b35a7f104f21e4705c 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java @@ -110,7 +110,7 @@ public class CraftSign<T extends SignBlockEntity> extends CraftBlockEntityState< @@ -28,10 +28,10 @@ index cc6aab5341365f9b4ec3cb23e2a4f5006aa75cd7..78b57aa3120f8526b4bff2ca90d77358 // Paper start diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 2f5704b19148f390402c0823030806ba96860286..f59733b6918dcbbb2190f76d8b8841a2d8818cdf 100644 +index 09fa4baa09f6262e87abb17fb42be02aa4b9124f..59f7320a3acffb12e36f81580d04a2adf866089d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -626,6 +626,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -625,6 +625,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { } } diff --git a/patches/server/0191-Enderman.teleportRandomly.patch b/patches/server/0191-Enderman.teleportRandomly.patch index 3db423abec..d5a1395578 100644 --- a/patches/server/0191-Enderman.teleportRandomly.patch +++ b/patches/server/0191-Enderman.teleportRandomly.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Enderman.teleportRandomly() Ability to trigger the vanilla "teleport randomly" mechanic of an enderman. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java -index 3121e0cef159493d6282e53d3a4ee3e4288ce5e1..fe829a74e23442c93bb5565589e8f33300ea01e1 100644 +index 0e13edd23016a6ffe6492de322e1d675137e3c9e..cb161c3d1a08d9c143201040018664298e98eafe 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java -@@ -18,6 +18,7 @@ public class CraftEnderman extends CraftMonster implements Enderman { +@@ -17,6 +17,7 @@ public class CraftEnderman extends CraftMonster implements Enderman { super(server, entity); } diff --git a/patches/server/0193-Expand-World.spawnParticle-API-and-add-Builder.patch b/patches/server/0193-Expand-World.spawnParticle-API-and-add-Builder.patch index cd8a1df970..19f435c50f 100644 --- a/patches/server/0193-Expand-World.spawnParticle-API-and-add-Builder.patch +++ b/patches/server/0193-Expand-World.spawnParticle-API-and-add-Builder.patch @@ -10,7 +10,7 @@ Adds an option to control the force mode of the particle. This adds a new Builder API which is much friendlier to use. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index f2eefdeab44ad4f7c0abd0e55e688e74a83abfff..68257f257dd3b167e237482c8d149590103896b2 100644 +index f2eefdeab44ad4f7c0abd0e55e688e74a83abfff..e5aea9a58dae2342e13bdd8427a35a1845731b45 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1717,12 +1717,17 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -18,9 +18,9 @@ index f2eefdeab44ad4f7c0abd0e55e688e74a83abfff..68257f257dd3b167e237482c8d149590 public <T extends ParticleOptions> int sendParticles(ServerPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, boolean force) { + // Paper start - Particle API Expansion -+ return sendParticles(players, sender, t0, d0, d1, d2, i, d3, d4, d5, d6, force); ++ return sendParticles(this.players(), sender, t0, d0, d1, d2, i, d3, d4, d5, d6, force); + } -+ public <T extends ParticleOptions> int sendParticles(List<ServerPlayer> receivers, ServerPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, boolean force) { ++ public <T extends ParticleOptions> int sendParticles(List<ServerPlayer> receivers, @Nullable ServerPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, boolean force) { + // Paper end ClientboundLevelParticlesPacket packetplayoutworldparticles = new ClientboundLevelParticlesPacket(t0, force, d0, d1, d2, (float) d3, (float) d4, (float) d5, (float) d6, i); // CraftBukkit end @@ -34,26 +34,27 @@ index f2eefdeab44ad4f7c0abd0e55e688e74a83abfff..68257f257dd3b167e237482c8d149590 if (this.sendParticles(entityplayer, force, d0, d1, d2, packetplayoutworldparticles)) { // CraftBukkit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 04a12be27ea3f7b8c0dd2bb2c8f4f0a4b90de1b2..5f8ce418d0a906f576622c3387d15c3969812611 100644 +index 125c55c0c80772ec9bd65ea2ddcd5e2dbaa0f332..82be61dffb993b2491890be42a114e1e4c59fc0f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1863,11 +1863,17 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1857,12 +1857,18 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override - public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { -- if (data != null) { + public <T> void spawnParticle(Particle<T> particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { + // Paper start - Particle API Expansion -+ spawnParticle(particle, null, null, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, force); ++ this.spawnParticle(particle, null, null, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, force); + } -+ public <T> void spawnParticle(Particle particle, List<Player> receivers, Player sender, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { -+ // Paper end ++ public <T> void spawnParticle(Particle<T> particle, List<Player> receivers, Player sender, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { + data = CraftParticle.convertLegacy(data); +- if (data != null) { + if (data != null && !particle.getDataType().isInstance(data)) { ++ // Paper end Preconditions.checkArgument(particle.getDataType().isInstance(data), "data (%s) should be %s", data.getClass(), particle.getDataType()); } this.getHandle().sendParticles( - null, // Sender -+ receivers == null ? getHandle().players() : receivers.stream().map(player -> ((CraftPlayer) player).getHandle()).collect(java.util.stream.Collectors.toList()), // Paper - Particle API Expansion ++ receivers == null ? this.getHandle().players() : receivers.stream().map(player -> ((CraftPlayer) player).getHandle()).collect(java.util.stream.Collectors.toList()), // Paper - Particle API Expansion + sender != null ? ((CraftPlayer) sender).getHandle() : null, // Sender // Paper - Particle API Expansion - CraftParticle.toNMS(particle, data), // Particle + ((CraftParticle<T>) particle).createParticleParam(data), // Particle x, y, z, // Position count, // Count diff --git a/patches/server/0199-Allow-spawning-Item-entities-with-World.spawnEntity.patch b/patches/server/0199-Allow-spawning-Item-entities-with-World.spawnEntity.patch index 5d2bb7facd..b25c1ffce9 100644 --- a/patches/server/0199-Allow-spawning-Item-entities-with-World.spawnEntity.patch +++ b/patches/server/0199-Allow-spawning-Item-entities-with-World.spawnEntity.patch @@ -8,10 +8,10 @@ This API has more capabilities than .dropItem with the Consumer function Item can be set inside of the Consumer pre spawn function. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -index 002875dc5ee549c5d192d90c6e4daf59c1f7c0ff..bdc752631136a4abe903e7a8f182e9eda480fcb6 100644 +index c783fb9d3c2569c324877037913f286c325354ff..177d58dca134ee590af9cfd1fb427aa7eed7d4b3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -@@ -592,6 +592,10 @@ public abstract class CraftRegionAccessor implements RegionAccessor { +@@ -594,6 +594,10 @@ public abstract class CraftRegionAccessor implements RegionAccessor { entity = net.minecraft.world.entity.EntityType.BOAT.create(world); } entity.moveTo(x, y, z, yaw, pitch); diff --git a/patches/server/0201-ItemStack-getMaxItemUseDuration.patch b/patches/server/0201-ItemStack-getMaxItemUseDuration.patch index 3dc9b55c1f..f021ad43f5 100644 --- a/patches/server/0201-ItemStack-getMaxItemUseDuration.patch +++ b/patches/server/0201-ItemStack-getMaxItemUseDuration.patch @@ -6,11 +6,11 @@ Subject: [PATCH] ItemStack#getMaxItemUseDuration Allows you to determine how long it takes to use a usable/consumable item diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 7fd9a3a7f4cb98d89b7c4cbfda756d581963e5bf..0ac686e880f0f87ab3f6dbed77e553d7568b3305 100644 +index 56f576e3c71d256dfd8e1c862573b0bcf1f70e60..73e5a7f7aa6021715d0d936935470e7f81ada5fa 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -174,6 +174,13 @@ public final class CraftItemStack extends ItemStack { - return (this.handle == null) ? Material.AIR.getMaxStackSize() : this.handle.getItem().getMaxStackSize(); + return (this.handle == null) ? ItemType.AIR.getMaxStackSize() : this.handle.getItem().getMaxStackSize(); } + // Paper start diff --git a/patches/server/0204-Fix-CraftEntity-hashCode.patch b/patches/server/0204-Fix-CraftEntity-hashCode.patch index a1ed33d54c..7768e6c853 100644 --- a/patches/server/0204-Fix-CraftEntity-hashCode.patch +++ b/patches/server/0204-Fix-CraftEntity-hashCode.patch @@ -21,10 +21,10 @@ check is essentially the same as this.getHandle() == other.getHandle() However, replaced it too to make it clearer of intent. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 83bde3f87e0861fdfd01f843ccae285b1748619a..9614a0bd83139e8d62f60fe04f017e0cb0f828c9 100644 +index 92a8c8512eb43df12fc85c8d167a7e55c855557c..0008f8365b13e10d842a3e2e7c4f87448014a857 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -830,14 +830,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -841,14 +841,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return false; } final CraftEntity other = (CraftEntity) obj; diff --git a/patches/server/0207-Make-shield-blocking-delay-configurable.patch b/patches/server/0207-Make-shield-blocking-delay-configurable.patch index 5d4a6a2ef0..0a8dfb5635 100644 --- a/patches/server/0207-Make-shield-blocking-delay-configurable.patch +++ b/patches/server/0207-Make-shield-blocking-delay-configurable.patch @@ -35,10 +35,10 @@ index c3ad63e1882d53f4207f4f08b55088d175360e8d..f894ffb7c9575d7337353ab8aaaf0b96 return this.isShiftKeyDown(); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 0fb61f37da9ef3e33803b41bd72e0bda5425eceb..b02d668243478c2cdc3d0212cec6f2e12a80414f 100644 +index a25a43552fe4cd76bb27db9fac6f419c3d35e5ee..fa6e2c147b8fae29b98ebd87cc663ac9a7201058 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -788,5 +788,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -786,5 +786,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { public void setArrowsStuck(final int arrows) { this.getHandle().setArrowCount(arrows); } diff --git a/patches/server/0211-Expand-Explosions-API.patch b/patches/server/0211-Expand-Explosions-API.patch index 98ca885cf2..51b9e3ef2d 100644 --- a/patches/server/0211-Expand-Explosions-API.patch +++ b/patches/server/0211-Expand-Explosions-API.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Expand Explosions API Add Entity as a Source capability, and add more API choices, and on Location. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 5f8ce418d0a906f576622c3387d15c3969812611..4a64fda12ef5e5d07fe0b28c755a5b9fd96358e6 100644 +index 82be61dffb993b2491890be42a114e1e4c59fc0f..6ce95bfd732826fbfb75ec0f9b0fd361bbf9c935 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -716,6 +716,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -717,6 +717,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks, Entity source) { return !this.world.explode(source == null ? null : ((CraftEntity) source).getHandle(), x, y, z, power, setFire, breakBlocks ? net.minecraft.world.level.Level.ExplosionInteraction.MOB : net.minecraft.world.level.Level.ExplosionInteraction.NONE).wasCanceled; } diff --git a/patches/server/0212-LivingEntity-Hand-Raised-Item-Use-API.patch b/patches/server/0212-LivingEntity-Hand-Raised-Item-Use-API.patch index 4d12e9763e..c7c344051b 100644 --- a/patches/server/0212-LivingEntity-Hand-Raised-Item-Use-API.patch +++ b/patches/server/0212-LivingEntity-Hand-Raised-Item-Use-API.patch @@ -6,10 +6,10 @@ Subject: [PATCH] LivingEntity Hand Raised/Item Use API How long an entity has raised hands to charge an attack or use an item diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index b02d668243478c2cdc3d0212cec6f2e12a80414f..6c4ff1acbf09987f8d6a4b4b2c62fce264430706 100644 +index fa6e2c147b8fae29b98ebd87cc663ac9a7201058..0bd811ed75d73afa84e9434318a2d670f7241f0c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -798,5 +798,30 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -796,5 +796,30 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { public void setShieldBlockingDelay(int delay) { getHandle().setShieldBlockingDelay(delay); } diff --git a/patches/server/0213-RangedEntity-API.patch b/patches/server/0213-RangedEntity-API.patch index 2f5d687138..a75f8218f2 100644 --- a/patches/server/0213-RangedEntity-API.patch +++ b/patches/server/0213-RangedEntity-API.patch @@ -57,12 +57,12 @@ index db6ad6eea8fa6f2755bbb0e1325df8bda98e708a..5ff566186431440c25a26900aba14e4a + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftDrowned.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftDrowned.java -index 34cb8062168258bfd168826ceeb2fde669f6d1a8..03e2acd4829da449a471b0fa1a311e74aee114d3 100644 +index b91d0841b7189d560150d41877e4a0bdea161539..14b575254171f66b8792033c93cf5a325a42b467 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftDrowned.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftDrowned.java -@@ -4,7 +4,7 @@ import org.bukkit.craftbukkit.CraftServer; +@@ -3,7 +3,7 @@ package org.bukkit.craftbukkit.entity; + import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Drowned; - import org.bukkit.entity.EntityType; -public class CraftDrowned extends CraftZombie implements Drowned { +public class CraftDrowned extends CraftZombie implements Drowned, com.destroystokyo.paper.entity.CraftRangedEntity<net.minecraft.world.entity.monster.Drowned> { // Paper @@ -70,11 +70,11 @@ index 34cb8062168258bfd168826ceeb2fde669f6d1a8..03e2acd4829da449a471b0fa1a311e74 public CraftDrowned(CraftServer server, net.minecraft.world.entity.monster.Drowned entity) { super(server, entity); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftIllusioner.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftIllusioner.java -index 59b866e54e0d7e1dd8815ffa85275e36271113da..bbf7189a0fc9921e7a6007494f91229d9fba0846 100644 +index 995c77ee53347328bfd0ad66fcc1b39589967476..5b2af80e584977683cd39e6f440e65a76e929be9 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftIllusioner.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftIllusioner.java -@@ -4,7 +4,7 @@ import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.entity.EntityType; +@@ -3,7 +3,7 @@ package org.bukkit.craftbukkit.entity; + import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Illusioner; -public class CraftIllusioner extends CraftSpellcaster implements Illusioner { @@ -83,10 +83,10 @@ index 59b866e54e0d7e1dd8815ffa85275e36271113da..bbf7189a0fc9921e7a6007494f91229d public CraftIllusioner(CraftServer server, net.minecraft.world.entity.monster.Illusioner entity) { super(server, entity); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java -index 92e48f89f8eef4c1110ff6dadea2f436e0b82d21..5500d5768bb22f70b99aa28cf4541b4871e12139 100644 +index dfd4cf1e613b7ccf3ad986f8e0d783593a411194..9986ac517e11b076a29a8c8e3f480ec286fa5825 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java -@@ -9,7 +9,7 @@ import org.bukkit.entity.Llama; +@@ -8,7 +8,7 @@ import org.bukkit.entity.Llama; import org.bukkit.entity.Llama.Color; import org.bukkit.inventory.LlamaInventory; @@ -96,12 +96,12 @@ index 92e48f89f8eef4c1110ff6dadea2f436e0b82d21..5500d5768bb22f70b99aa28cf4541b48 public CraftLlama(CraftServer server, net.minecraft.world.entity.animal.horse.Llama entity) { super(server, entity); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java -index 27763d1eca832abda76c8b3c22595cbaf9b1fe45..aeda5fc001fe4ce55ee467240b275b6050a29f98 100644 +index 2cdcd3a6bd9bd76f2654927d410d22b31199048c..ee69aff7ea348c8b0d2b272451ffd36d39bb0e0e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java -@@ -13,7 +13,7 @@ import org.bukkit.entity.EntityType; - import org.bukkit.entity.Piglin; +@@ -12,7 +12,7 @@ import org.bukkit.entity.Piglin; import org.bukkit.inventory.Inventory; + import org.bukkit.inventory.ItemType; -public class CraftPiglin extends CraftPiglinAbstract implements Piglin { +public class CraftPiglin extends CraftPiglinAbstract implements Piglin, com.destroystokyo.paper.entity.CraftRangedEntity<net.minecraft.world.entity.monster.piglin.Piglin> { // Paper @@ -109,10 +109,10 @@ index 27763d1eca832abda76c8b3c22595cbaf9b1fe45..aeda5fc001fe4ce55ee467240b275b60 public CraftPiglin(CraftServer server, net.minecraft.world.entity.monster.piglin.Piglin entity) { super(server, entity); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPillager.java -index 06786fba1fef36e8fc3d0f5650160123f728a6d1..beea227855f0b978e655efc298024120df8f4945 100644 +index d82cea48d9baeaba4dfa32540dcc9ca73651608b..2638c341bc02f201f7ab17fdebcdbdf3a7ec05bf 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPillager.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPillager.java -@@ -6,7 +6,7 @@ import org.bukkit.entity.EntityType; +@@ -5,7 +5,7 @@ import org.bukkit.craftbukkit.inventory.CraftInventory; import org.bukkit.entity.Pillager; import org.bukkit.inventory.Inventory; @@ -122,11 +122,11 @@ index 06786fba1fef36e8fc3d0f5650160123f728a6d1..beea227855f0b978e655efc298024120 public CraftPillager(CraftServer server, net.minecraft.world.entity.monster.Pillager entity) { super(server, entity); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java -index 6a82d567d96a42bfea0e38afb4e8de13eb3ad5a2..659e2959c5330e4764ea1edc7f8de9f464f9ff52 100644 +index cb9efd2fa886d721a802d1c644d9b2c7e6eb948a..5d2e0fb911265f1184de5434464378ffba98d379 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java -@@ -5,7 +5,7 @@ import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.entity.EntityType; +@@ -4,7 +4,7 @@ import net.minecraft.world.entity.animal.SnowGolem; + import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Snowman; -public class CraftSnowman extends CraftGolem implements Snowman { @@ -135,11 +135,11 @@ index 6a82d567d96a42bfea0e38afb4e8de13eb3ad5a2..659e2959c5330e4764ea1edc7f8de9f4 super(server, entity); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java -index 5fbb06e28d5c797cfb6859ce7ef05ba00949f690..eada1f0ff10d4c00f82a6f4411fe18b7184e9901 100644 +index 399b045478d93b2b85b0b25c2dec427dc6a45166..5024a102fe71d7013bc809bb4140763bd4c466e7 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java -@@ -4,7 +4,7 @@ import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.entity.EntityType; +@@ -3,7 +3,7 @@ package org.bukkit.craftbukkit.entity; + import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Witch; -public class CraftWitch extends CraftRaider implements Witch { @@ -148,10 +148,10 @@ index 5fbb06e28d5c797cfb6859ce7ef05ba00949f690..eada1f0ff10d4c00f82a6f4411fe18b7 super(server, entity); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java -index 10ba8c3f9c2c84b573d77da4919324df6292ab9d..f9c3a14bf4674f21ed32f6dc2a4296a935dd2b6d 100644 +index 2536d59a01e3557678125e26ace9676d7aec6099..83353863e0c58995d3699d5f812d38cae056f695 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java -@@ -10,7 +10,7 @@ import org.bukkit.entity.EntityType; +@@ -9,7 +9,7 @@ import org.bukkit.craftbukkit.boss.CraftBossBar; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Wither; diff --git a/patches/server/0215-Implement-World.getEntity-UUID-API.patch b/patches/server/0215-Implement-World.getEntity-UUID-API.patch index 91b154cf4e..091ab64373 100644 --- a/patches/server/0215-Implement-World.getEntity-UUID-API.patch +++ b/patches/server/0215-Implement-World.getEntity-UUID-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement World.getEntity(UUID) API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 4a64fda12ef5e5d07fe0b28c755a5b9fd96358e6..b003de51df51bbe31c76289dcdf1f52051b20d35 100644 +index 6ce95bfd732826fbfb75ec0f9b0fd361bbf9c935..4b040f55d31998a8e6fa09397500812ac5978f5a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1040,6 +1040,15 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1041,6 +1041,15 @@ public class CraftWorld extends CraftRegionAccessor implements World { return list; } diff --git a/patches/server/0216-InventoryCloseEvent-Reason-API.patch b/patches/server/0216-InventoryCloseEvent-Reason-API.patch index 4a56c9aea7..ca01dd2ec7 100644 --- a/patches/server/0216-InventoryCloseEvent-Reason-API.patch +++ b/patches/server/0216-InventoryCloseEvent-Reason-API.patch @@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers to "confirm" things based on if it was player triggered close or not. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 68257f257dd3b167e237482c8d149590103896b2..33ce550ea68d4862e0966ed827200cf426909d85 100644 +index e5aea9a58dae2342e13bdd8427a35a1845731b45..592c97c0d1e672bb9203e67006b4bfee0791d6c8 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1449,7 +1449,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -75,7 +75,7 @@ index dda3b911fcaa294ec7b8e9d696880fcb8325f69c..8e2340ca473c8cacfe9d888091834986 this.doCloseContainer(); } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 391295bf6898320421272ad5dfb14e4c5e2d2be0..92d359cfbe6fc5ae6be4931754cdf48ccd92ba13 100644 +index a88beb2e59f1f381263b2649039e2cc6c1294210..79022a9b3fb23e8c947129047004cdf30e593741 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -220,6 +220,7 @@ import org.bukkit.event.inventory.ClickType; @@ -144,10 +144,10 @@ index 734d00e84ec0bcef91a12546873de64e33e14d0c..c7bcbc3f0542a74c30e29bded3bfc0e9 this.containerMenu = this.inventoryMenu; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index f59733b6918dcbbb2190f76d8b8841a2d8818cdf..ba6105a970381d642cd7955754cc47135207027a 100644 +index 59f7320a3acffb12e36f81580d04a2adf866089d..8fe752c801e5172d5bed55e86e8fbdfb696660ee 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -376,7 +376,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -378,7 +378,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { if (((ServerPlayer) this.getHandle()).connection == null) return; if (this.getHandle().containerMenu != this.getHandle().inventoryMenu) { // fire INVENTORY_CLOSE if one already open @@ -156,7 +156,7 @@ index f59733b6918dcbbb2190f76d8b8841a2d8818cdf..ba6105a970381d642cd7955754cc4713 } ServerPlayer player = (ServerPlayer) this.getHandle(); AbstractContainerMenu container; -@@ -446,8 +446,14 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -448,8 +448,14 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @Override public void closeInventory() { @@ -173,10 +173,10 @@ index f59733b6918dcbbb2190f76d8b8841a2d8818cdf..ba6105a970381d642cd7955754cc4713 @Override public boolean isBlocking() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 70b499e4c6d50cb55219033fd67356295239316a..dceea046eb4becbfa7be8bd91459f7aabea27914 100644 +index 46d06256230dafac0088a60de7c210a6aa103931..0a507311855cc9c21aec1212de738ea374283615 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1182,7 +1182,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1174,7 +1174,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Close any foreign inventory if (this.getHandle().containerMenu != this.getHandle().inventoryMenu) { @@ -186,10 +186,10 @@ index 70b499e4c6d50cb55219033fd67356295239316a..dceea046eb4becbfa7be8bd91459f7aa // Check if the fromWorld and toWorld are the same. diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index f882b007756edc2f25e913393b7e8b400ccbe50e..1a0a4f2d94b65179426d7b5715847e5ed19489b5 100644 +index 4291348fbbbad7dd10c8f9a7baf86645a705863c..553216ab26fa7db1923a60fe4435e48497e8ac7d 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1265,7 +1265,7 @@ public class CraftEventFactory { +@@ -1271,7 +1271,7 @@ public class CraftEventFactory { public static AbstractContainerMenu callInventoryOpenEvent(ServerPlayer player, AbstractContainerMenu container, boolean cancelled) { if (player.containerMenu != player.inventoryMenu) { // fire INVENTORY_CLOSE if one already open @@ -198,7 +198,7 @@ index f882b007756edc2f25e913393b7e8b400ccbe50e..1a0a4f2d94b65179426d7b5715847e5e } CraftServer server = player.level().getCraftServer(); -@@ -1439,8 +1439,18 @@ public class CraftEventFactory { +@@ -1437,8 +1437,18 @@ public class CraftEventFactory { return event; } diff --git a/patches/server/0217-Vex-get-setSummoner-API.patch b/patches/server/0217-Vex-get-setSummoner-API.patch index 61ba4a29fe..f0dff217b9 100644 --- a/patches/server/0217-Vex-get-setSummoner-API.patch +++ b/patches/server/0217-Vex-get-setSummoner-API.patch @@ -9,10 +9,10 @@ Allow setting the vex's summoner Co-authored-by: BillyGalbreath <[email protected]> diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java -index ba8f9d96029aa26e097abb56963261aa707ef645..50b07045cd17a7576a436c64662ad039d4aa2132 100644 +index bf9e23702d30838770d612d7644713f6510497be..c4f7216c7ca7a49048fcf5240ef2a8f80e843f1c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java -@@ -19,6 +19,19 @@ public class CraftVex extends CraftMonster implements Vex { +@@ -18,6 +18,19 @@ public class CraftVex extends CraftMonster implements Vex { return (net.minecraft.world.entity.monster.Vex) super.getHandle(); } diff --git a/patches/server/0219-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch b/patches/server/0219-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch index 88ab68ad27..6a646a9f91 100644 --- a/patches/server/0219-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch +++ b/patches/server/0219-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Use AsyncAppender to keep logging IO off main thread diff --git a/build.gradle.kts b/build.gradle.kts -index 588d5370a10de25f80022d64abb8af0f16ce943b..de1586eb07570ab7daf1775550522bb911699d0e 100644 +index 37c27c6ea94010af6653ad861091d233aa975bb1..c248e309373c284f7baa929c13efb52d77039c01 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -30,6 +30,7 @@ dependencies { +@@ -29,6 +29,7 @@ dependencies { implementation("commons-lang:commons-lang:2.6") runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.0") runtimeOnly("com.mysql:mysql-connector-j:8.0.33") diff --git a/patches/server/0226-Vanished-players-don-t-have-rights.patch b/patches/server/0226-Vanished-players-don-t-have-rights.patch index 957e9557c2..b68cf1ff10 100644 --- a/patches/server/0226-Vanished-players-don-t-have-rights.patch +++ b/patches/server/0226-Vanished-players-don-t-have-rights.patch @@ -89,10 +89,10 @@ index 1beff41c02fb4c22b5474da7c514be2f50f16055..8a53284a5846b25864352e18a5e6b2de public boolean isClientSide() { return this.isClientSide; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 1a0a4f2d94b65179426d7b5715847e5ed19489b5..2bb2c3ae7584d45ab9e32f1b9d0fa848e8667fc0 100644 +index 553216ab26fa7db1923a60fe4435e48497e8ac7d..143a1a8c54ae9494e14ae7f656433f47b917c108 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1302,6 +1302,14 @@ public class CraftEventFactory { +@@ -1308,6 +1308,14 @@ public class CraftEventFactory { Projectile projectile = (Projectile) entity.getBukkitEntity(); org.bukkit.entity.Entity collided = position.getEntity().getBukkitEntity(); com.destroystokyo.paper.event.entity.ProjectileCollideEvent event = new com.destroystokyo.paper.event.entity.ProjectileCollideEvent(projectile, collided); diff --git a/patches/server/0227-Allow-disabling-armour-stand-ticking.patch b/patches/server/0227-Allow-disabling-armour-stand-ticking.patch index 25ee029470..ff92f7be81 100644 --- a/patches/server/0227-Allow-disabling-armour-stand-ticking.patch +++ b/patches/server/0227-Allow-disabling-armour-stand-ticking.patch @@ -123,10 +123,10 @@ index a59381646031a1a99c98c8c6ad9de7efc96b774a..719f68f96e58ddcdd3592131c691d212 public Rotations getHeadPose() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -index 06cedeea447f53d100e32a6eba6f83b4719cb231..82b9ee993b0d2e7e0685231f7bad2b85756ec959 100644 +index fc3b98746a558b3ad6c89543170225bdae1e63ba..f4d46cd34fb97ebbf2e95d905d315b93add958b8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -@@ -238,5 +238,16 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { +@@ -232,5 +232,16 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { public void setCanMove(boolean move) { getHandle().canMove = move; } diff --git a/patches/server/0228-SkeletonHorse-Additions.patch b/patches/server/0228-SkeletonHorse-Additions.patch index 09786150d8..27538378de 100644 --- a/patches/server/0228-SkeletonHorse-Additions.patch +++ b/patches/server/0228-SkeletonHorse-Additions.patch @@ -65,10 +65,10 @@ index ea98625fe7c00743b8df74a24e6d4b75df4189a5..66a5783e2a83c75ca46d1fd6f97d9de7 default Player getNearestPlayer(Entity entity, double maxDistance) { return this.getNearestPlayer(entity.getX(), entity.getY(), entity.getZ(), maxDistance, false); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java -index e42dfd154f05130ff26f4d47d6817a1a561bfd54..78bc77d9cc5797fa8edd189167bb60b75b7f920e 100644 +index 1a631ab092bbd03d24a09e22992bb16c825e7043..bba6dcac6df4841561cf39b9ea0fc116f57a901b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java -@@ -50,4 +50,16 @@ public class CraftSkeletonHorse extends CraftAbstractHorse implements SkeletonHo +@@ -44,4 +44,16 @@ public class CraftSkeletonHorse extends CraftAbstractHorse implements SkeletonHo public void setTrapTime(int trapTime) { this.getHandle().trapTime = trapTime; } diff --git a/patches/server/0229-Don-t-call-getItemMeta-on-hasItemMeta.patch b/patches/server/0229-Don-t-call-getItemMeta-on-hasItemMeta.patch index ce7d42bc7a..a9ffa5d88c 100644 --- a/patches/server/0229-Don-t-call-getItemMeta-on-hasItemMeta.patch +++ b/patches/server/0229-Don-t-call-getItemMeta-on-hasItemMeta.patch @@ -11,10 +11,10 @@ Returns true if getDamage() == 0 or has damage tag or other tag is set. Check the `ItemMetaTest#testTaggedButNotMeta` method to see how this method behaves. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 0ac686e880f0f87ab3f6dbed77e553d7568b3305..6775b432e17b09aaa21af5713fa0ffdf7fdbf8a9 100644 +index 73e5a7f7aa6021715d0d936935470e7f81ada5fa..a30ccb1ff3a02ce482ce2b0d40c76dd07d3b0dc1 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -@@ -657,7 +657,7 @@ public final class CraftItemStack extends ItemStack { +@@ -506,7 +506,7 @@ public final class CraftItemStack extends ItemStack { @Override public boolean hasItemMeta() { @@ -24,10 +24,10 @@ index 0ac686e880f0f87ab3f6dbed77e553d7568b3305..6775b432e17b09aaa21af5713fa0ffdf static boolean hasItemMeta(net.minecraft.world.item.ItemStack item) { diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -index 4400f10a592b86488e61521a4fce61adbf656cb9..7cc7f485325a4277bac7a6eade749dbb3b0b104f 100644 +index 76106ce9aa33dec5ad3768c4a7077dc5f0b48523..f501fe0207d78162789c619857eca69ea9a79304 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -@@ -107,6 +107,34 @@ public class ItemMetaTest extends AbstractTestingBase { +@@ -110,6 +110,34 @@ public class ItemMetaTest extends AbstractTestingBase { assertThat(itemMeta.hasConflictingEnchant(null), is(false)); } @@ -61,4 +61,4 @@ index 4400f10a592b86488e61521a4fce61adbf656cb9..7cc7f485325a4277bac7a6eade749dbb + @Test public void testConflictingStoredEnchantment() { - EnchantmentStorageMeta itemMeta = (EnchantmentStorageMeta) Bukkit.getItemFactory().getItemMeta(Material.ENCHANTED_BOOK); + EnchantmentStorageMeta itemMeta = (EnchantmentStorageMeta) Bukkit.getItemFactory().getItemMeta(ItemType.ENCHANTED_BOOK); diff --git a/patches/server/0230-Implement-Expanded-ArmorStand-API.patch b/patches/server/0230-Implement-Expanded-ArmorStand-API.patch index 646e0ab722..bce62779d9 100644 --- a/patches/server/0230-Implement-Expanded-ArmorStand-API.patch +++ b/patches/server/0230-Implement-Expanded-ArmorStand-API.patch @@ -14,10 +14,10 @@ public net.minecraft.world.entity.decoration.ArmorStand isDisabled(Lnet/minecraf Co-authored-by: SoSeDiK <[email protected]> diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -index 82b9ee993b0d2e7e0685231f7bad2b85756ec959..f80cafe3544c7e6c3c29073ba6539783adf6666c 100644 +index f4d46cd34fb97ebbf2e95d905d315b93add958b8..273f3c029f878c8a30e4f0911d79195c023d3442 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -@@ -239,6 +239,147 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { +@@ -233,6 +233,147 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { getHandle().canMove = move; } diff --git a/patches/server/0237-Add-Early-Warning-Feature-to-WatchDog.patch b/patches/server/0237-Add-Early-Warning-Feature-to-WatchDog.patch index dff466e366..84d594a98c 100644 --- a/patches/server/0237-Add-Early-Warning-Feature-to-WatchDog.patch +++ b/patches/server/0237-Add-Early-Warning-Feature-to-WatchDog.patch @@ -33,10 +33,10 @@ index 24f62f9c4d288297d7a324e806745cc1449d7b4c..29eadf85e11c2261218fa406b29455da com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 23407ccc0482f67db46947cbcc56c5488c42cf93..537a5e19c9566dfbefa913a66183ec4ef31844c1 100644 +index 31bc418253abd54c96d6853568e019b5c95a7602..b60da399ea129f0b8c41608397e440ae161ec6e4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -931,6 +931,7 @@ public final class CraftServer implements Server { +@@ -942,6 +942,7 @@ public final class CraftServer implements Server { @Override public void reload() { @@ -44,7 +44,7 @@ index 23407ccc0482f67db46947cbcc56c5488c42cf93..537a5e19c9566dfbefa913a66183ec4e this.reloadCount++; this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile()); this.commandsConfiguration = YamlConfiguration.loadConfiguration(this.getCommandsConfigFile()); -@@ -1020,6 +1021,7 @@ public final class CraftServer implements Server { +@@ -1031,6 +1032,7 @@ public final class CraftServer implements Server { this.enablePlugins(PluginLoadOrder.STARTUP); this.enablePlugins(PluginLoadOrder.POSTWORLD); this.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.RELOAD)); diff --git a/patches/server/0240-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch b/patches/server/0240-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch index 4d0160d028..a2a11fa436 100644 --- a/patches/server/0240-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch +++ b/patches/server/0240-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Ability to get Tile Entities from a chunk without snapshots diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -index 8ae78690748b2cb5d5186d8859871c1630e10130..b738e1f7debac7d70910d5ac908ca9d4f60640d5 100644 +index 51471933252f989a2640568f42c59ac930be58e8..8eb22243381b131264706b5ade67c6513564c2dd 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -@@ -125,6 +125,13 @@ public class CraftChunk implements Chunk { +@@ -126,6 +126,13 @@ public class CraftChunk implements Chunk { @Override public BlockState[] getTileEntities() { @@ -22,7 +22,7 @@ index 8ae78690748b2cb5d5186d8859871c1630e10130..b738e1f7debac7d70910d5ac908ca9d4 if (!this.isLoaded()) { this.getWorld().getChunkAt(x, z); // Transient load for this tick } -@@ -134,7 +141,29 @@ public class CraftChunk implements Chunk { +@@ -135,7 +142,29 @@ public class CraftChunk implements Chunk { BlockState[] entities = new BlockState[chunk.blockEntities.size()]; for (BlockPos position : chunk.blockEntities.keySet()) { diff --git a/patches/server/0243-Slime-Pathfinder-Events.patch b/patches/server/0243-Slime-Pathfinder-Events.patch index 1acba54894..3777b95865 100644 --- a/patches/server/0243-Slime-Pathfinder-Events.patch +++ b/patches/server/0243-Slime-Pathfinder-Events.patch @@ -145,12 +145,12 @@ index 476a9b2db5deac803f1cb3c2cbe88b69cc3da8e5..30779b817db6f8e392036b4ec66e1c5c + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java -index a5b3b08bbac2149e5de8e2933efaad65c4f13b12..743af3b71f2d007290fa4e4da85973b491d95135 100644 +index d4891e026c5ccc3d75d5b455661ab641b9d4a3b5..9b219beb8922bf0701e538bcf874f0eb922f60bb 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java -@@ -34,4 +34,16 @@ public class CraftSlime extends CraftMob implements Slime, CraftEnemy { - public EntityType getType() { - return EntityType.SLIME; +@@ -28,4 +28,16 @@ public class CraftSlime extends CraftMob implements Slime, CraftEnemy { + public String toString() { + return "CraftSlime"; } + + // Paper start diff --git a/patches/server/0245-Optimize-CraftBlockData-Creation.patch b/patches/server/0245-Optimize-CraftBlockData-Creation.patch index 60559a5bc2..44c01cb1b2 100644 --- a/patches/server/0245-Optimize-CraftBlockData-Creation.patch +++ b/patches/server/0245-Optimize-CraftBlockData-Creation.patch @@ -26,11 +26,11 @@ index 803f3ebaa9fe43c88f461168ee43fc6ba920a764..2451bb61e304fbe5cdfd6bbb248575e9 private boolean calculateSolid() { if (((Block) this.owner).properties.forceSolidOn) { diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -index 745d2c589df8c59db327d7482024096473318812..c80aaa37b7d63acfb283641a4804dc2a32156eda 100644 +index 25a52b932112fbec9031ef522e8bae29f8e77723..5af27d3ff909c62f50ec8a30f7c7b11b3579807a 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -@@ -560,7 +560,17 @@ public class CraftBlockData implements BlockData { - return craft; +@@ -561,7 +561,17 @@ public class CraftBlockData implements BlockData { + return (B) craft; } + // Paper start - optimize creating BlockData to not need a map lookup diff --git a/patches/server/0247-Add-PhantomPreSpawnEvent.patch b/patches/server/0247-Add-PhantomPreSpawnEvent.patch index 5e0542c9d7..838aa93c0e 100644 --- a/patches/server/0247-Add-PhantomPreSpawnEvent.patch +++ b/patches/server/0247-Add-PhantomPreSpawnEvent.patch @@ -72,12 +72,12 @@ index 61ba99d99cc4e7782450ee6aa8b6c87b1a42cb3a..a18e6296d1f50c53291d41192a100960 groupdataentity = entityphantom.finalizeSpawn(world, difficultydamagescaler, MobSpawnType.NATURAL, groupdataentity, (CompoundTag) null); world.addFreshEntityWithPassengers(entityphantom, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java -index ac43323a391c380458e741ba8a809c02f8b2903c..1ebb83fe98f573d0a982397096d4dba7249aef4b 100644 +index 0359c161448941f1b9fdac545a5c47a68f19b760..305a635b049741ac5e2670060c6818cb2c07e5ab 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java -@@ -34,4 +34,11 @@ public class CraftPhantom extends CraftFlying implements Phantom, CraftEnemy { - public EntityType getType() { - return EntityType.PHANTOM; +@@ -28,4 +28,11 @@ public class CraftPhantom extends CraftFlying implements Phantom, CraftEnemy { + public String toString() { + return "CraftPhantom"; } + + // Paper start diff --git a/patches/server/0248-Add-More-Creeper-API.patch b/patches/server/0248-Add-More-Creeper-API.patch index 6ff6e633ec..c6cd9bdf33 100644 --- a/patches/server/0248-Add-More-Creeper-API.patch +++ b/patches/server/0248-Add-More-Creeper-API.patch @@ -38,12 +38,12 @@ index 2480c128f6b7c4ba7af1f06f4e01b972587c08ba..71587510ef1b6cbd95cb55556cd93c6c public boolean canDropMobsSkull() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java -index ea9dc2219cdff3976796e4848b0faa278656be63..63a8188010f045d5c17a1ecb63e8081ec86c2960 100644 +index e9a9154804bf2b26f4c613e81819e1cf448b76d0..6ccb32786b3abe1109dcc2d083cd231b70d8c6b4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java -@@ -94,4 +94,16 @@ public class CraftCreeper extends CraftMonster implements Creeper { - public EntityType getType() { - return EntityType.CREEPER; +@@ -88,4 +88,16 @@ public class CraftCreeper extends CraftMonster implements Creeper { + public String toString() { + return "CraftCreeper"; } + + // Paper start diff --git a/patches/server/0249-Inventory-removeItemAnySlot.patch b/patches/server/0249-Inventory-removeItemAnySlot.patch index f8c275581d..dc1fcf8000 100644 --- a/patches/server/0249-Inventory-removeItemAnySlot.patch +++ b/patches/server/0249-Inventory-removeItemAnySlot.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Inventory#removeItemAnySlot diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java -index 41a15ecba33c40c01f0ffdcfae687b96c03731da..287b17ba34f1261a708b9fbf41f6422d92d9c37b 100644 +index 1820ea381094e14205bc9d2a4c78140f1ff20ec7..0b515bcf772518e1396a3503bbb510b7224995d2 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java -@@ -223,10 +223,16 @@ public class CraftInventory implements Inventory { +@@ -218,10 +218,16 @@ public class CraftInventory implements Inventory { } private int first(ItemStack item, boolean withAmount) { @@ -26,7 +26,7 @@ index 41a15ecba33c40c01f0ffdcfae687b96c03731da..287b17ba34f1261a708b9fbf41f6422d for (int i = 0; i < inventory.length; i++) { if (inventory[i] == null) continue; -@@ -350,6 +356,17 @@ public class CraftInventory implements Inventory { +@@ -344,6 +350,17 @@ public class CraftInventory implements Inventory { @Override public HashMap<Integer, ItemStack> removeItem(ItemStack... items) { @@ -44,7 +44,7 @@ index 41a15ecba33c40c01f0ffdcfae687b96c03731da..287b17ba34f1261a708b9fbf41f6422d Preconditions.checkArgument(items != null, "items cannot be null"); HashMap<Integer, ItemStack> leftover = new HashMap<Integer, ItemStack>(); -@@ -361,7 +378,10 @@ public class CraftInventory implements Inventory { +@@ -355,7 +372,10 @@ public class CraftInventory implements Inventory { int toDelete = item.getAmount(); while (true) { diff --git a/patches/server/0250-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch b/patches/server/0250-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch index 1f243711dc..faff1cb7b0 100644 --- a/patches/server/0250-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch +++ b/patches/server/0250-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Make CraftWorld#loadChunk(int, int, false) load unconverted diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index b003de51df51bbe31c76289dcdf1f52051b20d35..e7aa0e6d78765836a31965ef9c518bfef17e2b03 100644 +index 4b040f55d31998a8e6fa09397500812ac5978f5a..6df2719e738dea69a7bbe30463f81c2d5f5f3754 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -400,7 +400,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -401,7 +401,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean loadChunk(int x, int z, boolean generate) { org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot diff --git a/patches/server/0251-Add-ray-tracing-methods-to-LivingEntity.patch b/patches/server/0251-Add-ray-tracing-methods-to-LivingEntity.patch index dc6af195b8..8d8f23486a 100644 --- a/patches/server/0251-Add-ray-tracing-methods-to-LivingEntity.patch +++ b/patches/server/0251-Add-ray-tracing-methods-to-LivingEntity.patch @@ -30,10 +30,10 @@ index 221fa0ca2f1c6e099da5b47ba42548262132d6de..f3af1c540b59819375f70ffbda613560 public int getShieldBlockingDelay() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 6c4ff1acbf09987f8d6a4b4b2c62fce264430706..bc40c64f8c9ace7dec8f966193f41c626ac14e22 100644 +index 0bd811ed75d73afa84e9434318a2d670f7241f0c..0155761d9771328f48d3513480ce8d4f7b30ae23 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -199,6 +199,33 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -202,6 +202,33 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { return blocks.get(0); } @@ -65,5 +65,5 @@ index 6c4ff1acbf09987f8d6a4b4b2c62fce264430706..bc40c64f8c9ace7dec8f966193f41c62 + // Paper end + @Override - public List<Block> getLastTwoTargetBlocks(Set<Material> transparent, int maxDistance) { + public List<Block> getLastTwoTargetBlocks(Set<BlockType<?>> transparent, int maxDistance) { return this.getLineOfSight(transparent, maxDistance, 2); diff --git a/patches/server/0252-Expose-attack-cooldown-methods-for-Player.patch b/patches/server/0252-Expose-attack-cooldown-methods-for-Player.patch index 9e5680cb81..daa44da765 100644 --- a/patches/server/0252-Expose-attack-cooldown-methods-for-Player.patch +++ b/patches/server/0252-Expose-attack-cooldown-methods-for-Player.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose attack cooldown methods for Player diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index dceea046eb4becbfa7be8bd91459f7aabea27914..91b858ef2ef063b5f91dc017836d37e19b329101 100644 +index 0a507311855cc9c21aec1212de738ea374283615..7eda341633a48a59155adeabab4b2eb5cc3742de 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2748,6 +2748,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2766,6 +2766,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.adventure$pointers; } diff --git a/patches/server/0253-Improve-death-events.patch b/patches/server/0253-Improve-death-events.patch index 917a7f6ffd..0a9f3787d1 100644 --- a/patches/server/0253-Improve-death-events.patch +++ b/patches/server/0253-Improve-death-events.patch @@ -357,10 +357,10 @@ index 719f68f96e58ddcdd3592131c691d21263c81915..4413b609f1250cf9477fcb3fecd7b67a this.gameEvent(GameEvent.ENTITY_DIE); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 91b858ef2ef063b5f91dc017836d37e19b329101..e572dbdbd02e6b7307172e0b6f80d9b6e7fbce60 100644 +index 7eda341633a48a59155adeabab4b2eb5cc3742de..9c422287436c8497d26ab99466fd1386fca6c3a0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2248,7 +2248,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2265,7 +2265,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void sendHealthUpdate() { @@ -377,10 +377,10 @@ index 91b858ef2ef063b5f91dc017836d37e19b329101..e572dbdbd02e6b7307172e0b6f80d9b6 public void injectScaledMaxHealth(Collection<AttributeInstance> collection, boolean force) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 2bb2c3ae7584d45ab9e32f1b9d0fa848e8667fc0..e8783b2c7083c847770e9f08e796b58e9f8ea6ec 100644 +index 143a1a8c54ae9494e14ae7f656433f47b917c108..f23f57a757e7fd39fa0128888d1c2e56a24faf99 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -824,9 +824,16 @@ public class CraftEventFactory { +@@ -830,9 +830,16 @@ public class CraftEventFactory { public static EntityDeathEvent callEntityDeathEvent(net.minecraft.world.entity.LivingEntity victim, List<org.bukkit.inventory.ItemStack> drops) { CraftLivingEntity entity = (CraftLivingEntity) victim.getBukkitEntity(); EntityDeathEvent event = new EntityDeathEvent(entity, drops, victim.getExpReward()); @@ -397,7 +397,7 @@ index 2bb2c3ae7584d45ab9e32f1b9d0fa848e8667fc0..e8783b2c7083c847770e9f08e796b58e victim.expToDrop = event.getDroppedExp(); for (org.bukkit.inventory.ItemStack stack : event.getDrops()) { -@@ -843,8 +850,15 @@ public class CraftEventFactory { +@@ -849,8 +856,15 @@ public class CraftEventFactory { PlayerDeathEvent event = new PlayerDeathEvent(entity, drops, victim.getExpReward(), 0, deathMessage, stringDeathMessage); // Paper - Adventure event.setKeepInventory(keepInventory); event.setKeepLevel(victim.keepLevel); // SPIGOT-2222: pre-set keepLevel @@ -413,7 +413,7 @@ index 2bb2c3ae7584d45ab9e32f1b9d0fa848e8667fc0..e8783b2c7083c847770e9f08e796b58e victim.keepLevel = event.getKeepLevel(); victim.newLevel = event.getNewLevel(); -@@ -861,6 +875,31 @@ public class CraftEventFactory { +@@ -867,6 +881,31 @@ public class CraftEventFactory { return event; } @@ -423,7 +423,7 @@ index 2bb2c3ae7584d45ab9e32f1b9d0fa848e8667fc0..e8783b2c7083c847770e9f08e796b58e + event.setReviveHealth(event.getEntity().getAttribute(org.bukkit.attribute.Attribute.GENERIC_MAX_HEALTH).getValue()); + event.setShouldPlayDeathSound(!victim.silentDeath && !victim.isSilent()); + net.minecraft.sounds.SoundEvent soundEffect = victim.getDeathSound(); -+ event.setDeathSound(soundEffect != null ? org.bukkit.craftbukkit.CraftSound.getBukkit(soundEffect) : null); ++ event.setDeathSound(soundEffect != null ? org.bukkit.craftbukkit.CraftSound.minecraftToBukkit(soundEffect) : null); + event.setDeathSoundCategory(org.bukkit.SoundCategory.valueOf(victim.getSoundSource().name())); + event.setDeathSoundVolume(victim.getSoundVolume()); + event.setDeathSoundPitch(victim.getVoicePitch()); @@ -436,7 +436,7 @@ index 2bb2c3ae7584d45ab9e32f1b9d0fa848e8667fc0..e8783b2c7083c847770e9f08e796b58e + double x = event.getEntity().getLocation().getX(); + double y = event.getEntity().getLocation().getY(); + double z = event.getEntity().getLocation().getZ(); -+ net.minecraft.sounds.SoundEvent soundEffect = org.bukkit.craftbukkit.CraftSound.getSoundEffect(event.getDeathSound()); ++ net.minecraft.sounds.SoundEvent soundEffect = org.bukkit.craftbukkit.CraftSound.bukkitToMinecraft(event.getDeathSound()); + net.minecraft.sounds.SoundSource soundCategory = net.minecraft.sounds.SoundSource.valueOf(event.getDeathSoundCategory().name()); + victim.level().playSound(source, x, y, z, soundEffect, soundCategory, event.getDeathSoundVolume(), event.getDeathSoundPitch()); + } diff --git a/patches/server/0256-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch b/patches/server/0256-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch index 5b6a8a9f46..381cfdce72 100644 --- a/patches/server/0256-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch +++ b/patches/server/0256-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement an API for CanPlaceOn and CanDestroy NBT values diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 01e09dfc00b2ae9ecd39bea37f229ad826de121c..7c803a928f41938c03b0239cf04e2ee765ecefb8 100644 +index 00bad8b037a48abd183cadd9fa94f2faff4596de..aa978a43c5285d2b149f2e2c0f2af33a65ab9eef 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -83,6 +83,12 @@ import org.bukkit.persistence.PersistentDataContainer; +@@ -88,6 +88,12 @@ import org.bukkit.persistence.PersistentDataContainer; import static org.spigotmc.ValidateUtils.*; // Spigot end @@ -21,7 +21,7 @@ index 01e09dfc00b2ae9ecd39bea37f229ad826de121c..7c803a928f41938c03b0239cf04e2ee7 /** * Children must include the following: * -@@ -271,6 +277,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -276,6 +282,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @Specific(Specific.To.NBT) static final ItemMetaKey BLOCK_DATA = new ItemMetaKey("BlockStateTag"); static final ItemMetaKey BUKKIT_CUSTOM_TAG = new ItemMetaKey("PublicBukkitValues"); @@ -32,7 +32,7 @@ index 01e09dfc00b2ae9ecd39bea37f229ad826de121c..7c803a928f41938c03b0239cf04e2ee7 // We store the raw original JSON representation of all text data. See SPIGOT-5063, SPIGOT-5656, SPIGOT-5304 private String displayName; -@@ -284,6 +294,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -289,6 +299,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { private int hideFlag; private boolean unbreakable; private int damage; @@ -43,7 +43,7 @@ index 01e09dfc00b2ae9ecd39bea37f229ad826de121c..7c803a928f41938c03b0239cf04e2ee7 private static final Set<String> HANDLED_TAGS = Sets.newHashSet(); private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); -@@ -321,6 +335,15 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -326,6 +340,15 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { this.hideFlag = meta.hideFlag; this.unbreakable = meta.unbreakable; this.damage = meta.damage; @@ -59,7 +59,7 @@ index 01e09dfc00b2ae9ecd39bea37f229ad826de121c..7c803a928f41938c03b0239cf04e2ee7 this.unhandledTags.putAll(meta.unhandledTags); this.persistentDataContainer.putAll(meta.persistentDataContainer.getRaw()); -@@ -384,6 +407,31 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -389,6 +412,31 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { this.persistentDataContainer.put(key, compound.get(key).copy()); } } @@ -91,7 +91,7 @@ index 01e09dfc00b2ae9ecd39bea37f229ad826de121c..7c803a928f41938c03b0239cf04e2ee7 Set<String> keys = tag.getAllKeys(); for (String key : keys) { -@@ -522,6 +570,34 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -527,6 +575,34 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { this.setDamage(damage); } @@ -126,7 +126,7 @@ index 01e09dfc00b2ae9ecd39bea37f229ad826de121c..7c803a928f41938c03b0239cf04e2ee7 String internal = SerializableMeta.getString(map, "internal", true); if (internal != null) { ByteArrayInputStream buf = new ByteArrayInputStream(Base64.getDecoder().decode(internal)); -@@ -650,6 +726,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -655,6 +731,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { if (this.hasDamage()) { itemTag.putInt(DAMAGE.NBT, damage); } @@ -150,7 +150,7 @@ index 01e09dfc00b2ae9ecd39bea37f229ad826de121c..7c803a928f41938c03b0239cf04e2ee7 for (Map.Entry<String, Tag> e : this.unhandledTags.entrySet()) { itemTag.put(e.getKey(), e.getValue()); -@@ -666,6 +759,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -671,6 +764,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } } @@ -172,7 +172,7 @@ index 01e09dfc00b2ae9ecd39bea37f229ad826de121c..7c803a928f41938c03b0239cf04e2ee7 ListTag createStringList(List<String> list) { if (list == null) { return null; -@@ -749,7 +857,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -754,7 +862,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @Overridden boolean isEmpty() { @@ -181,7 +181,7 @@ index 01e09dfc00b2ae9ecd39bea37f229ad826de121c..7c803a928f41938c03b0239cf04e2ee7 } // Paper start -@@ -1181,7 +1289,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1186,7 +1294,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { && (this.hideFlag == that.hideFlag) && (this.isUnbreakable() == that.isUnbreakable()) && (this.hasDamage() ? that.hasDamage() && this.damage == that.damage : !that.hasDamage()) @@ -194,7 +194,7 @@ index 01e09dfc00b2ae9ecd39bea37f229ad826de121c..7c803a928f41938c03b0239cf04e2ee7 } /** -@@ -1216,6 +1328,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1221,6 +1333,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { hash = 61 * hash + (this.hasDamage() ? this.damage : 0); hash = 61 * hash + (this.hasAttributeModifiers() ? this.attributeModifiers.hashCode() : 0); hash = 61 * hash + this.version; @@ -205,7 +205,7 @@ index 01e09dfc00b2ae9ecd39bea37f229ad826de121c..7c803a928f41938c03b0239cf04e2ee7 return hash; } -@@ -1240,6 +1356,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1245,6 +1361,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { clone.unbreakable = this.unbreakable; clone.damage = this.damage; clone.version = this.version; @@ -220,7 +220,7 @@ index 01e09dfc00b2ae9ecd39bea37f229ad826de121c..7c803a928f41938c03b0239cf04e2ee7 return clone; } catch (CloneNotSupportedException e) { throw new Error(e); -@@ -1297,6 +1421,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1302,6 +1426,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { builder.put(DAMAGE.BUKKIT, damage); } @@ -244,7 +244,7 @@ index 01e09dfc00b2ae9ecd39bea37f229ad826de121c..7c803a928f41938c03b0239cf04e2ee7 final Map<String, Tag> internalTags = new HashMap<String, Tag>(this.unhandledTags); this.serializeInternal(internalTags); if (!internalTags.isEmpty()) { -@@ -1464,6 +1605,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1469,6 +1610,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { CraftMetaArmorStand.SHOW_ARMS.NBT, CraftMetaArmorStand.SMALL.NBT, CraftMetaArmorStand.MARKER.NBT, @@ -253,7 +253,7 @@ index 01e09dfc00b2ae9ecd39bea37f229ad826de121c..7c803a928f41938c03b0239cf04e2ee7 // Paper end CraftMetaCompass.LODESTONE_DIMENSION.NBT, CraftMetaCompass.LODESTONE_POS.NBT, -@@ -1493,4 +1636,146 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1498,4 +1641,146 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } // Paper end diff --git a/patches/server/0263-Hook-into-CB-plugin-rewrites.patch b/patches/server/0263-Hook-into-CB-plugin-rewrites.patch index d40c5ed17b..e731c8916a 100644 --- a/patches/server/0263-Hook-into-CB-plugin-rewrites.patch +++ b/patches/server/0263-Hook-into-CB-plugin-rewrites.patch @@ -8,67 +8,35 @@ our own relocation. Also lets us rewrite NMS calls for when we're debugging in an IDE pre-relocate. diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 48cdd483c25825571043800f3cfa41a4d723f649..fe5d3b60ad740b7f1cce040f9c8d96ac51245ef6 100644 +index 754beb0b96e6b645630fa72dd67ea953c7470dfc..8a2914d2b9683be14943066fcba21519145f9467 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -6,7 +6,9 @@ import java.io.FileOutputStream; - import java.io.InputStream; - import java.util.Arrays; - import java.util.Enumeration; -+import java.util.HashMap; - import java.util.HashSet; -+import java.util.Map; - import java.util.Set; - import java.util.jar.JarEntry; - import java.util.jar.JarFile; -@@ -20,10 +22,15 @@ import org.bukkit.plugin.AuthorNagException; - import org.objectweb.asm.ClassReader; - import org.objectweb.asm.ClassVisitor; - import org.objectweb.asm.ClassWriter; -+import org.objectweb.asm.FieldVisitor; -+import org.objectweb.asm.Handle; -+import org.objectweb.asm.Label; - import org.objectweb.asm.MethodVisitor; - import org.objectweb.asm.Opcodes; - import org.objectweb.asm.Type; - -+import javax.annotation.Nonnull; -+ - /** - * This file is imported from Commodore. - * -@@ -46,6 +53,41 @@ public class Commodore - "org/bukkit/inventory/ItemStack (I)V setTypeId" - ) ); +@@ -150,6 +150,35 @@ public class Commodore { + Commodore.TYPE_INSTRUCTIONS.add(new TypeInstructionInfo(preEnumKill, enumCompatibility, owner, newOwner)); + } + // Paper start - Plugin rewrites -+ private static final Map<String, String> SEARCH_AND_REMOVE = initReplacementsMap(); -+ private static Map<String, String> initReplacementsMap() -+ { -+ Map<String, String> getAndRemove = new HashMap<>(); ++ private static final java.util.Map<String, String> SEARCH_AND_REMOVE = initReplacementsMap(); ++ private static java.util.Map<String, String> initReplacementsMap() { ++ java.util.Map<String, String> getAndRemove = new java.util.HashMap<>(); + // Be wary of maven shade's relocations + + final java.util.jar.Manifest manifest = io.papermc.paper.util.JarManifests.manifest(Commodore.class); -+ if ( Boolean.getBoolean( "debug.rewriteForIde" ) && manifest != null) -+ { ++ if (Boolean.getBoolean("debug.rewriteForIde") && manifest != null) { + // unversion incoming calls for pre-relocate debug work + final String NMS_REVISION_PACKAGE = "v" + manifest.getMainAttributes().getValue("CraftBukkit-Package-Version") + "/"; + -+ getAndRemove.put( "org/bukkit/".concat( "craftbukkit/" + NMS_REVISION_PACKAGE ), NMS_REVISION_PACKAGE ); ++ getAndRemove.put("org/bukkit/".concat("craftbukkit/" + NMS_REVISION_PACKAGE), NMS_REVISION_PACKAGE); + } + + return getAndRemove; + } + -+ @Nonnull -+ private static String getOriginalOrRewrite(@Nonnull String original) -+ { ++ private static String getOriginalOrRewrite(String original) { + String rewrite = null; -+ for ( Map.Entry<String, String> entry : SEARCH_AND_REMOVE.entrySet() ) -+ { -+ if ( original.contains( entry.getKey() ) ) -+ { -+ rewrite = original.replace( entry.getValue(), "" ); ++ for (java.util.Map.Entry<String, String> entry : SEARCH_AND_REMOVE.entrySet()) { ++ if (original.contains(entry.getKey())) { ++ rewrite = original.replace(entry.getValue(),""); + } + } + @@ -76,85 +44,26 @@ index 48cdd483c25825571043800f3cfa41a4d723f649..fe5d3b60ad740b7f1cce040f9c8d96ac + } + // Paper end + - public static void main(String[] args) - { + public static void main(String[] args) { OptionParser parser = new OptionParser(); -@@ -130,15 +172,86 @@ public class Commodore - - cr.accept( new ClassVisitor( Opcodes.ASM9, cw ) - { -+ // Paper start - Rewrite plugins -+ @Override -+ public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) -+ { + OptionSpec<File> inputFlag = parser.acceptsAll(Arrays.asList("i", "input")).withRequiredArg().ofType(File.class).required(); +@@ -219,6 +248,12 @@ public class Commodore { + cr.accept(new ClassVisitor(Opcodes.ASM9, cw) { + @Override + public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) { ++ // Paper start - Rewrite plugins + desc = getOriginalOrRewrite( desc ); + if ( signature != null ) { + signature = getOriginalOrRewrite( signature ); + } -+ -+ return super.visitField( access, name, desc, signature, value) ; -+ } -+ // Paper end -+ - @Override - public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) - { - return new MethodVisitor( api, super.visitMethod( access, name, desc, signature, exceptions ) ) - { -+ // Paper start - Plugin rewrites -+ @Override -+ public void visitInvokeDynamicInsn(String name, String desc, Handle bootstrapMethodHandle, Object... bootstrapMethodArguments) -+ { -+ // Paper start - Rewrite plugins -+ name = getOriginalOrRewrite( name ); -+ if ( desc != null ) -+ { -+ desc = getOriginalOrRewrite( desc ); -+ } -+ // Paper end -+ -+ super.visitInvokeDynamicInsn( name, desc, bootstrapMethodHandle, bootstrapMethodArguments ); -+ } -+ -+ @Override -+ public void visitTypeInsn(int opcode, String type) -+ { -+ type = getOriginalOrRewrite( type ); -+ -+ super.visitTypeInsn( opcode, type ); -+ } -+ -+ @Override -+ public void visitFrame(int type, int nLocal, Object[] local, int nStack, Object[] stack) { -+ for ( int i = 0; i < local.length; i++ ) -+ { -+ if ( !( local[i] instanceof String ) ) { continue; } -+ -+ local[i] = getOriginalOrRewrite( (String) local[i] ); -+ } -+ -+ for ( int i = 0; i < stack.length; i++ ) -+ { -+ if ( !( stack[i] instanceof String ) ) { continue; } -+ -+ stack[i] = getOriginalOrRewrite( (String) stack[i] ); -+ } -+ -+ super.visitFrame( type, nLocal, local, nStack, stack ); -+ } -+ -+ @Override -+ public void visitLocalVariable(String name, String descriptor, String signature, Label start, Label end, int index) -+ { -+ descriptor = getOriginalOrRewrite( descriptor ); -+ -+ super.visitLocalVariable( name, descriptor, signature, start, end, index ); -+ } -+ // Paper end - ++ // Paper end + for (TypeInstructionInfo typeInstructionInfo : Commodore.TYPE_INSTRUCTIONS) { + if (preEnumKilling != typeInstructionInfo.preEnumKill) { + continue; +@@ -276,6 +311,13 @@ public class Commodore { + return new MethodVisitor(api, super.visitMethod(access, name, desc, signature, exceptions)) { @Override - public void visitFieldInsn(int opcode, String owner, String name, String desc) - { + public void visitFieldInsn(int opcode, String owner, String name, String desc) { + // Paper start - Rewrite plugins + owner = getOriginalOrRewrite( owner ); + if ( desc != null ) @@ -162,11 +71,10 @@ index 48cdd483c25825571043800f3cfa41a4d723f649..fe5d3b60ad740b7f1cce040f9c8d96ac + desc = getOriginalOrRewrite( desc ); + } + // Paper end -+ - if ( owner.equals( "org/bukkit/block/Biome" ) ) - { - switch ( name ) -@@ -330,6 +443,11 @@ public class Commodore + if (owner.equals("org/bukkit/block/Biome")) { + switch (name) { + case "NETHER": +@@ -857,6 +899,11 @@ public class Commodore { } // Paper start - Rewrite plugins @@ -178,17 +86,66 @@ index 48cdd483c25825571043800f3cfa41a4d723f649..fe5d3b60ad740b7f1cce040f9c8d96ac if ((owner.equals("org/bukkit/OfflinePlayer") || owner.equals("org/bukkit/entity/Player")) && name.equals("getPlayerProfile") && desc.equals("()Lorg/bukkit/profile/PlayerProfile;")) { super.visitMethodInsn(opcode, owner, name, "()Lcom/destroystokyo/paper/profile/PlayerProfile;", itf); return; -@@ -424,6 +542,13 @@ public class Commodore +@@ -1042,6 +1089,13 @@ public class Commodore { + @Override - public void visitLdcInsn(Object value) - { -+ // Paper start + public void visitLdcInsn(Object value) { ++ // Paper start - Rewrite plugins + if (value instanceof Type type) { + if (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY) { + value = Type.getType(getOriginalOrRewrite(type.getDescriptor())); + } + } + // Paper end - if ( value instanceof String && ( (String) value ).equals( "com.mysql.jdbc.Driver" ) ) - { - super.visitLdcInsn( "com.mysql.cj.jdbc.Driver" ); + if (value instanceof String && ((String) value).equals("com.mysql.jdbc.Driver")) { + super.visitLdcInsn("com.mysql.cj.jdbc.Driver"); + return; +@@ -1052,6 +1106,7 @@ public class Commodore { + + @Override + public void visitTypeInsn(int opcode, String type) { ++ type = getOriginalOrRewrite(type); // Paper - Rewrite plugins + for (TypeInstructionInfo typeInstructionInfo : Commodore.TYPE_INSTRUCTIONS) { + if (preEnumKilling != typeInstructionInfo.preEnumKill) { + continue; +@@ -1069,6 +1124,7 @@ public class Commodore { + + @Override + public void visitLocalVariable(String name, String descriptor, String signature, Label start, Label end, int index) { ++ descriptor = getOriginalOrRewrite(descriptor); // Paper - Rewrite plugins + for (TypeInstructionInfo typeInstructionInfo : Commodore.TYPE_INSTRUCTIONS) { + if (preEnumKilling != typeInstructionInfo.preEnumKill) { + continue; +@@ -1086,6 +1142,12 @@ public class Commodore { + + @Override + public void visitInvokeDynamicInsn(String name, String descriptor, Handle bootstrapMethodHandle, Object... bootstrapMethodArguments) { ++ // Paper start - Rewrite plugins ++ name = getOriginalOrRewrite(name); ++ if (descriptor != null) { ++ descriptor = getOriginalOrRewrite(descriptor); ++ } ++ // Paper end + + if (bootstrapMethodHandle.getOwner().equals("java/lang/invoke/LambdaMetafactory") + && bootstrapMethodHandle.getName().equals("metafactory") && bootstrapMethodArguments.length == 3) { +@@ -1211,6 +1273,19 @@ public class Commodore { + + @Override + public void visitFrame(int type, int numLocal, Object[] local, int numStack, Object[] stack) { ++ // Paper start - Rewrite plugins ++ for (int i = 0; i < local.length; i++) { ++ if (!(local[i] instanceof String)) { continue; } ++ ++ local[i] = getOriginalOrRewrite((String) local[i]); ++ } ++ ++ for (int i = 0; i < stack.length; i++) { ++ if (!(stack[i] instanceof String)) continue; ++ ++ stack[i] = getOriginalOrRewrite((String) stack[i]); ++ } ++ // Paper end + Object[] newLocal = new Object[local.length]; + Object[] newStack = new Object[stack.length]; + diff --git a/patches/server/0265-Add-LivingEntity-getTargetEntity.patch b/patches/server/0265-Add-LivingEntity-getTargetEntity.patch index e82a8ec813..9c35f8b1a4 100644 --- a/patches/server/0265-Add-LivingEntity-getTargetEntity.patch +++ b/patches/server/0265-Add-LivingEntity-getTargetEntity.patch @@ -56,7 +56,7 @@ index b712f505fd092e0366ffc74ff59345a7f8c701be..6718b4159b1c670e0a15020ee5dba675 public int getShieldBlockingDelay() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index bc40c64f8c9ace7dec8f966193f41c626ac14e22..0c3ac380b9092ff961bce761ddfc835f4bd66544 100644 +index 0155761d9771328f48d3513480ce8d4f7b30ae23..f43753678cc079d5076479962de6d28f44745b45 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -1,5 +1,6 @@ @@ -66,7 +66,7 @@ index bc40c64f8c9ace7dec8f966193f41c626ac14e22..0c3ac380b9092ff961bce761ddfc835f import com.google.common.base.Preconditions; import com.google.common.collect.Sets; import java.util.ArrayList; -@@ -224,6 +225,39 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -227,6 +228,39 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { } return null; } diff --git a/patches/server/0266-Add-sun-related-API.patch b/patches/server/0266-Add-sun-related-API.patch index c1cdee93e6..a119c2fc28 100644 --- a/patches/server/0266-Add-sun-related-API.patch +++ b/patches/server/0266-Add-sun-related-API.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Add sun related API public net.minecraft.world.entity.Mob isSunBurnTick()Z diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index e7aa0e6d78765836a31965ef9c518bfef17e2b03..b005c956311612bc16b57e0ec9a4f832d9243dce 100644 +index 6df2719e738dea69a7bbe30463f81c2d5f5f3754..d684e59e978a3fbea71c2c8294428f1c9b8fc2e4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -692,6 +692,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -693,6 +693,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { } } @@ -25,7 +25,7 @@ index e7aa0e6d78765836a31965ef9c518bfef17e2b03..b005c956311612bc16b57e0ec9a4f832 public long getGameTime() { return world.levelData.getGameTime(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -index f36713771598ac5afdae5d94db10a5790949611d..c92f7f31c3bf96f22fb1d2e783b14b80512448a0 100644 +index ce244e96f674f7886179baced3d1e9b67fedfe73..522b7cb1db22b02279b004916ad2a14447a6bbed 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java @@ -93,4 +93,11 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { diff --git a/patches/server/0268-Turtle-API.patch b/patches/server/0268-Turtle-API.patch index e2997b3063..960922becc 100644 --- a/patches/server/0268-Turtle-API.patch +++ b/patches/server/0268-Turtle-API.patch @@ -60,10 +60,10 @@ index fcd760cb88f84ff79811631612956fde79905132..99fc97051c61ac8d08afdc0ea4845e96 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java -index 96462a29551c301d3c80029cab2bec3839914237..d3546fb082a56b4ce077ded5d25909e15f7eb593 100644 +index fac0317ff945db991e761ac8973f0d3d41ade26b..d44e6f4bb682d18c1497eee9fb2802f2bda6e840 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java -@@ -34,4 +34,31 @@ public class CraftTurtle extends CraftAnimals implements Turtle { +@@ -28,4 +28,31 @@ public class CraftTurtle extends CraftAnimals implements Turtle { public boolean isLayingEgg() { return this.getHandle().isLayingEgg(); } diff --git a/patches/server/0271-Add-more-Witch-API.patch b/patches/server/0271-Add-more-Witch-API.patch index 3e1ba61773..4610626cbb 100644 --- a/patches/server/0271-Add-more-Witch-API.patch +++ b/patches/server/0271-Add-more-Witch-API.patch @@ -60,12 +60,12 @@ index df024c3108df807772fc487f5c59004a59938bf2..701f6bf1d558cf0ec4bc1abb9e1f66d9 public SoundEvent getCelebrateSound() { return SoundEvents.WITCH_CELEBRATE; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java -index eada1f0ff10d4c00f82a6f4411fe18b7184e9901..9039db1a72009342063d4db08e18e6aee18836e8 100644 +index 5024a102fe71d7013bc809bb4140763bd4c466e7..e25f49700e794a40a8d7931eb535a5303bda031d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java -@@ -3,6 +3,13 @@ package org.bukkit.craftbukkit.entity; +@@ -2,6 +2,13 @@ package org.bukkit.craftbukkit.entity; + import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.entity.EntityType; import org.bukkit.entity.Witch; +// Paper start +import com.destroystokyo.paper.entity.CraftRangedEntity; @@ -77,7 +77,7 @@ index eada1f0ff10d4c00f82a6f4411fe18b7184e9901..9039db1a72009342063d4db08e18e6ae public class CraftWitch extends CraftRaider implements Witch, com.destroystokyo.paper.entity.CraftRangedEntity<net.minecraft.world.entity.monster.Witch> { // Paper public CraftWitch(CraftServer server, net.minecraft.world.entity.monster.Witch entity) { -@@ -28,4 +35,23 @@ public class CraftWitch extends CraftRaider implements Witch, com.destroystokyo. +@@ -22,4 +29,23 @@ public class CraftWitch extends CraftRaider implements Witch, com.destroystokyo. public boolean isDrinkingPotion() { return this.getHandle().isDrinkingPotion(); } @@ -96,7 +96,7 @@ index eada1f0ff10d4c00f82a6f4411fe18b7184e9901..9039db1a72009342063d4db08e18e6ae + } + + public void setDrinkingPotion(ItemStack potion) { -+ Preconditions.checkArgument(potion == null || potion.getType().isEmpty() || potion.getType() == Material.POTION, "must be potion, air, or null"); ++ Preconditions.checkArgument(potion == null || potion.getType() == org.bukkit.inventory.ItemType.AIR || potion.getType() == org.bukkit.inventory.ItemType.POTION, "must be potion, air, or null"); + getHandle().setDrinkingPotion(CraftItemStack.asNMSCopy(potion)); + } + // Paper end diff --git a/patches/server/0278-Restore-custom-InventoryHolder-support.patch b/patches/server/0278-Restore-custom-InventoryHolder-support.patch index 4dd682813b..b8611459f9 100644 --- a/patches/server/0278-Restore-custom-InventoryHolder-support.patch +++ b/patches/server/0278-Restore-custom-InventoryHolder-support.patch @@ -194,10 +194,10 @@ index 8ea031537c27b219c22316bff191670c48ebd602..bdaa739aa18a95894a165e9333a3e9d5 // SPIGOT-4598 - we should still delegate the shift click handler diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java -index 287b17ba34f1261a708b9fbf41f6422d92d9c37b..7bdb2e52d36feb9e0ce517ae95f5edb28ddc67d6 100644 +index 0b515bcf772518e1396a3503bbb510b7224995d2..f3ea4401a445eb5c327c886415da2c98f734df5a 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java -@@ -492,6 +492,10 @@ public class CraftInventory implements Inventory { +@@ -485,6 +485,10 @@ public class CraftInventory implements Inventory { return InventoryType.BREWING; } else if (this.inventory instanceof CraftInventoryCustom.MinecraftInventory) { return ((CraftInventoryCustom.MinecraftInventory) this.inventory).getType(); diff --git a/patches/server/0282-Make-the-default-permission-message-configurable.patch b/patches/server/0282-Make-the-default-permission-message-configurable.patch index 6dbccd2fed..1b2338906c 100644 --- a/patches/server/0282-Make-the-default-permission-message-configurable.patch +++ b/patches/server/0282-Make-the-default-permission-message-configurable.patch @@ -18,10 +18,10 @@ index e3467aaf6d0c8d486b84362e3c20b3fe631b50ff..8f16640fc2f1233c10392d7e32a54d78 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 537a5e19c9566dfbefa913a66183ec4ef31844c1..bf5e68463882f59d16550313b698156404ae90c1 100644 +index b60da399ea129f0b8c41608397e440ae161ec6e4..6e79ba557dbb27cce5eaafcbf00c044795c9d831 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2710,6 +2710,16 @@ public final class CraftServer implements Server { +@@ -2724,6 +2724,16 @@ public final class CraftServer implements Server { return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions; } diff --git a/patches/server/0286-Add-more-Zombie-API.patch b/patches/server/0286-Add-more-Zombie-API.patch index 47ee4744f5..52e2b083ce 100644 --- a/patches/server/0286-Add-more-Zombie-API.patch +++ b/patches/server/0286-Add-more-Zombie-API.patch @@ -69,10 +69,10 @@ index 86dc8bdfdc4eabef2266f3409366b373fb0ae13d..fed8b065172f40a2a5c251f46303fc4d } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java -index 9e249a194980796248d07481df2cd04e80f079d8..1e0154f2d06b0cc5bc58ec2de98cbdce1346da35 100644 +index 47ee56a5623e0ebd4263ef9b9b92434a26a08311..1e303c3686e2fe4e05efe5a630dd2c1cb0f9edea 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java -@@ -93,6 +93,42 @@ public class CraftZombie extends CraftMonster implements Zombie { +@@ -87,6 +87,42 @@ public class CraftZombie extends CraftMonster implements Zombie { @Override public void setAgeLock(boolean b) { } diff --git a/patches/server/0290-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch b/patches/server/0290-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch index 32fb1c41a1..28a7d7c272 100644 --- a/patches/server/0290-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch +++ b/patches/server/0290-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch @@ -40,10 +40,10 @@ index 2bccba03bb12cf17a82c1e54c2bb10535b7c8964..5657493e215a17f3132f9d4114248751 GameProfileCache usercache = this.server.getProfileCache(); String s; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -index 69a1852905dd4724c30ac8ab88c14251eee2c371..17b3d5de58a9ef3acc67624c46cd6bbd96394f87 100644 +index d870cd9cf7453cc13aafed9f5205e7c28b1a9cdc..ffc31edc50cc19deead448856a0d6fb592bb7401 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -@@ -250,6 +250,61 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa +@@ -252,6 +252,61 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa return this.getData() != null; } @@ -106,7 +106,7 @@ index 69a1852905dd4724c30ac8ab88c14251eee2c371..17b3d5de58a9ef3acc67624c46cd6bbd public Location getLastDeathLocation() { if (this.getData().contains("LastDeathLocation", 10)) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index e572dbdbd02e6b7307172e0b6f80d9b6e7fbce60..25e8d025c3542cdb08a9228dc5fb2d1944d51701 100644 +index 9c422287436c8497d26ab99466fd1386fca6c3a0..40d49a9e7598872596949d07dc56d6e00cfd1a7b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -186,6 +186,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -117,7 +117,7 @@ index e572dbdbd02e6b7307172e0b6f80d9b6e7fbce60..25e8d025c3542cdb08a9228dc5fb2d19 // Paper end public CraftPlayer(CraftServer server, ServerPlayer entity) { -@@ -1873,6 +1874,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1895,6 +1896,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.firstPlayed = firstPlayed; } @@ -136,7 +136,7 @@ index e572dbdbd02e6b7307172e0b6f80d9b6e7fbce60..25e8d025c3542cdb08a9228dc5fb2d19 public void readExtraData(CompoundTag nbttagcompound) { this.hasPlayedBefore = true; if (nbttagcompound.contains("bukkit")) { -@@ -1895,6 +1908,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1917,6 +1930,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void setExtraData(CompoundTag nbttagcompound) { @@ -145,7 +145,7 @@ index e572dbdbd02e6b7307172e0b6f80d9b6e7fbce60..25e8d025c3542cdb08a9228dc5fb2d19 if (!nbttagcompound.contains("bukkit")) { nbttagcompound.put("bukkit", new CompoundTag()); } -@@ -1909,6 +1924,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1931,6 +1946,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { data.putLong("firstPlayed", this.getFirstPlayed()); data.putLong("lastPlayed", System.currentTimeMillis()); data.putString("lastKnownName", handle.getScoreboardName()); diff --git a/patches/server/0292-Block-Entity-remove-from-being-called-on-Players.patch b/patches/server/0292-Block-Entity-remove-from-being-called-on-Players.patch index 04e20f9035..c1bbd28a6f 100644 --- a/patches/server/0292-Block-Entity-remove-from-being-called-on-Players.patch +++ b/patches/server/0292-Block-Entity-remove-from-being-called-on-Players.patch @@ -12,10 +12,10 @@ Player we will look at limiting the scope of this change. It appears to be unintentional in the few cases we've seen so far. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 25e8d025c3542cdb08a9228dc5fb2d1944d51701..38786153c9e9dc86992ba1b9a8226042aaf7e845 100644 +index 40d49a9e7598872596949d07dc56d6e00cfd1a7b..2fe9e07ee873d3051e9fc42454cf7ba54c3082e5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2795,6 +2795,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2813,6 +2813,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void resetCooldown() { getHandle().resetAttackStrengthTicker(); } diff --git a/patches/server/0301-Entity-getEntitySpawnReason.patch b/patches/server/0301-Entity-getEntitySpawnReason.patch index f6ea5a4b86..3565f02584 100644 --- a/patches/server/0301-Entity-getEntitySpawnReason.patch +++ b/patches/server/0301-Entity-getEntitySpawnReason.patch @@ -10,7 +10,7 @@ persistenting Living Entity, SPAWNER for spawners, or DEFAULT since data was not stored. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 6b157b362cffedae26133fc0f0af1094655ee11f..986a509998d217228eb1dc2b5815787599e02d6b 100644 +index eace3ac2219a9746800811037074578ccc23f072..8e2129c78c212c61456efc3a40fb13b877d52259 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1429,6 +1429,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -108,10 +108,10 @@ index a9be524edb03c51300bc45d424fcf87c7491a8c0..a08c2dee792da1a54005f0a65a9eefab // CraftBukkit start if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 9614a0bd83139e8d62f60fe04f017e0cb0f828c9..e237320b2703a1281fab47f24516e8b7d83677be 100644 +index 0008f8365b13e10d842a3e2e7c4f87448014a857..8b48c0379d395f1e5a2e5ac90a9bb50e26649a71 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1296,5 +1296,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1311,5 +1311,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { public boolean fromMobSpawner() { return getHandle().spawnedViaMobSpawner; } diff --git a/patches/server/0308-Add-Heightmap-API.patch b/patches/server/0308-Add-Heightmap-API.patch index 3e482f7785..32597614e2 100644 --- a/patches/server/0308-Add-Heightmap-API.patch +++ b/patches/server/0308-Add-Heightmap-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Heightmap API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index b005c956311612bc16b57e0ec9a4f832d9243dce..944f673c4537a44afbdf43e7540835a25b4dece7 100644 +index d684e59e978a3fbea71c2c8294428f1c9b8fc2e4..862f55b778fc6d097786271a65e72feaa62487d8 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -219,6 +219,29 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -220,6 +220,29 @@ public class CraftWorld extends CraftRegionAccessor implements World { return CraftBlock.at(world, new BlockPos(x, y, z)); } diff --git a/patches/server/0309-Mob-Spawner-API-Enhancements.patch b/patches/server/0309-Mob-Spawner-API-Enhancements.patch index 3ad0d3508d..c4a49e0b4d 100644 --- a/patches/server/0309-Mob-Spawner-API-Enhancements.patch +++ b/patches/server/0309-Mob-Spawner-API-Enhancements.patch @@ -69,7 +69,7 @@ index a08c2dee792da1a54005f0a65a9eefabc7bc7c60..369298dfd437c1c83801f3d4ba63484e nbt.putShort("MaxNearbyEntities", (short) this.maxNearbyEntities); nbt.putShort("RequiredPlayerRange", (short) this.requiredPlayerRange); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java -index ecafc548c96f01763f4f189c11de04636fb3968e..cc4c9c2db57d0727a898a90951d6d7e39fc5b190 100644 +index 515dcff006310523a10e5e78ae0e81a4820c25f9..a1b284f8a7be98cd4586c3398e359a4af8c4c2aa 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java @@ -134,4 +134,28 @@ public class CraftCreatureSpawner extends CraftBlockEntityState<SpawnerBlockEnti @@ -92,7 +92,7 @@ index ecafc548c96f01763f4f189c11de04636fb3968e..cc4c9c2db57d0727a898a90951d6d7e3 + + @Override + public void setSpawnedItem(org.bukkit.inventory.ItemStack itemStack) { -+ Preconditions.checkArgument(itemStack != null && !itemStack.getType().isAir(), "spawners cannot spawn air"); ++ Preconditions.checkArgument(itemStack != null && itemStack.getType() != org.bukkit.inventory.ItemType.AIR, "spawners cannot spawn air"); + net.minecraft.world.item.ItemStack item = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(itemStack); + net.minecraft.nbt.CompoundTag entity = new net.minecraft.nbt.CompoundTag(); + entity.putString("id", net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.getKey(net.minecraft.world.entity.EntityType.ITEM).toString()); diff --git a/patches/server/0312-Implement-CraftBlockSoundGroup.patch b/patches/server/0312-Implement-CraftBlockSoundGroup.patch index aa1e2c4994..e2c139fbf5 100644 --- a/patches/server/0312-Implement-CraftBlockSoundGroup.patch +++ b/patches/server/0312-Implement-CraftBlockSoundGroup.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Implement CraftBlockSoundGroup diff --git a/src/main/java/com/destroystokyo/paper/block/CraftBlockSoundGroup.java b/src/main/java/com/destroystokyo/paper/block/CraftBlockSoundGroup.java new file mode 100644 -index 0000000000000000000000000000000000000000..c5b07ec346105d1b95c1c938ffca12a21642040c +index 0000000000000000000000000000000000000000..3913c407a3bfa7dfa4a5e374a5e792962fcdafe6 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/block/CraftBlockSoundGroup.java @@ -0,0 +1,39 @@ @@ -26,34 +26,34 @@ index 0000000000000000000000000000000000000000..c5b07ec346105d1b95c1c938ffca12a2 + + @Override + public Sound getBreakSound() { -+ return CraftSound.getBukkit(soundEffectType.getBreakSound()); ++ return CraftSound.minecraftToBukkit(soundEffectType.getBreakSound()); + } + + @Override + public Sound getStepSound() { -+ return CraftSound.getBukkit(soundEffectType.getStepSound()); ++ return CraftSound.minecraftToBukkit(soundEffectType.getStepSound()); + } + + @Override + public Sound getPlaceSound() { -+ return CraftSound.getBukkit(soundEffectType.getPlaceSound()); ++ return CraftSound.minecraftToBukkit(soundEffectType.getPlaceSound()); + } + + @Override + public Sound getHitSound() { -+ return CraftSound.getBukkit(soundEffectType.getHitSound()); ++ return CraftSound.minecraftToBukkit(soundEffectType.getHitSound()); + } + + @Override + public Sound getFallSound() { -+ return CraftSound.getBukkit(soundEffectType.getFallSound()); ++ return CraftSound.minecraftToBukkit(soundEffectType.getFallSound()); + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index 3205d86a63f8fcf3ccd13c6be0e0eefc27beb62a..93bf6b8e30e5e28fa9261b8b927081d85547e400 100644 +index 77dd29a93af4cc0a02374fe2bf0ff0a2679fc9a4..99256a0054bf19e24390dae0dd78ad87af87b0a2 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -@@ -647,4 +647,16 @@ public class CraftBlock implements Block { +@@ -621,4 +621,16 @@ public class CraftBlock implements Block { public String getTranslationKey() { return this.getNMS().getBlock().getDescriptionId(); } diff --git a/patches/server/0313-Configurable-Keep-Spawn-Loaded-range-per-world.patch b/patches/server/0313-Configurable-Keep-Spawn-Loaded-range-per-world.patch index 45e2ade11a..6510bc9f8f 100644 --- a/patches/server/0313-Configurable-Keep-Spawn-Loaded-range-per-world.patch +++ b/patches/server/0313-Configurable-Keep-Spawn-Loaded-range-per-world.patch @@ -63,7 +63,7 @@ index 95c2be1ee4bca53c9ea78e3a32aaf3a6395381a7..cd57953e31c1f0f51553be113d84760f // this.updateMobSpawningFlags(); worldserver.setSpawnSettings(this.isSpawningMonsters(), this.isSpawningAnimals()); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 986a509998d217228eb1dc2b5815787599e02d6b..773fea9c2c4bef931439b5663471c010d9a1297c 100644 +index 8e2129c78c212c61456efc3a40fb13b877d52259..543b2c8711713ebe756f4583606dd85e0a5b7f38 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1866,12 +1866,84 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -191,10 +191,10 @@ index 4d2348df25410a0b5364eec066880326d6667dad..286aad3205ef8a9e21a47ef07893844f this.maxCount = i * i; } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 944f673c4537a44afbdf43e7540835a25b4dece7..66eabbe916994e96f67e2039e6b291447753900f 100644 +index 862f55b778fc6d097786271a65e72feaa62487d8..828a8860c79e33b0dc9e99678be23e99682545e2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1350,15 +1350,21 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1344,15 +1344,21 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setKeepSpawnInMemory(boolean keepLoaded) { diff --git a/patches/server/0315-Expose-the-internal-current-tick.patch b/patches/server/0315-Expose-the-internal-current-tick.patch index 55a6b69199..b417a1814d 100644 --- a/patches/server/0315-Expose-the-internal-current-tick.patch +++ b/patches/server/0315-Expose-the-internal-current-tick.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose the internal current tick diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index bf5e68463882f59d16550313b698156404ae90c1..9d477eaa1015b6337a644f1baafd7cba67bb0e4a 100644 +index 6e79ba557dbb27cce5eaafcbf00c044795c9d831..b1220319498c126eb89d9274084e22e5c0a4379b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2751,5 +2751,10 @@ public final class CraftServer implements Server { +@@ -2765,5 +2765,10 @@ public final class CraftServer implements Server { profile.getProperties().putAll(((CraftPlayer)player).getHandle().getGameProfile().getProperties()); return new com.destroystokyo.paper.profile.CraftPlayerProfile(profile); } diff --git a/patches/server/0316-Fix-World-isChunkGenerated-calls.patch b/patches/server/0316-Fix-World-isChunkGenerated-calls.patch index ceb1869c90..6975d1f79a 100644 --- a/patches/server/0316-Fix-World-isChunkGenerated-calls.patch +++ b/patches/server/0316-Fix-World-isChunkGenerated-calls.patch @@ -156,10 +156,10 @@ index 96f129cb13642dc9667464b58c025fa0ed700cfd..29da08c58200c24fd03003937d30eb41 } catch (Throwable throwable) { if (dataoutputstream != null) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 66eabbe916994e96f67e2039e6b291447753900f..ad272693251141f60ef68c50cf27f3f005b0acbd 100644 +index 828a8860c79e33b0dc9e99678be23e99682545e2..87203f42d23f0e384138f85d4e7e8783c2b8a258 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -307,9 +307,23 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -308,9 +308,23 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean isChunkGenerated(int x, int z) { @@ -185,7 +185,7 @@ index 66eabbe916994e96f67e2039e6b291447753900f..ad272693251141f60ef68c50cf27f3f0 throw new RuntimeException(ex); } } -@@ -423,20 +437,48 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -424,20 +438,48 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean loadChunk(int x, int z, boolean generate) { org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot diff --git a/patches/server/0343-Anti-Xray.patch b/patches/server/0343-Anti-Xray.patch index 266d228c20..f3d9743806 100644 --- a/patches/server/0343-Anti-Xray.patch +++ b/patches/server/0343-Anti-Xray.patch @@ -1135,7 +1135,7 @@ index 5cc0a39622a265e42e6b7d20e81144d1acce59b7..e0c9b9b61fa718d81d6e4438d7c12a83 List<Entity> list = Lists.newArrayList(); List<Entity> list1 = Lists.newArrayList(); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index b12e9da3eebda396769b30f4b7e37a78f3bcb060..62ea2bb2fdd1f2de31b08c88193887989fbd3ece 100644 +index 4785ad352bc8715395c94b0b2d3ae386aeca7af6..7a5ad311b419ea82460ac7aef061098f402d3087 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -564,7 +564,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1560,10 +1560,10 @@ index 0d8cfc0808a8f204d57cec40929b489099eca815..dec862552b08e6b9f9ad1f88db1e07dc // CraftBukkit end diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -index b738e1f7debac7d70910d5ac908ca9d4f60640d5..269ebe8e8826a0c89e471cb59b503900d7ebe0fa 100644 +index 8eb22243381b131264706b5ade67c6513564c2dd..1ecd0c8fa79e8628f2b71302fe429e68ff89a731 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -@@ -52,7 +52,7 @@ public class CraftChunk implements Chunk { +@@ -53,7 +53,7 @@ public class CraftChunk implements Chunk { private final ServerLevel worldServer; private final int x; private final int z; @@ -1573,10 +1573,10 @@ index b738e1f7debac7d70910d5ac908ca9d4f60640d5..269ebe8e8826a0c89e471cb59b503900 public CraftChunk(net.minecraft.world.level.chunk.LevelChunk chunk) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 9d477eaa1015b6337a644f1baafd7cba67bb0e4a..f7d2193f7e182e64cd51d3f909e4f0505a388f48 100644 +index b1220319498c126eb89d9274084e22e5c0a4379b..0fd61cde0bc8d5e7c723e86d740125482189ae70 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2280,7 +2280,7 @@ public final class CraftServer implements Server { +@@ -2291,7 +2291,7 @@ public final class CraftServer implements Server { public ChunkGenerator.ChunkData createChunkData(World world) { Preconditions.checkArgument(world != null, "World cannot be null"); ServerLevel handle = ((CraftWorld) world).getHandle(); @@ -1586,10 +1586,10 @@ index 9d477eaa1015b6337a644f1baafd7cba67bb0e4a..f7d2193f7e182e64cd51d3f909e4f050 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index ad272693251141f60ef68c50cf27f3f005b0acbd..e3308c3e93abf80022a16166c3cc522da8221f34 100644 +index 87203f42d23f0e384138f85d4e7e8783c2b8a258..4fe7d86bdfe0adbe205c212f22db0f8daaf99075 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -418,11 +418,16 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -419,11 +419,16 @@ public class CraftWorld extends CraftRegionAccessor implements World { List<ServerPlayer> playersInRange = playerChunk.playerProvider.getPlayers(playerChunk.getPos(), false); if (playersInRange.isEmpty()) return true; // Paper - rewrite player chunk loader @@ -1609,7 +1609,7 @@ index ad272693251141f60ef68c50cf27f3f005b0acbd..e3308c3e93abf80022a16166c3cc522d // Paper - rewrite player chunk loader diff --git a/src/main/java/org/bukkit/craftbukkit/generator/OldCraftChunkData.java b/src/main/java/org/bukkit/craftbukkit/generator/OldCraftChunkData.java -index c23ce88cb9693291fec81a99e3a5bcb2615bb897..a9700b750f124b5367c91ac071ee5194e9f7f8d8 100644 +index 0e709ad6e0cb14bb57700afc55d526ee3df164ab..4a2f2c7a79fe28fb3ac49d097b8b3349b5fe55bb 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/OldCraftChunkData.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/OldCraftChunkData.java @@ -27,8 +27,13 @@ public final class OldCraftChunkData implements ChunkGenerator.ChunkData { @@ -1617,11 +1617,11 @@ index c23ce88cb9693291fec81a99e3a5bcb2615bb897..a9700b750f124b5367c91ac071ee5194 private Set<BlockPos> tiles; private final Set<BlockPos> lights = new HashSet<>(); + // Paper start - Anti-Xray - Add parameters -+ private final World world; ++ private final org.bukkit.World world; - public OldCraftChunkData(int minHeight, int maxHeight, Registry<net.minecraft.world.level.biome.Biome> biomes) { + @Deprecated @io.papermc.paper.annotation.DoNotUse public OldCraftChunkData(int minHeight, int maxHeight, Registry<net.minecraft.world.level.biome.Biome> biomes) { this(minHeight, maxHeight, biomes, null); } -+ public OldCraftChunkData(int minHeight, int maxHeight, Registry<net.minecraft.world.level.biome.Biome> biomes, World world) { ++ public OldCraftChunkData(int minHeight, int maxHeight, Registry<net.minecraft.world.level.biome.Biome> biomes, org.bukkit.World world) { + this.world = world; + // Paper end this.minHeight = minHeight; diff --git a/patches/server/0345-Improve-Block-breakNaturally-API.patch b/patches/server/0345-Improve-Block-breakNaturally-API.patch index 4de6b7c5eb..e383cf2faf 100644 --- a/patches/server/0345-Improve-Block-breakNaturally-API.patch +++ b/patches/server/0345-Improve-Block-breakNaturally-API.patch @@ -34,10 +34,10 @@ index 6f9cb55491da718cd6564425748ab3852fda9b68..5fbdc96f29e29dfc092b9e84a988032d if (world.dimensionType().ultraWarm()) { world.removeBlock(pos, false); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index 93bf6b8e30e5e28fa9261b8b927081d85547e400..5534348ddb3ac42b6b8a687816c2c8c1858e3b3e 100644 +index 99256a0054bf19e24390dae0dd78ad87af87b0a2..c5e98a0147e6eed86fc02e8681d8b476ca8f13f6 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -@@ -477,6 +477,18 @@ public class CraftBlock implements Block { +@@ -451,6 +451,18 @@ public class CraftBlock implements Block { @Override public boolean breakNaturally(ItemStack item) { @@ -56,7 +56,7 @@ index 93bf6b8e30e5e28fa9261b8b927081d85547e400..5534348ddb3ac42b6b8a687816c2c8c1 // Order matters here, need to drop before setting to air so skulls can get their data net.minecraft.world.level.block.state.BlockState iblockdata = this.getNMS(); net.minecraft.world.level.block.Block block = iblockdata.getBlock(); -@@ -486,11 +498,35 @@ public class CraftBlock implements Block { +@@ -460,11 +472,35 @@ public class CraftBlock implements Block { // Modelled off EntityHuman#hasBlock if (block != Blocks.AIR && (item == null || !iblockdata.requiresCorrectToolForDrops() || nmsItem.isCorrectToolForDrops(iblockdata))) { net.minecraft.world.level.block.Block.dropResources(iblockdata, this.world.getMinecraftWorld(), position, this.world.getBlockEntity(position), null, nmsItem); diff --git a/patches/server/0350-Entity-Jump-API.patch b/patches/server/0350-Entity-Jump-API.patch index 4c1f5f0426..f4952d4b33 100644 --- a/patches/server/0350-Entity-Jump-API.patch +++ b/patches/server/0350-Entity-Jump-API.patch @@ -48,10 +48,10 @@ index 243397de3b0a843ec95c6b721d7fc654bfc78448..aad1fb5cf231b400dc8c192871aa4429 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 0c3ac380b9092ff961bce761ddfc835f4bd66544..6bf1b3a9ee029feafa054f40291078c79f28c5f4 100644 +index f43753678cc079d5076479962de6d28f44745b45..e1fa2116b804e685b40117490824d36f6d12eb32 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -884,5 +884,19 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -882,5 +882,19 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { public org.bukkit.inventory.EquipmentSlot getHandRaised() { return getHandle().getUsedItemHand() == net.minecraft.world.InteractionHand.MAIN_HAND ? org.bukkit.inventory.EquipmentSlot.HAND : org.bukkit.inventory.EquipmentSlot.OFF_HAND; } diff --git a/patches/server/0353-add-hand-to-BlockMultiPlaceEvent.patch b/patches/server/0353-add-hand-to-BlockMultiPlaceEvent.patch index c28dd4a82b..337faea43c 100644 --- a/patches/server/0353-add-hand-to-BlockMultiPlaceEvent.patch +++ b/patches/server/0353-add-hand-to-BlockMultiPlaceEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] add hand to BlockMultiPlaceEvent diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index e8783b2c7083c847770e9f08e796b58e9f8ea6ec..8fbe5a10ba6eeff70c9b4907717c281b6f30a454 100644 +index f23f57a757e7fd39fa0128888d1c2e56a24faf99..4b0340fa8905df442f2b031cffca1efffa70f68f 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -366,13 +366,18 @@ public class CraftEventFactory { +@@ -372,13 +372,18 @@ public class CraftEventFactory { } org.bukkit.inventory.ItemStack item; diff --git a/patches/server/0359-Add-tick-times-API-and-mspt-command.patch b/patches/server/0359-Add-tick-times-API-and-mspt-command.patch index 80ac508d51..357ecddc23 100644 --- a/patches/server/0359-Add-tick-times-API-and-mspt-command.patch +++ b/patches/server/0359-Add-tick-times-API-and-mspt-command.patch @@ -184,10 +184,10 @@ index cd57953e31c1f0f51553be113d84760f24b061b0..36112a1ab7306deb3cc38b103f22f7c1 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index f7d2193f7e182e64cd51d3f909e4f0505a388f48..6e1618f32f1b5a896fa647d857eed4356115dcdd 100644 +index 0fd61cde0bc8d5e7c723e86d740125482189ae70..11a78795d93957e0cfb228ad4f2d744885f74fb9 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2535,6 +2535,16 @@ public final class CraftServer implements Server { +@@ -2549,6 +2549,16 @@ public final class CraftServer implements Server { net.minecraft.server.MinecraftServer.getServer().tps15.getAverage() }; } diff --git a/patches/server/0360-Expose-MinecraftServer-isRunning.patch b/patches/server/0360-Expose-MinecraftServer-isRunning.patch index 5dec3ef5cf..b77b7d2ad0 100644 --- a/patches/server/0360-Expose-MinecraftServer-isRunning.patch +++ b/patches/server/0360-Expose-MinecraftServer-isRunning.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Expose MinecraftServer#isRunning This allows for plugins to detect if the server is actually turning off in onDisable rather than just plugins reloading. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 6e1618f32f1b5a896fa647d857eed4356115dcdd..f87a6248a9e920d0e64d7971b0f056d06bc222e8 100644 +index 11a78795d93957e0cfb228ad4f2d744885f74fb9..4824e9da8e4bc9f9eed3a36cf79e29470e6973bb 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2766,5 +2766,10 @@ public final class CraftServer implements Server { +@@ -2780,5 +2780,10 @@ public final class CraftServer implements Server { public int getCurrentTick() { return net.minecraft.server.MinecraftServer.currentTick; } diff --git a/patches/server/0361-Add-Raw-Byte-ItemStack-Serialization.patch b/patches/server/0361-Add-Raw-Byte-ItemStack-Serialization.patch index 6af14e1082..28482b8a06 100644 --- a/patches/server/0361-Add-Raw-Byte-ItemStack-Serialization.patch +++ b/patches/server/0361-Add-Raw-Byte-ItemStack-Serialization.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add Raw Byte ItemStack Serialization Serializes using NBT which is safer for server data migrations than bukkits format. diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index bf8cb65df8e6ecc76e065625e89fd296d71b15b4..173d17adb76f5f08828048236f544d25f53152ea 100644 +index 621e63a2ef0623b81140efc5abe84a2450bd3e05..34555953d4252ef4c61d6901a9d33e2eded0f404 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -466,6 +466,52 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -525,6 +525,52 @@ public final class CraftMagicNumbers implements UnsafeValues { public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() { return new com.destroystokyo.paper.PaperVersionFetcher(); } @@ -17,7 +17,7 @@ index bf8cb65df8e6ecc76e065625e89fd296d71b15b4..173d17adb76f5f08828048236f544d25 + @Override + public byte[] serializeItem(ItemStack item) { + Preconditions.checkNotNull(item, "null cannot be serialized"); -+ Preconditions.checkArgument(item.getType() != Material.AIR, "air cannot be serialized"); ++ Preconditions.checkArgument(item.getType() != ItemType.AIR, "air cannot be serialized"); + + return serializeNbtToBytes((item instanceof CraftItemStack ? ((CraftItemStack) item).handle : CraftItemStack.asNMSCopy(item)).save(new CompoundTag())); + } diff --git a/patches/server/0371-Improved-Watchdog-Support.patch b/patches/server/0371-Improved-Watchdog-Support.patch index 680307abd1..78c856d474 100644 --- a/patches/server/0371-Improved-Watchdog-Support.patch +++ b/patches/server/0371-Improved-Watchdog-Support.patch @@ -319,7 +319,7 @@ index c3760f22fcc56ccb25e3315823054416c2172386..246606164117e8140ab0892ec1326503 final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ()); net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 24607ed5f60ce68aeda7380c433a8b416ed885c4..203a25a2a8d843c33440d849a94b85e2c717d2a0 100644 +index e1ca6c7974dcf65ff69fba9c8929e5d24ed4d97e..7ef9b0187d72e5891c7266b6ee3f652fc8318640 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -178,6 +178,36 @@ public class Main { @@ -359,7 +359,7 @@ index 24607ed5f60ce68aeda7380c433a8b416ed885c4..203a25a2a8d843c33440d849a94b85e2 try { options = parser.parse(args); } catch (joptsimple.OptionException ex) { -@@ -280,8 +310,64 @@ public class Main { +@@ -283,8 +313,64 @@ public class Main { } catch (Throwable t) { t.printStackTrace(); } diff --git a/patches/server/0375-Prevent-opening-inventories-when-frozen.patch b/patches/server/0375-Prevent-opening-inventories-when-frozen.patch index 93a9721f23..799cabab00 100644 --- a/patches/server/0375-Prevent-opening-inventories-when-frozen.patch +++ b/patches/server/0375-Prevent-opening-inventories-when-frozen.patch @@ -27,10 +27,10 @@ index 6ad3b7e7c7808cb40697e2eb6185f431fc431a20..65d17836785774d0f196321ba741ffd0 this.initMenu(container); return OptionalInt.of(this.containerCounter); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index ba6105a970381d642cd7955754cc47135207027a..82314358220b064a0f8a29cc1d663cc266c13916 100644 +index 8fe752c801e5172d5bed55e86e8fbdfb696660ee..99a8c0ef093e6383024dbe8c4b29876baabc10f1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -325,7 +325,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -327,7 +327,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { if (adventure$title == null) adventure$title = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(container.getBukkitView().getTitle()); // Paper //player.connection.send(new ClientboundOpenScreenPacket(container.containerId, windowType, CraftChatMessage.fromString(title)[0])); // Paper - comment @@ -39,7 +39,7 @@ index ba6105a970381d642cd7955754cc47135207027a..82314358220b064a0f8a29cc1d663cc2 player.containerMenu = container; player.initMenu(container); } -@@ -399,7 +399,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -401,7 +401,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { net.kyori.adventure.text.Component adventure$title = inventory.title(); // Paper if (adventure$title == null) adventure$title = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(inventory.getTitle()); // Paper //player.connection.send(new ClientboundOpenScreenPacket(container.containerId, windowType, CraftChatMessage.fromString(title)[0])); // Paper - comment diff --git a/patches/server/0384-Fix-numerous-item-duplication-issues-and-teleport-is.patch b/patches/server/0384-Fix-numerous-item-duplication-issues-and-teleport-is.patch index 95bd7a94e7..2b242e2a9d 100644 --- a/patches/server/0384-Fix-numerous-item-duplication-issues-and-teleport-is.patch +++ b/patches/server/0384-Fix-numerous-item-duplication-issues-and-teleport-is.patch @@ -135,10 +135,10 @@ index 4413b609f1250cf9477fcb3fecd7b67afee0b896..101e3a1f0f52b67b55c99c2619cc4329 } } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 8fbe5a10ba6eeff70c9b4907717c281b6f30a454..f9f9292a99bf35d49916e1380781cc9bc0e19842 100644 +index 4b0340fa8905df442f2b031cffca1efffa70f68f..595b707caed0d64ba86dda5330148e791db75247 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -827,6 +827,11 @@ public class CraftEventFactory { +@@ -833,6 +833,11 @@ public class CraftEventFactory { } public static EntityDeathEvent callEntityDeathEvent(net.minecraft.world.entity.LivingEntity victim, List<org.bukkit.inventory.ItemStack> drops) { @@ -150,14 +150,14 @@ index 8fbe5a10ba6eeff70c9b4907717c281b6f30a454..f9f9292a99bf35d49916e1380781cc9b CraftLivingEntity entity = (CraftLivingEntity) victim.getBukkitEntity(); EntityDeathEvent event = new EntityDeathEvent(entity, drops, victim.getExpReward()); populateFields(victim, event); // Paper - make cancellable -@@ -840,11 +845,13 @@ public class CraftEventFactory { +@@ -846,11 +851,13 @@ public class CraftEventFactory { playDeathSound(victim, event); // Paper end victim.expToDrop = event.getDroppedExp(); + lootCheck.run(); // Paper - advancement triggers before destroying items for (org.bukkit.inventory.ItemStack stack : event.getDrops()) { - if (stack == null || stack.getType() == Material.AIR || stack.getAmount() == 0) continue; + if (stack == null || stack.getType() == ItemType.AIR || stack.getAmount() == 0) continue; - world.dropItem(entity.getLocation(), stack); + world.dropItem(entity.getLocation(), stack); // Paper - note: dropItem already clones due to this being bukkit -> NMS diff --git a/patches/server/0385-Villager-Restocks-API.patch b/patches/server/0385-Villager-Restocks-API.patch index c424a6d1fe..3ae16eb9d6 100644 --- a/patches/server/0385-Villager-Restocks-API.patch +++ b/patches/server/0385-Villager-Restocks-API.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Villager Restocks API public net.minecraft.world.entity.npc.Villager numberOfRestocksToday diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java -index de8eec8d0294f2eb5ae73e060df9805758b9881d..0c92bbe9900a9d598ad90f2ba12808c776ba8f04 100644 +index 867c8ea8a8ce9f7cd326b3d1795139d321f729f9..ee0cad4f838429d6f06baf9e5177912556402b4a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java -@@ -91,6 +91,18 @@ public class CraftVillager extends CraftAbstractVillager implements Villager { +@@ -88,6 +88,18 @@ public class CraftVillager extends CraftAbstractVillager implements Villager { this.getHandle().setVillagerXp(experience); } diff --git a/patches/server/0387-Expose-game-version.patch b/patches/server/0387-Expose-game-version.patch index 5fd69af924..2945ebe8bb 100644 --- a/patches/server/0387-Expose-game-version.patch +++ b/patches/server/0387-Expose-game-version.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose game version diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index f87a6248a9e920d0e64d7971b0f056d06bc222e8..af3c77a26a054c65f2f17037879fc54ada478848 100644 +index 4824e9da8e4bc9f9eed3a36cf79e29470e6973bb..d881e3e2a7a324d2ee66bcb8c1f26a55e39c9db0 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -576,6 +576,13 @@ public final class CraftServer implements Server { +@@ -587,6 +587,13 @@ public final class CraftServer implements Server { return this.bukkitVersion; } diff --git a/patches/server/0390-misc-debugging-dumps.patch b/patches/server/0390-misc-debugging-dumps.patch index 8a66975bcd..d4d9b3638c 100644 --- a/patches/server/0390-misc-debugging-dumps.patch +++ b/patches/server/0390-misc-debugging-dumps.patch @@ -74,10 +74,10 @@ index 0c7f280bae81bbb492d5780a43e5ffda0f58756a..238a7bc87ab49da1f0fa3c733dd512fd this.connection.send(new ClientboundDisconnectPacket(ichatmutablecomponent)); this.connection.disconnect(ichatmutablecomponent); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index af3c77a26a054c65f2f17037879fc54ada478848..1b5197752992ed7c7a8ea6d01e5efa90347e8ddd 100644 +index d881e3e2a7a324d2ee66bcb8c1f26a55e39c9db0..41798e5cd7725c1c3a6673960837fc784aa9fd50 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1022,6 +1022,7 @@ public final class CraftServer implements Server { +@@ -1033,6 +1033,7 @@ public final class CraftServer implements Server { plugin.getDescription().getFullName(), "This plugin is not properly shutting down its async tasks when it is being reloaded. This may cause conflicts with the newly loaded version of the plugin" )); diff --git a/patches/server/0392-Deobfuscate-stacktraces-in-log-messages-crash-report.patch b/patches/server/0392-Deobfuscate-stacktraces-in-log-messages-crash-report.patch index 13212aa41d..b359a4890b 100644 --- a/patches/server/0392-Deobfuscate-stacktraces-in-log-messages-crash-report.patch +++ b/patches/server/0392-Deobfuscate-stacktraces-in-log-messages-crash-report.patch @@ -6,11 +6,11 @@ Subject: [PATCH] Deobfuscate stacktraces in log messages, crash reports, and diff --git a/build.gradle.kts b/build.gradle.kts -index 50de0801f88091b8e5587ef797fc2d5fd8621a54..4162d6a040a20a4ef8e1adb90f215a8d80fb48a3 100644 +index 3b94fe6373a8bb6ffb92a88bfd82bf005c6ebc1c..b9a0740989e17fe0edb8f1d227acc9ff039837c3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -29,6 +29,7 @@ dependencies { - testImplementation("org.mockito:mockito-core:4.9.0") // Paper - switch to mockito +@@ -28,6 +28,7 @@ dependencies { + implementation("org.ow2.asm:asm-commons:9.4") // Paper - ASM event executor generation implementation("org.spongepowered:configurate-yaml:4.1.2") // Paper - config files implementation("commons-lang:commons-lang:2.6") + implementation("net.fabricmc:mapping-io:0.3.0") // Paper - needed to read mappings for stacktrace deobfuscation @@ -508,7 +508,7 @@ index aaad6b0de19872c6e54591adf90c30d2c2ed5223..6a4c7783146ff6b6703e9ae814134a8d paperConfigurations.initializeWorldDefaultsConfiguration(); org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 2838e035204e95defce0d7488248b2e57bf71fab..e96890be7f03b7cc846fe850d4169e09b5d40eab 100644 +index a95cdeb41e8881ffb5daabfcc3294bac86612570..dd80c0a01293ef48b8f014d10bab6c7f6bbd103a 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -221,7 +221,9 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0393-Implement-Mob-Goal-API.patch b/patches/server/0393-Implement-Mob-Goal-API.patch index 13ff8a4c78..7d343bb628 100644 --- a/patches/server/0393-Implement-Mob-Goal-API.patch +++ b/patches/server/0393-Implement-Mob-Goal-API.patch @@ -5,17 +5,17 @@ Subject: [PATCH] Implement Mob Goal API diff --git a/build.gradle.kts b/build.gradle.kts -index 4162d6a040a20a4ef8e1adb90f215a8d80fb48a3..d63f6a46244b9dd133f12e9cfae16c8cf3b394da 100644 +index b9a0740989e17fe0edb8f1d227acc9ff039837c3..338d35cafb42dfc042bd9eb7a2c6303fc38f1208 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -38,6 +38,7 @@ dependencies { +@@ -37,6 +37,7 @@ dependencies { runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.10") runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.10") + testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test testImplementation("junit:junit:4.13.2") testImplementation("org.hamcrest:hamcrest-library:1.3") - + testImplementation("org.mockito:mockito-core:5.3.1") diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java new file mode 100644 index 0000000000000000000000000000000000000000..f80a6ad7638453348ee82ea00b166a3aac029142 @@ -792,10 +792,10 @@ index 4379b9948f1eecfe6fd7dea98e298ad5f761019a..3f081183521603824430709886a9cc31 LOOK, JUMP, diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 1b5197752992ed7c7a8ea6d01e5efa90347e8ddd..057a7df7daba35debe470116c28a5984e4e8132f 100644 +index 41798e5cd7725c1c3a6673960837fc784aa9fd50..9416fb00c24b68610e19ec573222bc048921c77f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2779,5 +2779,11 @@ public final class CraftServer implements Server { +@@ -2793,5 +2793,11 @@ public final class CraftServer implements Server { public boolean isStopping() { return net.minecraft.server.MinecraftServer.getServer().hasStopped(); } diff --git a/patches/server/0394-Add-villager-reputation-API.patch b/patches/server/0394-Add-villager-reputation-API.patch index 0b402ed019..17d69ffda9 100644 --- a/patches/server/0394-Add-villager-reputation-API.patch +++ b/patches/server/0394-Add-villager-reputation-API.patch @@ -57,10 +57,10 @@ index a28f359202e6502c6ea5e9c918ec0b3e9a3fca61..76dffb2705e5207db96895f82f1c7c56 static record GossipEntry(UUID target, GossipType type, int value) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java -index 0c92bbe9900a9d598ad90f2ba12808c776ba8f04..6f7977b492ce01e7cda7872c42bd7f2386d3e745 100644 +index ee0cad4f838429d6f06baf9e5177912556402b4a..c5f3ed36957d52120ad95f28e655e63bb0a50ff4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java -@@ -17,6 +17,13 @@ import org.bukkit.entity.Villager; +@@ -19,6 +19,13 @@ import org.bukkit.entity.Villager; import org.bukkit.entity.ZombieVillager; import org.bukkit.event.entity.CreatureSpawnEvent; @@ -74,9 +74,9 @@ index 0c92bbe9900a9d598ad90f2ba12808c776ba8f04..6f7977b492ce01e7cda7872c42bd7f23 public class CraftVillager extends CraftAbstractVillager implements Villager { public CraftVillager(CraftServer server, net.minecraft.world.entity.npc.Villager entity) { -@@ -146,4 +153,45 @@ public class CraftVillager extends CraftAbstractVillager implements Villager { - public static VillagerProfession bukkitToNmsProfession(Profession bukkit) { - return BuiltInRegistries.VILLAGER_PROFESSION.get(CraftNamespacedKey.toMinecraft(bukkit.getKey())); +@@ -313,4 +320,45 @@ public class CraftVillager extends CraftAbstractVillager implements Villager { + return this.getKey().hashCode(); + } } + + // Paper start - Add villager reputation API diff --git a/patches/server/0395-Option-for-maximum-exp-value-when-merging-orbs.patch b/patches/server/0395-Option-for-maximum-exp-value-when-merging-orbs.patch index d4ec4f243f..a8e0f807c6 100644 --- a/patches/server/0395-Option-for-maximum-exp-value-when-merging-orbs.patch +++ b/patches/server/0395-Option-for-maximum-exp-value-when-merging-orbs.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Option for maximum exp value when merging orbs diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index f9f9292a99bf35d49916e1380781cc9bc0e19842..e8532d35f8c3bf10e5c9c17839dbce2bf927ec77 100644 +index 595b707caed0d64ba86dda5330148e791db75247..e70e3955827edc0d4499d31c0509a03786a7f9b5 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -648,16 +648,30 @@ public class CraftEventFactory { +@@ -654,16 +654,30 @@ public class CraftEventFactory { net.minecraft.world.entity.ExperienceOrb xp = (net.minecraft.world.entity.ExperienceOrb) entity; double radius = world.spigotConfig.expMerge; if (radius > 0) { diff --git a/patches/server/0396-ExperienceOrbMergeEvent.patch b/patches/server/0396-ExperienceOrbMergeEvent.patch index a2a81f9fa5..7fdbc98a31 100644 --- a/patches/server/0396-ExperienceOrbMergeEvent.patch +++ b/patches/server/0396-ExperienceOrbMergeEvent.patch @@ -9,10 +9,10 @@ Plugins can cancel this if they want to ensure experience orbs do not lose impor metadata such as spawn reason, or conditionally move data from source to target. diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index e8532d35f8c3bf10e5c9c17839dbce2bf927ec77..f35cba8f45f96cd9504ccce73fea592532c36702 100644 +index e70e3955827edc0d4499d31c0509a03786a7f9b5..4f95a46178e075c382461f2891cd196173884c3a 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -658,7 +658,7 @@ public class CraftEventFactory { +@@ -664,7 +664,7 @@ public class CraftEventFactory { if (e instanceof net.minecraft.world.entity.ExperienceOrb) { net.minecraft.world.entity.ExperienceOrb loopItem = (net.minecraft.world.entity.ExperienceOrb) e; // Paper start diff --git a/patches/server/0397-Fix-PotionEffect-ignores-icon-flag.patch b/patches/server/0397-Fix-PotionEffect-ignores-icon-flag.patch index 296215abfc..08dbd93e59 100644 --- a/patches/server/0397-Fix-PotionEffect-ignores-icon-flag.patch +++ b/patches/server/0397-Fix-PotionEffect-ignores-icon-flag.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix PotionEffect ignores icon flag diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 6bf1b3a9ee029feafa054f40291078c79f28c5f4..2f6ba5525a014dfb3ce2efae765e501e8cd1c1c1 100644 +index e1fa2116b804e685b40117490824d36f6d12eb32..3ebc62033b0efe37c059553fe8327875fd10991e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -430,7 +430,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -433,7 +433,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @Override public boolean addPotionEffect(PotionEffect effect, boolean force) { diff --git a/patches/server/0399-Potential-bed-API.patch b/patches/server/0399-Potential-bed-API.patch index 7f753c1b92..065b64fd55 100644 --- a/patches/server/0399-Potential-bed-API.patch +++ b/patches/server/0399-Potential-bed-API.patch @@ -8,7 +8,7 @@ Adds a new method to fetch the location of a player's bed without generating any getPotentialBedLocation - Gets the last known location of a player's bed. This does not preform any check if the bed is still valid and does not load any chunks. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 82314358220b064a0f8a29cc1d663cc266c13916..55a3035516552f4d429ae5f36bacb1b4c4d5666c 100644 +index 99a8c0ef093e6383024dbe8c4b29876baabc10f1..90971adbe5bb15f42c1d59eb069fec40866f30b0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -12,6 +12,7 @@ import net.minecraft.nbt.CompoundTag; @@ -19,7 +19,7 @@ index 82314358220b064a0f8a29cc1d663cc266c13916..55a3035516552f4d429ae5f36bacb1b4 import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.MenuProvider; import net.minecraft.world.entity.Entity; -@@ -130,6 +131,22 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -132,6 +133,22 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { return this.getHandle().sleepCounter; } diff --git a/patches/server/0400-Wait-for-Async-Tasks-during-shutdown.patch b/patches/server/0400-Wait-for-Async-Tasks-during-shutdown.patch index fe1354b419..97368da43e 100644 --- a/patches/server/0400-Wait-for-Async-Tasks-during-shutdown.patch +++ b/patches/server/0400-Wait-for-Async-Tasks-during-shutdown.patch @@ -22,10 +22,10 @@ index f4ad35b55cacd5c1c3e4d81d4a9cf9675349ce79..53876c0d957e2d151e93744eff606060 // CraftBukkit end if (this.getConnection() != null) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 057a7df7daba35debe470116c28a5984e4e8132f..3062d9bc3582d7468000ec3b51bf47acfc628e71 100644 +index 9416fb00c24b68610e19ec573222bc048921c77f..880e47e609981af7613adf67dca0531325c157c6 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1032,6 +1032,31 @@ public final class CraftServer implements Server { +@@ -1043,6 +1043,31 @@ public final class CraftServer implements Server { org.spigotmc.WatchdogThread.hasStarted = true; // Paper - Disable watchdog early timeout on reload } diff --git a/patches/server/0415-Inventory-getHolder-method-without-block-snapshot.patch b/patches/server/0415-Inventory-getHolder-method-without-block-snapshot.patch index a15244c105..23bc84b171 100644 --- a/patches/server/0415-Inventory-getHolder-method-without-block-snapshot.patch +++ b/patches/server/0415-Inventory-getHolder-method-without-block-snapshot.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Inventory getHolder method without block snapshot diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java -index 7bdb2e52d36feb9e0ce517ae95f5edb28ddc67d6..01b38b5a515c7dd0f0c79141c270d618bf3c56eb 100644 +index f3ea4401a445eb5c327c886415da2c98f734df5a..481eefba58779a051bc20a13488e5d8ece497c75 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java -@@ -540,6 +540,13 @@ public class CraftInventory implements Inventory { +@@ -533,6 +533,13 @@ public class CraftInventory implements Inventory { return this.inventory.getOwner(); } diff --git a/patches/server/0416-Improve-Arrow-API.patch b/patches/server/0416-Improve-Arrow-API.patch index b2c31e3793..a6dc061557 100644 --- a/patches/server/0416-Improve-Arrow-API.patch +++ b/patches/server/0416-Improve-Arrow-API.patch @@ -9,10 +9,10 @@ to set the arrow's "noclip" status Co-authored-by: Jake Potrebic <[email protected]> diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java -index ce6291f2ccfb1ea3c069dd9f053446413894d743..d443b171191d150eed62d000a1079ede6bcf9052 100644 +index e734cdb23f6289ac1cf3494f8efd2cae0562657e..5056ec1ad51be9209591d34d32d256c350feed63 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java -@@ -100,6 +100,23 @@ public class CraftArrow extends AbstractProjectile implements AbstractArrow { +@@ -99,6 +99,23 @@ public class CraftArrow extends AbstractProjectile implements AbstractArrow { this.getHandle().pickup = net.minecraft.world.entity.projectile.AbstractArrow.Pickup.byOrdinal(status.ordinal()); } diff --git a/patches/server/0421-Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/patches/server/0421-Fix-Per-World-Difficulty-Remembering-Difficulty.patch index 1ac808bf27..5527cdd599 100644 --- a/patches/server/0421-Fix-Per-World-Difficulty-Remembering-Difficulty.patch +++ b/patches/server/0421-Fix-Per-World-Difficulty-Remembering-Difficulty.patch @@ -89,7 +89,7 @@ index 6dcac005b57234983d0ed05fe825a16c98eb4557..2040b2defecb484ee7b46a885e924483 playerlist.sendPlayerPermissionLevel(this); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index e6b53060aaf7c2b7ed8b24240be2bbe7cc962f67..a7429a2efb6100033552d5bf2d7731d1d5c6c7df 100644 +index 3d37208527e4a0605cdfc36fe82c0248b7d38b5c..8789032eb702c21b17108deafd78478fb726fbd4 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -3355,7 +3355,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -102,10 +102,10 @@ index e6b53060aaf7c2b7ed8b24240be2bbe7cc962f67..a7429a2efb6100033552d5bf2d7731d1 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 3062d9bc3582d7468000ec3b51bf47acfc628e71..7d6e44ca0a373ad1ee46bc1fc3162585cfa0d747 100644 +index 880e47e609981af7613adf67dca0531325c157c6..5e0bb9b286bc9a72b8774bba4eac1af16f6bcfb4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -971,8 +971,8 @@ public final class CraftServer implements Server { +@@ -982,8 +982,8 @@ public final class CraftServer implements Server { org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot this.console.paperConfigurations.reloadConfigs(this.console); for (ServerLevel world : this.console.getAllLevels()) { @@ -117,10 +117,10 @@ index 3062d9bc3582d7468000ec3b51bf47acfc628e71..7d6e44ca0a373ad1ee46bc1fc3162585 for (SpawnCategory spawnCategory : SpawnCategory.values()) { if (CraftSpawnCategory.isValidForLimits(spawnCategory)) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index e3308c3e93abf80022a16166c3cc522da8221f34..f186be0b65808247077f075c2a2d3af6daa40711 100644 +index 4fe7d86bdfe0adbe205c212f22db0f8daaf99075..ac8be0c09f7271d12730494e9bb6f334c1c85011 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1150,7 +1150,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1151,7 +1151,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setDifficulty(Difficulty difficulty) { diff --git a/patches/server/0425-Add-Plugin-Tickets-to-API-Chunk-Methods.patch b/patches/server/0425-Add-Plugin-Tickets-to-API-Chunk-Methods.patch index e01eace066..a75e78719d 100644 --- a/patches/server/0425-Add-Plugin-Tickets-to-API-Chunk-Methods.patch +++ b/patches/server/0425-Add-Plugin-Tickets-to-API-Chunk-Methods.patch @@ -22,10 +22,10 @@ wants it to collect even faster, they can restore that setting back to 1 instead Not adding it to .getType() though to keep behavior consistent with vanilla for performance reasons. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 7d6e44ca0a373ad1ee46bc1fc3162585cfa0d747..925079abb26fc658770c97961fb247e12b3bb216 100644 +index 5e0bb9b286bc9a72b8774bba4eac1af16f6bcfb4..0fe6965d870f091bfd78743b96fa27a11eb6ef92 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -376,7 +376,7 @@ public final class CraftServer implements Server { +@@ -370,7 +370,7 @@ public final class CraftServer implements Server { this.overrideSpawnLimits(); console.autosavePeriod = this.configuration.getInt("ticks-per.autosave"); this.warningState = WarningState.value(this.configuration.getString("settings.deprecated-verbose")); @@ -34,7 +34,7 @@ index 7d6e44ca0a373ad1ee46bc1fc3162585cfa0d747..925079abb26fc658770c97961fb247e1 this.minimumAPI = this.configuration.getString("settings.minimum-api"); this.loadIcon(); -@@ -951,7 +951,7 @@ public final class CraftServer implements Server { +@@ -962,7 +962,7 @@ public final class CraftServer implements Server { this.console.setMotd(config.motd); this.overrideSpawnLimits(); this.warningState = WarningState.value(this.configuration.getString("settings.deprecated-verbose")); @@ -44,10 +44,10 @@ index 7d6e44ca0a373ad1ee46bc1fc3162585cfa0d747..925079abb26fc658770c97961fb247e1 this.printSaveWarning = false; console.autosavePeriod = this.configuration.getInt("ticks-per.autosave"); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index f186be0b65808247077f075c2a2d3af6daa40711..c00a76408b6c800bf81b2de9565c95111940c365 100644 +index ac8be0c09f7271d12730494e9bb6f334c1c85011..66eda8e78d53307b75a8322ebd5c5495b46c8542 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -279,7 +279,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -280,7 +280,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public Chunk getChunkAt(int x, int z) { @@ -62,7 +62,7 @@ index f186be0b65808247077f075c2a2d3af6daa40711..c00a76408b6c800bf81b2de9565c9511 return new CraftChunk(chunk); } -@@ -293,6 +299,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -294,6 +300,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { return new CraftChunk(this.getHandle(), x, z); } @@ -75,7 +75,7 @@ index f186be0b65808247077f075c2a2d3af6daa40711..c00a76408b6c800bf81b2de9565c9511 @Override public Chunk getChunkAt(Block block) { Preconditions.checkArgument(block != null, "null block"); -@@ -358,7 +370,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -359,7 +371,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { public boolean unloadChunkRequest(int x, int z) { org.spigotmc.AsyncCatcher.catchOp("chunk unload"); // Spigot if (this.isChunkLoaded(x, z)) { @@ -84,7 +84,7 @@ index f186be0b65808247077f075c2a2d3af6daa40711..c00a76408b6c800bf81b2de9565c9511 } return true; -@@ -444,9 +456,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -445,9 +457,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot // Paper start - Optimize this method ChunkPos chunkPos = new ChunkPos(x, z); @@ -98,7 +98,7 @@ index f186be0b65808247077f075c2a2d3af6daa40711..c00a76408b6c800bf81b2de9565c9511 if (immediate == null) { immediate = world.getChunkSource().chunkMap.getUnloadingChunk(x, z); } -@@ -454,7 +469,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -455,7 +470,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { if (!(immediate instanceof ImposterProtoChunk) && !(immediate instanceof net.minecraft.world.level.chunk.LevelChunk)) { return false; // not full status } @@ -107,7 +107,7 @@ index f186be0b65808247077f075c2a2d3af6daa40711..c00a76408b6c800bf81b2de9565c9511 world.getChunk(x, z); // make sure we're at ticket level 32 or lower return true; } -@@ -480,7 +495,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -481,7 +496,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { // we do this so we do not re-read the chunk data on disk } @@ -116,7 +116,7 @@ index f186be0b65808247077f075c2a2d3af6daa40711..c00a76408b6c800bf81b2de9565c9511 world.getChunkSource().getChunk(x, z, ChunkStatus.FULL, true); return true; // Paper end -@@ -2208,6 +2223,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2203,6 +2218,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { io.papermc.paper.chunk.system.ChunkSystem.scheduleChunkLoad(this.getHandle(), x, z, gen, ChunkStatus.FULL, true, priority, (c) -> { net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(() -> { net.minecraft.world.level.chunk.LevelChunk chunk = (net.minecraft.world.level.chunk.LevelChunk)c; diff --git a/patches/server/0429-Convert-legacy-attributes-in-Item-Meta.patch b/patches/server/0429-Convert-legacy-attributes-in-Item-Meta.patch index c8376d2ce9..0563520207 100644 --- a/patches/server/0429-Convert-legacy-attributes-in-Item-Meta.patch +++ b/patches/server/0429-Convert-legacy-attributes-in-Item-Meta.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Convert legacy attributes in Item Meta diff --git a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java -index fac4097be2ee3d0bffbc92fb217f98831e78d6b3..233e372ba5d785352c9ac12dac37395bac63315c 100644 +index 00f671d49dc6ec3245bc56175a2258604c7e82e1..a5452d7ef38a4045995289a592ff8e467a1e9832 100644 --- a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java +++ b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java -@@ -12,6 +12,20 @@ import org.bukkit.craftbukkit.util.CraftNamespacedKey; +@@ -11,6 +11,20 @@ import org.bukkit.craftbukkit.util.CraftNamespacedKey; public class CraftAttributeMap implements Attributable { private final AttributeMap handle; @@ -30,10 +30,10 @@ index fac4097be2ee3d0bffbc92fb217f98831e78d6b3..233e372ba5d785352c9ac12dac37395b public CraftAttributeMap(AttributeMap handle) { this.handle = handle; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 7c803a928f41938c03b0239cf04e2ee765ecefb8..3d500e8be2478840669b236421c6908f8d288014 100644 +index aa978a43c5285d2b149f2e2c0f2af33a65ab9eef..5b444fc18e96b12ee4a45fd01bebbe1612ce6eaa 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -483,7 +483,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -488,7 +488,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { AttributeModifier attribMod = CraftAttributeInstance.convert(nmsModifier); diff --git a/patches/server/0432-Support-components-in-ItemMeta.patch b/patches/server/0432-Support-components-in-ItemMeta.patch index 45ae7502c3..41ee94d848 100644 --- a/patches/server/0432-Support-components-in-ItemMeta.patch +++ b/patches/server/0432-Support-components-in-ItemMeta.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Support components in ItemMeta diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 3d500e8be2478840669b236421c6908f8d288014..fa94030ac80c8c68ee429e6b7350395208e4348f 100644 +index 5b444fc18e96b12ee4a45fd01bebbe1612ce6eaa..ad6128ad7c48402a2415c6a12c867eac1a25cd4f 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -877,11 +877,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -882,11 +882,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { return CraftChatMessage.fromJSONComponent(displayName); } @@ -32,7 +32,7 @@ index 3d500e8be2478840669b236421c6908f8d288014..fa94030ac80c8c68ee429e6b73503952 @Override public boolean hasDisplayName() { return this.displayName != null; -@@ -1024,6 +1036,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1029,6 +1041,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { return this.lore == null ? null : new ArrayList<String>(Lists.transform(this.lore, CraftChatMessage::fromJSONComponent)); } @@ -47,7 +47,7 @@ index 3d500e8be2478840669b236421c6908f8d288014..fa94030ac80c8c68ee429e6b73503952 @Override public void setLore(List<String> lore) { if (lore == null || lore.isEmpty()) { -@@ -1038,6 +1058,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1043,6 +1063,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } } @@ -69,7 +69,7 @@ index 3d500e8be2478840669b236421c6908f8d288014..fa94030ac80c8c68ee429e6b73503952 @Override public boolean hasCustomModelData() { return this.customModelData != null; -@@ -1506,6 +1541,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1511,6 +1546,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } for (Object object : addFrom) { diff --git a/patches/server/0434-Add-entity-liquid-API.patch b/patches/server/0434-Add-entity-liquid-API.patch index b9499300da..489fb72e6c 100644 --- a/patches/server/0434-Add-entity-liquid-API.patch +++ b/patches/server/0434-Add-entity-liquid-API.patch @@ -8,10 +8,10 @@ public net.minecraft.world.entity.Entity isInRain()Z public net.minecraft.world.entity.Entity isInBubbleColumn()Z diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index e237320b2703a1281fab47f24516e8b7d83677be..c480cddf693ec9f42b0e8a8aec3cc7828e337312 100644 +index 8b48c0379d395f1e5a2e5ac90a9bb50e26649a71..ab20f96f545871da8928e026f8bbffae9f56213a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1301,5 +1301,40 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1316,5 +1316,40 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { public org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason getEntitySpawnReason() { return getHandle().spawnReason; } diff --git a/patches/server/0437-Add-PrepareResultEvent.patch b/patches/server/0437-Add-PrepareResultEvent.patch index b01a35ac4d..54f5277f96 100644 --- a/patches/server/0437-Add-PrepareResultEvent.patch +++ b/patches/server/0437-Add-PrepareResultEvent.patch @@ -94,10 +94,10 @@ index 8734a129244271b370f965fcbf488a14ce04684a..00f01ab2eff69c18b50ec07b7623af66 private void setupRecipeList(Container input, ItemStack stack) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index f35cba8f45f96cd9504ccce73fea592532c36702..019a486f40256771341358509a5abe0b1284d248 100644 +index 4f95a46178e075c382461f2891cd196173884c3a..bd73ed0c807efd6897f76f04d34222ff95eec84e 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1628,26 +1628,53 @@ public class CraftEventFactory { +@@ -1617,26 +1617,53 @@ public class CraftEventFactory { return event; } diff --git a/patches/server/0449-Brand-support.patch b/patches/server/0449-Brand-support.patch index 76eab8e1b7..43be58680f 100644 --- a/patches/server/0449-Brand-support.patch +++ b/patches/server/0449-Brand-support.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Brand support diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index a7429a2efb6100033552d5bf2d7731d1d5c6c7df..5fb375ac652029441147ffefd3305683288ee058 100644 +index 8789032eb702c21b17108deafd78478fb726fbd4..b72e6df4cfc0426577b52cf495f0373c7ceecd02 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -302,6 +302,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -56,10 +56,10 @@ index a7429a2efb6100033552d5bf2d7731d1d5c6c7df..5fb375ac652029441147ffefd3305683 return (!this.player.joining && !this.connection.isConnected()) || this.processedDisconnect; // Paper } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 97e19221920e2ba26432a0d6d78aceff48f8e082..7eb629519f1604d76a20c9ac468b8e2697980de4 100644 +index 512cb47af9fecd23db6c6e0e2e1d0990965b937f..c21710e895fc614d06f2de6dbfa60c1571c157f8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2912,6 +2912,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2930,6 +2930,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Paper end }; diff --git a/patches/server/0450-Add-playPickupItemAnimation-to-LivingEntity.patch b/patches/server/0450-Add-playPickupItemAnimation-to-LivingEntity.patch index c2a653b423..873e8ffb7e 100644 --- a/patches/server/0450-Add-playPickupItemAnimation-to-LivingEntity.patch +++ b/patches/server/0450-Add-playPickupItemAnimation-to-LivingEntity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add playPickupItemAnimation to LivingEntity diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 2f6ba5525a014dfb3ce2efae765e501e8cd1c1c1..97286605e33436f3e4a7b7ad319d2b2870d7029a 100644 +index 3ebc62033b0efe37c059553fe8327875fd10991e..3e6c63b5c2a572fb1a28ac3ef1aa928b5a5a635e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -898,5 +898,10 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -896,5 +896,10 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { ((Mob) getHandle()).getJumpControl().jump(); } } diff --git a/patches/server/0452-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch b/patches/server/0452-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch index f2e60fe1de..341dab8aae 100644 --- a/patches/server/0452-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch +++ b/patches/server/0452-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix SpawnChangeEvent not firing for all use-cases diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 02ba7e25c649832aba2e742cb76be9d2b6b6f954..babc90ed1a85756545ac2b7631853d09f37125f2 100644 +index bdb52878b76fab516162f421db2d898c3b3fa012..c12384bf1838fafe71085fe61270182ccb7a8369 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -2003,9 +2003,11 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -21,10 +21,10 @@ index 02ba7e25c649832aba2e742cb76be9d2b6b6f954..babc90ed1a85756545ac2b7631853d09 // if this keepSpawnInMemory is false a plugin has already removed our tickets, do not re-add this.removeTicketsForSpawn(this.paperConfig().spawn.keepSpawnLoadedRange * 16, prevSpawn); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index c00a76408b6c800bf81b2de9565c95111940c365..133a5b30b4cdca091f7eae9fccc5bb7d03ace432 100644 +index 66eda8e78d53307b75a8322ebd5c5495b46c8542..5b97101be2fa04cc2482151766578675c85ee457 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -259,12 +259,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -260,12 +260,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public boolean setSpawnLocation(int x, int y, int z, float angle) { try { diff --git a/patches/server/0453-Add-moon-phase-API.patch b/patches/server/0453-Add-moon-phase-API.patch index 4fb9522173..a6ddfe47f9 100644 --- a/patches/server/0453-Add-moon-phase-API.patch +++ b/patches/server/0453-Add-moon-phase-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add moon phase API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -index bdc752631136a4abe903e7a8f182e9eda480fcb6..a9cad569f9c71f9818d1b831983f71aae367d98e 100644 +index 177d58dca134ee590af9cfd1fb427aa7eed7d4b3..f302d936057a56629c4b9edaaffb996191b102c9 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -@@ -980,4 +980,11 @@ public abstract class CraftRegionAccessor implements RegionAccessor { +@@ -982,4 +982,11 @@ public abstract class CraftRegionAccessor implements RegionAccessor { throw new IllegalArgumentException("Cannot spawn an entity for " + clazz.getName()); } diff --git a/patches/server/0455-Add-BellRingEvent.patch b/patches/server/0455-Add-BellRingEvent.patch index f9865e6e0b..916b5066c5 100644 --- a/patches/server/0455-Add-BellRingEvent.patch +++ b/patches/server/0455-Add-BellRingEvent.patch @@ -7,10 +7,10 @@ Add a new event, BellRingEvent, to trigger whenever a player rings a village bell. Passes along the bell block and the player who rang it. diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 019a486f40256771341358509a5abe0b1284d248..9761302bb1ca66242ae46d26001837dd881cb9fa 100644 +index bd73ed0c807efd6897f76f04d34222ff95eec84e..75ac4dcf5552341cb6018788f4fea5a72c782d44 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -332,10 +332,11 @@ public class CraftEventFactory { +@@ -338,10 +338,11 @@ public class CraftEventFactory { return tradeSelectEvent; } diff --git a/patches/server/0461-Add-more-Evoker-API.patch b/patches/server/0461-Add-more-Evoker-API.patch index 0fce1f166a..742d85985e 100644 --- a/patches/server/0461-Add-more-Evoker-API.patch +++ b/patches/server/0461-Add-more-Evoker-API.patch @@ -8,7 +8,7 @@ public net.minecraft.world.entity.monster.Evoker setWololoTarget(Lnet/minecraft/ public net.minecraft.world.entity.monster.Evoker getWololoTarget()Lnet/minecraft/world/entity/animal/Sheep; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java -index 91d07e6996e315734689ea25336992b0ed21cf25..7e861636710aa44ed36e7f20c6320dabb809c35d 100644 +index 93ffe2ac37b03aa289881f5f12c7aa7f1d835eda..b66dd5c5c5d98c9285e0d0a4ad4b99a66419f732 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java @@ -1,5 +1,6 @@ @@ -17,8 +17,8 @@ index 91d07e6996e315734689ea25336992b0ed21cf25..7e861636710aa44ed36e7f20c6320dab +import net.minecraft.world.entity.animal.Sheep; import net.minecraft.world.entity.monster.SpellcasterIllager; import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.entity.EntityType; -@@ -35,4 +36,17 @@ public class CraftEvoker extends CraftSpellcaster implements Evoker { + import org.bukkit.entity.Evoker; +@@ -29,4 +30,17 @@ public class CraftEvoker extends CraftSpellcaster implements Evoker { public void setCurrentSpell(Evoker.Spell spell) { this.getHandle().setIsCastingSpell(spell == null ? SpellcasterIllager.IllagerSpell.NONE : SpellcasterIllager.IllagerSpell.byId(spell.ordinal())); } diff --git a/patches/server/0462-Add-methods-to-get-translation-keys.patch b/patches/server/0462-Add-methods-to-get-translation-keys.patch index f0730a4081..ebd5b42fc6 100644 --- a/patches/server/0462-Add-methods-to-get-translation-keys.patch +++ b/patches/server/0462-Add-methods-to-get-translation-keys.patch @@ -9,11 +9,58 @@ public org.bukkit.craftbukkit.inventory.CraftMetaFirework getNBT(Lorg/bukkit/Fir Co-authored-by: MeFisto94 <[email protected]> +diff --git a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttribute.java b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttribute.java +index 6ceb36931b98b4e205ac52211cfbae4337a4ff45..0571224316424980b726cdf1d5bbc25115975c94 100644 +--- a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttribute.java ++++ b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttribute.java +@@ -72,6 +72,13 @@ public class CraftAttribute extends Attribute { + return this.ordinal; + } + ++ // Paper start - translation key ++ @Override ++ public String translationKey() { ++ return this.attributeBase.getDescriptionId(); ++ } ++ // Paper end ++ + @Override + public String toString() { + // For backwards compatibility +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBiome.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBiome.java +index b350c4e30927bf020784f0fe39850f10e0fd9133..9cc5234409bdf71f3dbbf3947f365ce86634ade3 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBiome.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBiome.java +@@ -43,6 +43,7 @@ public class CraftBiome extends Biome { + private final net.minecraft.world.level.biome.Biome biome; + private final String name; + private final int ordinal; ++ private final net.minecraft.resources.ResourceLocation resourceLocation; // Paper + + public CraftBiome(NamespacedKey key, net.minecraft.world.level.biome.Biome biome) { + this.key = key; +@@ -57,8 +58,16 @@ public class CraftBiome extends Biome { + this.name = key.toString(); + } + this.ordinal = CraftBiome.count++; ++ this.resourceLocation = CraftNamespacedKey.toMinecraft(this.key); // Paper + } + ++ // Paper start - translation keys ++ @Override ++ public String translationKey() { ++ return this.resourceLocation.toLanguageKey("biome"); ++ } ++ // Paper end ++ + public net.minecraft.world.level.biome.Biome getHandle() { + return this.biome; + } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index 5534348ddb3ac42b6b8a687816c2c8c1858e3b3e..d2d5a43cfdf294ccc9353258250f5a990e205b88 100644 +index c5e98a0147e6eed86fc02e8681d8b476ca8f13f6..16cec4f1dc9020074576a3c5fff95580520377f8 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -@@ -694,5 +694,10 @@ public class CraftBlock implements Block { +@@ -668,5 +668,10 @@ public class CraftBlock implements Block { public org.bukkit.SoundGroup getBlockSoundGroup() { return org.bukkit.craftbukkit.CraftSoundGroup.getSoundGroup(this.getNMS().getSoundType()); } @@ -24,11 +71,27 @@ index 5534348ddb3ac42b6b8a687816c2c8c1858e3b3e..d2d5a43cfdf294ccc9353258250f5a99 + } // Paper end } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockType.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockType.java +index fab5edd8e40bb8dc4923034ee46528356334431b..719273eeaab49570ef7efd5197c2f241a875e434 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockType.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockType.java +@@ -168,4 +168,11 @@ public class CraftBlockType<B extends BlockData> implements BlockType<B> { + public NamespacedKey getKey() { + return this.key; + } ++ ++ // Paper start - translation key ++ @Override ++ public String translationKey() { ++ return this.block.getDescriptionId(); ++ } ++ // Paper end + } diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java -index e8334e2264510f5101e80b4f130e7ae1442560d7..57decf4156f176ebcc988478c17856cbc555c5e4 100644 +index 62b75098ae26cbcc331d3b23940b7da46ccf2cfe..92cecdae6a4ab7c2876a42c7128453948a5a249a 100644 --- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java +++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java -@@ -194,6 +194,11 @@ public class CraftEnchantment extends Enchantment { +@@ -122,6 +122,11 @@ public class CraftEnchantment extends Enchantment { public net.kyori.adventure.text.Component displayName(int level) { return io.papermc.paper.adventure.PaperAdventure.asAdventure(getHandle().getFullname(level)); } @@ -40,8 +103,60 @@ index e8334e2264510f5101e80b4f130e7ae1442560d7..57decf4156f176ebcc988478c17856cb // Paper end public net.minecraft.world.item.enchantment.Enchantment getHandle() { +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityType.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityType.java +index fbd436df49b2a5d356ba84a94828eb1bc2cd7d1b..33be9fa46c3bdb4958b32d30c730ceff075aaaea 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityType.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityType.java +@@ -157,6 +157,13 @@ public class CraftEntityType<E extends Entity> extends EntityType<E> { + return this.entityType.getDescriptionId(); + } + ++ // Paper start - translation key ++ @Override ++ public String translationKey() { ++ return this.entityType.getDescriptionId(); ++ } ++ // Paper end ++ + public static class CraftEntityTypeRegistry extends CraftRegistry<EntityType<?>, net.minecraft.world.entity.EntityType<?>> { + private static final Map<NamespacedKey, Class<? extends Entity>> CLASS_MAP = new HashMap<>(); + private static final Map<NamespacedKey, Boolean> SPAWNABLE = new HashMap<>(); +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java +index c5f3ed36957d52120ad95f28e655e63bb0a50ff4..eeca610110a058d704b72674e0f2df72982ca039 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java +@@ -281,6 +281,13 @@ public class CraftVillager extends CraftAbstractVillager implements Villager { + return this.key; + } + ++ // Paper start - translation key ++ @Override ++ public String translationKey() { ++ return net.minecraft.world.entity.EntityType.VILLAGER.getDescriptionId() + "." + this.key().value(); ++ } ++ // Paper end ++ + @Override + public int compareTo(Profession profession) { + return this.ordinal - profession.ordinal(); +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java +index e540f986a0da8002e669e9f1885ba601be3d1371..49be8074280d9840bb3d8e6880b4e0a8aa4ef0cb 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java +@@ -135,4 +135,11 @@ public class CraftItemType implements ItemType { + public NamespacedKey getKey() { + return this.key; + } ++ ++ // Paper start - translation key ++ @Override ++ public String translationKey() { ++ return this.item.getDescriptionId(); ++ } ++ // Paper end + } diff --git a/src/test/java/io/papermc/paper/world/TranslationKeyTest.java b/src/test/java/io/papermc/paper/world/TranslationKeyTest.java -index fab3063fffa959ac7f0eb5937f2fae94d11b6591..4cc8ca5dd95e9cccd08ada057a9592a1421f434a 100644 +index fab3063fffa959ac7f0eb5937f2fae94d11b6591..daef5db580c6182ca10a5950eb1d4fb647910e63 100644 --- a/src/test/java/io/papermc/paper/world/TranslationKeyTest.java +++ b/src/test/java/io/papermc/paper/world/TranslationKeyTest.java @@ -1,12 +1,23 @@ @@ -91,7 +206,7 @@ index fab3063fffa959ac7f0eb5937f2fae94d11b6591..4cc8ca5dd95e9cccd08ada057a9592a1 + @Test + public void testAttributeKeys() { + for (Attribute attribute : Attribute.values()) { -+ Assert.assertEquals("translation key mismatch for " + attribute, org.bukkit.craftbukkit.attribute.CraftAttributeMap.toMinecraft(attribute).getDescriptionId(), attribute.translationKey()); ++ Assert.assertEquals("translation key mismatch for " + attribute, org.bukkit.craftbukkit.attribute.CraftAttribute.bukkitToMinecraft(attribute).getDescriptionId(), attribute.translationKey()); + } + } + diff --git a/patches/server/0463-Create-HoverEvent-from-ItemStack-Entity.patch b/patches/server/0463-Create-HoverEvent-from-ItemStack-Entity.patch index 042efb92e7..bf6e7df7c0 100644 --- a/patches/server/0463-Create-HoverEvent-from-ItemStack-Entity.patch +++ b/patches/server/0463-Create-HoverEvent-from-ItemStack-Entity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Create HoverEvent from ItemStack Entity diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index f8475390d69bef6f3eca5a57d5f44021fabf4942..21f5c0f2fc10b5f5752e214a08e858227bdcf2ce 100644 +index 161de8a7c1d3e6c7918a0f313c7df9719c14e672..532da796231f4ea3a6d5e32c848fa07732977483 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -468,5 +468,40 @@ public final class CraftItemFactory implements ItemFactory { +@@ -316,5 +316,40 @@ public final class CraftItemFactory implements ItemFactory { return nms != null ? net.minecraft.locale.Language.getInstance().getOrDefault(nms.getItem().getDescriptionId(nms)) : null; } diff --git a/patches/server/0464-Cache-block-data-strings.patch b/patches/server/0464-Cache-block-data-strings.patch index 2e4525b8b8..b08fc592df 100644 --- a/patches/server/0464-Cache-block-data-strings.patch +++ b/patches/server/0464-Cache-block-data-strings.patch @@ -17,10 +17,10 @@ index 56e98ea2964c2779537ac607b7c4677bc695d92a..0ed8add0a2acec7d109f9687b7d77967 if (this.isSameThread()) { diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -index c80aaa37b7d63acfb283641a4804dc2a32156eda..68dc8455427b6e3f60a4472db3a625028c413561 100644 +index 5af27d3ff909c62f50ec8a30f7c7b11b3579807a..2e898658548d350f850dc83295d5785269ce72e8 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -@@ -527,9 +527,39 @@ public class CraftBlockData implements BlockData { +@@ -530,7 +530,35 @@ public class CraftBlockData implements BlockData { Preconditions.checkState(CraftBlockData.MAP.put(nms, bukkit) == null, "Duplicate mapping %s->%s", nms, bukkit); } @@ -39,24 +39,20 @@ index c80aaa37b7d63acfb283641a4804dc2a32156eda..68dc8455427b6e3f60a4472db3a62502 + } + // Paper end + - public static CraftBlockData newData(Material material, String data) { - Preconditions.checkArgument(material == null || material.isBlock(), "Cannot get data for not block %s", material); - + public static <B extends BlockData> B newData(BlockType<B> blockType, String data) { + // Paper start - cache block data strings -+ if (material != null) { -+ Block block = CraftMagicNumbers.getBlock(material); -+ if (block != null) { -+ net.minecraft.resources.ResourceLocation key = BuiltInRegistries.BLOCK.getKey(block); -+ data = data == null ? key.toString() : key + data; -+ } ++ if (blockType != null) { ++ Block block = ((CraftBlockType<B>) blockType).getHandle(); ++ net.minecraft.resources.ResourceLocation key = net.minecraft.core.registries.BuiltInRegistries.BLOCK.getKey(block); ++ data = data == null ? key.toString() : key + data; + } + + CraftBlockData cached = stringDataCache.computeIfAbsent(data, s -> createNewData(null, s)); -+ return (CraftBlockData) cached.clone(); ++ return (B) cached.clone(); + } + -+ private static CraftBlockData createNewData(Material material, String data) { ++ private static <B extends BlockData> B createNewData(BlockType<B> blockType, String data) { + // Paper end - cache block data strings net.minecraft.world.level.block.state.BlockState blockData; - Block block = CraftMagicNumbers.getBlock(material); + Block block = blockType != null ? ((CraftBlockType<B>) blockType).getHandle() : null; Map<Property<?>, Comparable<?>> parsed = null; diff --git a/patches/server/0465-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch b/patches/server/0465-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch index 63f17d8950..feae3c7f54 100644 --- a/patches/server/0465-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch +++ b/patches/server/0465-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch @@ -9,7 +9,7 @@ as this is how Vanilla teleports entities. Cancel any pending motion when teleported. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 5fb375ac652029441147ffefd3305683288ee058..7248010828b361425a83da7671deac27b4504ccd 100644 +index b72e6df4cfc0426577b52cf495f0373c7ceecd02..e46c245801943b95f1477a2e53be5571efa63d91 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -760,7 +760,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -69,10 +69,10 @@ index 369298dfd437c1c83801f3d4ba63484ee1b969fe..ae2b95f53e875716489821dc9b0a3a35 if (entity instanceof Mob) { Mob entityinsentient = (Mob) entity; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index c480cddf693ec9f42b0e8a8aec3cc7828e337312..4002311a4f8a0b137f743a0a1ded52587719765b 100644 +index ab20f96f545871da8928e026f8bbffae9f56213a..85f02e1e080eb5b05061afcf73dac659619d9673 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -574,7 +574,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -580,7 +580,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { } // entity.setLocation() throws no event, and so cannot be cancelled diff --git a/patches/server/0466-Add-additional-open-container-api-to-HumanEntity.patch b/patches/server/0466-Add-additional-open-container-api-to-HumanEntity.patch index 18fdf7d704..4861ad7c90 100644 --- a/patches/server/0466-Add-additional-open-container-api-to-HumanEntity.patch +++ b/patches/server/0466-Add-additional-open-container-api-to-HumanEntity.patch @@ -5,70 +5,70 @@ Subject: [PATCH] Add additional open container api to HumanEntity diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 55a3035516552f4d429ae5f36bacb1b4c4d5666c..b0d2038cf2622c8ee7f810026ed735ff954d7ad0 100644 +index 90971adbe5bb15f42c1d59eb069fec40866f30b0..96016906ec745c5f806161edcfe3caad53fc8381 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -461,6 +461,70 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -463,6 +463,70 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { return this.getHandle().containerMenu.getBukkitView(); } + // Paper start - Add additional containers + @Override + public InventoryView openAnvil(Location location, boolean force) { -+ return this.openInventory(location, force, Material.ANVIL); ++ return this.openInventory(location, force, BlockType.ANVIL); + } + + @Override + public InventoryView openCartographyTable(Location location, boolean force) { -+ return this.openInventory(location, force, Material.CARTOGRAPHY_TABLE); ++ return this.openInventory(location, force, BlockType.CARTOGRAPHY_TABLE); + } + + @Override + public InventoryView openGrindstone(Location location, boolean force) { -+ return this.openInventory(location, force, Material.GRINDSTONE); ++ return this.openInventory(location, force, BlockType.GRINDSTONE); + } + + @Override + public InventoryView openLoom(Location location, boolean force) { -+ return this.openInventory(location, force, Material.LOOM); ++ return this.openInventory(location, force, BlockType.LOOM); + } + + @Override + public InventoryView openSmithingTable(Location location, boolean force) { -+ return this.openInventory(location, force, Material.SMITHING_TABLE); ++ return this.openInventory(location, force, BlockType.SMITHING_TABLE); + } + + @Override + public InventoryView openStonecutter(Location location, boolean force) { -+ return this.openInventory(location, force, Material.STONECUTTER); ++ return this.openInventory(location, force, BlockType.STONECUTTER); + } + -+ private InventoryView openInventory(Location location, boolean force, Material material) { -+ org.spigotmc.AsyncCatcher.catchOp("open" + material); ++ private InventoryView openInventory(Location location, boolean force, BlockType<?> blockType) { ++ org.spigotmc.AsyncCatcher.catchOp("open" + blockType); + if (location == null) { + location = this.getLocation(); + } + if (!force) { + Block block = location.getBlock(); -+ if (block.getType() != material) { ++ if (block.getType() != blockType) { + return null; + } + } + net.minecraft.world.level.block.Block block; -+ if (material == Material.ANVIL) { ++ if (blockType == BlockType.ANVIL) { + block = Blocks.ANVIL; -+ } else if (material == Material.CARTOGRAPHY_TABLE) { ++ } else if (blockType == BlockType.CARTOGRAPHY_TABLE) { + block = Blocks.CARTOGRAPHY_TABLE; -+ } else if (material == Material.GRINDSTONE) { ++ } else if (blockType == BlockType.GRINDSTONE) { + block = Blocks.GRINDSTONE; -+ } else if (material == Material.LOOM) { ++ } else if (blockType == BlockType.LOOM) { + block = Blocks.LOOM; -+ } else if (material == Material.SMITHING_TABLE) { ++ } else if (blockType == BlockType.SMITHING_TABLE) { + block = Blocks.SMITHING_TABLE; -+ } else if (material == Material.STONECUTTER) { ++ } else if (blockType == BlockType.STONECUTTER) { + block = Blocks.STONECUTTER; + } else { -+ throw new IllegalArgumentException("Unsupported inventory type: " + material); ++ throw new IllegalArgumentException("Unsupported inventory type: " + blockType); + } + this.getHandle().openMenu(block.getMenuProvider(null, this.getHandle().level(), new BlockPos(location.getBlockX(), location.getBlockY(), location.getBlockZ()))); + this.getHandle().containerMenu.checkReachable = !force; diff --git a/patches/server/0469-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch b/patches/server/0469-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch index f761190a9f..43d8351dc7 100644 --- a/patches/server/0469-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch +++ b/patches/server/0469-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch @@ -21,10 +21,10 @@ index 11675a7611a42277ed0625509aa98a2f69611698..bda94c9c34c7f1f6b56103de5be253c6 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 173d17adb76f5f08828048236f544d25f53152ea..6c6587c775162655581bd09e5eb7cc2d7fb8f782 100644 +index 34555953d4252ef4c61d6901a9d33e2eded0f404..e74459da98dfa5bf790629e450ed51d1f97f8d34 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -512,6 +512,11 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -571,6 +571,11 @@ public final class CraftMagicNumbers implements UnsafeValues { Preconditions.checkArgument(dataVersion <= getDataVersion(), "Newer version! Server downgrades are not supported!"); return compound; } diff --git a/patches/server/0471-Entity-isTicking.patch b/patches/server/0471-Entity-isTicking.patch index b0c393fba7..f48ba80b9c 100644 --- a/patches/server/0471-Entity-isTicking.patch +++ b/patches/server/0471-Entity-isTicking.patch @@ -19,10 +19,10 @@ index bda94c9c34c7f1f6b56103de5be253c619b576b2..30c955cb8b1cb767e62964fea897870a // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 4002311a4f8a0b137f743a0a1ded52587719765b..702987ef563db2e0819771e8c3be822e4644ee3f 100644 +index 85f02e1e080eb5b05061afcf73dac659619d9673..c3ddbc8a124f5e82d3a4d5120724f3ee9265b3b8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1336,5 +1336,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1351,5 +1351,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { public boolean isInLava() { return getHandle().isInLava(); } diff --git a/patches/server/0476-Optimise-getType-calls.patch b/patches/server/0476-Optimise-getType-calls.patch index d135865cc4..a34ee27ed9 100644 --- a/patches/server/0476-Optimise-getType-calls.patch +++ b/patches/server/0476-Optimise-getType-calls.patch @@ -6,89 +6,90 @@ Subject: [PATCH] Optimise getType calls Remove the map lookup for converting from Block->Bukkit Material diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockState.java b/src/main/java/net/minecraft/world/level/block/state/BlockState.java -index da878e180c6b94f98dc82c6e8395f63ecc9b2c1e..a9b0f5950b6f97ea4c2a1075946b92008b62c9d9 100644 +index da878e180c6b94f98dc82c6e8395f63ecc9b2c1e..a376a8fa1dc6ab49140ed5291bd1567aa009899c 100644 --- a/src/main/java/net/minecraft/world/level/block/state/BlockState.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockState.java -@@ -10,6 +10,17 @@ import net.minecraft.world.level.block.state.properties.Property; +@@ -10,6 +10,18 @@ import net.minecraft.world.level.block.state.properties.Property; public class BlockState extends BlockBehaviour.BlockStateBase { public static final Codec<BlockState> CODEC = codec(BuiltInRegistries.BLOCK.byNameCodec(), Block::defaultBlockState).stable(); + // Paper start - optimise getType calls -+ org.bukkit.Material cachedMaterial; ++ @javax.annotation.Nullable ++ org.bukkit.block.BlockType<?> cachedBlockType; + -+ public final org.bukkit.Material getBukkitMaterial() { -+ if (this.cachedMaterial == null) { -+ this.cachedMaterial = org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(this.getBlock()); ++ public final org.bukkit.block.BlockType<?> getBukkitBlockType() { ++ if (this.cachedBlockType == null) { ++ this.cachedBlockType = org.bukkit.craftbukkit.block.CraftBlockType.minecraftToBukkit(this.getBlock()); + } + -+ return this.cachedMaterial; ++ return this.cachedBlockType; + } + // Paper end - optimise getType calls public BlockState(Block block, ImmutableMap<Property<?>, Comparable<?>> propertyMap, MapCodec<BlockState> codec) { super(block, propertyMap, codec); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java b/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java -index eebac2ea211f58c385b2ceb36ab911ac5e115296..d1aaca5de055fd5e3bf2c6d39ef397bbb2deeaae 100644 +index cc9ea858749bfdb947390aa806ddabaf0642bc1c..5776c88ebd206bf96ee7728e01aeaa5ca8380497 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java -@@ -98,7 +98,7 @@ public class CraftChunkSnapshot implements ChunkSnapshot { - public Material getBlockType(int x, int y, int z) { +@@ -99,7 +99,7 @@ public class CraftChunkSnapshot implements ChunkSnapshot { + public BlockType<?> getBlockType(int x, int y, int z) { this.validateChunkCoordinates(x, y, z); -- return CraftMagicNumbers.getMaterial(this.blockids[this.getSectionIndex(y)].get(x, y & 0xF, z).getBlock()); -+ return this.blockids[this.getSectionIndex(y)].get(x, y & 0xF, z).getBukkitMaterial(); // Paper - optimise getType calls +- return CraftBlockType.minecraftToBukkit(this.blockids[this.getSectionIndex(y)].get(x, y & 0xF, z).getBlock()); ++ return this.blockids[this.getSectionIndex(y)].get(x, y & 0xF, z).getBukkitBlockType(); // Paper - optimise getType calls } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index d2d5a43cfdf294ccc9353258250f5a990e205b88..2749f81fd74e466fa6b7c1c5f08d8defc5203b3e 100644 +index 16cec4f1dc9020074576a3c5fff95580520377f8..8cc60850dab635a2133523ea41cf072094a38cb6 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -@@ -224,7 +224,7 @@ public class CraftBlock implements Block { +@@ -219,7 +219,7 @@ public class CraftBlock implements Block { @Override - public Material getType() { -- return CraftMagicNumbers.getMaterial(this.world.getBlockState(position).getBlock()); -+ return this.world.getBlockState(this.position).getBukkitMaterial(); // Paper - optimise getType calls + public BlockType<?> getType() { +- return CraftBlockType.minecraftToBukkit(this.world.getBlockState(position).getBlock()); ++ return this.world.getBlockState(this.position).getBukkitBlockType(); // Paper - optimise getType calls } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java -index 2773f47d4e7a9432ab1ccebfcdc22317ef762099..b722a207c0e745bb172d93b90e1241d7bfa173ce 100644 +index a49f21647ffb44982e7ca774c2338799e518d3e3..445838ee0ffdc6551e125de190abb91011f467b7 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java @@ -161,7 +161,7 @@ public class CraftBlockState implements BlockState { @Override - public Material getType() { -- return CraftMagicNumbers.getMaterial(this.data.getBlock()); -+ return this.data.getBukkitMaterial(); // Paper - optimise getType calls + public BlockType<?> getType() { +- return CraftBlockType.minecraftToBukkit(this.data.getBlock()); ++ return this.data.getBukkitBlockType(); // Paper - optimise getType calls } public void setFlag(int flag) { diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -index 68dc8455427b6e3f60a4472db3a625028c413561..68ffdb2140bdf8d00ed86db19d316735d9a6b2d1 100644 +index 2e898658548d350f850dc83295d5785269ce72e8..466b9a4363199e1b5535bb712f4de911cdfd26d3 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -@@ -59,7 +59,7 @@ public class CraftBlockData implements BlockData { +@@ -62,7 +62,7 @@ public class CraftBlockData implements BlockData { @Override - public Material getMaterial() { -- return CraftMagicNumbers.getMaterial(this.state.getBlock()); -+ return this.state.getBukkitMaterial(); // Paper - optimise getType calls + public BlockType<?> getBlockType() { +- return CraftBlockType.minecraftToBukkit(this.state.getBlock()); ++ return this.state.getBukkitBlockType(); // Paper - optimise getType calls } public net.minecraft.world.level.block.state.BlockState getState() { diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java b/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java -index 79b6f88a32ea5eaf77757b8cc3824b6dac1558a7..7bfb9bc9689c5d9899b572862f3fbe53812f36b1 100644 +index a6ae6a5f293960bf7a11af285da2f623836cf9af..1dd1de6b8fb57e7e19c7b53638916d3dacfc6a91 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java -@@ -95,7 +95,7 @@ public final class CraftChunkData implements ChunkGenerator.ChunkData { +@@ -96,7 +96,7 @@ public final class CraftChunkData implements ChunkGenerator.ChunkData { @Override - public Material getType(int x, int y, int z) { -- return CraftMagicNumbers.getMaterial(this.getTypeId(x, y, z).getBlock()); -+ return this.getTypeId(x, y, z).getBukkitMaterial(); // Paper - optimise getType calls + public BlockType<?> getType(int x, int y, int z) { +- return CraftBlockType.minecraftToBukkit(this.getTypeId(x, y, z).getBlock()); ++ return this.getTypeId(x, y, z).getBukkitBlockType(); // Paper - optimise getType calls } @Override diff --git a/patches/server/0481-Player-elytra-boost-API.patch b/patches/server/0481-Player-elytra-boost-API.patch index 841134b7ae..c389d60dee 100644 --- a/patches/server/0481-Player-elytra-boost-API.patch +++ b/patches/server/0481-Player-elytra-boost-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Player elytra boost API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 7eb629519f1604d76a20c9ac468b8e2697980de4..c67161842ad149cd0958520d9528fbedf42e3fe1 100644 +index c21710e895fc614d06f2de6dbfa60c1571c157f8..01e7b92cef00cda4c4bb10f42501876d7a7c54a1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -617,6 +617,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -17,7 +17,7 @@ index 7eb629519f1604d76a20c9ac468b8e2697980de4..c67161842ad149cd0958520d9528fbed + public org.bukkit.entity.Firework boostElytra(ItemStack firework) { + Preconditions.checkState(this.isGliding(), "Player must be gliding"); + Preconditions.checkArgument(firework != null, "firework == null"); -+ Preconditions.checkArgument(firework.getType() == Material.FIREWORK_ROCKET, "Firework must be Material.FIREWORK_ROCKET"); ++ Preconditions.checkArgument(firework.getType() == ItemType.FIREWORK_ROCKET, "Firework must be Material.FIREWORK_ROCKET"); + + net.minecraft.world.item.ItemStack item = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(firework); + net.minecraft.world.level.Level world = ((CraftWorld) getWorld()).getHandle(); diff --git a/patches/server/0484-Add-getOfflinePlayerIfCached-String.patch b/patches/server/0484-Add-getOfflinePlayerIfCached-String.patch index 3836224d13..d80a874414 100644 --- a/patches/server/0484-Add-getOfflinePlayerIfCached-String.patch +++ b/patches/server/0484-Add-getOfflinePlayerIfCached-String.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add getOfflinePlayerIfCached(String) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 925079abb26fc658770c97961fb247e12b3bb216..b6c9dd5b3fd746ef7e863c27fd581c9f23a795a2 100644 +index 0fe6965d870f091bfd78743b96fa27a11eb6ef92..db932b5fe59b29969f199003dc32248f4253c1a2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1827,6 +1827,28 @@ public final class CraftServer implements Server { +@@ -1838,6 +1838,28 @@ public final class CraftServer implements Server { return result; } diff --git a/patches/server/0487-Fix-client-lag-on-advancement-loading.patch b/patches/server/0487-Fix-client-lag-on-advancement-loading.patch index d32bf05036..363706917e 100644 --- a/patches/server/0487-Fix-client-lag-on-advancement-loading.patch +++ b/patches/server/0487-Fix-client-lag-on-advancement-loading.patch @@ -15,10 +15,10 @@ manually reload the advancement data for all players, which normally takes place as a part of the datapack reloading. diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 6c6587c775162655581bd09e5eb7cc2d7fb8f782..c168dbfa5bc4aa49a1d743fe4b53d8169f01e1a0 100644 +index e74459da98dfa5bf790629e450ed51d1f97f8d34..227279ae3d4aa1aadd961e07986b94b1b5786fd7 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -345,7 +345,13 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -371,7 +371,13 @@ public final class CraftMagicNumbers implements UnsafeValues { Bukkit.getLogger().log(Level.SEVERE, "Error saving advancement " + key, ex); } diff --git a/patches/server/0488-Item-no-age-no-player-pickup.patch b/patches/server/0488-Item-no-age-no-player-pickup.patch index 0a59edc058..6501bec6d6 100644 --- a/patches/server/0488-Item-no-age-no-player-pickup.patch +++ b/patches/server/0488-Item-no-age-no-player-pickup.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Item no age & no player pickup diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java -index 5f36b0fd12ccd0e7ec9a7f61c56f08307844935f..27e961653dc66fbe8d5421eef04260b91ca410f4 100644 +index 66e69cb13e2d82acc0a2398625766a49bc701a09..ff6868ab31cec208045353c842f20ca31191bc0a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java -@@ -10,6 +10,12 @@ import org.bukkit.entity.Item; +@@ -9,6 +9,12 @@ import org.bukkit.entity.Item; import org.bukkit.inventory.ItemStack; public class CraftItem extends CraftEntity implements Item { @@ -21,7 +21,7 @@ index 5f36b0fd12ccd0e7ec9a7f61c56f08307844935f..27e961653dc66fbe8d5421eef04260b9 private final ItemEntity item; public CraftItem(CraftServer server, Entity entity, ItemEntity item) { -@@ -76,6 +82,26 @@ public class CraftItem extends CraftEntity implements Item { +@@ -75,6 +81,26 @@ public class CraftItem extends CraftEntity implements Item { public void setCanMobPickup(boolean canMobPickup) { item.canMobPickup = canMobPickup; } diff --git a/patches/server/0490-Beacon-API-custom-effect-ranges.patch b/patches/server/0490-Beacon-API-custom-effect-ranges.patch index acea4bac73..475b240dcd 100644 --- a/patches/server/0490-Beacon-API-custom-effect-ranges.patch +++ b/patches/server/0490-Beacon-API-custom-effect-ranges.patch @@ -95,10 +95,10 @@ index 154e4652a93b50e9b26c93531a4e854601ed75e1..f3fb7e07ca65cb1c948b110b7f7edc8b public void setCustomName(@Nullable Component customName) { diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java -index c186a44b927188ed222f8b2f8f76aaef35d9c654..c47e613cae3d9252a8364ccc4d717e410bb0fc0c 100644 +index 30b5b18de94dd3e77b6926b62fb453720f8a23e3..c28c12f2716056e09b20bbdec2cd01096ceac2dc 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java -@@ -29,7 +29,7 @@ public class CraftBeacon extends CraftBlockEntityState<BeaconBlockEntity> implem +@@ -28,7 +28,7 @@ public class CraftBeacon extends CraftBlockEntityState<BeaconBlockEntity> implem if (tileEntity instanceof BeaconBlockEntity) { BeaconBlockEntity beacon = (BeaconBlockEntity) tileEntity; @@ -107,7 +107,7 @@ index c186a44b927188ed222f8b2f8f76aaef35d9c654..c47e613cae3d9252a8364ccc4d717e41 Collection<LivingEntity> bukkit = new ArrayList<LivingEntity>(nms.size()); for (Player human : nms) { -@@ -106,4 +106,21 @@ public class CraftBeacon extends CraftBlockEntityState<BeaconBlockEntity> implem +@@ -105,4 +105,21 @@ public class CraftBeacon extends CraftBlockEntityState<BeaconBlockEntity> implem public void setLock(String key) { this.getSnapshot().lockKey = (key == null) ? LockCode.NO_LOCK : new LockCode(key); } diff --git a/patches/server/0494-Add-Destroy-Speed-API.patch b/patches/server/0494-Add-Destroy-Speed-API.patch index 067919e248..43b2cdf339 100644 --- a/patches/server/0494-Add-Destroy-Speed-API.patch +++ b/patches/server/0494-Add-Destroy-Speed-API.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add Destroy Speed API Co-authored-by: Jake Potrebic <[email protected]> diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index 2749f81fd74e466fa6b7c1c5f08d8defc5203b3e..d035ff8390f2181fb81baec1b0287ead6da0a912 100644 +index 8cc60850dab635a2133523ea41cf072094a38cb6..2bf8b235646df3817eea742138574383e766bc9b 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -@@ -699,5 +699,26 @@ public class CraftBlock implements Block { +@@ -673,5 +673,26 @@ public class CraftBlock implements Block { public String translationKey() { return this.getNMS().getBlock().getDescriptionId(); } diff --git a/patches/server/0495-Fix-Player-spawnParticle-x-y-z-precision-loss.patch b/patches/server/0495-Fix-Player-spawnParticle-x-y-z-precision-loss.patch index 1e6566545e..67dc8df880 100644 --- a/patches/server/0495-Fix-Player-spawnParticle-x-y-z-precision-loss.patch +++ b/patches/server/0495-Fix-Player-spawnParticle-x-y-z-precision-loss.patch @@ -5,15 +5,15 @@ Subject: [PATCH] Fix Player spawnParticle x/y/z precision loss diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c67161842ad149cd0958520d9528fbedf42e3fe1..e163daf31a1e3318f9127920e5ef0d36af2f6664 100644 +index 01e7b92cef00cda4c4bb10f42501876d7a7c54a1..6d08c24b067509e0358f4f8a151776774126590d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2441,7 +2441,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2459,7 +2459,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (data != null) { Preconditions.checkArgument(particle.getDataType().isInstance(data), "data (%s) should be %s", data.getClass(), particle.getDataType()); } -- ClientboundLevelParticlesPacket packetplayoutworldparticles = new ClientboundLevelParticlesPacket(CraftParticle.toNMS(particle, data), true, (float) x, (float) y, (float) z, (float) offsetX, (float) offsetY, (float) offsetZ, (float) extra, count); -+ ClientboundLevelParticlesPacket packetplayoutworldparticles = new ClientboundLevelParticlesPacket(CraftParticle.toNMS(particle, data), true, x, y, z, (float) offsetX, (float) offsetY, (float) offsetZ, (float) extra, count); // Paper - Fix x/y/z coordinate precision loss +- ClientboundLevelParticlesPacket packetplayoutworldparticles = new ClientboundLevelParticlesPacket(((CraftParticle<T>) particle).createParticleParam(data), true, (float) x, (float) y, (float) z, (float) offsetX, (float) offsetY, (float) offsetZ, (float) extra, count); ++ ClientboundLevelParticlesPacket packetplayoutworldparticles = new ClientboundLevelParticlesPacket(((CraftParticle<T>) particle).createParticleParam(data), true, x, y, z, (float) offsetX, (float) offsetY, (float) offsetZ, (float) extra, count); // Paper - Fix x/y/z coordinate precision loss this.getHandle().connection.send(packetplayoutworldparticles); } diff --git a/patches/server/0496-Add-LivingEntity-clearActiveItem.patch b/patches/server/0496-Add-LivingEntity-clearActiveItem.patch index 3fc9e55552..c12dfa8113 100644 --- a/patches/server/0496-Add-LivingEntity-clearActiveItem.patch +++ b/patches/server/0496-Add-LivingEntity-clearActiveItem.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add LivingEntity#clearActiveItem diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 97286605e33436f3e4a7b7ad319d2b2870d7029a..4bdb06c18824c99475ea7a9cc4237b0879e705a8 100644 +index 3e6c63b5c2a572fb1a28ac3ef1aa928b5a5a635e..f3118b761137257ef0503805f7f82f97c4f6bcfa 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -865,6 +865,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -863,6 +863,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { return getHandle().getUseItem().asBukkitMirror(); } diff --git a/patches/server/0499-More-lightning-API.patch b/patches/server/0499-More-lightning-API.patch index f3cc50d6cc..50620fb3ad 100644 --- a/patches/server/0499-More-lightning-API.patch +++ b/patches/server/0499-More-lightning-API.patch @@ -8,10 +8,10 @@ public net.minecraft.world.entity.LightningBolt life public net.minecraft.world.entity.LightningBolt flashes diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java -index f7991ff14ef9cda0327b8621bf615b49cffd7ac5..e515e819774bfb31ec03f05a5502921e66f2b0e2 100644 +index a244385cc0c297d018e860d0b6e4570084d9d0e7..dbb435ec7a930c3b410fc4311f7eb0a4d2faa987 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java -@@ -45,4 +45,38 @@ public class CraftLightningStrike extends CraftEntity implements LightningStrike +@@ -39,4 +39,38 @@ public class CraftLightningStrike extends CraftEntity implements LightningStrike return this.spigot; } // Spigot end diff --git a/patches/server/0505-Fix-CraftSound-backwards-compatibility.patch b/patches/server/0505-Fix-CraftSound-backwards-compatibility.patch index 9795fec129..ac0a0dbce6 100644 --- a/patches/server/0505-Fix-CraftSound-backwards-compatibility.patch +++ b/patches/server/0505-Fix-CraftSound-backwards-compatibility.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Fix CraftSound backwards compatibility diff --git a/src/main/java/org/bukkit/craftbukkit/CraftSound.java b/src/main/java/org/bukkit/craftbukkit/CraftSound.java -index 180275a8b9d48d0c5a7bbaa950de619aed2dad53..5b68188d1a7b5a75e2f4b61e8d415b5784e0d8c0 100644 +index ae1bc31c6fbeaf69c6cca137875edf5235bdcb42..26853cfe4bbad307ef76f1c68b87244604277186 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftSound.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftSound.java -@@ -27,4 +27,10 @@ public class CraftSound { - public static Sound getBukkit(SoundEvent soundEffect) { - return Registry.SOUNDS.get(CraftNamespacedKey.fromMinecraft(BuiltInRegistries.SOUND_EVENT.getKey(soundEffect))); +@@ -110,4 +110,10 @@ public class CraftSound extends Sound { + public int hashCode() { + return this.getKey().hashCode(); } + + // Paper start diff --git a/patches/server/0508-Expose-LivingEntity-hurt-direction.patch b/patches/server/0508-Expose-LivingEntity-hurt-direction.patch index bb3e6f8b6b..b5a5064709 100644 --- a/patches/server/0508-Expose-LivingEntity-hurt-direction.patch +++ b/patches/server/0508-Expose-LivingEntity-hurt-direction.patch @@ -18,10 +18,10 @@ index a8731cf957da9aad7ed6f5d372500bc34afd32ca..b36492efc3d6338e0099988c1ff31e72 public boolean affectsSpawning = true; // Paper end diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index b0d2038cf2622c8ee7f810026ed735ff954d7ad0..a8aa176b8afd45fada9529d4d0b92000299faf1b 100644 +index 96016906ec745c5f806161edcfe3caad53fc8381..515fc9de2534821b0487a0375eaa8164bc4576b4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -126,6 +126,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -128,6 +128,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { } } @@ -36,10 +36,10 @@ index b0d2038cf2622c8ee7f810026ed735ff954d7ad0..a8aa176b8afd45fada9529d4d0b92000 public int getSleepTicks() { return this.getHandle().sleepCounter; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 4bdb06c18824c99475ea7a9cc4237b0879e705a8..c74a6df6a9c3c7745daae4c0558948ea4a31d7a6 100644 +index f3118b761137257ef0503805f7f82f97c4f6bcfa..c75d6d09d731ec41fe8b518bb1c866d3f0c63ff1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -910,5 +910,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -908,5 +908,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { public void playPickupItemAnimation(org.bukkit.entity.Item item, int quantity) { getHandle().take(((CraftItem) item).getHandle(), quantity); } diff --git a/patches/server/0509-Add-OBSTRUCTED-reason-to-BedEnterResult.patch b/patches/server/0509-Add-OBSTRUCTED-reason-to-BedEnterResult.patch index 92a22c8ba6..58289d3652 100644 --- a/patches/server/0509-Add-OBSTRUCTED-reason-to-BedEnterResult.patch +++ b/patches/server/0509-Add-OBSTRUCTED-reason-to-BedEnterResult.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add OBSTRUCTED reason to BedEnterResult diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 9761302bb1ca66242ae46d26001837dd881cb9fa..0c177a3165ea61bf31f030111084920a3a048256 100644 +index 75ac4dcf5552341cb6018788f4fea5a72c782d44..cf558c5357aaf4308364dd1f1a7ecba221418dd3 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -267,6 +267,10 @@ public class CraftEventFactory { +@@ -273,6 +273,10 @@ public class CraftEventFactory { return BedEnterResult.TOO_FAR_AWAY; case NOT_SAFE: return BedEnterResult.NOT_SAFE; diff --git a/patches/server/0514-Additional-Block-Material-API-s.patch b/patches/server/0514-Additional-Block-Material-API-s.patch index 5704d47e95..4d77e61107 100644 --- a/patches/server/0514-Additional-Block-Material-API-s.patch +++ b/patches/server/0514-Additional-Block-Material-API-s.patch @@ -9,10 +9,10 @@ process to do this in the Bukkit API Adds API for buildable, replaceable, burnable too. diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index d035ff8390f2181fb81baec1b0287ead6da0a912..8958a54d1a9d6e9ad6ab09f3a587ba89ae2d817d 100644 +index 2bf8b235646df3817eea742138574383e766bc9b..c8d7bd799d2563039e677160e6954f034d2dcaea 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -@@ -465,6 +465,25 @@ public class CraftBlock implements Block { +@@ -439,6 +439,25 @@ public class CraftBlock implements Block { return this.getNMS().liquid(); } diff --git a/patches/server/0516-Implement-API-to-get-Material-from-Boats-and-Minecar.patch b/patches/server/0516-Implement-API-to-get-Material-from-Boats-and-Minecar.patch index f9e803f989..3a705ab726 100644 --- a/patches/server/0516-Implement-API-to-get-Material-from-Boats-and-Minecar.patch +++ b/patches/server/0516-Implement-API-to-get-Material-from-Boats-and-Minecar.patch @@ -5,18 +5,23 @@ Subject: [PATCH] Implement API to get Material from Boats and Minecarts diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java -index b2639e15d7b9f7068dcba3a3b80f5a6a897f0de9..dd7076938b04d4b36e3360a883bae81ced455fda 100644 +index ff83b62207652903334e3c2631f22a6456788fe2..c8290f56ea90add766ec0a23c96d0100223e71fd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java -@@ -80,6 +80,13 @@ public class CraftBoat extends CraftVehicle implements Boat { +@@ -79,6 +79,18 @@ public class CraftBoat extends CraftVehicle implements Boat { this.getHandle().landBoats = workOnLand; } -+ // Paper start ++ // Paper start - get boat material + @Override + public org.bukkit.Material getBoatMaterial() { + return org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(this.getHandle().getDropItem()); + } ++ ++ @Override ++ public org.bukkit.inventory.ItemType getBoatItem() { ++ return org.bukkit.craftbukkit.inventory.CraftItemType.minecraftToBukkit(this.getHandle().getDropItem()); ++ } + // Paper end + @Override diff --git a/patches/server/0522-Zombie-API-breaking-doors.patch b/patches/server/0522-Zombie-API-breaking-doors.patch index 0b6d0327e3..da4c6d2dce 100644 --- a/patches/server/0522-Zombie-API-breaking-doors.patch +++ b/patches/server/0522-Zombie-API-breaking-doors.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Zombie API - breaking doors public net.minecraft.world.entity.monster.Zombie supportsBreakDoorGoal()Z diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java -index 1e0154f2d06b0cc5bc58ec2de98cbdce1346da35..9f4da46dce54fe4207e24b49402fe0d3fa548e29 100644 +index 1e303c3686e2fe4e05efe5a630dd2c1cb0f9edea..ed211b123354ece21dd8beae7192a26727f5124f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java -@@ -128,6 +128,11 @@ public class CraftZombie extends CraftMonster implements Zombie { +@@ -122,6 +122,11 @@ public class CraftZombie extends CraftMonster implements Zombie { public void setShouldBurnInDay(boolean shouldBurnInDay) { getHandle().setShouldBurnInDay(shouldBurnInDay); } diff --git a/patches/server/0525-Added-WorldGameRuleChangeEvent.patch b/patches/server/0525-Added-WorldGameRuleChangeEvent.patch index ef56270b86..8574c12700 100644 --- a/patches/server/0525-Added-WorldGameRuleChangeEvent.patch +++ b/patches/server/0525-Added-WorldGameRuleChangeEvent.patch @@ -64,10 +64,10 @@ index 4a0321f56ef80aa4991e61f586ddd3f6b45e499b..de713f1ca1d61a6b1fca2b66de916255 public int get() { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 133a5b30b4cdca091f7eae9fccc5bb7d03ace432..9351b3b8d4d9c7069ea4ae11a49a1f7b70ffbce9 100644 +index 5b97101be2fa04cc2482151766578675c85ee457..7f6688f0c6a0e50c44adb3214f8f1a93201bf977 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1845,8 +1845,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1839,8 +1839,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { if (!this.isGameRule(rule)) return false; @@ -82,7 +82,7 @@ index 133a5b30b4cdca091f7eae9fccc5bb7d03ace432..9351b3b8d4d9c7069ea4ae11a49a1f7b handle.onChanged(this.getHandle().getServer()); return true; } -@@ -1882,8 +1887,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1876,8 +1881,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { if (!this.isGameRule(rule.getName())) return false; diff --git a/patches/server/0528-Implemented-BlockFailedDispenseEvent.patch b/patches/server/0528-Implemented-BlockFailedDispenseEvent.patch index b1b85563fe..303af196ee 100644 --- a/patches/server/0528-Implemented-BlockFailedDispenseEvent.patch +++ b/patches/server/0528-Implemented-BlockFailedDispenseEvent.patch @@ -32,10 +32,10 @@ index 1415ad60163f6584619cc7caa61f1848d6ebaa93..801c4c120e98584bcf218a4ef9bd66d7 } else { ItemStack itemstack = tileentitydispenser.getItem(i); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 0c177a3165ea61bf31f030111084920a3a048256..edd27b8e2535b520c4f6e6309269ab84799f2a3a 100644 +index cf558c5357aaf4308364dd1f1a7ecba221418dd3..15c03353bd10655baf0a989c105fdc56658c1c18 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1920,4 +1920,12 @@ public class CraftEventFactory { +@@ -1909,4 +1909,12 @@ public class CraftEventFactory { return !event.isCancelled(); } diff --git a/patches/server/0533-Implement-API-to-expose-exact-interaction-point.patch b/patches/server/0533-Implement-API-to-expose-exact-interaction-point.patch index b411c78421..cabe0750f5 100644 --- a/patches/server/0533-Implement-API-to-expose-exact-interaction-point.patch +++ b/patches/server/0533-Implement-API-to-expose-exact-interaction-point.patch @@ -18,10 +18,10 @@ index 180dc7ec0202fd6c24682631dedc066976f17fa4..43221bf57fb4eeb70823c12b48f4df0b this.interactResult = event.useItemInHand() == Event.Result.DENY; this.interactPosition = blockposition.immutable(); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index edd27b8e2535b520c4f6e6309269ab84799f2a3a..3799eec69ef45c77e032faee91ce45205dcd3675 100644 +index 15c03353bd10655baf0a989c105fdc56658c1c18..2bc3e52efd34042f7f96f7fbf564653edbe28fa7 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -58,7 +58,9 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams; +@@ -59,7 +59,9 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.EntityHitResult; import net.minecraft.world.phys.HitResult; @@ -31,7 +31,7 @@ index edd27b8e2535b520c4f6e6309269ab84799f2a3a..3799eec69ef45c77e032faee91ce4520 import org.bukkit.Material; import org.bukkit.NamespacedKey; import org.bukkit.Server; -@@ -492,7 +494,13 @@ public class CraftEventFactory { +@@ -498,7 +500,13 @@ public class CraftEventFactory { return CraftEventFactory.callPlayerInteractEvent(who, action, position, direction, itemstack, false, hand); } @@ -45,7 +45,7 @@ index edd27b8e2535b520c4f6e6309269ab84799f2a3a..3799eec69ef45c77e032faee91ce4520 Player player = (who == null) ? null : (Player) who.getBukkitEntity(); CraftItemStack itemInHand = CraftItemStack.asCraftMirror(itemstack); -@@ -518,7 +526,10 @@ public class CraftEventFactory { +@@ -524,7 +532,10 @@ public class CraftEventFactory { itemInHand = null; } diff --git a/patches/server/0537-TODO-Registry-Modification-API.patch b/patches/server/0537-TODO-Registry-Modification-API.patch index 54b86b44e7..ff3ea64608 100644 --- a/patches/server/0537-TODO-Registry-Modification-API.patch +++ b/patches/server/0537-TODO-Registry-Modification-API.patch @@ -5,12 +5,12 @@ Subject: [PATCH] TODO Registry Modification API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java -index 8d392d16050e65de081753c1479d0738d3f021a0..8e1a6206eafdf4160aef280710f0912a0664536f 100644 +index 390e1e8e78bdb1f008ea4b4e4df6e9db2732cfc6..32c1b8845e42c2dd74cf7ecf3d649923c6f99fdd 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java -@@ -36,6 +36,7 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> { - if (bukkitClass == TrimPattern.class) { - return new CraftRegistry<>(registryHolder.registryOrThrow(Registries.TRIM_PATTERN), CraftTrimPattern::new); +@@ -131,6 +131,7 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> { + if (bukkitClass == MusicInstrument.class) { + return new CraftRegistry<>(registryHolder.registryOrThrow(Registries.INSTRUMENT), CraftMusicInstrument::new); } + // TODO registry modification API diff --git a/patches/server/0538-Add-StructuresLocateEvent.patch b/patches/server/0538-Add-StructuresLocateEvent.patch index 6486f1c83a..7ceb79b15c 100644 --- a/patches/server/0538-Add-StructuresLocateEvent.patch +++ b/patches/server/0538-Add-StructuresLocateEvent.patch @@ -47,7 +47,7 @@ index 0000000000000000000000000000000000000000..09837f6e6c6ab8a1df2aacdb86646993 + } +} diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java -index 4da303d7e15496f04f0e27bfb613176bc2a72b76..3c7920721914588a3e7eaf1faff46f7305823416 100644 +index f430589fc2cdda23b099b20ace9818e8a8eb7278..3a6cf81e349063e47dfa2c2d40a3c3fca50beaef 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java @@ -121,6 +121,24 @@ public abstract class ChunkGenerator { @@ -57,7 +57,7 @@ index 4da303d7e15496f04f0e27bfb613176bc2a72b76..3c7920721914588a3e7eaf1faff46f73 + // Paper start - StructuresLocateEvent + final org.bukkit.World bukkitWorld = world.getWorld(); + final org.bukkit.Location origin = io.papermc.paper.util.MCUtil.toLocation(world, center); -+ final List<org.bukkit.generator.structure.Structure> apiStructures = structures.stream().map(Holder::value).map(nms -> org.bukkit.craftbukkit.generator.structure.CraftStructure.minecraftToBukkit(nms, world.registryAccess())).toList(); ++ final List<org.bukkit.generator.structure.Structure> apiStructures = structures.stream().map(Holder::value).map(org.bukkit.craftbukkit.generator.structure.CraftStructure::minecraftToBukkit).toList(); + if (!apiStructures.isEmpty()) { + final io.papermc.paper.event.world.StructuresLocateEvent event = new io.papermc.paper.event.world.StructuresLocateEvent(bukkitWorld, origin, apiStructures, radius, skipReferencedStructures); + if (!event.callEvent()) { @@ -76,11 +76,11 @@ index 4da303d7e15496f04f0e27bfb613176bc2a72b76..3c7920721914588a3e7eaf1faff46f73 Map<StructurePlacement, Set<Holder<Structure>>> map = new Object2ObjectArrayMap(); Iterator iterator = structures.iterator(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java -index 8e1a6206eafdf4160aef280710f0912a0664536f..15abd319ac51a97cdb07da85e815ea93ff45431a 100644 +index 32c1b8845e42c2dd74cf7ecf3d649923c6f99fdd..ecbe30582af8758a8b3cdf71bdbf8ed2e4d92d64 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java -@@ -37,6 +37,11 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> { - return new CraftRegistry<>(registryHolder.registryOrThrow(Registries.TRIM_PATTERN), CraftTrimPattern::new); +@@ -132,6 +132,11 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> { + return new CraftRegistry<>(registryHolder.registryOrThrow(Registries.INSTRUMENT), CraftMusicInstrument::new); } // TODO registry modification API + // Paper start - remove this after a while along with all ConfiguredStructure stuff @@ -193,3 +193,15 @@ index 0000000000000000000000000000000000000000..102b99691b53f5e3c14999d3c281b030 + System.setOut(out); + } +} +diff --git a/src/test/java/org/bukkit/PerRegistryTest.java b/src/test/java/org/bukkit/PerRegistryTest.java +index cd764c9d78bef25148d79d471e7607d74c93ffcb..d7dfef5bde5a7eb62f09ded7abae7547aa3e3520 100644 +--- a/src/test/java/org/bukkit/PerRegistryTest.java ++++ b/src/test/java/org/bukkit/PerRegistryTest.java +@@ -32,6 +32,7 @@ public class PerRegistryTest extends AbstractTestingBase { + for (Field registryField : registryFields) { + try { + Object object = registryField.get(null); ++ if (object == org.bukkit.Registry.CONFIGURED_STRUCTURE) continue; // Paper - skip + // Ignore Bukkit's default SimpleRegistry. It cannot be tested correctly + if (!(object instanceof CraftRegistry<?, ?> registry)) { + continue; diff --git a/patches/server/0544-Implement-BlockPreDispenseEvent.patch b/patches/server/0544-Implement-BlockPreDispenseEvent.patch index 3749486d75..7631df0c31 100644 --- a/patches/server/0544-Implement-BlockPreDispenseEvent.patch +++ b/patches/server/0544-Implement-BlockPreDispenseEvent.patch @@ -17,10 +17,10 @@ index 9ec043ff2cd38e589066a3eb7f42834e4e7592cf..4720b884e1e311f44a012f1219fe648a tileentitydispenser.setItem(i, idispensebehavior.dispense(sourceblock, itemstack)); } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 3799eec69ef45c77e032faee91ce45205dcd3675..2567c229eb14a8bf54cd99e852a4c31fde86646d 100644 +index 2bc3e52efd34042f7f96f7fbf564653edbe28fa7..4abcd3927d1d1bc234cdbc315fb5afd327b85272 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1938,5 +1938,11 @@ public class CraftEventFactory { +@@ -1927,5 +1927,11 @@ public class CraftEventFactory { io.papermc.paper.event.block.BlockFailedDispenseEvent event = new io.papermc.paper.event.block.BlockFailedDispenseEvent(block); return event.callEvent(); } diff --git a/patches/server/0548-Add-dropLeash-variable-to-EntityUnleashEvent.patch b/patches/server/0548-Add-dropLeash-variable-to-EntityUnleashEvent.patch index fdcf6c0771..f851064f5c 100644 --- a/patches/server/0548-Add-dropLeash-variable-to-EntityUnleashEvent.patch +++ b/patches/server/0548-Add-dropLeash-variable-to-EntityUnleashEvent.patch @@ -122,10 +122,10 @@ index 16784fcc853e23689a854e7dc6c03ed8182a164e..4eb97572a97a8d98af37c4223f42fc63 flag1 = true; } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 2567c229eb14a8bf54cd99e852a4c31fde86646d..2dc961eedf4da8175bad709fbb9f0fcce7d23330 100644 +index 4abcd3927d1d1bc234cdbc315fb5afd327b85272..8d30128683e3927dfba7dcb44d3be755c0e2bc68 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1562,8 +1562,10 @@ public class CraftEventFactory { +@@ -1560,8 +1560,10 @@ public class CraftEventFactory { return itemInHand; } diff --git a/patches/server/0554-Allow-adding-items-to-BlockDropItemEvent.patch b/patches/server/0554-Allow-adding-items-to-BlockDropItemEvent.patch index 64ee1fccfe..62fdcf63e9 100644 --- a/patches/server/0554-Allow-adding-items-to-BlockDropItemEvent.patch +++ b/patches/server/0554-Allow-adding-items-to-BlockDropItemEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow adding items to BlockDropItemEvent diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 2dc961eedf4da8175bad709fbb9f0fcce7d23330..64e1e46bd6c4b225fe9b86c4cf632b9bb1c4af09 100644 +index 8d30128683e3927dfba7dcb44d3be755c0e2bc68..8305472b13cffe5fe44211153da71d781a6b3892 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -418,13 +418,30 @@ public class CraftEventFactory { +@@ -424,13 +424,30 @@ public class CraftEventFactory { } public static void handleBlockDropItemEvent(Block block, BlockState state, ServerPlayer player, List<ItemEntity> items) { diff --git a/patches/server/0556-living-entity-allow-attribute-registration.patch b/patches/server/0556-living-entity-allow-attribute-registration.patch index 4c2d5f8c84..8226d495b6 100644 --- a/patches/server/0556-living-entity-allow-attribute-registration.patch +++ b/patches/server/0556-living-entity-allow-attribute-registration.patch @@ -22,29 +22,29 @@ index 03561cb69c58e4ed8115a9e67df28d5df1f79bc4..dd1102d5291ef6f18e82400a6d8a0a37 + } diff --git a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java -index 233e372ba5d785352c9ac12dac37395bac63315c..0e61caa5c9f21788fbeaa90ed75d23e10b816aac 100644 +index a5452d7ef38a4045995289a592ff8e467a1e9832..341cc78f44fa7ce4e790fa75cb2e5d3ed31a82f4 100644 --- a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java +++ b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java -@@ -39,6 +39,14 @@ public class CraftAttributeMap implements Attributable { +@@ -38,6 +38,14 @@ public class CraftAttributeMap implements Attributable { return (nms == null) ? null : new CraftAttributeInstance(nms, attribute); } + // Paper start + @Override -+ public void registerAttribute(Attribute attribute) { ++ public void registerAttribute(final Attribute attribute) { + Preconditions.checkArgument(attribute != null, "attribute"); -+ handle.registerAttribute(CraftAttributeMap.toMinecraft(attribute)); ++ this.handle.registerAttribute(CraftAttribute.bukkitToMinecraft(attribute)); + } + // Paper end + - public static net.minecraft.world.entity.ai.attributes.Attribute toMinecraft(Attribute attribute) { - return BuiltInRegistries.ATTRIBUTE.get(CraftNamespacedKey.toMinecraft(attribute.getKey())); + public static Attribute fromMinecraft(String nms) { + return Registry.ATTRIBUTE.get(CraftNamespacedKey.fromString(nms)); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index c74a6df6a9c3c7745daae4c0558948ea4a31d7a6..63a1522071ec6e9a550598b04c1a901ff76a5c78 100644 +index c75d6d09d731ec41fe8b518bb1c866d3f0c63ff1..a5715406f99c97c5b785d8a1e0afdafc38ca06f2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -702,6 +702,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -700,6 +700,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { return this.getHandle().craftAttributes.getAttribute(attribute); } diff --git a/patches/server/0557-fix-dead-slime-setSize-invincibility.patch b/patches/server/0557-fix-dead-slime-setSize-invincibility.patch index 91a270bc9e..82acef5e68 100644 --- a/patches/server/0557-fix-dead-slime-setSize-invincibility.patch +++ b/patches/server/0557-fix-dead-slime-setSize-invincibility.patch @@ -5,10 +5,10 @@ Subject: [PATCH] fix dead slime setSize invincibility diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java -index 743af3b71f2d007290fa4e4da85973b491d95135..c580922c64f0e26177494fb87ecd0c1d086c5ef9 100644 +index 9b219beb8922bf0701e538bcf874f0eb922f60bb..2b1211ee410a0246195053ad041eaa131f859bcd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java -@@ -17,7 +17,7 @@ public class CraftSlime extends CraftMob implements Slime, CraftEnemy { +@@ -16,7 +16,7 @@ public class CraftSlime extends CraftMob implements Slime, CraftEnemy { @Override public void setSize(int size) { diff --git a/patches/server/0559-Expose-Tracked-Players.patch b/patches/server/0559-Expose-Tracked-Players.patch index 35f7177f1c..de9e9c0b7a 100644 --- a/patches/server/0559-Expose-Tracked-Players.patch +++ b/patches/server/0559-Expose-Tracked-Players.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose Tracked Players diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 702987ef563db2e0819771e8c3be822e4644ee3f..d3eaf054b1815003934e7f2d904a05a5d8abc3a5 100644 +index c3ddbc8a124f5e82d3a4d5120724f3ee9265b3b8..2578d45a1fa43e4c9f004ab8afc1d8147cabfe8f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1341,5 +1341,18 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1356,5 +1356,18 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { public boolean isTicking() { return getHandle().isTicking(); } diff --git a/patches/server/0568-Add-Block-isValidTool.patch b/patches/server/0568-Add-Block-isValidTool.patch index 6130e68ff2..e2f9d421e4 100644 --- a/patches/server/0568-Add-Block-isValidTool.patch +++ b/patches/server/0568-Add-Block-isValidTool.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Block#isValidTool diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index 8958a54d1a9d6e9ad6ab09f3a587ba89ae2d817d..582f1c07da8edc88dda9463992bb8503fcb9e163 100644 +index c8d7bd799d2563039e677160e6954f034d2dcaea..4745c633e92e16efb9fcd9ab009413b05abed434 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -@@ -739,5 +739,9 @@ public class CraftBlock implements Block { +@@ -713,5 +713,9 @@ public class CraftBlock implements Block { } return speed; } diff --git a/patches/server/0570-Expand-world-key-API.patch b/patches/server/0570-Expand-world-key-API.patch index 4f0094406b..7b23e2a0ef 100644 --- a/patches/server/0570-Expand-world-key-API.patch +++ b/patches/server/0570-Expand-world-key-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expand world key API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -index a9cad569f9c71f9818d1b831983f71aae367d98e..4e85e98d12d5ee4cabb6d449bcf3134f353932fb 100644 +index f302d936057a56629c4b9edaaffb996191b102c9..ff7d2bfbd94cd336fccd70dde904df5666873bf9 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -@@ -986,5 +986,10 @@ public abstract class CraftRegionAccessor implements RegionAccessor { +@@ -988,5 +988,10 @@ public abstract class CraftRegionAccessor implements RegionAccessor { public io.papermc.paper.world.MoonPhase getMoonPhase() { return io.papermc.paper.world.MoonPhase.getPhase(this.getHandle().dayTime() / 24000L); } @@ -20,10 +20,10 @@ index a9cad569f9c71f9818d1b831983f71aae367d98e..4e85e98d12d5ee4cabb6d449bcf3134f // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b6c9dd5b3fd746ef7e863c27fd581c9f23a795a2..ed6125d52eb0e406e44a2c3ded1ed1d1b19bf5c5 100644 +index db932b5fe59b29969f199003dc32248f4253c1a2..ef0bc987da9bd076fd1f760c0c9ba4c1db57e771 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1153,9 +1153,15 @@ public final class CraftServer implements Server { +@@ -1164,9 +1164,15 @@ public final class CraftServer implements Server { File folder = new File(this.getWorldContainer(), name); World world = this.getWorld(name); @@ -41,7 +41,7 @@ index b6c9dd5b3fd746ef7e863c27fd581c9f23a795a2..ed6125d52eb0e406e44a2c3ded1ed1d1 if (folder.exists()) { Preconditions.checkArgument(folder.isDirectory(), "File (%s) exists and isn't a folder", name); -@@ -1242,7 +1248,7 @@ public final class CraftServer implements Server { +@@ -1253,7 +1259,7 @@ public final class CraftServer implements Server { } else if (name.equals(levelName + "_the_end")) { worldKey = net.minecraft.world.level.Level.END; } else { @@ -50,7 +50,7 @@ index b6c9dd5b3fd746ef7e863c27fd581c9f23a795a2..ed6125d52eb0e406e44a2c3ded1ed1d1 } ServerLevel internal = (ServerLevel) new ServerLevel(this.console, console.executor, worldSession, worlddata, worldKey, worlddimension, this.getServer().progressListenerFactory.create(11), -@@ -1334,6 +1340,15 @@ public final class CraftServer implements Server { +@@ -1345,6 +1351,15 @@ public final class CraftServer implements Server { return null; } @@ -67,10 +67,10 @@ index b6c9dd5b3fd746ef7e863c27fd581c9f23a795a2..ed6125d52eb0e406e44a2c3ded1ed1d1 // Check if a World already exists with the UID. if (this.getWorld(world.getUID()) != null) { diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index c168dbfa5bc4aa49a1d743fe4b53d8169f01e1a0..16ef907b9443b9feedd768d0116762799fee9ab3 100644 +index 227279ae3d4aa1aadd961e07986b94b1b5786fd7..6c454ec27082f04d4e6b74d718dd1e333e4b2f14 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -523,6 +523,11 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -582,6 +582,11 @@ public final class CraftMagicNumbers implements UnsafeValues { public int nextEntityId() { return net.minecraft.world.entity.Entity.nextEntityId(); } diff --git a/patches/server/0572-Item-Rarity-API.patch b/patches/server/0572-Item-Rarity-API.patch index 3e21a97a84..b691abcce6 100644 --- a/patches/server/0572-Item-Rarity-API.patch +++ b/patches/server/0572-Item-Rarity-API.patch @@ -6,27 +6,34 @@ Subject: [PATCH] Item Rarity API == AT == public net.minecraft.world.item.Item rarity +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java +index 49be8074280d9840bb3d8e6880b4e0a8aa4ef0cb..589e8816a49f7d5cb6c4231e5851319647e71d3e 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java +@@ -142,4 +142,11 @@ public class CraftItemType implements ItemType { + return this.item.getDescriptionId(); + } + // Paper end ++ ++ // Paper start - Item Rarity API ++ @Override ++ public io.papermc.paper.inventory.ItemRarity getItemRarity() { ++ return io.papermc.paper.inventory.ItemRarity.values()[this.item.rarity.ordinal()]; ++ } ++ // Paper end + } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 16ef907b9443b9feedd768d0116762799fee9ab3..2a08fca2c863717b72341772630cd4b690f34968 100644 +index 6c454ec27082f04d4e6b74d718dd1e333e4b2f14..9f395fd7a38d2589269eeea00efd6dcada290088 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -528,6 +528,20 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -587,6 +587,11 @@ public final class CraftMagicNumbers implements UnsafeValues { public String getMainLevelName() { return ((net.minecraft.server.dedicated.DedicatedServer) net.minecraft.server.MinecraftServer.getServer()).getProperties().levelName; } + + @Override -+ public io.papermc.paper.inventory.ItemRarity getItemRarity(org.bukkit.Material material) { -+ Item item = getItem(material); -+ if (item == null) { -+ throw new IllegalArgumentException(material + " is not an item, and rarity does not apply to blocks"); -+ } -+ return io.papermc.paper.inventory.ItemRarity.values()[item.rarity.ordinal()]; -+ } -+ -+ @Override + public io.papermc.paper.inventory.ItemRarity getItemStackRarity(org.bukkit.inventory.ItemStack itemStack) { -+ return io.papermc.paper.inventory.ItemRarity.values()[getItem(itemStack.getType()).getRarity(CraftItemStack.asNMSCopy(itemStack)).ordinal()]; ++ return io.papermc.paper.inventory.ItemRarity.values()[((org.bukkit.craftbukkit.inventory.CraftItemType)itemStack.getType()).getHandle().getRarity(CraftItemStack.asNMSCopy(itemStack)).ordinal()]; + } // Paper end diff --git a/patches/server/0576-Expose-protocol-version.patch b/patches/server/0576-Expose-protocol-version.patch index 79834b44b7..be6b353cef 100644 --- a/patches/server/0576-Expose-protocol-version.patch +++ b/patches/server/0576-Expose-protocol-version.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Expose protocol version diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 2a08fca2c863717b72341772630cd4b690f34968..e540a219e26ecb1b2f93df01a34dd754faea1f10 100644 +index 9f395fd7a38d2589269eeea00efd6dcada290088..2944ca24702bb5b8a3c548f5fda872ddb44e7573 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -542,6 +542,11 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -592,6 +592,11 @@ public final class CraftMagicNumbers implements UnsafeValues { public io.papermc.paper.inventory.ItemRarity getItemStackRarity(org.bukkit.inventory.ItemStack itemStack) { - return io.papermc.paper.inventory.ItemRarity.values()[getItem(itemStack.getType()).getRarity(CraftItemStack.asNMSCopy(itemStack)).ordinal()]; + return io.papermc.paper.inventory.ItemRarity.values()[((org.bukkit.craftbukkit.inventory.CraftItemType)itemStack.getType()).getHandle().getRarity(CraftItemStack.asNMSCopy(itemStack)).ordinal()]; } + + @Override diff --git a/patches/server/0580-Set-area-affect-cloud-rotation.patch b/patches/server/0580-Set-area-affect-cloud-rotation.patch index 4441d7b847..b01d747740 100644 --- a/patches/server/0580-Set-area-affect-cloud-rotation.patch +++ b/patches/server/0580-Set-area-affect-cloud-rotation.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Set area affect cloud rotation diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -index 4e85e98d12d5ee4cabb6d449bcf3134f353932fb..9160fc90afce3c589cf6a3ddb829d56e045b20fa 100644 +index ff7d2bfbd94cd336fccd70dde904df5666873bf9..4d2451ac57de1bb248169c266b111f102670c606 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -@@ -952,6 +952,7 @@ public abstract class CraftRegionAccessor implements RegionAccessor { +@@ -954,6 +954,7 @@ public abstract class CraftRegionAccessor implements RegionAccessor { entity.moveTo(location.getX(), location.getY(), location.getZ()); } else if (AreaEffectCloud.class.isAssignableFrom(clazz)) { entity = new net.minecraft.world.entity.AreaEffectCloud(world, x, y, z); diff --git a/patches/server/0581-add-isDeeplySleeping-to-HumanEntity.patch b/patches/server/0581-add-isDeeplySleeping-to-HumanEntity.patch index 28dad086f7..0be6409cf8 100644 --- a/patches/server/0581-add-isDeeplySleeping-to-HumanEntity.patch +++ b/patches/server/0581-add-isDeeplySleeping-to-HumanEntity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] add isDeeplySleeping to HumanEntity diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index a8aa176b8afd45fada9529d4d0b92000299faf1b..329e0586ec4ea44b6a8f4b72a69041aa7cd01ced 100644 +index 515fc9de2534821b0487a0375eaa8164bc4576b4..adca583aa01d729d15a6b74223806522599cb63b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -133,6 +133,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -135,6 +135,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { } // Paper end diff --git a/patches/server/0587-More-World-API.patch b/patches/server/0587-More-World-API.patch index dd016744ab..dcae20b81f 100644 --- a/patches/server/0587-More-World-API.patch +++ b/patches/server/0587-More-World-API.patch @@ -5,11 +5,11 @@ Subject: [PATCH] More World API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 9351b3b8d4d9c7069ea4ae11a49a1f7b70ffbce9..f5de2359af2a7dc3c2f9cd4daec3aeae86fae153 100644 +index 7f6688f0c6a0e50c44adb3214f8f1a93201bf977..b8bf03012e5fc3781173065d1784e9d69007ebaa 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -2088,6 +2088,69 @@ public class CraftWorld extends CraftRegionAccessor implements World { - return new CraftStructureSearchResult(CraftStructure.minecraftToBukkit(found.getSecond().value(), this.getHandle().registryAccess()), CraftLocation.toBukkit(found.getFirst(), this)); +@@ -2083,6 +2083,69 @@ public class CraftWorld extends CraftRegionAccessor implements World { + return new CraftStructureSearchResult(CraftStructure.minecraftToBukkit(found.getSecond().value()), CraftLocation.toBukkit(found.getFirst(), this)); } + // Paper start @@ -66,7 +66,7 @@ index 9351b3b8d4d9c7069ea4ae11a49a1f7b70ffbce9..f5de2359af2a7dc3c2f9cd4daec3aeae + + @Override + public Collection<org.bukkit.Material> getInfiniburn() { -+ return com.google.common.collect.Sets.newHashSet(com.google.common.collect.Iterators.transform(net.minecraft.core.registries.BuiltInRegistries.BLOCK.getTagOrEmpty(this.getHandle().dimensionType().infiniburn()).iterator(), blockHolder -> CraftMagicNumbers.getMaterial(blockHolder.value()))); ++ return com.google.common.collect.Sets.newHashSet(com.google.common.collect.Iterators.transform(net.minecraft.core.registries.BuiltInRegistries.BLOCK.getTagOrEmpty(this.getHandle().dimensionType().infiniburn()).iterator(), blockHolder -> org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(blockHolder.value()))); + } + + @Override diff --git a/patches/server/0596-Add-more-WanderingTrader-API.patch b/patches/server/0596-Add-more-WanderingTrader-API.patch index 9e5ed86cee..c46d758e8c 100644 --- a/patches/server/0596-Add-more-WanderingTrader-API.patch +++ b/patches/server/0596-Add-more-WanderingTrader-API.patch @@ -33,10 +33,10 @@ index 65592c41b1519eff77ccd7ddd3c885058f3ed138..2e7de2378e01aed514e237029d6d64e7 this.goalSelector.addGoal(1, new TradeWithPlayerGoal(this)); this.goalSelector.addGoal(1, new AvoidEntityGoal<>(this, Zombie.class, 8.0F, 0.5D, 0.5D)); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWanderingTrader.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWanderingTrader.java -index 65b052567d1d855021d7273672b4354aba0a42a4..fa7107593b20e0151d8d67104e4a92dcc697d461 100644 +index 758eb33c565999e6321b96ff0f733478ffbbd9cc..4a6700d7d2f40cf516054e2e3d09049f1ce4fd17 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWanderingTrader.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWanderingTrader.java -@@ -34,4 +34,26 @@ public class CraftWanderingTrader extends CraftAbstractVillager implements Wande +@@ -28,4 +28,26 @@ public class CraftWanderingTrader extends CraftAbstractVillager implements Wande public void setDespawnDelay(int despawnDelay) { this.getHandle().setDespawnDelay(despawnDelay); } diff --git a/patches/server/0600-Inventory-close.patch b/patches/server/0600-Inventory-close.patch index 31cb3eaa08..ac90fc573c 100644 --- a/patches/server/0600-Inventory-close.patch +++ b/patches/server/0600-Inventory-close.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Inventory#close diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java -index 01b38b5a515c7dd0f0c79141c270d618bf3c56eb..bfac13ec6c316caa65db4a51b77f0a7045ad88ff 100644 +index 481eefba58779a051bc20a13488e5d8ece497c75..9156b0f650891d1d231df8cfc4a8ba2054c3dba7 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java -@@ -450,6 +450,14 @@ public class CraftInventory implements Inventory { +@@ -443,6 +443,14 @@ public class CraftInventory implements Inventory { this.clear(i); } } diff --git a/patches/server/0601-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch b/patches/server/0601-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch index 45fefcead5..1e99a5d4c4 100644 --- a/patches/server/0601-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch +++ b/patches/server/0601-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch @@ -110,10 +110,10 @@ index 5ff566186431440c25a26900aba14e4adb642031..5beaa2bb0d58fe477ce8d2de8b77600d + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java -index 1ebb83fe98f573d0a982397096d4dba7249aef4b..6b71f8b373ef524f5df16023b773e92249bb2532 100644 +index 305a635b049741ac5e2670060c6818cb2c07e5ab..9304e201db1ec96d0916aa8ea781f3e4bc7991e6 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java -@@ -40,5 +40,15 @@ public class CraftPhantom extends CraftFlying implements Phantom, CraftEnemy { +@@ -34,5 +34,15 @@ public class CraftPhantom extends CraftFlying implements Phantom, CraftEnemy { public java.util.UUID getSpawningEntity() { return getHandle().getSpawningEntity(); } diff --git a/patches/server/0603-Add-basic-Datapack-API.patch b/patches/server/0603-Add-basic-Datapack-API.patch index c0687f2e96..695d5dc0e5 100644 --- a/patches/server/0603-Add-basic-Datapack-API.patch +++ b/patches/server/0603-Add-basic-Datapack-API.patch @@ -92,26 +92,26 @@ index 0000000000000000000000000000000000000000..cf4374493c11057451a62a655514415c + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index ed6125d52eb0e406e44a2c3ded1ed1d1b19bf5c5..532c4f79e0926e029e78bc796238e54fd5f63023 100644 +index ef0bc987da9bd076fd1f760c0c9ba4c1db57e771..de9fc36a1eeb4a6cb6ebf772e64b103611e45296 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -297,6 +297,7 @@ public final class CraftServer implements Server { - public boolean ignoreVanillaPermissions = false; + public final boolean enumCompatibilityMode; private final List<CraftPlayer> playerView; public int reloadCount; + private final io.papermc.paper.datapack.PaperDatapackManager datapackManager; // Paper public static Exception excessiveVelEx; // Paper - Velocity warnings static { -@@ -384,6 +385,7 @@ public final class CraftServer implements Server { - if (this.configuration.getBoolean("settings.use-map-color-cache")) { - MapPalette.setMapColorCache(new CraftMapColorCache(this.logger)); +@@ -395,6 +396,7 @@ public final class CraftServer implements Server { + /*********************************************************/ + """); } -+ datapackManager = new io.papermc.paper.datapack.PaperDatapackManager(console.getPackRepository()); // Paper ++ this.datapackManager = new io.papermc.paper.datapack.PaperDatapackManager(console.getPackRepository()); // Paper } public boolean getCommandBlockOverride(String command) { -@@ -2847,5 +2849,11 @@ public final class CraftServer implements Server { +@@ -2861,5 +2863,11 @@ public final class CraftServer implements Server { public com.destroystokyo.paper.entity.ai.MobGoals getMobGoals() { return mobGoals; } diff --git a/patches/server/0605-additions-to-PlayerGameModeChangeEvent.patch b/patches/server/0605-additions-to-PlayerGameModeChangeEvent.patch index 2b20e4d74c..b67388677c 100644 --- a/patches/server/0605-additions-to-PlayerGameModeChangeEvent.patch +++ b/patches/server/0605-additions-to-PlayerGameModeChangeEvent.patch @@ -131,7 +131,7 @@ index 43221bf57fb4eeb70823c12b48f4df0bb817eb0b..e903371b370034f6447c5f23562fe5c9 } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 84c49a70c32c07580748d9a55f24902ce5be8c5b..582697f5bb1423ee5eae91d28b19c10889bf8904 100644 +index 126e68c41f3b6c9d7f2991904bbe3d6eb0dc7571..3b4b864274403c57867fbed209c663b28708938f 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2792,7 +2792,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -144,10 +144,10 @@ index 84c49a70c32c07580748d9a55f24902ce5be8c5b..582697f5bb1423ee5eae91d28b19c108 } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 0906de2fb92cbdcc47ed1b2393430a7ac33ae920..eab8e34a3768b380e6c171080adc8d22c6f4f85b 100644 +index 1acf9650f6400ee9530d5cb9fb55aa98d13cc222..b6d31bef8f532db7f5f9d77e498a4fdfd5336c7f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1501,7 +1501,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1523,7 +1523,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { Preconditions.checkArgument(mode != null, "GameMode cannot be null"); if (this.getHandle().connection == null) return; diff --git a/patches/server/0606-ItemStack-repair-check-API.patch b/patches/server/0606-ItemStack-repair-check-API.patch index 51821ed50d..68b8b54df0 100644 --- a/patches/server/0606-ItemStack-repair-check-API.patch +++ b/patches/server/0606-ItemStack-repair-check-API.patch @@ -5,19 +5,16 @@ Subject: [PATCH] ItemStack repair check API diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index e540a219e26ecb1b2f93df01a34dd754faea1f10..cab2f4ae154a6159ead1b95dbf02ebcbb1051dd8 100644 +index 2944ca24702bb5b8a3c548f5fda872ddb44e7573..d59368cc5d280935da1aac1d9322583527e8742d 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -543,6 +543,14 @@ public final class CraftMagicNumbers implements UnsafeValues { - return io.papermc.paper.inventory.ItemRarity.values()[getItem(itemStack.getType()).getRarity(CraftItemStack.asNMSCopy(itemStack)).ordinal()]; +@@ -593,6 +593,11 @@ public final class CraftMagicNumbers implements UnsafeValues { + return io.papermc.paper.inventory.ItemRarity.values()[((org.bukkit.craftbukkit.inventory.CraftItemType)itemStack.getType()).getHandle().getRarity(CraftItemStack.asNMSCopy(itemStack)).ordinal()]; } + @Override + public boolean isValidRepairItemStack(org.bukkit.inventory.ItemStack itemToBeRepaired, org.bukkit.inventory.ItemStack repairMaterial) { -+ if (!itemToBeRepaired.getType().isItem() || !repairMaterial.getType().isItem()) { -+ return false; -+ } -+ return CraftMagicNumbers.getItem(itemToBeRepaired.getType()).isValidRepairItem(CraftItemStack.asNMSCopy(itemToBeRepaired), CraftItemStack.asNMSCopy(repairMaterial)); ++ return ((org.bukkit.craftbukkit.inventory.CraftItemType) itemToBeRepaired.getType()).getHandle().isValidRepairItem(CraftItemStack.asNMSCopy(itemToBeRepaired), CraftItemStack.asNMSCopy(repairMaterial)); + } + @Override @@ -25,55 +22,47 @@ index e540a219e26ecb1b2f93df01a34dd754faea1f10..cab2f4ae154a6159ead1b95dbf02ebcb return net.minecraft.SharedConstants.getCurrentVersion().getProtocolVersion(); diff --git a/src/test/java/io/papermc/paper/util/ItemStackRepairCheckTest.java b/src/test/java/io/papermc/paper/util/ItemStackRepairCheckTest.java new file mode 100644 -index 0000000000000000000000000000000000000000..8d9c9b3bd53d407391d4fcb7fc773153d1a7b402 +index 0000000000000000000000000000000000000000..3cbdbc8c2ce21d90c8d0b60978d07590a3a76f7f --- /dev/null +++ b/src/test/java/io/papermc/paper/util/ItemStackRepairCheckTest.java -@@ -0,0 +1,48 @@ +@@ -0,0 +1,40 @@ +package io.papermc.paper.util; + -+import org.bukkit.Material; +import org.bukkit.inventory.ItemStack; ++import org.bukkit.inventory.ItemType; +import org.bukkit.support.AbstractTestingBase; +import org.junit.Test; + +import static org.junit.Assert.assertFalse; -+import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; + +public class ItemStackRepairCheckTest extends AbstractTestingBase { + + @Test -+ public void testIsRepariableBy() { -+ ItemStack diamondPick = new ItemStack(Material.DIAMOND_PICKAXE); ++ public void testIsRepairableBy() { ++ ItemStack diamondPick = ItemStack.of(ItemType.DIAMOND_PICKAXE); + -+ assertTrue("diamond pick isn't repairable by a diamond", diamondPick.isRepairableBy(new ItemStack(Material.DIAMOND))); ++ assertTrue("diamond pick isn't repairable by a diamond", diamondPick.isRepairableBy(ItemStack.of(ItemType.DIAMOND))); + } + + @Test + public void testCanRepair() { -+ ItemStack diamond = new ItemStack(Material.DIAMOND); ++ ItemStack diamond = ItemStack.of(ItemType.DIAMOND); + -+ assertTrue("diamond can't repair a diamond axe", diamond.canRepair(new ItemStack(Material.DIAMOND_AXE))); ++ assertTrue("diamond can't repair a diamond axe", diamond.canRepair(ItemStack.of(ItemType.DIAMOND_AXE))); + } + + @Test + public void testIsNotRepairableBy() { -+ ItemStack notDiamondPick = new ItemStack(Material.ACACIA_SAPLING); ++ ItemStack notDiamondPick = ItemStack.of(ItemType.ACACIA_SAPLING); + -+ assertFalse("acacia sapling is repairable by a diamond", notDiamondPick.isRepairableBy(new ItemStack(Material.DIAMOND))); ++ assertFalse("acacia sapling is repairable by a diamond", notDiamondPick.isRepairableBy(ItemStack.of(ItemType.DIAMOND))); + } + + @Test + public void testCanNotRepair() { -+ ItemStack diamond = new ItemStack(Material.DIAMOND); ++ ItemStack diamond = ItemStack.of(ItemType.DIAMOND); + -+ assertFalse("diamond can repair oak button", diamond.canRepair(new ItemStack(Material.OAK_BUTTON))); -+ } -+ -+ @Test -+ public void testInvalidItem() { -+ ItemStack badItemStack = new ItemStack(Material.ACACIA_WALL_SIGN); -+ -+ assertFalse("acacia wall sign is repairable by diamond", badItemStack.isRepairableBy(new ItemStack(Material.DIAMOND))); ++ assertFalse("diamond can repair oak button", diamond.canRepair(ItemStack.of(ItemType.OAK_BUTTON))); + } +} diff --git a/patches/server/0607-More-Enchantment-API.patch b/patches/server/0607-More-Enchantment-API.patch index afd4dec304..4c0ac986c2 100644 --- a/patches/server/0607-More-Enchantment-API.patch +++ b/patches/server/0607-More-Enchantment-API.patch @@ -7,10 +7,10 @@ Subject: [PATCH] More Enchantment API public net.minecraft.world.item.enchantment.Enchantment slots diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java -index 57decf4156f176ebcc988478c17856cbc555c5e4..3d0ce0803e1da8a2681a3cb41096ac942ece54a1 100644 +index 92cecdae6a4ab7c2876a42c7128453948a5a249a..284aa95d2a88e3cba5ddfea786cf763d1463bf4b 100644 --- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java +++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java -@@ -71,7 +71,7 @@ public class CraftEnchantment extends Enchantment { +@@ -81,7 +81,7 @@ public class CraftEnchantment extends Enchantment { @Override public boolean isCursed() { @@ -19,7 +19,7 @@ index 57decf4156f176ebcc988478c17856cbc555c5e4..3d0ce0803e1da8a2681a3cb41096ac94 } @Override -@@ -199,6 +199,45 @@ public class CraftEnchantment extends Enchantment { +@@ -127,6 +127,45 @@ public class CraftEnchantment extends Enchantment { public String translationKey() { return this.target.getDescriptionId(); } @@ -66,10 +66,10 @@ index 57decf4156f176ebcc988478c17856cbc555c5e4..3d0ce0803e1da8a2681a3cb41096ac94 public net.minecraft.world.item.enchantment.Enchantment getHandle() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 63a1522071ec6e9a550598b04c1a901ff76a5c78..d7499a2ffdc21ded42f7973e35ace340ff276f5a 100644 +index a5715406f99c97c5b785d8a1e0afdafc38ca06f2..df58ef33a9997c375e51838fba1c3c1a1ad5487e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -927,5 +927,21 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -925,5 +925,21 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { public void setHurtDirection(float hurtDirection) { throw new UnsupportedOperationException("Cannot set the hurt direction on a non player"); } diff --git a/patches/server/0609-Fix-and-optimise-world-force-upgrading.patch b/patches/server/0609-Fix-and-optimise-world-force-upgrading.patch index dae741c23f..706f1fe919 100644 --- a/patches/server/0609-Fix-and-optimise-world-force-upgrading.patch +++ b/patches/server/0609-Fix-and-optimise-world-force-upgrading.patch @@ -362,10 +362,10 @@ index 29da08c58200c24fd03003937d30eb41234cabc9..d3d4d10a77af51cff4da201201bac325 public synchronized RegionFile getRegionFileIfLoaded(ChunkPos chunkcoordintpair) { return this.regionCache.getAndMoveToFirst(ChunkPos.asLong(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ())); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 532c4f79e0926e029e78bc796238e54fd5f63023..95f2490000e3f49644d6795a4c4c67ee0674fbf9 100644 +index de9fc36a1eeb4a6cb6ebf772e64b103611e45296..2ff97603e5e6ef4a9bea49c05bfe2f3e2bafdbf5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1230,9 +1230,7 @@ public final class CraftServer implements Server { +@@ -1241,9 +1241,7 @@ public final class CraftServer implements Server { worlddata.checkName(name); worlddata.setModdedInfo(this.console.getServerModName(), this.console.getModdedStatus().shouldReportAsModified()); @@ -376,7 +376,7 @@ index 532c4f79e0926e029e78bc796238e54fd5f63023..95f2490000e3f49644d6795a4c4c67ee long j = BiomeManager.obfuscateSeed(creator.seed()); List<CustomSpawner> list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(worlddata)); -@@ -1243,6 +1241,13 @@ public final class CraftServer implements Server { +@@ -1254,6 +1252,13 @@ public final class CraftServer implements Server { biomeProvider = generator.getDefaultBiomeProvider(worldInfo); } diff --git a/patches/server/0614-Add-cause-to-Weather-ThunderChangeEvents.patch b/patches/server/0613-Add-cause-to-Weather-ThunderChangeEvents.patch index 3b0c93464b..3a53d28a2a 100644 --- a/patches/server/0614-Add-cause-to-Weather-ThunderChangeEvents.patch +++ b/patches/server/0613-Add-cause-to-Weather-ThunderChangeEvents.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add cause to Weather/ThunderChangeEvents diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 6fc54777e15cebaef7e30702f8537a9a337ad2ed..e63cb62affc88d1482f9926ae459986e2d213fb0 100644 +index 3a887bdc391184b9b676568eee7fe1cb5cd53bbd..618ac96f5abcf6e3def9fe16d6c5da1d8c122979 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -672,8 +672,8 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -95,10 +95,10 @@ index 626b861ef2f323a5fc50ab5178d3e108e0f9cc25..31c31a9138cb5f6e41de01a6210f84e7 if (weather.isCancelled()) { return; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index f5de2359af2a7dc3c2f9cd4daec3aeae86fae153..139265ff015bba7517ccbbcc890610d00362142e 100644 +index b8bf03012e5fc3781173065d1784e9d69007ebaa..c6361acd43ae59747aa5e845dedb18c90365a8f7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1186,7 +1186,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1187,7 +1187,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setStorm(boolean hasStorm) { @@ -107,7 +107,7 @@ index f5de2359af2a7dc3c2f9cd4daec3aeae86fae153..139265ff015bba7517ccbbcc890610d0 this.setWeatherDuration(0); // Reset weather duration (legacy behaviour) this.setClearWeatherDuration(0); // Reset clear weather duration (reset "/weather clear" commands) } -@@ -1208,7 +1208,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1209,7 +1209,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @Override public void setThundering(boolean thundering) { diff --git a/patches/server/0613-Attributes-API-for-item-defaults.patch b/patches/server/0613-Attributes-API-for-item-defaults.patch deleted file mode 100644 index 003b920e39..0000000000 --- a/patches/server/0613-Attributes-API-for-item-defaults.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic <[email protected]> -Date: Sat, 8 May 2021 15:01:54 -0700 -Subject: [PATCH] Attributes API for item defaults - - -diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index cab2f4ae154a6159ead1b95dbf02ebcbb1051dd8..7f870317139db136103cb72b2aa57bcba9f6e793 100644 ---- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -551,6 +551,19 @@ public final class CraftMagicNumbers implements UnsafeValues { - return CraftMagicNumbers.getItem(itemToBeRepaired.getType()).isValidRepairItem(CraftItemStack.asNMSCopy(itemToBeRepaired), CraftItemStack.asNMSCopy(repairMaterial)); - } - -+ @Override -+ public Multimap<Attribute, AttributeModifier> getItemAttributes(Material material, EquipmentSlot equipmentSlot) { -+ Item item = CraftMagicNumbers.getItem(material); -+ if (item == null) { -+ throw new IllegalArgumentException(material + " is not an item and therefore does not have attributes"); -+ } -+ ImmutableMultimap.Builder<Attribute, AttributeModifier> attributeMapBuilder = ImmutableMultimap.builder(); -+ item.getDefaultAttributeModifiers(CraftEquipmentSlot.getNMS(equipmentSlot)).forEach((attributeBase, attributeModifier) -> { -+ attributeMapBuilder.put(CraftAttributeMap.fromMinecraft(net.minecraft.core.registries.BuiltInRegistries.ATTRIBUTE.getKey(attributeBase).toString()), CraftAttributeInstance.convert(attributeModifier, equipmentSlot)); -+ }); -+ return attributeMapBuilder.build(); -+ } -+ - @Override - public int getProtocolVersion() { - return net.minecraft.SharedConstants.getCurrentVersion().getProtocolVersion(); diff --git a/patches/server/0615-More-Lidded-Block-API.patch b/patches/server/0614-More-Lidded-Block-API.patch index 135fd68698..e1f44c2b5a 100644 --- a/patches/server/0615-More-Lidded-Block-API.patch +++ b/patches/server/0614-More-Lidded-Block-API.patch @@ -21,7 +21,7 @@ index 9d0c272b1d89a96b0b63603fa8e4649f11fb6c51..d5fdf4504a0ca76fb0483f4ae5861c93 + // Paper end - More Lidded Block API } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java -index 82b3f3b3aced73ce136b6b94fe212972ac6090ef..b4bc5cbb71007b4d1a27bb841ff787a95e9ecbdc 100644 +index 07b0c7409d4d1698e1527242293d1c1e1686153f..211738a8e995e201fc43fce0ba45737ec85cc7ad 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java @@ -78,4 +78,11 @@ public class CraftChest extends CraftLootable<ChestBlockEntity> implements Chest @@ -53,7 +53,7 @@ index 6513acb46591b2903d1baf18c23ed1fc8c2a731f..b8ab67fd1820613520203f708f2f2675 + // Paper end - More Lidded Block API } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java b/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java -index 2d5205a9adfa66545f40a13bf0e37dc62ac0fdb9..72074b4c0feea8136e80589345538552ce28a2ea 100644 +index 5466a8fe8500bdc8047d9f9eab3463cb9bdbea8a..84c32d6d2e4f7bd52ac8613b40447959305e60ce 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java @@ -55,8 +55,15 @@ public class CraftShulkerBox extends CraftLootable<ShulkerBoxBlockEntity> implem diff --git a/patches/server/0616-Limit-item-frame-cursors-on-maps.patch b/patches/server/0615-Limit-item-frame-cursors-on-maps.patch index 8e8559a185..8e8559a185 100644 --- a/patches/server/0616-Limit-item-frame-cursors-on-maps.patch +++ b/patches/server/0615-Limit-item-frame-cursors-on-maps.patch diff --git a/patches/server/0617-Add-PlayerKickEvent-causes.patch b/patches/server/0616-Add-PlayerKickEvent-causes.patch index 9980e252bf..4786ee56bb 100644 --- a/patches/server/0617-Add-PlayerKickEvent-causes.patch +++ b/patches/server/0616-Add-PlayerKickEvent-causes.patch @@ -88,7 +88,7 @@ index c68bac4727f6b2ca95fc8c438303097af14286f2..bb629ec263959c8268de88ca807bddb6 return Component.translatable("commands.kick.success", serverPlayer.getDisplayName(), reason); }, true); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 75ab3e102caead4f9bdfbf74772d998f9da9c723..76d8c5c5029ac564d05144cef5030c6b64df9a98 100644 +index 5b9ced448194e790c2aa7a1aa2dab1d6ef1fd058..21ed0a8b4b04df1abe84f4f3572855ad63ce1671 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -362,7 +362,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -491,7 +491,7 @@ index 984c288abf94d9fe47fada33722fea035b832f3b..addd20237b87c9a87bb09fd7addb101a } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index eab8e34a3768b380e6c171080adc8d22c6f4f85b..c11ca0b9601ef90f19f61cce029cafcfac3c1619 100644 +index b6d31bef8f532db7f5f9d77e498a4fdfd5336c7f..4aab071d6f8b26bd69f1fb639a78eac6f99c9071 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -577,7 +577,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0618-Add-PufferFishStateChangeEvent.patch b/patches/server/0617-Add-PufferFishStateChangeEvent.patch index 091a042a02..091a042a02 100644 --- a/patches/server/0618-Add-PufferFishStateChangeEvent.patch +++ b/patches/server/0617-Add-PufferFishStateChangeEvent.patch diff --git a/patches/server/0619-Fix-PlayerBucketEmptyEvent-result-itemstack.patch b/patches/server/0618-Fix-PlayerBucketEmptyEvent-result-itemstack.patch index adbc2300b0..adbc2300b0 100644 --- a/patches/server/0619-Fix-PlayerBucketEmptyEvent-result-itemstack.patch +++ b/patches/server/0618-Fix-PlayerBucketEmptyEvent-result-itemstack.patch diff --git a/patches/server/0620-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch b/patches/server/0619-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch index 21b2143546..21b2143546 100644 --- a/patches/server/0620-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch +++ b/patches/server/0619-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch diff --git a/patches/server/0621-Add-option-to-fix-items-merging-through-walls.patch b/patches/server/0620-Add-option-to-fix-items-merging-through-walls.patch index ca8770c5bd..ca8770c5bd 100644 --- a/patches/server/0621-Add-option-to-fix-items-merging-through-walls.patch +++ b/patches/server/0620-Add-option-to-fix-items-merging-through-walls.patch diff --git a/patches/server/0622-Add-BellRevealRaiderEvent.patch b/patches/server/0621-Add-BellRevealRaiderEvent.patch index ed8e81f6a2..ed8e81f6a2 100644 --- a/patches/server/0622-Add-BellRevealRaiderEvent.patch +++ b/patches/server/0621-Add-BellRevealRaiderEvent.patch diff --git a/patches/server/0623-Fix-invulnerable-end-crystals.patch b/patches/server/0622-Fix-invulnerable-end-crystals.patch index b023697625..b023697625 100644 --- a/patches/server/0623-Fix-invulnerable-end-crystals.patch +++ b/patches/server/0622-Fix-invulnerable-end-crystals.patch diff --git a/patches/server/0624-Add-ElderGuardianAppearanceEvent.patch b/patches/server/0623-Add-ElderGuardianAppearanceEvent.patch index 76665d8084..76665d8084 100644 --- a/patches/server/0624-Add-ElderGuardianAppearanceEvent.patch +++ b/patches/server/0623-Add-ElderGuardianAppearanceEvent.patch diff --git a/patches/server/0625-Fix-dangerous-end-portal-logic.patch b/patches/server/0624-Fix-dangerous-end-portal-logic.patch index a28edf1edc..a28edf1edc 100644 --- a/patches/server/0625-Fix-dangerous-end-portal-logic.patch +++ b/patches/server/0624-Fix-dangerous-end-portal-logic.patch diff --git a/patches/server/0626-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch b/patches/server/0625-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch index ef457d74af..ef457d74af 100644 --- a/patches/server/0626-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch +++ b/patches/server/0625-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch diff --git a/patches/server/0627-Make-item-validations-configurable.patch b/patches/server/0626-Make-item-validations-configurable.patch index 15390d1f92..2271bf42dd 100644 --- a/patches/server/0627-Make-item-validations-configurable.patch +++ b/patches/server/0626-Make-item-validations-configurable.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Make item validations configurable diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java -index cf928745c36af0e6fa0a95e177395c5fb1aa821a..2a08b1ac6e9aac81012997637b4cad59f0f1125a 100644 +index 792c69fa8efbcb06d904d2f1337b7125fcb99575..5a0cfeccf548a36f3901893aeab4c97926687aa6 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java @@ -88,11 +88,11 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta { @@ -32,10 +32,10 @@ index cf928745c36af0e6fa0a95e177395c5fb1aa821a..2a08b1ac6e9aac81012997637b4cad59 } } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index fa94030ac80c8c68ee429e6b7350395208e4348f..ac9fb7cf96ed36162c4f6c2a834b627d0120f3cc 100644 +index ad6128ad7c48402a2415c6a12c867eac1a25cd4f..5c526f7e125e3b50e6f0178e43515f931cc6defc 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -360,7 +360,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -365,7 +365,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { CompoundTag display = tag.getCompound(DISPLAY.NBT); if (display.contains(NAME.NBT)) { @@ -44,7 +44,7 @@ index fa94030ac80c8c68ee429e6b7350395208e4348f..ac9fb7cf96ed36162c4f6c2a834b627d } if (display.contains(LOCNAME.NBT)) { -@@ -371,7 +371,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -376,7 +376,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { ListTag list = display.getList(LORE.NBT, CraftMagicNumbers.NBT.TAG_STRING); this.lore = new ArrayList<String>(list.size()); for (int index = 0; index < list.size(); index++) { diff --git a/patches/server/0628-Line-Of-Sight-Changes.patch b/patches/server/0627-Line-Of-Sight-Changes.patch index e58b9a605f..ff9bb53503 100644 --- a/patches/server/0628-Line-Of-Sight-Changes.patch +++ b/patches/server/0627-Line-Of-Sight-Changes.patch @@ -19,10 +19,10 @@ index bce63453fb04db09b10550197f749c959b30a37e..62e8586d30950eed81868ccbb48212a4 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -index 9160fc90afce3c589cf6a3ddb829d56e045b20fa..248c8abf6620ac78b8a4fd1476d7b20862c6125b 100644 +index 4d2451ac57de1bb248169c266b111f102670c606..82de88fef79b2bffffce2264f3a62e946749768e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -@@ -992,5 +992,16 @@ public abstract class CraftRegionAccessor implements RegionAccessor { +@@ -994,5 +994,16 @@ public abstract class CraftRegionAccessor implements RegionAccessor { public org.bukkit.NamespacedKey getKey() { return org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(this.getHandle().getLevel().dimension().location()); } @@ -40,10 +40,10 @@ index 9160fc90afce3c589cf6a3ddb829d56e045b20fa..248c8abf6620ac78b8a4fd1476d7b208 // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index d7499a2ffdc21ded42f7973e35ace340ff276f5a..b56504c3e5c457bfe83bbc864dc217c2f0cc9d18 100644 +index df58ef33a9997c375e51838fba1c3c1a1ad5487e..7240a9bea74589be9e29e0e05d843ca14a361b45 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -575,6 +575,18 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -573,6 +573,18 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { return this.getHandle().hasLineOfSight(((CraftEntity) other).getHandle()); } diff --git a/patches/server/0629-add-per-world-spawn-limits.patch b/patches/server/0628-add-per-world-spawn-limits.patch index 8b6813991f..07e471e783 100644 --- a/patches/server/0629-add-per-world-spawn-limits.patch +++ b/patches/server/0628-add-per-world-spawn-limits.patch @@ -6,10 +6,10 @@ Subject: [PATCH] add per world spawn limits Taken from #2982. Credit to Chasewhip8 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 139265ff015bba7517ccbbcc890610d00362142e..7edcc68a24bd812f50d9ce441fab568906061da3 100644 +index c6361acd43ae59747aa5e845dedb18c90365a8f7..3cf8dd8b3e63db60a3fe9ef2610bec4597485a6e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -212,6 +212,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -213,6 +213,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { this.biomeProvider = biomeProvider; this.environment = env; diff --git a/patches/server/0630-Fix-potions-splash-events.patch b/patches/server/0629-Fix-potions-splash-events.patch index ac9546298b..ac9546298b 100644 --- a/patches/server/0630-Fix-potions-splash-events.patch +++ b/patches/server/0629-Fix-potions-splash-events.patch diff --git a/patches/server/0631-Add-more-LimitedRegion-API.patch b/patches/server/0630-Add-more-LimitedRegion-API.patch index af3f4ff82e..25b0a93f29 100644 --- a/patches/server/0631-Add-more-LimitedRegion-API.patch +++ b/patches/server/0630-Add-more-LimitedRegion-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add more LimitedRegion API diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java b/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java -index bc606693566419c143d19284b110961602c2810b..23ffe4b8a19286543e12bf7408879e6d1305a78f 100644 +index 429a2cef96666d82218032f9864bfe05fb9a4020..23fbaa5c086f1d6f2c858dfc46619a51b113a22d 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java @@ -249,4 +249,45 @@ public class CraftLimitedRegion extends CraftRegionAccessor implements LimitedRe diff --git a/patches/server/0632-Fix-PlayerDropItemEvent-using-wrong-item.patch b/patches/server/0631-Fix-PlayerDropItemEvent-using-wrong-item.patch index 07077c14b3..07077c14b3 100644 --- a/patches/server/0632-Fix-PlayerDropItemEvent-using-wrong-item.patch +++ b/patches/server/0631-Fix-PlayerDropItemEvent-using-wrong-item.patch diff --git a/patches/server/0633-Missing-Entity-Behavior-API.patch b/patches/server/0632-Missing-Entity-Behavior-API.patch index 91ea359d06..dd1b82869c 100644 --- a/patches/server/0633-Missing-Entity-Behavior-API.patch +++ b/patches/server/0632-Missing-Entity-Behavior-API.patch @@ -358,10 +358,10 @@ index 61d4877b4f74362e38104bfeacb7d66534ad798e..454dd67920826b8b62c2654abfd43fc0 @Override protected EntityHitResult findHitEntity(Vec3 currentPosition, Vec3 nextPosition) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -index 248c8abf6620ac78b8a4fd1476d7b20862c6125b..7318209de454b233e22c20b176cb207de7f86674 100644 +index 82de88fef79b2bffffce2264f3a62e946749768e..a779e70dd6d2d258c2272bd25d46fe63796f1f18 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -@@ -828,14 +828,19 @@ public abstract class CraftRegionAccessor implements RegionAccessor { +@@ -830,14 +830,19 @@ public abstract class CraftRegionAccessor implements RegionAccessor { } else if (Phantom.class.isAssignableFrom(clazz)) { entity = net.minecraft.world.entity.EntityType.PHANTOM.create(world); } else if (Fish.class.isAssignableFrom(clazz)) { @@ -429,10 +429,10 @@ index 3f1f4d65525562b3117fdc21c8a7f535b12c3c46..90a989c7c9de6f9ba55ab640761915e9 + // Paper end - Horse API } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBat.java -index 3b960a832df1fe496ea036962083f1ac507a7db7..e405488ba5e0159ff84a72fac1d2da6e9c45238e 100644 +index f049fd8b8fdfca6e64010741d000a2e3efddc83b..7592ecac3d0893974d9d22ce40c50f1008ab9695 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBat.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBat.java -@@ -33,4 +33,25 @@ public class CraftBat extends CraftAmbient implements Bat { +@@ -27,4 +27,25 @@ public class CraftBat extends CraftAmbient implements Bat { public void setAwake(boolean state) { this.getHandle().setResting(!state); } @@ -459,10 +459,10 @@ index 3b960a832df1fe496ea036962083f1ac507a7db7..e405488ba5e0159ff84a72fac1d2da6e + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBee.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBee.java -index 099c2422d03ebb6ee36f5c93f4cfad5acd2fdeeb..e222a6ab6afbc43a3d358a79855a818b0e481fdb 100644 +index 86ad6073a130100258908d3f2c93c54e21e998f3..17608e0e8cc5288905d2e42ae1429f7d947511fb 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBee.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBee.java -@@ -92,4 +92,42 @@ public class CraftBee extends CraftAnimals implements Bee { +@@ -86,4 +86,42 @@ public class CraftBee extends CraftAnimals implements Bee { public void setCannotEnterHiveTicks(int ticks) { this.getHandle().setStayOutOfHiveCountdown(ticks); } @@ -506,13 +506,13 @@ index 099c2422d03ebb6ee36f5c93f4cfad5acd2fdeeb..e222a6ab6afbc43a3d358a79855a818b + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java -index d2531a2a323be74169324a5cb2c558655c380ea6..273a062090f4c6f6ffd5a4238623b32af497f6b6 100644 +index 42eaa53b333c38859224e0e13600c20226bc7bc4..689792ae70b2e94b1e3def6e6ba37492f64ef769 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java -@@ -50,4 +50,25 @@ public class CraftCat extends CraftTameableAnimal implements Cat { - public void setCollarColor(DyeColor color) { +@@ -49,6 +49,28 @@ public class CraftCat extends CraftTameableAnimal implements Cat { this.getHandle().setCollarColor(net.minecraft.world.item.DyeColor.byId(color.getWoolData())); } + + // Paper Start - More cat api + @Override + public void setLyingDown(boolean lyingDown) { @@ -534,15 +534,19 @@ index d2531a2a323be74169324a5cb2c558655c380ea6..273a062090f4c6f6ffd5a4238623b32a + return this.getHandle().isRelaxStateOne(); + } + // Paper End - More cat api - } ++ + public static class CraftType extends Type { + private static int count = 0; + diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftChicken.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftChicken.java -index 178328042ad62f32ca2ae14a6bcf2b694418eb8c..fd87f979ee207dac13e4028d76bdd40911509e56 100644 +index c2c653e269330b8494eca98e9cf5a4abb79a6933..5e0b611db52452c00bf3cd2fc07dd713f238a581 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftChicken.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftChicken.java -@@ -24,4 +24,25 @@ public class CraftChicken extends CraftAnimals implements Chicken { - public EntityType getType() { - return EntityType.CHICKEN; +@@ -18,4 +18,26 @@ public class CraftChicken extends CraftAnimals implements Chicken { + public String toString() { + return "CraftChicken"; } ++ + // Paper start + @Override + public boolean isChickenJockey() { @@ -566,12 +570,12 @@ index 178328042ad62f32ca2ae14a6bcf2b694418eb8c..fd87f979ee207dac13e4028d76bdd409 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCod.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCod.java -index fb4b3d30eded561f526dbd2daa74e49149eb55ac..801ed8241cad4ac890a6d99cd19a3dd7490d9339 100644 +index fa0bf7db880063427ba12df1df1c72240fff93e9..63e6b07e3b159c74d9ef17be20b5ab43d07f0f5f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCod.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCod.java -@@ -4,7 +4,7 @@ import org.bukkit.craftbukkit.CraftServer; +@@ -3,7 +3,7 @@ package org.bukkit.craftbukkit.entity; + import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Cod; - import org.bukkit.entity.EntityType; -public class CraftCod extends CraftFish implements Cod { +public class CraftCod extends io.papermc.paper.entity.PaperSchoolableFish implements Cod { // Paper - School Fish API @@ -579,10 +583,10 @@ index fb4b3d30eded561f526dbd2daa74e49149eb55ac..801ed8241cad4ac890a6d99cd19a3dd7 public CraftCod(CraftServer server, net.minecraft.world.entity.animal.Cod entity) { super(server, entity); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java -index fe829a74e23442c93bb5565589e8f33300ea01e1..57704564acc11ea688026aad8be4e612e36803ff 100644 +index cb161c3d1a08d9c143201040018664298e98eafe..92eb829161079c4a96447698aee58cc6e7cbd29f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java -@@ -41,6 +41,28 @@ public class CraftEnderman extends CraftMonster implements Enderman { +@@ -40,6 +40,28 @@ public class CraftEnderman extends CraftMonster implements Enderman { this.getHandle().setCarriedBlock(blockData == null ? null : ((CraftBlockData) blockData).getState()); } @@ -612,10 +616,10 @@ index fe829a74e23442c93bb5565589e8f33300ea01e1..57704564acc11ea688026aad8be4e612 public EnderMan getHandle() { return (EnderMan) entity; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEndermite.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEndermite.java -index 04976616da8c85b1278dad33ff05554aa74a6b33..75c7645fb5732c43d1da15181cf5c7ee4c3ecd6c 100644 +index fc0f0e841dc974d080e1abb9bbafb5165801131f..d657fd2c507a5b215aeab0a5f3e9c2ee892a27c8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEndermite.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEndermite.java -@@ -34,4 +34,15 @@ public class CraftEndermite extends CraftMonster implements Endermite { +@@ -28,4 +28,15 @@ public class CraftEndermite extends CraftMonster implements Endermite { public void setPlayerSpawned(boolean playerSpawned) { // Nop } @@ -632,10 +636,10 @@ index 04976616da8c85b1278dad33ff05554aa74a6b33..75c7645fb5732c43d1da15181cf5c7ee + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index d3eaf054b1815003934e7f2d904a05a5d8abc3a5..02dc40b6f7b82ce503c33fb4af26cbb20c9d5b7a 100644 +index 2578d45a1fa43e4c9f004ab8afc1d8147cabfe8f..ec2c989f690020cd9959fac877bae0a0263872fa 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -227,10 +227,16 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -233,10 +233,16 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { else { return new CraftSquid(server, (Squid) entity); } } else if (entity instanceof AbstractFish) { @@ -656,10 +660,10 @@ index d3eaf054b1815003934e7f2d904a05a5d8abc3a5..02dc40b6f7b82ce503c33fb4af26cbb2 else { return new CraftFish(server, (AbstractFish) entity); } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java -index 007b69c201672483103397c945634d7518f5861c..9e5c9b1c4299986b2fae7e191d7661549376a331 100644 +index 08911b340c45f0b6d4657bfe46f0b153997e4d49..6149067a14b950e727d3387055016a19e55c0fc6 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java -@@ -119,4 +119,41 @@ public class CraftFox extends CraftAnimals implements Fox { +@@ -113,4 +113,41 @@ public class CraftFox extends CraftAnimals implements Fox { public boolean isFaceplanted() { return this.getHandle().isFaceplanted(); } @@ -702,10 +706,10 @@ index 007b69c201672483103397c945634d7518f5861c..9e5c9b1c4299986b2fae7e191d766154 + // Paper end - Add more fox behavior API } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftGhast.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftGhast.java -index 9e7a9520737f56a20a130b624ae66f3ee90fa3e7..814cded47a04c25391575af036f53dc409121813 100644 +index 24938472b7898c4111a1f7244b207fd32fcf6e80..3adcf36c7b4beb0f752f91b7333593a610ec118c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftGhast.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftGhast.java -@@ -34,4 +34,17 @@ public class CraftGhast extends CraftFlying implements Ghast, CraftEnemy { +@@ -28,4 +28,17 @@ public class CraftGhast extends CraftFlying implements Ghast, CraftEnemy { public void setCharging(boolean flag) { this.getHandle().setCharging(flag); } @@ -724,12 +728,12 @@ index 9e7a9520737f56a20a130b624ae66f3ee90fa3e7..814cded47a04c25391575af036f53dc4 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java -index 5500d5768bb22f70b99aa28cf4541b4871e12139..4d7a2c4c1001aefe9fcd4be8dbcb414f721bfff9 100644 +index 9986ac517e11b076a29a8c8e3f480ec286fa5825..0ad16ee7b33582d214dab41eeee378d52c8e38ed 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java -@@ -64,4 +64,36 @@ public class CraftLlama extends CraftChestedHorse implements Llama, com.destroys - public EntityType getType() { - return EntityType.LLAMA; +@@ -58,4 +58,36 @@ public class CraftLlama extends CraftChestedHorse implements Llama, com.destroys + public String toString() { + return "CraftLlama"; } + + // Paper start @@ -765,10 +769,10 @@ index 5500d5768bb22f70b99aa28cf4541b4871e12139..4d7a2c4c1001aefe9fcd4be8dbcb414f + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java -index ee9648739fb39c5842063d7442df6eb5c9336d7f..67fe56cc4c2af24f6bd883c6e14851019b0b9523 100644 +index 3ba7e8ef1035e1de2c195b6919fe57aee398af51..fbabf86510c582e372b0b1ac5585c7287734c985 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java -@@ -39,4 +39,20 @@ public final class CraftMinecartHopper extends CraftMinecartContainer implements +@@ -33,4 +33,20 @@ public final class CraftMinecartHopper extends CraftMinecartContainer implements public void setEnabled(boolean enabled) { ((MinecartHopper) getHandle()).setEnabled(enabled); } @@ -790,10 +794,10 @@ index ee9648739fb39c5842063d7442df6eb5c9336d7f..67fe56cc4c2af24f6bd883c6e1485101 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java -index 383c6d464e8077eeb900d61baa6a02f15a818b01..20eaa3424428b8b30fd15591b660983cb7fc4375 100644 +index de54d45d1764228bdbfb5a73173b551f25440898..3e0049c2442c5941e02da0b0fb643784746cb2a1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java -@@ -28,6 +28,38 @@ public class CraftMushroomCow extends CraftCow implements MushroomCow { +@@ -27,6 +27,38 @@ public class CraftMushroomCow extends CraftCow implements MushroomCow { this.getHandle().setVariant(net.minecraft.world.entity.animal.MushroomCow.MushroomType.values()[variant.ordinal()]); } @@ -833,10 +837,10 @@ index 383c6d464e8077eeb900d61baa6a02f15a818b01..20eaa3424428b8b30fd15591b660983c public String toString() { return "CraftMushroomCow"; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPanda.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPanda.java -index ff9f711b83a8ea1bf4135751a9ba865224bce787..1f6dcad764240e15083731d017f9bb1c5c84622f 100644 +index 5467e4a74b70ff57b49d9e6bc686c493178f8511..56f9630dbe5d18d5ec33dc85f6531723022d6a3b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPanda.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPanda.java -@@ -46,6 +46,32 @@ public class CraftPanda extends CraftAnimals implements Panda { +@@ -40,6 +40,32 @@ public class CraftPanda extends CraftAnimals implements Panda { public void setHiddenGene(Gene gene) { this.getHandle().setHiddenGene(CraftPanda.toNms(gene)); } @@ -870,10 +874,10 @@ index ff9f711b83a8ea1bf4135751a9ba865224bce787..1f6dcad764240e15083731d017f9bb1c @Override public boolean isRolling() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java -index 6b71f8b373ef524f5df16023b773e92249bb2532..63e31c237dc3cf37a5e06c1cf3f030c9f1df3d38 100644 +index 9304e201db1ec96d0916aa8ea781f3e4bc7991e6..8338effd39b1709dbe578e247710a8e58d83e3aa 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java -@@ -50,5 +50,25 @@ public class CraftPhantom extends CraftFlying implements Phantom, CraftEnemy { +@@ -44,5 +44,25 @@ public class CraftPhantom extends CraftFlying implements Phantom, CraftEnemy { public void setShouldBurnInDay(boolean shouldBurnInDay) { getHandle().setShouldBurnInDay(shouldBurnInDay); } @@ -900,10 +904,10 @@ index 6b71f8b373ef524f5df16023b773e92249bb2532..63e31c237dc3cf37a5e06c1cf3f030c9 // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java -index aeda5fc001fe4ce55ee467240b275b6050a29f98..48d0a4e42e1b90d1323784d1284acabfe9497dd6 100644 +index ee69aff7ea348c8b0d2b272451ffd36d39bb0e0e..44cadd6f7ffab3dc866d847ea88bf8ba27b62283 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java -@@ -90,4 +90,15 @@ public class CraftPiglin extends CraftPiglinAbstract implements Piglin, com.dest +@@ -84,4 +84,15 @@ public class CraftPiglin extends CraftPiglinAbstract implements Piglin, com.dest public String toString() { return "CraftPiglin"; } @@ -920,12 +924,12 @@ index aeda5fc001fe4ce55ee467240b275b6050a29f98..48d0a4e42e1b90d1323784d1284acabf + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPolarBear.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPolarBear.java -index da1488c9cae53bd554727c850da2192adda2478a..30a0eac179c86b0fe94a2a40b5bfcd3eee01e53b 100644 +index bf216a7b5438a16f1f50fa6d2fb67eebe1408ad3..3c4cbde06c768912332edf57768eabe082e47345 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPolarBear.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPolarBear.java -@@ -23,4 +23,16 @@ public class CraftPolarBear extends CraftAnimals implements PolarBear { - public EntityType getType() { - return EntityType.POLAR_BEAR; +@@ -17,4 +17,16 @@ public class CraftPolarBear extends CraftAnimals implements PolarBear { + public String toString() { + return "CraftPolarBear"; } + + // Paper start @@ -941,10 +945,10 @@ index da1488c9cae53bd554727c850da2192adda2478a..30a0eac179c86b0fe94a2a40b5bfcd3e + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java -index 3bdcc754a5afb6506178bd5c0d4f9c6e02bc24da..3cb4860fea30bfaf2147b4f29a34336b6e417d6c 100644 +index 28e3bac4847dbbb67b966fe36f7220f041ebed15..6225710209cb67d0d20bfe86da13cc76c0fcf50a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftRabbit.java -@@ -48,4 +48,15 @@ public class CraftRabbit extends CraftAnimals implements Rabbit { +@@ -42,4 +42,15 @@ public class CraftRabbit extends CraftAnimals implements Rabbit { entity.setVariant(net.minecraft.world.entity.animal.Rabbit.Variant.values()[type.ordinal()]); } @@ -961,12 +965,12 @@ index 3bdcc754a5afb6506178bd5c0d4f9c6e02bc24da..3cb4860fea30bfaf2147b4f29a34336b + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftRaider.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftRaider.java -index 7345a644b57c8022d9e326575419c87551c4e8fc..f0b061979f9acdce6d06f70b651692c841418d96 100644 +index 26aa9d997c881961b6c5f3ffaecaf9574ef98e20..c07f44a20ee16a5e0a006b6f938c23992316ff30 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftRaider.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftRaider.java @@ -63,4 +63,16 @@ public abstract class CraftRaider extends CraftMonster implements Raider { public Sound getCelebrationSound() { - return CraftSound.getBukkit(this.getHandle().getCelebrateSound()); + return CraftSound.minecraftToBukkit(this.getHandle().getCelebrateSound()); } + + // Paper start @@ -982,10 +986,10 @@ index 7345a644b57c8022d9e326575419c87551c4e8fc..f0b061979f9acdce6d06f70b651692c8 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftRavager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftRavager.java -index 796b784d7a50e3a4aea5c67b7cd16d288ed392b0..84899714b96a7ed31ceee10373a62c37cab2ad2a 100644 +index cae59f77c704a5b9515dc4917ed5fdc89631ecfb..09796ce15658e3f7c223a265a547a51ee729ed40 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftRavager.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftRavager.java -@@ -24,4 +24,35 @@ public class CraftRavager extends CraftRaider implements Ravager { +@@ -18,4 +18,35 @@ public class CraftRavager extends CraftRaider implements Ravager { public String toString() { return "CraftRavager"; } @@ -1022,11 +1026,11 @@ index 796b784d7a50e3a4aea5c67b7cd16d288ed392b0..84899714b96a7ed31ceee10373a62c37 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSalmon.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSalmon.java -index f27a451f2e2343ab66c8cae24053fd1b6a0ea086..c888415f9b4f19db69667525e37279ab8be794f6 100644 +index b8140aa25a25870259b5644091c6643da1e14b54..d4d8ce60098c74508e2de9541bf6534988779764 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSalmon.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSalmon.java -@@ -4,7 +4,7 @@ import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.entity.EntityType; +@@ -3,7 +3,7 @@ package org.bukkit.craftbukkit.entity; + import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Salmon; -public class CraftSalmon extends CraftFish implements Salmon { @@ -1035,10 +1039,10 @@ index f27a451f2e2343ab66c8cae24053fd1b6a0ea086..c888415f9b4f19db69667525e37279ab public CraftSalmon(CraftServer server, net.minecraft.world.entity.animal.Salmon entity) { super(server, entity); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTadpole.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTadpole.java -index 1dfd4d92dfcb55d26fc5e9adfd1df3fbc9f02ca0..43c2d820d164d36a28c4920d70aea2fe5096763a 100644 +index 0e23bb2d8754a4124126803a6bbca22129d32381..730a25ef2fe934f64f65c21e4e007cf1dbab8bf2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTadpole.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTadpole.java -@@ -34,4 +34,15 @@ public class CraftTadpole extends CraftFish implements org.bukkit.entity.Tadpole +@@ -28,4 +28,15 @@ public class CraftTadpole extends CraftFish implements org.bukkit.entity.Tadpole public void setAge(int age) { this.getHandle().age = age; } @@ -1055,12 +1059,12 @@ index 1dfd4d92dfcb55d26fc5e9adfd1df3fbc9f02ca0..43c2d820d164d36a28c4920d70aea2fe + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java -index bf5b2fd6676c4430578db4cc6c603c501cc5e349..832981b07ef5c633ef00a382f56798ee87eec0df 100644 +index 2d1fcbbaba2b88f2c19ae7553d89e50b30cf6581..c628594b981f276acae7b9337100d811f919631b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java -@@ -37,4 +37,27 @@ public class CraftTrident extends CraftArrow implements Trident { - public EntityType getType() { - return EntityType.TRIDENT; +@@ -31,4 +31,27 @@ public class CraftTrident extends CraftArrow implements Trident { + public String toString() { + return "CraftTrident"; } + + // Paper start @@ -1087,10 +1091,10 @@ index bf5b2fd6676c4430578db4cc6c603c501cc5e349..832981b07ef5c633ef00a382f56798ee + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java -index ee84a90772381f7cfe864642c860880b827d25ea..4352af0a76ce4a4cd4afbea96f4851ef2b64ac7d 100644 +index 9982d94f19d0f201840653c227f1875c83de0723..d1d932dd27cff00e0ab69443a58715e3cbc1e57c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTropicalFish.java -@@ -8,7 +8,7 @@ import org.bukkit.entity.EntityType; +@@ -7,7 +7,7 @@ import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.TropicalFish; import org.bukkit.entity.TropicalFish.Pattern; @@ -1100,10 +1104,10 @@ index ee84a90772381f7cfe864642c860880b827d25ea..4352af0a76ce4a4cd4afbea96f4851ef public CraftTropicalFish(CraftServer server, net.minecraft.world.entity.animal.TropicalFish entity) { super(server, entity); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java -index 50b07045cd17a7576a436c64662ad039d4aa2132..bcfca66c7b99b9d514fe850d6cc6abd7e36ccaf7 100644 +index c4f7216c7ca7a49048fcf5240ef2a8f80e843f1c..6079581ba2eef8ac9272d0bbbf77e31f593edf0f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java -@@ -30,6 +30,26 @@ public class CraftVex extends CraftMonster implements Vex { +@@ -29,6 +29,26 @@ public class CraftVex extends CraftMonster implements Vex { public void setSummoner(org.bukkit.entity.Mob summoner) { getHandle().setOwner(summoner == null ? null : ((CraftMob) summoner).getHandle()); } @@ -1131,10 +1135,10 @@ index 50b07045cd17a7576a436c64662ad039d4aa2132..bcfca66c7b99b9d514fe850d6cc6abd7 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java -index 20e11bb0ae8949988b3499ad85016379fbe83218..7d63e9b8c92da089886ce9118bea07077f0541cd 100644 +index ae5e0d0c079e3efb7ebe391128879d474e8d56aa..afd940ebb790dca9a5f21f7c4f4435a668f3b8d5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java -@@ -70,13 +70,20 @@ public class CraftVillagerZombie extends CraftZombie implements ZombieVillager { +@@ -64,13 +64,20 @@ public class CraftVillagerZombie extends CraftZombie implements ZombieVillager { @Override public void setConversionTime(int time) { @@ -1157,10 +1161,10 @@ index 20e11bb0ae8949988b3499ad85016379fbe83218..7d63e9b8c92da089886ce9118bea0707 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWanderingTrader.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWanderingTrader.java -index fa7107593b20e0151d8d67104e4a92dcc697d461..f9a3d060ff4da6047d11f2b024d144572c513399 100644 +index 4a6700d7d2f40cf516054e2e3d09049f1ce4fd17..fd6ac99dae7e54b90f2b0e01430ac6db9410ccd4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWanderingTrader.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWanderingTrader.java -@@ -55,5 +55,25 @@ public class CraftWanderingTrader extends CraftAbstractVillager implements Wande +@@ -49,5 +49,25 @@ public class CraftWanderingTrader extends CraftAbstractVillager implements Wande public boolean canDrinkMilk() { return getHandle().canDrinkMilk; } @@ -1187,10 +1191,10 @@ index fa7107593b20e0151d8d67104e4a92dcc697d461..f9a3d060ff4da6047d11f2b024d14457 // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWarden.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWarden.java -index 08c55cb00c8ff3c39dd99c64227d5d60abee2a51..6ecdc4bf1f6b8f0363e667135ba463433be5c0fb 100644 +index 4575c96ad06adfbcec4eca2c50b9eae7975950c2..53c185dc562a0f258d5918fefa9fe42c77334014 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWarden.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWarden.java -@@ -43,6 +43,13 @@ public class CraftWarden extends CraftMonster implements org.bukkit.entity.Warde +@@ -38,6 +38,13 @@ public class CraftWarden extends CraftMonster implements org.bukkit.entity.Warde return this.getHandle().getAngerManagement().getActiveAnger(((CraftEntity) entity).getHandle()); } @@ -1205,10 +1209,10 @@ index 08c55cb00c8ff3c39dd99c64227d5d60abee2a51..6ecdc4bf1f6b8f0363e667135ba46343 public void increaseAnger(Entity entity, int increase) { Preconditions.checkArgument(entity != null, "Entity cannot be null"); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java -index f9c3a14bf4674f21ed32f6dc2a4296a935dd2b6d..1477c2c04d8f5c5639ce94808fe2a7029cedaeb2 100644 +index 83353863e0c58995d3699d5f812d38cae056f695..5a97c92f9b044d8ab7bd3346ceb464455a09046e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java -@@ -73,4 +73,36 @@ public class CraftWither extends CraftMonster implements Wither, com.destroystok +@@ -67,4 +67,36 @@ public class CraftWither extends CraftMonster implements Wither, com.destroystok this.getHandle().setInvulnerableTicks(ticks); } diff --git a/patches/server/0634-Ensure-disconnect-for-book-edit-is-called-on-main.patch b/patches/server/0633-Ensure-disconnect-for-book-edit-is-called-on-main.patch index c89825748e..596f9ba5e5 100644 --- a/patches/server/0634-Ensure-disconnect-for-book-edit-is-called-on-main.patch +++ b/patches/server/0633-Ensure-disconnect-for-book-edit-is-called-on-main.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Ensure disconnect for book edit is called on main diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 76d8c5c5029ac564d05144cef5030c6b64df9a98..b8eba8f002bffacd4c4943d2e49045ddc753db8c 100644 +index 21ed0a8b4b04df1abe84f4f3572855ad63ce1671..d2b9714db79725a6d855a9915222691de3846654 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1209,7 +1209,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic diff --git a/patches/server/0635-Fix-return-value-of-Block-applyBoneMeal-always-being.patch b/patches/server/0634-Fix-return-value-of-Block-applyBoneMeal-always-being.patch index 571b88a531..97e25c38b3 100644 --- a/patches/server/0635-Fix-return-value-of-Block-applyBoneMeal-always-being.patch +++ b/patches/server/0634-Fix-return-value-of-Block-applyBoneMeal-always-being.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix return value of Block#applyBoneMeal always being false diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index 582f1c07da8edc88dda9463992bb8503fcb9e163..d37440f78a31c676fc6efe9e59253dbe8097b94e 100644 +index 4745c633e92e16efb9fcd9ab009413b05abed434..8244ed8614a8f4bf95e5d8e8f22969cb54a8c17a 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -@@ -583,7 +583,7 @@ public class CraftBlock implements Block { +@@ -557,7 +557,7 @@ public class CraftBlock implements Block { } } diff --git a/patches/server/0636-Use-getChunkIfLoadedImmediately-in-places.patch b/patches/server/0635-Use-getChunkIfLoadedImmediately-in-places.patch index c5f7bc04c3..3f0b91f112 100644 --- a/patches/server/0636-Use-getChunkIfLoadedImmediately-in-places.patch +++ b/patches/server/0635-Use-getChunkIfLoadedImmediately-in-places.patch @@ -8,7 +8,7 @@ ticket level 33 (yes getChunkIfLoaded will actually perform a chunk load in that case). diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index e63cb62affc88d1482f9926ae459986e2d213fb0..bc7daf89e30152a3bcb215e91b30c9680be5c343 100644 +index 618ac96f5abcf6e3def9fe16d6c5da1d8c122979..d3ddcceed5247e0bb2f8432e7cfcf58607036694 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -228,7 +228,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -39,10 +39,10 @@ index 640ab1cf00ddc24a704b7f555396d18b29959a87..e35e25aea3d5f0f9e033a112545a398b protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor diff --git a/src/main/java/net/minecraft/world/level/gameevent/GameEventDispatcher.java b/src/main/java/net/minecraft/world/level/gameevent/GameEventDispatcher.java -index e9ead1e49f9043430e316c36ade83b70cf850e47..f2d10d58617644a589ecec3e17358c1277795e5d 100644 +index 30567fac80ced14c185fac585352227dfd63687e..5019f9160f9abe45c008ba74a1092f2d58a628f3 100644 --- a/src/main/java/net/minecraft/world/level/gameevent/GameEventDispatcher.java +++ b/src/main/java/net/minecraft/world/level/gameevent/GameEventDispatcher.java -@@ -56,7 +56,7 @@ public class GameEventDispatcher { +@@ -54,7 +54,7 @@ public class GameEventDispatcher { for (int l1 = j; l1 <= i1; ++l1) { for (int i2 = l; i2 <= k1; ++i2) { diff --git a/patches/server/0637-Fix-commands-from-signs-not-firing-command-events.patch b/patches/server/0636-Fix-commands-from-signs-not-firing-command-events.patch index 6db45da44f..6db45da44f 100644 --- a/patches/server/0637-Fix-commands-from-signs-not-firing-command-events.patch +++ b/patches/server/0636-Fix-commands-from-signs-not-firing-command-events.patch diff --git a/patches/server/0638-Adds-PlayerArmSwingEvent.patch b/patches/server/0637-Adds-PlayerArmSwingEvent.patch index b3d3eef0c5..1c7dea5a9a 100644 --- a/patches/server/0638-Adds-PlayerArmSwingEvent.patch +++ b/patches/server/0637-Adds-PlayerArmSwingEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Adds PlayerArmSwingEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index b8eba8f002bffacd4c4943d2e49045ddc753db8c..e0937f5437451c383e9a540d98b07f23120cb8f1 100644 +index d2b9714db79725a6d855a9915222691de3846654..127b1297703bf5f38be2d766ebf89a4e29ca6c6e 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2494,7 +2494,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic diff --git a/patches/server/0639-Fixes-kick-event-leave-message-not-being-sent.patch b/patches/server/0638-Fixes-kick-event-leave-message-not-being-sent.patch index d2d5b852a1..d53d2280e9 100644 --- a/patches/server/0639-Fixes-kick-event-leave-message-not-being-sent.patch +++ b/patches/server/0638-Fixes-kick-event-leave-message-not-being-sent.patch @@ -17,7 +17,7 @@ index 7d5de33442fe4ba53c51cc7356323622c2c3022f..478dbba3519f8d2fdd4b203756403761 public boolean isRealPlayer; // Paper public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index e0937f5437451c383e9a540d98b07f23120cb8f1..7b2c971dad894718825475f3af364f0c653e5beb 100644 +index 127b1297703bf5f38be2d766ebf89a4e29ca6c6e..0dc0bc95f14bcbabc6e4a28556f01c51df268ab7 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -514,7 +514,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic diff --git a/patches/server/0640-Add-config-for-mobs-immune-to-default-effects.patch b/patches/server/0639-Add-config-for-mobs-immune-to-default-effects.patch index 004b00f0db..004b00f0db 100644 --- a/patches/server/0640-Add-config-for-mobs-immune-to-default-effects.patch +++ b/patches/server/0639-Add-config-for-mobs-immune-to-default-effects.patch diff --git a/patches/server/0641-Fix-incorrect-message-for-outdated-client.patch b/patches/server/0640-Fix-incorrect-message-for-outdated-client.patch index 73f722f54d..73f722f54d 100644 --- a/patches/server/0641-Fix-incorrect-message-for-outdated-client.patch +++ b/patches/server/0640-Fix-incorrect-message-for-outdated-client.patch diff --git a/patches/server/0642-Don-t-apply-cramming-damage-to-players.patch b/patches/server/0641-Don-t-apply-cramming-damage-to-players.patch index a423c75fc2..a423c75fc2 100644 --- a/patches/server/0642-Don-t-apply-cramming-damage-to-players.patch +++ b/patches/server/0641-Don-t-apply-cramming-damage-to-players.patch diff --git a/patches/server/0643-Rate-options-and-timings-for-sensors-and-behaviors.patch b/patches/server/0642-Rate-options-and-timings-for-sensors-and-behaviors.patch index 297c6b3a06..297c6b3a06 100644 --- a/patches/server/0643-Rate-options-and-timings-for-sensors-and-behaviors.patch +++ b/patches/server/0642-Rate-options-and-timings-for-sensors-and-behaviors.patch diff --git a/patches/server/0644-Add-a-bunch-of-missing-forceDrop-toggles.patch b/patches/server/0643-Add-a-bunch-of-missing-forceDrop-toggles.patch index cbd167929b..cbd167929b 100644 --- a/patches/server/0644-Add-a-bunch-of-missing-forceDrop-toggles.patch +++ b/patches/server/0643-Add-a-bunch-of-missing-forceDrop-toggles.patch diff --git a/patches/server/0645-Stinger-API.patch b/patches/server/0644-Stinger-API.patch index 49ac5ef4ef..3509a97d2c 100644 --- a/patches/server/0645-Stinger-API.patch +++ b/patches/server/0644-Stinger-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Stinger API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index b56504c3e5c457bfe83bbc864dc217c2f0cc9d18..084bf9ab43c322f8856dc8f600a18ae166aaa5ef 100644 +index 7240a9bea74589be9e29e0e05d843ca14a361b45..a7c7f865c88faed1e18b1793ec2a5c39cf892de5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -336,7 +336,28 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -339,7 +339,28 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { } // Paper end } diff --git a/patches/server/0646-Fix-incosistency-issue-with-empty-map-items-in-CB.patch b/patches/server/0645-Fix-incosistency-issue-with-empty-map-items-in-CB.patch index c9f7c064a5..e62ae0a415 100644 --- a/patches/server/0646-Fix-incosistency-issue-with-empty-map-items-in-CB.patch +++ b/patches/server/0645-Fix-incosistency-issue-with-empty-map-items-in-CB.patch @@ -18,7 +18,7 @@ index 75b110c6fb685390306fe3b8504aeea9bd6deedd..d3c29e6bf8b3c2dd628809177dac5022 public static int createNewSavedData(Level world, int x, int z, int scale, boolean showIcons, boolean unlimitedTracking, ResourceKey<Level> dimension) { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaMap.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaMap.java -index 70b365afc40f11d4da3aea2b5d6b2467f517deac..a74ea06e3a190916527ab2c85d13f1e34c08d50a 100644 +index bfa9c544d766e2f5ae82474c3429f365cf3e0597..cbb2b7020f405351f1c88da118b93d38ed0796e2 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaMap.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaMap.java @@ -133,6 +133,7 @@ class CraftMetaMap extends CraftMetaItem implements MapMeta { diff --git a/patches/server/0647-Add-System.out-err-catcher.patch b/patches/server/0646-Add-System.out-err-catcher.patch index 0d16af6e4f..e6f0853dbc 100644 --- a/patches/server/0647-Add-System.out-err-catcher.patch +++ b/patches/server/0646-Add-System.out-err-catcher.patch @@ -105,7 +105,7 @@ index 0000000000000000000000000000000000000000..a8e813ca89b033f061e695288b3383bd + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 95f2490000e3f49644d6795a4c4c67ee0674fbf9..46a4a9e18299060fa0050e2bd0e5a01716a6bce0 100644 +index 2ff97603e5e6ef4a9bea49c05bfe2f3e2bafdbf5..49a1b5d9c677809075f1f8bf1acd9e9f944819e2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -299,6 +299,7 @@ public final class CraftServer implements Server { diff --git a/patches/server/0649-Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch b/patches/server/0647-Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch index a02cafdd72..a02cafdd72 100644 --- a/patches/server/0649-Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch +++ b/patches/server/0647-Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch diff --git a/patches/server/0648-Fix-test-not-bootstrapping.patch b/patches/server/0648-Fix-test-not-bootstrapping.patch deleted file mode 100644 index 6c582bf1e6..0000000000 --- a/patches/server/0648-Fix-test-not-bootstrapping.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Mariell Hoversholm <[email protected]> -Date: Mon, 2 Aug 2021 08:52:21 +0200 -Subject: [PATCH] Fix test not bootstrapping - -Signed-off-by: Mariell Hoversholm <[email protected]> - -diff --git a/src/test/java/org/bukkit/enchantments/EnchantmentTargetTest.java b/src/test/java/org/bukkit/enchantments/EnchantmentTargetTest.java -index 439bf35c251ab5dc0d27923e62789a496618de82..5d3b8ba99d0fe966b7329540d61825aa266c7e64 100644 ---- a/src/test/java/org/bukkit/enchantments/EnchantmentTargetTest.java -+++ b/src/test/java/org/bukkit/enchantments/EnchantmentTargetTest.java -@@ -5,10 +5,11 @@ import net.minecraft.world.item.Item; - import net.minecraft.world.item.enchantment.EnchantmentCategory; - import org.bukkit.Material; - import org.bukkit.craftbukkit.util.CraftMagicNumbers; -+import org.bukkit.support.AbstractTestingBase; - import org.junit.Assert; - import org.junit.Test; - --public class EnchantmentTargetTest { -+public class EnchantmentTargetTest extends AbstractTestingBase { // Paper - - @Test - public void test() { diff --git a/patches/server/0650-Improve-boat-collision-performance.patch b/patches/server/0648-Improve-boat-collision-performance.patch index 4836f8e064..4836f8e064 100644 --- a/patches/server/0650-Improve-boat-collision-performance.patch +++ b/patches/server/0648-Improve-boat-collision-performance.patch diff --git a/patches/server/0651-Prevent-AFK-kick-while-watching-end-credits.patch b/patches/server/0649-Prevent-AFK-kick-while-watching-end-credits.patch index 8fbcf677c3..f6d5fd2828 100644 --- a/patches/server/0651-Prevent-AFK-kick-while-watching-end-credits.patch +++ b/patches/server/0649-Prevent-AFK-kick-while-watching-end-credits.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Prevent AFK kick while watching end credits. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 7b2c971dad894718825475f3af364f0c653e5beb..5c98df63c36a01a70569894534f6059218ba83d2 100644 +index 0dc0bc95f14bcbabc6e4a28556f01c51df268ab7..a15268acd17dfc12773a18b0c81e6f331fdad79c 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -431,7 +431,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic diff --git a/patches/server/0652-Allow-skipping-writing-of-comments-to-server.propert.patch b/patches/server/0650-Allow-skipping-writing-of-comments-to-server.propert.patch index c456bcd235..c456bcd235 100644 --- a/patches/server/0652-Allow-skipping-writing-of-comments-to-server.propert.patch +++ b/patches/server/0650-Allow-skipping-writing-of-comments-to-server.propert.patch diff --git a/patches/server/0653-Add-PlayerSetSpawnEvent.patch b/patches/server/0651-Add-PlayerSetSpawnEvent.patch index f929924374..abe0d51afd 100644 --- a/patches/server/0653-Add-PlayerSetSpawnEvent.patch +++ b/patches/server/0651-Add-PlayerSetSpawnEvent.patch @@ -187,10 +187,10 @@ index 1a27b7faa22e6b3dc5fce329ed06425de56c4315..b9903c29bdea8d1e3b6fce0e97be6bd9 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c11ca0b9601ef90f19f61cce029cafcfac3c1619..736b97517906f154158618ad92328ad34ab1882d 100644 +index 4aab071d6f8b26bd69f1fb639a78eac6f99c9071..aa0badfdfdf8a00cc06dd95c007a8ae0957826de 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1314,9 +1314,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1306,9 +1306,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setBedSpawnLocation(Location location, boolean override) { if (location == null) { diff --git a/patches/server/0654-Make-hoppers-respect-inventory-max-stack-size.patch b/patches/server/0652-Make-hoppers-respect-inventory-max-stack-size.patch index 929c4e2715..929c4e2715 100644 --- a/patches/server/0654-Make-hoppers-respect-inventory-max-stack-size.patch +++ b/patches/server/0652-Make-hoppers-respect-inventory-max-stack-size.patch diff --git a/patches/server/0655-Optimize-entity-tracker-passenger-checks.patch b/patches/server/0653-Optimize-entity-tracker-passenger-checks.patch index b832093f21..b832093f21 100644 --- a/patches/server/0655-Optimize-entity-tracker-passenger-checks.patch +++ b/patches/server/0653-Optimize-entity-tracker-passenger-checks.patch diff --git a/patches/server/0656-Config-option-for-Piglins-guarding-chests.patch b/patches/server/0654-Config-option-for-Piglins-guarding-chests.patch index 23ef76f3e7..23ef76f3e7 100644 --- a/patches/server/0656-Config-option-for-Piglins-guarding-chests.patch +++ b/patches/server/0654-Config-option-for-Piglins-guarding-chests.patch diff --git a/patches/server/0657-Added-EntityDamageItemEvent.patch b/patches/server/0655-Added-EntityDamageItemEvent.patch index 7a458b966f..af2ee1d973 100644 --- a/patches/server/0657-Added-EntityDamageItemEvent.patch +++ b/patches/server/0655-Added-EntityDamageItemEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Added EntityDamageItemEvent diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index a236d2826b6a2dff8b3e63e7c59cce2602393e62..9e7357c65c36da9cad2f4492dacfc60af2a1af70 100644 +index 226d024f222affba83479d44a7163d29207ae8f1..487f16f64ac3d4c22538032029925ed156cf119c 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java @@ -591,7 +591,7 @@ public final class ItemStack { diff --git a/patches/server/0658-Optimize-indirect-passenger-iteration.patch b/patches/server/0656-Optimize-indirect-passenger-iteration.patch index 67debf687d..67debf687d 100644 --- a/patches/server/0658-Optimize-indirect-passenger-iteration.patch +++ b/patches/server/0656-Optimize-indirect-passenger-iteration.patch diff --git a/patches/server/0659-Configurable-item-frame-map-cursor-update-interval.patch b/patches/server/0657-Configurable-item-frame-map-cursor-update-interval.patch index 898bee5973..898bee5973 100644 --- a/patches/server/0659-Configurable-item-frame-map-cursor-update-interval.patch +++ b/patches/server/0657-Configurable-item-frame-map-cursor-update-interval.patch diff --git a/patches/server/0660-Make-EntityUnleashEvent-cancellable.patch b/patches/server/0658-Make-EntityUnleashEvent-cancellable.patch index 3d733321df..3d733321df 100644 --- a/patches/server/0660-Make-EntityUnleashEvent-cancellable.patch +++ b/patches/server/0658-Make-EntityUnleashEvent-cancellable.patch diff --git a/patches/server/0661-Clear-bucket-NBT-after-dispense.patch b/patches/server/0659-Clear-bucket-NBT-after-dispense.patch index 9705f1b9dd..9705f1b9dd 100644 --- a/patches/server/0661-Clear-bucket-NBT-after-dispense.patch +++ b/patches/server/0659-Clear-bucket-NBT-after-dispense.patch diff --git a/patches/server/0662-Change-EnderEye-target-without-changing-other-things.patch b/patches/server/0660-Change-EnderEye-target-without-changing-other-things.patch index 22293dd5c1..71e04b67ea 100644 --- a/patches/server/0662-Change-EnderEye-target-without-changing-other-things.patch +++ b/patches/server/0660-Change-EnderEye-target-without-changing-other-things.patch @@ -32,10 +32,10 @@ index ee6bbe96503e9205349e9a5c411dc60dd952ec9e..e48706e2fefc39fcce3c65f629153fdc @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java -index e45c1bfb1b8e0cd8f7b9ab5b655d33dd4da1b151..e3688e941d9b63b5319faf9370b8f75e0e5828ae 100644 +index c0c917b928a648206ff6fd53f13fbe3bcb0cdda7..18712bfd46d3852bc1210c8f0dea7e9af3e55b4d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java -@@ -38,8 +38,15 @@ public class CraftEnderSignal extends CraftEntity implements EnderSignal { +@@ -32,8 +32,15 @@ public class CraftEnderSignal extends CraftEntity implements EnderSignal { @Override public void setTargetLocation(Location location) { diff --git a/patches/server/0663-Add-BlockBreakBlockEvent.patch b/patches/server/0661-Add-BlockBreakBlockEvent.patch index 83bda7fe59..83bda7fe59 100644 --- a/patches/server/0663-Add-BlockBreakBlockEvent.patch +++ b/patches/server/0661-Add-BlockBreakBlockEvent.patch diff --git a/patches/server/0664-Option-to-prevent-NBT-copy-in-smithing-recipes.patch b/patches/server/0662-Option-to-prevent-NBT-copy-in-smithing-recipes.patch index d9f83ce872..d9f83ce872 100644 --- a/patches/server/0664-Option-to-prevent-NBT-copy-in-smithing-recipes.patch +++ b/patches/server/0662-Option-to-prevent-NBT-copy-in-smithing-recipes.patch diff --git a/patches/server/0665-More-CommandBlock-API.patch b/patches/server/0663-More-CommandBlock-API.patch index 3cbd2436d3..08e4be7648 100644 --- a/patches/server/0665-More-CommandBlock-API.patch +++ b/patches/server/0663-More-CommandBlock-API.patch @@ -68,10 +68,10 @@ index c4ea6760f489e6171f9e6e170160b932597f842f..245a9b062a0033a39fd42f3ff9435019 // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java -index f9863e138994f6c7a7975a852f106faa96d52315..b709a1d909c189f60d0c3aa97b4b96623e7c1db0 100644 +index 66fb6aeb49b7e93d2a4d9b5ce7f1a7d68f571cf5..2534abcdce426189ac15e0659ab62840b3d54762 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartCommand.java -@@ -14,7 +14,7 @@ import org.bukkit.permissions.PermissionAttachment; +@@ -13,7 +13,7 @@ import org.bukkit.permissions.PermissionAttachment; import org.bukkit.permissions.PermissionAttachmentInfo; import org.bukkit.plugin.Plugin; @@ -80,7 +80,7 @@ index f9863e138994f6c7a7975a852f106faa96d52315..b709a1d909c189f60d0c3aa97b4b9662 private final PermissibleBase perm = new PermissibleBase(this); public CraftMinecartCommand(CraftServer server, MinecartCommandBlock entity) { -@@ -70,6 +70,17 @@ public class CraftMinecartCommand extends CraftMinecart implements CommandMineca +@@ -64,6 +64,17 @@ public class CraftMinecartCommand extends CraftMinecart implements CommandMineca public [email protected] Component name() { return io.papermc.paper.adventure.PaperAdventure.asAdventure(this.getHandle().getCommandBlock().getName()); } diff --git a/patches/server/0666-Add-missing-team-sidebar-display-slots.patch b/patches/server/0664-Add-missing-team-sidebar-display-slots.patch index 0ffc852554..88f67ed987 100644 --- a/patches/server/0666-Add-missing-team-sidebar-display-slots.patch +++ b/patches/server/0664-Add-missing-team-sidebar-display-slots.patch @@ -54,13 +54,14 @@ index e2d3fe9af7d3bd82bee519b20e141cd58f68bbd6..944a4fee237730c0d89567aaa6ddf268 } diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index fe5d3b60ad740b7f1cce040f9c8d96ac51245ef6..43ffc4180b1ef2d2000991ad58b0706141470d08 100644 +index 8a2914d2b9683be14943066fcba21519145f9467..2500ca4cda59d16285c1749669ea21fddaf14f53 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -251,6 +251,14 @@ public class Commodore +@@ -318,6 +318,15 @@ public class Commodore { desc = getOriginalOrRewrite( desc ); } // Paper end ++ + // Paper start - DisplaySlot + if (owner.equals("org/bukkit/scoreboard/DisplaySlot")) { + if (name.startsWith("SIDEBAR_") && !name.startsWith("SIDEBAR_TEAM_")) { @@ -69,9 +70,9 @@ index fe5d3b60ad740b7f1cce040f9c8d96ac51245ef6..43ffc4180b1ef2d2000991ad58b07061 + } + } + // Paper end - DisplaySlot - - if ( owner.equals( "org/bukkit/block/Biome" ) ) - { + if (owner.equals("org/bukkit/block/Biome")) { + switch (name) { + case "NETHER": diff --git a/src/test/java/io/papermc/paper/scoreboard/DisplaySlotTest.java b/src/test/java/io/papermc/paper/scoreboard/DisplaySlotTest.java new file mode 100644 index 0000000000000000000000000000000000000000..bb41a2f2c0a5e3b4cb3fe1b584e0ceb7a7116afb diff --git a/patches/server/0667-Add-back-EntityPortalExitEvent.patch b/patches/server/0665-Add-back-EntityPortalExitEvent.patch index 6696b7bb2b..6696b7bb2b 100644 --- a/patches/server/0667-Add-back-EntityPortalExitEvent.patch +++ b/patches/server/0665-Add-back-EntityPortalExitEvent.patch diff --git a/patches/server/0668-Add-methods-to-find-targets-for-lightning-strikes.patch b/patches/server/0666-Add-methods-to-find-targets-for-lightning-strikes.patch index ea10046bcc..e4b4ec3ba4 100644 --- a/patches/server/0668-Add-methods-to-find-targets-for-lightning-strikes.patch +++ b/patches/server/0666-Add-methods-to-find-targets-for-lightning-strikes.patch @@ -7,7 +7,7 @@ Subject: [PATCH] Add methods to find targets for lightning strikes public net.minecraft.server.level.ServerLevel findLightningRod(Lnet/minecraft/core/BlockPos;)Ljava/util/Optional; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index bc7daf89e30152a3bcb215e91b30c9680be5c343..e809a959d69197ecdec768a2d4f348c73c0d5b9a 100644 +index d3ddcceed5247e0bb2f8432e7cfcf58607036694..29f0a4bd537c13ee73570e2d78b641c5751e9bfe 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -974,6 +974,11 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -31,10 +31,10 @@ index bc7daf89e30152a3bcb215e91b30c9680be5c343..e809a959d69197ecdec768a2d4f348c7 blockposition1 = blockposition1.above(2); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 7edcc68a24bd812f50d9ce441fab568906061da3..8bdcf37f7e0adbf6be73a44bdbda8e69e105c2e3 100644 +index 3cf8dd8b3e63db60a3fe9ef2610bec4597485a6e..ea01717f5fc77a1503eb518107f15dcf3ec11be0 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -698,6 +698,23 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -699,6 +699,23 @@ public class CraftWorld extends CraftRegionAccessor implements World { return (LightningStrike) lightning.getBukkitEntity(); } diff --git a/patches/server/0669-Get-entity-default-attributes.patch b/patches/server/0667-Get-entity-default-attributes.patch index 666afc9487..f4b8eb404d 100644 --- a/patches/server/0669-Get-entity-default-attributes.patch +++ b/patches/server/0667-Get-entity-default-attributes.patch @@ -44,16 +44,17 @@ index 0000000000000000000000000000000000000000..12135ffeacd648f6bc4d7d327059ea1a +} diff --git a/src/main/java/io/papermc/paper/attribute/UnmodifiableAttributeMap.java b/src/main/java/io/papermc/paper/attribute/UnmodifiableAttributeMap.java new file mode 100644 -index 0000000000000000000000000000000000000000..cf9d28ea97d93cec05c9fb768d59e283ca915565 +index 0000000000000000000000000000000000000000..57ea677907daa4689b8712b2686830197256a119 --- /dev/null +++ b/src/main/java/io/papermc/paper/attribute/UnmodifiableAttributeMap.java -@@ -0,0 +1,32 @@ +@@ -0,0 +1,33 @@ +package io.papermc.paper.attribute; + +import net.minecraft.world.entity.ai.attributes.AttributeSupplier; +import org.bukkit.attribute.Attributable; +import org.bukkit.attribute.Attribute; +import org.bukkit.attribute.AttributeInstance; ++import org.bukkit.craftbukkit.attribute.CraftAttribute; +import org.bukkit.craftbukkit.attribute.CraftAttributeMap; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; @@ -68,7 +69,7 @@ index 0000000000000000000000000000000000000000..cf9d28ea97d93cec05c9fb768d59e283 + + @Override + public @Nullable AttributeInstance getAttribute(@NotNull Attribute attribute) { -+ net.minecraft.world.entity.ai.attributes.Attribute nmsAttribute = CraftAttributeMap.toMinecraft(attribute); ++ net.minecraft.world.entity.ai.attributes.Attribute nmsAttribute = CraftAttribute.bukkitToMinecraft(attribute); + if (!this.handle.hasAttribute(nmsAttribute)) { + return null; + } @@ -80,29 +81,32 @@ index 0000000000000000000000000000000000000000..cf9d28ea97d93cec05c9fb768d59e283 + throw new UnsupportedOperationException("Cannot register new attributes here"); + } +} -diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 7f870317139db136103cb72b2aa57bcba9f6e793..53e40ab7d37ef707151c165831b24737a9f3683c 100644 ---- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -568,6 +568,18 @@ public final class CraftMagicNumbers implements UnsafeValues { - public int getProtocolVersion() { - return net.minecraft.SharedConstants.getCurrentVersion().getProtocolVersion(); +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityType.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityType.java +index 33be9fa46c3bdb4958b32d30c730ceff075aaaea..85602b01b3bef4cd223a86b9b7cc85dbb4b3a105 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityType.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityType.java +@@ -164,6 +164,21 @@ public class CraftEntityType<E extends Entity> extends EntityType<E> { } -+ + // Paper end + ++ // Paper start - default entity attributes + @Override -+ public boolean hasDefaultEntityAttributes(NamespacedKey bukkitEntityKey) { -+ return net.minecraft.world.entity.ai.attributes.DefaultAttributes.hasSupplier(net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.get(CraftNamespacedKey.toMinecraft(bukkitEntityKey))); ++ public boolean hasDefaultAttributes() { ++ return net.minecraft.world.entity.ai.attributes.DefaultAttributes.hasSupplier(this.entityType); + } + ++ @SuppressWarnings("unchecked") + @Override -+ public org.bukkit.attribute.Attributable getDefaultEntityAttributes(NamespacedKey bukkitEntityKey) { -+ Preconditions.checkArgument(hasDefaultEntityAttributes(bukkitEntityKey), bukkitEntityKey + " doesn't have default attributes"); -+ var supplier = net.minecraft.world.entity.ai.attributes.DefaultAttributes.getSupplier((net.minecraft.world.entity.EntityType<? extends net.minecraft.world.entity.LivingEntity>) net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.get(CraftNamespacedKey.toMinecraft(bukkitEntityKey))); ++ public org.bukkit.attribute.Attributable getDefaultAttributes() { ++ Preconditions.checkArgument(this.hasDefaultAttributes(), this.key + " doesn't have default attributes"); ++ net.minecraft.world.entity.ai.attributes.AttributeSupplier supplier = net.minecraft.world.entity.ai.attributes.DefaultAttributes.getSupplier((net.minecraft.world.entity.EntityType<? extends net.minecraft.world.entity.LivingEntity>) this.entityType); + return new io.papermc.paper.attribute.UnmodifiableAttributeMap(supplier); + } - // Paper end - - /** ++ // Paper end ++ + public static class CraftEntityTypeRegistry extends CraftRegistry<EntityType<?>, net.minecraft.world.entity.EntityType<?>> { + private static final Map<NamespacedKey, Class<? extends Entity>> CLASS_MAP = new HashMap<>(); + private static final Map<NamespacedKey, Boolean> SPAWNABLE = new HashMap<>(); diff --git a/src/test/java/io/papermc/paper/attribute/EntityTypeAttributesTest.java b/src/test/java/io/papermc/paper/attribute/EntityTypeAttributesTest.java new file mode 100644 index 0000000000000000000000000000000000000000..7b999deba66aa6d22cd7520f6c13550a44ca327d diff --git a/patches/server/0670-Left-handed-API.patch b/patches/server/0668-Left-handed-API.patch index 3b4077b54a..367c9ed9bc 100644 --- a/patches/server/0670-Left-handed-API.patch +++ b/patches/server/0668-Left-handed-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Left handed API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -index 4d0c6e3aaf984e295061d878dd4a8ef4d19511cb..620d918e302a00d5a6640648e3096988d15535a0 100644 +index c90f9b519c82327b787d2920b3bb079efb0c7e8a..c526304d31fd9be1b3c895187f7d9fc45edf4866 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java @@ -147,5 +147,15 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { diff --git a/patches/server/0671-Add-more-advancement-API.patch b/patches/server/0669-Add-more-advancement-API.patch index 451dbda15c..8e5a10a53e 100644 --- a/patches/server/0671-Add-more-advancement-API.patch +++ b/patches/server/0669-Add-more-advancement-API.patch @@ -189,29 +189,31 @@ index 4aa8cda2bf72627b153e636a408fb3971caf2309..e29d7c6e1cef10a76c8630855fada11c private final DisplayInfo handle; diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 43ffc4180b1ef2d2000991ad58b0706141470d08..cacd9b59741c31e70e898e7af91a1a6ed3f87f07 100644 +index 2500ca4cda59d16285c1749669ea21fddaf14f53..ef28f880a4f603a48be5b32acc697f567a78b963 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -54,6 +54,7 @@ public class Commodore - ) ); +@@ -151,6 +151,7 @@ public class Commodore { + } // Paper start - Plugin rewrites + private static final String CB_PACKAGE = org.bukkit.Bukkit.getServer().getClass().getPackageName().replace('.', '/'); - private static final Map<String, String> SEARCH_AND_REMOVE = initReplacementsMap(); - private static Map<String, String> initReplacementsMap() - { -@@ -460,6 +461,11 @@ public class Commodore - super.visitMethodInsn(opcode, owner, name, "()Lcom/destroystokyo/paper/profile/PlayerProfile;", itf); + private static final java.util.Map<String, String> SEARCH_AND_REMOVE = initReplacementsMap(); + private static java.util.Map<String, String> initReplacementsMap() { + java.util.Map<String, String> getAndRemove = new java.util.HashMap<>(); +@@ -918,6 +919,13 @@ public class Commodore { return; } + // Paper end ++ // Paper start - advancement API + if (owner.equals("org/bukkit/advancement/Advancement") && name.equals("getDisplay") && desc.endsWith(")Lorg/bukkit/advancement/AdvancementDisplay;")) { + super.visitTypeInsn(Opcodes.CHECKCAST, CB_PACKAGE + "/advancement/CraftAdvancement"); + super.visitMethodInsn(Opcodes.INVOKEVIRTUAL, CB_PACKAGE + "/advancement/CraftAdvancement", "getDisplay0", desc, false); + return; + } - // Paper end - if ( modern ) - { ++ // Paper end + if (modern) { + if (owner.equals("org/bukkit/Material")) { + switch (name) { diff --git a/src/test/java/io/papermc/paper/advancement/AdvancementFrameTest.java b/src/test/java/io/papermc/paper/advancement/AdvancementFrameTest.java new file mode 100644 index 0000000000000000000000000000000000000000..4d043e0e43ef8bb75788e195f95b5a50a51a2a48 diff --git a/patches/server/0672-Add-ItemFactory-getSpawnEgg-API.patch b/patches/server/0670-Add-ItemFactory-getSpawnEgg-API.patch index b9440112fb..452a0f9e1f 100644 --- a/patches/server/0672-Add-ItemFactory-getSpawnEgg-API.patch +++ b/patches/server/0670-Add-ItemFactory-getSpawnEgg-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add ItemFactory#getSpawnEgg API diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index 21f5c0f2fc10b5f5752e214a08e858227bdcf2ce..583cd4726a1b60e8f11bf8a28cc3c655fa8c1b90 100644 +index 532da796231f4ea3a6d5e32c848fa07732977483..041cad0f4f3b86d182db39f2db6a41565808e20c 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -503,5 +503,17 @@ public final class CraftItemFactory implements ItemFactory { +@@ -351,5 +351,17 @@ public final class CraftItemFactory implements ItemFactory { entity.getUniqueId().toString(), new net.md_5.bungee.api.chat.TextComponent(customName)); } diff --git a/patches/server/0673-Add-critical-damage-API.patch b/patches/server/0671-Add-critical-damage-API.patch index 8280cf1022..7e3a080837 100644 --- a/patches/server/0673-Add-critical-damage-API.patch +++ b/patches/server/0671-Add-critical-damage-API.patch @@ -71,10 +71,10 @@ index a0d688128a1268fa1acf7c339cde15df5dce1c82..372b9ec0c8eddf4a01b4b8203a88401d int k = entity.getRemainingFireTicks(); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 64e1e46bd6c4b225fe9b86c4cf632b9bb1c4af09..94796cbe43546748b28aa921d22cb4b68ef23fa6 100644 +index 8305472b13cffe5fe44211153da71d781a6b3892..a1602539eaba33d9fb1a466e75f2f832ae33dfe6 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -988,7 +988,7 @@ public class CraftEventFactory { +@@ -994,7 +994,7 @@ public class CraftEventFactory { } else { damageCause = DamageCause.ENTITY_EXPLOSION; } @@ -83,7 +83,7 @@ index 64e1e46bd6c4b225fe9b86c4cf632b9bb1c4af09..94796cbe43546748b28aa921d22cb4b6 } event.setCancelled(cancelled); -@@ -1020,7 +1020,7 @@ public class CraftEventFactory { +@@ -1026,7 +1026,7 @@ public class CraftEventFactory { cause = DamageCause.SONIC_BOOM; } @@ -92,7 +92,7 @@ index 64e1e46bd6c4b225fe9b86c4cf632b9bb1c4af09..94796cbe43546748b28aa921d22cb4b6 } else if (source.is(DamageTypes.FELL_OUT_OF_WORLD)) { EntityDamageEvent event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.VOID, modifiers, modifierFunctions); event.setCancelled(cancelled); -@@ -1090,7 +1090,7 @@ public class CraftEventFactory { +@@ -1096,7 +1096,7 @@ public class CraftEventFactory { } else { throw new IllegalStateException(String.format("Unhandled damage of %s by %s from %s", entity, damager.getHandle(), source.getMsgId())); } @@ -101,7 +101,7 @@ index 64e1e46bd6c4b225fe9b86c4cf632b9bb1c4af09..94796cbe43546748b28aa921d22cb4b6 event.setCancelled(cancelled); CraftEventFactory.callEvent(event); if (!event.isCancelled()) { -@@ -1139,20 +1139,28 @@ public class CraftEventFactory { +@@ -1145,20 +1145,28 @@ public class CraftEventFactory { } if (cause != null) { diff --git a/patches/server/0674-Fix-issues-with-mob-conversion.patch b/patches/server/0672-Fix-issues-with-mob-conversion.patch index c5a854da3b..c5a854da3b 100644 --- a/patches/server/0674-Fix-issues-with-mob-conversion.patch +++ b/patches/server/0672-Fix-issues-with-mob-conversion.patch diff --git a/patches/server/0675-Add-isCollidable-methods-to-various-places.patch b/patches/server/0673-Add-isCollidable-methods-to-various-places.patch index 70fc349cfe..e3a8ae2152 100644 --- a/patches/server/0675-Add-isCollidable-methods-to-various-places.patch +++ b/patches/server/0673-Add-isCollidable-methods-to-various-places.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Add isCollidable methods to various places public net.minecraft.world.level.block.state.BlockBehaviour hasCollision diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index d37440f78a31c676fc6efe9e59253dbe8097b94e..8d2da07f0793367a51026b50adc8b3dc71073013 100644 +index 8244ed8614a8f4bf95e5d8e8f22969cb54a8c17a..40d0610c1cdc4f7131ff36869a6983ee53b801f9 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -@@ -482,6 +482,11 @@ public class CraftBlock implements Block { +@@ -456,6 +456,11 @@ public class CraftBlock implements Block { public boolean isSolid() { return this.getNMS().blocksMotion(); } @@ -23,7 +23,7 @@ index d37440f78a31c676fc6efe9e59253dbe8097b94e..8d2da07f0793367a51026b50adc8b3dc @Override diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java -index b722a207c0e745bb172d93b90e1241d7bfa173ce..792bfc7eab33b26462e76a1912bd712e8af70073 100644 +index 445838ee0ffdc6551e125de190abb91011f467b7..3c2e879799c6b6289b0ae467eae4ed950b0abeef 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java @@ -317,4 +317,11 @@ public class CraftBlockState implements BlockState { @@ -38,20 +38,19 @@ index b722a207c0e745bb172d93b90e1241d7bfa173ce..792bfc7eab33b26462e76a1912bd712e + } + // Paper end } -diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 53e40ab7d37ef707151c165831b24737a9f3683c..bbc3724769497e7687a27d800cd7511c5f1fe667 100644 ---- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -580,6 +580,12 @@ public final class CraftMagicNumbers implements UnsafeValues { - var supplier = net.minecraft.world.entity.ai.attributes.DefaultAttributes.getSupplier((net.minecraft.world.entity.EntityType<? extends net.minecraft.world.entity.LivingEntity>) net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.get(CraftNamespacedKey.toMinecraft(bukkitEntityKey))); - return new io.papermc.paper.attribute.UnmodifiableAttributeMap(supplier); +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockType.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockType.java +index 719273eeaab49570ef7efd5197c2f241a875e434..799a164245be1182c5ae2dff801c89147d4dbe64 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockType.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockType.java +@@ -175,4 +175,11 @@ public class CraftBlockType<B extends BlockData> implements BlockType<B> { + return this.block.getDescriptionId(); } + // Paper end + ++ // Paper start - isCollidable + @Override -+ public boolean isCollidable(Material material) { -+ Preconditions.checkArgument(material.isBlock(), material + " is not a block"); -+ return getBlock(material).hasCollision; ++ public boolean isCollidable() { ++ return this.block.hasCollision; + } - // Paper end - - /** ++ // Paper end + } diff --git a/patches/server/0676-Goat-ram-API.patch b/patches/server/0674-Goat-ram-API.patch index 2d8433a918..acbfe09600 100644 --- a/patches/server/0676-Goat-ram-API.patch +++ b/patches/server/0674-Goat-ram-API.patch @@ -25,10 +25,10 @@ index 923ac08708de02c0e83a5745b65e901965000d65..316823ea978b9c9b6656a01254c201fd + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftGoat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftGoat.java -index 9142b132f045af55b6bb436a39a9ca416bcfc698..e4be28b130e35ea263f85b3157898cd3a7e80561 100644 +index 65fcb36e849da6949c123a6f3672b485036f368e..2c21de478bff9cdf13ba46cd041831d54c11e924 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftGoat.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftGoat.java -@@ -54,4 +54,11 @@ public class CraftGoat extends CraftAnimals implements Goat { +@@ -48,4 +48,11 @@ public class CraftGoat extends CraftAnimals implements Goat { public void setScreaming(boolean screaming) { this.getHandle().setScreamingGoat(screaming); } diff --git a/patches/server/0677-Add-API-for-resetting-a-single-score.patch b/patches/server/0675-Add-API-for-resetting-a-single-score.patch index c2e1fd93b9..c2e1fd93b9 100644 --- a/patches/server/0677-Add-API-for-resetting-a-single-score.patch +++ b/patches/server/0675-Add-API-for-resetting-a-single-score.patch diff --git a/patches/server/0678-Add-Raw-Byte-Entity-Serialization.patch b/patches/server/0676-Add-Raw-Byte-Entity-Serialization.patch index b547dbbbe9..ac9056737b 100644 --- a/patches/server/0678-Add-Raw-Byte-Entity-Serialization.patch +++ b/patches/server/0676-Add-Raw-Byte-Entity-Serialization.patch @@ -27,10 +27,10 @@ index 719f97ff0c6a6b2480c249a3517bc27757d1c01b..266cdbadbf40959ef2214d30ddba9458 return this.isPassenger() ? false : this.saveAsPassenger(nbt); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 02dc40b6f7b82ce503c33fb4af26cbb20c9d5b7a..5fad5dbc0815ec3ee86a3fb34fe0c68bb4c33bcc 100644 +index ec2c989f690020cd9959fac877bae0a0263872fa..594b5e0fd56eb92ebcb0ea5a6ccdb3ba37a6adcc 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1360,5 +1360,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1375,5 +1375,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { } return set; } @@ -47,10 +47,10 @@ index 02dc40b6f7b82ce503c33fb4af26cbb20c9d5b7a..5fad5dbc0815ec3ee86a3fb34fe0c68b // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index bbc3724769497e7687a27d800cd7511c5f1fe667..e8e26cca7fc8090a3b22925ae37e2362a44ced80 100644 +index d59368cc5d280935da1aac1d9322583527e8742d..ab3e0782720359b9825a636c5fdf8725c66687bf 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -491,6 +491,29 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -550,6 +550,29 @@ public final class CraftMagicNumbers implements UnsafeValues { return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.of(ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.ITEM_STACK, compound, dataVersion, getDataVersion()))); } diff --git a/patches/server/0679-Vanilla-command-permission-fixes.patch b/patches/server/0677-Vanilla-command-permission-fixes.patch index 4f690751a2..4f690751a2 100644 --- a/patches/server/0679-Vanilla-command-permission-fixes.patch +++ b/patches/server/0677-Vanilla-command-permission-fixes.patch diff --git a/patches/server/0680-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch b/patches/server/0678-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch index 51a8fd4611..0391a41a14 100644 --- a/patches/server/0680-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch +++ b/patches/server/0678-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch @@ -9,7 +9,7 @@ chunk through it. This should also be OK from a leak prevention/ state desync POV because the TE is getting unloaded anyways. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index e809a959d69197ecdec768a2d4f348c73c0d5b9a..0f6d4f80677c54a94a1bbfb861a3bcce17b83489 100644 +index 29f0a4bd537c13ee73570e2d78b641c5751e9bfe..261a0dcff17f451faf73b61abb9b3dc23798b029 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1553,9 +1553,13 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0681-Fix-GameProfileCache-concurrency.patch b/patches/server/0679-Fix-GameProfileCache-concurrency.patch index 8c22da1dde..8c22da1dde 100644 --- a/patches/server/0681-Fix-GameProfileCache-concurrency.patch +++ b/patches/server/0679-Fix-GameProfileCache-concurrency.patch diff --git a/patches/server/0682-Improve-and-expand-AsyncCatcher.patch b/patches/server/0680-Improve-and-expand-AsyncCatcher.patch index b2edc90b2d..d225503fc8 100644 --- a/patches/server/0682-Improve-and-expand-AsyncCatcher.patch +++ b/patches/server/0680-Improve-and-expand-AsyncCatcher.patch @@ -17,7 +17,7 @@ Async catch modifications to critical entity state Co-authored-by: Jake Potrebic <[email protected]> diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 5c98df63c36a01a70569894534f6059218ba83d2..c76fa82020feba290787efb7eb6bb000ef98db8b 100644 +index a15268acd17dfc12773a18b0c81e6f331fdad79c..c8b23cdc7748d0b62daed36965bcac5044ffa330 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1656,6 +1656,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -166,10 +166,10 @@ index 47bab513feec217d875192afef61f3af95b93d24..d3fb277878adb26c7d80cf21f2707038 PersistentEntitySectionManager.LOGGER.warn("Entity {} wasn't found in section {} (destroying due to {})", new Object[]{this.entity, SectionPos.of(this.currentSectionKey), reason}); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 084bf9ab43c322f8856dc8f600a18ae166aaa5ef..4590764ec62938e2b601f9f8339d5c4ea183e5e2 100644 +index a7c7f865c88faed1e18b1793ec2a5c39cf892de5..1a41f371d9fc147ab0fd833d1bacb10096ec4f65 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -451,6 +451,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -454,6 +454,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @Override public boolean addPotionEffect(PotionEffect effect, boolean force) { diff --git a/patches/server/0683-Add-paper-mobcaps-and-paper-playermobcaps.patch b/patches/server/0681-Add-paper-mobcaps-and-paper-playermobcaps.patch index 4ff6d7fef3..379bc50cdd 100644 --- a/patches/server/0683-Add-paper-mobcaps-and-paper-playermobcaps.patch +++ b/patches/server/0681-Add-paper-mobcaps-and-paper-playermobcaps.patch @@ -278,10 +278,10 @@ index a3461824fd2162d509facf6f64c5008e3f0fd42b..d4f99f4592a86e2d8344bc2c44711fef // Paper start - add parameters and int ret type spawnCategoryForChunk(group, world, chunk, checker, runner, Integer.MAX_VALUE, null); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 46a4a9e18299060fa0050e2bd0e5a01716a6bce0..dfb3aef5fdc4fea0975c7f27ceaf895f1094f8a5 100644 +index 49a1b5d9c677809075f1f8bf1acd9e9f944819e2..d2c162ba4a52557bbd20249ff69b26dcbc34bc09 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2186,6 +2186,11 @@ public final class CraftServer implements Server { +@@ -2197,6 +2197,11 @@ public final class CraftServer implements Server { @Override public int getSpawnLimit(SpawnCategory spawnCategory) { @@ -294,10 +294,10 @@ index 46a4a9e18299060fa0050e2bd0e5a01716a6bce0..dfb3aef5fdc4fea0975c7f27ceaf895f } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 8bdcf37f7e0adbf6be73a44bdbda8e69e105c2e3..dbdae5af24f762c7c2678754eb688c0de9ca5215 100644 +index ea01717f5fc77a1503eb518107f15dcf3ec11be0..7290b4a74689db1ccdfccd9559d8fa39cfd775b0 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1704,9 +1704,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1698,9 +1698,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { Preconditions.checkArgument(spawnCategory != null, "SpawnCategory cannot be null"); Preconditions.checkArgument(CraftSpawnCategory.isValidForLimits(spawnCategory), "SpawnCategory.%s are not supported", spawnCategory); diff --git a/patches/server/0684-Sanitize-ResourceLocation-error-logging.patch b/patches/server/0682-Sanitize-ResourceLocation-error-logging.patch index d8427b5ba0..d8427b5ba0 100644 --- a/patches/server/0684-Sanitize-ResourceLocation-error-logging.patch +++ b/patches/server/0682-Sanitize-ResourceLocation-error-logging.patch diff --git a/patches/server/0685-Allow-controlled-flushing-for-network-manager.patch b/patches/server/0683-Allow-controlled-flushing-for-network-manager.patch index fd7bf47eb3..fd7bf47eb3 100644 --- a/patches/server/0685-Allow-controlled-flushing-for-network-manager.patch +++ b/patches/server/0683-Allow-controlled-flushing-for-network-manager.patch diff --git a/patches/server/0686-Optimise-general-POI-access.patch b/patches/server/0684-Optimise-general-POI-access.patch index 02fe35aa9d..02fe35aa9d 100644 --- a/patches/server/0686-Optimise-general-POI-access.patch +++ b/patches/server/0684-Optimise-general-POI-access.patch diff --git a/patches/server/0687-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch b/patches/server/0685-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch index 9039a81a52..9039a81a52 100644 --- a/patches/server/0687-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch +++ b/patches/server/0685-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch diff --git a/patches/server/0688-Optimise-chunk-tick-iteration.patch b/patches/server/0686-Optimise-chunk-tick-iteration.patch index 701231d24f..701231d24f 100644 --- a/patches/server/0688-Optimise-chunk-tick-iteration.patch +++ b/patches/server/0686-Optimise-chunk-tick-iteration.patch diff --git a/patches/server/0689-Execute-chunk-tasks-mid-tick.patch b/patches/server/0687-Execute-chunk-tasks-mid-tick.patch index e58dbbe393..8521168a8a 100644 --- a/patches/server/0689-Execute-chunk-tasks-mid-tick.patch +++ b/patches/server/0687-Execute-chunk-tasks-mid-tick.patch @@ -127,7 +127,7 @@ index 828de28f2777e2477a9c6545c8af96c4ca4e352b..2a31265ac49b7a6e32105530d00952ee } // Paper start - optimise chunk tick iteration diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 0f6d4f80677c54a94a1bbfb861a3bcce17b83489..1d0f87185a8a74394bc2da29828407fd4210754c 100644 +index 261a0dcff17f451faf73b61abb9b3dc23798b029..36bf91e58e74fac790eca7e7b6cc58dd42ff462c 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -215,6 +215,7 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0690-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch b/patches/server/0688-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch index 293669046c..293669046c 100644 --- a/patches/server/0690-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch +++ b/patches/server/0688-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch diff --git a/patches/server/0691-Custom-table-implementation-for-blockstate-state-loo.patch b/patches/server/0689-Custom-table-implementation-for-blockstate-state-loo.patch index 0318d05517..0318d05517 100644 --- a/patches/server/0691-Custom-table-implementation-for-blockstate-state-loo.patch +++ b/patches/server/0689-Custom-table-implementation-for-blockstate-state-loo.patch diff --git a/patches/server/0692-Detail-more-information-in-watchdog-dumps.patch b/patches/server/0690-Detail-more-information-in-watchdog-dumps.patch index 7c18ec69e5..2ef8fc65c9 100644 --- a/patches/server/0692-Detail-more-information-in-watchdog-dumps.patch +++ b/patches/server/0690-Detail-more-information-in-watchdog-dumps.patch @@ -76,7 +76,7 @@ index 4a1148a76020089caf01f888f87afdbb35788dc0..52a84eeb3b7df782cbf91aac6df42fb8 }); throw RunningOnDifferentThreadException.RUNNING_ON_DIFFERENT_THREAD; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 1d0f87185a8a74394bc2da29828407fd4210754c..d6429d721116aac2a4df8d0b217e9efcb698094e 100644 +index 36bf91e58e74fac790eca7e7b6cc58dd42ff462c..4db57d685e926aea21644473c2a9790bfca47e3f 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1200,7 +1200,26 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0693-Manually-inline-methods-in-BlockPosition.patch b/patches/server/0691-Manually-inline-methods-in-BlockPosition.patch index c8b8adfce9..c8b8adfce9 100644 --- a/patches/server/0693-Manually-inline-methods-in-BlockPosition.patch +++ b/patches/server/0691-Manually-inline-methods-in-BlockPosition.patch diff --git a/patches/server/0694-Distance-manager-tick-timings.patch b/patches/server/0692-Distance-manager-tick-timings.patch index 1ea0186cb3..1ea0186cb3 100644 --- a/patches/server/0694-Distance-manager-tick-timings.patch +++ b/patches/server/0692-Distance-manager-tick-timings.patch diff --git a/patches/server/0695-Name-craft-scheduler-threads-according-to-the-plugin.patch b/patches/server/0693-Name-craft-scheduler-threads-according-to-the-plugin.patch index e2e0d713f0..e2e0d713f0 100644 --- a/patches/server/0695-Name-craft-scheduler-threads-according-to-the-plugin.patch +++ b/patches/server/0693-Name-craft-scheduler-threads-according-to-the-plugin.patch diff --git a/patches/server/0696-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch b/patches/server/0694-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch index 336cbb88f7..336cbb88f7 100644 --- a/patches/server/0696-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch +++ b/patches/server/0694-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch diff --git a/patches/server/0697-Add-packet-limiter-config.patch b/patches/server/0695-Add-packet-limiter-config.patch index 4e51d69d3a..4e51d69d3a 100644 --- a/patches/server/0697-Add-packet-limiter-config.patch +++ b/patches/server/0695-Add-packet-limiter-config.patch diff --git a/patches/server/0698-Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch b/patches/server/0696-Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch index 30ce1f4f3d..30ce1f4f3d 100644 --- a/patches/server/0698-Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch +++ b/patches/server/0696-Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch diff --git a/patches/server/0699-Consolidate-flush-calls-for-entity-tracker-packets.patch b/patches/server/0697-Consolidate-flush-calls-for-entity-tracker-packets.patch index 6846952891..6846952891 100644 --- a/patches/server/0699-Consolidate-flush-calls-for-entity-tracker-packets.patch +++ b/patches/server/0697-Consolidate-flush-calls-for-entity-tracker-packets.patch diff --git a/patches/server/0700-Don-t-lookup-fluid-state-when-raytracing.patch b/patches/server/0698-Don-t-lookup-fluid-state-when-raytracing.patch index 3497fb942c..3497fb942c 100644 --- a/patches/server/0700-Don-t-lookup-fluid-state-when-raytracing.patch +++ b/patches/server/0698-Don-t-lookup-fluid-state-when-raytracing.patch diff --git a/patches/server/0701-Time-scoreboard-search.patch b/patches/server/0699-Time-scoreboard-search.patch index 5c5417edeb..5c5417edeb 100644 --- a/patches/server/0701-Time-scoreboard-search.patch +++ b/patches/server/0699-Time-scoreboard-search.patch diff --git a/patches/server/0702-Send-full-pos-packets-for-hard-colliding-entities.patch b/patches/server/0700-Send-full-pos-packets-for-hard-colliding-entities.patch index dba17c9f63..dba17c9f63 100644 --- a/patches/server/0702-Send-full-pos-packets-for-hard-colliding-entities.patch +++ b/patches/server/0700-Send-full-pos-packets-for-hard-colliding-entities.patch diff --git a/patches/server/0703-Do-not-run-raytrace-logic-for-AIR.patch b/patches/server/0701-Do-not-run-raytrace-logic-for-AIR.patch index 61d1c10cc0..61d1c10cc0 100644 --- a/patches/server/0703-Do-not-run-raytrace-logic-for-AIR.patch +++ b/patches/server/0701-Do-not-run-raytrace-logic-for-AIR.patch diff --git a/patches/server/0704-Oprimise-map-impl-for-tracked-players.patch b/patches/server/0702-Oprimise-map-impl-for-tracked-players.patch index 6d88849131..6d88849131 100644 --- a/patches/server/0704-Oprimise-map-impl-for-tracked-players.patch +++ b/patches/server/0702-Oprimise-map-impl-for-tracked-players.patch diff --git a/patches/server/0705-Optimise-BlockSoil-nearby-water-lookup.patch b/patches/server/0703-Optimise-BlockSoil-nearby-water-lookup.patch index ed636e2ee2..ed636e2ee2 100644 --- a/patches/server/0705-Optimise-BlockSoil-nearby-water-lookup.patch +++ b/patches/server/0703-Optimise-BlockSoil-nearby-water-lookup.patch diff --git a/patches/server/0706-Optimise-random-block-ticking.patch b/patches/server/0704-Optimise-random-block-ticking.patch index 4157e93a2c..3b8cd54444 100644 --- a/patches/server/0706-Optimise-random-block-ticking.patch +++ b/patches/server/0704-Optimise-random-block-ticking.patch @@ -90,7 +90,7 @@ index 0000000000000000000000000000000000000000..7d93652c1abbb6aee6eb7c26cf35d4d0 + } +} diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index d6429d721116aac2a4df8d0b217e9efcb698094e..fb9cf86250939fbc9cf1bfb90f6a1a7f4a489460 100644 +index 4db57d685e926aea21644473c2a9790bfca47e3f..be8d7aa376474c6806fe95a64c9ef9c17199ba73 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -845,6 +845,10 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0707-Optimise-non-flush-packet-sending.patch b/patches/server/0705-Optimise-non-flush-packet-sending.patch index f9efebf60a..f9efebf60a 100644 --- a/patches/server/0707-Optimise-non-flush-packet-sending.patch +++ b/patches/server/0705-Optimise-non-flush-packet-sending.patch diff --git a/patches/server/0708-Optimise-nearby-player-lookups.patch b/patches/server/0706-Optimise-nearby-player-lookups.patch index 43c9989b3d..3488660c74 100644 --- a/patches/server/0708-Optimise-nearby-player-lookups.patch +++ b/patches/server/0706-Optimise-nearby-player-lookups.patch @@ -104,7 +104,7 @@ index d83a4405b68d2417de345849b936d43c17e11392..9209b598d7168b82574e4800056b8b9f protected ChunkGenerator generator() { diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index fb9cf86250939fbc9cf1bfb90f6a1a7f4a489460..84ef33f700d3205d934802dceb4a2279df00adb0 100644 +index be8d7aa376474c6806fe95a64c9ef9c17199ba73..712d977f55174fd9e731ea1e964c96bc25765646 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -562,6 +562,84 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0709-Remove-streams-for-villager-AI.patch b/patches/server/0707-Remove-streams-for-villager-AI.patch index b4ef086afb..b4ef086afb 100644 --- a/patches/server/0709-Remove-streams-for-villager-AI.patch +++ b/patches/server/0707-Remove-streams-for-villager-AI.patch diff --git a/patches/server/0710-Use-Velocity-compression-and-cipher-natives.patch b/patches/server/0708-Use-Velocity-compression-and-cipher-natives.patch index 9848c6b07d..f64297f0d5 100644 --- a/patches/server/0710-Use-Velocity-compression-and-cipher-natives.patch +++ b/patches/server/0708-Use-Velocity-compression-and-cipher-natives.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Use Velocity compression and cipher natives diff --git a/build.gradle.kts b/build.gradle.kts -index d63f6a46244b9dd133f12e9cfae16c8cf3b394da..f783c349fe0f4c9ebd15ea20e04b3291d294e947 100644 +index 338d35cafb42dfc042bd9eb7a2c6303fc38f1208..b695b2364d030717b70a7c3bd0b072ca8a0702f0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -33,6 +33,11 @@ dependencies { +@@ -32,6 +32,11 @@ dependencies { runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.0") runtimeOnly("com.mysql:mysql-connector-j:8.0.33") runtimeOnly("com.lmax:disruptor:3.4.4") // Paper diff --git a/patches/server/0711-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch b/patches/server/0709-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch index 125dc57c81..125dc57c81 100644 --- a/patches/server/0711-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch +++ b/patches/server/0709-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch diff --git a/patches/server/0712-Fix-Bukkit-NamespacedKey-shenanigans.patch b/patches/server/0710-Fix-Bukkit-NamespacedKey-shenanigans.patch index c77b9ae0d6..c77b9ae0d6 100644 --- a/patches/server/0712-Fix-Bukkit-NamespacedKey-shenanigans.patch +++ b/patches/server/0710-Fix-Bukkit-NamespacedKey-shenanigans.patch diff --git a/patches/server/0713-Fix-merchant-inventory-not-closing-on-entity-removal.patch b/patches/server/0711-Fix-merchant-inventory-not-closing-on-entity-removal.patch index 175e6eef47..a52ea0bc87 100644 --- a/patches/server/0713-Fix-merchant-inventory-not-closing-on-entity-removal.patch +++ b/patches/server/0711-Fix-merchant-inventory-not-closing-on-entity-removal.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix merchant inventory not closing on entity removal diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 84ef33f700d3205d934802dceb4a2279df00adb0..b00c1df57789996fef58b2c649588c13df149abd 100644 +index 712d977f55174fd9e731ea1e964c96bc25765646..04a2f85a0365e8763d28aef68540f508667b750f 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -2737,6 +2737,11 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0714-Check-requirement-before-suggesting-root-nodes.patch b/patches/server/0712-Check-requirement-before-suggesting-root-nodes.patch index 4f135f41df..4f135f41df 100644 --- a/patches/server/0714-Check-requirement-before-suggesting-root-nodes.patch +++ b/patches/server/0712-Check-requirement-before-suggesting-root-nodes.patch diff --git a/patches/server/0715-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch b/patches/server/0713-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch index 07963d7944..7bbbdf3b84 100644 --- a/patches/server/0715-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch +++ b/patches/server/0713-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Don't respond to ServerboundCommandSuggestionPacket when diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index c76fa82020feba290787efb7eb6bb000ef98db8b..9ae8bdc5d17f585257f61f3692117e82e718b6f4 100644 +index c8b23cdc7748d0b62daed36965bcac5044ffa330..107cbffb8838a836b38ed386a6129781a5ae3ed4 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -847,6 +847,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic diff --git a/patches/server/0716-Fix-setPatternColor-on-tropical-fish-bucket-meta.patch b/patches/server/0714-Fix-setPatternColor-on-tropical-fish-bucket-meta.patch index 8bc6527cd8..e744de6067 100644 --- a/patches/server/0716-Fix-setPatternColor-on-tropical-fish-bucket-meta.patch +++ b/patches/server/0714-Fix-setPatternColor-on-tropical-fish-bucket-meta.patch @@ -11,7 +11,7 @@ This commit hence simply fixes this by using the proper body colour value when updating the pattern color. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaTropicalFishBucket.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaTropicalFishBucket.java -index 581e0f4d68d6eb8eb04449586ffdba35e8b3ad2b..9a045a7793ec20334853a0e1c3529b31899214b3 100644 +index 259c4f0f85c79bf5f0e81520937aedff73f929a5..43264db3a2ff9ad25522df9abbbf0069c29ec730 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaTropicalFishBucket.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaTropicalFishBucket.java @@ -107,7 +107,7 @@ class CraftMetaTropicalFishBucket extends CraftMetaItem implements TropicalFishB diff --git a/patches/server/0717-Ensure-valid-vehicle-status.patch b/patches/server/0715-Ensure-valid-vehicle-status.patch index f96c46691e..f96c46691e 100644 --- a/patches/server/0717-Ensure-valid-vehicle-status.patch +++ b/patches/server/0715-Ensure-valid-vehicle-status.patch diff --git a/patches/server/0718-Prevent-softlocked-end-exit-portal-generation.patch b/patches/server/0716-Prevent-softlocked-end-exit-portal-generation.patch index 4b7141d625..4b7141d625 100644 --- a/patches/server/0718-Prevent-softlocked-end-exit-portal-generation.patch +++ b/patches/server/0716-Prevent-softlocked-end-exit-portal-generation.patch diff --git a/patches/server/0719-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch b/patches/server/0717-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch index b415f668ab..b415f668ab 100644 --- a/patches/server/0719-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch +++ b/patches/server/0717-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch diff --git a/patches/server/0720-Don-t-log-debug-logging-being-disabled.patch b/patches/server/0718-Don-t-log-debug-logging-being-disabled.patch index 82e266f96e..82e266f96e 100644 --- a/patches/server/0720-Don-t-log-debug-logging-being-disabled.patch +++ b/patches/server/0718-Don-t-log-debug-logging-being-disabled.patch diff --git a/patches/server/0721-fix-various-menus-with-empty-level-accesses.patch b/patches/server/0719-fix-various-menus-with-empty-level-accesses.patch index 3bda24b9c6..3bda24b9c6 100644 --- a/patches/server/0721-fix-various-menus-with-empty-level-accesses.patch +++ b/patches/server/0719-fix-various-menus-with-empty-level-accesses.patch diff --git a/patches/server/0722-Preserve-overstacked-loot.patch b/patches/server/0720-Preserve-overstacked-loot.patch index 940c8f47ca..940c8f47ca 100644 --- a/patches/server/0722-Preserve-overstacked-loot.patch +++ b/patches/server/0720-Preserve-overstacked-loot.patch diff --git a/patches/server/0723-Update-head-rotation-in-missing-places.patch b/patches/server/0721-Update-head-rotation-in-missing-places.patch index d08c4d10e5..d08c4d10e5 100644 --- a/patches/server/0723-Update-head-rotation-in-missing-places.patch +++ b/patches/server/0721-Update-head-rotation-in-missing-places.patch diff --git a/patches/server/0724-prevent-unintended-light-block-manipulation.patch b/patches/server/0722-prevent-unintended-light-block-manipulation.patch index 745b4cd9b5..745b4cd9b5 100644 --- a/patches/server/0724-prevent-unintended-light-block-manipulation.patch +++ b/patches/server/0722-prevent-unintended-light-block-manipulation.patch diff --git a/patches/server/0725-Fix-CraftCriteria-defaults-map.patch b/patches/server/0723-Fix-CraftCriteria-defaults-map.patch index 65eeffccea..65eeffccea 100644 --- a/patches/server/0725-Fix-CraftCriteria-defaults-map.patch +++ b/patches/server/0723-Fix-CraftCriteria-defaults-map.patch diff --git a/patches/server/0726-Fix-upstreams-block-state-factories.patch b/patches/server/0724-Fix-upstreams-block-state-factories.patch index 386d9a5449..b3df057e8c 100644 --- a/patches/server/0726-Fix-upstreams-block-state-factories.patch +++ b/patches/server/0724-Fix-upstreams-block-state-factories.patch @@ -39,7 +39,7 @@ index fbf2c487d7ea0e6530ab664ba706cbcf81fc60a3..e30d5235c89a23b31ef259a480e23aa0 private final T tileEntity; private final T snapshot; diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java -index 17e1131c79ad140c0803a914621ce7924f0f2a6d..da4609caecc8183d02c301c7cedbca52ed39323f 100644 +index 3af36dd64e5e2a4eb142a24254e3e271a4524943..731f2b01799ccb6cebb1a30e3eccf5df11392f99 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java @@ -19,6 +19,7 @@ import net.minecraft.world.level.block.entity.BeehiveBlockEntity; @@ -60,7 +60,7 @@ index 17e1131c79ad140c0803a914621ce7924f0f2a6d..da4609caecc8183d02c301c7cedbca52 - return new CraftBlockEntityState<>(world, tileEntity); - } + // Paper - revert upstream's revert of the block state changes. Block entities that have already had the block type set to AIR are still valid, upstream decided to ignore them - Preconditions.checkState(tileEntity == null, "Unexpected BlockState for %s", CraftMagicNumbers.getMaterial(blockData.getBlock())); + Preconditions.checkState(tileEntity == null, "Unexpected BlockState for %s", CraftBlockType.minecraftToBukkit(blockData.getBlock()).getKey()); return new CraftBlockState(world, blockPosition, blockData); } }; @@ -74,212 +74,212 @@ index 17e1131c79ad140c0803a914621ce7924f0f2a6d..da4609caecc8183d02c301c7cedbca52 static { - register( - Arrays.asList( -- Material.ACACIA_SIGN, -- Material.ACACIA_WALL_SIGN, -- Material.BAMBOO_SIGN, -- Material.BAMBOO_WALL_SIGN, -- Material.BIRCH_SIGN, -- Material.BIRCH_WALL_SIGN, -- Material.CHERRY_SIGN, -- Material.CHERRY_WALL_SIGN, -- Material.CRIMSON_SIGN, -- Material.CRIMSON_WALL_SIGN, -- Material.DARK_OAK_SIGN, -- Material.DARK_OAK_WALL_SIGN, -- Material.JUNGLE_SIGN, -- Material.JUNGLE_WALL_SIGN, -- Material.MANGROVE_SIGN, -- Material.MANGROVE_WALL_SIGN, -- Material.OAK_SIGN, -- Material.OAK_WALL_SIGN, -- Material.SPRUCE_SIGN, -- Material.SPRUCE_WALL_SIGN, -- Material.WARPED_SIGN, -- Material.WARPED_WALL_SIGN +- BlockType.ACACIA_SIGN, +- BlockType.ACACIA_WALL_SIGN, +- BlockType.BAMBOO_SIGN, +- BlockType.BAMBOO_WALL_SIGN, +- BlockType.BIRCH_SIGN, +- BlockType.BIRCH_WALL_SIGN, +- BlockType.CHERRY_SIGN, +- BlockType.CHERRY_WALL_SIGN, +- BlockType.CRIMSON_SIGN, +- BlockType.CRIMSON_WALL_SIGN, +- BlockType.DARK_OAK_SIGN, +- BlockType.DARK_OAK_WALL_SIGN, +- BlockType.JUNGLE_SIGN, +- BlockType.JUNGLE_WALL_SIGN, +- BlockType.MANGROVE_SIGN, +- BlockType.MANGROVE_WALL_SIGN, +- BlockType.OAK_SIGN, +- BlockType.OAK_WALL_SIGN, +- BlockType.SPRUCE_SIGN, +- BlockType.SPRUCE_WALL_SIGN, +- BlockType.WARPED_SIGN, +- BlockType.WARPED_WALL_SIGN - ), CraftSign.class, CraftSign::new, SignBlockEntity::new - ); - - register( - Arrays.asList( -- Material.ACACIA_HANGING_SIGN, -- Material.ACACIA_WALL_HANGING_SIGN, -- Material.BAMBOO_HANGING_SIGN, -- Material.BAMBOO_WALL_HANGING_SIGN, -- Material.BIRCH_HANGING_SIGN, -- Material.BIRCH_WALL_HANGING_SIGN, -- Material.CHERRY_HANGING_SIGN, -- Material.CHERRY_WALL_HANGING_SIGN, -- Material.CRIMSON_HANGING_SIGN, -- Material.CRIMSON_WALL_HANGING_SIGN, -- Material.DARK_OAK_HANGING_SIGN, -- Material.DARK_OAK_WALL_HANGING_SIGN, -- Material.JUNGLE_HANGING_SIGN, -- Material.JUNGLE_WALL_HANGING_SIGN, -- Material.MANGROVE_HANGING_SIGN, -- Material.MANGROVE_WALL_HANGING_SIGN, -- Material.OAK_HANGING_SIGN, -- Material.OAK_WALL_HANGING_SIGN, -- Material.SPRUCE_HANGING_SIGN, -- Material.SPRUCE_WALL_HANGING_SIGN, -- Material.WARPED_HANGING_SIGN, -- Material.WARPED_WALL_HANGING_SIGN +- BlockType.ACACIA_HANGING_SIGN, +- BlockType.ACACIA_WALL_HANGING_SIGN, +- BlockType.BAMBOO_HANGING_SIGN, +- BlockType.BAMBOO_WALL_HANGING_SIGN, +- BlockType.BIRCH_HANGING_SIGN, +- BlockType.BIRCH_WALL_HANGING_SIGN, +- BlockType.CHERRY_HANGING_SIGN, +- BlockType.CHERRY_WALL_HANGING_SIGN, +- BlockType.CRIMSON_HANGING_SIGN, +- BlockType.CRIMSON_WALL_HANGING_SIGN, +- BlockType.DARK_OAK_HANGING_SIGN, +- BlockType.DARK_OAK_WALL_HANGING_SIGN, +- BlockType.JUNGLE_HANGING_SIGN, +- BlockType.JUNGLE_WALL_HANGING_SIGN, +- BlockType.MANGROVE_HANGING_SIGN, +- BlockType.MANGROVE_WALL_HANGING_SIGN, +- BlockType.OAK_HANGING_SIGN, +- BlockType.OAK_WALL_HANGING_SIGN, +- BlockType.SPRUCE_HANGING_SIGN, +- BlockType.SPRUCE_WALL_HANGING_SIGN, +- BlockType.WARPED_HANGING_SIGN, +- BlockType.WARPED_WALL_HANGING_SIGN - ), CraftHangingSign.class, CraftHangingSign::new, HangingSignBlockEntity::new - ); - - register( - Arrays.asList( -- Material.CREEPER_HEAD, -- Material.CREEPER_WALL_HEAD, -- Material.DRAGON_HEAD, -- Material.DRAGON_WALL_HEAD, -- Material.PIGLIN_HEAD, -- Material.PIGLIN_WALL_HEAD, -- Material.PLAYER_HEAD, -- Material.PLAYER_WALL_HEAD, -- Material.SKELETON_SKULL, -- Material.SKELETON_WALL_SKULL, -- Material.WITHER_SKELETON_SKULL, -- Material.WITHER_SKELETON_WALL_SKULL, -- Material.ZOMBIE_HEAD, -- Material.ZOMBIE_WALL_HEAD +- BlockType.CREEPER_HEAD, +- BlockType.CREEPER_WALL_HEAD, +- BlockType.DRAGON_HEAD, +- BlockType.DRAGON_WALL_HEAD, +- BlockType.PIGLIN_HEAD, +- BlockType.PIGLIN_WALL_HEAD, +- BlockType.PLAYER_HEAD, +- BlockType.PLAYER_WALL_HEAD, +- BlockType.SKELETON_SKULL, +- BlockType.SKELETON_WALL_SKULL, +- BlockType.WITHER_SKELETON_SKULL, +- BlockType.WITHER_SKELETON_WALL_SKULL, +- BlockType.ZOMBIE_HEAD, +- BlockType.ZOMBIE_WALL_HEAD - ), CraftSkull.class, CraftSkull::new, SkullBlockEntity::new - ); - - register( - Arrays.asList( -- Material.COMMAND_BLOCK, -- Material.REPEATING_COMMAND_BLOCK, -- Material.CHAIN_COMMAND_BLOCK +- BlockType.COMMAND_BLOCK, +- BlockType.REPEATING_COMMAND_BLOCK, +- BlockType.CHAIN_COMMAND_BLOCK - ), CraftCommandBlock.class, CraftCommandBlock::new, CommandBlockEntity::new - ); - - register( - Arrays.asList( -- Material.BLACK_BANNER, -- Material.BLACK_WALL_BANNER, -- Material.BLUE_BANNER, -- Material.BLUE_WALL_BANNER, -- Material.BROWN_BANNER, -- Material.BROWN_WALL_BANNER, -- Material.CYAN_BANNER, -- Material.CYAN_WALL_BANNER, -- Material.GRAY_BANNER, -- Material.GRAY_WALL_BANNER, -- Material.GREEN_BANNER, -- Material.GREEN_WALL_BANNER, -- Material.LIGHT_BLUE_BANNER, -- Material.LIGHT_BLUE_WALL_BANNER, -- Material.LIGHT_GRAY_BANNER, -- Material.LIGHT_GRAY_WALL_BANNER, -- Material.LIME_BANNER, -- Material.LIME_WALL_BANNER, -- Material.MAGENTA_BANNER, -- Material.MAGENTA_WALL_BANNER, -- Material.ORANGE_BANNER, -- Material.ORANGE_WALL_BANNER, -- Material.PINK_BANNER, -- Material.PINK_WALL_BANNER, -- Material.PURPLE_BANNER, -- Material.PURPLE_WALL_BANNER, -- Material.RED_BANNER, -- Material.RED_WALL_BANNER, -- Material.WHITE_BANNER, -- Material.WHITE_WALL_BANNER, -- Material.YELLOW_BANNER, -- Material.YELLOW_WALL_BANNER +- BlockType.BLACK_BANNER, +- BlockType.BLACK_WALL_BANNER, +- BlockType.BLUE_BANNER, +- BlockType.BLUE_WALL_BANNER, +- BlockType.BROWN_BANNER, +- BlockType.BROWN_WALL_BANNER, +- BlockType.CYAN_BANNER, +- BlockType.CYAN_WALL_BANNER, +- BlockType.GRAY_BANNER, +- BlockType.GRAY_WALL_BANNER, +- BlockType.GREEN_BANNER, +- BlockType.GREEN_WALL_BANNER, +- BlockType.LIGHT_BLUE_BANNER, +- BlockType.LIGHT_BLUE_WALL_BANNER, +- BlockType.LIGHT_GRAY_BANNER, +- BlockType.LIGHT_GRAY_WALL_BANNER, +- BlockType.LIME_BANNER, +- BlockType.LIME_WALL_BANNER, +- BlockType.MAGENTA_BANNER, +- BlockType.MAGENTA_WALL_BANNER, +- BlockType.ORANGE_BANNER, +- BlockType.ORANGE_WALL_BANNER, +- BlockType.PINK_BANNER, +- BlockType.PINK_WALL_BANNER, +- BlockType.PURPLE_BANNER, +- BlockType.PURPLE_WALL_BANNER, +- BlockType.RED_BANNER, +- BlockType.RED_WALL_BANNER, +- BlockType.WHITE_BANNER, +- BlockType.WHITE_WALL_BANNER, +- BlockType.YELLOW_BANNER, +- BlockType.YELLOW_WALL_BANNER - ), CraftBanner.class, CraftBanner::new, BannerBlockEntity::new - ); - - register( - Arrays.asList( -- Material.SHULKER_BOX, -- Material.WHITE_SHULKER_BOX, -- Material.ORANGE_SHULKER_BOX, -- Material.MAGENTA_SHULKER_BOX, -- Material.LIGHT_BLUE_SHULKER_BOX, -- Material.YELLOW_SHULKER_BOX, -- Material.LIME_SHULKER_BOX, -- Material.PINK_SHULKER_BOX, -- Material.GRAY_SHULKER_BOX, -- Material.LIGHT_GRAY_SHULKER_BOX, -- Material.CYAN_SHULKER_BOX, -- Material.PURPLE_SHULKER_BOX, -- Material.BLUE_SHULKER_BOX, -- Material.BROWN_SHULKER_BOX, -- Material.GREEN_SHULKER_BOX, -- Material.RED_SHULKER_BOX, -- Material.BLACK_SHULKER_BOX +- BlockType.SHULKER_BOX, +- BlockType.WHITE_SHULKER_BOX, +- BlockType.ORANGE_SHULKER_BOX, +- BlockType.MAGENTA_SHULKER_BOX, +- BlockType.LIGHT_BLUE_SHULKER_BOX, +- BlockType.YELLOW_SHULKER_BOX, +- BlockType.LIME_SHULKER_BOX, +- BlockType.PINK_SHULKER_BOX, +- BlockType.GRAY_SHULKER_BOX, +- BlockType.LIGHT_GRAY_SHULKER_BOX, +- BlockType.CYAN_SHULKER_BOX, +- BlockType.PURPLE_SHULKER_BOX, +- BlockType.BLUE_SHULKER_BOX, +- BlockType.BROWN_SHULKER_BOX, +- BlockType.GREEN_SHULKER_BOX, +- BlockType.RED_SHULKER_BOX, +- BlockType.BLACK_SHULKER_BOX - ), CraftShulkerBox.class, CraftShulkerBox::new, ShulkerBoxBlockEntity::new - ); - - register( - Arrays.asList( -- Material.BLACK_BED, -- Material.BLUE_BED, -- Material.BROWN_BED, -- Material.CYAN_BED, -- Material.GRAY_BED, -- Material.GREEN_BED, -- Material.LIGHT_BLUE_BED, -- Material.LIGHT_GRAY_BED, -- Material.LIME_BED, -- Material.MAGENTA_BED, -- Material.ORANGE_BED, -- Material.PINK_BED, -- Material.PURPLE_BED, -- Material.RED_BED, -- Material.WHITE_BED, -- Material.YELLOW_BED +- BlockType.BLACK_BED, +- BlockType.BLUE_BED, +- BlockType.BROWN_BED, +- BlockType.CYAN_BED, +- BlockType.GRAY_BED, +- BlockType.GREEN_BED, +- BlockType.LIGHT_BLUE_BED, +- BlockType.LIGHT_GRAY_BED, +- BlockType.LIME_BED, +- BlockType.MAGENTA_BED, +- BlockType.ORANGE_BED, +- BlockType.PINK_BED, +- BlockType.PURPLE_BED, +- BlockType.RED_BED, +- BlockType.WHITE_BED, +- BlockType.YELLOW_BED - ), CraftBed.class, CraftBed::new, BedBlockEntity::new - ); - - register( - Arrays.asList( -- Material.BEEHIVE, -- Material.BEE_NEST +- BlockType.BEEHIVE, +- BlockType.BEE_NEST - ), CraftBeehive.class, CraftBeehive::new, BeehiveBlockEntity::new - ); - - register( - Arrays.asList( -- Material.CAMPFIRE, -- Material.SOUL_CAMPFIRE +- BlockType.CAMPFIRE, +- BlockType.SOUL_CAMPFIRE - ), CraftCampfire.class, CraftCampfire::new, CampfireBlockEntity::new - ); - -- register(Material.BARREL, CraftBarrel.class, CraftBarrel::new, BarrelBlockEntity::new); -- register(Material.BEACON, CraftBeacon.class, CraftBeacon::new, BeaconBlockEntity::new); -- register(Material.BELL, CraftBell.class, CraftBell::new, BellBlockEntity::new); -- register(Material.BLAST_FURNACE, CraftBlastFurnace.class, CraftBlastFurnace::new, BlastFurnaceBlockEntity::new); -- register(Material.BREWING_STAND, CraftBrewingStand.class, CraftBrewingStand::new, BrewingStandBlockEntity::new); -- register(Material.CHEST, CraftChest.class, CraftChest::new, ChestBlockEntity::new); -- register(Material.CHISELED_BOOKSHELF, CraftChiseledBookshelf.class, CraftChiseledBookshelf::new, ChiseledBookShelfBlockEntity::new); -- register(Material.COMPARATOR, CraftComparator.class, CraftComparator::new, ComparatorBlockEntity::new); -- register(Material.CONDUIT, CraftConduit.class, CraftConduit::new, ConduitBlockEntity::new); -- register(Material.DAYLIGHT_DETECTOR, CraftDaylightDetector.class, CraftDaylightDetector::new, DaylightDetectorBlockEntity::new); -- register(Material.DECORATED_POT, CraftDecoratedPot.class, CraftDecoratedPot::new, DecoratedPotBlockEntity::new); -- register(Material.DISPENSER, CraftDispenser.class, CraftDispenser::new, DispenserBlockEntity::new); -- register(Material.DROPPER, CraftDropper.class, CraftDropper::new, DropperBlockEntity::new); -- register(Material.ENCHANTING_TABLE, CraftEnchantingTable.class, CraftEnchantingTable::new, EnchantmentTableBlockEntity::new); -- register(Material.ENDER_CHEST, CraftEnderChest.class, CraftEnderChest::new, EnderChestBlockEntity::new); -- register(Material.END_GATEWAY, CraftEndGateway.class, CraftEndGateway::new, TheEndGatewayBlockEntity::new); -- register(Material.END_PORTAL, CraftEndPortal.class, CraftEndPortal::new, TheEndPortalBlockEntity::new); -- register(Material.FURNACE, CraftFurnaceFurnace.class, CraftFurnaceFurnace::new, FurnaceBlockEntity::new); -- register(Material.HOPPER, CraftHopper.class, CraftHopper::new, HopperBlockEntity::new); -- register(Material.JIGSAW, CraftJigsaw.class, CraftJigsaw::new, JigsawBlockEntity::new); -- register(Material.JUKEBOX, CraftJukebox.class, CraftJukebox::new, JukeboxBlockEntity::new); -- register(Material.LECTERN, CraftLectern.class, CraftLectern::new, LecternBlockEntity::new); -- register(Material.MOVING_PISTON, CraftMovingPiston.class, CraftMovingPiston::new, PistonMovingBlockEntity::new); -- register(Material.SCULK_CATALYST, CraftSculkCatalyst.class, CraftSculkCatalyst::new, SculkCatalystBlockEntity::new); -- register(Material.CALIBRATED_SCULK_SENSOR, CraftCalibratedSculkSensor.class, CraftCalibratedSculkSensor::new, CalibratedSculkSensorBlockEntity::new); -- register(Material.SCULK_SENSOR, CraftSculkSensor.class, CraftSculkSensor::new, SculkSensorBlockEntity::new); -- register(Material.SCULK_SHRIEKER, CraftSculkShrieker.class, CraftSculkShrieker::new, SculkShriekerBlockEntity::new); -- register(Material.SMOKER, CraftSmoker.class, CraftSmoker::new, SmokerBlockEntity::new); -- register(Material.SPAWNER, CraftCreatureSpawner.class, CraftCreatureSpawner::new, SpawnerBlockEntity::new); -- register(Material.STRUCTURE_BLOCK, CraftStructureBlock.class, CraftStructureBlock::new, StructureBlockEntity::new); -- register(Material.SUSPICIOUS_SAND, CraftSuspiciousSand.class, CraftSuspiciousSand::new, BrushableBlockEntity::new); -- register(Material.SUSPICIOUS_GRAVEL, CraftBrushableBlock.class, CraftBrushableBlock::new, BrushableBlockEntity::new); -- register(Material.TRAPPED_CHEST, CraftChest.class, CraftChest::new, TrappedChestBlockEntity::new); +- register(BlockType.BARREL, CraftBarrel.class, CraftBarrel::new, BarrelBlockEntity::new); +- register(BlockType.BEACON, CraftBeacon.class, CraftBeacon::new, BeaconBlockEntity::new); +- register(BlockType.BELL, CraftBell.class, CraftBell::new, BellBlockEntity::new); +- register(BlockType.BLAST_FURNACE, CraftBlastFurnace.class, CraftBlastFurnace::new, BlastFurnaceBlockEntity::new); +- register(BlockType.BREWING_STAND, CraftBrewingStand.class, CraftBrewingStand::new, BrewingStandBlockEntity::new); +- register(BlockType.CHEST, CraftChest.class, CraftChest::new, ChestBlockEntity::new); +- register(BlockType.CHISELED_BOOKSHELF, CraftChiseledBookshelf.class, CraftChiseledBookshelf::new, ChiseledBookShelfBlockEntity::new); +- register(BlockType.COMPARATOR, CraftComparator.class, CraftComparator::new, ComparatorBlockEntity::new); +- register(BlockType.CONDUIT, CraftConduit.class, CraftConduit::new, ConduitBlockEntity::new); +- register(BlockType.DAYLIGHT_DETECTOR, CraftDaylightDetector.class, CraftDaylightDetector::new, DaylightDetectorBlockEntity::new); +- register(BlockType.DECORATED_POT, CraftDecoratedPot.class, CraftDecoratedPot::new, DecoratedPotBlockEntity::new); +- register(BlockType.DISPENSER, CraftDispenser.class, CraftDispenser::new, DispenserBlockEntity::new); +- register(BlockType.DROPPER, CraftDropper.class, CraftDropper::new, DropperBlockEntity::new); +- register(BlockType.ENCHANTING_TABLE, CraftEnchantingTable.class, CraftEnchantingTable::new, EnchantmentTableBlockEntity::new); +- register(BlockType.ENDER_CHEST, CraftEnderChest.class, CraftEnderChest::new, EnderChestBlockEntity::new); +- register(BlockType.END_GATEWAY, CraftEndGateway.class, CraftEndGateway::new, TheEndGatewayBlockEntity::new); +- register(BlockType.END_PORTAL, CraftEndPortal.class, CraftEndPortal::new, TheEndPortalBlockEntity::new); +- register(BlockType.FURNACE, CraftFurnaceFurnace.class, CraftFurnaceFurnace::new, FurnaceBlockEntity::new); +- register(BlockType.HOPPER, CraftHopper.class, CraftHopper::new, HopperBlockEntity::new); +- register(BlockType.JIGSAW, CraftJigsaw.class, CraftJigsaw::new, JigsawBlockEntity::new); +- register(BlockType.JUKEBOX, CraftJukebox.class, CraftJukebox::new, JukeboxBlockEntity::new); +- register(BlockType.LECTERN, CraftLectern.class, CraftLectern::new, LecternBlockEntity::new); +- register(BlockType.MOVING_PISTON, CraftMovingPiston.class, CraftMovingPiston::new, PistonMovingBlockEntity::new); +- register(BlockType.SCULK_CATALYST, CraftSculkCatalyst.class, CraftSculkCatalyst::new, SculkCatalystBlockEntity::new); +- register(BlockType.CALIBRATED_SCULK_SENSOR, CraftCalibratedSculkSensor.class, CraftCalibratedSculkSensor::new, CalibratedSculkSensorBlockEntity::new); +- register(BlockType.SCULK_SENSOR, CraftSculkSensor.class, CraftSculkSensor::new, SculkSensorBlockEntity::new); +- register(BlockType.SCULK_SHRIEKER, CraftSculkShrieker.class, CraftSculkShrieker::new, SculkShriekerBlockEntity::new); +- register(BlockType.SMOKER, CraftSmoker.class, CraftSmoker::new, SmokerBlockEntity::new); +- register(BlockType.SPAWNER, CraftCreatureSpawner.class, CraftCreatureSpawner::new, SpawnerBlockEntity::new); +- register(BlockType.STRUCTURE_BLOCK, CraftStructureBlock.class, CraftStructureBlock::new, StructureBlockEntity::new); +- register(BlockType.SUSPICIOUS_SAND, CraftSuspiciousSand.class, CraftSuspiciousSand::new, BrushableBlockEntity::new); +- register(BlockType.SUSPICIOUS_GRAVEL, CraftBrushableBlock.class, CraftBrushableBlock::new, BrushableBlockEntity::new); +- register(BlockType.TRAPPED_CHEST, CraftChest.class, CraftChest::new, TrappedChestBlockEntity::new); + // Paper start - simplify + register(BlockEntityType.SIGN, CraftSign.class, CraftSign::new); + register(BlockEntityType.HANGING_SIGN, CraftHangingSign.class, CraftHangingSign::new); @@ -325,12 +325,12 @@ index 17e1131c79ad140c0803a914621ce7924f0f2a6d..da4609caecc8183d02c301c7cedbca52 + // Paper end } - private static void register(Material blockType, BlockStateFactory<?> factory) { -@@ -339,30 +177,33 @@ public final class CraftBlockStates { + private static void register(BlockType<?> blockType, BlockStateFactory<?> factory) { +@@ -339,35 +177,45 @@ public final class CraftBlockStates { } private static <T extends BlockEntity, B extends CraftBlockEntityState<T>> void register( -- Material blockType, +- BlockType<?> blockType, - Class<B> blockStateType, - BiFunction<World, T, B> blockStateConstructor, - BiFunction<BlockPos, net.minecraft.world.level.block.state.BlockState, T> tileEntityConstructor @@ -339,7 +339,7 @@ index 17e1131c79ad140c0803a914621ce7924f0f2a6d..da4609caecc8183d02c301c7cedbca52 - } - - private static <T extends BlockEntity, B extends CraftBlockEntityState<T>> void register( -- List<Material> blockTypes, +- List<BlockType<?>> blockTypes, + net.minecraft.world.level.block.entity.BlockEntityType<? extends T> blockEntityType, // Paper Class<B> blockStateType, - BiFunction<World, T, B> blockStateConstructor, @@ -347,36 +347,34 @@ index 17e1131c79ad140c0803a914621ce7924f0f2a6d..da4609caecc8183d02c301c7cedbca52 + BiFunction<World, T, B> blockStateConstructor // Paper ) { - BlockStateFactory<B> factory = new BlockEntityStateFactory<>(blockStateType, blockStateConstructor, tileEntityConstructor); -- for (Material blockType : blockTypes) { +- for (BlockType<?> blockType : blockTypes) { - CraftBlockStates.register(blockType, factory); + // Paper start + BlockStateFactory<B> factory = new BlockEntityStateFactory<>(blockStateType, blockStateConstructor, blockEntityType::create); + for (net.minecraft.world.level.block.Block block : blockEntityType.validBlocks) { -+ CraftBlockStates.register(CraftMagicNumbers.getMaterial(block), factory); ++ CraftBlockStates.register(CraftBlockType.minecraftToBukkit(block), factory); } + CraftBlockStates.register(blockEntityType, factory); + // Paper end } - private static BlockStateFactory<?> getFactory(Material material) { - return CraftBlockStates.FACTORIES.getOrDefault(material, DEFAULT_FACTORY); + private static BlockStateFactory<?> getFactory(BlockType<?> blockType) { + return CraftBlockStates.FACTORIES.getOrDefault(blockType, DEFAULT_FACTORY); } + // Paper start -+ private static BlockStateFactory<?> getFactory(Material material, BlockEntityType<?> type) { ++ private static BlockStateFactory<?> getFactory(BlockType<?> blockType, BlockEntityType<?> type) { + if (type != null) { -+ return CraftBlockStates.FACTORIES_BY_BLOCK_ENTITY_TYPE.getOrDefault(type, getFactory(material)); ++ return CraftBlockStates.FACTORIES_BY_BLOCK_ENTITY_TYPE.getOrDefault(type, getFactory(blockType)); + } else { -+ return getFactory(material); ++ return getFactory(blockType); + } + } + // Paper end + - public static Class<? extends CraftBlockState> getBlockStateType(Material material) { - Preconditions.checkNotNull(material, "material is null"); - return CraftBlockStates.getFactory(material).blockStateType; -@@ -378,6 +219,13 @@ public final class CraftBlockStates { - return null; + public static Class<? extends CraftBlockState> getBlockStateType(BlockType<?> blockType) { + Preconditions.checkNotNull(blockType, "blockType is null"); + return CraftBlockStates.getFactory(blockType).blockStateType; } + // Paper start @@ -386,20 +384,20 @@ index 17e1131c79ad140c0803a914621ce7924f0f2a6d..da4609caecc8183d02c301c7cedbca52 + } + // Paper end + - public static BlockState getBlockState(Block block) { - // Paper start - return CraftBlockStates.getBlockState(block, true); + public static BlockEntity createNewTileEntity(BlockType<?> blockType) { + BlockStateFactory<?> factory = CraftBlockStates.getFactory(blockType); + @@ -435,7 +283,7 @@ public final class CraftBlockStates { - if (world != null && tileEntity == null && CraftBlockStates.isTileEntityOptional(material)) { + if (world != null && tileEntity == null && CraftBlockStates.isTileEntityOptional(blockType)) { factory = CraftBlockStates.DEFAULT_FACTORY; } else { -- factory = CraftBlockStates.getFactory(material); -+ factory = CraftBlockStates.getFactory(material, tileEntity != null ? tileEntity.getType() : null); // Paper +- factory = CraftBlockStates.getFactory(blockType); ++ factory = CraftBlockStates.getFactory(blockType, tileEntity != null ? tileEntity.getType() : null); // Paper } return factory.createBlockState(world, blockPosition, blockData, tileEntity); } diff --git a/src/test/java/org/bukkit/craftbukkit/block/BlockStateTest.java b/src/test/java/org/bukkit/craftbukkit/block/BlockStateTest.java -index a6dbd1919bce5b5092666372f4cc31d2e2190c42..3cdc3bdba201afb45b7121c0792d585194c90a14 100644 +index 810dd4ca5f4098b18af57e816293209c1a4d537c..7cdf1eaa356d95f453700a6abcd9c75bc55c91cd 100644 --- a/src/test/java/org/bukkit/craftbukkit/block/BlockStateTest.java +++ b/src/test/java/org/bukkit/craftbukkit/block/BlockStateTest.java @@ -10,6 +10,7 @@ import net.minecraft.core.registries.BuiltInRegistries; @@ -408,9 +406,9 @@ index a6dbd1919bce5b5092666372f4cc31d2e2190c42..3cdc3bdba201afb45b7121c0792d5851 import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityType; import org.bukkit.Material; + import org.bukkit.block.BlockType; import org.bukkit.craftbukkit.util.CraftMagicNumbers; - import org.bukkit.support.AbstractTestingBase; -@@ -45,4 +46,13 @@ public class BlockStateTest extends AbstractTestingBase { +@@ -46,4 +47,13 @@ public class BlockStateTest extends AbstractTestingBase { } } } diff --git a/patches/server/0727-Add-config-option-for-logging-player-ip-addresses.patch b/patches/server/0725-Add-config-option-for-logging-player-ip-addresses.patch index a96c1d39be..a96c1d39be 100644 --- a/patches/server/0727-Add-config-option-for-logging-player-ip-addresses.patch +++ b/patches/server/0725-Add-config-option-for-logging-player-ip-addresses.patch diff --git a/patches/server/0728-Configurable-feature-seeds.patch b/patches/server/0726-Configurable-feature-seeds.patch index 2e7ba7f297..d38352575f 100644 --- a/patches/server/0728-Configurable-feature-seeds.patch +++ b/patches/server/0726-Configurable-feature-seeds.patch @@ -19,7 +19,7 @@ index 1080e1f67afe5574baca0df50cdb1d029a7a586a..a2f71a6d1a9e98133dff6cd0f625da94 } final Object val = config.get(key); diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java -index 3c7920721914588a3e7eaf1faff46f7305823416..eee2239cd715d01c5adbf1cd79282e115f42cd2e 100644 +index 3a6cf81e349063e47dfa2c2d40a3c3fca50beaef..6a6001c42cba124fd4439159008e6ca86b1aa21f 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java @@ -431,7 +431,14 @@ public abstract class ChunkGenerator { diff --git a/patches/server/0729-VanillaCommandWrapper-didnt-account-for-entity-sende.patch b/patches/server/0727-VanillaCommandWrapper-didnt-account-for-entity-sende.patch index f082107a26..f082107a26 100644 --- a/patches/server/0729-VanillaCommandWrapper-didnt-account-for-entity-sende.patch +++ b/patches/server/0727-VanillaCommandWrapper-didnt-account-for-entity-sende.patch diff --git a/patches/server/0730-Add-root-admin-user-detection.patch b/patches/server/0728-Add-root-admin-user-detection.patch index bc171867c0..bc171867c0 100644 --- a/patches/server/0730-Add-root-admin-user-detection.patch +++ b/patches/server/0728-Add-root-admin-user-detection.patch diff --git a/patches/server/0731-Always-allow-item-changing-in-Fireball.patch b/patches/server/0729-Always-allow-item-changing-in-Fireball.patch index f8453901a9..f8453901a9 100644 --- a/patches/server/0731-Always-allow-item-changing-in-Fireball.patch +++ b/patches/server/0729-Always-allow-item-changing-in-Fireball.patch diff --git a/patches/server/0732-don-t-attempt-to-teleport-dead-entities.patch b/patches/server/0730-don-t-attempt-to-teleport-dead-entities.patch index 35e1ddc351..35e1ddc351 100644 --- a/patches/server/0732-don-t-attempt-to-teleport-dead-entities.patch +++ b/patches/server/0730-don-t-attempt-to-teleport-dead-entities.patch diff --git a/patches/server/0733-Prevent-excessive-velocity-through-repeated-crits.patch b/patches/server/0731-Prevent-excessive-velocity-through-repeated-crits.patch index 5cdbdc4130..5cdbdc4130 100644 --- a/patches/server/0733-Prevent-excessive-velocity-through-repeated-crits.patch +++ b/patches/server/0731-Prevent-excessive-velocity-through-repeated-crits.patch diff --git a/patches/server/0734-Remove-client-side-code-using-deprecated-for-removal.patch b/patches/server/0732-Remove-client-side-code-using-deprecated-for-removal.patch index 573119e335..573119e335 100644 --- a/patches/server/0734-Remove-client-side-code-using-deprecated-for-removal.patch +++ b/patches/server/0732-Remove-client-side-code-using-deprecated-for-removal.patch diff --git a/patches/server/0735-Fix-removing-recipes-from-RecipeIterator.patch b/patches/server/0733-Fix-removing-recipes-from-RecipeIterator.patch index 50c8cae9c0..50c8cae9c0 100644 --- a/patches/server/0735-Fix-removing-recipes-from-RecipeIterator.patch +++ b/patches/server/0733-Fix-removing-recipes-from-RecipeIterator.patch diff --git a/patches/server/0736-Prevent-sending-oversized-item-data-in-equipment-and.patch b/patches/server/0734-Prevent-sending-oversized-item-data-in-equipment-and.patch index 1001f67b5d..1001f67b5d 100644 --- a/patches/server/0736-Prevent-sending-oversized-item-data-in-equipment-and.patch +++ b/patches/server/0734-Prevent-sending-oversized-item-data-in-equipment-and.patch diff --git a/patches/server/0737-Hide-unnecessary-itemmeta-from-clients.patch b/patches/server/0735-Hide-unnecessary-itemmeta-from-clients.patch index 0822fcc400..d0006ecdf4 100644 --- a/patches/server/0737-Hide-unnecessary-itemmeta-from-clients.patch +++ b/patches/server/0735-Hide-unnecessary-itemmeta-from-clients.patch @@ -18,7 +18,7 @@ index 71a8812365503d840f6702a21d504a37d67c7194..63561c0044375465fa0023b2b563a651 } } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 9ae8bdc5d17f585257f61f3692117e82e718b6f4..a47e05e1955b7c0b11fa0c36b5a97d27be0f7e1d 100644 +index 107cbffb8838a836b38ed386a6129781a5ae3ed4..e9a43b4072ed36743e259a34f763209105960a5c 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2708,8 +2708,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic diff --git a/patches/server/0738-Fix-Spigot-growth-modifiers.patch b/patches/server/0736-Fix-Spigot-growth-modifiers.patch index 7530d5438f..7530d5438f 100644 --- a/patches/server/0738-Fix-Spigot-growth-modifiers.patch +++ b/patches/server/0736-Fix-Spigot-growth-modifiers.patch diff --git a/patches/server/0739-Prevent-ContainerOpenersCounter-openCount-from-going.patch b/patches/server/0737-Prevent-ContainerOpenersCounter-openCount-from-going.patch index 62a65ff130..62a65ff130 100644 --- a/patches/server/0739-Prevent-ContainerOpenersCounter-openCount-from-going.patch +++ b/patches/server/0737-Prevent-ContainerOpenersCounter-openCount-from-going.patch diff --git a/patches/server/0740-Add-PlayerItemFrameChangeEvent.patch b/patches/server/0738-Add-PlayerItemFrameChangeEvent.patch index 6214bdbdef..6214bdbdef 100644 --- a/patches/server/0740-Add-PlayerItemFrameChangeEvent.patch +++ b/patches/server/0738-Add-PlayerItemFrameChangeEvent.patch diff --git a/patches/server/0741-Add-player-health-update-API.patch b/patches/server/0739-Add-player-health-update-API.patch index 39a40ee8e7..da7b9b09cb 100644 --- a/patches/server/0741-Add-player-health-update-API.patch +++ b/patches/server/0739-Add-player-health-update-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add player health update API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 736b97517906f154158618ad92328ad34ab1882d..8406901601abbfda9d39482bed0a17f1ebc701b1 100644 +index aa0badfdfdf8a00cc06dd95c007a8ae0957826de..f501f68cb6762f91e1c2b429d333bfa50fa89023 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2320,9 +2320,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2337,9 +2337,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().maxHealthCache = getMaxHealth(); } @@ -22,7 +22,7 @@ index 736b97517906f154158618ad92328ad34ab1882d..8406901601abbfda9d39482bed0a17f1 if (this.getHandle().queueHealthUpdatePacket) { this.getHandle().queuedHealthUpdatePacket = packet; } else { -@@ -2331,6 +2333,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2348,6 +2350,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Paper end } diff --git a/patches/server/0742-Optimize-HashMapPalette.patch b/patches/server/0740-Optimize-HashMapPalette.patch index 52a28a4fd3..52a28a4fd3 100644 --- a/patches/server/0742-Optimize-HashMapPalette.patch +++ b/patches/server/0740-Optimize-HashMapPalette.patch diff --git a/patches/server/0743-Allow-delegation-to-vanilla-chunk-gen.patch b/patches/server/0741-Allow-delegation-to-vanilla-chunk-gen.patch index 67bf1a50b0..2c79b82cc3 100644 --- a/patches/server/0743-Allow-delegation-to-vanilla-chunk-gen.patch +++ b/patches/server/0741-Allow-delegation-to-vanilla-chunk-gen.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow delegation to vanilla chunk gen diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index dfb3aef5fdc4fea0975c7f27ceaf895f1094f8a5..f23c83b281e8fa7310bd8d10f6972f68743e2ab4 100644 +index d2c162ba4a52557bbd20249ff69b26dcbc34bc09..7030323032e38ec8f9d4f4b64dab6f51963df4b3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2366,6 +2366,88 @@ public final class CraftServer implements Server { +@@ -2377,6 +2377,88 @@ public final class CraftServer implements Server { return new OldCraftChunkData(world.getMinHeight(), world.getMaxHeight(), handle.registryAccess().registryOrThrow(Registries.BIOME), world); // Paper - Anti-Xray - Add parameters } @@ -98,7 +98,7 @@ index dfb3aef5fdc4fea0975c7f27ceaf895f1094f8a5..f23c83b281e8fa7310bd8d10f6972f68 public BossBar createBossBar(String title, BarColor color, BarStyle style, BarFlag... flags) { return new CraftBossBar(title, color, style, flags); diff --git a/src/main/java/org/bukkit/craftbukkit/generator/OldCraftChunkData.java b/src/main/java/org/bukkit/craftbukkit/generator/OldCraftChunkData.java -index a9700b750f124b5367c91ac071ee5194e9f7f8d8..1a363ceeefbf69618e5f17f67b6f6a2660579ba5 100644 +index 4a2f2c7a79fe28fb3ac49d097b8b3349b5fe55bb..36ce6a51dcacd2d5d250a982a44ad287751a664d 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/OldCraftChunkData.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/OldCraftChunkData.java @@ -23,7 +23,7 @@ import org.bukkit.material.MaterialData; diff --git a/patches/server/0744-Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch b/patches/server/0742-Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch index 71830dfd1c..71830dfd1c 100644 --- a/patches/server/0744-Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch +++ b/patches/server/0742-Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch diff --git a/patches/server/0745-Optimise-collision-checking-in-player-move-packet-ha.patch b/patches/server/0743-Optimise-collision-checking-in-player-move-packet-ha.patch index 89716c784a..ae6966df1d 100644 --- a/patches/server/0745-Optimise-collision-checking-in-player-move-packet-ha.patch +++ b/patches/server/0743-Optimise-collision-checking-in-player-move-packet-ha.patch @@ -8,7 +8,7 @@ Move collision logic to just the hasNewCollision call instead of getCubes + hasN CHECK ME diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index a47e05e1955b7c0b11fa0c36b5a97d27be0f7e1d..0203c778e2cfd421d4e9516a00535a5f20e61679 100644 +index e9a43b4072ed36743e259a34f763209105960a5c..4bf8e2e371c78aeb175f068faeefc873b77d6379 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -647,7 +647,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic diff --git a/patches/server/0746-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch b/patches/server/0744-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch index 78d359b1d9..7bf82205ed 100644 --- a/patches/server/0746-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch +++ b/patches/server/0744-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix ChunkSnapshot#isSectionEmpty(int) and optimize diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -index 269ebe8e8826a0c89e471cb59b503900d7ebe0fa..883eed6e92792e225ebfa8667ce3f4eeb6287d6a 100644 +index 1ecd0c8fa79e8628f2b71302fe429e68ff89a731..aad45407a7f18e67a9a57b7d60e9e3dc10e372a2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -@@ -289,13 +289,17 @@ public class CraftChunk implements Chunk { +@@ -290,13 +290,17 @@ public class CraftChunk implements Chunk { PalettedContainerRO<Holder<net.minecraft.world.level.biome.Biome>>[] biome = (includeBiome || includeBiomeTempRain) ? new PalettedContainer[cs.length] : null; Registry<net.minecraft.world.level.biome.Biome> iregistry = this.worldServer.registryAccess().registryOrThrow(Registries.BIOME); @@ -31,7 +31,7 @@ index 269ebe8e8826a0c89e471cb59b503900d7ebe0fa..883eed6e92792e225ebfa8667ce3f4ee LevelLightEngine lightengine = this.worldServer.getLightEngine(); DataLayer skyLightArray = lightengine.getLayerListener(LightLayer.SKY).getDataLayerData(SectionPos.of(x, i, z)); -@@ -314,8 +318,7 @@ public class CraftChunk implements Chunk { +@@ -315,8 +319,7 @@ public class CraftChunk implements Chunk { } if (biome != null) { diff --git a/patches/server/0747-Add-more-Campfire-API.patch b/patches/server/0745-Add-more-Campfire-API.patch index da279b0a50..da279b0a50 100644 --- a/patches/server/0747-Add-more-Campfire-API.patch +++ b/patches/server/0745-Add-more-Campfire-API.patch diff --git a/patches/server/0748-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch b/patches/server/0746-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch index 0246c3f0d5..0246c3f0d5 100644 --- a/patches/server/0748-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch +++ b/patches/server/0746-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch diff --git a/patches/server/0749-Fix-tripwire-state-inconsistency.patch b/patches/server/0747-Fix-tripwire-state-inconsistency.patch index eba71d4136..eba71d4136 100644 --- a/patches/server/0749-Fix-tripwire-state-inconsistency.patch +++ b/patches/server/0747-Fix-tripwire-state-inconsistency.patch diff --git a/patches/server/0750-Forward-CraftEntity-in-teleport-command.patch b/patches/server/0748-Forward-CraftEntity-in-teleport-command.patch index 5ae23d9d77..5ae23d9d77 100644 --- a/patches/server/0750-Forward-CraftEntity-in-teleport-command.patch +++ b/patches/server/0748-Forward-CraftEntity-in-teleport-command.patch diff --git a/patches/server/0751-Improve-scoreboard-entries.patch b/patches/server/0749-Improve-scoreboard-entries.patch index 561724f7cd..561724f7cd 100644 --- a/patches/server/0751-Improve-scoreboard-entries.patch +++ b/patches/server/0749-Improve-scoreboard-entries.patch diff --git a/patches/server/0752-Entity-powdered-snow-API.patch b/patches/server/0750-Entity-powdered-snow-API.patch index 0df0028dcc..3896d827ea 100644 --- a/patches/server/0752-Entity-powdered-snow-API.patch +++ b/patches/server/0750-Entity-powdered-snow-API.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Entity powdered snow API public net.minecraft.world.entity.monster.Skeleton inPowderSnowTime diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 5fad5dbc0815ec3ee86a3fb34fe0c68bb4c33bcc..fbc18be64e71be2215059c34afd8129138dc4dff 100644 +index 594b5e0fd56eb92ebcb0ea5a6ccdb3ba37a6adcc..f78bfef00dc08f1b906121fda9090d705f3c1b7a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1370,5 +1370,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1385,5 +1385,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { this.entity.setRot(location.getYaw(), location.getPitch()); return !this.entity.valid && this.entity.level().addFreshEntity(this.entity, reason); } @@ -22,10 +22,10 @@ index 5fad5dbc0815ec3ee86a3fb34fe0c68bb4c33bcc..fbc18be64e71be2215059c34afd81291 // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java -index 90f34d75f99f31f5c98c499df209979a03e23191..1737857424c5da885c46f39502cafd2a670d3be7 100644 +index 956ddd955e6f9b2f02ef05b0e95150c9c90c3107..16e6325a944c1eb21dd5a3835aa8a00d238e7b5d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java -@@ -51,4 +51,11 @@ public class CraftSkeleton extends CraftAbstractSkeleton implements Skeleton { +@@ -45,4 +45,11 @@ public class CraftSkeleton extends CraftAbstractSkeleton implements Skeleton { public SkeletonType getSkeletonType() { return SkeletonType.NORMAL; } diff --git a/patches/server/0753-Add-API-for-item-entity-health.patch b/patches/server/0751-Add-API-for-item-entity-health.patch index 66df625d46..5dddc23e86 100644 --- a/patches/server/0753-Add-API-for-item-entity-health.patch +++ b/patches/server/0751-Add-API-for-item-entity-health.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Add API for item entity health public net.minecraft.world.entity.item.ItemEntity health diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java -index 27e961653dc66fbe8d5421eef04260b91ca410f4..e9946edf568db010e4ccb9fe7755709ed7b8310f 100644 +index ff6868ab31cec208045353c842f20ca31191bc0a..d160db37a3b7ef44b6de8fef209eeccef46c3a95 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java -@@ -102,6 +102,21 @@ public class CraftItem extends CraftEntity implements Item { +@@ -101,6 +101,21 @@ public class CraftItem extends CraftEntity implements Item { public void setWillAge(boolean willAge) { item.age = willAge ? 0 : NO_AGE_TIME; } diff --git a/patches/server/0754-Fix-entity-type-tags-suggestions-in-selectors.patch b/patches/server/0752-Fix-entity-type-tags-suggestions-in-selectors.patch index 913bb30928..913bb30928 100644 --- a/patches/server/0754-Fix-entity-type-tags-suggestions-in-selectors.patch +++ b/patches/server/0752-Fix-entity-type-tags-suggestions-in-selectors.patch diff --git a/patches/server/0755-Configurable-max-block-light-for-monster-spawning.patch b/patches/server/0753-Configurable-max-block-light-for-monster-spawning.patch index baf913d352..baf913d352 100644 --- a/patches/server/0755-Configurable-max-block-light-for-monster-spawning.patch +++ b/patches/server/0753-Configurable-max-block-light-for-monster-spawning.patch diff --git a/patches/server/0756-Fix-sticky-pistons-and-BlockPistonRetractEvent.patch b/patches/server/0754-Fix-sticky-pistons-and-BlockPistonRetractEvent.patch index d4f3ab6d9f..d4f3ab6d9f 100644 --- a/patches/server/0756-Fix-sticky-pistons-and-BlockPistonRetractEvent.patch +++ b/patches/server/0754-Fix-sticky-pistons-and-BlockPistonRetractEvent.patch diff --git a/patches/server/0757-Load-effect-amplifiers-greater-than-127-correctly.patch b/patches/server/0755-Load-effect-amplifiers-greater-than-127-correctly.patch index 2b10cf2e71..2b10cf2e71 100644 --- a/patches/server/0757-Load-effect-amplifiers-greater-than-127-correctly.patch +++ b/patches/server/0755-Load-effect-amplifiers-greater-than-127-correctly.patch diff --git a/patches/server/0758-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch b/patches/server/0756-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch index 9f3ee548ee..60038293a0 100644 --- a/patches/server/0758-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch +++ b/patches/server/0756-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Expose isFuel and canSmelt methods to FurnaceInventory diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryFurnace.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryFurnace.java -index 05c29a788c96282fc18066ae253cf0b5be37e95c..e8e53d3c7d8b1bba7d77dc0c76d242eb177ad851 100644 +index 05c29a788c96282fc18066ae253cf0b5be37e95c..fc860927e6b22784380be411b0816cebe3e1969d 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryFurnace.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryFurnace.java @@ -40,6 +40,20 @@ public class CraftInventoryFurnace extends CraftInventory implements FurnaceInve @@ -15,14 +15,14 @@ index 05c29a788c96282fc18066ae253cf0b5be37e95c..e8e53d3c7d8b1bba7d77dc0c76d242eb + // Paper start + @Override + public boolean isFuel(ItemStack stack) { -+ return stack != null && !stack.getType().isEmpty() && AbstractFurnaceBlockEntity.isFuel(CraftItemStack.asNMSCopy(stack)); ++ return stack != null && stack.getType() != org.bukkit.inventory.ItemType.AIR && AbstractFurnaceBlockEntity.isFuel(CraftItemStack.asNMSCopy(stack)); + } + + @Override + public boolean canSmelt(ItemStack stack) { + // data packs are always loaded in the main world + net.minecraft.server.level.ServerLevel world = ((org.bukkit.craftbukkit.CraftWorld) org.bukkit.Bukkit.getWorlds().get(0)).getHandle(); -+ return stack != null && !stack.getType().isEmpty() && world.getRecipeManager().getRecipeFor(((AbstractFurnaceBlockEntity) this.inventory).recipeType, new net.minecraft.world.SimpleContainer(CraftItemStack.asNMSCopy(stack)), world).isPresent(); ++ return stack != null && stack.getType() != org.bukkit.inventory.ItemType.AIR && world.getRecipeManager().getRecipeFor(((AbstractFurnaceBlockEntity) this.inventory).recipeType, new net.minecraft.world.SimpleContainer(CraftItemStack.asNMSCopy(stack)), world).isPresent(); + } + // Paper end + diff --git a/patches/server/0759-Fix-bees-aging-inside-hives.patch b/patches/server/0757-Fix-bees-aging-inside-hives.patch index 2be01a557c..2be01a557c 100644 --- a/patches/server/0759-Fix-bees-aging-inside-hives.patch +++ b/patches/server/0757-Fix-bees-aging-inside-hives.patch diff --git a/patches/server/0760-Bucketable-API.patch b/patches/server/0758-Bucketable-API.patch index 3dd4d8263f..4345ec75a6 100644 --- a/patches/server/0760-Bucketable-API.patch +++ b/patches/server/0758-Bucketable-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Bucketable API diff --git a/src/main/java/io/papermc/paper/entity/PaperBucketable.java b/src/main/java/io/papermc/paper/entity/PaperBucketable.java new file mode 100644 -index 0000000000000000000000000000000000000000..c4eee682f5b8cd82f71f92f0549f39b76e735cd8 +index 0000000000000000000000000000000000000000..d3fc2e5db9f3c20120b403bf03c3c340b9956cbd --- /dev/null +++ b/src/main/java/io/papermc/paper/entity/PaperBucketable.java @@ -0,0 +1,31 @@ @@ -38,16 +38,16 @@ index 0000000000000000000000000000000000000000..c4eee682f5b8cd82f71f92f0549f39b7 + + @Override + default Sound getPickupSound() { -+ return CraftSound.getBukkit(this.getHandle().getPickupSound()); ++ return CraftSound.minecraftToBukkit(this.getHandle().getPickupSound()); + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAxolotl.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAxolotl.java -index 2947298fe69aa8330d4fe399bf2441c367e8bd80..a82acbbe62bf6aa497e627587e2f3b9be2fbf487 100644 +index e730292edca4624400bdb89d555922c5f61db7a5..cbfca242f820d238b112f8ce64e9de8398c48a1c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAxolotl.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAxolotl.java -@@ -5,7 +5,7 @@ import org.bukkit.craftbukkit.CraftServer; +@@ -4,7 +4,7 @@ import com.google.common.base.Preconditions; + import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Axolotl; - import org.bukkit.entity.EntityType; -public class CraftAxolotl extends CraftAnimals implements Axolotl { +public class CraftAxolotl extends CraftAnimals implements Axolotl, io.papermc.paper.entity.PaperBucketable { // Paper - Bucketable API diff --git a/patches/server/0761-Validate-usernames.patch b/patches/server/0759-Validate-usernames.patch index 762960d87e..762960d87e 100644 --- a/patches/server/0761-Validate-usernames.patch +++ b/patches/server/0759-Validate-usernames.patch diff --git a/patches/server/0762-Make-water-animal-spawn-height-configurable.patch b/patches/server/0760-Make-water-animal-spawn-height-configurable.patch index 9e90672eb5..9e90672eb5 100644 --- a/patches/server/0762-Make-water-animal-spawn-height-configurable.patch +++ b/patches/server/0760-Make-water-animal-spawn-height-configurable.patch diff --git a/patches/server/0763-Expose-vanilla-BiomeProvider-from-WorldInfo.patch b/patches/server/0761-Expose-vanilla-BiomeProvider-from-WorldInfo.patch index e35c0bb71b..ccd3b36cc8 100644 --- a/patches/server/0763-Expose-vanilla-BiomeProvider-from-WorldInfo.patch +++ b/patches/server/0761-Expose-vanilla-BiomeProvider-from-WorldInfo.patch @@ -18,10 +18,10 @@ index ebd092a3f3c745b3a2f69fd72c04be7a2ab214a2..91a66fb66e9df5d5878315afa9d357a3 biomeProvider = gen.getDefaultBiomeProvider(worldInfo); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index f23c83b281e8fa7310bd8d10f6972f68743e2ab4..012d9b8d053dea682cf1d857b5ce5d3585f331e8 100644 +index 7030323032e38ec8f9d4f4b64dab6f51963df4b3..afc17cb99b30e4c84a46da4d5f3689ec8f0e40a0 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1237,7 +1237,7 @@ public final class CraftServer implements Server { +@@ -1248,7 +1248,7 @@ public final class CraftServer implements Server { List<CustomSpawner> list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(worlddata)); LevelStem worlddimension = iregistry.get(actualDimension); @@ -31,10 +31,10 @@ index f23c83b281e8fa7310bd8d10f6972f68743e2ab4..012d9b8d053dea682cf1d857b5ce5d35 biomeProvider = generator.getDefaultBiomeProvider(worldInfo); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index dbdae5af24f762c7c2678754eb688c0de9ca5215..05c085f6c2c304879f6c5a823755bfe6aee1a9b9 100644 +index 7290b4a74689db1ccdfccd9559d8fa39cfd775b0..f3c54a10424950c862901be088f172cd91b56acb 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -202,6 +202,30 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -203,6 +203,29 @@ public class CraftWorld extends CraftRegionAccessor implements World { public int getPlayerCount() { return world.players().size(); } @@ -45,15 +45,14 @@ index dbdae5af24f762c7c2678754eb688c0de9ca5215..05c085f6c2c304879f6c5a823755bfe6 + + final net.minecraft.world.level.biome.BiomeSource biomeSource = serverCache.getGenerator().getBiomeSource(); + final net.minecraft.world.level.biome.Climate.Sampler sampler = serverCache.randomState().sampler(); -+ final net.minecraft.core.Registry<net.minecraft.world.level.biome.Biome> biomeRegistry = this.getHandle().registryAccess().registryOrThrow(net.minecraft.core.registries.Registries.BIOME); + + final List<Biome> possibleBiomes = biomeSource.possibleBiomes().stream() -+ .map(biome -> CraftBlock.biomeBaseToBiome(biomeRegistry, biome)) ++ .map(org.bukkit.craftbukkit.block.CraftBiome::minecraftToBukkit) + .toList(); + return new BiomeProvider() { + @Override + public Biome getBiome(final org.bukkit.generator.WorldInfo worldInfo, final int x, final int y, final int z) { -+ return CraftBlock.biomeBaseToBiome(biomeRegistry, biomeSource.getNoiseBiome(x >> 2, y >> 2, z >> 2, sampler)); ++ return org.bukkit.craftbukkit.block.CraftBiome.minecraftToBukkit(biomeSource.getNoiseBiome(x >> 2, y >> 2, z >> 2, sampler)); + } + + @Override @@ -66,7 +65,7 @@ index dbdae5af24f762c7c2678754eb688c0de9ca5215..05c085f6c2c304879f6c5a823755bfe6 private static final Random rand = new Random(); diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CraftWorldInfo.java b/src/main/java/org/bukkit/craftbukkit/generator/CraftWorldInfo.java -index 5d655d6cd3e23e0287069f8bdf77601487e862fd..5dbd1a6d314ebbb072cb61360ca5c1043f47a38d 100644 +index 5d655d6cd3e23e0287069f8bdf77601487e862fd..1534f154d87d4cb7090285e0ad2546d62ea4cd8e 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CraftWorldInfo.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftWorldInfo.java @@ -17,8 +17,14 @@ public class CraftWorldInfo implements WorldInfo { @@ -101,7 +100,7 @@ index 5d655d6cd3e23e0287069f8bdf77601487e862fd..5dbd1a6d314ebbb072cb61360ca5c104 @Override public String getName() { return this.name; -@@ -65,4 +62,35 @@ public class CraftWorldInfo implements WorldInfo { +@@ -65,4 +62,33 @@ public class CraftWorldInfo implements WorldInfo { public int getMaxHeight() { return this.maxHeight; } @@ -118,15 +117,13 @@ index 5d655d6cd3e23e0287069f8bdf77601487e862fd..5dbd1a6d314ebbb072cb61360ca5c104 + registryAccess.lookupOrThrow(net.minecraft.core.registries.Registries.NOISE), getSeed()); + } + -+ final net.minecraft.core.Registry<net.minecraft.world.level.biome.Biome> biomeRegistry = CraftWorldInfo.this.registryAccess.registryOrThrow(net.minecraft.core.registries.Registries.BIOME); + final java.util.List<org.bukkit.block.Biome> possibleBiomes = CraftWorldInfo.this.vanillaChunkGenerator.getBiomeSource().possibleBiomes().stream() -+ .map(biome -> org.bukkit.craftbukkit.block.CraftBlock.biomeBaseToBiome(biomeRegistry, biome)) ++ .map(org.bukkit.craftbukkit.block.CraftBiome::minecraftToBukkit) + .toList(); + return new org.bukkit.generator.BiomeProvider() { + @Override + public org.bukkit.block.Biome getBiome(final WorldInfo worldInfo, final int x, final int y, final int z) { -+ return org.bukkit.craftbukkit.block.CraftBlock.biomeBaseToBiome(biomeRegistry, -+ CraftWorldInfo.this.vanillaChunkGenerator.getBiomeSource().getNoiseBiome(x >> 2, y >> 2, z >> 2, randomState.sampler())); ++ return org.bukkit.craftbukkit.block.CraftBiome.minecraftToBukkit(CraftWorldInfo.this.vanillaChunkGenerator.getBiomeSource().getNoiseBiome(x >> 2, y >> 2, z >> 2, randomState.sampler())); + } + + @Override diff --git a/patches/server/0764-Add-config-option-for-worlds-affected-by-time-cmd.patch b/patches/server/0762-Add-config-option-for-worlds-affected-by-time-cmd.patch index 156eacada9..156eacada9 100644 --- a/patches/server/0764-Add-config-option-for-worlds-affected-by-time-cmd.patch +++ b/patches/server/0762-Add-config-option-for-worlds-affected-by-time-cmd.patch diff --git a/patches/server/0765-Add-new-overload-to-PersistentDataContainer-has.patch b/patches/server/0763-Add-new-overload-to-PersistentDataContainer-has.patch index 7bec9a60ef..7bec9a60ef 100644 --- a/patches/server/0765-Add-new-overload-to-PersistentDataContainer-has.patch +++ b/patches/server/0763-Add-new-overload-to-PersistentDataContainer-has.patch diff --git a/patches/server/0766-Multiple-Entries-with-Scoreboards.patch b/patches/server/0764-Multiple-Entries-with-Scoreboards.patch index 66769fb534..66769fb534 100644 --- a/patches/server/0766-Multiple-Entries-with-Scoreboards.patch +++ b/patches/server/0764-Multiple-Entries-with-Scoreboards.patch diff --git a/patches/server/0767-Reset-placed-block-on-exception.patch b/patches/server/0765-Reset-placed-block-on-exception.patch index 308089d693..308089d693 100644 --- a/patches/server/0767-Reset-placed-block-on-exception.patch +++ b/patches/server/0765-Reset-placed-block-on-exception.patch diff --git a/patches/server/0768-Add-configurable-height-for-slime-spawn.patch b/patches/server/0766-Add-configurable-height-for-slime-spawn.patch index 65b8d6d80d..65b8d6d80d 100644 --- a/patches/server/0768-Add-configurable-height-for-slime-spawn.patch +++ b/patches/server/0766-Add-configurable-height-for-slime-spawn.patch diff --git a/patches/server/0769-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch b/patches/server/0767-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch index f2c95ba6c0..f2c95ba6c0 100644 --- a/patches/server/0769-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch +++ b/patches/server/0767-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch diff --git a/patches/server/0770-Fix-xp-reward-for-baby-zombies.patch b/patches/server/0768-Fix-xp-reward-for-baby-zombies.patch index 399ad48f22..399ad48f22 100644 --- a/patches/server/0770-Fix-xp-reward-for-baby-zombies.patch +++ b/patches/server/0768-Fix-xp-reward-for-baby-zombies.patch diff --git a/patches/server/0771-Kick-on-main-for-illegal-chat.patch b/patches/server/0769-Kick-on-main-for-illegal-chat.patch index 345e23b0be..8b321a120d 100644 --- a/patches/server/0771-Kick-on-main-for-illegal-chat.patch +++ b/patches/server/0769-Kick-on-main-for-illegal-chat.patch @@ -7,7 +7,7 @@ Makes the PlayerKickEvent fire on the main thread for illegal characters or chat out-of-order errors. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 0203c778e2cfd421d4e9516a00535a5f20e61679..446ef101ca506ec9fdce6cede70a1e51d97d7dfc 100644 +index 4bf8e2e371c78aeb175f068faeefc873b77d6379..161e8a8c7517c87784bd7f543d18d4ac0a323c8f 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2165,7 +2165,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic diff --git a/patches/server/0772-Multi-Block-Change-API-Implementation.patch b/patches/server/0770-Multi-Block-Change-API-Implementation.patch index 3e28241505..42ed429313 100644 --- a/patches/server/0772-Multi-Block-Change-API-Implementation.patch +++ b/patches/server/0770-Multi-Block-Change-API-Implementation.patch @@ -24,10 +24,10 @@ index f96d61bdeb556665d6e6e5023f9d77fd82204e89..e3f355c85eb7cc8c1683e3009502c10a public void write(FriendlyByteBuf buf) { buf.writeLong(this.sectionPos.asLong()); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 8406901601abbfda9d39482bed0a17f1ebc701b1..3120f72d2ba93625931da83c1e37678c07bd69cd 100644 +index f501f68cb6762f91e1c2b429d333bfa50fa89023..620a46712a61dfcac5f87656fbea65d0388f8c54 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -882,6 +882,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -874,6 +874,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().connection.send(packet); } diff --git a/patches/server/0773-Fix-NotePlayEvent.patch b/patches/server/0771-Fix-NotePlayEvent.patch index 5104743fbe..5104743fbe 100644 --- a/patches/server/0773-Fix-NotePlayEvent.patch +++ b/patches/server/0771-Fix-NotePlayEvent.patch diff --git a/patches/server/0774-Freeze-Tick-Lock-API.patch b/patches/server/0772-Freeze-Tick-Lock-API.patch index 0951dac980..0e34357774 100644 --- a/patches/server/0774-Freeze-Tick-Lock-API.patch +++ b/patches/server/0772-Freeze-Tick-Lock-API.patch @@ -59,10 +59,10 @@ index 5287ff8b30a6d27ca05241695a6c99e868a5aa36..351c60a6f1dfc00aa1a300ed929e81df if (this.isInPowderSnow && this.canFreeze()) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index fbc18be64e71be2215059c34afd8129138dc4dff..cc72d960d9a5f9481ec2214b1549a344907a68da 100644 +index f78bfef00dc08f1b906121fda9090d705f3c1b7a..12c917c1324451b03f671e4e5f8fda7dcbea4207 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -663,6 +663,17 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -669,6 +669,17 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return this.getHandle().isFullyFrozen(); } diff --git a/patches/server/0775-Dolphin-API.patch b/patches/server/0773-Dolphin-API.patch index 9fd01d6fb1..3f180ca7d9 100644 --- a/patches/server/0775-Dolphin-API.patch +++ b/patches/server/0773-Dolphin-API.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Dolphin API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftDolphin.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftDolphin.java -index 938e141f161acf5de5d3361382b514caea02c6fb..18623159932df2dd5e43133b4396b43731693780 100644 +index af432f9a1d255a56c31c3b97aeb4457d17f37e3e..378b7e942567babc025669ded5d0970026c93a35 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftDolphin.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftDolphin.java -@@ -24,4 +24,34 @@ public class CraftDolphin extends CraftWaterMob implements Dolphin { - public EntityType getType() { - return EntityType.DOLPHIN; +@@ -18,4 +18,34 @@ public class CraftDolphin extends CraftWaterMob implements Dolphin { + public String toString() { + return "CraftDolphin"; } + + @Override diff --git a/patches/server/0776-More-PotionEffectType-API.patch b/patches/server/0774-More-PotionEffectType-API.patch index 15d2f7a5ec..b871df1794 100644 --- a/patches/server/0776-More-PotionEffectType-API.patch +++ b/patches/server/0774-More-PotionEffectType-API.patch @@ -5,19 +5,15 @@ Subject: [PATCH] More PotionEffectType API diff --git a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java -index 5a8c29cc117ce9478cc205f6fdbe63d227268775..3bda325cfd5d0d8dcc878cf547c9ae9e82fde240 100644 +index 0b30bf1bf2f9d79076418f664260602efab4398c..916f3bc20c288b351db3b2b58f02fc70d70964ae 100644 --- a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java +++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java -@@ -105,4 +105,46 @@ public class CraftPotionEffectType extends PotionEffectType { - public Color getColor() { - return Color.fromRGB(this.handle.getColor()); +@@ -106,4 +106,42 @@ public class CraftPotionEffectType extends PotionEffectType { + public String toString() { + return "CraftPotionEffectType[" + this.getKey() + "]"; } -+ // Paper start -+ @Override -+ public org.bukkit.NamespacedKey getKey() { -+ return org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(net.minecraft.core.registries.BuiltInRegistries.MOB_EFFECT.getKey(this.handle)); -+ } + ++ // Paper start + @Override + public java.util.Map<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> getEffectAttributes() { + // re-create map each time because a nms MobEffect can have its attributes modified @@ -31,7 +27,7 @@ index 5a8c29cc117ce9478cc205f6fdbe63d227268775..3bda325cfd5d0d8dcc878cf547c9ae9e + @Override + public double getAttributeModifierAmount(org.bukkit.attribute.Attribute attribute, int effectAmplifier) { + com.google.common.base.Preconditions.checkArgument(effectAmplifier >= 0, "effectAmplifier must be greater than or equal to 0"); -+ net.minecraft.world.entity.ai.attributes.Attribute nmsAttribute = org.bukkit.craftbukkit.attribute.CraftAttributeMap.toMinecraft(attribute); ++ net.minecraft.world.entity.ai.attributes.Attribute nmsAttribute = org.bukkit.craftbukkit.attribute.CraftAttribute.bukkitToMinecraft(attribute); + com.google.common.base.Preconditions.checkArgument(this.handle.getAttributeModifiers().containsKey(nmsAttribute), attribute + " is not present on " + this.getKey()); + return this.handle.getAttributeModifierValue(effectAmplifier, this.handle.getAttributeModifiers().get(nmsAttribute)); + } diff --git a/patches/server/0777-Use-a-CHM-for-StructureTemplate.Pallete-cache.patch b/patches/server/0775-Use-a-CHM-for-StructureTemplate.Pallete-cache.patch index 839a5f95d4..839a5f95d4 100644 --- a/patches/server/0777-Use-a-CHM-for-StructureTemplate.Pallete-cache.patch +++ b/patches/server/0775-Use-a-CHM-for-StructureTemplate.Pallete-cache.patch diff --git a/patches/server/0778-API-for-creating-command-sender-which-forwards-feedb.patch b/patches/server/0776-API-for-creating-command-sender-which-forwards-feedb.patch index 379e607e9d..dc8bda1d23 100644 --- a/patches/server/0778-API-for-creating-command-sender-which-forwards-feedb.patch +++ b/patches/server/0776-API-for-creating-command-sender-which-forwards-feedb.patch @@ -122,10 +122,10 @@ index 0000000000000000000000000000000000000000..e3a5f1ec376319bdfda87fa27ae217bf + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 012d9b8d053dea682cf1d857b5ce5d3585f331e8..74b7824d104ad568e76dd3352bc509997b5c91fd 100644 +index afc17cb99b30e4c84a46da4d5f3689ec8f0e40a0..ee28eb9eabc7f8ca0344dc4533b8cf60c602b0a6 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2017,6 +2017,13 @@ public final class CraftServer implements Server { +@@ -2028,6 +2028,13 @@ public final class CraftServer implements Server { return console.console; } diff --git a/patches/server/0779-Add-missing-structure-set-seed-configs.patch b/patches/server/0777-Add-missing-structure-set-seed-configs.patch index f299fd82ac..f5c68accb8 100644 --- a/patches/server/0779-Add-missing-structure-set-seed-configs.patch +++ b/patches/server/0777-Add-missing-structure-set-seed-configs.patch @@ -20,7 +20,7 @@ seeds/salts to the frequency reducer which has a similar effect. Co-authored-by: William Blake Galbreath <[email protected]> diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java -index eee2239cd715d01c5adbf1cd79282e115f42cd2e..8bab3fcfc6aa6c0b37621474a69f15e94bda2113 100644 +index 6a6001c42cba124fd4439159008e6ca86b1aa21f..579fc116df887a0a905ddf30057797e2d2562fba 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java @@ -568,7 +568,7 @@ public abstract class ChunkGenerator { diff --git a/patches/server/0780-Implement-regenerateChunk.patch b/patches/server/0778-Implement-regenerateChunk.patch index 2101ebbee1..0ac5afe6ba 100644 --- a/patches/server/0780-Implement-regenerateChunk.patch +++ b/patches/server/0778-Implement-regenerateChunk.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Implement regenerateChunk Co-authored-by: Jason Penilla <[email protected]> diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 05c085f6c2c304879f6c5a823755bfe6aee1a9b9..e49c907f668b17cb85505b9199af3b90f2c5af74 100644 +index f3c54a10424950c862901be088f172cd91b56acb..9c338a26bf3f6b7b82ead2bc425505a71fdd816f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -141,6 +141,7 @@ import org.jetbrains.annotations.NotNull; +@@ -142,6 +142,7 @@ import org.jetbrains.annotations.Nullable; public class CraftWorld extends CraftRegionAccessor implements World { public static final int CUSTOM_DIMENSION_OFFSET = 10; private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); diff --git a/patches/server/0781-Fix-cancelled-powdered-snow-bucket-placement.patch b/patches/server/0779-Fix-cancelled-powdered-snow-bucket-placement.patch index cd73c1c14d..7e8db55923 100644 --- a/patches/server/0781-Fix-cancelled-powdered-snow-bucket-placement.patch +++ b/patches/server/0779-Fix-cancelled-powdered-snow-bucket-placement.patch @@ -20,7 +20,7 @@ index e581dc10f3c805f7f8b6e4c842092609e7e1a0f8..b0204af850ee182773ad458208cccd94 } return InteractionResult.FAIL; diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 9e7357c65c36da9cad2f4492dacfc60af2a1af70..6b9924652ef3cb3b26042155b05df3458b2a25ab 100644 +index 487f16f64ac3d4c22538032029925ed156cf119c..9047d65b60203062dac6eeac3b90ef3417074c09 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java @@ -352,7 +352,7 @@ public final class ItemStack { diff --git a/patches/server/0782-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch b/patches/server/0780-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch index e39fc3e9bd..37c0f97df6 100644 --- a/patches/server/0782-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch +++ b/patches/server/0780-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add missing Validate calls to CraftServer#getSpawnLimit Copies appropriate checks from CraftWorld#getSpawnLimit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 74b7824d104ad568e76dd3352bc509997b5c91fd..f2f81ee6e938ef3d148f16729c0daf2fde8e1b26 100644 +index ee28eb9eabc7f8ca0344dc4533b8cf60c602b0a6..eefd83fcf9aa0eaf4f06281259b36bfa257bec3f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2194,6 +2194,8 @@ public final class CraftServer implements Server { +@@ -2205,6 +2205,8 @@ public final class CraftServer implements Server { @Override public int getSpawnLimit(SpawnCategory spawnCategory) { // Paper start diff --git a/patches/server/0783-Add-GameEvent-tags.patch b/patches/server/0781-Add-GameEvent-tags.patch index b33e7a1eba..4ced9508f1 100644 --- a/patches/server/0783-Add-GameEvent-tags.patch +++ b/patches/server/0781-Add-GameEvent-tags.patch @@ -46,11 +46,11 @@ index 0000000000000000000000000000000000000000..e7d9fd2702a1ce96596580fff8f5ee4f + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index f2f81ee6e938ef3d148f16729c0daf2fde8e1b26..68a929979e61f418f5833ba7886c86d959d3a89f 100644 +index eefd83fcf9aa0eaf4f06281259b36bfa257bec3f..41d68eecfb564907f8fe50fab4300f8155cccce0 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2615,6 +2615,15 @@ public final class CraftServer implements Server { - return (org.bukkit.Tag<T>) new CraftEntityTag(BuiltInRegistries.ENTITY_TYPE, entityTagKey); +@@ -2627,6 +2627,15 @@ public final class CraftServer implements Server { + return (org.bukkit.Tag<T>) new CraftEntityTag(this.getServer().registryAccess().registryOrThrow(Registries.ENTITY_TYPE), entityTagKey); } } + // Paper start @@ -65,8 +65,8 @@ index f2f81ee6e938ef3d148f16729c0daf2fde8e1b26..68a929979e61f418f5833ba7886c86d9 default -> throw new IllegalArgumentException(); } -@@ -2647,6 +2656,13 @@ public final class CraftServer implements Server { - net.minecraft.core.Registry<EntityType<?>> entityTags = BuiltInRegistries.ENTITY_TYPE; +@@ -2661,6 +2670,13 @@ public final class CraftServer implements Server { + net.minecraft.core.Registry<EntityType<?>> entityTags = this.getServer().registryAccess().registryOrThrow(Registries.ENTITY_TYPE); return entityTags.getTags().map(pair -> (org.bukkit.Tag<T>) new CraftEntityTag(entityTags, pair.getFirst())).collect(ImmutableList.toImmutableList()); } + // Paper start @@ -79,3 +79,23 @@ index f2f81ee6e938ef3d148f16729c0daf2fde8e1b26..68a929979e61f418f5833ba7886c86d9 default -> throw new IllegalArgumentException(); } } +diff --git a/src/test/java/org/bukkit/support/DummyServer.java b/src/test/java/org/bukkit/support/DummyServer.java +index e337f482fb4dd554069684ac2f1f759593fea233..c5dbf7faa35663a7adf6a76a109c31e1f84330c6 100644 +--- a/src/test/java/org/bukkit/support/DummyServer.java ++++ b/src/test/java/org/bukkit/support/DummyServer.java +@@ -112,6 +112,15 @@ public final class DummyServer { + return new CraftEntityTag(BuiltInRegistries.ENTITY_TYPE, entityTagKey); + } + } ++ // Paper start ++ case org.bukkit.Tag.REGISTRY_GAME_EVENTS -> { ++ Preconditions.checkArgument(clazz == org.bukkit.GameEvent.class, "Game Event namespace must have GameEvent type"); ++ TagKey<net.minecraft.world.level.gameevent.GameEvent> gameEventTagKey = TagKey.create(net.minecraft.core.registries.Registries.GAME_EVENT, key); ++ if (net.minecraft.core.registries.BuiltInRegistries.GAME_EVENT.getTag(gameEventTagKey).isPresent()) { ++ return new io.papermc.paper.CraftGameEventTag(net.minecraft.core.registries.BuiltInRegistries.GAME_EVENT, gameEventTagKey); ++ } ++ } ++ // Paper end + default -> throw new IllegalArgumentException(); + } + diff --git a/patches/server/0784-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch b/patches/server/0782-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch index 45ac694a2b..45ac694a2b 100644 --- a/patches/server/0784-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch +++ b/patches/server/0782-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch diff --git a/patches/server/0785-Furnace-RecipesUsed-API.patch b/patches/server/0783-Furnace-RecipesUsed-API.patch index 2e6cf1c2fe..2e6cf1c2fe 100644 --- a/patches/server/0785-Furnace-RecipesUsed-API.patch +++ b/patches/server/0783-Furnace-RecipesUsed-API.patch diff --git a/patches/server/0786-Configurable-sculk-sensor-listener-range.patch b/patches/server/0784-Configurable-sculk-sensor-listener-range.patch index c68e2d2cc3..c68e2d2cc3 100644 --- a/patches/server/0786-Configurable-sculk-sensor-listener-range.patch +++ b/patches/server/0784-Configurable-sculk-sensor-listener-range.patch diff --git a/patches/server/0787-Add-missing-block-data-mins-and-maxes.patch b/patches/server/0785-Add-missing-block-data-mins-and-maxes.patch index 2096473939..2096473939 100644 --- a/patches/server/0787-Add-missing-block-data-mins-and-maxes.patch +++ b/patches/server/0785-Add-missing-block-data-mins-and-maxes.patch diff --git a/patches/server/0788-Option-to-have-default-CustomSpawners-in-custom-worl.patch b/patches/server/0786-Option-to-have-default-CustomSpawners-in-custom-worl.patch index 964a6c913e..964a6c913e 100644 --- a/patches/server/0788-Option-to-have-default-CustomSpawners-in-custom-worl.patch +++ b/patches/server/0786-Option-to-have-default-CustomSpawners-in-custom-worl.patch diff --git a/patches/server/0789-Put-world-into-worldlist-before-initing-the-world.patch b/patches/server/0787-Put-world-into-worldlist-before-initing-the-world.patch index 5dd414a8a8..3aa0578d91 100644 --- a/patches/server/0789-Put-world-into-worldlist-before-initing-the-world.patch +++ b/patches/server/0787-Put-world-into-worldlist-before-initing-the-world.patch @@ -23,10 +23,10 @@ index a9240274b903f23a5d0b2414b3bc7a984845b6cd..9b720d3407802eac986c2044892d5b70 if (worlddata.getCustomBossEvents() != null) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 68a929979e61f418f5833ba7886c86d959d3a89f..bee2e61da10e97433c0a77496de421db85200055 100644 +index 41d68eecfb564907f8fe50fab4300f8155cccce0..3d3bff31befbfd5b730e47485a5d814a1065549b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1266,10 +1266,11 @@ public final class CraftServer implements Server { +@@ -1277,10 +1277,11 @@ public final class CraftServer implements Server { return null; } diff --git a/patches/server/0790-Fix-Entity-Position-Desync.patch b/patches/server/0788-Fix-Entity-Position-Desync.patch index 3ccd5470c9..3ccd5470c9 100644 --- a/patches/server/0790-Fix-Entity-Position-Desync.patch +++ b/patches/server/0788-Fix-Entity-Position-Desync.patch diff --git a/patches/server/0791-Custom-Potion-Mixes.patch b/patches/server/0789-Custom-Potion-Mixes.patch index be42b2c77e..412cb01f25 100644 --- a/patches/server/0791-Custom-Potion-Mixes.patch +++ b/patches/server/0789-Custom-Potion-Mixes.patch @@ -164,7 +164,7 @@ index 424406d2692856cfd82b6f3b7b6228fa3bd20c2f..c57efcb9a79337ec791e4e8f6671612f @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index bee2e61da10e97433c0a77496de421db85200055..7e7539b7f50007f10d7926bb13beea2538403b1f 100644 +index 3d3bff31befbfd5b730e47485a5d814a1065549b..e9d3a817071774cf60b8fd04227382569d8cd3f8 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -300,6 +300,7 @@ public final class CraftServer implements Server { @@ -175,16 +175,15 @@ index bee2e61da10e97433c0a77496de421db85200055..7e7539b7f50007f10d7926bb13beea25 static { ConfigurationSerialization.registerClass(CraftOfflinePlayer.class); -@@ -327,7 +328,7 @@ public final class CraftServer implements Server { - Enchantments.SHARPNESS.getClass(); - org.bukkit.enchantments.Enchantment.stopAcceptingRegistrations(); - -- Potion.setPotionBrewer(new CraftPotionBrewer()); -+ Potion.setPotionBrewer(potionBrewer); // Paper - MobEffects.BLINDNESS.getClass(); - PotionEffectType.stopAcceptingRegistrations(); +@@ -324,6 +325,7 @@ public final class CraftServer implements Server { + Bukkit.setServer(this); + + Potion.setPotionBrewer(new CraftPotionBrewer()); ++ Potion.setPotionBrewer(this.potionBrewer); // Paper // Ugly hack :( -@@ -2974,5 +2975,10 @@ public final class CraftServer implements Server { + + if (!Main.useConsole) { +@@ -2988,5 +2990,10 @@ public final class CraftServer implements Server { return datapackManager; } @@ -196,7 +195,7 @@ index bee2e61da10e97433c0a77496de421db85200055..7e7539b7f50007f10d7926bb13beea25 // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java -index 28fac26aa8e4da52f3e5d8e5e0d2e2731bcf74e1..13d25d118eb4d3ef35a4cdfb9bbde9ed83f6c04b 100644 +index 5aacc0d1f74075b089b794a899e2260d90fe4f85..e6b767a6637da3caca27dc1382f5d837c88fb6d1 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java @@ -16,6 +16,11 @@ public interface CraftRecipe extends Recipe { diff --git a/patches/server/0792-Force-close-world-loading-screen.patch b/patches/server/0790-Force-close-world-loading-screen.patch index d4a01751c2..d4a01751c2 100644 --- a/patches/server/0792-Force-close-world-loading-screen.patch +++ b/patches/server/0790-Force-close-world-loading-screen.patch diff --git a/patches/server/0793-Fix-falling-block-spawn-methods.patch b/patches/server/0791-Fix-falling-block-spawn-methods.patch index daa0d01521..80a3cb9be6 100644 --- a/patches/server/0793-Fix-falling-block-spawn-methods.patch +++ b/patches/server/0791-Fix-falling-block-spawn-methods.patch @@ -11,10 +11,10 @@ Restores the API behavior from previous versions of the server public net.minecraft.world.entity.item.FallingBlockEntity <init>(Lnet/minecraft/world/level/Level;DDDLnet/minecraft/world/level/block/state/BlockState;)V diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -index 7318209de454b233e22c20b176cb207de7f86674..414b4fd46307aa9c9d0f96bc571a68642f33afdb 100644 +index a779e70dd6d2d258c2272bd25d46fe63796f1f18..5197c90d483cc17a965272f84b852eae67af4d5e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -@@ -598,7 +598,7 @@ public abstract class CraftRegionAccessor implements RegionAccessor { +@@ -600,7 +600,7 @@ public abstract class CraftRegionAccessor implements RegionAccessor { // Paper end } else if (FallingBlock.class.isAssignableFrom(clazz)) { BlockPos pos = BlockPos.containing(x, y, z); @@ -24,16 +24,16 @@ index 7318209de454b233e22c20b176cb207de7f86674..414b4fd46307aa9c9d0f96bc571a6864 if (Snowball.class.isAssignableFrom(clazz)) { entity = new net.minecraft.world.entity.projectile.Snowball(world, x, y, z); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index e49c907f668b17cb85505b9199af3b90f2c5af74..1e26fea83065c7e76b196e6599892c11d4370617 100644 +index 9c338a26bf3f6b7b82ead2bc425505a71fdd816f..7f56dcf98a614bec109bddd98458e1f61d0d71f7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1397,7 +1397,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { - Preconditions.checkArgument(material != null, "Material cannot be null"); - Preconditions.checkArgument(material.isBlock(), "Material.%s must be a block", material); +@@ -1390,7 +1390,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { + Preconditions.checkArgument(data != null, "MaterialData cannot be null"); + Preconditions.checkArgument(location != null, "Location cannot be null"); -- FallingBlockEntity entity = FallingBlockEntity.fall(world, BlockPos.containing(location.getX(), location.getY(), location.getZ()), CraftMagicNumbers.getBlock(material).defaultBlockState(), SpawnReason.CUSTOM); +- FallingBlockEntity entity = FallingBlockEntity.fall(world, BlockPos.containing(location.getX(), location.getY(), location.getZ()), ((CraftBlockType<?>) data.getItemType().asBlockType()).getHandle().defaultBlockState(), SpawnReason.CUSTOM); + // Paper start - restore API behavior for spawning falling blocks -+ FallingBlockEntity entity = new FallingBlockEntity(this.world, location.getX(), location.getY(), location.getZ(), CraftMagicNumbers.getBlock(material).defaultBlockState()); // Paper ++ FallingBlockEntity entity = new FallingBlockEntity(this.world, location.getX(), location.getY(), location.getZ(), ((CraftBlockType<?>) data.getItemType().asBlockType()).getHandle().defaultBlockState()); // Paper + entity.time = 1; + + this.world.addFreshEntity(entity, SpawnReason.CUSTOM); @@ -41,7 +41,7 @@ index e49c907f668b17cb85505b9199af3b90f2c5af74..1e26fea83065c7e76b196e6599892c11 return (FallingBlock) entity.getBukkitEntity(); } -@@ -1406,7 +1411,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1399,7 +1404,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { Preconditions.checkArgument(location != null, "Location cannot be null"); Preconditions.checkArgument(data != null, "BlockData cannot be null"); diff --git a/patches/server/0794-Expose-furnace-minecart-push-values.patch b/patches/server/0792-Expose-furnace-minecart-push-values.patch index 4086d94249..572d7c5f66 100644 --- a/patches/server/0794-Expose-furnace-minecart-push-values.patch +++ b/patches/server/0792-Expose-furnace-minecart-push-values.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Expose furnace minecart push values Adds methods for getting and setting a furnace minecart's push values diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartFurnace.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartFurnace.java -index 49ceb730b6e68b7c70799fca80dc32da4a12c545..b8378d5f3c2a08ab565dcb8cb200822b581c7dba 100644 +index 2469a8e393665c6b085b028816bd4dad4a1b5ba3..1027c915c0a2f981703908fdb2eb6beeb548f347 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartFurnace.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartFurnace.java -@@ -28,6 +28,28 @@ public class CraftMinecartFurnace extends CraftMinecart implements PoweredMineca +@@ -27,6 +27,28 @@ public class CraftMinecartFurnace extends CraftMinecart implements PoweredMineca this.getHandle().fuel = fuel; } diff --git a/patches/server/0795-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch b/patches/server/0793-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch index 2d848b1041..2d848b1041 100644 --- a/patches/server/0795-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch +++ b/patches/server/0793-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch diff --git a/patches/server/0796-More-Projectile-API.patch b/patches/server/0794-More-Projectile-API.patch index bc39b7ad22..cf262dae57 100644 --- a/patches/server/0796-More-Projectile-API.patch +++ b/patches/server/0794-More-Projectile-API.patch @@ -116,10 +116,10 @@ index 40e5b19bc8fa3de3b3d54da0762aee5bd7bb8d7b..b3814bd6c6d6aae090fe417696535ed1 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java -index d443b171191d150eed62d000a1079ede6bcf9052..10e2d251ec398245786a0b3bd41f3bc7155a49fe 100644 +index 5056ec1ad51be9209591d34d32d256c350feed63..96a20efc60efef4485eca9ebffed92dc195ed357 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java -@@ -59,20 +59,7 @@ public class CraftArrow extends AbstractProjectile implements AbstractArrow { +@@ -58,20 +58,7 @@ public class CraftArrow extends AbstractProjectile implements AbstractArrow { this.getHandle().setCritArrow(critical); } @@ -141,7 +141,7 @@ index d443b171191d150eed62d000a1079ede6bcf9052..10e2d251ec398245786a0b3bd41f3bc7 @Override public boolean isInBlock() { -@@ -106,6 +93,27 @@ public class CraftArrow extends AbstractProjectile implements AbstractArrow { +@@ -105,6 +92,27 @@ public class CraftArrow extends AbstractProjectile implements AbstractArrow { return org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(getHandle().getPickupItem()); } @@ -158,22 +158,22 @@ index d443b171191d150eed62d000a1079ede6bcf9052..10e2d251ec398245786a0b3bd41f3bc7 + @org.jetbrains.annotations.NotNull + @Override + public org.bukkit.Sound getHitSound() { -+ return org.bukkit.craftbukkit.CraftSound.getBukkit(this.getHandle().soundEvent); ++ return org.bukkit.craftbukkit.CraftSound.minecraftToBukkit(this.getHandle().soundEvent); + } + + @Override + public void setHitSound(@org.jetbrains.annotations.NotNull org.bukkit.Sound sound) { -+ this.getHandle().setSoundEvent(org.bukkit.craftbukkit.CraftSound.getSoundEffect(sound)); ++ this.getHandle().setSoundEvent(org.bukkit.craftbukkit.CraftSound.bukkitToMinecraft(sound)); + } + @Override public void setNoPhysics(boolean noPhysics) { this.getHandle().setNoPhysics(noPhysics); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java -index 44353e074fb4655e38ffffe83cbf52080e5cbbdb..1fdf52edc47591bf3d8bbcb9db9d41773aace42f 100644 +index 013de344fc9a4b21952fc6177243905982d88486..e04500dcdc5b72cca7ac81b5d12e76822db9c8c5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java -@@ -33,20 +33,7 @@ public class CraftFireball extends AbstractProjectile implements Fireball { +@@ -32,20 +32,7 @@ public class CraftFireball extends AbstractProjectile implements Fireball { this.getHandle().bukkitYield = yield; } @@ -196,15 +196,15 @@ index 44353e074fb4655e38ffffe83cbf52080e5cbbdb..1fdf52edc47591bf3d8bbcb9db9d4177 @Override public Vector getDirection() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java -index c242f654c88ca1773429348939d3bb2ffae3768c..d1c7ab67cba881d96b7a5e9220130d86d0514304 100644 +index a624a2a6cf31fbfed86930a462cbf1e2d93ca002..2fdaed196a563303bc3ce0c4cdcbc3ce8d8d0d40 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java -@@ -16,24 +16,26 @@ import org.bukkit.inventory.meta.FireworkMeta; +@@ -15,24 +15,26 @@ import org.bukkit.inventory.meta.FireworkMeta; public class CraftFirework extends CraftProjectile implements Firework { private final Random random = new Random(); - private final CraftItemStack item; -+ //private CraftItemStack item; // Paper - Remove usage, not accurate representation of current item. ++ // private CraftItemStack item; // Paper - Remove usage, not accurate representation of current item. public CraftFirework(CraftServer server, FireworkRocketEntity entity) { super(server, entity); @@ -219,33 +219,33 @@ index c242f654c88ca1773429348939d3bb2ffae3768c..d1c7ab67cba881d96b7a5e9220130d86 - this.item = CraftItemStack.asCraftMirror(item); - - // Ensure the item is a firework... -- if (this.item.getType() != Material.FIREWORK_ROCKET) { -- this.item.setType(Material.FIREWORK_ROCKET); +- if (this.item.getType() != ItemType.FIREWORK_ROCKET) { +- this.item.setType(ItemType.FIREWORK_ROCKET); - } -+// Paper Start - Expose firework item directly -+// ItemStack item = this.getHandle().getEntityData().get(FireworkRocketEntity.DATA_ID_FIREWORKS_ITEM); -+// -+// if (item.isEmpty()) { -+// item = new ItemStack(Items.FIREWORK_ROCKET); -+// this.getHandle().getEntityData().set(FireworkRocketEntity.DATA_ID_FIREWORKS_ITEM, item); -+// } -+// -+// this.item = CraftItemStack.asCraftMirror(item); -+// -+// // Ensure the item is a firework... -+// if (this.item.getType() != Material.FIREWORK_ROCKET) { -+// this.item.setType(Material.FIREWORK_ROCKET); -+// } ++ // Paper Start - Expose firework item directly ++ // ItemStack item = this.getHandle().getEntityData().get(FireworkRocketEntity.DATA_ID_FIREWORKS_ITEM); ++ // ++ // if (item.isEmpty()) { ++ // item = new ItemStack(Items.FIREWORK_ROCKET); ++ // this.getHandle().getEntityData().set(FireworkRocketEntity.DATA_ID_FIREWORKS_ITEM, item); ++ // } ++ // ++ // this.item = CraftItemStack.asCraftMirror(item); ++ // ++ // // Ensure the item is a firework... ++ // if (this.item.getType() != ItemType.FIREWORK_ROCKET) { ++ // this.item.setType(ItemType.FIREWORK_ROCKET); ++ // } + // Paper End - Expose firework item directly } @Override -@@ -53,12 +55,12 @@ public class CraftFirework extends CraftProjectile implements Firework { +@@ -47,12 +49,12 @@ public class CraftFirework extends CraftProjectile implements Firework { @Override public FireworkMeta getFireworkMeta() { - return (FireworkMeta) this.item.getItemMeta(); -+ return (FireworkMeta) CraftItemStack.getItemMeta(this.getHandle().getEntityData().get(FireworkRocketEntity.DATA_ID_FIREWORKS_ITEM), Material.FIREWORK_ROCKET); // Paper - Expose firework item directly ++ return (FireworkMeta) CraftItemStack.getItemMeta(this.getHandle().getEntityData().get(FireworkRocketEntity.DATA_ID_FIREWORKS_ITEM), ItemType.FIREWORK_ROCKET); // Paper - Expose firework item directly } @Override @@ -255,7 +255,7 @@ index c242f654c88ca1773429348939d3bb2ffae3768c..d1c7ab67cba881d96b7a5e9220130d86 // Copied from EntityFireworks constructor, update firework lifetime/power this.getHandle().lifetime = 10 * (1 + meta.getPower()) + this.random.nextInt(6) + this.random.nextInt(7); -@@ -142,4 +144,46 @@ public class CraftFirework extends CraftProjectile implements Firework { +@@ -136,4 +138,46 @@ public class CraftFirework extends CraftProjectile implements Firework { return getHandle().spawningEntity; } // Paper end @@ -303,10 +303,10 @@ index c242f654c88ca1773429348939d3bb2ffae3768c..d1c7ab67cba881d96b7a5e9220130d86 + // Paper end - Expose firework item directly + manually setting flight } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java -index d38fca354695ef940421fe7325f2ef3a7b57a6f4..ce934b945b85a4c3d0f575eb090bbf90c4b3ca9f 100644 +index b32a8d0a942d1a3c4e4b047cda4aa32d03b09875..9de72665c947bb00547cdd7c41a890711f5b2afc 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java -@@ -202,4 +202,15 @@ public class CraftFishHook extends CraftProjectile implements FishHook { +@@ -196,4 +196,15 @@ public class CraftFishHook extends CraftProjectile implements FishHook { public HookState getState() { return HookState.values()[this.getHandle().currentState.ordinal()]; } @@ -323,11 +323,11 @@ index d38fca354695ef940421fe7325f2ef3a7b57a6f4..ce934b945b85a4c3d0f575eb090bbf90 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlamaSpit.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlamaSpit.java -index dd4c67f42217b5e746c4b0cf5c44116cacb321f6..9b92efb9bb6905032cee43299d0fdb226dd0e598 100644 +index 70cbc6c668c60e9d608ca7013b72f9b916c05c2d..47633f05b4fab1dcabc2117e7645fe6d6949622a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlamaSpit.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlamaSpit.java -@@ -26,13 +26,5 @@ public class CraftLlamaSpit extends AbstractProjectile implements LlamaSpit { - return EntityType.LLAMA_SPIT; +@@ -20,13 +20,5 @@ public class CraftLlamaSpit extends AbstractProjectile implements LlamaSpit { + return "CraftLlamaSpit"; } - @Override @@ -368,10 +368,10 @@ index 9a68f4ef68870d0baab5b6464d6c0a82a8fd105d..fd5beb956f643532e08613366ebd380d @Override public net.minecraft.world.entity.projectile.Projectile getHandle() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftShulkerBullet.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftShulkerBullet.java -index 20b54f8896be1f8744a29e1d0205e58d27049f1f..43f52716c82863382cb0eb08cc0e174a19ffebdf 100644 +index 929a429428493093837c8a7a065896873d533f2d..807a498c2a80a5bd5eedf5322c699adebf25872f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftShulkerBullet.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftShulkerBullet.java -@@ -13,20 +13,7 @@ public class CraftShulkerBullet extends AbstractProjectile implements ShulkerBul +@@ -12,20 +12,7 @@ public class CraftShulkerBullet extends AbstractProjectile implements ShulkerBul super(server, entity); } @@ -393,7 +393,7 @@ index 20b54f8896be1f8744a29e1d0205e58d27049f1f..43f52716c82863382cb0eb08cc0e174a @Override public org.bukkit.entity.Entity getTarget() { -@@ -40,6 +27,40 @@ public class CraftShulkerBullet extends AbstractProjectile implements ShulkerBul +@@ -39,6 +26,40 @@ public class CraftShulkerBullet extends AbstractProjectile implements ShulkerBul this.getHandle().setTarget(target == null ? null : ((CraftEntity) target).getHandle()); } @@ -435,16 +435,16 @@ index 20b54f8896be1f8744a29e1d0205e58d27049f1f..43f52716c82863382cb0eb08cc0e174a public String toString() { return "CraftShulkerBullet"; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java -index 02ee302f93f971fbd97f7fd88f257a1a613a81ba..2b8a4ad4bca3044f1af274cdff90e6d66b6c7da7 100644 +index 196755521ad7cc68ba87e91592565b2e2c520b43..0d9c96fa877660e756bcf99baef1787b8893eb00 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java -@@ -36,11 +36,31 @@ public class CraftThrownPotion extends CraftThrowableProjectile implements Throw +@@ -35,11 +35,31 @@ public class CraftThrownPotion extends CraftThrowableProjectile implements Throw @Override public void setItem(ItemStack item) { Preconditions.checkArgument(item != null, "ItemStack cannot be null"); -- Preconditions.checkArgument(item.getType() == Material.LINGERING_POTION || item.getType() == Material.SPLASH_POTION, "ItemStack material must be Material.LINGERING_POTION or Material.SPLASH_POTION but was Material.%s", item.getType()); -+ // Preconditions.checkArgument(item.getType() == Material.LINGERING_POTION || item.getType() == Material.SPLASH_POTION, "ItemStack material must be Material.LINGERING_POTION or Material.SPLASH_POTION but was Material.%s", item.getType()); // Paper - Projectile API -+ org.bukkit.inventory.meta.PotionMeta meta = (item.getType() == Material.LINGERING_POTION || item.getType() == Material.SPLASH_POTION) ? null : this.getPotionMeta(); // Paper - Projectile API +- Preconditions.checkArgument(item.getType() == ItemType.LINGERING_POTION || item.getType() == ItemType.SPLASH_POTION, "ItemStack type must be ItemType.LINGERING_POTION or ItemType.SPLASH_POTION but was ItemType.%s", item.getType()); ++ // Preconditions.checkArgument(item.getType() == ItemType.LINGERING_POTION || item.getType() == ItemType.SPLASH_POTION, "ItemStack type must be ItemType.LINGERING_POTION or ItemType.SPLASH_POTION but was ItemType.%s", item.getType()); // Paper - Projectile API ++ org.bukkit.inventory.meta.PotionMeta meta = (item.getType() == ItemType.LINGERING_POTION || item.getType() == ItemType.SPLASH_POTION) ? null : this.getPotionMeta(); // Paper - Projectile API this.getHandle().setItem(CraftItemStack.asNMSCopy(item)); + if (meta != null) this.setPotionMeta(meta); // Paper - Projectile API @@ -453,7 +453,7 @@ index 02ee302f93f971fbd97f7fd88f257a1a613a81ba..2b8a4ad4bca3044f1af274cdff90e6d6 + // Paper start - Projectile API + @Override + public org.bukkit.inventory.meta.PotionMeta getPotionMeta() { -+ return (org.bukkit.inventory.meta.PotionMeta) CraftItemStack.getItemMeta(this.getHandle().getItemRaw(), Material.SPLASH_POTION); ++ return (org.bukkit.inventory.meta.PotionMeta) CraftItemStack.getItemMeta(this.getHandle().getItemRaw(), ItemType.SPLASH_POTION); + } + + @Override @@ -472,10 +472,10 @@ index 02ee302f93f971fbd97f7fd88f257a1a613a81ba..2b8a4ad4bca3044f1af274cdff90e6d6 public net.minecraft.world.entity.projectile.ThrownPotion getHandle() { return (net.minecraft.world.entity.projectile.ThrownPotion) entity; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java -index 832981b07ef5c633ef00a382f56798ee87eec0df..faf071201b7c1414225a33fe9641eac9477d53c7 100644 +index c628594b981f276acae7b9337100d811f919631b..c8b65210d2416b5a293cb4bcc1b71f56ed365cd7 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java -@@ -59,5 +59,15 @@ public class CraftTrident extends CraftArrow implements Trident { +@@ -53,5 +53,15 @@ public class CraftTrident extends CraftArrow implements Trident { com.google.common.base.Preconditions.checkArgument(loyaltyLevel >= 0 && loyaltyLevel <= 127, "The loyalty level has to be between 0 and 127"); this.getHandle().setLoyalty((byte) loyaltyLevel); } @@ -492,10 +492,10 @@ index 832981b07ef5c633ef00a382f56798ee87eec0df..faf071201b7c1414225a33fe9641eac9 // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 6775b432e17b09aaa21af5713fa0ffdf7fdbf8a9..d6b9897dcb4715decd4dd0b1b96995e25d789482 100644 +index a30ccb1ff3a02ce482ce2b0d40c76dd07d3b0dc1..37819199655d03810f9f4c48b242798a43cbc06f 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -@@ -279,12 +279,20 @@ public final class CraftItemStack extends ItemStack { +@@ -279,13 +279,20 @@ public final class CraftItemStack extends ItemStack { public ItemMeta getItemMeta() { return CraftItemStack.getItemMeta(this.handle); } @@ -507,14 +507,14 @@ index 6775b432e17b09aaa21af5713fa0ffdf7fdbf8a9..d6b9897dcb4715decd4dd0b1b96995e2 public static ItemMeta getItemMeta(net.minecraft.world.item.ItemStack item) { + return getItemMeta(item, CraftItemStack.getType(item)); + } -+ public static ItemMeta getItemMeta(net.minecraft.world.item.ItemStack item, Material material) { ++ public static ItemMeta getItemMeta(net.minecraft.world.item.ItemStack item, ItemType type) { + // Paper end if (!CraftItemStack.hasItemMeta(item)) { - return CraftItemFactory.instance().getItemMeta(CraftItemStack.getType(item)); -+ return CraftItemFactory.instance().getItemMeta(material); // Paper ++ return CraftItemFactory.instance().getItemMeta(type); // Paper + } + +- ItemType type = CraftItemStack.getType(item); + if (type == ItemType.WRITTEN_BOOK) { + return new CraftMetaBookSigned(item.getTag()); } -- switch (CraftItemStack.getType(item)) { -+ switch (material) { // Paper - case WRITTEN_BOOK: - return new CraftMetaBookSigned(item.getTag()); - case WRITABLE_BOOK: diff --git a/patches/server/0797-Fix-swamp-hut-cat-generation-deadlock.patch b/patches/server/0795-Fix-swamp-hut-cat-generation-deadlock.patch index 018b928494..018b928494 100644 --- a/patches/server/0797-Fix-swamp-hut-cat-generation-deadlock.patch +++ b/patches/server/0795-Fix-swamp-hut-cat-generation-deadlock.patch diff --git a/patches/server/0798-Don-t-allow-vehicle-movement-from-players-while-tele.patch b/patches/server/0796-Don-t-allow-vehicle-movement-from-players-while-tele.patch index aa96a3253f..ec7182ba6b 100644 --- a/patches/server/0798-Don-t-allow-vehicle-movement-from-players-while-tele.patch +++ b/patches/server/0796-Don-t-allow-vehicle-movement-from-players-while-tele.patch @@ -7,7 +7,7 @@ Bring the vehicle move packet behavior in line with the regular player move packet. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 446ef101ca506ec9fdce6cede70a1e51d97d7dfc..3b6edec55939c4fddf28b59282652493b42a2b8d 100644 +index 161e8a8c7517c87784bd7f543d18d4ac0a323c8f..d6293594e022b7c7fbf904589c5f26610a52b6c6 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -576,6 +576,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic diff --git a/patches/server/0799-Implement-getComputedBiome-API.patch b/patches/server/0797-Implement-getComputedBiome-API.patch index 7eec45ff95..d0cd757d01 100644 --- a/patches/server/0799-Implement-getComputedBiome-API.patch +++ b/patches/server/0797-Implement-getComputedBiome-API.patch @@ -5,17 +5,17 @@ Subject: [PATCH] Implement getComputedBiome API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -index 414b4fd46307aa9c9d0f96bc571a68642f33afdb..61bc6a68fe1b0101f70b065710d941b36f8766a8 100644 +index 5197c90d483cc17a965272f84b852eae67af4d5e..1ce493e453e0a4049f7e9fe105fb145fdf8d98b8 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -@@ -220,6 +220,13 @@ public abstract class CraftRegionAccessor implements RegionAccessor { - return CraftBlock.biomeBaseToBiome(this.getHandle().registryAccess().registryOrThrow(Registries.BIOME), this.getHandle().getNoiseBiome(x >> 2, y >> 2, z >> 2)); +@@ -222,6 +222,13 @@ public abstract class CraftRegionAccessor implements RegionAccessor { + return CraftBiome.minecraftToBukkit(this.getHandle().getNoiseBiome(x >> 2, y >> 2, z >> 2)); } + // Paper start + @Override + public Biome getComputedBiome(int x, int y, int z) { -+ return CraftBlock.biomeBaseToBiome(this.getHandle().registryAccess().registryOrThrow(Registries.BIOME), this.getHandle().getBiome(new BlockPos(x, y, z))); ++ return CraftBiome.minecraftToBukkit(this.getHandle().getBiome(new BlockPos(x, y, z))); + } + // Paper end + @@ -23,10 +23,10 @@ index 414b4fd46307aa9c9d0f96bc571a68642f33afdb..61bc6a68fe1b0101f70b065710d941b3 public void setBiome(Location location, Biome biome) { this.setBiome(location.getBlockX(), location.getBlockY(), location.getBlockZ(), biome); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index 8d2da07f0793367a51026b50adc8b3dc71073013..61c1f722b99363597613c506cb2fb437e358eb1b 100644 +index 40d0610c1cdc4f7131ff36869a6983ee53b801f9..396e02e2e1017bbdbd5f1c1540e104f834aba6c5 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -@@ -344,6 +344,13 @@ public class CraftBlock implements Block { +@@ -339,6 +339,13 @@ public class CraftBlock implements Block { return this.getWorld().getBiome(this.getX(), this.getY(), this.getZ()); } @@ -41,7 +41,7 @@ index 8d2da07f0793367a51026b50adc8b3dc71073013..61c1f722b99363597613c506cb2fb437 public void setBiome(Biome bio) { this.getWorld().setBiome(this.getX(), this.getY(), this.getZ(), bio); diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java b/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java -index 23ffe4b8a19286543e12bf7408879e6d1305a78f..935bca901f0618d77f3bf6c057bcbc606c742fac 100644 +index 23fbaa5c086f1d6f2c858dfc46619a51b113a22d..5e2cc342f8d0cbc4dce7fb78f240a0d8d2477643 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java @@ -165,6 +165,14 @@ public class CraftLimitedRegion extends CraftRegionAccessor implements LimitedRe diff --git a/patches/server/0800-Make-some-itemstacks-nonnull.patch b/patches/server/0798-Make-some-itemstacks-nonnull.patch index 153d145fd3..153d145fd3 100644 --- a/patches/server/0800-Make-some-itemstacks-nonnull.patch +++ b/patches/server/0798-Make-some-itemstacks-nonnull.patch diff --git a/patches/server/0801-Implement-enchantWithLevels-API.patch b/patches/server/0799-Implement-enchantWithLevels-API.patch index ffa67d357d..2f3861fecb 100644 --- a/patches/server/0801-Implement-enchantWithLevels-API.patch +++ b/patches/server/0799-Implement-enchantWithLevels-API.patch @@ -5,17 +5,17 @@ Subject: [PATCH] Implement enchantWithLevels API diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index 583cd4726a1b60e8f11bf8a28cc3c655fa8c1b90..849e93a8a0645de4c3e6ab8047815d78a722d4f6 100644 +index 041cad0f4f3b86d182db39f2db6a41565808e20c..07661b1e2be3a38717f0b1e842d29cf4fe681246 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -439,6 +439,21 @@ public final class CraftItemFactory implements ItemFactory { +@@ -287,6 +287,21 @@ public final class CraftItemFactory implements ItemFactory { } // Paper start + @Override + public ItemStack enchantWithLevels(ItemStack itemStack, int levels, boolean allowTreasure, java.util.Random random) { + Preconditions.checkArgument(itemStack != null, "Argument 'itemStack' must not be null"); -+ Preconditions.checkArgument(itemStack.getType() != Material.AIR, "Argument 'itemStack' must not be of type AIR"); ++ Preconditions.checkArgument(itemStack.getType() != ItemType.AIR, "Argument 'itemStack' must not be of type AIR"); + Preconditions.checkArgument(itemStack.getAmount() > 0, "Argument 'itemStack' amount must be greater than 0"); + Preconditions.checkArgument(levels > 0 && levels <= 30, "Argument 'levels' must be in range [1, 30] (attempted " + levels + ")"); + Preconditions.checkArgument(random != null, "Argument 'random' must not be null"); diff --git a/patches/server/0802-Fix-saving-in-unloadWorld.patch b/patches/server/0800-Fix-saving-in-unloadWorld.patch index 50f6a5db96..012d980ebf 100644 --- a/patches/server/0802-Fix-saving-in-unloadWorld.patch +++ b/patches/server/0800-Fix-saving-in-unloadWorld.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix saving in unloadWorld Change savingDisabled to false to ensure ServerLevel's saving logic gets called when unloadWorld is called with save = true diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 7e7539b7f50007f10d7926bb13beea2538403b1f..86e11118d21849cb5613bcf0e18ec85467b6ab3a 100644 +index e9d3a817071774cf60b8fd04227382569d8cd3f8..a34cbc27c41f073ed473be39d41867ac2b9a7cd9 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1314,7 +1314,7 @@ public final class CraftServer implements Server { +@@ -1326,7 +1326,7 @@ public final class CraftServer implements Server { try { if (save) { diff --git a/patches/server/0803-Buffer-OOB-setBlock-calls.patch b/patches/server/0801-Buffer-OOB-setBlock-calls.patch index 4e1905eb3b..4e1905eb3b 100644 --- a/patches/server/0803-Buffer-OOB-setBlock-calls.patch +++ b/patches/server/0801-Buffer-OOB-setBlock-calls.patch diff --git a/patches/server/0804-Add-TameableDeathMessageEvent.patch b/patches/server/0802-Add-TameableDeathMessageEvent.patch index b08801fd3d..b08801fd3d 100644 --- a/patches/server/0804-Add-TameableDeathMessageEvent.patch +++ b/patches/server/0802-Add-TameableDeathMessageEvent.patch diff --git a/patches/server/0805-Fix-new-block-data-for-EntityChangeBlockEvent.patch b/patches/server/0803-Fix-new-block-data-for-EntityChangeBlockEvent.patch index 0ee11ae770..0ee11ae770 100644 --- a/patches/server/0805-Fix-new-block-data-for-EntityChangeBlockEvent.patch +++ b/patches/server/0803-Fix-new-block-data-for-EntityChangeBlockEvent.patch diff --git a/patches/server/0806-fix-player-loottables-running-when-mob-loot-gamerule.patch b/patches/server/0804-fix-player-loottables-running-when-mob-loot-gamerule.patch index 9c03da00a3..9c03da00a3 100644 --- a/patches/server/0806-fix-player-loottables-running-when-mob-loot-gamerule.patch +++ b/patches/server/0804-fix-player-loottables-running-when-mob-loot-gamerule.patch diff --git a/patches/server/0807-Ensure-entity-passenger-world-matches-ridden-entity.patch b/patches/server/0805-Ensure-entity-passenger-world-matches-ridden-entity.patch index f3bbed2174..f3bbed2174 100644 --- a/patches/server/0807-Ensure-entity-passenger-world-matches-ridden-entity.patch +++ b/patches/server/0805-Ensure-entity-passenger-world-matches-ridden-entity.patch diff --git a/patches/server/0808-Guard-against-invalid-entity-positions.patch b/patches/server/0806-Guard-against-invalid-entity-positions.patch index 8db61fe05f..8db61fe05f 100644 --- a/patches/server/0808-Guard-against-invalid-entity-positions.patch +++ b/patches/server/0806-Guard-against-invalid-entity-positions.patch diff --git a/patches/server/0807-cache-resource-keys.patch b/patches/server/0807-cache-resource-keys.patch new file mode 100644 index 0000000000..92f2d5c0a8 --- /dev/null +++ b/patches/server/0807-cache-resource-keys.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic <[email protected]> +Date: Sun, 20 Mar 2022 22:06:47 -0700 +Subject: [PATCH] cache resource keys + + +diff --git a/src/main/java/org/bukkit/craftbukkit/tag/CraftEntityTag.java b/src/main/java/org/bukkit/craftbukkit/tag/CraftEntityTag.java +index 277fbf879d9953f0ef0ba78c0f9888690c5b8e8d..ecb926ac6497bafd86ebc3c068aa46a29d3c0169 100644 +--- a/src/main/java/org/bukkit/craftbukkit/tag/CraftEntityTag.java ++++ b/src/main/java/org/bukkit/craftbukkit/tag/CraftEntityTag.java +@@ -16,9 +16,10 @@ public class CraftEntityTag extends CraftTag<net.minecraft.world.entity.EntityTy + super(registry, tag); + } + ++ private static final java.util.Map<EntityType<?>, net.minecraft.resources.ResourceKey<net.minecraft.world.entity.EntityType<?>>> KEY_CACHE = new java.util.concurrent.ConcurrentHashMap<>(); // Paper - cache key + @Override + public boolean isTagged(EntityType<?> entity) { +- return registry.getHolderOrThrow(ResourceKey.create(Registries.ENTITY_TYPE, CraftNamespacedKey.toMinecraft(entity.getKey()))).is(tag); ++ return registry.getHolderOrThrow(KEY_CACHE.computeIfAbsent(entity, type -> ResourceKey.create(Registries.ENTITY_TYPE, CraftNamespacedKey.toMinecraft(type.getKey())))).is(tag); // Paper - cache key + } + + @Override diff --git a/patches/server/0810-Allow-to-change-the-podium-for-the-EnderDragon.patch b/patches/server/0808-Allow-to-change-the-podium-for-the-EnderDragon.patch index 5ed62ee0e3..a82c69c51e 100644 --- a/patches/server/0810-Allow-to-change-the-podium-for-the-EnderDragon.patch +++ b/patches/server/0808-Allow-to-change-the-podium-for-the-EnderDragon.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Allow to change the podium for the EnderDragon diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -index fada988941c33e09bce5e71bcb2bb733185f6c12..92666c48620078623a451fbf68f673cb9f81c4b5 100644 +index 923601c346d51fd5d14ad7800dea639d00249256..80d1642b863f90f0d0a9e464f0dc5d0f71dc7abd 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java @@ -101,6 +101,10 @@ public class EnderDragon extends Mob implements Enemy { @@ -123,10 +123,10 @@ index 1290090f855840bf64bf3a7ba93e3cb036630dcc..98fb6422df0ceadff5aaf4b2965eb1b0 this.dragon.getPhaseManager().setPhase(EnderDragonPhase.HOLDING_PATTERN); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java -index acdd2e6efa42476dd627a54da66576ea75bc02d4..92bcc01b3b28062aa966a7aaca199d7a3be832f4 100644 +index 1cfba7aaa807f70ce6d88bf67c7ddacecf55d295..492fdc855fe9735b614b6831aa5baaa6b252cfb6 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderDragon.java -@@ -79,4 +79,22 @@ public class CraftEnderDragon extends CraftMob implements EnderDragon, CraftEnem +@@ -73,4 +73,22 @@ public class CraftEnderDragon extends CraftMob implements EnderDragon, CraftEnem public int getDeathAnimationTicks() { return this.getHandle().dragonDeathTime; } diff --git a/patches/server/0811-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch b/patches/server/0809-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch index 5fb11187b2..5fb11187b2 100644 --- a/patches/server/0811-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch +++ b/patches/server/0809-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch diff --git a/patches/server/0809-cache-resource-keys.patch b/patches/server/0809-cache-resource-keys.patch deleted file mode 100644 index c56e3412af..0000000000 --- a/patches/server/0809-cache-resource-keys.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic <[email protected]> -Date: Sun, 20 Mar 2022 22:06:47 -0700 -Subject: [PATCH] cache resource keys - - -diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index 61c1f722b99363597613c506cb2fb437e358eb1b..c04397cc60154ef55027c90be990b9dfb818fd2f 100644 ---- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -@@ -369,12 +369,13 @@ public class CraftBlock implements Block { - return (biome == null) ? Biome.CUSTOM : biome; - } - -+ private static final java.util.Map<org.bukkit.block.Biome, net.minecraft.resources.ResourceKey<net.minecraft.world.level.biome.Biome>> BIOME_KEY_CACHE = Collections.synchronizedMap(new java.util.EnumMap<>(Biome.class)); // Paper - public static Holder<net.minecraft.world.level.biome.Biome> biomeToBiomeBase(net.minecraft.core.Registry<net.minecraft.world.level.biome.Biome> registry, Biome bio) { - if (bio == null || bio == Biome.CUSTOM) { - return null; - } - -- return registry.getHolderOrThrow(ResourceKey.create(Registries.BIOME, CraftNamespacedKey.toMinecraft(bio.getKey()))); -+ return registry.getHolderOrThrow(BIOME_KEY_CACHE.computeIfAbsent(bio, b -> ResourceKey.create(Registries.BIOME, CraftNamespacedKey.toMinecraft(b.getKey())))); // Paper - cache key - } - - @Override -diff --git a/src/main/java/org/bukkit/craftbukkit/tag/CraftEntityTag.java b/src/main/java/org/bukkit/craftbukkit/tag/CraftEntityTag.java -index e0bf615fb1b99abbab2be55a4ee345204b36e218..7b3b12b4b2f5dbd37e23a7f5a0ad2abd04d259e2 100644 ---- a/src/main/java/org/bukkit/craftbukkit/tag/CraftEntityTag.java -+++ b/src/main/java/org/bukkit/craftbukkit/tag/CraftEntityTag.java -@@ -16,9 +16,10 @@ public class CraftEntityTag extends CraftTag<net.minecraft.world.entity.EntityTy - super(registry, tag); - } - -+ private static final java.util.Map<org.bukkit.entity.EntityType, net.minecraft.resources.ResourceKey<net.minecraft.world.entity.EntityType<?>>> KEY_CACHE = java.util.Collections.synchronizedMap(new java.util.EnumMap<>(EntityType.class)); // Paper - @Override - public boolean isTagged(EntityType entity) { -- return registry.getHolderOrThrow(ResourceKey.create(Registries.ENTITY_TYPE, CraftNamespacedKey.toMinecraft(entity.getKey()))).is(tag); -+ return registry.getHolderOrThrow(KEY_CACHE.computeIfAbsent(entity, type -> ResourceKey.create(Registries.ENTITY_TYPE, CraftNamespacedKey.toMinecraft(type.getKey())))).is(tag); // Paper - cache key - } - - @Override diff --git a/patches/server/0812-Fix-StructureGrowEvent-species-for-RED_MUSHROOM.patch b/patches/server/0810-Fix-StructureGrowEvent-species-for-RED_MUSHROOM.patch index fbb9b72b07..fbb9b72b07 100644 --- a/patches/server/0812-Fix-StructureGrowEvent-species-for-RED_MUSHROOM.patch +++ b/patches/server/0810-Fix-StructureGrowEvent-species-for-RED_MUSHROOM.patch diff --git a/patches/server/0813-Prevent-tile-entity-copies-loading-chunks.patch b/patches/server/0811-Prevent-tile-entity-copies-loading-chunks.patch index 6f5b29b2a0..ed2d176046 100644 --- a/patches/server/0813-Prevent-tile-entity-copies-loading-chunks.patch +++ b/patches/server/0811-Prevent-tile-entity-copies-loading-chunks.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Prevent tile entity copies loading chunks diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 3b6edec55939c4fddf28b59282652493b42a2b8d..2333252a3c46affb76c09731968117fdd46a9b1b 100644 +index d6293594e022b7c7fbf904589c5f26610a52b6c6..ba8db91a3e8d114cd0253ab147b2103e130983cc 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -3311,7 +3311,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic diff --git a/patches/server/0814-Use-username-instead-of-display-name-in-PlayerList-g.patch b/patches/server/0812-Use-username-instead-of-display-name-in-PlayerList-g.patch index 0b34f9da4c..0b34f9da4c 100644 --- a/patches/server/0814-Use-username-instead-of-display-name-in-PlayerList-g.patch +++ b/patches/server/0812-Use-username-instead-of-display-name-in-PlayerList-g.patch diff --git a/patches/server/0815-Fix-slime-spawners-not-spawning-outside-slime-chunks.patch b/patches/server/0813-Fix-slime-spawners-not-spawning-outside-slime-chunks.patch index e809e65ba8..e809e65ba8 100644 --- a/patches/server/0815-Fix-slime-spawners-not-spawning-outside-slime-chunks.patch +++ b/patches/server/0813-Fix-slime-spawners-not-spawning-outside-slime-chunks.patch diff --git a/patches/server/0816-Pass-ServerLevel-for-gamerule-callbacks.patch b/patches/server/0814-Pass-ServerLevel-for-gamerule-callbacks.patch index 79635fc588..67e2a23a5e 100644 --- a/patches/server/0816-Pass-ServerLevel-for-gamerule-callbacks.patch +++ b/patches/server/0814-Pass-ServerLevel-for-gamerule-callbacks.patch @@ -18,7 +18,7 @@ index 9a45921cbb1e7a39e6ef46cc93c14766ee8229ad..8115cf64a30b6438721769df6045e1b7 if (dedicatedserverproperties.enableQuery) { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 2333252a3c46affb76c09731968117fdd46a9b1b..65b94c6e2d85637342ebfb5478189536759d8338 100644 +index ba8db91a3e8d114cd0253ab147b2103e130983cc..4f0c8c4a7c20806fba7cf66ad06b0dcb5c7aaf76 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2901,7 +2901,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -158,10 +158,10 @@ index de713f1ca1d61a6b1fca2b66de9162556d102449..edd2c9d0cf5a81c779011cb4215d496a this.onChanged(server); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 1e26fea83065c7e76b196e6599892c11d4370617..5deed29e78ba599c4732b9bac57f0661e4871882 100644 +index 7f56dcf98a614bec109bddd98458e1f61d0d71f7..a79d66ba72163e7635d2a172545617ad9674e618 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1950,7 +1950,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1943,7 +1943,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { // Paper end GameRules.Value<?> handle = this.getHandle().getGameRules().getRule(CraftWorld.getGameRulesNMS().get(rule)); handle.deserialize(event.getValue()); // Paper @@ -170,7 +170,7 @@ index 1e26fea83065c7e76b196e6599892c11d4370617..5deed29e78ba599c4732b9bac57f0661 return true; } -@@ -1991,7 +1991,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1984,7 +1984,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { // Paper end GameRules.Value<?> handle = this.getHandle().getGameRules().getRule(CraftWorld.getGameRulesNMS().get(rule.getName())); handle.deserialize(event.getValue()); // Paper diff --git a/patches/server/0817-Add-pre-unbreaking-amount-to-PlayerItemDamageEvent.patch b/patches/server/0815-Add-pre-unbreaking-amount-to-PlayerItemDamageEvent.patch index 46b984988b..d5e87f2276 100644 --- a/patches/server/0817-Add-pre-unbreaking-amount-to-PlayerItemDamageEvent.patch +++ b/patches/server/0815-Add-pre-unbreaking-amount-to-PlayerItemDamageEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add pre-unbreaking amount to PlayerItemDamageEvent diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 6b9924652ef3cb3b26042155b05df3458b2a25ab..ac688d6175cc4c82cb454100b19738318503701a 100644 +index 9047d65b60203062dac6eeac3b90ef3417074c09..784623eefedfb601a8e0b8b42cbdb71eaebcac84 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java @@ -607,10 +607,11 @@ public final class ItemStack { diff --git a/patches/server/0818-WorldCreator-keepSpawnLoaded.patch b/patches/server/0816-WorldCreator-keepSpawnLoaded.patch index d1c0f4c8e8..43f195c5d0 100644 --- a/patches/server/0818-WorldCreator-keepSpawnLoaded.patch +++ b/patches/server/0816-WorldCreator-keepSpawnLoaded.patch @@ -5,10 +5,10 @@ Subject: [PATCH] WorldCreator#keepSpawnLoaded diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 86e11118d21849cb5613bcf0e18ec85467b6ab3a..738ba9f21169511eeabb5204c49049f77c2bc9da 100644 +index a34cbc27c41f073ed473be39d41867ac2b9a7cd9..659367b869509ecfcc16d6e9088368b0dec7e098 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1273,6 +1273,7 @@ public final class CraftServer implements Server { +@@ -1285,6 +1285,7 @@ public final class CraftServer implements Server { internal.setSpawnSettings(true, true); // Paper - move up diff --git a/patches/server/0819-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch b/patches/server/0817-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch index 91934e5589..91934e5589 100644 --- a/patches/server/0819-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch +++ b/patches/server/0817-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch diff --git a/patches/server/0820-Add-EntityDyeEvent-and-CollarColorable-interface.patch b/patches/server/0818-Add-EntityDyeEvent-and-CollarColorable-interface.patch index 83deaddd5f..83deaddd5f 100644 --- a/patches/server/0820-Add-EntityDyeEvent-and-CollarColorable-interface.patch +++ b/patches/server/0818-Add-EntityDyeEvent-and-CollarColorable-interface.patch diff --git a/patches/server/0821-Fire-CauldronLevelChange-on-initial-fill.patch b/patches/server/0819-Fire-CauldronLevelChange-on-initial-fill.patch index bcc871d7bc..bcc871d7bc 100644 --- a/patches/server/0821-Fire-CauldronLevelChange-on-initial-fill.patch +++ b/patches/server/0819-Fire-CauldronLevelChange-on-initial-fill.patch diff --git a/patches/server/0822-fix-powder-snow-cauldrons-not-turning-to-water.patch b/patches/server/0820-fix-powder-snow-cauldrons-not-turning-to-water.patch index fec28b7e17..fec28b7e17 100644 --- a/patches/server/0822-fix-powder-snow-cauldrons-not-turning-to-water.patch +++ b/patches/server/0820-fix-powder-snow-cauldrons-not-turning-to-water.patch diff --git a/patches/server/0823-Add-PlayerStopUsingItemEvent.patch b/patches/server/0821-Add-PlayerStopUsingItemEvent.patch index 78a9eb0f99..78a9eb0f99 100644 --- a/patches/server/0823-Add-PlayerStopUsingItemEvent.patch +++ b/patches/server/0821-Add-PlayerStopUsingItemEvent.patch diff --git a/patches/server/0824-FallingBlock-auto-expire-setting.patch b/patches/server/0822-FallingBlock-auto-expire-setting.patch index ed07517265..5f5e86a6f1 100644 --- a/patches/server/0824-FallingBlock-auto-expire-setting.patch +++ b/patches/server/0822-FallingBlock-auto-expire-setting.patch @@ -46,10 +46,10 @@ index 4a44109df0aece6661567dac5ebf6355de5d58c7..eff81e846f696349b3bd3d26c02442f1 public void setHurtsEntities(float fallHurtAmount, int fallHurtMax) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java -index 4a4fe85abb4ddd62e04f348e5be8b98ca4d4fbdc..e99314b905a7ed54ceeb156ed92ff1a5793df99a 100644 +index fb3ab0253c109c084cc15823a3ce318df3f658ed..642ef946b123c4507a407aa4ce459a2a143fba9e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFallingBlock.java -@@ -97,4 +97,15 @@ public class CraftFallingBlock extends CraftEntity implements FallingBlock { +@@ -85,4 +85,15 @@ public class CraftFallingBlock extends CraftEntity implements FallingBlock { this.setHurtEntities(true); } } diff --git a/patches/server/0825-Don-t-tick-markers.patch b/patches/server/0823-Don-t-tick-markers.patch index 9980fc455d..9119b23db8 100644 --- a/patches/server/0825-Don-t-tick-markers.patch +++ b/patches/server/0823-Don-t-tick-markers.patch @@ -23,7 +23,7 @@ index ff99336e0b8131ae161cfa5c4fc83c6905e3dbc8..5f43aedc6596e2b1ac7af97115157147 } }); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index b00c1df57789996fef58b2c649588c13df149abd..67e096207b08d2ba13ebc1b92ac94ed2e170f896 100644 +index 04a2f85a0365e8763d28aef68540f508667b750f..fc6c1e6a22bfcf52c0c1bb4d0d02edb0e6678252 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -2647,6 +2647,7 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0826-Do-not-accept-invalid-client-settings.patch b/patches/server/0824-Do-not-accept-invalid-client-settings.patch index 8b6617459b..13369cde67 100644 --- a/patches/server/0826-Do-not-accept-invalid-client-settings.patch +++ b/patches/server/0824-Do-not-accept-invalid-client-settings.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Do not accept invalid client settings diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 65b94c6e2d85637342ebfb5478189536759d8338..042dea0c808d21c97f3a26027625474c6440a372 100644 +index 4f0c8c4a7c20806fba7cf66ad06b0dcb5c7aaf76..400aa2f226df3cab4f0289ba23eb5de96c3daa97 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -3453,6 +3453,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic diff --git a/patches/server/0827-Add-support-for-Proxy-Protocol.patch b/patches/server/0825-Add-support-for-Proxy-Protocol.patch index 10999e871e..573ac9ffce 100644 --- a/patches/server/0827-Add-support-for-Proxy-Protocol.patch +++ b/patches/server/0825-Add-support-for-Proxy-Protocol.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add support for Proxy Protocol diff --git a/build.gradle.kts b/build.gradle.kts -index f783c349fe0f4c9ebd15ea20e04b3291d294e947..19186e436cd6a5f00f0b42ac11f8050ad2ef6713 100644 +index b695b2364d030717b70a7c3bd0b072ca8a0702f0..87a30234ada55f881a716b609a798a455d3b408e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -22,6 +22,7 @@ dependencies { diff --git a/patches/server/0828-Fix-OfflinePlayer-getBedSpawnLocation.patch b/patches/server/0826-Fix-OfflinePlayer-getBedSpawnLocation.patch index f74dc698da..44f3ed7a71 100644 --- a/patches/server/0828-Fix-OfflinePlayer-getBedSpawnLocation.patch +++ b/patches/server/0826-Fix-OfflinePlayer-getBedSpawnLocation.patch @@ -8,10 +8,10 @@ instance of CraftOfflinePlayer the world was incorrect due to the logic for reading the NBT not being up-to-date. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -index 17b3d5de58a9ef3acc67624c46cd6bbd96394f87..714afc98b5150907b45a00060be4e41582333204 100644 +index ffc31edc50cc19deead448856a0d6fb592bb7401..1af4a5c38af300d9e2cf127ee356574f4bbc513e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -@@ -31,6 +31,7 @@ import org.bukkit.profile.PlayerProfile; +@@ -33,6 +33,7 @@ import org.bukkit.profile.PlayerProfile; @SerializableAs("Player") public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializable { @@ -19,7 +19,7 @@ index 17b3d5de58a9ef3acc67624c46cd6bbd96394f87..714afc98b5150907b45a00060be4e415 private final GameProfile profile; private final CraftServer server; private final PlayerDataStorage storage; -@@ -319,11 +320,20 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa +@@ -321,11 +322,20 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa if (data == null) return null; if (data.contains("SpawnX") && data.contains("SpawnY") && data.contains("SpawnZ")) { diff --git a/patches/server/0829-Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch b/patches/server/0827-Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch index 59fabed7e4..59fabed7e4 100644 --- a/patches/server/0829-Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch +++ b/patches/server/0827-Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch diff --git a/patches/server/0830-Sanitize-Sent-BlockEntity-NBT.patch b/patches/server/0828-Sanitize-Sent-BlockEntity-NBT.patch index 52fcd344ad..52fcd344ad 100644 --- a/patches/server/0830-Sanitize-Sent-BlockEntity-NBT.patch +++ b/patches/server/0828-Sanitize-Sent-BlockEntity-NBT.patch diff --git a/patches/server/0831-Disable-component-selector-resolving-in-books-by-def.patch b/patches/server/0829-Disable-component-selector-resolving-in-books-by-def.patch index 72862c20c5..72862c20c5 100644 --- a/patches/server/0831-Disable-component-selector-resolving-in-books-by-def.patch +++ b/patches/server/0829-Disable-component-selector-resolving-in-books-by-def.patch diff --git a/patches/server/0832-Prevent-entity-loading-causing-async-lookups.patch b/patches/server/0830-Prevent-entity-loading-causing-async-lookups.patch index e2214f6079..e2214f6079 100644 --- a/patches/server/0832-Prevent-entity-loading-causing-async-lookups.patch +++ b/patches/server/0830-Prevent-entity-loading-causing-async-lookups.patch diff --git a/patches/server/0833-Throw-exception-on-world-create-while-being-ticked.patch b/patches/server/0831-Throw-exception-on-world-create-while-being-ticked.patch index d292db0d7f..a74ae44e40 100644 --- a/patches/server/0833-Throw-exception-on-world-create-while-being-ticked.patch +++ b/patches/server/0831-Throw-exception-on-world-create-while-being-ticked.patch @@ -45,10 +45,10 @@ index 910523399b1fae64808b292cfb45bed56719fcb3..66bb92ca535b559d3bca89b9bc841f8f this.profiler.popPush("connection"); MinecraftTimings.connectionTimer.startTiming(); // Spigot diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 738ba9f21169511eeabb5204c49049f77c2bc9da..fdceec1390113fd009801f42608c1dfc747e47bf 100644 +index 659367b869509ecfcc16d6e9088368b0dec7e098..408c4c1a6da5c393b98a2a81f15e20029b08283b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -868,6 +868,11 @@ public final class CraftServer implements Server { +@@ -880,6 +880,11 @@ public final class CraftServer implements Server { return new ArrayList<World>(this.worlds.values()); } @@ -60,7 +60,7 @@ index 738ba9f21169511eeabb5204c49049f77c2bc9da..fdceec1390113fd009801f42608c1dfc public DedicatedPlayerList getHandle() { return this.playerList; } -@@ -1149,6 +1154,7 @@ public final class CraftServer implements Server { +@@ -1161,6 +1166,7 @@ public final class CraftServer implements Server { @Override public World createWorld(WorldCreator creator) { Preconditions.checkState(this.console.getAllLevels().iterator().hasNext(), "Cannot create additional worlds on STARTUP"); @@ -68,7 +68,7 @@ index 738ba9f21169511eeabb5204c49049f77c2bc9da..fdceec1390113fd009801f42608c1dfc Preconditions.checkArgument(creator != null, "WorldCreator cannot be null"); String name = creator.name(); -@@ -1288,6 +1294,7 @@ public final class CraftServer implements Server { +@@ -1300,6 +1306,7 @@ public final class CraftServer implements Server { @Override public boolean unloadWorld(World world, boolean save) { diff --git a/patches/server/0834-Add-Alternate-Current-redstone-implementation.patch b/patches/server/0832-Add-Alternate-Current-redstone-implementation.patch index 2638138390..66aafef40e 100644 --- a/patches/server/0834-Add-Alternate-Current-redstone-implementation.patch +++ b/patches/server/0832-Add-Alternate-Current-redstone-implementation.patch @@ -2008,7 +2008,7 @@ index 0000000000000000000000000000000000000000..33cd90c30c22200a4e1ae64f40a0bf78 + } +} diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 67e096207b08d2ba13ebc1b92ac94ed2e170f896..653c9c41ab7c5cd332565436564396d18f26c17c 100644 +index fc6c1e6a22bfcf52c0c1bb4d0d02edb0e6678252..e06bab4c7134d31267f31b798c8bae0b65f05744 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -222,6 +222,7 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0835-Dont-resent-entity-on-art-update.patch b/patches/server/0833-Dont-resent-entity-on-art-update.patch index ff4ac47ad6..3594e67abc 100644 --- a/patches/server/0835-Dont-resent-entity-on-art-update.patch +++ b/patches/server/0833-Dont-resent-entity-on-art-update.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Dont resent entity on art update diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPainting.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPainting.java -index 1d54465f1835f5e419899a7585d3dec920e1a73b..b7610e880e857058b621228583c841b5d9338fc7 100644 +index 85b148c84747c4ac0fbd643823dd4b0ea7058f22..0668dfebbc76fe8b5c58ea57fcb37814fa07c913 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPainting.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPainting.java -@@ -38,7 +38,7 @@ public class CraftPainting extends CraftHanging implements Painting { +@@ -37,7 +37,7 @@ public class CraftPainting extends CraftHanging implements Painting { painting.setDirection(painting.getDirection()); return false; } diff --git a/patches/server/0836-Add-WardenAngerChangeEvent.patch b/patches/server/0834-Add-WardenAngerChangeEvent.patch index 2e66f62a0c..2e66f62a0c 100644 --- a/patches/server/0836-Add-WardenAngerChangeEvent.patch +++ b/patches/server/0834-Add-WardenAngerChangeEvent.patch diff --git a/patches/server/0837-Add-option-for-strict-advancement-dimension-checks.patch b/patches/server/0835-Add-option-for-strict-advancement-dimension-checks.patch index 17c86550c3..17c86550c3 100644 --- a/patches/server/0837-Add-option-for-strict-advancement-dimension-checks.patch +++ b/patches/server/0835-Add-option-for-strict-advancement-dimension-checks.patch diff --git a/patches/server/0838-Add-missing-important-BlockStateListPopulator-method.patch b/patches/server/0836-Add-missing-important-BlockStateListPopulator-method.patch index cdb1bc89a3..cdb1bc89a3 100644 --- a/patches/server/0838-Add-missing-important-BlockStateListPopulator-method.patch +++ b/patches/server/0836-Add-missing-important-BlockStateListPopulator-method.patch diff --git a/patches/server/0839-Nameable-Banner-API.patch b/patches/server/0837-Nameable-Banner-API.patch index 78f176be32..78f176be32 100644 --- a/patches/server/0839-Nameable-Banner-API.patch +++ b/patches/server/0837-Nameable-Banner-API.patch diff --git a/patches/server/0840-Don-t-broadcast-messages-to-command-blocks.patch b/patches/server/0838-Don-t-broadcast-messages-to-command-blocks.patch index 0ed5794063..960470bd14 100644 --- a/patches/server/0840-Don-t-broadcast-messages-to-command-blocks.patch +++ b/patches/server/0838-Don-t-broadcast-messages-to-command-blocks.patch @@ -20,10 +20,10 @@ index e05eb08a9c229b371887676da510df948b896a85..ceeedbd88c56c08ec8b047c9ca2f14cc Date date = new Date(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index fdceec1390113fd009801f42608c1dfc747e47bf..70e77e0e165140e761193d9255cfe3bfcb710979 100644 +index 408c4c1a6da5c393b98a2a81f15e20029b08283b..1f7f9c2fb99c8c035f0ac87727582b58c158cdb3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1790,7 +1790,7 @@ public final class CraftServer implements Server { +@@ -1802,7 +1802,7 @@ public final class CraftServer implements Server { // Paper end Set<CommandSender> recipients = new HashSet<>(); for (Permissible permissible : this.getPluginManager().getPermissionSubscriptions(permission)) { diff --git a/patches/server/0841-Prevent-empty-items-from-being-added-to-world.patch b/patches/server/0839-Prevent-empty-items-from-being-added-to-world.patch index af7950c0cb..1ed32f1812 100644 --- a/patches/server/0841-Prevent-empty-items-from-being-added-to-world.patch +++ b/patches/server/0839-Prevent-empty-items-from-being-added-to-world.patch @@ -7,7 +7,7 @@ The previous solution caused a bunch of bandaid fixes inorder to resolve edge ca Just simply prevent them from being added to the world instead. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 653c9c41ab7c5cd332565436564396d18f26c17c..06df21e55fdb70558b85fc095a04b3bb64fbe770 100644 +index e06bab4c7134d31267f31b798c8bae0b65f05744..c8a0f243d51cfa0f246fd217121e24bfc7c0069c 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1645,6 +1645,7 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0842-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch b/patches/server/0840-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch index 73b5c96f27..c7ccd70941 100644 --- a/patches/server/0842-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch +++ b/patches/server/0840-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch @@ -7,11 +7,11 @@ Remove in 1.19 along with the SplashPotion and LingeringPotion interfaces diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java -index 2b8a4ad4bca3044f1af274cdff90e6d66b6c7da7..5c3bc680c4e4e6dc4b2d9edc666d6a8d95c2e7b7 100644 +index 0d9c96fa877660e756bcf99baef1787b8893eb00..590811e4fd6a95606d19efc6c7f7822365df1a76 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java -@@ -14,7 +14,7 @@ import org.bukkit.entity.ThrownPotion; - import org.bukkit.inventory.ItemStack; +@@ -13,7 +13,7 @@ import org.bukkit.inventory.ItemStack; + import org.bukkit.inventory.ItemType; import org.bukkit.potion.PotionEffect; -public class CraftThrownPotion extends CraftThrowableProjectile implements ThrownPotion { diff --git a/patches/server/0843-Don-t-print-component-in-resource-pack-rejection-mes.patch b/patches/server/0841-Don-t-print-component-in-resource-pack-rejection-mes.patch index 14f42c194f..104ba6f4c5 100644 --- a/patches/server/0843-Don-t-print-component-in-resource-pack-rejection-mes.patch +++ b/patches/server/0841-Don-t-print-component-in-resource-pack-rejection-mes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Don't print component in resource pack rejection message diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 042dea0c808d21c97f3a26027625474c6440a372..9823e0b5b1129d22ad449acf77794c6c9975381e 100644 +index 400aa2f226df3cab4f0289ba23eb5de96c3daa97..2aac04915a1ca8112dec346b88f3e59d72d5f1fa 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2035,7 +2035,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic diff --git a/patches/server/0844-Add-Player-getFishHook.patch b/patches/server/0842-Add-Player-getFishHook.patch index 1f16e905b9..64bfa5d76d 100644 --- a/patches/server/0844-Add-Player-getFishHook.patch +++ b/patches/server/0842-Add-Player-getFishHook.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Player#getFishHook diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 329e0586ec4ea44b6a8f4b72a69041aa7cd01ced..35f79f34b86dbf6d592842883f53f83e07f95f93 100644 +index adca583aa01d729d15a6b74223806522599cb63b..e29f515c9840a8a125da0cbf021205b13197db17 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -161,6 +161,15 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -163,6 +163,15 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { return new Location(worldServer.getWorld(), bed.getX(), bed.getY(), bed.getZ()); } // Paper end diff --git a/patches/server/0845-Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch b/patches/server/0843-Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch index 3956916b04..3956916b04 100644 --- a/patches/server/0845-Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch +++ b/patches/server/0843-Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch diff --git a/patches/server/0846-Add-various-missing-EntityDropItemEvent-calls.patch b/patches/server/0844-Add-various-missing-EntityDropItemEvent-calls.patch index d723f0211a..d723f0211a 100644 --- a/patches/server/0846-Add-various-missing-EntityDropItemEvent-calls.patch +++ b/patches/server/0844-Add-various-missing-EntityDropItemEvent-calls.patch diff --git a/patches/server/0847-Add-some-minimal-debug-information-to-chat-packet-er.patch b/patches/server/0845-Add-some-minimal-debug-information-to-chat-packet-er.patch index 92447d0b2e..8e583b1351 100644 --- a/patches/server/0847-Add-some-minimal-debug-information-to-chat-packet-er.patch +++ b/patches/server/0845-Add-some-minimal-debug-information-to-chat-packet-er.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add some minimal debug information to chat packet errors TODO: potentially add some kick leeway diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 9823e0b5b1129d22ad449acf77794c6c9975381e..472c86d4f54d54cd5bb84d886194b3ddf7485a6e 100644 +index 2aac04915a1ca8112dec346b88f3e59d72d5f1fa..5b32436c4c2fe5cf057ce8fc6b439cc8232213af 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2293,7 +2293,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic diff --git a/patches/server/0848-Fix-Bee-flower-NPE.patch b/patches/server/0846-Fix-Bee-flower-NPE.patch index 8e5627e598..8e5627e598 100644 --- a/patches/server/0848-Fix-Bee-flower-NPE.patch +++ b/patches/server/0846-Fix-Bee-flower-NPE.patch diff --git a/patches/server/0849-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch b/patches/server/0847-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch index 011e5b929f..a6ee126f8a 100644 --- a/patches/server/0849-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch +++ b/patches/server/0847-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix Spigot Config not using commands.spam-exclusions diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 472c86d4f54d54cd5bb84d886194b3ddf7485a6e..a8465cf4b21d376b37e88a3f9fd8b6e4360ee775 100644 +index 5b32436c4c2fe5cf057ce8fc6b439cc8232213af..3d489006ce075d1e3f690587ac2d079a498d2b79 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2540,7 +2540,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic diff --git a/patches/server/0850-More-Teleport-API.patch b/patches/server/0848-More-Teleport-API.patch index 391f9be147..c012e537ff 100644 --- a/patches/server/0850-More-Teleport-API.patch +++ b/patches/server/0848-More-Teleport-API.patch @@ -7,7 +7,7 @@ Subject: [PATCH] More Teleport API public net.minecraft.server.network.ServerGamePacketListenerImpl internalTeleport(DDDFFLjava/util/Set;Z)V diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index a8465cf4b21d376b37e88a3f9fd8b6e4360ee775..94c1c276998b76744122f98c18f65a4e8cbccf4d 100644 +index 3d489006ce075d1e3f690587ac2d079a498d2b79..b7b9ae16883769739393906de6e7492ea3e30c75 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1711,11 +1711,17 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -31,10 +31,10 @@ index a8465cf4b21d376b37e88a3f9fd8b6e4360ee775..94c1c276998b76744122f98c18f65a4e d0 = to.getX(); d1 = to.getY(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index cc72d960d9a5f9481ec2214b1549a344907a68da..94b41e9e3abe9cfbe09af67b03bc841fc009b75c 100644 +index 12c917c1324451b03f671e4e5f8fda7dcbea4207..4e0ebcc93a1ab84d7063c020a3d119f23ceb8ca7 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -561,15 +561,36 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -567,15 +567,36 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @Override public boolean teleport(Location location, TeleportCause cause) { @@ -74,10 +74,10 @@ index cc72d960d9a5f9481ec2214b1549a344907a68da..94b41e9e3abe9cfbe09af67b03bc841f // Let the server handle cross world teleports if (location.getWorld() != null && !location.getWorld().equals(this.getWorld())) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 3120f72d2ba93625931da83c1e37678c07bd69cd..65e0a7e7b210107cd8882cc48da796c470b6eec4 100644 +index 620a46712a61dfcac5f87656fbea65d0388f8c54..3c79a729aba2b350c7caa131a5c532b178453101 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1203,13 +1203,101 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1195,13 +1195,101 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setRotation(float yaw, float pitch) { @@ -180,7 +180,7 @@ index 3120f72d2ba93625931da83c1e37678c07bd69cd..65e0a7e7b210107cd8882cc48da796c4 location.checkFinite(); ServerPlayer entity = this.getHandle(); -@@ -1222,7 +1310,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1214,7 +1302,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return false; } @@ -189,7 +189,7 @@ index 3120f72d2ba93625931da83c1e37678c07bd69cd..65e0a7e7b210107cd8882cc48da796c4 return false; } -@@ -1240,7 +1328,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1232,7 +1320,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // If this player is riding another entity, we must dismount before teleporting. @@ -198,7 +198,7 @@ index 3120f72d2ba93625931da83c1e37678c07bd69cd..65e0a7e7b210107cd8882cc48da796c4 // SPIGOT-5509: Wakeup, similar to riding if (this.isSleeping()) { -@@ -1256,13 +1344,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1248,13 +1336,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { ServerLevel toWorld = ((CraftWorld) to.getWorld()).getHandle(); // Close any foreign inventory diff --git a/patches/server/0851-Add-EntityPortalReadyEvent.patch b/patches/server/0849-Add-EntityPortalReadyEvent.patch index c775c2df51..c775c2df51 100644 --- a/patches/server/0851-Add-EntityPortalReadyEvent.patch +++ b/patches/server/0849-Add-EntityPortalReadyEvent.patch diff --git a/patches/server/0852-Don-t-use-level-random-in-entity-constructors.patch b/patches/server/0850-Don-t-use-level-random-in-entity-constructors.patch index c3f35be4a5..c3f35be4a5 100644 --- a/patches/server/0852-Don-t-use-level-random-in-entity-constructors.patch +++ b/patches/server/0850-Don-t-use-level-random-in-entity-constructors.patch diff --git a/patches/server/0853-Send-block-entities-after-destroy-prediction.patch b/patches/server/0851-Send-block-entities-after-destroy-prediction.patch index 10bf2d17e5..1a5d3e8bb2 100644 --- a/patches/server/0853-Send-block-entities-after-destroy-prediction.patch +++ b/patches/server/0851-Send-block-entities-after-destroy-prediction.patch @@ -57,7 +57,7 @@ index a88d9c733a647d4b3ad9e079b289f2979d092b07..257fa5207b889f882b77885d375564a8 } } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 94c1c276998b76744122f98c18f65a4e8cbccf4d..35ef7487060f81fb106a6a882006edf03023fd01 100644 +index b7b9ae16883769739393906de6e7492ea3e30c75..8a8031f9a39d5b3dfc27b5fc54a6eefb6b871563 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1857,8 +1857,28 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic diff --git a/patches/server/0854-Warn-on-plugins-accessing-faraway-chunks.patch b/patches/server/0852-Warn-on-plugins-accessing-faraway-chunks.patch index 90275821d3..dab69a5258 100644 --- a/patches/server/0854-Warn-on-plugins-accessing-faraway-chunks.patch +++ b/patches/server/0852-Warn-on-plugins-accessing-faraway-chunks.patch @@ -18,7 +18,7 @@ index 8107c8e4a994523c75252f7762e362ab6eb13e43..b3f4469c137d221bf5f43565800df59c private static boolean isOutsideSpawnableHeight(int y) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 5deed29e78ba599c4732b9bac57f0661e4871882..1a481fb4f4228f0fea8a7dc6132248c98b727c90 100644 +index a79d66ba72163e7635d2a172545617ad9674e618..a2b46096910a02ae757e895f44350a98554121b0 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -310,9 +310,24 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -86,7 +86,7 @@ index 5deed29e78ba599c4732b9bac57f0661e4871882..1a481fb4f4228f0fea8a7dc6132248c9 // Transient load for this tick return this.world.getChunk(x >> 4, z >> 4).getHeight(CraftHeightMap.toNMS(heightMap), x, z); } -@@ -2376,6 +2396,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2370,6 +2390,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { // Spigot end // Paper start public java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsync(int x, int z, boolean gen, boolean urgent) { diff --git a/patches/server/0855-Custom-Chat-Completion-Suggestions-API.patch b/patches/server/0853-Custom-Chat-Completion-Suggestions-API.patch index d23a9e98bc..8d7334cb72 100644 --- a/patches/server/0855-Custom-Chat-Completion-Suggestions-API.patch +++ b/patches/server/0853-Custom-Chat-Completion-Suggestions-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Custom Chat Completion Suggestions API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 65e0a7e7b210107cd8882cc48da796c470b6eec4..8369fa30d713e9917473d9d6caf4ebc4e3aad228 100644 +index 3c79a729aba2b350c7caa131a5c532b178453101..a9e76645d95908f95616f841471fbf9fb093e2e2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -643,6 +643,22 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0856-Add-missing-BlockFadeEvents.patch b/patches/server/0854-Add-missing-BlockFadeEvents.patch index e939b49a21..e939b49a21 100644 --- a/patches/server/0856-Add-missing-BlockFadeEvents.patch +++ b/patches/server/0854-Add-missing-BlockFadeEvents.patch diff --git a/patches/server/0857-Collision-API.patch b/patches/server/0855-Collision-API.patch index 19339f84ba..21bb50e40a 100644 --- a/patches/server/0857-Collision-API.patch +++ b/patches/server/0855-Collision-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Collision API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -index 61bc6a68fe1b0101f70b065710d941b36f8766a8..086cbbfb492413bf1ae901c46f8e8ebbadd68b21 100644 +index 1ce493e453e0a4049f7e9fe105fb145fdf8d98b8..8358acae246df67e917a8154538fc8a557b71a75 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -@@ -1015,5 +1015,12 @@ public abstract class CraftRegionAccessor implements RegionAccessor { +@@ -1017,5 +1017,12 @@ public abstract class CraftRegionAccessor implements RegionAccessor { return this.getHandle().clip(new net.minecraft.world.level.ClipContext(vec3d, vec3d1, net.minecraft.world.level.ClipContext.Block.COLLIDER, net.minecraft.world.level.ClipContext.Fluid.NONE, null)).getType() == net.minecraft.world.phys.HitResult.Type.MISS; } @@ -22,10 +22,10 @@ index 61bc6a68fe1b0101f70b065710d941b36f8766a8..086cbbfb492413bf1ae901c46f8e8ebb // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 94b41e9e3abe9cfbe09af67b03bc841fc009b75c..f7c879cf10f89eaeb41a0f40787bd2c98d8d3f31 100644 +index 4e0ebcc93a1ab84d7063c020a3d119f23ceb8ca7..50ac10a04f903234077e049e4f7f689c39ac9129 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1408,4 +1408,19 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1423,4 +1423,19 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return getHandle().isInPowderSnow || getHandle().wasInPowderSnow; // depending on the location in the entity "tick" either could be needed. } // Paper end diff --git a/patches/server/0858-Fix-suggest-command-message-for-brigadier-syntax-exc.patch b/patches/server/0856-Fix-suggest-command-message-for-brigadier-syntax-exc.patch index aa73cbbddf..aa73cbbddf 100644 --- a/patches/server/0858-Fix-suggest-command-message-for-brigadier-syntax-exc.patch +++ b/patches/server/0856-Fix-suggest-command-message-for-brigadier-syntax-exc.patch diff --git a/patches/server/0859-Block-Ticking-API.patch b/patches/server/0857-Block-Ticking-API.patch index 583ed00736..d0344c392d 100644 --- a/patches/server/0859-Block-Ticking-API.patch +++ b/patches/server/0857-Block-Ticking-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Block Ticking API diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index c04397cc60154ef55027c90be990b9dfb818fd2f..5401ab9f8f6ce12e1c5368dbc3acc78a250b3822 100644 +index 396e02e2e1017bbdbd5f1c1540e104f834aba6c5..b8d6b097d29a8b4d982715a44e4ae9b9660cd0a2 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -@@ -756,5 +756,21 @@ public class CraftBlock implements Block { +@@ -729,5 +729,21 @@ public class CraftBlock implements Block { public boolean isValidTool(ItemStack itemStack) { return getDrops(itemStack).size() != 0; } @@ -31,7 +31,7 @@ index c04397cc60154ef55027c90be990b9dfb818fd2f..5401ab9f8f6ce12e1c5368dbc3acc78a // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -index 68ffdb2140bdf8d00ed86db19d316735d9a6b2d1..78dc524549be9373a04df905deab85d41e7f7870 100644 +index 466b9a4363199e1b5535bb712f4de911cdfd26d3..f13e6e56e5fdb16f47e9c697875c9a471305891d 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java @@ -688,4 +688,11 @@ public class CraftBlockData implements BlockData { diff --git a/patches/server/0860-Add-Velocity-IP-Forwarding-Support.patch b/patches/server/0858-Add-Velocity-IP-Forwarding-Support.patch index 091bb3c90f..85275365de 100644 --- a/patches/server/0860-Add-Velocity-IP-Forwarding-Support.patch +++ b/patches/server/0858-Add-Velocity-IP-Forwarding-Support.patch @@ -213,10 +213,10 @@ index 3fcd7bfdb8945b276c94a263e9da6b85ce470366..3431b1132e55c53cda7cf47f021f2306 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 70e77e0e165140e761193d9255cfe3bfcb710979..9f8c5ceb8485b14a84f2a7b2ffc8192be5c6bdfd 100644 +index 1f7f9c2fb99c8c035f0ac87727582b58c158cdb3..a29320e9c4f139afce472da7190a3798a61e9506 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -797,7 +797,7 @@ public final class CraftServer implements Server { +@@ -809,7 +809,7 @@ public final class CraftServer implements Server { @Override public long getConnectionThrottle() { // Spigot Start - Automatically set connection throttle for bungee configurations diff --git a/patches/server/0861-Use-thread-safe-random-in-ServerLoginPacketListenerI.patch b/patches/server/0859-Use-thread-safe-random-in-ServerLoginPacketListenerI.patch index 2e38ad24c3..2e38ad24c3 100644 --- a/patches/server/0861-Use-thread-safe-random-in-ServerLoginPacketListenerI.patch +++ b/patches/server/0859-Use-thread-safe-random-in-ServerLoginPacketListenerI.patch diff --git a/patches/server/0863-Fix-plugin-loggers-on-server-shutdown.patch b/patches/server/0860-Fix-plugin-loggers-on-server-shutdown.patch index af3d178c6b..85b6df2f18 100644 --- a/patches/server/0863-Fix-plugin-loggers-on-server-shutdown.patch +++ b/patches/server/0860-Fix-plugin-loggers-on-server-shutdown.patch @@ -49,7 +49,7 @@ index 66bb92ca535b559d3bca89b9bc841f8f842b7e07..c5f3dc74888919e82e2ffbb8d648b764 // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 9f1b363e1a6fa4925dc4560654af8426e6908c9d..717e292040ed7779eb4b6c5fa26665d3df9024e7 100644 +index e0dd196e81fbb7cd4acd880d599d26b1bdd3a292..ef8055979da90ccb47f0ddc2ca17cb8e8e95c44e 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -18,6 +18,12 @@ public class Main { diff --git a/patches/server/0864-Stop-large-look-changes-from-crashing-the-server.patch b/patches/server/0861-Stop-large-look-changes-from-crashing-the-server.patch index 1a4fc80ccb..1a4fc80ccb 100644 --- a/patches/server/0864-Stop-large-look-changes-from-crashing-the-server.patch +++ b/patches/server/0861-Stop-large-look-changes-from-crashing-the-server.patch diff --git a/patches/server/0862-Add-NamespacedKey-biome-methods.patch b/patches/server/0862-Add-NamespacedKey-biome-methods.patch deleted file mode 100644 index e03f769d70..0000000000 --- a/patches/server/0862-Add-NamespacedKey-biome-methods.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Josh Roy <[email protected]> -Date: Sun, 14 Aug 2022 12:23:11 -0400 -Subject: [PATCH] Add NamespacedKey biome methods - -Co-authored-by: Thonk <[email protected]> - -diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index e8e26cca7fc8090a3b22925ae37e2362a44ced80..83cef5ec27c31f133a23cd27349f722799c786ea 100644 ---- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -609,6 +609,19 @@ public final class CraftMagicNumbers implements UnsafeValues { - Preconditions.checkArgument(material.isBlock(), material + " is not a block"); - return getBlock(material).hasCollision; - } -+ -+ @Override -+ public org.bukkit.NamespacedKey getBiomeKey(org.bukkit.RegionAccessor accessor, int x, int y, int z) { -+ org.bukkit.craftbukkit.CraftRegionAccessor cra = (org.bukkit.craftbukkit.CraftRegionAccessor) accessor; -+ return org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(cra.getHandle().registryAccess().registryOrThrow(net.minecraft.core.registries.Registries.BIOME).getKey(cra.getHandle().getBiome(new net.minecraft.core.BlockPos(x, y, z)).value())); -+ } -+ -+ @Override -+ public void setBiomeKey(org.bukkit.RegionAccessor accessor, int x, int y, int z, org.bukkit.NamespacedKey biomeKey) { -+ org.bukkit.craftbukkit.CraftRegionAccessor cra = (org.bukkit.craftbukkit.CraftRegionAccessor) accessor; -+ net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> biomeBase = cra.getHandle().registryAccess().registryOrThrow(net.minecraft.core.registries.Registries.BIOME).getHolderOrThrow(net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.BIOME, org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(biomeKey))); -+ cra.setBiome(x, y, z, biomeBase); -+ } - // Paper end - - /** diff --git a/patches/server/0865-Fire-EntityChangeBlockEvent-in-more-places.patch b/patches/server/0862-Fire-EntityChangeBlockEvent-in-more-places.patch index c7fbbaaa64..c7fbbaaa64 100644 --- a/patches/server/0865-Fire-EntityChangeBlockEvent-in-more-places.patch +++ b/patches/server/0862-Fire-EntityChangeBlockEvent-in-more-places.patch diff --git a/patches/server/0866-Missing-eating-regain-reason.patch b/patches/server/0863-Missing-eating-regain-reason.patch index b5a99bc0ef..b5a99bc0ef 100644 --- a/patches/server/0866-Missing-eating-regain-reason.patch +++ b/patches/server/0863-Missing-eating-regain-reason.patch diff --git a/patches/server/0867-Missing-effect-cause.patch b/patches/server/0864-Missing-effect-cause.patch index 2b4bcfc188..2b4bcfc188 100644 --- a/patches/server/0867-Missing-effect-cause.patch +++ b/patches/server/0864-Missing-effect-cause.patch diff --git a/patches/server/0868-Added-byte-array-serialization-deserialization-for-P.patch b/patches/server/0865-Added-byte-array-serialization-deserialization-for-P.patch index 28ffa3283e..28ffa3283e 100644 --- a/patches/server/0868-Added-byte-array-serialization-deserialization-for-P.patch +++ b/patches/server/0865-Added-byte-array-serialization-deserialization-for-P.patch diff --git a/patches/server/0869-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch b/patches/server/0866-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch index 4aa37793dd..af20932de0 100644 --- a/patches/server/0869-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch +++ b/patches/server/0866-Add-a-consumer-parameter-to-ProjectileSource-launchP.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add a consumer parameter to ProjectileSource#launchProjectile diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 4590764ec62938e2b601f9f8339d5c4ea183e5e2..4cf07ff38df050defceb69335e402ca52972a05f 100644 +index 1a41f371d9fc147ab0fd833d1bacb10096ec4f65..b0de36ed125a21d6f92f22351bb34040cdc42f53 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -496,8 +496,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -499,8 +499,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { } @Override @@ -25,7 +25,7 @@ index 4590764ec62938e2b601f9f8339d5c4ea183e5e2..4cf07ff38df050defceb69335e402ca5 Preconditions.checkState(!this.getHandle().generation, "Cannot launch projectile during world generation"); net.minecraft.world.level.Level world = ((CraftWorld) getWorld()).getHandle(); -@@ -580,6 +587,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -583,6 +590,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { if (velocity != null) { ((T) launch.getBukkitEntity()).setVelocity(velocity); } @@ -38,10 +38,10 @@ index 4590764ec62938e2b601f9f8339d5c4ea183e5e2..4cf07ff38df050defceb69335e402ca5 world.addFreshEntity(launch); return (T) launch.getBukkitEntity(); diff --git a/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java b/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java -index 18d6846d04268f0099a84b01a3a2790d7742d85e..40a1f138b610e336eb11f2ace4a0da5703295c6b 100644 +index 01725215768e7340234987969bcf5386f0e1711b..26c0552735a4056db290cc9a5eb7814c2a79e7f0 100644 --- a/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java +++ b/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java -@@ -57,6 +57,13 @@ public class CraftBlockProjectileSource implements BlockProjectileSource { +@@ -58,6 +58,13 @@ public class CraftBlockProjectileSource implements BlockProjectileSource { @Override public <T extends Projectile> T launchProjectile(Class<? extends T> projectile, Vector velocity) { @@ -52,10 +52,10 @@ index 18d6846d04268f0099a84b01a3a2790d7742d85e..40a1f138b610e336eb11f2ace4a0da57 + @Override + public <T extends Projectile> T launchProjectile(Class<? extends T> projectile, Vector velocity, org.bukkit.util.Consumer<T> function) { + // Paper end - launchProjectile consumer - Preconditions.checkArgument(this.getBlock().getType() == Material.DISPENSER, "Block is no longer dispenser"); + Preconditions.checkArgument(this.getBlock().getType() == BlockType.DISPENSER, "Block is no longer dispenser"); // Copied from BlockDispenser.dispense() BlockSourceImpl isourceblock = new BlockSourceImpl((ServerLevel) this.dispenserBlock.getLevel(), this.dispenserBlock.getBlockPos()); -@@ -147,6 +154,11 @@ public class CraftBlockProjectileSource implements BlockProjectileSource { +@@ -148,6 +155,11 @@ public class CraftBlockProjectileSource implements BlockProjectileSource { if (velocity != null) { ((T) launch.getBukkitEntity()).setVelocity(velocity); } diff --git a/patches/server/0870-Call-BlockPhysicsEvent-more-often.patch b/patches/server/0867-Call-BlockPhysicsEvent-more-often.patch index 83450685d0..83450685d0 100644 --- a/patches/server/0870-Call-BlockPhysicsEvent-more-often.patch +++ b/patches/server/0867-Call-BlockPhysicsEvent-more-often.patch diff --git a/patches/server/0871-Configurable-chat-thread-limit.patch b/patches/server/0868-Configurable-chat-thread-limit.patch index d6404f007b..d6404f007b 100644 --- a/patches/server/0871-Configurable-chat-thread-limit.patch +++ b/patches/server/0868-Configurable-chat-thread-limit.patch diff --git a/patches/server/0872-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch b/patches/server/0869-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch index 793883a2f4..adf9c249ec 100644 --- a/patches/server/0872-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch +++ b/patches/server/0869-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Mitigate effects of WorldCreator#keepSpawnLoaded ret type TODO: Remove in 1.21? diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index cacd9b59741c31e70e898e7af91a1a6ed3f87f07..2ee82c316c3a6a79e1d722dfd00c22baa83c0299 100644 +index ef28f880a4f603a48be5b32acc697f567a78b963..e0a8c946a7f5b0cf930a794f0e250757ec82488e 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -466,6 +466,12 @@ public class Commodore +@@ -925,6 +925,12 @@ public class Commodore { super.visitMethodInsn(Opcodes.INVOKEVIRTUAL, CB_PACKAGE + "/advancement/CraftAdvancement", "getDisplay0", desc, false); return; } @@ -21,5 +21,5 @@ index cacd9b59741c31e70e898e7af91a1a6ed3f87f07..2ee82c316c3a6a79e1d722dfd00c22ba + return; + } // Paper end - if ( modern ) - { + if (modern) { + if (owner.equals("org/bukkit/Material")) { diff --git a/patches/server/0873-fix-Jigsaw-block-kicking-user.patch b/patches/server/0870-fix-Jigsaw-block-kicking-user.patch index 6206d8d028..6206d8d028 100644 --- a/patches/server/0873-fix-Jigsaw-block-kicking-user.patch +++ b/patches/server/0870-fix-Jigsaw-block-kicking-user.patch diff --git a/patches/server/0874-use-BlockFormEvent-for-mud-converting-into-clay.patch b/patches/server/0871-use-BlockFormEvent-for-mud-converting-into-clay.patch index 7cd7034099..7cd7034099 100644 --- a/patches/server/0874-use-BlockFormEvent-for-mud-converting-into-clay.patch +++ b/patches/server/0871-use-BlockFormEvent-for-mud-converting-into-clay.patch diff --git a/patches/server/0875-Add-getDrops-to-BlockState.patch b/patches/server/0872-Add-getDrops-to-BlockState.patch index 7f9d14aad9..993e7cf522 100644 --- a/patches/server/0875-Add-getDrops-to-BlockState.patch +++ b/patches/server/0872-Add-getDrops-to-BlockState.patch @@ -7,7 +7,7 @@ Originally added isPreferredTool to BlockData but upstream added that. diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java -index 792bfc7eab33b26462e76a1912bd712e8af70073..b1abb332eca597b23888bca42d21d5b587f61b13 100644 +index 3c2e879799c6b6289b0ae467eae4ed950b0abeef..7c1b8f9704940db319f3226c0559e11e5d3e0a1a 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java @@ -323,5 +323,33 @@ public class CraftBlockState implements BlockState { diff --git a/patches/server/0876-Fix-a-bunch-of-vanilla-bugs.patch b/patches/server/0873-Fix-a-bunch-of-vanilla-bugs.patch index 193fb96886..c92250641a 100644 --- a/patches/server/0876-Fix-a-bunch-of-vanilla-bugs.patch +++ b/patches/server/0873-Fix-a-bunch-of-vanilla-bugs.patch @@ -79,7 +79,7 @@ index 6cd6d69a20e95e344fc18ab67dc300824537a59b..2e2a7c2cf3081187da817479a9da3eb1 } } diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 06df21e55fdb70558b85fc095a04b3bb64fbe770..c6a7aace64785f76792b03be08fb69e4cb93d1b3 100644 +index c8a0f243d51cfa0f246fd217121e24bfc7c0069c..cbc952f047d1cf0bfc89851876e5a5288e26142d 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1091,7 +1091,7 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0877-Remove-unnecessary-onTrackingStart-during-navigation.patch b/patches/server/0874-Remove-unnecessary-onTrackingStart-during-navigation.patch index 758839864f..d9b47f5c3f 100644 --- a/patches/server/0877-Remove-unnecessary-onTrackingStart-during-navigation.patch +++ b/patches/server/0874-Remove-unnecessary-onTrackingStart-during-navigation.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Remove unnecessary onTrackingStart during navigation warning diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index c6a7aace64785f76792b03be08fb69e4cb93d1b3..5bdae591d344fc9b72ffcc1a44fb5e495b1e6bb2 100644 +index cbc952f047d1cf0bfc89851876e5a5288e26142d..473d4e00972a42a30c18ae8d08b06394c815883a 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -2683,7 +2683,7 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0878-Fix-custom-piglin-loved-items.patch b/patches/server/0875-Fix-custom-piglin-loved-items.patch index e768ba98b8..e768ba98b8 100644 --- a/patches/server/0878-Fix-custom-piglin-loved-items.patch +++ b/patches/server/0875-Fix-custom-piglin-loved-items.patch diff --git a/patches/server/0879-EntityPickupItemEvent-fixes.patch b/patches/server/0876-EntityPickupItemEvent-fixes.patch index 8c7fe9dd48..8c7fe9dd48 100644 --- a/patches/server/0879-EntityPickupItemEvent-fixes.patch +++ b/patches/server/0876-EntityPickupItemEvent-fixes.patch diff --git a/patches/server/0880-Correctly-handle-interactions-with-items-on-cooldown.patch b/patches/server/0877-Correctly-handle-interactions-with-items-on-cooldown.patch index 9243e65aeb..0b9133c1c9 100644 --- a/patches/server/0880-Correctly-handle-interactions-with-items-on-cooldown.patch +++ b/patches/server/0877-Correctly-handle-interactions-with-items-on-cooldown.patch @@ -30,10 +30,10 @@ index 92340937194a985999a85c5d387f4d73e8354d24..1635fee928d64f4d2c336dca6675ed46 this.interactResult = event.useItemInHand() == Event.Result.DENY; this.interactPosition = blockposition.immutable(); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 94796cbe43546748b28aa921d22cb4b68ef23fa6..22ebf307641f9aa7231df8607bb859785be60f7a 100644 +index a1602539eaba33d9fb1a466e75f2f832ae33dfe6..f90e0c626e5fa944ae22034d5712d10abec67e46 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -517,6 +517,12 @@ public class CraftEventFactory { +@@ -523,6 +523,12 @@ public class CraftEventFactory { } public static PlayerInteractEvent callPlayerInteractEvent(net.minecraft.world.entity.player.Player who, Action action, BlockPos position, Direction direction, ItemStack itemstack, boolean cancelledBlock, InteractionHand hand, Vec3 hitVec) { @@ -46,7 +46,7 @@ index 94796cbe43546748b28aa921d22cb4b68ef23fa6..22ebf307641f9aa7231df8607bb85978 // Paper end Player player = (who == null) ? null : (Player) who.getBukkitEntity(); CraftItemStack itemInHand = CraftItemStack.asCraftMirror(itemstack); -@@ -550,6 +556,11 @@ public class CraftEventFactory { +@@ -556,6 +562,11 @@ public class CraftEventFactory { if (cancelledBlock) { event.setUseInteractedBlock(Event.Result.DENY); } diff --git a/patches/server/0881-Add-PlayerInventorySlotChangeEvent.patch b/patches/server/0878-Add-PlayerInventorySlotChangeEvent.patch index 70dd42cf1b..52e2603b94 100644 --- a/patches/server/0881-Add-PlayerInventorySlotChangeEvent.patch +++ b/patches/server/0878-Add-PlayerInventorySlotChangeEvent.patch @@ -35,7 +35,7 @@ index 48cd206a41fe238af4c53b7f2a664fb16da366a5..88726c9bfd6dee2110910f43a042a9b2 @Override public void dataChanged(AbstractContainerMenu handler, int property, int value) {} diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java -index 19b0ae77e99c972159cb236403f420baa0cc46e0..b9e8d8b91b307e37900d0d2e8c823e63faed7cea 100644 +index 45e6d0a7044ae3fb4d837b6bc4604329224a672f..401b92a8366906b8a3202e386ee8301353b275b0 100644 --- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java @@ -302,7 +302,7 @@ public abstract class AbstractContainerMenu { diff --git a/patches/server/0882-Elder-Guardian-appearance-API.patch b/patches/server/0879-Elder-Guardian-appearance-API.patch index 5855c82762..4cc82c63a1 100644 --- a/patches/server/0882-Elder-Guardian-appearance-API.patch +++ b/patches/server/0879-Elder-Guardian-appearance-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Elder Guardian appearance API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b2f333b88f8282b01975c622c496ca796745b1d4..e0f2f83f411270ac3bc95979ab6778606b3fc890 100644 +index a9e76645d95908f95616f841471fbf9fb093e2e2..50e262a7c9e56b951d97dd2cea654071cf3223da 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3083,6 +3083,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3101,6 +3101,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end diff --git a/patches/server/0883-Allow-changing-bed-s-occupied-property.patch b/patches/server/0880-Allow-changing-bed-s-occupied-property.patch index 4d0128b6d3..4d0128b6d3 100644 --- a/patches/server/0883-Allow-changing-bed-s-occupied-property.patch +++ b/patches/server/0880-Allow-changing-bed-s-occupied-property.patch diff --git a/patches/server/0884-Add-entity-knockback-API.patch b/patches/server/0881-Add-entity-knockback-API.patch index 3c5152fdf6..c42b05c48b 100644 --- a/patches/server/0884-Add-entity-knockback-API.patch +++ b/patches/server/0881-Add-entity-knockback-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add entity knockback API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 4cf07ff38df050defceb69335e402ca52972a05f..a4d2f2a296e93dd786abf81439eb759c49029850 100644 +index b0de36ed125a21d6f92f22351bb34040cdc42f53..7571d35e3b29ee803b438a10a6016741c2618347 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -989,5 +989,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -987,5 +987,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { } throw new IllegalArgumentException(entityCategory + " is an unrecognized entity category"); } diff --git a/patches/server/0885-Detect-headless-JREs.patch b/patches/server/0882-Detect-headless-JREs.patch index 9d49be7a76..9d49be7a76 100644 --- a/patches/server/0885-Detect-headless-JREs.patch +++ b/patches/server/0882-Detect-headless-JREs.patch diff --git a/patches/server/0886-fixed-entity-vehicle-collision-event-not-called.patch b/patches/server/0883-fixed-entity-vehicle-collision-event-not-called.patch index 19c5cdfd72..19c5cdfd72 100644 --- a/patches/server/0886-fixed-entity-vehicle-collision-event-not-called.patch +++ b/patches/server/0883-fixed-entity-vehicle-collision-event-not-called.patch diff --git a/patches/server/0887-optimized-dirt-and-snow-spreading.patch b/patches/server/0884-optimized-dirt-and-snow-spreading.patch index 08a3761309..08a3761309 100644 --- a/patches/server/0887-optimized-dirt-and-snow-spreading.patch +++ b/patches/server/0884-optimized-dirt-and-snow-spreading.patch diff --git a/patches/server/0888-Added-EntityToggleSitEvent.patch b/patches/server/0885-Added-EntityToggleSitEvent.patch index 3545a2f37d..3545a2f37d 100644 --- a/patches/server/0888-Added-EntityToggleSitEvent.patch +++ b/patches/server/0885-Added-EntityToggleSitEvent.patch diff --git a/patches/server/0889-Add-fire-tick-delay-option.patch b/patches/server/0886-Add-fire-tick-delay-option.patch index e9a876ed2b..e9a876ed2b 100644 --- a/patches/server/0889-Add-fire-tick-delay-option.patch +++ b/patches/server/0886-Add-fire-tick-delay-option.patch diff --git a/patches/server/0890-Add-Moving-Piston-API.patch b/patches/server/0887-Add-Moving-Piston-API.patch index 53df041ba1..53df041ba1 100644 --- a/patches/server/0890-Add-Moving-Piston-API.patch +++ b/patches/server/0887-Add-Moving-Piston-API.patch diff --git a/patches/server/0891-Ignore-impossible-spawn-tick.patch b/patches/server/0888-Ignore-impossible-spawn-tick.patch index 46cd469266..46cd469266 100644 --- a/patches/server/0891-Ignore-impossible-spawn-tick.patch +++ b/patches/server/0888-Ignore-impossible-spawn-tick.patch diff --git a/patches/server/0892-Track-projectile-source-for-fireworks-from-dispenser.patch b/patches/server/0889-Track-projectile-source-for-fireworks-from-dispenser.patch index 389dfc4431..389dfc4431 100644 --- a/patches/server/0892-Track-projectile-source-for-fireworks-from-dispenser.patch +++ b/patches/server/0889-Track-projectile-source-for-fireworks-from-dispenser.patch diff --git a/patches/server/0893-Fix-EntityArgument-suggestion-permissions-to-align-w.patch b/patches/server/0890-Fix-EntityArgument-suggestion-permissions-to-align-w.patch index a840f9a576..a840f9a576 100644 --- a/patches/server/0893-Fix-EntityArgument-suggestion-permissions-to-align-w.patch +++ b/patches/server/0890-Fix-EntityArgument-suggestion-permissions-to-align-w.patch diff --git a/patches/server/0894-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch b/patches/server/0891-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch index ba347aa9a8..ba347aa9a8 100644 --- a/patches/server/0894-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch +++ b/patches/server/0891-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch diff --git a/patches/server/0895-Prevent-compass-from-loading-chunks.patch b/patches/server/0892-Prevent-compass-from-loading-chunks.patch index fd21636990..fd21636990 100644 --- a/patches/server/0895-Prevent-compass-from-loading-chunks.patch +++ b/patches/server/0892-Prevent-compass-from-loading-chunks.patch diff --git a/patches/server/0896-Add-PrePlayerAttackEntityEvent.patch b/patches/server/0893-Add-PrePlayerAttackEntityEvent.patch index 01fbd77bb2..01fbd77bb2 100644 --- a/patches/server/0896-Add-PrePlayerAttackEntityEvent.patch +++ b/patches/server/0893-Add-PrePlayerAttackEntityEvent.patch diff --git a/patches/server/0897-ensure-reset-EnderDragon-boss-event-name.patch b/patches/server/0894-ensure-reset-EnderDragon-boss-event-name.patch index 0f1fd322ef..0f1fd322ef 100644 --- a/patches/server/0897-ensure-reset-EnderDragon-boss-event-name.patch +++ b/patches/server/0894-ensure-reset-EnderDragon-boss-event-name.patch diff --git a/patches/server/0898-fix-MC-252817-green-map-markers-do-not-disappear.patch b/patches/server/0895-fix-MC-252817-green-map-markers-do-not-disappear.patch index e5593afbc6..e5593afbc6 100644 --- a/patches/server/0898-fix-MC-252817-green-map-markers-do-not-disappear.patch +++ b/patches/server/0895-fix-MC-252817-green-map-markers-do-not-disappear.patch diff --git a/patches/server/0899-Add-Player-Warden-Warning-API.patch b/patches/server/0896-Add-Player-Warden-Warning-API.patch index 102a25ab34..fc572c5320 100644 --- a/patches/server/0899-Add-Player-Warden-Warning-API.patch +++ b/patches/server/0896-Add-Player-Warden-Warning-API.patch @@ -10,10 +10,10 @@ public net.minecraft.world.entity.monster.warden.WardenSpawnTracker cooldownTick public net.minecraft.world.entity.monster.warden.WardenSpawnTracker increaseWarningLevel()V diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index e0f2f83f411270ac3bc95979ab6778606b3fc890..621a990a54e61e174e77558d70a84d6a215fb879 100644 +index 50e262a7c9e56b951d97dd2cea654071cf3223da..77c0c07831a0c1011aa92c4882d99836ed2817eb 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3088,6 +3088,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3106,6 +3106,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void showElderGuardian(boolean silent) { if (getHandle().connection != null) getHandle().connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.GUARDIAN_ELDER_EFFECT, silent ? 0F : 1F)); } diff --git a/patches/server/0900-More-vanilla-friendly-methods-to-update-trades.patch b/patches/server/0897-More-vanilla-friendly-methods-to-update-trades.patch index 18bc407bfb..693a168ec1 100644 --- a/patches/server/0900-More-vanilla-friendly-methods-to-update-trades.patch +++ b/patches/server/0897-More-vanilla-friendly-methods-to-update-trades.patch @@ -35,10 +35,10 @@ index 4bef7abbed6b64c2f126c81af5484eff200e620f..e30d5ae3e2900f43d7cafde71b8196f2 public void gossip(ServerLevel world, Villager villager, long time) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java -index 6f7977b492ce01e7cda7872c42bd7f2386d3e745..f21c715ea109164efa755cddb35ef656a9859759 100644 +index eeca610110a058d704b72674e0f2df72982ca039..4c5f33084ddec1a49f8d8f7c2deafe37009d7644 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java -@@ -99,6 +99,34 @@ public class CraftVillager extends CraftAbstractVillager implements Villager { +@@ -96,6 +96,34 @@ public class CraftVillager extends CraftAbstractVillager implements Villager { } // Paper start diff --git a/patches/server/0901-Add-paper-dumplisteners-command.patch b/patches/server/0898-Add-paper-dumplisteners-command.patch index cbf1598dd5..cbf1598dd5 100644 --- a/patches/server/0901-Add-paper-dumplisteners-command.patch +++ b/patches/server/0898-Add-paper-dumplisteners-command.patch diff --git a/patches/server/0902-check-global-player-list-where-appropriate.patch b/patches/server/0899-check-global-player-list-where-appropriate.patch index be6c2d1321..460baa0b75 100644 --- a/patches/server/0902-check-global-player-list-where-appropriate.patch +++ b/patches/server/0899-check-global-player-list-where-appropriate.patch @@ -7,7 +7,7 @@ Makes certain entities check all players when searching for a player instead of just checking players in their world. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 5bdae591d344fc9b72ffcc1a44fb5e495b1e6bb2..37873ea2876a89ac8ea702ab0a71171e044852bc 100644 +index 473d4e00972a42a30c18ae8d08b06394c815883a..0660c2f968a6e3d66d4fe9fd18ecac72d328f000 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -2805,4 +2805,12 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0903-Fix-async-entity-add-due-to-fungus-trees.patch b/patches/server/0900-Fix-async-entity-add-due-to-fungus-trees.patch index fdb8bd16d3..a34c6d610e 100644 --- a/patches/server/0903-Fix-async-entity-add-due-to-fungus-trees.patch +++ b/patches/server/0900-Fix-async-entity-add-due-to-fungus-trees.patch @@ -17,10 +17,10 @@ index 52fd12c474c01f3b53d0f6596b7a6fafee52bd0d..877498729c66de9aa6a27c9148f7494d BlockEntity tileentity = iblockdata.hasBlockEntity() ? this.getBlockEntity(pos) : null; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -index 086cbbfb492413bf1ae901c46f8e8ebbadd68b21..23d77e6cc55c06d9c2cfb21421cd19c487dbe765 100644 +index 8358acae246df67e917a8154538fc8a557b71a75..fb65442111804a6dc1851802605020b96af77973 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -@@ -401,10 +401,10 @@ public abstract class CraftRegionAccessor implements RegionAccessor { +@@ -403,10 +403,10 @@ public abstract class CraftRegionAccessor implements RegionAccessor { ((ChorusFlowerBlock) Blocks.CHORUS_FLOWER).generatePlant(access, pos, random, 8); return true; case CRIMSON_FUNGUS: diff --git a/patches/server/0904-ItemStack-damage-API.patch b/patches/server/0901-ItemStack-damage-API.patch index 9c9e244de1..6017351aeb 100644 --- a/patches/server/0904-ItemStack-damage-API.patch +++ b/patches/server/0901-ItemStack-damage-API.patch @@ -11,10 +11,10 @@ the logic associated with damaging them public net.minecraft.world.entity.LivingEntity entityEventForEquipmentBreak(Lnet/minecraft/world/entity/EquipmentSlot;)B diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index a4d2f2a296e93dd786abf81439eb759c49029850..7db6e0f8260f748669b1d98160bc47b979ade0f7 100644 +index 7571d35e3b29ee803b438a10a6016741c2618347..c2ef57029bea0ebd161c917adbfa3b1297b6806e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -990,6 +990,53 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -988,6 +988,53 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { throw new IllegalArgumentException(entityCategory + " is an unrecognized entity category"); } diff --git a/patches/server/0905-Friction-API.patch b/patches/server/0902-Friction-API.patch index b137b79138..45b7a1422e 100644 --- a/patches/server/0905-Friction-API.patch +++ b/patches/server/0902-Friction-API.patch @@ -109,10 +109,10 @@ index 00ecef0ba7530ff2533fa9d5eaa8489da8796ead..3d41dbe0285f8fec8adae1e93010cf46 this.setItem(ItemStack.of(nbttagcompound1)); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java -index e9946edf568db010e4ccb9fe7755709ed7b8310f..a925b5c490e7129b27370aa57b5fad1cf05530c6 100644 +index d160db37a3b7ef44b6de8fef209eeccef46c3a95..5e83fabb20bc2b0668cbf48530053ca1bb9092f3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java -@@ -103,6 +103,18 @@ public class CraftItem extends CraftEntity implements Item { +@@ -102,6 +102,18 @@ public class CraftItem extends CraftEntity implements Item { item.age = willAge ? 0 : NO_AGE_TIME; } @@ -132,10 +132,10 @@ index e9946edf568db010e4ccb9fe7755709ed7b8310f..a925b5c490e7129b27370aa57b5fad1c public int getHealth() { return item.health; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 7db6e0f8260f748669b1d98160bc47b979ade0f7..40c80ba7fa6e0505c23e643acbc87fd03b69e208 100644 +index c2ef57029bea0ebd161c917adbfa3b1297b6806e..eb61197da44a84a60cd59bb518079e4c202e1188 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -1037,6 +1037,18 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -1035,6 +1035,18 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { }); } diff --git a/patches/server/0906-Ability-to-control-player-s-insomnia-and-phantoms.patch b/patches/server/0903-Ability-to-control-player-s-insomnia-and-phantoms.patch index 458d74cc9c..458d74cc9c 100644 --- a/patches/server/0906-Ability-to-control-player-s-insomnia-and-phantoms.patch +++ b/patches/server/0903-Ability-to-control-player-s-insomnia-and-phantoms.patch diff --git a/patches/server/0907-Fix-player-kick-on-shutdown.patch b/patches/server/0904-Fix-player-kick-on-shutdown.patch index b954657690..b954657690 100644 --- a/patches/server/0907-Fix-player-kick-on-shutdown.patch +++ b/patches/server/0904-Fix-player-kick-on-shutdown.patch diff --git a/patches/server/0908-Sync-offhand-slot-in-menus.patch b/patches/server/0905-Sync-offhand-slot-in-menus.patch index 66e1fc2fc7..4ae4602941 100644 --- a/patches/server/0908-Sync-offhand-slot-in-menus.patch +++ b/patches/server/0905-Sync-offhand-slot-in-menus.patch @@ -26,7 +26,7 @@ index 88726c9bfd6dee2110910f43a042a9b29717dc82..9d46536f80b5b3e6641fd377c02166a4 public void sendSlotChange(AbstractContainerMenu handler, int slot, ItemStack stack) { ServerPlayer.this.connection.send(new ClientboundContainerSetSlotPacket(handler.containerId, handler.incrementStateId(), slot, stack)); diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java -index b9e8d8b91b307e37900d0d2e8c823e63faed7cea..706b354ac9a1a6a4a1e61b2a109180d1dd22bbbd 100644 +index 401b92a8366906b8a3202e386ee8301353b275b0..76666fb7d20214319ca22eae3d6acd5e35b465aa 100644 --- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java @@ -200,6 +200,7 @@ public abstract class AbstractContainerMenu { diff --git a/patches/server/0909-Player-Entity-Tracking-Events.patch b/patches/server/0906-Player-Entity-Tracking-Events.patch index 0fdc102ca9..0fdc102ca9 100644 --- a/patches/server/0909-Player-Entity-Tracking-Events.patch +++ b/patches/server/0906-Player-Entity-Tracking-Events.patch diff --git a/patches/server/0910-Limit-pet-look-distance.patch b/patches/server/0907-Limit-pet-look-distance.patch index 724bcbffa1..724bcbffa1 100644 --- a/patches/server/0910-Limit-pet-look-distance.patch +++ b/patches/server/0907-Limit-pet-look-distance.patch diff --git a/patches/server/0911-Properly-resend-entities.patch b/patches/server/0908-Properly-resend-entities.patch index c1cea9b974..b642b7af58 100644 --- a/patches/server/0911-Properly-resend-entities.patch +++ b/patches/server/0908-Properly-resend-entities.patch @@ -66,7 +66,7 @@ index d088479d160dbd2fc90b48a30553be141db8eef2..bf6a70a69bb695ec1a202cd1e863c468 public static class DataItem<T> { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 35ef7487060f81fb106a6a882006edf03023fd01..1f6a0ec6e42906466aa63fe81f2d651b8512e837 100644 +index 8a8031f9a39d5b3dfc27b5fc54a6eefb6b871563..479c252ae715a6f12f542a6568aa88192e2c3ca4 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2799,7 +2799,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic diff --git a/patches/server/0912-Fixes-and-additions-to-the-SpawnReason-API.patch b/patches/server/0909-Fixes-and-additions-to-the-SpawnReason-API.patch index f7f6ee5b61..f7f6ee5b61 100644 --- a/patches/server/0912-Fixes-and-additions-to-the-SpawnReason-API.patch +++ b/patches/server/0909-Fixes-and-additions-to-the-SpawnReason-API.patch diff --git a/patches/server/0913-fix-Instruments.patch b/patches/server/0910-fix-Instruments.patch index c488b2b420..c43e2244a8 100644 --- a/patches/server/0913-fix-Instruments.patch +++ b/patches/server/0910-fix-Instruments.patch @@ -6,7 +6,7 @@ Subject: [PATCH] fix Instruments properly handle Player#playNote diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 621a990a54e61e174e77558d70a84d6a215fb879..c1d8535564446d297238a962cc0956f75a314e7b 100644 +index 77c0c07831a0c1011aa92c4882d99836ed2817eb..6813e7c001bb3f5a17c0ef83a83a5551cb11cfe1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -717,29 +717,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -35,7 +35,7 @@ index 621a990a54e61e174e77558d70a84d6a215fb879..c1d8535564446d297238a962cc0956f7 - }; - - float f = (float) Math.pow(2.0D, (note.getId() - 12.0D) / 12.0D); -- this.getHandle().connection.send(new ClientboundSoundPacket(BuiltInRegistries.SOUND_EVENT.wrapAsHolder(CraftSound.getSoundEffect("block.note_block." + instrumentName)), net.minecraft.sounds.SoundSource.RECORDS, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), 3.0f, f, this.getHandle().getRandom().nextLong())); +- this.getHandle().connection.send(new ClientboundSoundPacket(getRegistryAccess().registryOrThrow(Registries.SOUND_EVENT).wrapAsHolder(CraftSound.stringToMinecraft("block.note_block." + instrumentName)), net.minecraft.sounds.SoundSource.RECORDS, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), 3.0f, f, this.getHandle().getRandom().nextLong())); + // Paper start - fix all this (modeled off of NoteBlock) + net.minecraft.world.level.block.state.properties.NoteBlockInstrument nms = CraftBlockData.toNMS(instrument, net.minecraft.world.level.block.state.properties.NoteBlockInstrument.class); + float f; diff --git a/patches/server/0914-Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch b/patches/server/0911-Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch index f4f36a8f11..f4f36a8f11 100644 --- a/patches/server/0914-Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch +++ b/patches/server/0911-Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch diff --git a/patches/server/0915-Fix-inconsistencies-in-dispense-events-regarding-sta.patch b/patches/server/0912-Fix-inconsistencies-in-dispense-events-regarding-sta.patch index 923b2ffa50..923b2ffa50 100644 --- a/patches/server/0915-Fix-inconsistencies-in-dispense-events-regarding-sta.patch +++ b/patches/server/0912-Fix-inconsistencies-in-dispense-events-regarding-sta.patch diff --git a/patches/server/0916-Add-BlockLockCheckEvent.patch b/patches/server/0913-Add-BlockLockCheckEvent.patch index 29e8b68880..29e8b68880 100644 --- a/patches/server/0916-Add-BlockLockCheckEvent.patch +++ b/patches/server/0913-Add-BlockLockCheckEvent.patch diff --git a/patches/server/0917-Add-Sneaking-API-for-Entities.patch b/patches/server/0914-Add-Sneaking-API-for-Entities.patch index c7ba3ecf8f..d74459d0d1 100644 --- a/patches/server/0917-Add-Sneaking-API-for-Entities.patch +++ b/patches/server/0914-Add-Sneaking-API-for-Entities.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Sneaking API for Entities diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index f7c879cf10f89eaeb41a0f40787bd2c98d8d3f31..733158b6f2c2bd03fbe798562ff7bc33280548dc 100644 +index 50ac10a04f903234077e049e4f7f689c39ac9129..7118366a79af0496e5ded6b2a3f45b43b22b7a90 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1191,6 +1191,18 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1202,6 +1202,18 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return Pose.values()[this.getHandle().getPose().ordinal()]; } diff --git a/patches/server/0918-Improve-logging-and-errors.patch b/patches/server/0915-Improve-logging-and-errors.patch index ce2f62a657..2449e45f3d 100644 --- a/patches/server/0918-Improve-logging-and-errors.patch +++ b/patches/server/0915-Improve-logging-and-errors.patch @@ -22,7 +22,7 @@ index f6e423a76d4c9cf639f1d44af80d33cf3072f6b5..135fc81414446f24c3adad71f5199c78 Properties properties; Properties properties1; diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 1f6a0ec6e42906466aa63fe81f2d651b8512e837..0d998395b65be269c2b5b58acd1b2b46408f8f8e 100644 +index 479c252ae715a6f12f542a6568aa88192e2c3ca4..456f7b83fddfb92d9505ffd6ed46c6b6482bab83 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -3588,7 +3588,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -52,10 +52,10 @@ index 0232c29d96e1021a9f5a9678996993dc55fe7254..8ad8ad1189d7cdb58caaa39c482d3268 set.add(string); } else { diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java -index 080cca90f15d90249b7a38f33286ae2f735ba7d9..2677e21d8239bf0361a3bc5c9a50c328e54d70f6 100644 +index 9e108b40ab8668837e5f03cf86e3d13b8378eb34..a8ca6b023ad3fc4a81195a692da435b4e5acf012 100644 --- a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java +++ b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java -@@ -44,6 +44,7 @@ import org.bukkit.material.MaterialData; +@@ -45,6 +45,7 @@ import org.bukkit.material.MaterialData; */ @Deprecated public final class CraftLegacy { @@ -63,7 +63,7 @@ index 080cca90f15d90249b7a38f33286ae2f735ba7d9..2677e21d8239bf0361a3bc5c9a50c328 private static final Map<Byte, Material> SPAWN_EGGS = new HashMap<>(); private static final Set<String> whitelistedStates = new HashSet<>(Arrays.asList("explode", "check_decay", "decayable", "facing")); -@@ -255,7 +256,7 @@ public final class CraftLegacy { +@@ -256,7 +257,7 @@ public final class CraftLegacy { } static { diff --git a/patches/server/0919-Improve-PortalEvents.patch b/patches/server/0916-Improve-PortalEvents.patch index aa5fbc2763..aa5fbc2763 100644 --- a/patches/server/0919-Improve-PortalEvents.patch +++ b/patches/server/0916-Improve-PortalEvents.patch diff --git a/patches/server/0920-Add-config-option-for-spider-worldborder-climbing.patch b/patches/server/0917-Add-config-option-for-spider-worldborder-climbing.patch index 38b52c6506..38b52c6506 100644 --- a/patches/server/0920-Add-config-option-for-spider-worldborder-climbing.patch +++ b/patches/server/0917-Add-config-option-for-spider-worldborder-climbing.patch diff --git a/patches/server/0921-Add-missing-SpigotConfig-logCommands-check.patch b/patches/server/0918-Add-missing-SpigotConfig-logCommands-check.patch index 8ecc1a22e8..3fa5fc3dd4 100644 --- a/patches/server/0921-Add-missing-SpigotConfig-logCommands-check.patch +++ b/patches/server/0918-Add-missing-SpigotConfig-logCommands-check.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add missing SpigotConfig logCommands check diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 0d998395b65be269c2b5b58acd1b2b46408f8f8e..2232139c2dc183fe9827ed6c276a4ed0f6ef3fd9 100644 +index 456f7b83fddfb92d9505ffd6ed46c6b6482bab83..5789aee191b122c1d24426e91f0f13b1f6bea1b6 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2257,7 +2257,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic diff --git a/patches/server/0922-Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch b/patches/server/0919-Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch index 04dbb4d045..21bf1f06fa 100644 --- a/patches/server/0922-Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch +++ b/patches/server/0919-Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix NPE on Allay#stopDancing while not dancing diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAllay.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAllay.java -index 38b060f2395df1803a896be8fb2dbc7510e92832..debccfa7cb5517a877c06b13468db57534ace77e 100644 +index 28bb2ec3cec4748f5170f7a79596452d29b29824..e0b8c62b0db9ccad21ff0cbf07b876e7c015994c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAllay.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAllay.java -@@ -84,7 +84,7 @@ public class CraftAllay extends CraftCreature implements org.bukkit.entity.Allay +@@ -78,7 +78,7 @@ public class CraftAllay extends CraftCreature implements org.bukkit.entity.Allay public void stopDancing() { this.getHandle().forceDancing = false; this.getHandle().jukeboxPos = null; diff --git a/patches/server/0923-Flying-Fall-Damage.patch b/patches/server/0920-Flying-Fall-Damage.patch index 3ed95d5d3f..32e25b9a0a 100644 --- a/patches/server/0923-Flying-Fall-Damage.patch +++ b/patches/server/0920-Flying-Fall-Damage.patch @@ -26,10 +26,10 @@ index 53487f0a4fe672298c3b83d24a2a603641afcde8..58152160d609d0e9d105153aeb166a56 } else { if (fallDistance >= 2.0F) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c1d8535564446d297238a962cc0956f75a314e7b..3d447541b733aa6cefc29c49d551b83642bc1f2a 100644 +index 6813e7c001bb3f5a17c0ef83a83a5551cb11cfe1..f46a829bd9fe3bf94a5c430b5ffe37034ba8f5df 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2304,6 +2304,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2321,6 +2321,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().onUpdateAbilities(); } diff --git a/patches/server/0924-Add-exploded-block-state-to-BlockExplodeEvent.patch b/patches/server/0921-Add-exploded-block-state-to-BlockExplodeEvent.patch index a968490b2b..18ff6dc110 100644 --- a/patches/server/0924-Add-exploded-block-state-to-BlockExplodeEvent.patch +++ b/patches/server/0921-Add-exploded-block-state-to-BlockExplodeEvent.patch @@ -112,7 +112,7 @@ index b9903c29bdea8d1e3b6fce0e97be6bd9493cfdf4..2ed78cf83c0ae66a6ddba1ff307da89a public static boolean canSetSpawn(Level world) { diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java -index da4609caecc8183d02c301c7cedbca52ed39323f..716021520c228b5bbced525b751f5d4126d882eb 100644 +index 731f2b01799ccb6cebb1a30e3eccf5df11392f99..1642e13874bb294e548994b59a45ce8238110d45 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java @@ -273,6 +273,12 @@ public final class CraftBlockStates { diff --git a/patches/server/0925-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch b/patches/server/0922-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch index 5f8840b205..5f8840b205 100644 --- a/patches/server/0925-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch +++ b/patches/server/0922-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch diff --git a/patches/server/0926-config-for-disabling-entity-tag-tags.patch b/patches/server/0923-config-for-disabling-entity-tag-tags.patch index e7680c986a..e7680c986a 100644 --- a/patches/server/0926-config-for-disabling-entity-tag-tags.patch +++ b/patches/server/0923-config-for-disabling-entity-tag-tags.patch diff --git a/patches/server/0927-Use-single-player-info-update-packet-on-join.patch b/patches/server/0924-Use-single-player-info-update-packet-on-join.patch index 222434b107..f962908fe4 100644 --- a/patches/server/0927-Use-single-player-info-update-packet-on-join.patch +++ b/patches/server/0924-Use-single-player-info-update-packet-on-join.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Use single player info update packet on join diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 2232139c2dc183fe9827ed6c276a4ed0f6ef3fd9..ad7b15eb0a4907d3ef02e4bd57ff4d482a278099 100644 +index 5789aee191b122c1d24426e91f0f13b1f6bea1b6..c0bb5da1426257e8726583c20abc173755b842a3 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -3603,7 +3603,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic diff --git a/patches/server/0928-Correctly-shrink-items-during-EntityResurrectEvent.patch b/patches/server/0925-Correctly-shrink-items-during-EntityResurrectEvent.patch index 48e1f8b1ec..48e1f8b1ec 100644 --- a/patches/server/0928-Correctly-shrink-items-during-EntityResurrectEvent.patch +++ b/patches/server/0925-Correctly-shrink-items-during-EntityResurrectEvent.patch diff --git a/patches/server/0929-Win-Screen-API.patch b/patches/server/0926-Win-Screen-API.patch index 0fec33ced7..82e2a1335c 100644 --- a/patches/server/0929-Win-Screen-API.patch +++ b/patches/server/0926-Win-Screen-API.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Win Screen API public net.minecraft.server.level.ServerPlayer seenCredits diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 3d447541b733aa6cefc29c49d551b83642bc1f2a..3643c7f434d8aa66633311ccb77ba4d035e8d337 100644 +index f46a829bd9fe3bf94a5c430b5ffe37034ba8f5df..61970a9f3bf27f0cf5a40c2f437706e335f49425 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1206,6 +1206,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1198,6 +1198,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().connection.send(packet); } diff --git a/patches/server/0930-Remove-CraftItemStack-setAmount-null-assignment.patch b/patches/server/0927-Remove-CraftItemStack-setAmount-null-assignment.patch index f6cf642638..108c5223b1 100644 --- a/patches/server/0930-Remove-CraftItemStack-setAmount-null-assignment.patch +++ b/patches/server/0927-Remove-CraftItemStack-setAmount-null-assignment.patch @@ -16,7 +16,7 @@ with less than zero amounts, so this code doesn't create a problem with operations on the vanilla ItemStack. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index d6b9897dcb4715decd4dd0b1b96995e25d789482..8657736cdfe2d5d2a1c0851ca54dd26ce17e0a83 100644 +index 37819199655d03810f9f4c48b242798a43cbc06f..9952a41c8c3cc0fc363d45ebe1d04c66a1677b27 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -147,7 +147,7 @@ public final class CraftItemStack extends ItemStack { diff --git a/patches/server/0931-Fix-force-opening-enchantment-tables.patch b/patches/server/0928-Fix-force-opening-enchantment-tables.patch index 97bfc2c883..7578328f54 100644 --- a/patches/server/0931-Fix-force-opening-enchantment-tables.patch +++ b/patches/server/0928-Fix-force-opening-enchantment-tables.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix force-opening enchantment tables diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 35f79f34b86dbf6d592842883f53f83e07f95f93..bca41901e2a44458dd9f53c2ab7181d86de54e9e 100644 +index e29f515c9840a8a125da0cbf021205b13197db17..7070090646f42d513d7eb716bbd0dc94243ecd0a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -402,7 +402,18 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -404,7 +404,18 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { // If there isn't an enchant table we can force create one, won't be very useful though. BlockPos pos = CraftLocation.toBlockPosition(location); diff --git a/patches/server/0932-Add-Entity-Body-Yaw-API.patch b/patches/server/0929-Add-Entity-Body-Yaw-API.patch index 6381bc95be..824af42d6b 100644 --- a/patches/server/0932-Add-Entity-Body-Yaw-API.patch +++ b/patches/server/0929-Add-Entity-Body-Yaw-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Entity Body Yaw API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 40c80ba7fa6e0505c23e643acbc87fd03b69e208..7880631fe8a4b06f29ef69ab850129737a99521b 100644 +index eb61197da44a84a60cd59bb518079e4c202e1188..d958751fa602b2f3c3d834398c4b36931a46b9c5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -1029,6 +1029,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -1027,6 +1027,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { this.damageItemStack0(this.getHandle().getItemBySlot(nmsSlot), amount, nmsSlot); } diff --git a/patches/server/0933-Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch b/patches/server/0930-Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch index efaf1a6e90..efaf1a6e90 100644 --- a/patches/server/0933-Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch +++ b/patches/server/0930-Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch diff --git a/patches/server/0934-Update-the-flag-when-a-captured-block-state-is-outda.patch b/patches/server/0931-Update-the-flag-when-a-captured-block-state-is-outda.patch index 097c2e3932..097c2e3932 100644 --- a/patches/server/0934-Update-the-flag-when-a-captured-block-state-is-outda.patch +++ b/patches/server/0931-Update-the-flag-when-a-captured-block-state-is-outda.patch diff --git a/patches/server/0935-Add-EntityFertilizeEggEvent.patch b/patches/server/0932-Add-EntityFertilizeEggEvent.patch index 1d6a8aeb2c..db16e11568 100644 --- a/patches/server/0935-Add-EntityFertilizeEggEvent.patch +++ b/patches/server/0932-Add-EntityFertilizeEggEvent.patch @@ -69,10 +69,10 @@ index c0f19138c6a00ce6ae837c972ae4af522ddd2895..a6d98f64910c816a5c11867d12698f5c world.addFreshEntity(entityitem); } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 22ebf307641f9aa7231df8607bb859785be60f7a..5cc8d5403058638ddecbed08059ecd96257f9dcb 100644 +index f90e0c626e5fa944ae22034d5712d10abec67e46..f8f221705a1fab5dbb20ebd4c972e37d96038e4a 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1983,4 +1983,29 @@ public class CraftEventFactory { +@@ -1972,4 +1972,29 @@ public class CraftEventFactory { return event.callEvent(); } // Paper end diff --git a/patches/server/0936-Fix-HumanEntity-drop-not-updating-the-client-inv.patch b/patches/server/0933-Fix-HumanEntity-drop-not-updating-the-client-inv.patch index 2e74734a41..a842c9954f 100644 --- a/patches/server/0936-Fix-HumanEntity-drop-not-updating-the-client-inv.patch +++ b/patches/server/0933-Fix-HumanEntity-drop-not-updating-the-client-inv.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Fix HumanEntity#drop not updating the client inv public net.minecraft.server.level.ServerPlayer containerSynchronizer diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index bca41901e2a44458dd9f53c2ab7181d86de54e9e..0f3e696582cd288357598490e8af0131ab30bdfc 100644 +index 7070090646f42d513d7eb716bbd0dc94243ecd0a..dd3cfaf93c18cd3aa600c22109faf103223fb9c7 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -755,8 +755,15 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -754,8 +754,15 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { // Paper end @Override public boolean dropItem(boolean dropAll) { diff --git a/patches/server/0937-Add-CompostItemEvent-and-EntityCompostItemEvent.patch b/patches/server/0934-Add-CompostItemEvent-and-EntityCompostItemEvent.patch index c09b36b849..c09b36b849 100644 --- a/patches/server/0937-Add-CompostItemEvent-and-EntityCompostItemEvent.patch +++ b/patches/server/0934-Add-CompostItemEvent-and-EntityCompostItemEvent.patch diff --git a/patches/server/0938-Correctly-handle-ArmorStand-invisibility.patch b/patches/server/0935-Correctly-handle-ArmorStand-invisibility.patch index 103ddcbb11..fec2b2ac08 100644 --- a/patches/server/0938-Correctly-handle-ArmorStand-invisibility.patch +++ b/patches/server/0935-Correctly-handle-ArmorStand-invisibility.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Correctly handle ArmorStand invisibility diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -index f80cafe3544c7e6c3c29073ba6539783adf6666c..17d08d2c90047ebfc4098b087be091b83111a40f 100644 +index 273f3c029f878c8a30e4f0911d79195c023d3442..dc26be80f2c1f058451c0d446165bc78a0ff8c47 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -@@ -158,6 +158,14 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { +@@ -152,6 +152,14 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { this.getHandle().noPhysics = !gravity; } diff --git a/patches/server/0939-Fix-advancement-triggers-for-entity-damage.patch b/patches/server/0936-Fix-advancement-triggers-for-entity-damage.patch index 549fd4f631..549fd4f631 100644 --- a/patches/server/0939-Fix-advancement-triggers-for-entity-damage.patch +++ b/patches/server/0936-Fix-advancement-triggers-for-entity-damage.patch diff --git a/patches/server/0940-Fix-text-display-error-on-spawn.patch b/patches/server/0937-Fix-text-display-error-on-spawn.patch index cb6ccd7e5e..cb6ccd7e5e 100644 --- a/patches/server/0940-Fix-text-display-error-on-spawn.patch +++ b/patches/server/0937-Fix-text-display-error-on-spawn.patch diff --git a/patches/server/0941-Fix-certain-inventories-returning-null-Locations.patch b/patches/server/0938-Fix-certain-inventories-returning-null-Locations.patch index e69fe4eb74..e69fe4eb74 100644 --- a/patches/server/0941-Fix-certain-inventories-returning-null-Locations.patch +++ b/patches/server/0938-Fix-certain-inventories-returning-null-Locations.patch diff --git a/patches/server/0942-Add-Shearable-API.patch b/patches/server/0939-Add-Shearable-API.patch index 950ecc2beb..7fe688ee70 100644 --- a/patches/server/0942-Add-Shearable-API.patch +++ b/patches/server/0939-Add-Shearable-API.patch @@ -32,10 +32,10 @@ index 0000000000000000000000000000000000000000..bcf254e3c81cf1e401bddc850fb24ad2 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java -index 20eaa3424428b8b30fd15591b660983cb7fc4375..4a6aae106de5eeeb80c078c5a167ef0484b13929 100644 +index 3e0049c2442c5941e02da0b0fb643784746cb2a1..1efc208dbb00b693de0c1d883e90b310cbf253e7 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java -@@ -6,7 +6,7 @@ import org.bukkit.entity.EntityType; +@@ -5,7 +5,7 @@ import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.MushroomCow; import org.bukkit.entity.MushroomCow.Variant; @@ -45,11 +45,11 @@ index 20eaa3424428b8b30fd15591b660983cb7fc4375..4a6aae106de5eeeb80c078c5a167ef04 super(server, entity); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java -index ca8e35fbf04a54d60c3612f74be0b5fbf2ab7a56..81ccb4bde315c42409a0c04883f5cb4551398308 100644 +index c83f16868571ab4724201e9369ab8d90d0e280c5..19e8fc7fa6037b063bc1809c85c703996cd9b5ac 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java -@@ -5,7 +5,7 @@ import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.entity.EntityType; +@@ -4,7 +4,7 @@ import org.bukkit.DyeColor; + import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Sheep; -public class CraftSheep extends CraftAnimals implements Sheep { @@ -58,11 +58,11 @@ index ca8e35fbf04a54d60c3612f74be0b5fbf2ab7a56..81ccb4bde315c42409a0c04883f5cb45 super(server, entity); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java -index 659e2959c5330e4764ea1edc7f8de9f464f9ff52..42b7058d93fab8cbee49dba130734e1df9910096 100644 +index 5d2e0fb911265f1184de5434464378ffba98d379..e4a14cdfeb91a3d32e622d27d612605b1bca08e2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java -@@ -5,7 +5,7 @@ import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.entity.EntityType; +@@ -4,7 +4,7 @@ import net.minecraft.world.entity.animal.SnowGolem; + import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Snowman; -public class CraftSnowman extends CraftGolem implements Snowman, com.destroystokyo.paper.entity.CraftRangedEntity<SnowGolem> { // Paper diff --git a/patches/server/0943-Fix-SpawnEggMeta-get-setSpawnedType.patch b/patches/server/0940-Fix-SpawnEggMeta-get-setSpawnedType.patch index 4c90082c28..5eff519db0 100644 --- a/patches/server/0943-Fix-SpawnEggMeta-get-setSpawnedType.patch +++ b/patches/server/0940-Fix-SpawnEggMeta-get-setSpawnedType.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix SpawnEggMeta#get/setSpawnedType diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java -index 2f65ce5d63ea4ad3a0b1b8fa47efa97b6641ef20..3ab43aab043ae59e541f708c8558ddf9bdd82f84 100644 +index 7899af2b01112a7a8934fdae7c9f3a6854d1daa8..49fea9cea6c3be3be0313c2a1cf49118e95d0698 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java -@@ -216,6 +216,31 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta { +@@ -217,6 +217,31 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta { throw new UnsupportedOperationException("Must change item type to set spawned type"); } diff --git a/patches/server/0944-Fix-chiseled-bookshelf-and-jukebox-setItem-with-air.patch b/patches/server/0941-Fix-chiseled-bookshelf-and-jukebox-setItem-with-air.patch index 9f3b11aee1..3706154e05 100644 --- a/patches/server/0944-Fix-chiseled-bookshelf-and-jukebox-setItem-with-air.patch +++ b/patches/server/0941-Fix-chiseled-bookshelf-and-jukebox-setItem-with-air.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix chiseled bookshelf and jukebox setItem with air diff --git a/src/main/java/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java -index 1f09eaa36b670212f6f02569de3312ad0382493e..4fb5328855fe0700fbc997b9801ef2e1c14c8c8f 100644 +index bf39b8b061dd12d33217d80a4620e13ec921fe98..fd8a38dc031621b4e1bfb74a4cdf4654c5cd2b0a 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java @@ -147,7 +147,7 @@ public class ChiseledBookShelfBlockEntity extends BlockEntity implements Contain diff --git a/patches/server/0945-Optimize-Hoppers.patch b/patches/server/0942-Optimize-Hoppers.patch index 18820e3768..18820e3768 100644 --- a/patches/server/0945-Optimize-Hoppers.patch +++ b/patches/server/0942-Optimize-Hoppers.patch diff --git a/patches/server/0946-Fix-beehives-generating-from-using-bonemeal.patch b/patches/server/0943-Fix-beehives-generating-from-using-bonemeal.patch index df619142e1..b8d9569409 100644 --- a/patches/server/0946-Fix-beehives-generating-from-using-bonemeal.patch +++ b/patches/server/0943-Fix-beehives-generating-from-using-bonemeal.patch @@ -17,7 +17,7 @@ index 90ed64613717e104fc31d7e8d5df964c92119052..50141d426dc93149dc48d876487649aa entityhuman.awardStat(Stats.ITEM_USED.get(item)); // SPIGOT-7236 - award stat } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java -index fb6454cc64ebc549f61ad7d51efb16ef15f8384d..a3d5e319473e2f6316b3ef8edf719296e02d85a1 100644 +index 70b06f2cccb52c243f686616a5e145c057ee4123..9606fadd5e8baab125e5522c06c8f63feb3522b6 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java @@ -25,6 +25,12 @@ public final class CapturedBlockState extends CraftBlockState { @@ -31,7 +31,7 @@ index fb6454cc64ebc549f61ad7d51efb16ef15f8384d..a3d5e319473e2f6316b3ef8edf719296 + public void checkTreeBlockHack() { + // Paper end // SPIGOT-5537: Horrible hack to manually add bees given World.captureTreeGeneration does not support tiles - if (this.treeBlock && getType() == Material.BEE_NEST) { + if (this.treeBlock && getType() == BlockType.BEE_NEST) { WorldGenLevel generatoraccessseed = this.world.getHandle(); @@ -47,7 +53,7 @@ public final class CapturedBlockState extends CraftBlockState { // End copied block diff --git a/patches/server/0947-Fix-api-checking-banned-ips.patch b/patches/server/0944-Fix-api-checking-banned-ips.patch index 08f63f3c08..08f63f3c08 100644 --- a/patches/server/0947-Fix-api-checking-banned-ips.patch +++ b/patches/server/0944-Fix-api-checking-banned-ips.patch diff --git a/patches/server/0948-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch b/patches/server/0945-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch index f4282269d8..f4282269d8 100644 --- a/patches/server/0948-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch +++ b/patches/server/0945-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch diff --git a/patches/server/0949-Treat-sequence-violations-like-they-should-be.patch b/patches/server/0946-Treat-sequence-violations-like-they-should-be.patch index 06d229aac7..16cb47268c 100644 --- a/patches/server/0949-Treat-sequence-violations-like-they-should-be.patch +++ b/patches/server/0946-Treat-sequence-violations-like-they-should-be.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Treat sequence violations like they should be diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index ad7b15eb0a4907d3ef02e4bd57ff4d482a278099..d00d003b29d357fbd80304acc50ca13c9f5393f5 100644 +index c0bb5da1426257e8726583c20abc173755b842a3..cc71cfed227b1e233473e8accc501647aad56b31 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2127,6 +2127,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic diff --git a/patches/server/0950-remove-duplicate-animate-packet-for-records.patch b/patches/server/0947-remove-duplicate-animate-packet-for-records.patch index 0958982027..0958982027 100644 --- a/patches/server/0950-remove-duplicate-animate-packet-for-records.patch +++ b/patches/server/0947-remove-duplicate-animate-packet-for-records.patch diff --git a/patches/server/0951-Prevent-causing-expired-keys-from-impacting-new-join.patch b/patches/server/0948-Prevent-causing-expired-keys-from-impacting-new-join.patch index 85153d77d0..66e61090a6 100644 --- a/patches/server/0951-Prevent-causing-expired-keys-from-impacting-new-join.patch +++ b/patches/server/0948-Prevent-causing-expired-keys-from-impacting-new-join.patch @@ -24,7 +24,7 @@ index 23e0e6937e28f09271a4ec7c35e0076a576cf3d3..4aa8b483841028fbcc43f9ed47730881 UPDATE_GAME_MODE((serialized, buf) -> { serialized.gameMode = GameType.byId(buf.readVarInt()); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index d00d003b29d357fbd80304acc50ca13c9f5393f5..d9c2d06ae24dcf80a497e75f4c7f63d401b77f9b 100644 +index cc71cfed227b1e233473e8accc501647aad56b31..40c31e562abc6572809fd38be7c909ef9d8ba0f1 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -296,6 +296,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic diff --git a/patches/server/0952-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch b/patches/server/0949-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch index 6671aa6357..e2af394520 100644 --- a/patches/server/0952-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch +++ b/patches/server/0949-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Prevent GameEvents being fired from unloaded chunks diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 37873ea2876a89ac8ea702ab0a71171e044852bc..18aac3da3c88f33b1a71a5920a8daa27e9723913 100644 +index 0660c2f968a6e3d66d4fe9fd18ecac72d328f000..129c0c1585a04d89d2dfbb7c26e5ea388306577b 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1782,6 +1782,11 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0953-Use-array-for-gamerule-storage.patch b/patches/server/0950-Use-array-for-gamerule-storage.patch index 52052561af..52052561af 100644 --- a/patches/server/0953-Use-array-for-gamerule-storage.patch +++ b/patches/server/0950-Use-array-for-gamerule-storage.patch diff --git a/patches/server/0954-Fix-a-couple-of-upstream-bed-issues.patch b/patches/server/0951-Fix-a-couple-of-upstream-bed-issues.patch index f4a4393fa2..f4a4393fa2 100644 --- a/patches/server/0954-Fix-a-couple-of-upstream-bed-issues.patch +++ b/patches/server/0951-Fix-a-couple-of-upstream-bed-issues.patch diff --git a/patches/server/0955-Fix-demo-flag-not-enabling-demo-mode.patch b/patches/server/0952-Fix-demo-flag-not-enabling-demo-mode.patch index 195413f40e..195413f40e 100644 --- a/patches/server/0955-Fix-demo-flag-not-enabling-demo-mode.patch +++ b/patches/server/0952-Fix-demo-flag-not-enabling-demo-mode.patch diff --git a/patches/server/0956-Add-Mob-Experience-reward-API.patch b/patches/server/0953-Add-Mob-Experience-reward-API.patch index 3c07d5e971..47d2f879f2 100644 --- a/patches/server/0956-Add-Mob-Experience-reward-API.patch +++ b/patches/server/0953-Add-Mob-Experience-reward-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add Mob Experience reward API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -index 620d918e302a00d5a6640648e3096988d15535a0..18b9b0dc70f6872a9d71c120bcd2edca531b0ac4 100644 +index c526304d31fd9be1b3c895187f7d9fc45edf4866..153e4c88c168097eb4a78650e7c9c120bec202a3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java @@ -158,4 +158,11 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { diff --git a/patches/server/0957-Break-redstone-on-top-of-trap-doors-early.patch b/patches/server/0954-Break-redstone-on-top-of-trap-doors-early.patch index 461e4c40ca..461e4c40ca 100644 --- a/patches/server/0957-Break-redstone-on-top-of-trap-doors-early.patch +++ b/patches/server/0954-Break-redstone-on-top-of-trap-doors-early.patch diff --git a/patches/server/0958-Fix-DamageCause-for-Falling-Blocks.patch b/patches/server/0955-Fix-DamageCause-for-Falling-Blocks.patch index 962ecdd8fa..3de1130387 100644 --- a/patches/server/0958-Fix-DamageCause-for-Falling-Blocks.patch +++ b/patches/server/0955-Fix-DamageCause-for-Falling-Blocks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix DamageCause for Falling Blocks diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 5cc8d5403058638ddecbed08059ecd96257f9dcb..0b84496161964bf84bfc08d687592b20ed06a25f 100644 +index f8f221705a1fab5dbb20ebd4c972e37d96038e4a..8b923b85723f0c7c4035caf8bcf995062535b8e8 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1030,6 +1030,11 @@ public class CraftEventFactory { +@@ -1036,6 +1036,11 @@ public class CraftEventFactory { } else if (source.is(DamageTypes.SONIC_BOOM)) { cause = DamageCause.SONIC_BOOM; } diff --git a/patches/server/0959-Avoid-Lazy-Initialization-for-Enum-Fields.patch b/patches/server/0956-Avoid-Lazy-Initialization-for-Enum-Fields.patch index 809f5d1710..809f5d1710 100644 --- a/patches/server/0959-Avoid-Lazy-Initialization-for-Enum-Fields.patch +++ b/patches/server/0956-Avoid-Lazy-Initialization-for-Enum-Fields.patch diff --git a/patches/server/0960-More-accurate-isInOpenWater-impl.patch b/patches/server/0957-More-accurate-isInOpenWater-impl.patch index 5d9d32149a..c782627938 100644 --- a/patches/server/0960-More-accurate-isInOpenWater-impl.patch +++ b/patches/server/0957-More-accurate-isInOpenWater-impl.patch @@ -13,10 +13,10 @@ public net.minecraft.world.entity.projectile.FishingHook calculateOpenWater(Lnet public net.minecraft.world.entity.projectile.FishingHook outOfWaterTime diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java -index ce934b945b85a4c3d0f575eb090bbf90c4b3ca9f..41e8167766383a6fcb1e9fb78933d74784caddbb 100644 +index 9de72665c947bb00547cdd7c41a890711f5b2afc..96b6e537ec4493a0cdd98ccfe7816f7ffb69c7dd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java -@@ -170,7 +170,7 @@ public class CraftFishHook extends CraftProjectile implements FishHook { +@@ -164,7 +164,7 @@ public class CraftFishHook extends CraftProjectile implements FishHook { @Override public boolean isInOpenWater() { diff --git a/patches/server/0961-Fix-concurrenct-access-to-lookups-field-in-RegistryO.patch b/patches/server/0958-Fix-concurrenct-access-to-lookups-field-in-RegistryO.patch index 2127f28b00..2127f28b00 100644 --- a/patches/server/0961-Fix-concurrenct-access-to-lookups-field-in-RegistryO.patch +++ b/patches/server/0958-Fix-concurrenct-access-to-lookups-field-in-RegistryO.patch diff --git a/patches/server/0962-Optimise-recalcBlockCounts-for-empty-sections.patch b/patches/server/0959-Optimise-recalcBlockCounts-for-empty-sections.patch index 2f061397e0..2f061397e0 100644 --- a/patches/server/0962-Optimise-recalcBlockCounts-for-empty-sections.patch +++ b/patches/server/0959-Optimise-recalcBlockCounts-for-empty-sections.patch diff --git a/patches/server/0963-Fix-destroying-beehive-without-any-players-nearby-th.patch b/patches/server/0960-Fix-destroying-beehive-without-any-players-nearby-th.patch index b166366059..b166366059 100644 --- a/patches/server/0963-Fix-destroying-beehive-without-any-players-nearby-th.patch +++ b/patches/server/0960-Fix-destroying-beehive-without-any-players-nearby-th.patch diff --git a/patches/server/0964-Expand-PlayerItemMendEvent.patch b/patches/server/0961-Expand-PlayerItemMendEvent.patch index 42e104169f..67e6ef8368 100644 --- a/patches/server/0964-Expand-PlayerItemMendEvent.patch +++ b/patches/server/0961-Expand-PlayerItemMendEvent.patch @@ -33,10 +33,10 @@ index 8d8fe55a05eea237a8af99ed15ab16d6167daa77..eca634792d2a7cc649675e3394e84dba return k > 0 ? this.repairPlayerItems(player, k) : 0; } else { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 3643c7f434d8aa66633311ccb77ba4d035e8d337..59c00045ec903a635966f16cf33e5b4110262953 100644 +index 61970a9f3bf27f0cf5a40c2f437706e335f49425..9acf522337db5b73e07f83ed77d4b05dfef2d954 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1674,11 +1674,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1696,11 +1696,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { orb.setPosRaw(handle.getX(), handle.getY(), handle.getZ()); int i = Math.min(orb.xpToDurability(amount), itemstack.getDamageValue()); @@ -51,10 +51,10 @@ index 3643c7f434d8aa66633311ccb77ba4d035e8d337..59c00045ec903a635966f16cf33e5b41 } } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 0b84496161964bf84bfc08d687592b20ed06a25f..32fe1e498ee988566213bfcf56bf98c92a3c9871 100644 +index 8b923b85723f0c7c4035caf8bcf995062535b8e8..f4e9731653ed59d7f654dedf0e842e5bfeeda647 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1266,10 +1266,10 @@ public class CraftEventFactory { +@@ -1272,10 +1272,10 @@ public class CraftEventFactory { return event; } diff --git a/patches/server/0965-Refresh-ProjectileSource-for-projectiles.patch b/patches/server/0962-Refresh-ProjectileSource-for-projectiles.patch index e666028592..e666028592 100644 --- a/patches/server/0965-Refresh-ProjectileSource-for-projectiles.patch +++ b/patches/server/0962-Refresh-ProjectileSource-for-projectiles.patch diff --git a/patches/server/0966-Add-transient-modifier-API.patch b/patches/server/0963-Add-transient-modifier-API.patch index e3b704e242..e3b704e242 100644 --- a/patches/server/0966-Add-transient-modifier-API.patch +++ b/patches/server/0963-Add-transient-modifier-API.patch diff --git a/patches/server/0967-Fix-block-place-logic.patch b/patches/server/0964-Fix-block-place-logic.patch index 57ecc3dabb..57ecc3dabb 100644 --- a/patches/server/0967-Fix-block-place-logic.patch +++ b/patches/server/0964-Fix-block-place-logic.patch diff --git a/patches/server/0968-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch b/patches/server/0965-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch index 0176a6c1b6..0176a6c1b6 100644 --- a/patches/server/0968-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch +++ b/patches/server/0965-Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch diff --git a/patches/server/0969-Ignore-inline-definitions-of-trim-material-pattern.patch b/patches/server/0966-Ignore-inline-definitions-of-trim-material-pattern.patch index 9b113e0bfe..7d18892d59 100644 --- a/patches/server/0969-Ignore-inline-definitions-of-trim-material-pattern.patch +++ b/patches/server/0966-Ignore-inline-definitions-of-trim-material-pattern.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Ignore inline definitions of trim material & pattern diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmor.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmor.java -index 742d4039392403a75882f83bb2f64453898adf76..c92981aedebe934cefa1c96a0328fb91fe17acbc 100644 +index 9b9f4b4e7fd1381dadc2db41836821484d90aaac..70b292e3dd9b62be5fb8415bc626b17e81ccb3c9 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmor.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmor.java @@ -67,7 +67,7 @@ public class CraftMetaArmor extends CraftMetaItem implements ArmorMeta { diff --git a/patches/server/0970-Call-BlockGrowEvent-for-the-pitcher-crop.patch b/patches/server/0967-Call-BlockGrowEvent-for-the-pitcher-crop.patch index 98e7c69d60..98e7c69d60 100644 --- a/patches/server/0970-Call-BlockGrowEvent-for-the-pitcher-crop.patch +++ b/patches/server/0967-Call-BlockGrowEvent-for-the-pitcher-crop.patch diff --git a/patches/server/0971-Add-API-for-waxed-signs.patch b/patches/server/0968-Add-API-for-waxed-signs.patch index a2329c0a7a..a2329c0a7a 100644 --- a/patches/server/0971-Add-API-for-waxed-signs.patch +++ b/patches/server/0968-Add-API-for-waxed-signs.patch diff --git a/patches/server/0972-Properly-remove-the-experimental-smithing-inventory-.patch b/patches/server/0969-Properly-remove-the-experimental-smithing-inventory-.patch index 73dd186dd3..cc7e8f3729 100644 --- a/patches/server/0972-Properly-remove-the-experimental-smithing-inventory-.patch +++ b/patches/server/0969-Properly-remove-the-experimental-smithing-inventory-.patch @@ -46,10 +46,10 @@ index bdaa739aa18a95894a165e9333a3e9d596fd7dc3..3075ba5f6d66316f27e618d8b279252e this.setupSmithing(top, bottom); // SPIGOT-6783 - manually set up slots so we can use the delegated inventory and not the automatically created one break; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java -index bfac13ec6c316caa65db4a51b77f0a7045ad88ff..df254c42b73cdb56f71781473cbf9d0f28dcfb08 100644 +index 9156b0f650891d1d231df8cfc4a8ba2054c3dba7..eeb3c990d3e6c35e05bafb397d0edd79466f70ed 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java -@@ -536,8 +536,7 @@ public class CraftInventory implements Inventory { +@@ -529,8 +529,7 @@ public class CraftInventory implements Inventory { return InventoryType.COMPOSTER; } else if (this.inventory instanceof JukeboxBlockEntity) { return InventoryType.JUKEBOX; diff --git a/patches/server/0973-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch b/patches/server/0970-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch index 9df3133e61..cdcbe5f2a6 100644 --- a/patches/server/0973-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch +++ b/patches/server/0970-Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't enforce icanhasbukkit default if alias block exists diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 9f8c5ceb8485b14a84f2a7b2ffc8192be5c6bdfd..59984cb8ba9ffb66b59a2c907e4f04b5a51ea8ed 100644 +index a29320e9c4f139afce472da7190a3798a61e9506..db59e9c82d6ab0e9822220f22515bf869a773e23 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -351,7 +351,11 @@ public final class CraftServer implements Server { +@@ -346,7 +346,11 @@ public final class CraftServer implements Server { } this.commandsConfiguration = YamlConfiguration.loadConfiguration(this.getCommandsConfigFile()); this.commandsConfiguration.options().copyDefaults(true); diff --git a/patches/server/0974-fix-MapLike-spam-for-missing-key-selector.patch b/patches/server/0971-fix-MapLike-spam-for-missing-key-selector.patch index 0dcf015d42..2212175e32 100644 --- a/patches/server/0974-fix-MapLike-spam-for-missing-key-selector.patch +++ b/patches/server/0971-fix-MapLike-spam-for-missing-key-selector.patch @@ -5,10 +5,10 @@ Subject: [PATCH] fix MapLike spam for missing key 'selector' diff --git a/src/main/java/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java b/src/main/java/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java -index 405709bed99bb0ddd3a746f0f7815b59394c1b81..846f0c18c348e30fb5ce73e0efafa30c1b121fec 100644 +index cbb827833d6a1c3865ed51ee3a641b1a77332bbf..a48fad59ccd0a49dea1a54729cf592ff5f01eefa 100644 --- a/src/main/java/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java +++ b/src/main/java/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java -@@ -351,7 +351,7 @@ public interface VibrationSystem { +@@ -349,7 +349,7 @@ public interface VibrationSystem { public static Codec<VibrationSystem.Data> CODEC = RecordCodecBuilder.create((instance) -> { return instance.group(VibrationInfo.CODEC.optionalFieldOf("event").forGetter((vibrationsystem_a) -> { return Optional.ofNullable(vibrationsystem_a.currentVibration); diff --git a/patches/server/0975-Fix-sniffer-removeExploredLocation.patch b/patches/server/0972-Fix-sniffer-removeExploredLocation.patch index 7e07747224..ca06cc2a5e 100644 --- a/patches/server/0975-Fix-sniffer-removeExploredLocation.patch +++ b/patches/server/0972-Fix-sniffer-removeExploredLocation.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix sniffer removeExploredLocation Add support to remove explored location in different world diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSniffer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSniffer.java -index ca3bffd07e0e8f3b2409917cf561d4755c8fba21..e9e8ee8c87285705366d54c23a59c136c612aaff 100644 +index 1c8b67de03aefe91bf80782fb14fb629a458ecc3..01328768ef2baba2aa7fea7e10b0eb9783497f4b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSniffer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSniffer.java -@@ -40,12 +40,13 @@ public class CraftSniffer extends CraftAnimals implements Sniffer { +@@ -34,12 +34,13 @@ public class CraftSniffer extends CraftAnimals implements Sniffer { @Override public void removeExploredLocation(Location location) { Preconditions.checkArgument(location != null, "location cannot be null"); diff --git a/patches/server/0976-Add-method-to-remove-all-active-potion-effects.patch b/patches/server/0973-Add-method-to-remove-all-active-potion-effects.patch index c1e651e367..4208ba8a11 100644 --- a/patches/server/0976-Add-method-to-remove-all-active-potion-effects.patch +++ b/patches/server/0973-Add-method-to-remove-all-active-potion-effects.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add method to remove all active potion effects diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 7880631fe8a4b06f29ef69ab850129737a99521b..19212795df4024cfb2b9f56e1efcd4c9f20d1d83 100644 +index d958751fa602b2f3c3d834398c4b36931a46b9c5..74c8725394689ca314a7e05803961fe250b25503 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -490,6 +490,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -493,6 +493,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { return effects; } diff --git a/patches/server/0974-fix-some-weird-issue.patch b/patches/server/0974-fix-some-weird-issue.patch new file mode 100644 index 0000000000..5b33f09f93 --- /dev/null +++ b/patches/server/0974-fix-some-weird-issue.patch @@ -0,0 +1,48 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic <[email protected]> +Date: Mon, 19 Jun 2023 20:17:56 -0700 +Subject: [PATCH] fix some weird issue? + + +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftParticle.java b/src/main/java/org/bukkit/craftbukkit/CraftParticle.java +index 0289c461eb7888cf52a4ef58b96b7dfaaf534afa..114ddc793f20b4e1452e1c152cb34e01e057d237 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftParticle.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftParticle.java +@@ -150,7 +150,7 @@ public abstract class CraftParticle<D> extends Particle<D> { + private static final BiFunction<NamespacedKey, net.minecraft.core.particles.ParticleType<?>, CraftParticle<?>> voidFunction = (name, particle) -> new CraftParticle<>(name, particle, Void.class) { + @Override + public ParticleOptions createParticleParam(Void data) { +- return (SimpleParticleType) CraftParticle.this.getHandle(); ++ return (SimpleParticleType) this.getHandle(); // Paper - TODO some issue? + } + }; + +@@ -166,14 +166,14 @@ public abstract class CraftParticle<D> extends Particle<D> { + BiFunction<NamespacedKey, net.minecraft.core.particles.ParticleType<?>, CraftParticle<?>> itemStackFunction = (name, particle) -> new CraftParticle<>(name, particle, ItemStack.class) { + @Override + public ParticleOptions createParticleParam(ItemStack data) { +- return new ItemParticleOption((net.minecraft.core.particles.ParticleType<ItemParticleOption>) CraftParticle.this.getHandle(), CraftItemStack.asNMSCopy(data)); ++ return new ItemParticleOption((net.minecraft.core.particles.ParticleType<ItemParticleOption>) this.getHandle(), CraftItemStack.asNMSCopy(data)); // Paper - TODO some issue? + } + }; + + BiFunction<NamespacedKey, net.minecraft.core.particles.ParticleType<?>, CraftParticle<?>> blockDataFunction = (name, particle) -> new CraftParticle<>(name, particle, BlockData.class) { + @Override + public ParticleOptions createParticleParam(BlockData data) { +- return new BlockParticleOption((net.minecraft.core.particles.ParticleType<BlockParticleOption>) CraftParticle.this.getHandle(), ((CraftBlockData) data).getState()); ++ return new BlockParticleOption((net.minecraft.core.particles.ParticleType<BlockParticleOption>) this.getHandle(), ((CraftBlockData) data).getState()); // Paper - TODO some issue? + } + }; + +diff --git a/src/main/java/org/bukkit/craftbukkit/tag/CraftEntityTag.java b/src/main/java/org/bukkit/craftbukkit/tag/CraftEntityTag.java +index ecb926ac6497bafd86ebc3c068aa46a29d3c0169..148c4538876d7aaba25ef188da83364a03bfbbf3 100644 +--- a/src/main/java/org/bukkit/craftbukkit/tag/CraftEntityTag.java ++++ b/src/main/java/org/bukkit/craftbukkit/tag/CraftEntityTag.java +@@ -24,6 +24,6 @@ public class CraftEntityTag extends CraftTag<net.minecraft.world.entity.EntityTy + + @Override + public Set<EntityType<?>> getValues() { +- return getHandle().stream().map((nms) -> Registry.ENTITY_TYPE.get(CraftNamespacedKey.fromMinecraft(net.minecraft.world.entity.EntityType.getKey(nms.value())))).filter(Objects::nonNull).collect(Collectors.toUnmodifiableSet()); ++ return getHandle().stream().map((nms) -> (EntityType<?>) Registry.ENTITY_TYPE.get(CraftNamespacedKey.fromMinecraft(net.minecraft.world.entity.EntityType.getKey(nms.value())))).filter(Objects::nonNull).collect(Collectors.toUnmodifiableSet()); // Paper - wtf is this? + } + } diff --git a/scripts/upstreamMerge.sh b/scripts/upstreamMerge.sh index 319a71695d..8e2ed76ca6 100755 --- a/scripts/upstreamMerge.sh +++ b/scripts/upstreamMerge.sh @@ -13,7 +13,7 @@ function getRef { } function update { cd "$workdir/$1" - $gitcmd fetch && $gitcmd clean -fd && $gitcmd reset --hard origin/master + $gitcmd fetch && $gitcmd clean -fd && $gitcmd reset --hard origin/experimental refRemote=$(git rev-parse HEAD) cd ../ $gitcmd add --force $1 diff --git a/work/Bukkit b/work/Bukkit -Subproject be1f33449ea205e494a7bcf2e9322319c616620 +Subproject 6680169e93a66de553b307018679b3f6421a106 diff --git a/work/CraftBukkit b/work/CraftBukkit -Subproject 3b557627cd8274a4a2b16375886c492964db38e +Subproject 8969b32d068e0046bf5ceaacf8754cd6855d629 diff --git a/work/Spigot b/work/Spigot -Subproject c62f4bd99c6f565026bdba8eabb941b0c58a19d +Subproject addcf45f2e8dc36f0f22423edeb5e46f3163d04 |