Compiler issues v2

This commit is contained in:
Bjarne Koll 2024-10-25 13:52:04 +02:00
parent 0f011a31b1
commit 6fb86bb20a
No known key found for this signature in database
GPG Key ID: 27F6CCCF55D2EE62
364 changed files with 151 additions and 165 deletions

View File

@ -8,7 +8,7 @@ Currently the server only supports the English language. To override this,
You must replace the language file embedded in the server jar. 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 diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index d5342258086066d3b9ef404916bad8440f0cf0cd..c92843d0adb438d7a64a5d00ce67b67efd65ca14 100644 index d5342258086066d3b9ef404916bad8440f0cf0cd..333884bc8fe45c66d37a1bbcebc10ea655d2055f 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java --- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -220,4 +220,20 @@ public interface ItemFactory { @@ -220,4 +220,20 @@ public interface ItemFactory {
@ -28,7 +28,7 @@ index d5342258086066d3b9ef404916bad8440f0cf0cd..c92843d0adb438d7a64a5d00ce67b67e
+ * {@link net.kyori.adventure.text.Component#translatable(net.kyori.adventure.translation.Translatable)} instead. + * {@link net.kyori.adventure.text.Component#translatable(net.kyori.adventure.translation.Translatable)} instead.
+ */ + */
+ @Nullable + @Nullable
+ @Deprecated(since = "1.18.1") + @Deprecated(since = "1.18.1", forRemoval = true)
+ String getI18NDisplayName(@Nullable ItemStack item); + String getI18NDisplayName(@Nullable ItemStack item);
+ // Paper end - add getI18NDisplayName + // Paper end - add getI18NDisplayName
} }

View File

@ -7,11 +7,11 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr
to ensure it meets latest minecraft expectations. 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 diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index c92843d0adb438d7a64a5d00ce67b67efd65ca14..3d08beee52f2247db6f6e679206ed6a965fbf9a8 100644 index 333884bc8fe45c66d37a1bbcebc10ea655d2055f..c1ec8efffd5ff2a4dcb1d761be9a431a62284607 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java --- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -236,4 +236,18 @@ public interface ItemFactory { @@ -236,4 +236,18 @@ public interface ItemFactory {
@Deprecated(since = "1.18.1") @Deprecated(since = "1.18.1", forRemoval = true)
String getI18NDisplayName(@Nullable ItemStack item); String getI18NDisplayName(@Nullable ItemStack item);
// Paper end - add getI18NDisplayName // Paper end - add getI18NDisplayName
+ +

View File

@ -1579,7 +1579,7 @@ index ebc14022c9ef9b0b3331ee53e96a32667e4762e0..5c258b6077277575daa5d96349837bdf
public void setTitle(@NotNull String title); public void setTitle(@NotNull String title);
} }
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index 3d08beee52f2247db6f6e679206ed6a965fbf9a8..1b4f9b93860e58762ac28715adad5a67298b06d7 100644 index c1ec8efffd5ff2a4dcb1d761be9a431a62284607..a1d8ef8eda3c0256e8c82b7a01c3e7b11454b250 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java --- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -29,7 +29,7 @@ public interface ItemFactory { @@ -29,7 +29,7 @@ public interface ItemFactory {

View File

@ -5,7 +5,7 @@ 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 diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index 1b4f9b93860e58762ac28715adad5a67298b06d7..96546712f788e091749a1b4eebc6b1d6c3db7814 100644 index a1d8ef8eda3c0256e8c82b7a01c3e7b11454b250..579a9037b656bef9fb65c6da03611e981492074a 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java --- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -250,4 +250,65 @@ public interface ItemFactory { @@ -250,4 +250,65 @@ public interface ItemFactory {

View File

@ -7,7 +7,7 @@ Deprecate upstream's newer and poorly implemented similar
API. API.
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index 96546712f788e091749a1b4eebc6b1d6c3db7814..bd0e55562f1cabef3078573182e0cf9fbc844585 100644 index 579a9037b656bef9fb65c6da03611e981492074a..e1986aea72bb1f1ba2ea76f3ba53f274b6aac899 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java --- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -170,8 +170,11 @@ public interface ItemFactory { @@ -170,8 +170,11 @@ public interface ItemFactory {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add enchantWithLevels with enchantment registry set
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index bd0e55562f1cabef3078573182e0cf9fbc844585..2669d783088b9f63f0edd6d0384c3a307ddccac7 100644 index e1986aea72bb1f1ba2ea76f3ba53f274b6aac899..0a814c1f65afc00034a454e3ff720d26e6c17ecc 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java --- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -338,4 +338,21 @@ public interface ItemFactory { @@ -338,4 +338,21 @@ public interface ItemFactory {

View File

@ -4155,7 +4155,7 @@ index 55945b83a5426b352bad9507cc9e94afb1278032..9ea1537408ff2d790747b6e5a681d917
public boolean isOp() { public boolean isOp() {
return true; return true;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index a3550d84c273c9720491484382a4bc50dc3246a6..2222fd316ec2463f7e40b2673b29fb338b9d6385 100644 index a3550d84c273c9720491484382a4bc50dc3246a6..24631135f90bb74bf829160ed079e152573666a2 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -395,14 +395,40 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -395,14 +395,40 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -4437,10 +4437,10 @@ index a3550d84c273c9720491484382a4bc50dc3246a6..2222fd316ec2463f7e40b2673b29fb33
+ } + }
+ +
+ private net.minecraft.network.chat.ChatType.Bound toHandle(net.kyori.adventure.chat.ChatType.Bound boundChatType) { + private net.minecraft.network.chat.ChatType.Bound toHandle(net.kyori.adventure.chat.ChatType.Bound boundChatType) {
+ net.minecraft.core.Registry<net.minecraft.network.chat.ChatType> chatTypeRegistry = this.getHandle().level().registryAccess().registryOrThrow(net.minecraft.core.registries.Registries.CHAT_TYPE); + net.minecraft.core.Registry<net.minecraft.network.chat.ChatType> chatTypeRegistry = this.getHandle().level().registryAccess().lookupOrThrow(net.minecraft.core.registries.Registries.CHAT_TYPE);
+ +
+ return new net.minecraft.network.chat.ChatType.Bound( + return new net.minecraft.network.chat.ChatType.Bound(
+ chatTypeRegistry.getHolderOrThrow(net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.CHAT_TYPE, io.papermc.paper.adventure.PaperAdventure.asVanilla(boundChatType.type().key()))), + chatTypeRegistry.getOrThrow(net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.CHAT_TYPE, io.papermc.paper.adventure.PaperAdventure.asVanilla(boundChatType.type().key()))),
+ io.papermc.paper.adventure.PaperAdventure.asVanilla(boundChatType.name()), + io.papermc.paper.adventure.PaperAdventure.asVanilla(boundChatType.name()),
+ Optional.ofNullable(io.papermc.paper.adventure.PaperAdventure.asVanilla(boundChatType.target())) + Optional.ofNullable(io.papermc.paper.adventure.PaperAdventure.asVanilla(boundChatType.target()))
+ ); + );
@ -4483,7 +4483,7 @@ index a3550d84c273c9720491484382a4bc50dc3246a6..2222fd316ec2463f7e40b2673b29fb33
+ @Override + @Override
+ public void sendMessage(final net.kyori.adventure.identity.Identity identity, final net.kyori.adventure.text.Component message, final net.kyori.adventure.audience.MessageType type) { + public void sendMessage(final net.kyori.adventure.identity.Identity identity, final net.kyori.adventure.text.Component message, final net.kyori.adventure.audience.MessageType type) {
+ if (getHandle().connection == null) return; + if (getHandle().connection == null) return;
+ final net.minecraft.core.Registry<net.minecraft.network.chat.ChatType> chatTypeRegistry = this.getHandle().level().registryAccess().registryOrThrow(net.minecraft.core.registries.Registries.CHAT_TYPE); + final net.minecraft.core.Registry<net.minecraft.network.chat.ChatType> chatTypeRegistry = this.getHandle().level().registryAccess().lookupOrThrow(net.minecraft.core.registries.Registries.CHAT_TYPE);
+ this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(message, false)); + this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(message, false));
+ } + }
+ +

View File

@ -1807,7 +1807,7 @@ 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 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 2222fd316ec2463f7e40b2673b29fb338b9d6385..1e23ea353a552d156cfddb2f620add11c89abbb0 100644 index 24631135f90bb74bf829160ed079e152573666a2..f7833cd528797ba46b001db5208c29eb11ae2529 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2809,6 +2809,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2809,6 +2809,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -135,7 +135,7 @@ index f689b2ca0ebc15c099f36ebfd14e455bda540296..fb043d67eaa6336fc0b5d62774b8f110
for (Player player : this.players()) { for (Player player : this.players()) {
if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player)) { 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 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 1e23ea353a552d156cfddb2f620add11c89abbb0..da568a74260a7068437681bddf102929e6b8f168 100644 index f7833cd528797ba46b001db5208c29eb11ae2529..2be8dc983d008cb3da597f3aabd5efc0df51f9e8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2452,6 +2452,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2452,6 +2452,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -5,7 +5,7 @@ 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 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index da568a74260a7068437681bddf102929e6b8f168..29990d84d9e3ee67a4766149c09be6d582999173 100644 index 2be8dc983d008cb3da597f3aabd5efc0df51f9e8..5600dce95548ffffa1a338f9c9f6d682d30cf02f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2120,12 +2120,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2120,12 +2120,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -36,7 +36,7 @@ index 4303bde198050cd037f006234d269af406606eff..911ec630c5925b160cc05f99f0d5bb5a
this.server.server.getPluginManager().callEvent(event); this.server.server.getPluginManager().callEvent(event);
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 29990d84d9e3ee67a4766149c09be6d582999173..9409244db73282816e4f7560dd7d73a961f9e1d3 100644 index 5600dce95548ffffa1a338f9c9f6d682d30cf02f..17a5b37a7591274a45a6818144b62b5cd1412a40 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2450,7 +2450,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2450,7 +2450,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -53,7 +53,7 @@ index 9683759c36de3b9d791e56dc1fb993087c1bc37c..3b58cc979c4e2fb5382f0c67ccfaa844
if (this.commandMap.dispatch(sender, commandLine)) { if (this.commandMap.dispatch(sender, commandLine)) {
return true; return true;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 9409244db73282816e4f7560dd7d73a961f9e1d3..60bf3f000bbaa8dac201e868ff46963f45251062 100644 index 17a5b37a7591274a45a6818144b62b5cd1412a40..51bf9e36ec13af09240c329e40391d79f715a021 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -563,7 +563,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -563,7 +563,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Player Tab List and Title APIs
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 60bf3f000bbaa8dac201e868ff46963f45251062..650a9dcb88e9c50fe60e91cfb55f6c440598a356 100644 index 51bf9e36ec13af09240c329e40391d79f715a021..e3b8cc11a5523614594f1c3a144991fa70227e57 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -393,6 +393,98 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -393,6 +393,98 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -22,7 +22,7 @@ index 99f89854e43ed6742dc9ac1624fa7140b4594b3b..d4527831f66bf1c55e6273c7f8923d6e
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 650a9dcb88e9c50fe60e91cfb55f6c440598a356..6e86a515bbea29f3287e968569c177c22c033766 100644 index e3b8cc11a5523614594f1c3a144991fa70227e57..e904d8558c425d3b2027053f4083999f0deb36fb 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -213,6 +213,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -213,6 +213,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -44,7 +44,7 @@ index 4fa5e7127549e090338b11e6493413a3fab254a0..14d9e62c86309676ddd7eed19cce2f4b
protected void internalSetAbsorptionAmount(float absorptionAmount) { protected void internalSetAbsorptionAmount(float absorptionAmount) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 6e86a515bbea29f3287e968569c177c22c033766..cbc8c9bea2a92ecd78ead69e35b9b179819a4c5f 100644 index e904d8558c425d3b2027053f4083999f0deb36fb..d578d65883f23cc4aaa5b0a7cf1fc88bb337f3a5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2365,6 +2365,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2365,6 +2365,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -261,7 +261,7 @@ index 0000000000000000000000000000000000000000..9e7c22ef49f1699df298f7121d50d27b
+} +}
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..cd61276a45894a02cbefc41a63c27e2cf6361d1e index 0000000000000000000000000000000000000000..861bff267cb397e13e8e1c79bd0776b130c6e5da
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java +++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
@@ -0,0 +1,249 @@ @@ -0,0 +1,249 @@
@ -391,12 +391,12 @@ index 0000000000000000000000000000000000000000..cd61276a45894a02cbefc41a63c27e2c
+ +
+ @Override + @Override
+ public void setSeed(final ContainerEntity holder, final long seed) { + public void setSeed(final ContainerEntity holder, final long seed) {
+ holder.setLootTableSeed(seed); + holder.setContainerLootTableSeed(seed);
+ } + }
+ +
+ @Override + @Override
+ public boolean hasLootTable(final ContainerEntity holder) { + public boolean hasLootTable(final ContainerEntity holder) {
+ return holder.getLootTable() != null; + return holder.getContainerLootTable() != null;
+ } + }
+ +
+ @Override + @Override

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Optional TNT doesn't move in water
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
index 3d489fdc14b3e29bab63f330d5edbbc1d354382a..f45a466120291103e4501276b3d8f97d79070360 100644 index 3d489fdc14b3e29bab63f330d5edbbc1d354382a..45c224198135e48f94dc72312c805bf451bf7b0e 100644
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java --- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java +++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
@@ -135,6 +135,27 @@ public class PrimedTnt extends Entity implements TraceableEntity { @@ -135,6 +135,27 @@ public class PrimedTnt extends Entity implements TraceableEntity {
@ -22,7 +22,7 @@ index 3d489fdc14b3e29bab63f330d5edbbc1d354382a..f45a466120291103e4501276b3d8f97d
+ net.minecraft.server.level.ChunkMap.TrackedEntity ete = ((net.minecraft.server.level.ServerLevel) this.level()).getChunkSource().chunkMap.entityMap.get(this.getId()); + net.minecraft.server.level.ChunkMap.TrackedEntity ete = ((net.minecraft.server.level.ServerLevel) this.level()).getChunkSource().chunkMap.entityMap.get(this.getId());
+ if (ete != null) { + if (ete != null) {
+ net.minecraft.network.protocol.game.ClientboundSetEntityMotionPacket velocityPacket = new net.minecraft.network.protocol.game.ClientboundSetEntityMotionPacket(this); + net.minecraft.network.protocol.game.ClientboundSetEntityMotionPacket velocityPacket = new net.minecraft.network.protocol.game.ClientboundSetEntityMotionPacket(this);
+ net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket positionPacket = new net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket(this); + net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket positionPacket = net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket.teleport(this.getId(), net.minecraft.world.entity.PositionMoveRotation.of(this), java.util.Set.of(), this.onGround);
+ +
+ ete.seenBy.stream() + ete.seenBy.stream()
+ .filter(viewer -> (viewer.getPlayer().getX() - this.getX()) * (viewer.getPlayer().getY() - this.getY()) * (viewer.getPlayer().getZ() - this.getZ()) < 16 * 16) + .filter(viewer -> (viewer.getPlayer().getX() - this.getX()) * (viewer.getPlayer().getY() - this.getY()) * (viewer.getPlayer().getZ() - this.getZ()) < 16 * 16)

View File

@ -5,7 +5,7 @@ Subject: [PATCH] String based Action Bar API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index cbc8c9bea2a92ecd78ead69e35b9b179819a4c5f..d3666250037ff4d6594fe859a7b6b0d0ca679d06 100644 index d578d65883f23cc4aaa5b0a7cf1fc88bb337f3a5..bf8453b2fa3549c827bff784b0d98aa827053634 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -395,6 +395,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -395,6 +395,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -8,7 +8,7 @@ Currently the server only supports the English language. To override this,
You must replace the language file embedded in the server jar. 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 diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index 91010267b8c4df582415a8f7cd7386723b556cc0..685aa3c35dc593b1d923a31967649b468df8a238 100644 index 91010267b8c4df582415a8f7cd7386723b556cc0..b407968b111ff9cb9f428319d211e5d9c4c99138 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -234,4 +234,19 @@ public final class CraftItemFactory implements ItemFactory { @@ -234,4 +234,19 @@ public final class CraftItemFactory implements ItemFactory {
@ -27,7 +27,7 @@ index 91010267b8c4df582415a8f7cd7386723b556cc0..685aa3c35dc593b1d923a31967649b46
+ nms = CraftItemStack.asNMSCopy(item); + nms = CraftItemStack.asNMSCopy(item);
+ } + }
+ +
+ return nms != null ? net.minecraft.locale.Language.getInstance().getOrDefault(nms.getItem().getDescriptionId(nms)) : null; + return nms != null ? nms.getItem().getName(nms).getString() : null;
+ } + }
+ // Paper end - add getI18NDisplayName + // Paper end - add getI18NDisplayName
} }

View File

@ -90,7 +90,7 @@ index 7ae4279768b70a4fdc8f4438898871a17c8fe402..582bbb376c75ab5bf737f3015ce8ad45
private void beginLogin(ClientIntentionPacket packet, boolean transfer) { private void beginLogin(ClientIntentionPacket packet, boolean transfer) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index d3666250037ff4d6594fe859a7b6b0d0ca679d06..ce777a7872e34fed0dfdb984127067ffd835477e 100644 index bf8453b2fa3549c827bff784b0d98aa827053634..63499a4fa349b3fa61040244db8be2d5d2569b96 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -341,6 +341,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -341,6 +341,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -14,7 +14,7 @@ public net.minecraft.world.entity.ExperienceOrb durabilityToXp(I)I
public net.minecraft.world.entity.ExperienceOrb xpToDurability(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 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index ce777a7872e34fed0dfdb984127067ffd835477e..d98c0b9faa4ec97ef251d397456458668c911012 100644 index 63499a4fa349b3fa61040244db8be2d5d2569b96..d222de793776b0217c8ec0a4a3151d085efa339f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1665,7 +1665,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1665,7 +1665,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -64,7 +64,7 @@ index 818df09e9245b5d89b4180b1eaa51470b7539341..f6b2ca92fd3510a76cbf56d0ea55aa6c
public Server getServer() { 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 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index d98c0b9faa4ec97ef251d397456458668c911012..862001f88b4613cb420bf8b8ca1471f41729ad0f 100644 index d222de793776b0217c8ec0a4a3151d085efa339f..6191c780cfab682464e23c53873d0acb0c642b0d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -254,11 +254,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -254,11 +254,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -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. 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 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 862001f88b4613cb420bf8b8ca1471f41729ad0f..b295c2cb3758f653b28120291b2f6c08ad2e4acf 100644 index 6191c780cfab682464e23c53873d0acb0c642b0d..afee0dd824cfa229f9ebdbc2b4ca9beee485d6e7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -214,6 +214,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -214,6 +214,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -165,7 +165,7 @@ index 6d4e0a90c70f7a66450cbb18ebec1d7bf9200af2..5ff159be1a6dfb4b1a5b9aa1e435d294
@Override @Override
public boolean isBlocking() { 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 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index b295c2cb3758f653b28120291b2f6c08ad2e4acf..dc0a04f68482a5101acd19bfc61a64aea689b773 100644 index afee0dd824cfa229f9ebdbc2b4ca9beee485d6e7..d1b14e7460bd2974e2c3c49a085968a90e1f410f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1290,7 +1290,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1290,7 +1290,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -5,7 +5,7 @@ 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 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index dc0a04f68482a5101acd19bfc61a64aea689b773..e3048a5ce7528c056a90a3bc75cea25d832c1d8c 100644 index d1b14e7460bd2974e2c3c49a085968a90e1f410f..6fb400243e491bb8492342327fe98127b2df331e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3007,6 +3007,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3007,6 +3007,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -420,7 +420,7 @@ index 2caba38a50b7ea535337a3540aa5272d4a9f1878..e20565cf256aacd012a1722c5ebbf901
// CraftBukkit end // CraftBukkit end
this.gameEvent(GameEvent.ENTITY_DIE); 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 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index e3048a5ce7528c056a90a3bc75cea25d832c1d8c..d7db67d8bf1f8c9f94547d43e8291e13c9ba34ac 100644 index 6fb400243e491bb8492342327fe98127b2df331e..5dab50309b9441ddb3fe66aec653be0246b049d2 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2544,7 +2544,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2544,7 +2544,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -106,7 +106,7 @@ index f6b2ca92fd3510a76cbf56d0ea55aa6caaf12ba1..e0d342a0ddd140b342f7af138c71596c
public Location getLastDeathLocation() { public Location getLastDeathLocation() {
if (this.getData().contains("LastDeathLocation", 10)) { 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 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index d7db67d8bf1f8c9f94547d43e8291e13c9ba34ac..5e14d93fe151847969d8c4ca9e1aa960aad39dcc 100644 index 5dab50309b9441ddb3fe66aec653be0246b049d2..38989d2e0702e6edba0e81e292b439b7ef48023c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -215,6 +215,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -215,6 +215,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -8,7 +8,7 @@ We just add a check to ensure that the CraftPlayer's handle
is a ServerPlayer is a ServerPlayer
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 5e14d93fe151847969d8c4ca9e1aa960aad39dcc..d4b6a3c2bb63022c00f5d847a1e406ed4efd98c6 100644 index 38989d2e0702e6edba0e81e292b439b7ef48023c..92fb4dfce832f5cb98b476365c060acfd8277183 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -229,8 +229,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -229,8 +229,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -136,7 +136,7 @@ index 363175d3325c012f31ba84060bb0bfac694f6ab8..9911e231ad021286f2da90057b06874f
this.adventure$locale = java.util.Objects.requireNonNullElse(net.kyori.adventure.translation.Translator.parseLocale(this.language), java.util.Locale.US); // Paper this.adventure$locale = java.util.Objects.requireNonNullElse(net.kyori.adventure.translation.Translator.parseLocale(this.language), java.util.Locale.US); // Paper
this.requestedViewDistance = clientOptions.viewDistance(); this.requestedViewDistance = clientOptions.viewDistance();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index d4b6a3c2bb63022c00f5d847a1e406ed4efd98c6..077d47858ac87f732d8ff0d22191b35bc2a58c42 100644 index 92fb4dfce832f5cb98b476365c060acfd8277183..330a64edf72dc598fb5458702cf7cae5dd83ab00 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -670,6 +670,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -670,6 +670,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -57,7 +57,7 @@ index b9fbaddcc8239bf737fdea51790f678306e511eb..9a8b08d4b70b8890961e4af7ce6e870a
} catch (Exception ex) { } catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex); ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 077d47858ac87f732d8ff0d22191b35bc2a58c42..9042bbcfb161d91b1e2c4d6e0461f141fa41872e 100644 index 330a64edf72dc598fb5458702cf7cae5dd83ab00..3b0e7473b3e0c5d9e9e34ed505eae4823e626aae 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3166,6 +3166,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3166,6 +3166,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -5,11 +5,11 @@ 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 diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index 685aa3c35dc593b1d923a31967649b468df8a238..19c1faecb398f5b91dd04827b66038c352e5b4e4 100644 index b407968b111ff9cb9f428319d211e5d9c4c99138..cab7a3d21699605cb7fc480830d7529f70e69e88 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -249,4 +249,44 @@ public final class CraftItemFactory implements ItemFactory { @@ -249,4 +249,44 @@ public final class CraftItemFactory implements ItemFactory {
return nms != null ? net.minecraft.locale.Language.getInstance().getOrDefault(nms.getItem().getDescriptionId(nms)) : null; return nms != null ? nms.getItem().getName(nms).getString() : null;
} }
// Paper end - add getI18NDisplayName // Paper end - add getI18NDisplayName
+ +

View File

@ -5,7 +5,7 @@ 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 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 9042bbcfb161d91b1e2c4d6e0461f141fa41872e..8d9c2c58f7216e1ae7dc382732bd6920c7c72e5c 100644 index 3b0e7473b3e0c5d9e9e34ed505eae4823e626aae..875d96ca1461d254745e53970b401634c07a8dd6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2734,7 +2734,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2734,7 +2734,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -32,7 +32,7 @@ index 70b7871091ab9b64d2a5503620a71c3d5585c25d..7676dbe55b4bf6e0472dc0190c01e6ec
public boolean isWhiteListed(GameProfile profile) { public boolean isWhiteListed(GameProfile profile) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 8d9c2c58f7216e1ae7dc382732bd6920c7c72e5c..680909750f9db56d3cc062b63913e3bd9f69d8a5 100644 index 875d96ca1461d254745e53970b401634c07a8dd6..0ca539a7e037b7f8791ed4c71ce3093a3def2746 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -694,6 +694,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -694,6 +694,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -147,7 +147,7 @@ index e6a927e991779bad84a02d81010057a4e36b9c95..9007a0f01b823c613c39c974d9e0f585
} }
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 680909750f9db56d3cc062b63913e3bd9f69d8a5..3cb6f46492a3441c09a452836d01c15d1837f6ea 100644 index 0ca539a7e037b7f8791ed4c71ce3093a3def2746..8551d626fd4eb38f57414d022f752c0a389a1095 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1681,7 +1681,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1681,7 +1681,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -495,7 +495,7 @@ index 9e2ad78b12cadbf0e2bda1e12fe844120529c347..6a7d7fad990fc44fdda6849d43dad141
} }
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 3cb6f46492a3441c09a452836d01c15d1837f6ea..4b28318dbdeb3fa5935949740343c996d30aa2dd 100644 index 8551d626fd4eb38f57414d022f752c0a389a1095..f0f8238aeb49c45921c7ec48cc49ed628087741f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -280,7 +280,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -280,7 +280,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -187,7 +187,7 @@ index db26b5a0464bd6087eeacaf6dd61eba37365df92..9117c035d5a6ff114b028fad3380ceb1
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 4b28318dbdeb3fa5935949740343c996d30aa2dd..eacfcaee0f534ff63c723af11517e6c895bc84ed 100644 index f0f8238aeb49c45921c7ec48cc49ed628087741f..efc9b5f6864b09fcf116bbad82424b82448f5469 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1430,9 +1430,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1430,9 +1430,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -5,7 +5,7 @@ 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 diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index 19c1faecb398f5b91dd04827b66038c352e5b4e4..237df8b37ee8cf5b15e8e6d30fa3b51ef394434d 100644 index cab7a3d21699605cb7fc480830d7529f70e69e88..ad86ee4372e55c82968fd4fc6a65debab0092028 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -9,6 +9,7 @@ import net.minecraft.core.HolderSet; @@ -9,6 +9,7 @@ import net.minecraft.core.HolderSet;
@ -30,7 +30,7 @@ index 19c1faecb398f5b91dd04827b66038c352e5b4e4..237df8b37ee8cf5b15e8e6d30fa3b51e
+ } + }
+ String typeId = type.getKey().toString(); + String typeId = type.getKey().toString();
+ net.minecraft.resources.ResourceLocation typeKey = ResourceLocation.parse(typeId); + net.minecraft.resources.ResourceLocation typeKey = ResourceLocation.parse(typeId);
+ net.minecraft.world.entity.EntityType<?> nmsType = net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.get(typeKey); + net.minecraft.world.entity.EntityType<?> nmsType = net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.getValue(typeKey);
+ net.minecraft.world.item.SpawnEggItem eggItem = net.minecraft.world.item.SpawnEggItem.byId(nmsType); + net.minecraft.world.item.SpawnEggItem eggItem = net.minecraft.world.item.SpawnEggItem.byId(nmsType);
+ return eggItem == null ? null : new net.minecraft.world.item.ItemStack(eggItem).asBukkitMirror(); + return eggItem == null ? null : new net.minecraft.world.item.ItemStack(eggItem).asBukkitMirror();
+ } + }

View File

@ -24,7 +24,7 @@ index 926ff9be3d9e3f5d620e4c7ccb22b9f64865ff8c..1a37654aff9a9c86c9f7af10a1cf7213
buf.writeLong(this.sectionPos.asLong()); buf.writeLong(this.sectionPos.asLong());
buf.writeVarInt(this.positions.length); buf.writeVarInt(this.positions.length);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index eacfcaee0f534ff63c723af11517e6c895bc84ed..0bb2a75b2dd3d6d5d7815d3f4b1d8b11b002db62 100644 index efc9b5f6864b09fcf116bbad82424b82448f5469..5274ee417ba3b9ccdab70449c87ce8f3809ea137 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -947,6 +947,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -947,6 +947,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -10,7 +10,7 @@ so we do not need that. The client only needs the chunk it is currently in to
be loaded to close the loading screen, so we just send an empty one. be loaded to close the loading screen, so we just send an empty one.
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index f34cad30c982f2bb563f0deab030111720858fa8..f64a4693855899409a0ba7ec15ca0b0351febdd3 100644 index f34cad30c982f2bb563f0deab030111720858fa8..215a3c9839d664f6cfd4c9360338abcf5863799a 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -407,6 +407,16 @@ public abstract class PlayerList { @@ -407,6 +407,16 @@ public abstract class PlayerList {
@ -20,7 +20,7 @@ index f34cad30c982f2bb563f0deab030111720858fa8..f64a4693855899409a0ba7ec15ca0b03
+ // Paper start - Send empty chunk, so players aren't stuck in the world loading screen with our chunk system not sending chunks when dead + // Paper start - Send empty chunk, so players aren't stuck in the world loading screen with our chunk system not sending chunks when dead
+ if (player.isDeadOrDying()) { + if (player.isDeadOrDying()) {
+ net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> plains = worldserver1.registryAccess().lookupOrThrow(net.minecraft.core.registries.Registries.BIOME) + net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> plains = worldserver1.registryAccess().lookupOrThrow(net.minecraft.core.registries.Registries.BIOME)
+ .getHolderOrThrow(net.minecraft.world.level.biome.Biomes.PLAINS); + .getOrThrow(net.minecraft.world.level.biome.Biomes.PLAINS);
+ player.connection.send(new net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket( + player.connection.send(new net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket(
+ new net.minecraft.world.level.chunk.EmptyLevelChunk(worldserver1, player.chunkPosition(), plains), + new net.minecraft.world.level.chunk.EmptyLevelChunk(worldserver1, player.chunkPosition(), plains),
+ worldserver1.getLightEngine(), (java.util.BitSet)null, (java.util.BitSet) null) + worldserver1.getLightEngine(), (java.util.BitSet)null, (java.util.BitSet) null)

View File

@ -5,7 +5,7 @@ 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 diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index 237df8b37ee8cf5b15e8e6d30fa3b51ef394434d..944dcc1126c947b4c8c3b4fdd174eb57320abbba 100644 index ad86ee4372e55c82968fd4fc6a65debab0092028..d9eec6cff3c7c6515f4d61bf1063e7d609d4bcb3 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -305,4 +305,47 @@ public final class CraftItemFactory implements ItemFactory { @@ -305,4 +305,47 @@ public final class CraftItemFactory implements ItemFactory {
@ -24,7 +24,7 @@ index 237df8b37ee8cf5b15e8e6d30fa3b51ef394434d..944dcc1126c947b4c8c3b4fdd174eb57
+ // NON_TREASURE, which does contain all enchantments not in the treasure tag. + // NON_TREASURE, which does contain all enchantments not in the treasure tag.
+ // Additionally, the allowTreasure boolean is more intended to configure this method to behave like + // Additionally, the allowTreasure boolean is more intended to configure this method to behave like
+ // an enchanting table. + // an enchanting table.
+ : net.minecraft.server.MinecraftServer.getServer().registryAccess().registryOrThrow(Registries.ENCHANTMENT).getTag(EnchantmentTags.IN_ENCHANTING_TABLE), + : net.minecraft.server.MinecraftServer.getServer().registryAccess().lookupOrThrow(Registries.ENCHANTMENT).get(EnchantmentTags.IN_ENCHANTING_TABLE),
+ random + random
+ ); + );
+ } + }

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Use username instead of display name in
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index f64a4693855899409a0ba7ec15ca0b0351febdd3..f0ce0041497d038c55019e0f5a8e8b8619cec398 100644 index 215a3c9839d664f6cfd4c9360338abcf5863799a..0646e435e869b5cc067968feb09ff5c6a979a8a7 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1354,7 +1354,7 @@ public abstract class PlayerList { @@ -1354,7 +1354,7 @@ public abstract class PlayerList {

View File

@ -24,7 +24,7 @@ index 37111113f6ab6d77c558b10c4162758135db99b0..911b6391455402922e8bd52cfe9e5694
EntityDropItemEvent event = new EntityDropItemEvent(this.getBukkitEntity(), (org.bukkit.entity.Item) entityitem.getBukkitEntity()); EntityDropItemEvent event = new EntityDropItemEvent(this.getBukkitEntity(), (org.bukkit.entity.Item) entityitem.getBukkitEntity());
Bukkit.getPluginManager().callEvent(event); Bukkit.getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java diff --git a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
index db8bb6e47b28bac6cf568415af3ffdd6eeac6ac7..34f35502faf2029525a8e0a8f347456b2868804b 100644 index db8bb6e47b28bac6cf568415af3ffdd6eeac6ac7..59b00aa57f62ec9d56c28d18c493e952e66f39c7 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java --- a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java +++ b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
@@ -604,7 +604,7 @@ public class Dolphin extends AgeableWaterCreature { @@ -604,7 +604,7 @@ public class Dolphin extends AgeableWaterCreature {
@ -32,12 +32,12 @@ index db8bb6e47b28bac6cf568415af3ffdd6eeac6ac7..34f35502faf2029525a8e0a8f347456b
entityitem.setDeltaMovement((double) (0.3F * -Mth.sin(Dolphin.this.getYRot() * 0.017453292F) * Mth.cos(Dolphin.this.getXRot() * 0.017453292F) + Mth.cos(f1) * f2), (double) (0.3F * Mth.sin(Dolphin.this.getXRot() * 0.017453292F) * 1.5F), (double) (0.3F * Mth.cos(Dolphin.this.getYRot() * 0.017453292F) * Mth.cos(Dolphin.this.getXRot() * 0.017453292F) + Mth.sin(f1) * f2)); entityitem.setDeltaMovement((double) (0.3F * -Mth.sin(Dolphin.this.getYRot() * 0.017453292F) * Mth.cos(Dolphin.this.getXRot() * 0.017453292F) + Mth.cos(f1) * f2), (double) (0.3F * Mth.sin(Dolphin.this.getXRot() * 0.017453292F) * 1.5F), (double) (0.3F * Mth.cos(Dolphin.this.getYRot() * 0.017453292F) * Mth.cos(Dolphin.this.getXRot() * 0.017453292F) + Mth.sin(f1) * f2));
- Dolphin.this.level().addFreshEntity(entityitem); - Dolphin.this.level().addFreshEntity(entityitem);
+ Dolphin.this.spawnAtLocation(entityitem); // Paper - Call EntityDropItemEvent + Dolphin.this.spawnAtLocation(getServerLevel(Dolphin.this), entityitem); // Paper - Call EntityDropItemEvent
} }
} }
} }
diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java
index 205aefd38a185fa411ff17cfb0155769de8fc2fd..ca45a8ccf7f4593d557d157470603e4d233d948d 100644 index 205aefd38a185fa411ff17cfb0155769de8fc2fd..67ea374ae3c66af434b4aadbe702a44d230fbe09 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Fox.java --- a/src/main/java/net/minecraft/world/entity/animal/Fox.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java +++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java
@@ -492,14 +492,14 @@ public class Fox extends Animal implements VariantHolder<Fox.Variant> { @@ -492,14 +492,14 @@ public class Fox extends Animal implements VariantHolder<Fox.Variant> {
@ -45,7 +45,7 @@ index 205aefd38a185fa411ff17cfb0155769de8fc2fd..ca45a8ccf7f4593d557d157470603e4d
entityitem.setThrower(this); entityitem.setThrower(this);
this.playSound(SoundEvents.FOX_SPIT, 1.0F, 1.0F); this.playSound(SoundEvents.FOX_SPIT, 1.0F, 1.0F);
- this.level().addFreshEntity(entityitem); - this.level().addFreshEntity(entityitem);
+ this.spawnAtLocation(entityitem); // Paper - Call EntityDropItemEvent + this.spawnAtLocation((net.minecraft.server.level.ServerLevel) this.level(), entityitem); // Paper - Call EntityDropItemEvent
} }
} }
@ -53,12 +53,12 @@ index 205aefd38a185fa411ff17cfb0155769de8fc2fd..ca45a8ccf7f4593d557d157470603e4d
ItemEntity entityitem = new ItemEntity(this.level(), this.getX(), this.getY(), this.getZ(), stack); ItemEntity entityitem = new ItemEntity(this.level(), this.getX(), this.getY(), this.getZ(), stack);
- this.level().addFreshEntity(entityitem); - this.level().addFreshEntity(entityitem);
+ this.spawnAtLocation(entityitem); // Paper - Call EntityDropItemEvent + this.spawnAtLocation((net.minecraft.server.level.ServerLevel) this.level(), entityitem); // Paper - Call EntityDropItemEvent
} }
@Override @Override
diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
index 14e02f9b0169db8388c515a68315ad5cc3f13d22..dbcf14f5af9c9c0655a82529ee99450a8da14525 100644 index 14e02f9b0169db8388c515a68315ad5cc3f13d22..14b47d6fa189f2a666b12ef7e7708d204c2b0452 100644
--- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java --- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
+++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java +++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
@@ -365,8 +365,7 @@ public class Goat extends Animal { @@ -365,8 +365,7 @@ public class Goat extends Animal {
@ -67,19 +67,19 @@ index 14e02f9b0169db8388c515a68315ad5cc3f13d22..dbcf14f5af9c9c0655a82529ee99450a
- this.level().addFreshEntity(entityitem); - this.level().addFreshEntity(entityitem);
- return true; - return true;
+ return this.spawnAtLocation(entityitem) != null; // Paper - Call EntityDropItemEvent + return this.spawnAtLocation((net.minecraft.server.level.ServerLevel) this.level(), entityitem) != null; // Paper - Call EntityDropItemEvent
} }
} }
diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
index 5e586f174ff4b610a2584f28c9ffdd445ad58bea..0395b120590552518a85f36a46b68532e936de49 100644 index 5e586f174ff4b610a2584f28c9ffdd445ad58bea..014e1ea1603bc7a7b42ae7ff7d12e5a41f331d2f 100644
--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java --- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java +++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
@@ -345,8 +345,9 @@ public class Sniffer extends Animal { @@ -345,8 +345,9 @@ public class Sniffer extends Animal {
entityitem.setDefaultPickUpDelay(); entityitem.setDefaultPickUpDelay();
this.finalizeSpawnChildFromBreeding(world, other, (AgeableMob) null); this.finalizeSpawnChildFromBreeding(world, other, (AgeableMob) null);
+ if (this.spawnAtLocation(entityitem) != null) { // Paper - Call EntityDropItemEvent + if (this.spawnAtLocation(world, entityitem) != null) { // Paper - Call EntityDropItemEvent
this.playSound(SoundEvents.SNIFFER_EGG_PLOP, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 0.5F); this.playSound(SoundEvents.SNIFFER_EGG_PLOP, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 0.5F);
- world.addFreshEntity(entityitem); - world.addFreshEntity(entityitem);
+ } // Paper - Call EntityDropItemEvent + } // Paper - Call EntityDropItemEvent

View File

@ -1,19 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Doc <nachito94@msn.com>
Date: Sun, 17 Jul 2022 11:49:43 -0400
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 ac2ad33a44ce04d9673adc08ff21a167d606e4db..b34245e82306c4ce607aa984ab8f597dec2ba4b5 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2402,7 +2402,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
// Spigot end
// this.chatSpamThrottler.increment();
- if (!this.chatSpamThrottler.isIncrementAndUnderThreshold() && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) {
+ if (counted && !this.chatSpamThrottler.isIncrementAndUnderThreshold() && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) { // Paper - exclude from SpigotConfig.spamExclusions
// CraftBukkit end
this.disconnect((Component) Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause
}

View File

@ -5,7 +5,7 @@ Subject: [PATCH] More Teleport API
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index b34245e82306c4ce607aa984ab8f597dec2ba4b5..ebe3d51ccc02b46d9bae4ba4f9185eadfec278f2 100644 index ac2ad33a44ce04d9673adc08ff21a167d606e4db..349da8b85b7a122977fcad80a399605109b88db2 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1585,11 +1585,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1585,11 +1585,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -15,7 +15,7 @@ index b34245e82306c4ce607aa984ab8f597dec2ba4b5..ebe3d51ccc02b46d9bae4ba4f9185ead
- PlayerTeleportEvent event = new PlayerTeleportEvent(player, from.clone(), to.clone(), cause); - PlayerTeleportEvent event = new PlayerTeleportEvent(player, from.clone(), to.clone(), cause);
+ // Paper start - Teleport API + // Paper start - Teleport API
+ Set<io.papermc.paper.entity.TeleportFlag.Relative> relativeFlags = java.util.EnumSet.noneOf(io.papermc.paper.entity.TeleportFlag.Relative.class); + Set<io.papermc.paper.entity.TeleportFlag.Relative> relativeFlags = java.util.EnumSet.noneOf(io.papermc.paper.entity.TeleportFlag.Relative.class);
+ for (RelativeMovement relativeArgument : set) { + for (Relative relativeArgument : set) {
+ relativeFlags.add(org.bukkit.craftbukkit.entity.CraftPlayer.toApiRelativeFlag(relativeArgument)); + relativeFlags.add(org.bukkit.craftbukkit.entity.CraftPlayer.toApiRelativeFlag(relativeArgument));
+ } + }
+ PlayerTeleportEvent event = new PlayerTeleportEvent(player, from.clone(), to.clone(), cause, java.util.Set.copyOf(relativeFlags)); + PlayerTeleportEvent event = new PlayerTeleportEvent(player, from.clone(), to.clone(), cause, java.util.Set.copyOf(relativeFlags));
@ -112,7 +112,7 @@ index 4e6afa243d6108cb946a8a7cf96c4036a3c2ac0c..43786eacc72cdf3bb209d3dfb1808ea9
private final org.bukkit.entity.Entity.Spigot spigot = new org.bukkit.entity.Entity.Spigot() private final org.bukkit.entity.Entity.Spigot spigot = new org.bukkit.entity.Entity.Spigot()
{ {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0bb2a75b2dd3d6d5d7815d3f4b1d8b11b002db62..2514fbae7c87a96c12e44d21ff7df1d2f3243387 100644 index 5274ee417ba3b9ccdab70449c87ce8f3809ea137..c45753f4b65b189ebfdaea4fb0ec51217dd990c3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1303,13 +1303,102 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1303,13 +1303,102 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -27,7 +27,7 @@ index 6b19689a19465554b943470fc6f959e48169ac5b..aa41c4cf8d3ae291c4147118c96190ff
public ItemEntity(Level world, double x, double y, double z, ItemStack stack, double velocityX, double velocityY, double velocityZ) { public ItemEntity(Level world, double x, double y, double z, ItemStack stack, double velocityX, double velocityY, double velocityZ) {
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
index f45a466120291103e4501276b3d8f97d79070360..96453be982623c7eb210a828404122e1d0f78b5d 100644 index 45c224198135e48f94dc72312c805bf451bf7b0e..de87483600e55d88176fe25db621bbd3e464729f 100644
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java --- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java +++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
@@ -68,7 +68,7 @@ public class PrimedTnt extends Entity implements TraceableEntity { @@ -68,7 +68,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {

View File

@ -57,7 +57,7 @@ index 5c3e5c348e6fececccd8097355f423b9e7ad982b..064a7a3e1c4d192010e072a5e985a541
} }
} }
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index ebe3d51ccc02b46d9bae4ba4f9185eadfec278f2..19b90fe644da59216e11b35af33e62c0fc66db7b 100644 index 349da8b85b7a122977fcad80a399605109b88db2..32ed76fca856b7d121e2215748be4f6d1b18791a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1723,8 +1723,28 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1723,8 +1723,28 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

View File

@ -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 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 2514fbae7c87a96c12e44d21ff7df1d2f3243387..dc360a7a8a8d23be9d8301a5e6fbff5499c9a947 100644 index c45753f4b65b189ebfdaea4fb0ec51217dd990c3..2b5eb586eda41d465f3f1faae8159f6fbe346312 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -708,6 +708,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -708,6 +708,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -130,7 +130,7 @@ index 064a7a3e1c4d192010e072a5e985a54135748d87..a706f0855fdf88cc9aece3ba00ef574b
this.player.server.getPlayerList().broadcastAll(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_GAME_MODE, this.player), this.player); // CraftBukkit this.player.server.getPlayerList().broadcastAll(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_GAME_MODE, this.player), this.player); // CraftBukkit
this.level.updateSleepingPlayerList(); this.level.updateSleepingPlayerList();
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 19b90fe644da59216e11b35af33e62c0fc66db7b..8c615974a738b87116830538646750bb6f7ef7f0 100644 index 32ed76fca856b7d121e2215748be4f6d1b18791a..72ac67c6d42a1763fd63bd0d0db18ba709f48314 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1831,7 +1831,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1831,7 +1831,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -143,7 +143,7 @@ index 19b90fe644da59216e11b35af33e62c0fc66db7b..8c615974a738b87116830538646750bb
MutableComponent ichatmutablecomponent1 = Component.translatable("build.tooHigh", i).withStyle(ChatFormatting.RED); MutableComponent ichatmutablecomponent1 = Component.translatable("build.tooHigh", i).withStyle(ChatFormatting.RED);
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index f0ce0041497d038c55019e0f5a8e8b8619cec398..8e71eeb5be2df1352447f3662a6d092a7db9e2d0 100644 index 0646e435e869b5cc067968feb09ff5c6a979a8a7..61c37bf5f75207085f22093e48986dab8231e1c1 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -261,7 +261,7 @@ public abstract class PlayerList { @@ -261,7 +261,7 @@ public abstract class PlayerList {
@ -219,7 +219,7 @@ index ef71b3ef4444c05b4211de87e1c8ec52cbe3e72a..137ec75ee803789deb7b1ca93dd9369c
public void start() { public void start() {
this.creeper.getNavigation().stop(); this.creeper.getNavigation().stop();
diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
index dbcf14f5af9c9c0655a82529ee99450a8da14525..f745a554b9b84a53d9bd942ca9908153fb0a668c 100644 index 14b47d6fa189f2a666b12ef7e7708d204c2b0452..4c6dc427b90012b0945e073dd905dc7e8d1bec82 100644
--- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java --- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
+++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java +++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
@@ -247,9 +247,10 @@ public class Goat extends Animal { @@ -247,9 +247,10 @@ public class Goat extends Animal {

View File

@ -56,7 +56,7 @@ index 5c26beef2d3f3d4afa51950ddeb7089989218462..e283b1296c1e831376bfe9491cbf02ed
if (!flag) { if (!flag) {
PiglinAi.putInInventory(piglin, itemstack); PiglinAi.putInInventory(piglin, itemstack);
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java
index 45375ccdcf730732dd915304dea2f523807eedd6..2eb1ad88bd39b3e6539d6c4ac61fb1d58edb5eb2 100644 index 45375ccdcf730732dd915304dea2f523807eedd6..ab132041982df2a701e4baea8195873f31b4a5fb 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raider.java --- a/src/main/java/net/minecraft/world/entity/raid/Raider.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java +++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java
@@ -228,6 +228,11 @@ public abstract class Raider extends PatrollingMonster { @@ -228,6 +228,11 @@ public abstract class Raider extends PatrollingMonster {
@ -64,7 +64,7 @@ index 45375ccdcf730732dd915304dea2f523807eedd6..2eb1ad88bd39b3e6539d6c4ac61fb1d5
if (this.hasActiveRaid() && !flag && ItemStack.matches(itemstack, Raid.getOminousBannerInstance(this.registryAccess().lookupOrThrow(Registries.BANNER_PATTERN)))) { if (this.hasActiveRaid() && !flag && ItemStack.matches(itemstack, Raid.getOminousBannerInstance(this.registryAccess().lookupOrThrow(Registries.BANNER_PATTERN)))) {
+ // Paper start - EntityPickupItemEvent fixes + // Paper start - EntityPickupItemEvent fixes
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(this, itemstack, 0, false).isCancelled()) { + if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(this, itemEntity, 0, false).isCancelled()) {
+ return; + return;
+ } + }
+ // Paper end - EntityPickupItemEvent fixes + // Paper end - EntityPickupItemEvent fixes

View File

@ -5,7 +5,7 @@ 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 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index dc360a7a8a8d23be9d8301a5e6fbff5499c9a947..74cfa4313c8aba96b792d7855627be68efc41d51 100644 index 2b5eb586eda41d465f3f1faae8159f6fbe346312..d8d3d256910790fd7fc406d64ab38e1c372ecfa7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3326,6 +3326,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3326,6 +3326,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -31,7 +31,7 @@ index 550c7f3435cc6c3180769e47f05bf693bdc380e3..e9e4d6fd69f9eec25a75b2610e15a19f
if (inSittingPose) { if (inSittingPose) {
diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java
index ca45a8ccf7f4593d557d157470603e4d233d948d..d98e4882dcba8a903bc86c8d30b290e6e967cc75 100644 index 67ea374ae3c66af434b4aadbe702a44d230fbe09..a9a8ebb2cebe668628d5bdb33fa1399e0ab1e08b 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Fox.java --- a/src/main/java/net/minecraft/world/entity/animal/Fox.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java +++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java
@@ -419,7 +419,7 @@ public class Fox extends Animal implements VariantHolder<Fox.Variant> { @@ -419,7 +419,7 @@ public class Fox extends Animal implements VariantHolder<Fox.Variant> {

View File

@ -10,7 +10,7 @@ public net.minecraft.world.entity.monster.warden.WardenSpawnTracker cooldownTick
public net.minecraft.world.entity.monster.warden.WardenSpawnTracker increaseWarningLevel()V 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 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 74cfa4313c8aba96b792d7855627be68efc41d51..a000d41fd6b6d9e690ea2a16ac1bd77589b64f14 100644 index d8d3d256910790fd7fc406d64ab38e1c372ecfa7..bc96e6a4f6833b351da5ac91563fd6f0d057c854 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3331,6 +3331,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3331,6 +3331,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -11,7 +11,7 @@ the logic associated with damaging them
public net.minecraft.world.entity.LivingEntity entityEventForEquipmentBreak(Lnet/minecraft/world/entity/EquipmentSlot;)B public net.minecraft.world.entity.LivingEntity entityEventForEquipmentBreak(Lnet/minecraft/world/entity/EquipmentSlot;)B
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index bcb3a45166e5dd75dd727adf92304b3a75399c8d..d8dc3228f3cd8c9efc8359162edac601a87bf762 100644 index bcb3a45166e5dd75dd727adf92304b3a75399c8d..90a55f00c36903d52630c51bf69322973a2b5274 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java --- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -693,8 +693,13 @@ public final class ItemStack implements DataComponentHolder { @@ -693,8 +693,13 @@ public final class ItemStack implements DataComponentHolder {
@ -29,18 +29,21 @@ index bcb3a45166e5dd75dd727adf92304b3a75399c8d..d8dc3228f3cd8c9efc8359162edac601
// CraftBukkit start // CraftBukkit start
if (player instanceof final ServerPlayer serverPlayer) { // Paper - Add EntityDamageItemEvent if (player instanceof final ServerPlayer serverPlayer) { // Paper - Add EntityDamageItemEvent
PlayerItemDamageEvent event = new PlayerItemDamageEvent(serverPlayer.getBukkitEntity(), CraftItemStack.asCraftMirror(this), j, originalDamage); // Paper - Add EntityDamageItemEvent PlayerItemDamageEvent event = new PlayerItemDamageEvent(serverPlayer.getBukkitEntity(), CraftItemStack.asCraftMirror(this), j, originalDamage); // Paper - Add EntityDamageItemEvent
@@ -725,8 +730,8 @@ public final class ItemStack implements DataComponentHolder { @@ -726,7 +731,12 @@ public final class ItemStack implements DataComponentHolder {
} }
- private int processDurabilityChange(int baseDamage, ServerLevel world, @Nullable LivingEntity player) { // Paper - Add EntityDamageItemEvent private int processDurabilityChange(int baseDamage, ServerLevel world, @Nullable LivingEntity player) { // Paper - Add EntityDamageItemEvent
- return !this.isDamageableItem() ? 0 : (player instanceof ServerPlayer && player.hasInfiniteMaterials() ? 0 : (baseDamage > 0 ? EnchantmentHelper.processDurabilityChange(world, this, baseDamage) : baseDamage)); // Paper - Add EntityDamageItemEvent - return !this.isDamageableItem() ? 0 : (player instanceof ServerPlayer && player.hasInfiniteMaterials() ? 0 : (baseDamage > 0 ? EnchantmentHelper.processDurabilityChange(world, this, baseDamage) : baseDamage)); // Paper - Add EntityDamageItemEvent
+ private int processDurabilityChange(int baseDamage, ServerLevel world, @Nullable LivingEntity player, boolean force) { // Paper - Add EntityDamageItemEvent + // Paper start - itemstack damage api
+ return processDurabilityChange(baseDamage, world, player, false);
+ }
+ private int processDurabilityChange(int baseDamage, ServerLevel world, @Nullable LivingEntity player, boolean force) {
+ return !this.isDamageableItem() ? 0 : (player instanceof ServerPlayer && player.hasInfiniteMaterials() && !force ? 0 : (baseDamage > 0 ? EnchantmentHelper.processDurabilityChange(world, this, baseDamage) : baseDamage)); // Paper - Add EntityDamageItemEvent + return !this.isDamageableItem() ? 0 : (player instanceof ServerPlayer && player.hasInfiniteMaterials() && !force ? 0 : (baseDamage > 0 ? EnchantmentHelper.processDurabilityChange(world, this, baseDamage) : baseDamage)); // Paper - Add EntityDamageItemEvent
+ // Paper end - itemstack damage api
} }
private void applyDamage(int damage, @Nullable LivingEntity player, Consumer<Item> breakCallback) { // Paper - Add EntityDamageItemEvent private void applyDamage(int damage, @Nullable LivingEntity player, Consumer<Item> breakCallback) { // Paper - Add EntityDamageItemEvent
@@ -766,6 +771,11 @@ public final class ItemStack implements DataComponentHolder { @@ -766,6 +776,11 @@ public final class ItemStack implements DataComponentHolder {
} }
public void hurtAndBreak(int amount, LivingEntity entity, EquipmentSlot slot) { public void hurtAndBreak(int amount, LivingEntity entity, EquipmentSlot slot) {
@ -52,7 +55,7 @@ index bcb3a45166e5dd75dd727adf92304b3a75399c8d..d8dc3228f3cd8c9efc8359162edac601
Level world = entity.level(); Level world = entity.level();
if (world instanceof ServerLevel worldserver) { if (world instanceof ServerLevel worldserver) {
@@ -778,8 +788,8 @@ public final class ItemStack implements DataComponentHolder { @@ -778,8 +793,8 @@ public final class ItemStack implements DataComponentHolder {
} }
this.hurtAndBreak(amount, worldserver, entity, (item) -> { // Paper - Add EntityDamageItemEvent this.hurtAndBreak(amount, worldserver, entity, (item) -> { // Paper - Add EntityDamageItemEvent

View File

@ -6,7 +6,7 @@ Subject: [PATCH] fix Instruments
properly handle Player#playNote 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 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index a000d41fd6b6d9e690ea2a16ac1bd77589b64f14..a70db1d658127ed72f82580c1dd743c6c9d5f809 100644 index bc96e6a4f6833b351da5ac91563fd6f0d057c854..b0818d1fc60ab75770e671d30cdbfd531b3dfa99 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -785,7 +785,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -785,7 +785,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

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