1.21.1-update #16

Offen
Chaoscaot möchte 44 Commits von 1.21.1-update nach master mergen
172 geänderte Dateien mit 2166 neuen und 817 gelöschten Zeilen

Datei anzeigen

@ -56,7 +56,6 @@ split into different directories which target certain parts of the code. These
directories are:
- `Paper-API` - Modifications to `Spigot-API`/`Bukkit`;
- `Paper-MojangAPI` - An API for [Mojang's Brigadier](https://github.com/Mojang/brigadier);
- `Paper-Server` - Modifications to `Spigot`/`CraftBukkit`.
Because the entire structure is based on patches and git, a basic understanding
@ -97,7 +96,9 @@ Your commit will be converted into a patch that you can then PR into Paper.
## Modifying Patches
Modifying previous patches is a bit more complex:
Modifying previous patches is a bit more complex.
Similar to adding patches, the methods to modify a patch are applied inside
the `Paper-Server` and/or `Paper-API` folders.
### Method 1

Datei anzeigen

@ -64,4 +64,5 @@ Oliwier Miodun <naczs@blueflow.pl>
aerulion <aerulion@gmail.com>
Lukas Planz <lukas.planz@web.de>
granny <contact@granny.dev>
mja00 <me@mja00.dev>
```

Datei anzeigen

@ -74,6 +74,20 @@ index 0cf808356a1a5c6fc4bcf97a694ed9beb80a776a..dc765dea47a9a1c1520fb16ddb24f814
* @param z Z-coordinate (0-15)
* @return temperature at given coordinate
*/
diff --git a/src/main/java/org/bukkit/HeightMap.java b/src/main/java/org/bukkit/HeightMap.java
index db6fcd635e295e561642d49941fd8e611247d38e..344b2b5d9207d2645bc5417d1ec00dd0a0b95604 100644
--- a/src/main/java/org/bukkit/HeightMap.java
+++ b/src/main/java/org/bukkit/HeightMap.java
@@ -12,8 +12,7 @@ public enum HeightMap {
*/
MOTION_BLOCKING,
/**
- * The highest block that blocks motion or contains a fluid or is in the
- * {@link Tag#LEAVES}.
+ * The highest block that blocks motion or contains a fluid, excluding leaves.
*/
MOTION_BLOCKING_NO_LEAVES,
/**
diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java
index 62a8bb18855be13ed1c466b4be7afcd3c91dc7aa..de9fd0fadd6d16ffe883a618bf499214878f443d 100644
--- a/src/main/java/org/bukkit/Particle.java
@ -444,6 +458,19 @@ index b688b3856cb3068a539fcecfbfa113f8ab4160a9..c275b881cbd11307a6dcc7190d7a7d40
*
* @return whether the item frame is visible or not
*/
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 32e89741ffd895e31af0104a0126c2f72742a1bb..bc17c86da49faf4b6e07d4fb4c53649da0384d69 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -502,7 +502,7 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
/**
* Sets the leash on this entity to be held by the supplied entity.
* <p>
- * This method has no effect on EnderDragons, Withers, Players, or Bats.
+ * This method has no effect on players.
* Non-living entities excluding leashes will not persist as leash
* holders.
*
diff --git a/src/main/java/org/bukkit/entity/Mob.java b/src/main/java/org/bukkit/entity/Mob.java
index f3f62e13cc1b6172808c52f2d5f520f1f584e6db..ad5dbf310fe7b34c997bb339f09697222f862005 100644
--- a/src/main/java/org/bukkit/entity/Mob.java
@ -1548,21 +1575,6 @@ index 35c6594fd1040a1af1029e7260e5e3a9307b107d..d58719ee75bef8bc265bfc81bc5d88a4
*/
void addChargedProjectile(@NotNull ItemStack item);
}
diff --git a/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java b/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java
index cdbcc8dbab2456cc2bc1f3084cbb1ced1698b7f5..d528b066c2aaa3fb097931914ff2181f8f64e520 100644
--- a/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java
@@ -86,8 +86,8 @@ public interface FireworkMeta extends ItemMeta {
* Sets the approximate power of the firework. Each level of power is half
* a second of flight time.
*
- * @param power the power of the firework, from 0-127
- * @throws IllegalArgumentException if {@literal height<0 or height>127}
+ * @param power the power of the firework, from 0-255
+ * @throws IllegalArgumentException if {@literal power < 0 or power > 255}
*/
void setPower(int power) throws IllegalArgumentException;
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
index 014c1a0379e532a5c924694a8e0715eb0ba50ec2..10ca843e57c74dfa32d539acd174c8867dfd56ec 100644
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java

Datei anzeigen

@ -11,6 +11,8 @@ and avoid going to main for tab completions.
Especially useful if you need to query a database in order to obtain the results for tab
completion, such as offline players.
Also Enforces mutability of the existing TabCompleteEvent.
Co-authored-by: Aikar <aikar@aikar.co>
diff --git a/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java
@ -534,10 +536,10 @@ index 0000000000000000000000000000000000000000..6f560a51277ccbd46a9142cfa057d276
+ }
+}
diff --git a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java
index 270e6d8ad4358baa256cee5f16cff281f063ce3b..b43c3cb5c88eada186d6f81712c244aaa18fb53e 100644
index 270e6d8ad4358baa256cee5f16cff281f063ce3b..6465e290c090d82986352d5ab7ba5dc65bd3dc17 100644
--- a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java
+++ b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java
@@ -29,6 +29,13 @@ public class TabCompleteEvent extends Event implements Cancellable {
@@ -29,13 +29,20 @@ public class TabCompleteEvent extends Event implements Cancellable {
private boolean cancelled;
public TabCompleteEvent(@NotNull CommandSender sender, @NotNull String buffer, @NotNull List<String> completions) {
@ -551,6 +553,14 @@ index 270e6d8ad4358baa256cee5f16cff281f063ce3b..b43c3cb5c88eada186d6f81712c244aa
Preconditions.checkArgument(sender != null, "sender");
Preconditions.checkArgument(buffer != null, "buffer");
Preconditions.checkArgument(completions != null, "completions");
this.sender = sender;
this.buffer = buffer;
- this.completions = completions;
+ this.completions = new java.util.ArrayList<>(completions); // Paper - Completions must be mutable
}
/**
@@ -69,14 +76,35 @@ public class TabCompleteEvent extends Event implements Cancellable {
return completions;
}
@ -584,7 +594,7 @@ index 270e6d8ad4358baa256cee5f16cff281f063ce3b..b43c3cb5c88eada186d6f81712c244aa
public void setCompletions(@NotNull List<String> completions) {
Preconditions.checkArgument(completions != null);
- this.completions = completions;
+ this.completions = new java.util.ArrayList<>(completions); // Paper
+ this.completions = new java.util.ArrayList<>(completions); // Paper - completions must be mutable
}
@Override

Datei anzeigen

@ -890,7 +890,7 @@ index bafef53c1d449135f1300c8c8fbb06f482ba67e1..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 b5ea7b60b47f056553a1cec766c57e0f75735633..ec35111df4b38fd55cc34f4baedebcf39c7fc92b 100644
index 3f1b74af137868e502792c65ccd7ca74f3c3cb8c..c89ffb0f98dccd015e80e299142252fed3ece4a8 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -716,7 +716,9 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@ -1509,7 +1509,7 @@ index f1a48eab1a357ae64545e1f1dc941c383cff8707..466d1bd7089b76f48f953e1a51c611ec
/**
* Checks if the inventory contains any ItemStacks with the given
diff --git a/src/main/java/org/bukkit/inventory/InventoryView.java b/src/main/java/org/bukkit/inventory/InventoryView.java
index ebc14022c9ef9b0b3331ee53e96a32667e4762e0..2b2c5faabce1628bd2e82a840dc97fe79bb57856 100644
index ebc14022c9ef9b0b3331ee53e96a32667e4762e0..5c258b6077277575daa5d96349837bdf06f42500 100644
--- a/src/main/java/org/bukkit/inventory/InventoryView.java
+++ b/src/main/java/org/bukkit/inventory/InventoryView.java
@@ -123,9 +123,9 @@ public interface InventoryView {
@ -1538,6 +1538,27 @@ index ebc14022c9ef9b0b3331ee53e96a32667e4762e0..2b2c5faabce1628bd2e82a840dc97fe7
public ItemStack getCursor();
/**
@@ -296,8 +296,10 @@ public interface InventoryView {
* made using {@link #setTitle(String)}.
*
* @return the original title
+ * @deprecated changing the title is not supported
*/
@NotNull
+ @Deprecated(since = "1.21.1") // Paper
public String getOriginalTitle();
/**
@@ -309,6 +311,9 @@ public interface InventoryView {
* exception.
*
* @param title The new title.
+ * @deprecated changing the title is not supported. This method has
+ * poorly defined and broken behaviors. It should not be used.
*/
+ @Deprecated(since = "1.21.1") // Paper
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
index 3d08beee52f2247db6f6e679206ed6a965fbf9a8..1b4f9b93860e58762ac28715adad5a67298b06d7 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java

Datei anzeigen

@ -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 fbe14c327ee9c1ac07893853ca7c699e81225281..a2ced20efd2c6be2fe63d80f444c8cb608c37eef 100644
index fbe14c327ee9c1ac07893853ca7c699e81225281..b558fa73dbcf3747690933e6aadf7061a0de2630 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -865,6 +865,18 @@ public final class Bukkit {
@@ -865,6 +865,29 @@ public final class Bukkit {
public static World getWorld(@NotNull UUID uid) {
return server.getWorld(uid);
}
@ -23,6 +23,17 @@ index fbe14c327ee9c1ac07893853ca7c699e81225281..a2ced20efd2c6be2fe63d80f444c8cb6
+ public static World getWorld(@NotNull NamespacedKey worldKey) {
+ return server.getWorld(worldKey);
+ }
+
+ /**
+ * Gets the world from the given Key
+ *
+ * @param worldKey the Key of the world to retrieve
+ * @return a world with the given Key, or null if none exists
+ */
+ @Nullable
+ public static World getWorld(@NotNull net.kyori.adventure.key.Key worldKey) {
+ return server.getWorld(worldKey);
+ }
+ // Paper end
/**
@ -56,10 +67,10 @@ index 27eff0826d5b5b48697fefd9571886e7bbce74b1..d8b1fa79dc24138dc71e32c14bda71c1
// Paper end
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 943f8881ea23481ea5d5125b6ec7c9c6f763f0b0..8b52e9a41ea9ba38117d42224811ff28663ef980 100644
index 943f8881ea23481ea5d5125b6ec7c9c6f763f0b0..42930006b6425b5d82233e4ffe7025ce5397b277 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -726,6 +726,17 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -726,6 +726,28 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@Nullable
public World getWorld(@NotNull UUID uid);
@ -71,7 +82,18 @@ index 943f8881ea23481ea5d5125b6ec7c9c6f763f0b0..8b52e9a41ea9ba38117d42224811ff28
+ * @return a world with the given NamespacedKey, or null if none exists
+ */
+ @Nullable
+ public World getWorld(@NotNull NamespacedKey worldKey);
+ default World getWorld(@NotNull NamespacedKey worldKey) {
+ return getWorld((net.kyori.adventure.key.Key) worldKey);
+ }
+
+ /**
+ * Gets the world from the given Key
+ *
+ * @param worldKey the Key of the world to retrieve
+ * @return a world with the given Key, or null if none exists
+ */
+ @Nullable
+ World getWorld(@NotNull net.kyori.adventure.key.Key worldKey);
+ // Paper end
+
/**

Datei anzeigen

@ -70,7 +70,7 @@ index 0000000000000000000000000000000000000000..58f78d5e91beacaf710f62461cf869f7
+
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index a2ced20efd2c6be2fe63d80f444c8cb608c37eef..a6e87d06e439bfa85512891da300e2de60b0af95 100644
index b558fa73dbcf3747690933e6aadf7061a0de2630..8a22c242a93b0e16e0bca583d0918bab695248b1 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -328,9 +328,11 @@ public final class Bukkit {
@ -85,7 +85,7 @@ index a2ced20efd2c6be2fe63d80f444c8cb608c37eef..a6e87d06e439bfa85512891da300e2de
public static DataPackManager getDataPackManager() {
return server.getDataPackManager();
}
@@ -2606,6 +2608,14 @@ public final class Bukkit {
@@ -2617,6 +2619,14 @@ public final class Bukkit {
public static com.destroystokyo.paper.entity.ai.MobGoals getMobGoals() {
return server.getMobGoals();
}
@ -101,7 +101,7 @@ index a2ced20efd2c6be2fe63d80f444c8cb608c37eef..a6e87d06e439bfa85512891da300e2de
@NotNull
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 8b52e9a41ea9ba38117d42224811ff28663ef980..c3f32db8ccd31e3ee8a544dc165540c0fa8bcc35 100644
index 42930006b6425b5d82233e4ffe7025ce5397b277..67b5cb7635c4251c259b1fb1ef50f99a0b2647e5 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -267,9 +267,11 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@ -116,7 +116,7 @@ index 8b52e9a41ea9ba38117d42224811ff28663ef980..c3f32db8ccd31e3ee8a544dc165540c0
public DataPackManager getDataPackManager();
/**
@@ -2273,5 +2275,11 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2284,5 +2286,11 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
@NotNull
com.destroystokyo.paper.entity.ai.MobGoals getMobGoals();

Datei anzeigen

@ -41,7 +41,7 @@ index 0000000000000000000000000000000000000000..aec3b41d7c3388e26fa203e3c062f1e6
+ }
+}
diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/java/org/bukkit/enchantments/Enchantment.java
index daae9bb234d2e10530b2bed35fada98652514e0e..fc30fbffd83285d4ec102a18454ed95289329667 100644
index daae9bb234d2e10530b2bed35fada98652514e0e..53dbb852d6a34f0814b81852c7f10f55c38299e7 100644
--- a/src/main/java/org/bukkit/enchantments/Enchantment.java
+++ b/src/main/java/org/bukkit/enchantments/Enchantment.java
@@ -290,11 +290,7 @@ public abstract class Enchantment implements Keyed, Translatable, net.kyori.adve
@ -56,11 +56,11 @@ index daae9bb234d2e10530b2bed35fada98652514e0e..fc30fbffd83285d4ec102a18454ed952
public abstract boolean isCursed();
/**
@@ -328,6 +324,116 @@ public abstract class Enchantment implements Keyed, Translatable, net.kyori.adve
* @return the name of the enchantment with {@code level} applied
*/
@@ -330,6 +326,118 @@ public abstract class Enchantment implements Keyed, Translatable, net.kyori.adve
public abstract net.kyori.adventure.text.@NotNull Component displayName(int level);
+
// Paper end
+ // Paper start - more Enchantment API
+ /**
+ * Checks if this enchantment can be found in villager trades.
+ *
@ -129,7 +129,7 @@ index daae9bb234d2e10530b2bed35fada98652514e0e..fc30fbffd83285d4ec102a18454ed952
+ * @return the damage increase
+ * @deprecated Enchantments now have a complex effect systems that cannot be reduced to a simple damage increase.
+ */
+ @Contract("-> fail")
+ @Contract("_, _ -> fail")
+ @Deprecated(forRemoval = true, since = "1.20.5")
+ public abstract float getDamageIncrease(int level, @NotNull org.bukkit.entity.EntityCategory entityCategory);
+
@ -141,7 +141,7 @@ index daae9bb234d2e10530b2bed35fada98652514e0e..fc30fbffd83285d4ec102a18454ed952
+ * @return the damage increase
+ * @deprecated Enchantments now have a complex effect systems that cannot be reduced to a simple damage increase.
+ */
+ @Contract("-> fail")
+ @Contract("_, _ -> fail")
+ @Deprecated(forRemoval = true, since = "1.21")
+ public abstract float getDamageIncrease(int level, @NotNull org.bukkit.entity.EntityType entityType);
+
@ -170,9 +170,11 @@ index daae9bb234d2e10530b2bed35fada98652514e0e..fc30fbffd83285d4ec102a18454ed952
+ */
+ @NotNull
+ public abstract java.util.Set<org.bukkit.inventory.EquipmentSlotGroup> getActiveSlotGroups();
// Paper end
+ // Paper end - more Enchantment API
+
// Paper start - mark translation key as deprecated
/**
* @deprecated this method assumes that the enchantments description
diff --git a/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java b/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java
index ac0371285370594d4de1554871b19bbcd2311730..da5d153a3e55a38b767359564001ad8663f9730b 100644
--- a/src/main/java/org/bukkit/enchantments/EnchantmentWrapper.java

Datei anzeigen

@ -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 a6e87d06e439bfa85512891da300e2de60b0af95..65e02f66fd275045bd1889b460cc6c0613e19755 100644
index 8a22c242a93b0e16e0bca583d0918bab695248b1..aa1795b9640a5e39cc5063dd3c389f6d5815ed36 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1584,6 +1584,20 @@ public final class Bukkit {
@@ -1595,6 +1595,20 @@ public final class Bukkit {
return server.getConsoleSender();
}
@ -30,10 +30,10 @@ index a6e87d06e439bfa85512891da300e2de60b0af95..65e02f66fd275045bd1889b460cc6c06
* 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 c3f32db8ccd31e3ee8a544dc165540c0fa8bcc35..04b7225486ee61ee66bc8423e46e620c6da9e41d 100644
index 67b5cb7635c4251c259b1fb1ef50f99a0b2647e5..65060c06c1e5521656bd88547b8d0df5975c1d29 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1338,6 +1338,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1349,6 +1349,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@NotNull
public ConsoleCommandSender getConsoleSender();

Datei anzeigen

@ -155,10 +155,10 @@ index 0000000000000000000000000000000000000000..3ede1e8f7bf0436fdc5bf395c0f9eaf1
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 65e02f66fd275045bd1889b460cc6c0613e19755..702e622a2ef2c3dcb0e582e38b3b10f9c939ed97 100644
index aa1795b9640a5e39cc5063dd3c389f6d5815ed36..30cb0f2c4d53a7ad473812810c4f50173b7d7391 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2630,6 +2630,15 @@ public final class Bukkit {
@@ -2641,6 +2641,15 @@ public final class Bukkit {
public static io.papermc.paper.datapack.DatapackManager getDatapackManager() {
return server.getDatapackManager();
}
@ -175,10 +175,10 @@ index 65e02f66fd275045bd1889b460cc6c0613e19755..702e622a2ef2c3dcb0e582e38b3b10f9
@NotNull
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 04b7225486ee61ee66bc8423e46e620c6da9e41d..28e883ffb5c4db22613035899be4a627c230fbf4 100644
index 65060c06c1e5521656bd88547b8d0df5975c1d29..7c33c9489e0f3c4429e9bc30d87a3f4c29ca010f 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2293,5 +2293,12 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2304,5 +2304,12 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
@NotNull
io.papermc.paper.datapack.DatapackManager getDatapackManager();

Datei anzeigen

@ -23,10 +23,10 @@ index 0000000000000000000000000000000000000000..f309961e0e96b6baacc4fe6d80dabd6c
+}
diff --git a/src/main/java/io/papermc/paper/event/block/BlockLockCheckEvent.java b/src/main/java/io/papermc/paper/event/block/BlockLockCheckEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..4c335212f6a5ad4a304c3c0f66ffd7e0974c0572
index 0000000000000000000000000000000000000000..5e2c8ad26dea2c8a84ae10f7da8cb836e78d7b68
--- /dev/null
+++ b/src/main/java/io/papermc/paper/event/block/BlockLockCheckEvent.java
@@ -0,0 +1,186 @@
@@ -0,0 +1,187 @@
+package io.papermc.paper.event.block;
+
+import com.google.common.base.Preconditions;
@ -34,6 +34,7 @@ index 0000000000000000000000000000000000000000..4c335212f6a5ad4a304c3c0f66ffd7e0
+import net.kyori.adventure.sound.Sound;
+import net.kyori.adventure.text.Component;
+import org.bukkit.block.Block;
+import org.bukkit.block.BlockState;
+import org.bukkit.entity.Player;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.block.BlockEvent;
@ -53,7 +54,6 @@ index 0000000000000000000000000000000000000000..4c335212f6a5ad4a304c3c0f66ffd7e0
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ private final LockableTileState state;
+ private final Player player;
+ private Component lockedMessage;
+ private Sound lockedSound;
@ -61,9 +61,8 @@ index 0000000000000000000000000000000000000000..4c335212f6a5ad4a304c3c0f66ffd7e0
+ private Result result = Result.DEFAULT;
+
+ @ApiStatus.Internal
+ public BlockLockCheckEvent(final @NotNull Block block, final @NotNull LockableTileState state, final @NotNull Player player, final @NotNull Component lockedMessage, final @NotNull Sound lockedSound) {
+ public BlockLockCheckEvent(final @NotNull Block block, final @NotNull Player player, final @NotNull Component lockedMessage, final @NotNull Sound lockedSound) {
+ super(block);
+ this.state = state;
+ this.player = player;
+ this.lockedMessage = lockedMessage;
+ this.lockedSound = lockedSound;
@ -76,7 +75,9 @@ index 0000000000000000000000000000000000000000..4c335212f6a5ad4a304c3c0f66ffd7e0
+ * @return the snapshot block state.
+ */
+ public @NotNull LockableTileState getBlockState() {
+ return this.state;
+ final BlockState blockState = this.getBlock().getState();
+ Preconditions.checkState(blockState instanceof LockableTileState, "Block state of lock-checked block is no longer a lockable tile state!");
+ return (LockableTileState) blockState;
+ }
+
+ /**

Datei anzeigen

@ -499,10 +499,10 @@ index 0000000000000000000000000000000000000000..a6b50c9d8af589cc4747e14d343d2045
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 3a8be5316229f372b471549a00eae958543ac91d..51eaeb14c87e317c37fb6d4082d82542b4b925ee 100644
index 556e8c6cf90af9c90ded18be013167fa440d6505..9265ee60edfb3df797e425e854c7d3c9c034a85c 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2661,6 +2661,141 @@ public final class Bukkit {
@@ -2672,6 +2672,141 @@ public final class Bukkit {
}
// Paper end
@ -645,10 +645,10 @@ index 3a8be5316229f372b471549a00eae958543ac91d..51eaeb14c87e317c37fb6d4082d82542
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 547ba309beb6a4d1fdfadb234d671c1475abaae5..9354a0bb002ddfaf8df90a963ae5be577efb8aee 100644
index a859d7bc870e5ef16793c2da453c84685b78ee47..968a5e18a023c92158a753f6d8fce4b2d0f0de48 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2322,4 +2322,119 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2333,4 +2333,119 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
@NotNull org.bukkit.potion.PotionBrewer getPotionBrewer();
// Paper end

Datei anzeigen

@ -1,18 +1,43 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Fri, 23 Jun 2023 12:16:35 -0700
Subject: [PATCH] Add Sign#getInteractableSideFor
Subject: [PATCH] More Sign Block API
Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
diff --git a/src/main/java/org/bukkit/block/Sign.java b/src/main/java/org/bukkit/block/Sign.java
index 1fdb1144949adc3a2b5cbc3aca94d2f8e0c6d9ee..7983ccb54f5f358dea1ffb530b9cc5bd716fb9b1 100644
index 1fdb1144949adc3a2b5cbc3aca94d2f8e0c6d9ee..340e3adcc57227f2e570826681ea81b9159805de 100644
--- a/src/main/java/org/bukkit/block/Sign.java
+++ b/src/main/java/org/bukkit/block/Sign.java
@@ -187,4 +187,34 @@ public interface Sign extends TileState, Colorable {
@@ -182,9 +182,58 @@ public interface Sign extends TileState, Colorable {
/**
* Gets the player that is currently allowed to edit this sign. <br>
* Edits from other players will be rejected if this value is not null.
+ * <br><br>You should prefer {@link #getAllowedEditorUniqueId()} if you don't
+ * need the player instance as this method will fetch the player from UUID.
*
* @return the player allowed to edit this sign, or null
*/
@Nullable
public Player getAllowedEditor();
+ // Paper start - get side for player
+ // Paper start - More Sign Block API
+ /**
+ * Gets the allowed editor's UUID.
+ * <br>Edits from other players will be rejected if this value is not null.
+ *
+ * @return the allowed editor's UUID, or null
+ */
+ @Nullable java.util.UUID getAllowedEditorUniqueId();
+
+ /**
+ * Sets the allowed editor's UUID.
+ * <br><br><b>Note:</b> the server sets the UUID back to null if the player can't
+ * interact with the sign (is either offline or outside the allowed interaction range).
+ *
+ * @param uuid the allowed editor's UUID
+ */
+ void setAllowedEditorUniqueId(@Nullable java.util.UUID uuid);
+
+ /**
+ * Compute the side facing the specified entity.
+ *
@ -41,5 +66,5 @@ index 1fdb1144949adc3a2b5cbc3aca94d2f8e0c6d9ee..7983ccb54f5f358dea1ffb530b9cc5bd
+ * @return the side the coordinates are facing
+ */
+ @NotNull Side getInteractableSideFor(double x, double z);
+ // Paper end
+ // Paper end - More Sign Block API
}

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] API for updating recipes on clients
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 51eaeb14c87e317c37fb6d4082d82542b4b925ee..c9046e30ae9ffe90a1835316e87988ccca25fb4d 100644
index 9265ee60edfb3df797e425e854c7d3c9c034a85c..f2753ef7d53ff3ff3531eaea89e816d7d8ce8b15 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -993,6 +993,26 @@ public final class Bukkit {
@@ -1004,6 +1004,26 @@ public final class Bukkit {
server.reloadData();
}
@ -35,7 +35,7 @@ index 51eaeb14c87e317c37fb6d4082d82542b4b925ee..c9046e30ae9ffe90a1835316e87988cc
/**
* Returns the primary logger associated with this server instance.
*
@@ -1053,6 +1073,20 @@ public final class Bukkit {
@@ -1064,6 +1084,20 @@ public final class Bukkit {
return server.addRecipe(recipe);
}
@ -56,7 +56,7 @@ index 51eaeb14c87e317c37fb6d4082d82542b4b925ee..c9046e30ae9ffe90a1835316e87988cc
/**
* Get a list of all recipes for a given item. The stack size is ignored
* in comparisons. If the durability is -1, it will match any data value.
@@ -1244,6 +1278,24 @@ public final class Bukkit {
@@ -1255,6 +1289,24 @@ public final class Bukkit {
return server.removeRecipe(key);
}
@ -82,10 +82,10 @@ index 51eaeb14c87e317c37fb6d4082d82542b4b925ee..c9046e30ae9ffe90a1835316e87988cc
* Gets a list of command aliases defined in the server properties.
*
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 9354a0bb002ddfaf8df90a963ae5be577efb8aee..e07fa603227dd936146d1bb810559df527aee0c1 100644
index 968a5e18a023c92158a753f6d8fce4b2d0f0de48..b93359e86db14e3a680bcdd8d935e2692c8b64e0 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -842,6 +842,22 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -853,6 +853,22 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
public void reloadData();
@ -108,7 +108,7 @@ index 9354a0bb002ddfaf8df90a963ae5be577efb8aee..e07fa603227dd936146d1bb810559df5
/**
* Returns the primary logger associated with this server instance.
*
@@ -883,15 +899,34 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -894,15 +910,34 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
public boolean dispatchCommand(@NotNull CommandSender sender, @NotNull String commandLine) throws CommandException;
/**
@ -144,7 +144,7 @@ index 9354a0bb002ddfaf8df90a963ae5be577efb8aee..e07fa603227dd936146d1bb810559df5
/**
* Get a list of all recipes for a given item. The stack size is ignored
* in comparisons. If the durability is -1, it will match any data value.
@@ -1060,6 +1095,22 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1071,6 +1106,22 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
public boolean removeRecipe(@NotNull NamespacedKey key);

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Deprecate and replace methods with old StructureType
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index c9046e30ae9ffe90a1835316e87988ccca25fb4d..fffd4b72672d2e3f82c6a018dfc7e95b6eb3fc2d 100644
index f2753ef7d53ff3ff3531eaea89e816d7d8ce8b15..7e70b9b34b170b1c00dd920fabc0e14ed4a14955 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -938,9 +938,6 @@ public final class Bukkit {
@@ -949,9 +949,6 @@ public final class Bukkit {
/**
* Create a new explorer map targeting the closest nearby structure of a
* given {@link StructureType}.
@ -18,7 +18,7 @@ index c9046e30ae9ffe90a1835316e87988ccca25fb4d..fffd4b72672d2e3f82c6a018dfc7e95b
*
* @param world the world the map will belong to
* @param location the origin location to find the nearest structure
@@ -949,7 +946,9 @@ public final class Bukkit {
@@ -960,7 +957,9 @@ public final class Bukkit {
*
* @see World#locateNearestStructure(org.bukkit.Location,
* org.bukkit.StructureType, int, boolean)
@ -28,7 +28,7 @@ index c9046e30ae9ffe90a1835316e87988ccca25fb4d..fffd4b72672d2e3f82c6a018dfc7e95b
@NotNull
public static ItemStack createExplorerMap(@NotNull World world, @NotNull Location location, @NotNull StructureType structureType) {
return server.createExplorerMap(world, location, structureType);
@@ -972,11 +971,54 @@ public final class Bukkit {
@@ -983,11 +982,54 @@ public final class Bukkit {
*
* @see World#locateNearestStructure(org.bukkit.Location,
* org.bukkit.StructureType, int, boolean)
@ -84,10 +84,10 @@ index c9046e30ae9ffe90a1835316e87988ccca25fb4d..fffd4b72672d2e3f82c6a018dfc7e95b
/**
* Reloads the server, refreshing settings and plugin information.
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index e07fa603227dd936146d1bb810559df527aee0c1..6d36734580eb411b00757a1cf63a4e05acbae6b2 100644
index b93359e86db14e3a680bcdd8d935e2692c8b64e0..f2be9647e015761ef7f56331be932a39cb6a5e8b 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -806,16 +806,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -817,16 +817,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*
* @see World#locateNearestStructure(org.bukkit.Location,
* org.bukkit.StructureType, int, boolean)
@ -106,7 +106,7 @@ index e07fa603227dd936146d1bb810559df527aee0c1..6d36734580eb411b00757a1cf63a4e05
*
* @param world the world the map will belong to
* @param location the origin location to find the nearest structure
@@ -827,9 +826,50 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -838,9 +837,50 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*
* @see World#locateNearestStructure(org.bukkit.Location,
* org.bukkit.StructureType, int, boolean)

Datei anzeigen

@ -9,8 +9,26 @@ items need to exist without having a key and so
getKey() methods on Keyed objects that have a registry
are marked as Deprecated or Obsolete.
diff --git a/src/main/java/org/bukkit/Art.java b/src/main/java/org/bukkit/Art.java
index 042d1d932a33022e4fc873652f70dc6ed342d46a..dbbd997d4693f1d9f551bae2ed1d7906c9f39c12 100644
--- a/src/main/java/org/bukkit/Art.java
+++ b/src/main/java/org/bukkit/Art.java
@@ -103,6 +103,13 @@ public enum Art implements Keyed {
return id;
}
+ // Paper start - deprecate getKey
+ /**
+ * @deprecated use {@link Registry#getKey(Keyed)} and {@link Registry#ART}. Painting variants
+ * can exist without a key.
+ */
+ @Deprecated(since = "1.21")
+ // Paper end - deprecate getKey
@NotNull
@Override
public NamespacedKey getKey() {
diff --git a/src/main/java/org/bukkit/MusicInstrument.java b/src/main/java/org/bukkit/MusicInstrument.java
index 62d2b3f950860dee0898d77b0a29635c3f9a7e23..704dba92f9246ef398ed8d162ebee3cf305960e1 100644
index 62d2b3f950860dee0898d77b0a29635c3f9a7e23..98fdfc8978fea1937e31a7427433a1927d42ec7d 100644
--- a/src/main/java/org/bukkit/MusicInstrument.java
+++ b/src/main/java/org/bukkit/MusicInstrument.java
@@ -53,6 +53,16 @@ public abstract class MusicInstrument implements Keyed, net.kyori.adventure.tran
@ -22,7 +40,7 @@ index 62d2b3f950860dee0898d77b0a29635c3f9a7e23..704dba92f9246ef398ed8d162ebee3cf
+ * @deprecated use {@link Registry#getKey(Keyed)} and {@link Registry#INSTRUMENT}. MusicInstruments
+ * can exist without a key.
+ */
+ @Deprecated
+ @Deprecated(forRemoval = true, since = "1.20.5")
+ @Override
+ public abstract @NotNull NamespacedKey getKey();
+ // Paper end - deprecate getKey
@ -31,7 +49,7 @@ index 62d2b3f950860dee0898d77b0a29635c3f9a7e23..704dba92f9246ef398ed8d162ebee3cf
@Override
public @NotNull String translationKey() {
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
index 0ee9a8728035217bb95c7fba917b45a5ef2ea533..cd1e38debbec745dd13cd895327f544dcf42594d 100644
index 1df2b8fcf90333d5981f16d9dddddd48289f94e4..5d21459e9128c515508a2b4b2265d9824e10d9d5 100644
--- a/src/main/java/org/bukkit/Registry.java
+++ b/src/main/java/org/bukkit/Registry.java
@@ -359,6 +359,79 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@ -127,8 +145,26 @@ index 0ee9a8728035217bb95c7fba917b45a5ef2ea533..cd1e38debbec745dd13cd895327f544d
+ // Paper end - improve Registry
}
}
diff --git a/src/main/java/org/bukkit/Sound.java b/src/main/java/org/bukkit/Sound.java
index 8c7b50906fc5b84c5570408f357410810bbfbded..7a35120c82b88774de777d3c3176ef553a8e9244 100644
--- a/src/main/java/org/bukkit/Sound.java
+++ b/src/main/java/org/bukkit/Sound.java
@@ -1636,6 +1636,13 @@ public enum Sound implements Keyed, net.kyori.adventure.sound.Sound.Type { // Pa
this.key = NamespacedKey.minecraft(key);
}
+ // Paper start - deprecate getKey
+ /**
+ * @deprecated use {@link Registry#getKey(Keyed)} and {@link Registry#SOUNDS}. Sounds
+ * can exist without a key.
+ */
+ @Deprecated(since = "1.20.5")
+ // Paper end - deprecate getKey
@NotNull
@Override
public NamespacedKey getKey() {
diff --git a/src/main/java/org/bukkit/block/banner/PatternType.java b/src/main/java/org/bukkit/block/banner/PatternType.java
index 9e90572745909538e942b7fbe788b5286c6cc9a3..100f93358e0a1fa8507775a2afd29314ff353a87 100644
index 9e90572745909538e942b7fbe788b5286c6cc9a3..e2afb2582a27b94a922754115dbb6b4ca35e0154 100644
--- a/src/main/java/org/bukkit/block/banner/PatternType.java
+++ b/src/main/java/org/bukkit/block/banner/PatternType.java
@@ -56,6 +56,13 @@ public interface PatternType extends OldEnum<PatternType>, Keyed {
@ -140,7 +176,7 @@ index 9e90572745909538e942b7fbe788b5286c6cc9a3..100f93358e0a1fa8507775a2afd29314
+ * @deprecated use {@link Registry#getKey(Keyed)} and {@link Registry#BANNER_PATTERN}. PatternTypes
+ * can exist without a key.
+ */
+ @Deprecated
+ @Deprecated(since = "1.20.5")
+ // Paper end - deprecate getKey
@Override
@NotNull

Datei anzeigen

@ -68,10 +68,10 @@ index a77c0411a68a9bad33ddfb335b7a996a843e478c..739d9d3ec789e58c10c8d818a9ca59ce
/**
* Banned player names
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index fffd4b72672d2e3f82c6a018dfc7e95b6eb3fc2d..4705c1d91e39fcc3c608b1f1a38a30d063ccf06e 100644
index 7e70b9b34b170b1c00dd920fabc0e14ed4a14955..419c056faf0d49d9b0435feb01252e87e227b9a9 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1652,11 +1652,27 @@ public final class Bukkit {
@@ -1663,11 +1663,27 @@ public final class Bukkit {
* @param <T> The ban target
*
* @return a ban list of the specified type
@ -100,10 +100,10 @@ index fffd4b72672d2e3f82c6a018dfc7e95b6eb3fc2d..4705c1d91e39fcc3c608b1f1a38a30d0
/**
* Gets a set containing all player operators.
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 6d36734580eb411b00757a1cf63a4e05acbae6b2..c043d239c449bf4bb13a24467f2f6c67b4d28d2d 100644
index f2be9647e015761ef7f56331be932a39cb6a5e8b..5aa64ea39ebd92e5067c53cea49a8685c0b9eee4 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1414,10 +1414,25 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1425,10 +1425,25 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @param <T> The ban target
*
* @return a ban list of the specified type

Datei anzeigen

@ -13,6 +13,9 @@ recipes and ingredient slots.
Also fixes some issues regarding mutability of both ItemStack
and implementations of RecipeChoice.
Also adds some validation regarding Materials passed to RecipeChoice
being items.
diff --git a/src/main/java/org/bukkit/inventory/CookingRecipe.java b/src/main/java/org/bukkit/inventory/CookingRecipe.java
index f7fa79393aef40027446b78bac8e9490cfafd8bc..07906ca1a9b39fcc6774870daa498402f7f37917 100644
--- a/src/main/java/org/bukkit/inventory/CookingRecipe.java
@ -126,7 +129,7 @@ index 39f9766a03d420340d79841197f75c8b1dd49f4a..4e59f5176fd6cf92457ad750081c253a
}
}
diff --git a/src/main/java/org/bukkit/inventory/RecipeChoice.java b/src/main/java/org/bukkit/inventory/RecipeChoice.java
index 91bfeffcdbe47208c7d0ddbe013cd0f11fddfa32..e7796054f3f65f5bea7f93c75320195f6c2f0561 100644
index 91bfeffcdbe47208c7d0ddbe013cd0f11fddfa32..f1aa67997f904953742e8895e49341c2f73d44a2 100644
--- a/src/main/java/org/bukkit/inventory/RecipeChoice.java
+++ b/src/main/java/org/bukkit/inventory/RecipeChoice.java
@@ -22,6 +22,19 @@ import org.jetbrains.annotations.NotNull;
@ -163,6 +166,24 @@ index 91bfeffcdbe47208c7d0ddbe013cd0f11fddfa32..e7796054f3f65f5bea7f93c75320195f
/**
* Represents a choice of multiple matching Materials.
*/
@@ -60,8 +80,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
* @param choices the tag
*/
public MaterialChoice(@NotNull Tag<Material> choices) {
- Preconditions.checkArgument(choices != null, "choices");
- this.choices = new ArrayList<>(choices.getValues());
+ this(new ArrayList<>(java.util.Objects.requireNonNull(choices, "Cannot create a material choice with null tag").getValues())); // Paper - delegate to list ctor to make sure all checks are called
}
public MaterialChoice(@NotNull List<Material> choices) {
@@ -78,6 +97,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
}
Preconditions.checkArgument(!choice.isAir(), "Cannot have empty/air choice");
+ Preconditions.checkArgument(choice.isItem(), "Cannot have non-item choice %s", choice); // Paper - validate material choice input to items
this.choices.add(choice);
}
}
@@ -152,6 +172,16 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
public String toString() {
return "MaterialChoice{" + "choices=" + choices + '}';

Datei anzeigen

@ -40,6 +40,46 @@ index a6d1dde422de98f178c0c9add99e01203a35e5cb..01ec84248a681180088fb1d7d22b80f8
ItemType.Typed<ItemMeta> TOTEM_OF_UNDYING = getItemType("totem_of_undying");
ItemType.Typed<ItemMeta> SHULKER_SHELL = getItemType("shulker_shell");
ItemType.Typed<ItemMeta> IRON_NUGGET = getItemType("iron_nugget");
diff --git a/src/main/java/org/bukkit/inventory/meta/CompassMeta.java b/src/main/java/org/bukkit/inventory/meta/CompassMeta.java
index 5040ab6190b41442986d2a734a8e782df0eab2f6..48bac38469ce3c5b2e59ad115375e7e5a2417da7 100644
--- a/src/main/java/org/bukkit/inventory/meta/CompassMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/CompassMeta.java
@@ -28,7 +28,8 @@ public interface CompassMeta extends ItemMeta {
/**
* Sets the location this lodestone compass will point to.
*
- * @param lodestone new location or null to clear
+ * @param lodestone new location or null to clear the targeted location
+ * @see #clearLodestone() to reset the compass to a normal compass
*/
void setLodestone(@Nullable Location lodestone);
@@ -49,9 +50,25 @@ public interface CompassMeta extends ItemMeta {
* location.
*
* @param tracked new tracked status
+ * @see #clearLodestone() to reset the compass to a normal compass
*/
void setLodestoneTracked(boolean tracked);
+ // Paper start - Add more lodestone compass methods
+ /**
+ * Checks if this compass is considered a lodestone compass.
+ * @see #hasLodestone() to check if a position is being tracked
+ * @see #isLodestoneTracked() to check if it verifies the position is a lodestone
+ */
+ boolean isLodestoneCompass();
+
+ /**
+ * Reset this compass to a normal compass, removing any tracked
+ * location.
+ */
+ void clearLodestone();
+ // Paper end - Add more lodestone compass methods
+
@Override
CompassMeta clone();
}
diff --git a/src/main/java/org/bukkit/inventory/meta/Damageable.java b/src/main/java/org/bukkit/inventory/meta/Damageable.java
index ff6818b6d9e0207eafdd749928f33aeac3f27191..992f39da07bafe9769effaa7dc6adc018c89329d 100644
--- a/src/main/java/org/bukkit/inventory/meta/Damageable.java
@ -92,6 +132,31 @@ index ff6818b6d9e0207eafdd749928f33aeac3f27191..992f39da07bafe9769effaa7dc6adc01
/**
* Checks to see if this item has a maximum amount of damage.
*
diff --git a/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java b/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java
index 9bd15803cd3526da951ed197305a1b9385305927..5833c4c16b08a0f338a5cd7c0011e82eeda222c2 100644
--- a/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java
@@ -75,10 +75,20 @@ public interface FireworkMeta extends ItemMeta {
*/
boolean hasEffects();
+ // Paper start - add hasPower
+ /**
+ * Checks if power is defined on this meta.
+ *
+ * @return true if there is a power specified
+ */
+ boolean hasPower();
+ // Paper end - add hasPower
+
/**
* Gets the approximate height the firework will fly.
*
* @return approximate flight height of the firework.
+ * @see #hasPower()
*/
int getPower();
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
index 1a4260b00b193b94ce4b1b2954644f4e41baff4c..5d5fcb2720b62e47d47f441032c4de02574b051a 100644
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java

Datei anzeigen

@ -0,0 +1,69 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Fri, 19 Jul 2024 08:43:01 -0700
Subject: [PATCH] Add even more Enchantment API
In a separate patch because it uses RegistryKeySet which
is after the previous "more enchant api" patch.
diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/java/org/bukkit/enchantments/Enchantment.java
index 53dbb852d6a34f0814b81852c7f10f55c38299e7..f38321c437b19125d57d25419e3cb564e3928d89 100644
--- a/src/main/java/org/bukkit/enchantments/Enchantment.java
+++ b/src/main/java/org/bukkit/enchantments/Enchantment.java
@@ -438,6 +438,56 @@ public abstract class Enchantment implements Keyed, Translatable, net.kyori.adve
public abstract java.util.Set<org.bukkit.inventory.EquipmentSlotGroup> getActiveSlotGroups();
// Paper end - more Enchantment API
+ // Paper start - even more Enchantment API
+ /**
+ * Provides the description of this enchantment entry as displayed to the client, e.g. "Sharpness" for the sharpness
+ * enchantment.
+ *
+ * @return the description component.
+ */
+ public abstract net.kyori.adventure.text.@NotNull Component description();
+
+ /**
+ * Provides the registry key set referencing the items this enchantment is supported on.
+ *
+ * @return the registry key set.
+ */
+ @org.jetbrains.annotations.ApiStatus.Experimental
+ public abstract io.papermc.paper.registry.set.@NotNull RegistryKeySet<org.bukkit.inventory.ItemType> getSupportedItems();
+
+ /**
+ * Provides the registry key set referencing the item types this enchantment can be applied to when
+ * enchanting in an enchantment table.
+ * <p>
+ * If this value is {@code null}, {@link #getSupportedItems()} will be sourced instead in the context of an enchantment table.
+ * Additionally, the tag {@link io.papermc.paper.registry.keys.tags.EnchantmentTagKeys#IN_ENCHANTING_TABLE} defines
+ * which enchantments can even show up in an enchantment table.
+ *
+ * @return the registry key set.
+ */
+ @org.jetbrains.annotations.ApiStatus.Experimental
+ public abstract io.papermc.paper.registry.set.@Nullable RegistryKeySet<org.bukkit.inventory.ItemType> getPrimaryItems();
+
+ /**
+ * Provides the weight of this enchantment used by the weighted random when selecting enchantments.
+ *
+ * @return the weight value.
+ * @see <a href="https://minecraft.wiki/w/Enchanting">https://minecraft.wiki/w/Enchanting</a> for examplary weights.
+ */
+ public abstract int getWeight();
+
+ /**
+ * Provides the registry key set of enchantments that this enchantment is exclusive with.
+ * <p>
+ * Exclusive enchantments prohibit the application of this enchantment to an item if they are already present on
+ * said item.
+ *
+ * @return a registry set of enchantments exclusive to this one.
+ */
+ @org.jetbrains.annotations.ApiStatus.Experimental
+ public abstract io.papermc.paper.registry.set.@NotNull RegistryKeySet<Enchantment> getExclusiveWith();
+ // Paper end - even more Enchantment API
+
// Paper start - mark translation key as deprecated
/**
* @deprecated this method assumes that the enchantments description

Datei anzeigen

@ -0,0 +1,74 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Date: Sat, 22 Jun 2024 21:11:58 +0200
Subject: [PATCH] Leashable API
diff --git a/src/main/java/io/papermc/paper/entity/Leashable.java b/src/main/java/io/papermc/paper/entity/Leashable.java
new file mode 100644
index 0000000000000000000000000000000000000000..7402bab20db0ebcac5b2d492ad002ecf9669caad
--- /dev/null
+++ b/src/main/java/io/papermc/paper/entity/Leashable.java
@@ -0,0 +1,36 @@
+package io.papermc.paper.entity;
+
+import org.bukkit.entity.Entity;
+import org.checkerframework.checker.nullness.qual.NonNull;
+import org.checkerframework.checker.nullness.qual.Nullable;
+
+/**
+ * Represents an entity that can be leashed.
+ */
+public interface Leashable extends Entity {
+
+ /**
+ * Returns whether the entity is currently leashed.
+ *
+ * @return whether the entity is leashed
+ */
+ boolean isLeashed();
+
+ /**
+ * Gets the entity that is currently leading this entity.
+ *
+ * @return the entity holding the leash
+ * @throws IllegalStateException if not currently leashed
+ */
+ @NonNull Entity getLeashHolder() throws IllegalStateException;
+
+ /**
+ * Sets the leash on this entity to be held by the supplied entity.
+ * <p>
+ * This method has no effect on players.
+ *
+ * @param holder the entity to leash this entity to, or {@code null} to unleash
+ * @return whether the operation was successful
+ */
+ boolean setLeashHolder(@Nullable Entity holder);
+}
diff --git a/src/main/java/org/bukkit/entity/Boat.java b/src/main/java/org/bukkit/entity/Boat.java
index 2ac685fb1817f3ce06ebe6391cc863712d68367c..d80524fe32672a8b8940d1028abf22026dace8d2 100644
--- a/src/main/java/org/bukkit/entity/Boat.java
+++ b/src/main/java/org/bukkit/entity/Boat.java
@@ -7,7 +7,7 @@ import org.jetbrains.annotations.NotNull;
/**
* Represents a boat entity.
*/
-public interface Boat extends Vehicle {
+public interface Boat extends Vehicle, io.papermc.paper.entity.Leashable { // Paper - Leashable API
/**
* Gets the wood type of the boat.
diff --git a/src/main/java/org/bukkit/entity/Mob.java b/src/main/java/org/bukkit/entity/Mob.java
index 256e5645bcfa76e7ede58ae365e69b4a4bed6204..9a10262a952e330f42187d6e4edab5a225bfba62 100644
--- a/src/main/java/org/bukkit/entity/Mob.java
+++ b/src/main/java/org/bukkit/entity/Mob.java
@@ -8,7 +8,7 @@ import org.jetbrains.annotations.Nullable;
/**
* Represents a Mob. Mobs are living entities with simple AI.
*/
-public interface Mob extends LivingEntity, Lootable {
+public interface Mob extends LivingEntity, Lootable, io.papermc.paper.entity.Leashable { // Paper - Leashable API
// Paper start
@Override

Datei anzeigen

@ -0,0 +1,26 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: okx-code <okx@okx.sh>
Date: Sat, 17 Aug 2024 13:02:56 +0100
Subject: [PATCH] Add enchantment seed update API
diff --git a/src/main/java/org/bukkit/inventory/view/EnchantmentView.java b/src/main/java/org/bukkit/inventory/view/EnchantmentView.java
index e3471d50673f55e0012f73695f845a71cf188d65..3812a540941337c56f3d4e89bb6a4eb8c914b903 100644
--- a/src/main/java/org/bukkit/inventory/view/EnchantmentView.java
+++ b/src/main/java/org/bukkit/inventory/view/EnchantmentView.java
@@ -17,6 +17,15 @@ public interface EnchantmentView extends InventoryView {
*/
int getEnchantmentSeed();
+ // Paper start - add enchantment seed update API
+ /**
+ * Sets the random enchantment seed used in this view. Loses its effect once the view is closed.
+ *
+ * @param seed the random seed to use
+ */
+ void setEnchantmentSeed(int seed);
+ // Paper end - add enchantment seed update API
+
/**
* Gets the offers of this EnchantmentView
*

Datei anzeigen

@ -487,10 +487,10 @@ index 0000000000000000000000000000000000000000..d9502ba028a96f9cc846f9ed428bd806
+}
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
new file mode 100644
index 0000000000000000000000000000000000000000..e727414d784debd276dcc42aabf588d6fcbccc91
index 0000000000000000000000000000000000000000..45ab7ff5497ceccb85944d2e8d354d9c860abf3b
--- /dev/null
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -0,0 +1,323 @@
@@ -0,0 +1,324 @@
+package io.papermc.paper.configuration;
+
+import co.aikar.timings.MinecraftTimings;
@ -513,6 +513,7 @@ index 0000000000000000000000000000000000000000..e727414d784debd276dcc42aabf588d6
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.OptionalInt;
+
+@SuppressWarnings({"CanBeFinal", "FieldCanBeLocal", "FieldMayBeFinal", "NotNullFieldNotInitialized", "InnerClassMayBeStatic"})
+public class GlobalConfiguration extends ConfigurationPart {
@ -723,7 +724,7 @@ index 0000000000000000000000000000000000000000..e727414d784debd276dcc42aabf588d6
+ public BookSize bookSize;
+
+ public class BookSize extends ConfigurationPart {
+ public int pageMax = 2560; // TODO this appears to be a duplicate setting with one above
+ public IntOr.Disabled pageMax = new IntOr.Disabled(OptionalInt.of(2560)); // TODO this appears to be a duplicate setting with one above
+ public double totalMultiplier = 0.98D; // TODO this should probably be merged into the above inner class
+ }
+ public boolean resolveSelectorsInBooks = false;
@ -854,10 +855,10 @@ index 0000000000000000000000000000000000000000..69add4a7f1147015806bc9b63a8340d1
+}
diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
new file mode 100644
index 0000000000000000000000000000000000000000..783eac6e458c6f1a0584301fb84a2fe341868f34
index 0000000000000000000000000000000000000000..1029b6de6f36b08bf634b4056ef5701383f6f258
--- /dev/null
+++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
@@ -0,0 +1,466 @@
@@ -0,0 +1,467 @@
+package io.papermc.paper.configuration;
+
+import com.google.common.base.Suppliers;
@ -885,6 +886,7 @@ index 0000000000000000000000000000000000000000..783eac6e458c6f1a0584301fb84a2fe3
+import io.papermc.paper.configuration.transformation.world.versioned.V30_RenameFilterNbtFromSpawnEgg;
+import io.papermc.paper.configuration.transformation.world.versioned.V31_SpawnLoadedRangeToGameRule;
+import io.papermc.paper.configuration.type.BooleanOrDefault;
+import io.papermc.paper.configuration.type.DespawnRange;
+import io.papermc.paper.configuration.type.Duration;
+import io.papermc.paper.configuration.type.DurationOrDisabled;
+import io.papermc.paper.configuration.type.EngineMode;
@ -1029,6 +1031,14 @@ index 0000000000000000000000000000000000000000..783eac6e458c6f1a0584301fb84a2fe3
+ .register(MapSerializer.TYPE, new MapSerializer(false))
+ .register(new EnumValueSerializer())
+ .register(new ComponentSerializer())
+ .register(IntOr.Default.SERIALIZER)
+ .register(IntOr.Disabled.SERIALIZER)
+ .register(DoubleOr.Default.SERIALIZER)
+ .register(DoubleOr.Disabled.SERIALIZER)
+ .register(BooleanOrDefault.SERIALIZER)
+ .register(Duration.SERIALIZER)
+ .register(DurationOrDisabled.SERIALIZER)
+ .register(NbtPathSerializer.SERIALIZER)
+ );
+ }
+
@ -1052,8 +1062,6 @@ index 0000000000000000000000000000000000000000..783eac6e458c6f1a0584301fb84a2fe3
+ .header(GLOBAL_HEADER)
+ .serializers(builder -> builder
+ .register(new PacketClassSerializer())
+ .register(IntOr.Default.SERIALIZER)
+ .register(DoubleOr.Default.SERIALIZER)
+ );
+ }
+
@ -1095,15 +1103,9 @@ index 0000000000000000000000000000000000000000..783eac6e458c6f1a0584301fb84a2fe3
+ .register(new TypeToken<Reference2IntMap<?>>() {}, new FastutilMapSerializer.SomethingToPrimitive<Reference2IntMap<?>>(Reference2IntOpenHashMap::new, Integer.TYPE))
+ .register(new TypeToken<Reference2LongMap<?>>() {}, new FastutilMapSerializer.SomethingToPrimitive<Reference2LongMap<?>>(Reference2LongOpenHashMap::new, Long.TYPE))
+ .register(new TypeToken<Table<?, ?, ?>>() {}, new TableSerializer())
+ .register(DespawnRange.class, DespawnRange.SERIALIZER)
+ .register(StringRepresentableSerializer::isValidFor, new StringRepresentableSerializer())
+ .register(IntOr.Default.SERIALIZER)
+ .register(IntOr.Disabled.SERIALIZER)
+ .register(DoubleOr.Default.SERIALIZER)
+ .register(BooleanOrDefault.SERIALIZER)
+ .register(Duration.SERIALIZER)
+ .register(DurationOrDisabled.SERIALIZER)
+ .register(EngineMode.SERIALIZER)
+ .register(NbtPathSerializer.SERIALIZER)
+ .register(FallbackValueSerializer.create(contextMap.require(SPIGOT_WORLD_CONFIG_CONTEXT_KEY).get(), MinecraftServer::getServer))
+ .register(new RegistryValueSerializer<>(new TypeToken<EntityType<?>>() {}, access, Registries.ENTITY_TYPE, true))
+ .register(new RegistryValueSerializer<>(Item.class, access, Registries.ITEM, true))
@ -1414,10 +1416,10 @@ index 0000000000000000000000000000000000000000..990d1bb46e0f9719f4e9af928d80ac6f
+}
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
new file mode 100644
index 0000000000000000000000000000000000000000..4bcf27f98765abf693e535cfc1756c27a10cb316
index 0000000000000000000000000000000000000000..aa3624fb8aaaf2720aaef7800f537dd4b906797f
--- /dev/null
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
@@ -0,0 +1,554 @@
@@ -0,0 +1,573 @@
+package io.papermc.paper.configuration;
+
+import com.google.common.collect.HashBasedTable;
@ -1429,6 +1431,7 @@ index 0000000000000000000000000000000000000000..4bcf27f98765abf693e535cfc1756c27
+import io.papermc.paper.configuration.serializer.NbtPathSerializer;
+import io.papermc.paper.configuration.transformation.world.FeatureSeedsGeneration;
+import io.papermc.paper.configuration.type.BooleanOrDefault;
+import io.papermc.paper.configuration.type.DespawnRange;
+import io.papermc.paper.configuration.type.Duration;
+import io.papermc.paper.configuration.type.DurationOrDisabled;
+import io.papermc.paper.configuration.type.EngineMode;
@ -1478,6 +1481,7 @@ index 0000000000000000000000000000000000000000..4bcf27f98765abf693e535cfc1756c27
+import org.spongepowered.configurate.objectmapping.meta.PostProcess;
+import org.spongepowered.configurate.objectmapping.meta.Required;
+import org.spongepowered.configurate.objectmapping.meta.Setting;
+import org.spongepowered.configurate.serialize.SerializationException;
+
+@SuppressWarnings({"FieldCanBeLocal", "FieldMayBeFinal", "NotNullFieldNotInitialized", "InnerClassMayBeStatic"})
+public class WorldConfiguration extends ConfigurationPart {
@ -1603,12 +1607,29 @@ index 0000000000000000000000000000000000000000..4bcf27f98765abf693e535cfc1756c27
+ @MergeMap
+ public Reference2IntMap<MobCategory> spawnLimits = Util.make(new Reference2IntOpenHashMap<>(NaturalSpawner.SPAWNING_CATEGORIES.length), map -> Arrays.stream(NaturalSpawner.SPAWNING_CATEGORIES).forEach(mobCategory -> map.put(mobCategory, -1)));
+ @MergeMap
+ public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), category.getDespawnDistance())));
+ public Map<MobCategory, DespawnRangePair> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> DespawnRangePair.createDefault()));
+ public DespawnRange.Shape despawnRangeShape = DespawnRange.Shape.ELLIPSOID;
+ @MergeMap
+ public Reference2IntMap<MobCategory> ticksPerSpawn = Util.make(new Reference2IntOpenHashMap<>(NaturalSpawner.SPAWNING_CATEGORIES.length), map -> Arrays.stream(NaturalSpawner.SPAWNING_CATEGORIES).forEach(mobCategory -> map.put(mobCategory, -1)));
+
+ @ConfigSerializable
+ public record DespawnRange(@Required int soft, @Required int hard) {
+ public record DespawnRangePair(@Required DespawnRange hard, @Required DespawnRange soft) {
+ public static DespawnRangePair createDefault() {
+ return new DespawnRangePair(
+ new DespawnRange(IntOr.Default.USE_DEFAULT),
+ new DespawnRange(IntOr.Default.USE_DEFAULT)
+ );
+ }
+ }
+
+ @PostProcess
+ public void precomputeDespawnDistances() throws SerializationException {
+ for (Map.Entry<MobCategory, DespawnRangePair> entry : this.despawnRanges.entrySet()) {
+ final MobCategory category = entry.getKey();
+ final DespawnRangePair range = entry.getValue();
+ range.hard().preComputed(category.getDespawnDistance(), category.getSerializedName());
+ range.soft().preComputed(category.getNoDespawnDistance(), category.getSerializedName());
+ }
+ }
+
+ public WaterAnimalSpawnHeight wateranimalSpawnHeight;
@ -1962,7 +1983,7 @@ index 0000000000000000000000000000000000000000..4bcf27f98765abf693e535cfc1756c27
+ public boolean showSignClickCommandFailureMsgsToPlayer = false;
+ public RedstoneImplementation redstoneImplementation = RedstoneImplementation.VANILLA;
+ public boolean disableEndCredits = false;
+ public double maxLeashDistance = Leashable.LEASH_TOO_FAR_DIST;
+ public DoubleOr.Default maxLeashDistance = DoubleOr.Default.USE_DEFAULT;
+ public boolean disableSprintInterruptionOnAttack = false;
+ public int shieldBlockingDelay = 5;
+ public boolean disableRelativeProjectileVelocity = false;
@ -2841,7 +2862,7 @@ index 0000000000000000000000000000000000000000..4af710e144b70933d750c22edfe484c1
+}
diff --git a/src/main/java/io/papermc/paper/configuration/serializer/collections/MapSerializer.java b/src/main/java/io/papermc/paper/configuration/serializer/collections/MapSerializer.java
new file mode 100644
index 0000000000000000000000000000000000000000..9b5075c39a4ef931cdb99e9aee8a33c6d88c2a2e
index 0000000000000000000000000000000000000000..e7e997796ec47c742cc1f98e61db75a4231e6f98
--- /dev/null
+++ b/src/main/java/io/papermc/paper/configuration/serializer/collections/MapSerializer.java
@@ -0,0 +1,162 @@
@ -2933,7 +2954,7 @@ index 0000000000000000000000000000000000000000..9b5075c39a4ef931cdb99e9aee8a33c6
+ return serializer.deserialize(type, node);
+ } catch (SerializationException ex) {
+ ex.initPath(node::path);
+ LOGGER.error("Could not deserialize {} {} into {} at {}", mapPart, node.raw(), type, path);
+ LOGGER.error("Could not deserialize {} {} into {} at {}: {}", mapPart, node.raw(), type, path, ex.rawMessage());
+ }
+ return null;
+ }
@ -2994,7 +3015,7 @@ index 0000000000000000000000000000000000000000..9b5075c39a4ef931cdb99e9aee8a33c6
+ return true;
+ } catch (SerializationException ex) {
+ ex.initPath(node::path);
+ LOGGER.error("Could not serialize {} {} from {} at {}", mapPart, object, type, path);
+ LOGGER.error("Could not serialize {} {} from {} at {}: {}", mapPart, object, type, path, ex.rawMessage());
+ }
+ return false;
+ }
@ -4190,6 +4211,121 @@ index 0000000000000000000000000000000000000000..a3eaa47cfcfc4fd2a607f9b375230fad
+ }
+ }
+}
diff --git a/src/main/java/io/papermc/paper/configuration/type/DespawnRange.java b/src/main/java/io/papermc/paper/configuration/type/DespawnRange.java
new file mode 100644
index 0000000000000000000000000000000000000000..8a792a000e924b3ddc572edc788598811e9ef71c
--- /dev/null
+++ b/src/main/java/io/papermc/paper/configuration/type/DespawnRange.java
@@ -0,0 +1,109 @@
+package io.papermc.paper.configuration.type;
+
+import io.papermc.paper.configuration.type.number.IntOr;
+import java.lang.reflect.Type;
+import org.checkerframework.checker.nullness.qual.Nullable;
+import org.spongepowered.configurate.ConfigurationNode;
+import org.spongepowered.configurate.serialize.SerializationException;
+import org.spongepowered.configurate.serialize.TypeSerializer;
+
+/*
+(x/a)^2 + (y/b)^2 + (z/c)^2 < 1
+a == c
+ac = horizontal limit
+b = vertical limit
+x^2/ac^2 + y^2/b^2 + z^2/ac^2 < 1
+(x^2 + z^2)/ac^2 + y^2/b^2 < 1
+x^2 + z^2 + (y^2 * (ac^2/b^2)) < ac^2
+ */
+public final class DespawnRange {
+
+ public static final TypeSerializer<DespawnRange> SERIALIZER = new Serializer();
+
+ private final IntOr.Default horizontalLimit;
+ private final IntOr.Default verticalLimit;
+ private final boolean wasDefinedViaLongSyntax;
+
+ // cached values
+ private double preComputedHorizontalLimitSquared; // ac^2
+ private double preComputedHorizontalLimitSquaredOverVerticalLimitSquared; // ac^2/b^2
+ private int preComputedVanillaDefaultLimit;
+
+ public DespawnRange(final IntOr.Default generalLimit) {
+ this(generalLimit, generalLimit, false);
+ }
+
+ public DespawnRange(final IntOr.Default horizontalLimit, final IntOr.Default verticalLimit, final boolean wasDefinedViaLongSyntax) {
+ this.horizontalLimit = horizontalLimit;
+ this.verticalLimit = verticalLimit;
+ this.wasDefinedViaLongSyntax = wasDefinedViaLongSyntax;
+ }
+
+ public void preComputed(int defaultDistanceLimit, String identifier) throws SerializationException {
+ if (this.verticalLimit.or(defaultDistanceLimit) <= 0) {
+ throw new SerializationException("Vertical limit must be greater than 0 for " + identifier);
+ }
+ if (this.horizontalLimit.or(defaultDistanceLimit) <= 0) {
+ throw new SerializationException("Horizontal limit must be greater than 0 for " + identifier);
+ }
+ this.preComputedVanillaDefaultLimit = defaultDistanceLimit;
+ this.preComputedHorizontalLimitSquared = Math.pow(this.horizontalLimit.or(defaultDistanceLimit), 2);
+ if (!this.horizontalLimit.isDefined() && !this.verticalLimit.isDefined()) {
+ this.preComputedHorizontalLimitSquaredOverVerticalLimitSquared = 1.0;
+ } else {
+ this.preComputedHorizontalLimitSquaredOverVerticalLimitSquared = this.preComputedHorizontalLimitSquared / Math.pow(this.verticalLimit.or(defaultDistanceLimit), 2);
+ }
+ }
+
+ public boolean shouldDespawn(final Shape shape, final double dxSqr, final double dySqr, final double dzSqr, final double dy) {
+ if (shape == Shape.ELLIPSOID) {
+ return dxSqr + dzSqr + (dySqr * this.preComputedHorizontalLimitSquaredOverVerticalLimitSquared) > this.preComputedHorizontalLimitSquared;
+ } else {
+ return dxSqr + dzSqr > this.preComputedHorizontalLimitSquared || dy > this.verticalLimit.or(this.preComputedVanillaDefaultLimit);
+ }
+ }
+
+ public boolean wasDefinedViaLongSyntax() {
+ return this.wasDefinedViaLongSyntax;
+ }
+
+ public enum Shape {
+ CYLINDER, ELLIPSOID
+ }
+
+ static final class Serializer implements TypeSerializer<DespawnRange> {
+
+ public static final String HORIZONTAL = "horizontal";
+ public static final String VERTICAL = "vertical";
+
+ @Override
+ public DespawnRange deserialize(final Type type, final ConfigurationNode node) throws SerializationException {
+ if (node.hasChild(HORIZONTAL) && node.hasChild(VERTICAL)) {
+ return new DespawnRange(
+ node.node(HORIZONTAL).require(IntOr.Default.class),
+ node.node(VERTICAL).require(IntOr.Default.class),
+ true
+ );
+ } else if (node.hasChild(HORIZONTAL) || node.hasChild(VERTICAL)) {
+ throw new SerializationException(node, DespawnRange.class, "Expected both horizontal and vertical despawn ranges to be defined");
+ } else {
+ return new DespawnRange(node.require(IntOr.Default.class));
+ }
+ }
+
+ @Override
+ public void serialize(final Type type, final @Nullable DespawnRange despawnRange, final ConfigurationNode node) throws SerializationException {
+ if (despawnRange == null) {
+ node.raw(null);
+ return;
+ }
+
+ if (despawnRange.wasDefinedViaLongSyntax()) {
+ node.node(HORIZONTAL).set(despawnRange.horizontalLimit);
+ node.node(VERTICAL).set(despawnRange.verticalLimit);
+ } else {
+ node.set(despawnRange.verticalLimit);
+ }
+ }
+ }
+}
diff --git a/src/main/java/io/papermc/paper/configuration/type/Duration.java b/src/main/java/io/papermc/paper/configuration/type/Duration.java
new file mode 100644
index 0000000000000000000000000000000000000000..422ccb0b332b3e94be228b9b94f379467d6461a5
@ -4689,14 +4825,15 @@ index 0000000000000000000000000000000000000000..31068170086aeac51a2adb952b19672e
+}
diff --git a/src/main/java/io/papermc/paper/configuration/type/number/DoubleOr.java b/src/main/java/io/papermc/paper/configuration/type/number/DoubleOr.java
new file mode 100644
index 0000000000000000000000000000000000000000..5833c06b0707906ab7d10786ecd115f20e42e925
index 0000000000000000000000000000000000000000..0e7205e6ba9b207082c8c530142f0b832dcd242d
--- /dev/null
+++ b/src/main/java/io/papermc/paper/configuration/type/number/DoubleOr.java
@@ -0,0 +1,59 @@
@@ -0,0 +1,74 @@
+package io.papermc.paper.configuration.type.number;
+
+import com.google.common.base.Preconditions;
+import java.util.OptionalDouble;
+import java.util.function.DoublePredicate;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import org.spongepowered.configurate.serialize.ScalarSerializer;
@ -4719,6 +4856,20 @@ index 0000000000000000000000000000000000000000..5833c06b0707906ab7d10786ecd115f2
+ public static final ScalarSerializer<Default> SERIALIZER = new Serializer<>(Default.class, Default::new, DEFAULT_VALUE, USE_DEFAULT);
+ }
+
+ record Disabled(OptionalDouble value) implements DoubleOr {
+ private static final String DISABLED_VALUE = "disabled";
+ public static final Disabled DISABLED = new Disabled(OptionalDouble.empty());
+ public static final ScalarSerializer<Disabled> SERIALIZER = new Serializer<>(Disabled.class, Disabled::new, DISABLED_VALUE, DISABLED);
+
+ public boolean test(DoublePredicate predicate) {
+ return this.value.isPresent() && predicate.test(this.value.getAsDouble());
+ }
+
+ public boolean enabled() {
+ return this.value.isPresent();
+ }
+ }
+
+ final class Serializer<T extends DoubleOr> extends OptionalNumSerializer<T, OptionalDouble> {
+ Serializer(final Class<T> classOfT, final Function<OptionalDouble, T> factory, String emptySerializedValue, T emptyValue) {
+ super(classOfT, emptySerializedValue, emptyValue, OptionalDouble::empty, OptionalDouble::isEmpty, factory, double.class);
@ -4754,10 +4905,10 @@ index 0000000000000000000000000000000000000000..5833c06b0707906ab7d10786ecd115f2
+
diff --git a/src/main/java/io/papermc/paper/configuration/type/number/IntOr.java b/src/main/java/io/papermc/paper/configuration/type/number/IntOr.java
new file mode 100644
index 0000000000000000000000000000000000000000..09f16e5dde565801b153bd6705637c5f71427c8a
index 0000000000000000000000000000000000000000..73a7b664923121daedac8f01a26253438da68119
--- /dev/null
+++ b/src/main/java/io/papermc/paper/configuration/type/number/IntOr.java
@@ -0,0 +1,81 @@
@@ -0,0 +1,85 @@
+package io.papermc.paper.configuration.type.number;
+
+import com.google.common.base.Preconditions;
@ -4779,6 +4930,10 @@ index 0000000000000000000000000000000000000000..09f16e5dde565801b153bd6705637c5f
+
+ OptionalInt value();
+
+ default boolean isDefined() {
+ return this.value().isPresent();
+ }
+
+ default int intValue() {
+ return this.value().orElseThrow();
+ }

Datei anzeigen

@ -2872,7 +2872,7 @@ index e7c407039fef88ef01ba9b6be9ae5bcc3edc026f..5457358bc76889153036818fdfd70a04
@Override
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index e244ac9f51a08603a7877e7e655fda26cd396772..556d8f23ee2de77cea71abcc0e56718e60b20b05 100644
index 2de70e3a3038b2d2bb47b58f0e14d937c35d55ba..4acee8121ff62413dbbf2294d17da3bd2f974d5a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -45,6 +45,7 @@ import net.minecraft.nbt.CompoundTag;
@ -4677,10 +4677,10 @@ index 5725b0281ac53a2354b233223259d6784353bc6e..9ef939b76d06874b856e0c850addb364
@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 938a7ee49a727d5929d1d049c61d2881cf24ff9c..78f4bb474c85e32448a385e108707d92082bfe02 100644
index 20eb63eeac7f5c9a1d98a9aa8f90a588cb036c70..8f468a3bfa8ef381eabb45ebb3dd9a4942e98dd5 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -915,7 +915,7 @@ public class CraftEventFactory {
@@ -917,7 +917,7 @@ public class CraftEventFactory {
return event;
}
@ -4689,7 +4689,7 @@ index 938a7ee49a727d5929d1d049c61d2881cf24ff9c..78f4bb474c85e32448a385e108707d92
CraftPlayer entity = victim.getBukkitEntity();
CraftDamageSource bukkitDamageSource = new CraftDamageSource(damageSource);
PlayerDeathEvent event = new PlayerDeathEvent(entity, bukkitDamageSource, drops, victim.getExpReward(damageSource.getEntity()), 0, deathMessage);
@@ -948,7 +948,7 @@ public class CraftEventFactory {
@@ -950,7 +950,7 @@ public class CraftEventFactory {
* Server methods
*/
public static ServerListPingEvent callServerListPingEvent(SocketAddress address, String motd, int numPlayers, int maxPlayers) {

Datei anzeigen

@ -5,23 +5,43 @@ Subject: [PATCH] Add configurable entity despawn distances
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 0593d828c911c94c9833bf12b9c294e5dac1f4e8..5fd0e3d27f3c86f1ff767b45dfa6138c30f13e3e 100644
index 0593d828c911c94c9833bf12b9c294e5dac1f4e8..02c8c52930640114592148fd5509ad8fffee5435 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -864,14 +864,14 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
@@ -863,20 +863,24 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
Player entityhuman = this.level().getNearestPlayer(this, -1.0D);
if (entityhuman != null) {
double d0 = entityhuman.distanceToSqr((Entity) this);
- double d0 = entityhuman.distanceToSqr((Entity) this);
- int i = this.getType().getCategory().getDespawnDistance();
+ int i = this.level().paperConfig().entities.spawning.despawnRanges.get(this.getType().getCategory()).hard(); // Paper - Configurable despawn distances
int j = i * i;
if (d0 > (double) j && this.removeWhenFarAway(d0)) {
- int j = i * i;
-
- if (d0 > (double) j && this.removeWhenFarAway(d0)) {
+ // Paper start - Configurable despawn distances
+ final io.papermc.paper.configuration.WorldConfiguration.Entities.Spawning.DespawnRangePair despawnRangePair = this.level().paperConfig().entities.spawning.despawnRanges.get(this.getType().getCategory());
+ final io.papermc.paper.configuration.type.DespawnRange.Shape shape = this.level().paperConfig().entities.spawning.despawnRangeShape;
+ final double dy = Math.abs(entityhuman.getY() - this.getY());
+ final double dySqr = Math.pow(dy, 2);
+ final double dxSqr = Math.pow(entityhuman.getX() - this.getX(), 2);
+ final double dzSqr = Math.pow(entityhuman.getZ() - this.getZ(), 2);
+ final double distanceSquared = dxSqr + dzSqr + dySqr;
+ // Despawn if hard/soft limit is exceeded
+ if (despawnRangePair.hard().shouldDespawn(shape, dxSqr, dySqr, dzSqr, dy) && this.removeWhenFarAway(distanceSquared)) {
this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
}
-
- int k = this.getType().getCategory().getNoDespawnDistance();
+ int k = this.level().paperConfig().entities.spawning.despawnRanges.get(this.getType().getCategory()).soft(); // Paper - Configurable despawn distances
int l = k * k;
if (this.noActionTime > 600 && this.random.nextInt(800) == 0 && d0 > (double) l && this.removeWhenFarAway(d0)) {
- int l = k * k;
-
- if (this.noActionTime > 600 && this.random.nextInt(800) == 0 && d0 > (double) l && this.removeWhenFarAway(d0)) {
- this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
- } else if (d0 < (double) l) {
+ if (despawnRangePair.soft().shouldDespawn(shape, dxSqr, dySqr, dzSqr, dy)) {
+ if (this.noActionTime > 600 && this.random.nextInt(800) == 0 && this.removeWhenFarAway(distanceSquared)) {
+ this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
+ }
+ } else {
+ // Paper end - Configurable despawn distances
this.noActionTime = 0;
}
}

Datei anzeigen

@ -21,7 +21,7 @@ index 3126e8cab3c40e3af47f4c8925e1c6a9523309ba..3207166061bf9c4d7bf3f38e5a9f7aff
public static Predicate<Entity> withinDistance(double x, double y, double z, double max) {
double d4 = max * max;
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 5fd0e3d27f3c86f1ff767b45dfa6138c30f13e3e..a753fd0434f611d8c77270012e383e3210f1194b 100644
index 4ce1586351b417aede1fd401907388b5fa0e9fd6..d8beadc96a7f779c39c8e22ffe52d872ac49a0ad 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -860,7 +860,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
@ -32,7 +32,7 @@ index 5fd0e3d27f3c86f1ff767b45dfa6138c30f13e3e..a753fd0434f611d8c77270012e383e32
+ Player entityhuman = this.level().findNearbyPlayer(this, -1.0D, EntitySelector.PLAYER_AFFECTS_SPAWNING); // Paper - Affects Spawning API
if (entityhuman != null) {
double d0 = entityhuman.distanceToSqr((Entity) this);
// Paper start - Configurable despawn distances
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java b/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java
index 3b7fc11b7832a72fb9b0806fe9847f4e30759e7b..3cb84856c10347162a8736ae1ef65165183ec8fe 100644
--- a/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Check online mode before converting and renaming player data
diff --git a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
index 79222a04ef104bf2eed85684479384b7c350ea19..e11c8523e633d2a8e3cea7ecd54978b2958b9684 100644
index 79222a04ef104bf2eed85684479384b7c350ea19..cd013567dd6224c86c0f1813d8a3d5fb7b8cabb5 100644
--- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
+++ b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
@@ -78,7 +78,7 @@ public class PlayerDataStorage {
@ -13,7 +13,7 @@ index 79222a04ef104bf2eed85684479384b7c350ea19..e11c8523e633d2a8e3cea7ecd54978b2
// Spigot Start
boolean usingWrongFile = false;
- if ( !file1.exists() )
+ if ( org.bukkit.Bukkit.getOnlineMode() && !file.exists() ) // Paper - Check online mode first
+ if ( org.bukkit.Bukkit.getOnlineMode() && !file1.exists() ) // Paper - Check online mode first
{
file1 = new File( file, java.util.UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + name ).getBytes( java.nio.charset.StandardCharsets.UTF_8 ) ).toString() + s );
if ( file1.exists() )

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add configurable portal search radius
diff --git a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
index 462afb22cce2376789e44283032e63a6264cf851..19c813ab9e71eed150ae569f903287e9283d9292 100644
index 462afb22cce2376789e44283032e63a6264cf851..8072e67f7b2f5944670159d3de1b01090bd1019d 100644
--- a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
@@ -139,8 +139,14 @@ public class NetherPortalBlock extends Block implements Portal {
@ -20,7 +20,7 @@ index 462afb22cce2376789e44283032e63a6264cf851..19c813ab9e71eed150ae569f903287e9
+ // Paper end - Configurable portal search radius
// CraftBukkit start
- CraftPortalEvent event = entity.callPortalEvent(entity, CraftLocation.toBukkit(blockposition1, worldserver1.getWorld()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, flag ? 16 : 128, 16);
+ CraftPortalEvent event = entity.callPortalEvent(entity, CraftLocation.toBukkit(blockposition1, worldserver1.getWorld()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, portalSearchRadius, 16); // Paper - use custom portal search radius
+ CraftPortalEvent event = entity.callPortalEvent(entity, CraftLocation.toBukkit(blockposition1, worldserver1.getWorld()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, portalSearchRadius, worldserver1.paperConfig().environment.portalCreateRadius); // Paper - use custom portal search radius
if (event == null) {
return null;
}

Datei anzeigen

@ -28,7 +28,7 @@ index 1e9c68cd1868d083e6a790d56006dd4aa432010a..8a0ee9564fc36a2badf1357f7e6c47b5
+ // Paper end - PlayerUseUnknownEntityEvent
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 64db7e017b41bffcaac202ee4ecfd7df46d69331..14a821bfc6b20475889d3138b8da9e6bfaf1787c 100644
index 02b9e1ed57f5d65698c461387ff7d48450e6a70f..0d18b12d0755c14bd041e0f98177469612262fde 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2493,7 +2493,26 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -59,10 +59,10 @@ index 64db7e017b41bffcaac202ee4ecfd7df46d69331..14a821bfc6b20475889d3138b8da9e6b
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 78f4bb474c85e32448a385e108707d92082bfe02..b68068c783f782258f86e5ecf54664916f069e38 100644
index 8f468a3bfa8ef381eabb45ebb3dd9a4942e98dd5..96e0fc5c8a018fd579f24529175decdac634cfa1 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1915,4 +1915,13 @@ public class CraftEventFactory {
@@ -1931,4 +1931,13 @@ public class CraftEventFactory {
Bukkit.getPluginManager().callEvent(new EntityRemoveEvent(entity.getBukkitEntity(), cause));
}

Datei anzeigen

@ -28,10 +28,10 @@ index 63c10be6eacd7108b8b4795d76bf624e0614440a..243eb1e54293c763a06febff551c0513
entitywitch.finalizeSpawn(world, world.getCurrentDifficultyAt(entitywitch.blockPosition()), MobSpawnType.CONVERSION, (SpawnGroupData) 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 b68068c783f782258f86e5ecf54664916f069e38..44c416f812867f19a26aeefc5710a7aef9dfdf64 100644
index 96e0fc5c8a018fd579f24529175decdac634cfa1..50f33c6029c190f947b6bf6215004416b034c0cc 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1215,6 +1215,14 @@ public class CraftEventFactory {
@@ -1217,6 +1217,14 @@ public class CraftEventFactory {
return !event.isCancelled();
}

Datei anzeigen

@ -18,10 +18,10 @@ index 56402312e44d12c859e2c4b39902d31b7cfd1573..25a45e680f9fdea90f43d59de87a3a50
--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 44c416f812867f19a26aeefc5710a7aef9dfdf64..a83b7f350bf20f944de92df76e112aaa49dc608d 100644
index 50f33c6029c190f947b6bf6215004416b034c0cc..d36e039aa5f1cf84179def5df5addaf448f54bd2 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1168,6 +1168,17 @@ public class CraftEventFactory {
@@ -1170,6 +1170,17 @@ public class CraftEventFactory {
return event;
}

Datei anzeigen

@ -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 a83b7f350bf20f944de92df76e112aaa49dc608d..b5b237c56575e8ceb3e6471deec1e7712891a8e0 100644
index d36e039aa5f1cf84179def5df5addaf448f54bd2..91180d7ad705ca97c0df43debc14b204127165d0 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1321,6 +1321,16 @@ public class CraftEventFactory {
@@ -1323,6 +1323,16 @@ public class CraftEventFactory {
Bukkit.getPluginManager().callEvent(crafterCraftEvent);
return crafterCraftEvent;
}
@ -26,7 +26,7 @@ index a83b7f350bf20f944de92df76e112aaa49dc608d..b5b237c56575e8ceb3e6471deec1e771
public static ProjectileLaunchEvent callProjectileLaunchEvent(Entity entity) {
Projectile bukkitEntity = (Projectile) entity.getBukkitEntity();
@@ -1346,8 +1356,15 @@ public class CraftEventFactory {
@@ -1348,8 +1358,15 @@ public class CraftEventFactory {
if (position.getType() == HitResult.Type.ENTITY) {
hitEntity = ((EntityHitResult) position).getEntity().getBukkitEntity();
}

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Item#canEntityPickup
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index a753fd0434f611d8c77270012e383e3210f1194b..55aecada617bd84676928a7818f1511b2d85e7bf 100644
index d8beadc96a7f779c39c8e22ffe52d872ac49a0ad..fe00b73b0aeac4e4c1496dcaf81595f57a4a073f 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -673,6 +673,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab

Datei anzeigen

@ -49,10 +49,10 @@ index aa54237205989f619ac6a3faa2e4285427b9e31d..43d399e1a0ba2fb0541f851a28032fa6
if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) {
continue;
diff --git a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java
index 571756dacfa16f6755b67457e17969c35104f971..52d71a03cd5b2af56704f265ce5b5f14d3236ebb 100644
index 55d63de57ec740fc4ea5faa3db9a092b8e4fed95..c3f6522a7dc0777c5b3fa2bac63a8901f96d9f38 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java
@@ -225,6 +225,7 @@ public final class TrialSpawner {
@@ -230,6 +230,7 @@ public final class TrialSpawner {
optional1.ifPresent(entityinsentient::equip);
}

Datei anzeigen

@ -33,10 +33,10 @@ index eef3517833ff5c0cf41b89973ebc972b8ed31e0f..c9fbc01be0b0e7fd1cafb091d06496f4
(type, meta) -> meta instanceof CraftMetaArmorStand armorStand ? armorStand : new CraftMetaArmorStand(meta));
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java
index c4f12f96e39cb6189799a796b4cb2cb4f0b92392..59bdac414e8205ed608f79ef0d1502acd826d216 100644
index c4f12f96e39cb6189799a796b4cb2cb4f0b92392..ecce5d0da946ca279c5608068442cc53437dd2a5 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java
@@ -11,9 +11,22 @@ import org.bukkit.Material;
@@ -11,9 +11,17 @@ import org.bukkit.Material;
import org.bukkit.configuration.serialization.DelegateDeserialization;
@DelegateDeserialization(SerializableMeta.class)
@ -45,229 +45,182 @@ index c4f12f96e39cb6189799a796b4cb2cb4f0b92392..59bdac414e8205ed608f79ef0d1502ac
static final ItemMetaKeyType<CustomData> ENTITY_TAG = new ItemMetaKeyType<>(DataComponents.ENTITY_DATA, "entity-tag");
+ // Paper start
+ static final ItemMetaKey ENTITY_ID = new ItemMetaKey("id", "entity-id");
+ static final ItemMetaKey INVISIBLE = new ItemMetaKey("Invisible", "invisible");
+ static final ItemMetaKey NO_BASE_PLATE = new ItemMetaKey("NoBasePlate", "no-base-plate");
+ static final ItemMetaKey SHOW_ARMS = new ItemMetaKey("ShowArms", "show-arms");
+ static final ItemMetaKey SMALL = new ItemMetaKey("Small", "small");
+ static final ItemMetaKey MARKER = new ItemMetaKey("Marker", "marker");
+
+ private Boolean invisible = null;
+ private Boolean noBasePlate = null;
+ private Boolean showArms = null;
+ private Boolean small = null;
+ private Boolean marker = null;
+ // Paper end
CompoundTag entityTag;
CraftMetaArmorStand(CraftMetaItem meta) {
@@ -24,6 +37,13 @@ public class CraftMetaArmorStand extends CraftMetaItem {
}
CraftMetaArmorStand armorStand = (CraftMetaArmorStand) meta;
+ // Paper start
+ this.invisible = armorStand.invisible;
+ this.noBasePlate = armorStand.noBasePlate;
+ this.showArms = armorStand.showArms;
+ this.small = armorStand.small;
+ this.marker = armorStand.marker;
+ // Paper end
this.entityTag = armorStand.entityTag;
}
@@ -32,11 +52,39 @@ public class CraftMetaArmorStand extends CraftMetaItem {
getOrEmpty(tag, CraftMetaArmorStand.ENTITY_TAG).ifPresent((nbt) -> {
this.entityTag = nbt.copyTag();
+ // Paper start
+ if (entityTag.contains(INVISIBLE.NBT)) {
+ invisible = entityTag.getBoolean(INVISIBLE.NBT);
+ }
+
+ if (entityTag.contains(NO_BASE_PLATE.NBT)) {
+ noBasePlate = entityTag.getBoolean(NO_BASE_PLATE.NBT);
+ }
+
+ if (entityTag.contains(SHOW_ARMS.NBT)) {
+ showArms = entityTag.getBoolean(SHOW_ARMS.NBT);
+ }
+
+ if (entityTag.contains(SMALL.NBT)) {
+ small = entityTag.getBoolean(SMALL.NBT);
+ }
+
+ if (entityTag.contains(MARKER.NBT)) {
+ marker = entityTag.getBoolean(MARKER.NBT);
+ }
+ // Paper end
});
}
@@ -37,6 +45,42 @@ public class CraftMetaArmorStand extends CraftMetaItem {
CraftMetaArmorStand(Map<String, Object> map) {
super(map);
+ // Paper start
+ this.invisible = SerializableMeta.getBoolean(map, INVISIBLE.BUKKIT);
+ this.noBasePlate = SerializableMeta.getBoolean(map, NO_BASE_PLATE.BUKKIT);
+ this.showArms = SerializableMeta.getBoolean(map, SHOW_ARMS.BUKKIT);
+ this.small = SerializableMeta.getBoolean(map, SMALL.BUKKIT);
+ this.marker = SerializableMeta.getBoolean(map, MARKER.BUKKIT);
+ String entityTag = SerializableMeta.getString(map, ENTITY_TAG.BUKKIT, true);
+ if (entityTag != null) {
+ java.io.ByteArrayInputStream buf = new java.io.ByteArrayInputStream(java.util.Base64.getDecoder().decode(entityTag));
+ try {
+ this.entityTag = net.minecraft.nbt.NbtIo.readCompressed(buf, net.minecraft.nbt.NbtAccounter.unlimitedHeap());
+ } catch (java.io.IOException ex) {
+ java.util.logging.Logger.getLogger(CraftMetaItem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ }
+ return;
+ }
+ SerializableMeta.getObjectOptionally(Boolean.class, map, INVISIBLE.BUKKIT, true).ifPresent((value) -> {
+ populateTagIfNull();
+ this.entityTag.putBoolean(INVISIBLE.NBT, value);
+ });
+ SerializableMeta.getObjectOptionally(Boolean.class, map, NO_BASE_PLATE.BUKKIT, true).ifPresent((value) -> {
+ populateTagIfNull();
+ this.entityTag.putBoolean(NO_BASE_PLATE.NBT, value);
+ });
+ SerializableMeta.getObjectOptionally(Boolean.class, map, SHOW_ARMS.BUKKIT, true).ifPresent((value) -> {
+ populateTagIfNull();
+ this.entityTag.putBoolean(SHOW_ARMS.NBT, value);
+ });
+ SerializableMeta.getObjectOptionally(Boolean.class, map, SMALL.BUKKIT, true).ifPresent((value) -> {
+ populateTagIfNull();
+ this.entityTag.putBoolean(SMALL.NBT, value);
+ });
+ SerializableMeta.getObjectOptionally(Boolean.class, map, MARKER.BUKKIT, true).ifPresent((value) -> {
+ populateTagIfNull();
+ this.entityTag.putBoolean(MARKER.NBT, value);
+ });
+ SerializableMeta.getObjectOptionally(String.class, map, ENTITY_ID, true).ifPresent((value) -> {
+ populateTagIfNull();
+ this.entityTag.putString(ENTITY_ID.NBT, value);
+ });
+ // Paper end
}
@Override
@@ -59,6 +107,31 @@ public class CraftMetaArmorStand extends CraftMetaItem {
void applyToItem(CraftMetaItem.Applicator tag) {
super.applyToItem(tag);
@@ -45,12 +89,13 @@ public class CraftMetaArmorStand extends CraftMetaItem {
+ // Paper start
+ if (!isArmorStandEmpty() && this.entityTag == null) {
+ this.entityTag = new CompoundTag();
+ }
+
+ if (this.invisible != null) {
+ this.entityTag.putBoolean(INVISIBLE.NBT, this.invisible);
+ }
+
+ if (this.noBasePlate != null) {
+ this.entityTag.putBoolean(NO_BASE_PLATE.NBT, this.noBasePlate);
+ }
+
+ if (this.showArms != null) {
+ this.entityTag.putBoolean(SHOW_ARMS.NBT, this.showArms);
+ }
+
+ if (this.small != null) {
+ this.entityTag.putBoolean(SMALL.NBT, this.small);
+ }
+
+ if (this.marker != null) {
+ this.entityTag.putBoolean(MARKER.NBT, this.marker);
+ }
+ // Paper end
if (this.entityTag != null) {
tag.put(CraftMetaArmorStand.ENTITY_TAG, CustomData.of(this.entityTag));
if (tag.contains(CraftMetaArmorStand.ENTITY_TAG.NBT)) {
this.entityTag = tag.getCompound(CraftMetaArmorStand.ENTITY_TAG.NBT);
+ if (!this.entityTag.contains(ENTITY_ID.NBT)) entityTag.putString(ENTITY_ID.NBT, "minecraft:armor_stand"); // Paper - fixup legacy armorstand metas that did not include this.
}
@@ -75,7 +148,7 @@ public class CraftMetaArmorStand extends CraftMetaItem {
}
@Override
void serializeInternal(Map<String, Tag> internalTags) {
- if (this.entityTag != null && !this.entityTag.isEmpty()) {
+ if (false && this.entityTag != null && !this.entityTag.isEmpty()) { // Paper - now correctly serialised as entity tag
internalTags.put(CraftMetaArmorStand.ENTITY_TAG.NBT, this.entityTag);
}
}
@@ -75,7 +120,7 @@ public class CraftMetaArmorStand extends CraftMetaItem {
}
boolean isArmorStandEmpty() {
- return !(this.entityTag != null);
+ return !(this.invisible != null || this.noBasePlate != null || this.showArms != null || this.small != null || this.marker != null || this.entityTag != null); // Paper
+ return entityTag == null || entityTag.isEmpty(); // Paper - consider armor stand empty if tag is empty.
}
@Override
@@ -86,7 +159,14 @@ public class CraftMetaArmorStand extends CraftMetaItem {
@@ -86,7 +131,9 @@ public class CraftMetaArmorStand extends CraftMetaItem {
if (meta instanceof CraftMetaArmorStand) {
CraftMetaArmorStand that = (CraftMetaArmorStand) meta;
- return this.entityTag != null ? that.entityTag != null && this.entityTag.equals(that.entityTag) : this.entityTag == null;
+ // Paper start
+ return java.util.Objects.equals(this.entityTag, that.entityTag) &&
+ this.invisible == that.invisible &&
+ this.noBasePlate == that.noBasePlate &&
+ this.showArms == that.showArms &&
+ this.small == that.small &&
+ this.marker == that.marker;
+ return java.util.Objects.equals(this.entityTag, that.entityTag);
+ // Paper end
}
return true;
}
@@ -104,6 +184,13 @@ public class CraftMetaArmorStand extends CraftMetaItem {
if (this.entityTag != null) {
hash = 73 * hash + this.entityTag.hashCode();
}
+ // Paper start
+ hash = 61 * hash + (this.invisible != null ? Boolean.hashCode(this.isInvisible()) : 0);
+ hash = 61 * hash + (this.noBasePlate != null ? Boolean.hashCode(this.hasNoBasePlate()) : 0);
+ hash = 61 * hash + (this.showArms != null ? Boolean.hashCode(this.shouldShowArms()) : 0);
+ hash = 61 * hash + (this.small != null ? Boolean.hashCode(this.isSmall()) : 0);
+ hash = 61 * hash + (this.marker != null ? Boolean.hashCode(this.isMarker()) : 0);
+ // Paper end
return original != hash ? CraftMetaArmorStand.class.hashCode() ^ hash : hash;
}
@@ -112,6 +199,28 @@ public class CraftMetaArmorStand extends CraftMetaItem {
@@ -112,6 +159,21 @@ public class CraftMetaArmorStand extends CraftMetaItem {
Builder<String, Object> serialize(Builder<String, Object> builder) {
super.serialize(builder);
+ // Paper start
+ if (invisible != null) {
+ builder.put(INVISIBLE.BUKKIT, invisible);
+ if (entityTag == null) {
+ return builder;
+ } else if (true) {
+ java.io.ByteArrayOutputStream buf = new java.io.ByteArrayOutputStream();
+ try {
+ net.minecraft.nbt.NbtIo.writeCompressed(entityTag, buf);
+ } catch (java.io.IOException ex) {
+ java.util.logging.Logger.getLogger(CraftMetaItem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ }
+
+ if (noBasePlate != null) {
+ builder.put(NO_BASE_PLATE.BUKKIT, noBasePlate);
+ }
+
+ if (showArms != null) {
+ builder.put(SHOW_ARMS.BUKKIT, showArms);
+ }
+
+ if (small != null) {
+ builder.put(SMALL.BUKKIT, small);
+ }
+
+ if (marker != null) {
+ builder.put(MARKER.BUKKIT, marker);
+ builder.put(ENTITY_TAG.BUKKIT, java.util.Base64.getEncoder().encodeToString(buf.toByteArray()));
+ return builder;
+ }
+ // Paper end
+
return builder;
}
@@ -125,4 +234,56 @@ public class CraftMetaArmorStand extends CraftMetaItem {
@@ -125,4 +187,68 @@ public class CraftMetaArmorStand extends CraftMetaItem {
return clone;
}
+
+ // Paper start
+ private void populateTagIfNull() {
+ if (this.entityTag == null) {
+ this.entityTag = new CompoundTag();
+ this.entityTag.putString(ENTITY_ID.NBT, "minecraft:armor_stand");
+ }
+ }
+
+ @Override
+ public boolean isInvisible() {
+ return invisible != null && invisible;
+ return entityTag != null && entityTag.contains(INVISIBLE.NBT) && entityTag.getBoolean(INVISIBLE.NBT);
+ }
+
+ @Override
+ public boolean hasNoBasePlate() {
+ return noBasePlate != null && noBasePlate;
+ return entityTag != null && entityTag.contains(NO_BASE_PLATE.NBT) && entityTag.getBoolean(NO_BASE_PLATE.NBT);
+ }
+
+ @Override
+ public boolean shouldShowArms() {
+ return showArms != null && showArms;
+ return entityTag != null && entityTag.contains(SHOW_ARMS.NBT) && entityTag.getBoolean(SHOW_ARMS.NBT);
+ }
+
+ @Override
+ public boolean isSmall() {
+ return small != null && small;
+ return entityTag != null && entityTag.contains(SMALL.NBT) && entityTag.getBoolean(SMALL.NBT);
+ }
+
+ @Override
+ public boolean isMarker() {
+ return marker != null && marker;
+ return entityTag != null && entityTag.contains(MARKER.NBT) && entityTag.getBoolean(MARKER.NBT);
+ }
+
+ @Override
+ public void setInvisible(boolean invisible) {
+ this.invisible = invisible;
+ populateTagIfNull();
+ entityTag.putBoolean(INVISIBLE.NBT, invisible);
+ }
+
+ @Override
+ public void setNoBasePlate(boolean noBasePlate) {
+ this.noBasePlate = noBasePlate;
+ populateTagIfNull();
+ entityTag.putBoolean(NO_BASE_PLATE.NBT, noBasePlate);
+ }
+
+ @Override
+ public void setShowArms(boolean showArms) {
+ this.showArms = showArms;
+ populateTagIfNull();
+ entityTag.putBoolean(SHOW_ARMS.NBT, showArms);
+ }
+
+ @Override
+ public void setSmall(boolean small) {
+ this.small = small;
+ populateTagIfNull();
+ entityTag.putBoolean(SMALL.NBT, small);
+ }
+
+ @Override
+ public void setMarker(boolean marker) {
+ this.marker = marker;
+ populateTagIfNull();
+ entityTag.putBoolean(MARKER.NBT, marker);
+ }
+ // Paper end
}

Datei anzeigen

@ -22,10 +22,10 @@ index a14e00d55930628333cc63b18727ea56dbdc4ee3..f6d01d21745391595d61b191832be4c2
this.setUsingItem(true);
if (!this.isSilent()) {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index b5b237c56575e8ceb3e6471deec1e7712891a8e0..cfdabb93c2d30845af9108552ed9bee9929250ce 100644
index 91180d7ad705ca97c0df43debc14b204127165d0..e3af0db8082e4e90902197f96f1c833405bf5f63 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1960,4 +1960,14 @@ public class CraftEventFactory {
@@ -1976,4 +1976,14 @@ public class CraftEventFactory {
).callEvent();
}
// Paper end - PlayerUseUnknownEntityEvent

Datei anzeigen

@ -93,10 +93,10 @@ index cccc60602360f25f0aeddbd16dad2bb63a1728a8..ada79af49d1cafe25ca6c1fb456e1c4c
}
}
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 55aecada617bd84676928a7818f1511b2d85e7bf..f56d431207323a80b7f566ac6e30eebf232ee695 100644
index 62c3b3d992aff2aa20857e2b3bee464a377a0857..25a71cc5ca8cf8a5070cd24eb56fe0d79e765669 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -1691,7 +1691,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
@@ -1695,7 +1695,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
if (f1 > 0.0F && target instanceof LivingEntity) {
LivingEntity entityliving = (LivingEntity) target;
@ -273,10 +273,10 @@ index 6476c644d3da824c5ee4190cb45cde678ff1188f..b216140a8be65e210250358af8daf493
// CraftBukkit end
entity.setDeltaMovement(entity.getDeltaMovement().add(vec3d1));
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index cfdabb93c2d30845af9108552ed9bee9929250ce..e1b7bd5c23ba79b84ad257b7fb45e251da3978e5 100644
index e3af0db8082e4e90902197f96f1c833405bf5f63..3059a21b554db99af96c76f72dd08591c00e3e08 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1922,19 +1922,33 @@ public class CraftEventFactory {
@@ -1938,19 +1938,33 @@ public class CraftEventFactory {
return event;
}

Datei anzeigen

@ -5,17 +5,19 @@ Subject: [PATCH] Add config to disable ender dragon legacy check
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
index 1a56247191172622f2bde6d799bc44f70b9ce3ae..6f9c78b124a33212125e98905efc8a09a1891500 100644
index 1a56247191172622f2bde6d799bc44f70b9ce3ae..93337fd026fefb76c8a288674fed05cb3c1eca38 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -106,6 +106,10 @@ public class EndDragonFight {
this.ticksSinceLastPlayerScan = 21;
this.skipArenaLoadedCheck = false;
this.needsStateScanning = true;
@@ -116,6 +116,12 @@ public class EndDragonFight {
if (data.isRespawning) {
this.respawnStage = DragonRespawnAnimation.START;
}
+ // Paper start - Add config to disable ender dragon legacy check
+ this.needsStateScanning = world.paperConfig().entities.spawning.scanForLegacyEnderDragon;
+ if (!this.needsStateScanning) this.dragonKilled = true;
+ if (data == EndDragonFight.Data.DEFAULT && !world.paperConfig().entities.spawning.scanForLegacyEnderDragon) {
+ this.needsStateScanning = false;
+ this.dragonKilled = true;
+ }
+ // Paper end - Add config to disable ender dragon legacy check
this.level = world;
this.origin = origin;
this.validPlayer = EntitySelector.ENTITY_STILL_ALIVE.and(EntitySelector.withinDistance((double) origin.getX(), (double) (128 + origin.getY()), (double) origin.getZ(), 192.0D));
this.portalLocation = (BlockPos) data.exitPortalLocation.orElse(null); // CraftBukkit - decompile error
this.gateways.addAll((Collection) data.gateways.orElseGet(() -> {

Datei anzeigen

@ -75,7 +75,7 @@ index fb5130b6378554ccb23fb7992e408497ca093ff3..0dee94f1dd27a0d7e709367450c5ef79
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 72edfb965aca81c2d2442b794b42baa04ec713b3..a954d3b0ff0917d857002dba70c54b3fcdf77943 100644
index 0073c6c5433be3193a01257a26c7035e544f37dd..0321128ab745250e79fa5f66079c9aeb7f394cc0 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2619,10 +2619,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -178,10 +178,10 @@ index 4e5dba1da323f12d77a36635c9227b1239856254..12c61db6d4b1284765f9bed3ae26131a
// 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 9225746382bcecb0bab655a8232fecc09169225d..bf3995795295c3224db97e4d6809c0f5da6ce55c 100644
index 3059a21b554db99af96c76f72dd08591c00e3e08..9b6607700ed23b97755a2171a49b22d498a60626 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1281,7 +1281,7 @@ public class CraftEventFactory {
@@ -1283,7 +1283,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
@ -190,7 +190,7 @@ index 9225746382bcecb0bab655a8232fecc09169225d..bf3995795295c3224db97e4d6809c0f5
}
CraftServer server = player.level().getCraftServer();
@@ -1477,8 +1477,18 @@ public class CraftEventFactory {
@@ -1479,8 +1479,18 @@ public class CraftEventFactory {
return event;
}

Datei anzeigen

@ -89,10 +89,10 @@ index a9227581ec78a56e96dc3a342006e4a649906326..5929b450a26e7c3cf63de3dc1d0e67cb
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 ad271871b207b425ef8d599fe74a67d065d66686..d1b473ef83df0ed4ae7cd9dd0525dac5e8a41223 100644
index 9b6607700ed23b97755a2171a49b22d498a60626..0613bdf3c2325d5cab64783af7211b07fcf5124a 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1327,6 +1327,14 @@ public class CraftEventFactory {
@@ -1329,6 +1329,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);

Datei anzeigen

@ -19,7 +19,7 @@ public net.minecraft.world.entity.LivingEntity getDeathSound()Lnet/minecraft/sou
public net.minecraft.world.entity.LivingEntity getSoundVolume()F
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index a3a1450949703851625bbb257e92b3be4d79a06a..ff3f70b8c266dc3b2ab374ffd6905ecbfe8510be 100644
index 0dee94f1dd27a0d7e709367450c5ef7956e27217..fa8640f961b93dc811296131dfda58faa1908add 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -269,6 +269,10 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
@ -80,7 +80,7 @@ index a3a1450949703851625bbb257e92b3be4d79a06a..ff3f70b8c266dc3b2ab374ffd6905ecb
}
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index f7a77b31dc196823510f96bd3b2344058e20feac..279fa00fd9043e1995f22c79f47d0b41c27bd933 100644
index 39dff0a38b53624c935f27cc86ff036c831f407f..bdee5725029eda3a0e7bee407286480c0bb47db1 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -283,6 +283,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@ -229,10 +229,10 @@ index f7a77b31dc196823510f96bd3b2344058e20feac..279fa00fd9043e1995f22c79f47d0b41
public int getExpReward(@Nullable Entity entity) { // CraftBukkit
Level world = this.level();
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index f56d431207323a80b7f566ac6e30eebf232ee695..c2b10c3dba9d4d08e48f8e8836142b85f16b14cb 100644
index 25a71cc5ca8cf8a5070cd24eb56fe0d79e765669..b46572f6e3b52f498b395d3b8c5def2aa799ff03 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -1119,6 +1119,12 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
@@ -1123,6 +1123,12 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
}
@ -245,7 +245,7 @@ index f56d431207323a80b7f566ac6e30eebf232ee695..c2b10c3dba9d4d08e48f8e8836142b85
@Override
protected void dropCustomDeathLoot(ServerLevel world, DamageSource source, boolean causedByPlayer) {
super.dropCustomDeathLoot(world, source, causedByPlayer);
@@ -1127,6 +1133,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
@@ -1131,6 +1137,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
for (int j = 0; j < i; ++j) {
EquipmentSlot enumitemslot = aenumitemslot[j];
@ -253,7 +253,7 @@ index f56d431207323a80b7f566ac6e30eebf232ee695..c2b10c3dba9d4d08e48f8e8836142b85
ItemStack itemstack = this.getItemBySlot(enumitemslot);
float f = this.getEquipmentDropChance(enumitemslot);
@@ -1151,7 +1158,13 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
@@ -1155,7 +1162,13 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
}
this.spawnAtLocation(itemstack);
@ -423,7 +423,7 @@ index ee3902cbada46ffb78c42dbf6f00c859546c76e1..92bb0c63330ad3a4cb13b2dc65502071
// CraftBukkit end
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 92f9502a2d5721ebb1757a069a0f138db66628d7..6c5bd88777ff79c7408cf5ffed0f099a79e5429a 100644
index a7e611aaeb457820ad303b95822d8ea86b060477..004ac565d4124f6059d530034cf0c9a28f0be467 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2517,7 +2517,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -443,10 +443,10 @@ index 92f9502a2d5721ebb1757a069a0f138db66628d7..6c5bd88777ff79c7408cf5ffed0f099a
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 d1b473ef83df0ed4ae7cd9dd0525dac5e8a41223..a9a2b35378d6654ba00a48737f596553445214aa 100644
index 0613bdf3c2325d5cab64783af7211b07fcf5124a..6a018f9c289a539b07855d75e4cc2d3c2828ded1 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -901,9 +901,16 @@ public class CraftEventFactory {
@@ -903,9 +903,16 @@ public class CraftEventFactory {
CraftLivingEntity entity = (CraftLivingEntity) victim.getBukkitEntity();
CraftDamageSource bukkitDamageSource = new CraftDamageSource(damageSource);
EntityDeathEvent event = new EntityDeathEvent(entity, bukkitDamageSource, drops, victim.getExpReward(damageSource.getEntity()));
@ -463,7 +463,7 @@ index d1b473ef83df0ed4ae7cd9dd0525dac5e8a41223..a9a2b35378d6654ba00a48737f596553
victim.expToDrop = event.getDroppedExp();
for (org.bukkit.inventory.ItemStack stack : event.getDrops()) {
@@ -921,7 +928,14 @@ public class CraftEventFactory {
@@ -923,7 +930,14 @@ public class CraftEventFactory {
PlayerDeathEvent event = new PlayerDeathEvent(entity, bukkitDamageSource, drops, victim.getExpReward(damageSource.getEntity()), 0, deathMessage);
event.setKeepInventory(keepInventory);
event.setKeepLevel(victim.keepLevel); // SPIGOT-2222: pre-set keepLevel
@ -478,7 +478,7 @@ index d1b473ef83df0ed4ae7cd9dd0525dac5e8a41223..a9a2b35378d6654ba00a48737f596553
victim.keepLevel = event.getKeepLevel();
victim.newLevel = event.getNewLevel();
@@ -944,6 +958,31 @@ public class CraftEventFactory {
@@ -946,6 +960,31 @@ public class CraftEventFactory {
return event;
}

Datei anzeigen

@ -5,38 +5,58 @@ Subject: [PATCH] Book size limits
Puts some limits on the size of books.
diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundEditBookPacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundEditBookPacket.java
index ed61767a64cdce37dc7c226ebd0d693a60de24a9..f634a830a2b58a419e84f969bd53eeae4f4513bb 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ServerboundEditBookPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ServerboundEditBookPacket.java
@@ -16,9 +16,9 @@ public record ServerboundEditBookPacket(int slot, List<String> pages, Optional<S
public static final StreamCodec<FriendlyByteBuf, ServerboundEditBookPacket> STREAM_CODEC = StreamCodec.composite(
ByteBufCodecs.VAR_INT,
ServerboundEditBookPacket::slot,
- ByteBufCodecs.stringUtf8(8192).apply(ByteBufCodecs.list(200)),
+ ByteBufCodecs.stringUtf8(net.minecraft.world.item.component.WritableBookContent.PAGE_EDIT_LENGTH).apply(ByteBufCodecs.list(net.minecraft.world.item.component.WritableBookContent.MAX_PAGES)), // Paper - limit books
ServerboundEditBookPacket::pages,
- ByteBufCodecs.stringUtf8(128).apply(ByteBufCodecs::optional),
+ ByteBufCodecs.stringUtf8(net.minecraft.world.item.component.WrittenBookContent.TITLE_MAX_LENGTH).apply(ByteBufCodecs::optional), // Paper - limit books
ServerboundEditBookPacket::title,
ServerboundEditBookPacket::new
);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 2e35c6cfdf0cded5adc9f512612faaa68876961c..d69b678b2611f3d1b1ef64541863256868969671 100644
index ce06a41d98bafc878918507404bd5d6cabc45776..d8f940016b68f488b5061d2826607c0db7e8f852 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1043,6 +1043,40 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1043,6 +1043,44 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override
public void handleEditBook(ServerboundEditBookPacket packet) {
+ // Paper start - Book size limits
+ if (!this.cserver.isPrimaryThread()) {
+ List<String> pageList = packet.pages();
+ final io.papermc.paper.configuration.type.number.IntOr.Disabled pageMax = io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.pageMax;
+ if (!this.cserver.isPrimaryThread() && pageMax.enabled()) {
+ final List<String> pageList = packet.pages();
+ long byteTotal = 0;
+ int maxBookPageSize = io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.pageMax;
+ double multiplier = Math.clamp(io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.totalMultiplier, 0.3D, 1D);
+ final int maxBookPageSize = pageMax.intValue();
+ final double multiplier = Math.clamp(io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.totalMultiplier, 0.3D, 1D);
+ long byteAllowed = maxBookPageSize;
+ for (String testString : pageList) {
+ int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
+ for (final String page : pageList) {
+ final int byteLength = page.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
+ byteTotal += byteLength;
+ int length = testString.length();
+ int multibytes = 0;
+ final int length = page.length();
+ int multiByteCharacters = 0;
+ if (byteLength != length) {
+ for (char c : testString.toCharArray()) {
+ // Count the number of multi byte characters
+ for (final char c : page.toCharArray()) {
+ if (c > 127) {
+ multibytes++;
+ multiByteCharacters++;
+ }
+ }
+ }
+
+ // Allow pages with fewer characters to consume less of the allowed byte quota
+ byteAllowed += maxBookPageSize * Math.clamp((double) length / 255D, 0.1D, 1) * multiplier;
+
+ if (multibytes > 1) {
+ // penalize MB
+ byteAllowed -= multibytes;
+ if (multiByteCharacters > 1) {
+ // Penalize multibyte characters
+ byteAllowed -= multiByteCharacters;
+ }
+ }
+

Datei anzeigen

@ -22,7 +22,7 @@ it only impacts data sent from the client.
Set -DPaper.maxSignLength=XX to change limit or -1 to disable
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 1c91e1812e536bb59dbb37aec47afca1d59ffa8d..e78a6234d6699e7f14c5ac7faa7d1ee60e46d7f9 100644
index 33a7aaf8c6b73b1732465125edd43cce06da7dc9..88fa94f33e5939bc8a5acb20f48ad5bdf35c2ada 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -299,6 +299,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -33,7 +33,7 @@ index 1c91e1812e536bb59dbb37aec47afca1d59ffa8d..e78a6234d6699e7f14c5ac7faa7d1ee6
public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player, CommonListenerCookie clientData) {
super(server, connection, clientData, player); // CraftBukkit
@@ -3146,7 +3147,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3150,7 +3151,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override
public void handleSignUpdate(ServerboundSignUpdatePacket packet) {

Datei anzeigen

@ -202,10 +202,10 @@ index dbc0b69603dcffbf3d41d79719aa0f2b7da4a131..dd86f5ec5b2051aeea4e19ff97146362
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java
index 52d71a03cd5b2af56704f265ce5b5f14d3236ebb..ffca6563c20f53c92b162054fec727d83e54e58a 100644
index c3f6522a7dc0777c5b3fa2bac63a8901f96d9f38..9b336f651ead8111a0b2c0fedad9331f594b2990 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java
@@ -226,6 +226,7 @@ public final class TrialSpawner {
@@ -231,6 +231,7 @@ public final class TrialSpawner {
}
entity.spawnedViaMobSpawner = true; // Paper

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerPostRespawnEvent
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 8f90e8cd36348089799097807ead774e186c2604..f0cc34002e260567322d7acaf803f43a8b92e563 100644
index 79203d0e5cdb86d9e2fb22cdaeb8cf3a93e43dcc..a2a913e20cdea9518da5ad0d1ef8908538860890 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -738,6 +738,10 @@ public abstract class PlayerList {
@ -19,15 +19,18 @@ index 8f90e8cd36348089799097807ead774e186c2604..f0cc34002e260567322d7acaf803f43a
// CraftBukkit start - fire PlayerRespawnEvent
DimensionTransition dimensiontransition;
@@ -745,6 +749,7 @@ public abstract class PlayerList {
@@ -745,6 +749,10 @@ public abstract class PlayerList {
dimensiontransition = entityplayer.findRespawnPositionAndUseSpawnBlock(flag, DimensionTransition.DO_NOTHING, reason);
if (!flag) entityplayer.reset(); // SPIGOT-4785
+ isRespawn = true; // Paper - Add PlayerPostRespawnEvent
+ // Paper start - Add PlayerPostRespawnEvent
+ isRespawn = true;
+ location = CraftLocation.toBukkit(dimensiontransition.pos(), dimensiontransition.newLevel().getWorld(), dimensiontransition.yRot(), dimensiontransition.xRot());
+ // Paper end - Add PlayerPostRespawnEvent
} else {
dimensiontransition = new DimensionTransition(((CraftWorld) location.getWorld()).getHandle(), CraftLocation.toVec3D(location), Vec3.ZERO, location.getYaw(), location.getPitch(), DimensionTransition.DO_NOTHING);
}
@@ -795,6 +800,11 @@ public abstract class PlayerList {
@@ -795,6 +803,11 @@ public abstract class PlayerList {
if (iblockdata.is(Blocks.RESPAWN_ANCHOR)) {
entityplayer1.connection.send(new ClientboundSoundPacket(SoundEvents.RESPAWN_ANCHOR_DEPLETE, SoundSource.BLOCKS, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), 1.0F, 1.0F, worldserver.getRandom().nextLong()));
}
@ -39,7 +42,7 @@ index 8f90e8cd36348089799097807ead774e186c2604..f0cc34002e260567322d7acaf803f43a
}
// Added from changeDimension
this.sendAllPlayerInfo(entityplayer); // Update health, etc...
@@ -816,6 +826,13 @@ public abstract class PlayerList {
@@ -816,6 +829,13 @@ public abstract class PlayerList {
if (entityplayer.connection.isDisconnected()) {
this.save(entityplayer);
}

Datei anzeigen

@ -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 a9a2b35378d6654ba00a48737f596553445214aa..7d21f3ec394b53461ca5fb73449b551fbe6e96aa 100644
index 6a018f9c289a539b07855d75e4cc2d3c2828ded1..e25ca301a4b9b252d3f75013e4e14df9b14aa7b9 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -410,13 +410,18 @@ public class CraftEventFactory {
@@ -412,13 +412,18 @@ public class CraftEventFactory {
}
org.bukkit.inventory.ItemStack item;

Datei anzeigen

@ -16,7 +16,7 @@ So even if something NEW comes up, it would be impossible to drop the
same item twice because the source was destroyed.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index d80fd4e2f41583f83c9527ccf4ce80afe851276a..bd5291ca4680572d2c5f3cec1231b1a3dcf72fa8 100644
index d80fd4e2f41583f83c9527ccf4ce80afe851276a..10015beb7a2de890fe27bffde8f55c1dd78ce344 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2515,11 +2515,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@ -52,8 +52,8 @@ index d80fd4e2f41583f83c9527ccf4ce80afe851276a..bd5291ca4680572d2c5f3cec1231b1a3
if (entity2 != null) {
if (this != entity2) {
+ // Paper start - Fix item duplication and teleport issues
+ if (this instanceof Mob) {
+ ((Mob) this).dropLeash(true, true); // Paper drop lead
+ if (this instanceof Leashable leashable) {
+ leashable.dropLeash(true, true); // Paper drop lead
+ }
+ // Paper end - Fix item duplication and teleport issues
entity2.restoreFrom(this);
@ -69,7 +69,7 @@ index d80fd4e2f41583f83c9527ccf4ce80afe851276a..bd5291ca4680572d2c5f3cec1231b1a3
public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) {
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index f2e66b50b32d197f9a8d4a9672ebf1413e66d59b..fe73a6728de0fad50451d3090002b6c0421d4c43 100644
index 926c8fd21bb610dc07658c41431a7795ba4f2870..c0bbeaa4a37c1ba9f5125a0c68f4511aac6a0e71 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1728,9 +1728,9 @@ public abstract class LivingEntity extends Entity implements Attackable {
@ -124,10 +124,10 @@ index 92bb0c63330ad3a4cb13b2dc655020714e9b1ffd..cc1189c2d7dc57ba8f29aad4ba5d2a07
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 7d21f3ec394b53461ca5fb73449b551fbe6e96aa..408f677337759f529fa41f6ba2b516b71a7940f1 100644
index e25ca301a4b9b252d3f75013e4e14df9b14aa7b9..9548ee5b43458ccc865f800d1f1b69245a821658 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -903,6 +903,11 @@ public class CraftEventFactory {
@@ -905,6 +905,11 @@ public class CraftEventFactory {
}
public static EntityDeathEvent callEntityDeathEvent(net.minecraft.world.entity.LivingEntity victim, DamageSource damageSource, List<org.bukkit.inventory.ItemStack> drops) {
@ -139,7 +139,7 @@ index 7d21f3ec394b53461ca5fb73449b551fbe6e96aa..408f677337759f529fa41f6ba2b516b7
CraftLivingEntity entity = (CraftLivingEntity) victim.getBukkitEntity();
CraftDamageSource bukkitDamageSource = new CraftDamageSource(damageSource);
EntityDeathEvent event = new EntityDeathEvent(entity, bukkitDamageSource, drops, victim.getExpReward(damageSource.getEntity()));
@@ -917,11 +922,13 @@ public class CraftEventFactory {
@@ -919,11 +924,13 @@ public class CraftEventFactory {
playDeathSound(victim, event);
// Paper end
victim.expToDrop = event.getDroppedExp();

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent teleporting dead entities
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 2fb31c0223f2638de0ebec170095fa20991738ff..e62415cf6a13634f85289c875092bb706c316fd3 100644
index 5dcb459b7ae7f31375e982501e7f16beb913114f..175fef59a8853727e58ba48e46009df17d8e7b6e 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1548,6 +1548,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1552,6 +1552,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
public void internalTeleport(double d0, double d1, double d2, float f, float f1, Set<RelativeMovement> set) { // Paper

Datei anzeigen

@ -77,10 +77,10 @@ index 5a7d314ec0562e472f5dc45924a7b24841cff126..650e4a01cecc4cc08e7ff9ebcc4c3670
public java.util.UUID getTriggerEntityId() {
return getHandle().triggerEntityId;
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 408f677337759f529fa41f6ba2b516b71a7940f1..1177a9310f686f3b4d75a713cdac75c5628e8bbb 100644
index 9548ee5b43458ccc865f800d1f1b69245a821658..752aba27c3eb9815bdd2b4683483c70e891711e7 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -712,15 +712,29 @@ public class CraftEventFactory {
@@ -714,15 +714,29 @@ public class CraftEventFactory {
if (entity instanceof net.minecraft.world.entity.ExperienceOrb xp) {
double radius = world.spigotConfig.expMerge;
if (radius > 0) {

Datei anzeigen

@ -13,10 +13,10 @@ behaviour, we need to move all of this dangerous logic outside
of the move call and into an appropriate place in the tick method.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index e62415cf6a13634f85289c875092bb706c316fd3..d93415023bed72d736f625977ca3e21497bc8f74 100644
index 175fef59a8853727e58ba48e46009df17d8e7b6e..c466e405b123ddcd3abe931f83930369ab668b90 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1345,6 +1345,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1349,6 +1349,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player.move(MoverType.PLAYER, new Vec3(d6, d7, d8));
this.player.onGround = packet.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerRecipeBookClickEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index d93415023bed72d736f625977ca3e21497bc8f74..d003494e741b97cbb8541d3132c7c448219e8ced 100644
index c466e405b123ddcd3abe931f83930369ab668b90..bba23db382a99ea3456bd6aefc437d9f4077705a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3053,16 +3053,40 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3057,16 +3057,40 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (!this.player.containerMenu.stillValid(this.player)) {
ServerGamePacketListenerImpl.LOGGER.debug("Player {} interacted with invalid menu {}", this.player, this.player.containerMenu);
} else {

Datei anzeigen

@ -76,10 +76,10 @@ index d6dc8c983d26ce89f17a990be4284fdc78ad164b..2b1d7a2360a9ee7bca9d93a2dc8c61d1
@Override
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index dae64538b34c7cc7d1af0f58e3a150c7f5e3c1c9..19f49465cfc80c1cf36755f24aa246e0656da75a 100644
index 15db3eaaab7471e6dde0a4f0d6ca2a1c38a3eb2d..0db5407cdf08d63e520db9b847bc9fcae8f585c7 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3256,7 +3256,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3260,7 +3260,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
public void handleChangeDifficulty(ServerboundChangeDifficultyPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (this.player.hasPermissions(2) || this.isSingleplayerOwner()) {
@ -89,7 +89,7 @@ index dae64538b34c7cc7d1af0f58e3a150c7f5e3c1c9..19f49465cfc80c1cf36755f24aa246e0
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index c2ccd10efd5096b2683fe235de1e8176ee7d2083..ebe69ce183b8bba43ed4d6fdbac09fdc1eaaa988 100644
index 1b3f1b06155e114cd5ab76a406c1b4e745ef58c6..52e8664f8d0368daed43e349aa67e3b295697f26 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -996,8 +996,8 @@ public final class CraftServer implements Server {

Datei anzeigen

@ -5,10 +5,10 @@ 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 19f49465cfc80c1cf36755f24aa246e0656da75a..19f13d845467364a25417ac8fd6404f16e18eaa2 100644
index 0db5407cdf08d63e520db9b847bc9fcae8f585c7..f0e60add7df4d00ee5b84164a532b75f9d90cfa8 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3248,6 +3248,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3252,6 +3252,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override
public void handleClientInformation(ServerboundClientInformationPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());

Datei anzeigen

@ -94,10 +94,10 @@ index 30ea1f9e97db86a2ad7baeea4f5a76c821874daa..5b4f03128499b0c1a4b8c5f5ccd17e4b
private static SingleRecipeInput createRecipeInput(Container inventory) {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 1177a9310f686f3b4d75a713cdac75c5628e8bbb..838ad7bc8a7488adf52d462e1a3f2faa275bebd0 100644
index 752aba27c3eb9815bdd2b4683483c70e891711e7..44fd82bf887e5c6d946d7eed18e21f966efda9de 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1679,6 +1679,12 @@ public class CraftEventFactory {
@@ -1681,6 +1681,12 @@ public class CraftEventFactory {
}
public static PrepareAnvilEvent callPrepareAnvilEvent(AnvilView view, ItemStack item) {
@ -110,7 +110,7 @@ index 1177a9310f686f3b4d75a713cdac75c5628e8bbb..838ad7bc8a7488adf52d462e1a3f2faa
PrepareAnvilEvent event = new PrepareAnvilEvent(view, CraftItemStack.asCraftMirror(item).clone());
event.getView().getPlayer().getServer().getPluginManager().callEvent(event);
event.getInventory().setItem(2, event.getResult());
@@ -1686,6 +1692,12 @@ public class CraftEventFactory {
@@ -1688,6 +1694,12 @@ public class CraftEventFactory {
}
public static PrepareGrindstoneEvent callPrepareGrindstoneEvent(InventoryView view, ItemStack item) {
@ -123,7 +123,7 @@ index 1177a9310f686f3b4d75a713cdac75c5628e8bbb..838ad7bc8a7488adf52d462e1a3f2faa
PrepareGrindstoneEvent event = new PrepareGrindstoneEvent(view, CraftItemStack.asCraftMirror(item).clone());
event.getView().getPlayer().getServer().getPluginManager().callEvent(event);
event.getInventory().setItem(2, event.getResult());
@@ -1693,12 +1705,39 @@ public class CraftEventFactory {
@@ -1695,12 +1707,39 @@ public class CraftEventFactory {
}
public static PrepareSmithingEvent callPrepareSmithingEvent(InventoryView view, ItemStack item) {

Datei anzeigen

@ -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 a3e359d174e4c175e49a6e7c03cbca0661cf8b34..2596159784a6ae0502b9a1b5a7cc573966021380 100644
index 44fd82bf887e5c6d946d7eed18e21f966efda9de..241e6527575c6d6b4facbd3ae1e4a8b65708e397 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -376,10 +376,11 @@ public class CraftEventFactory {
@@ -378,10 +378,11 @@ public class CraftEventFactory {
return tradeSelectEvent;
}

Datei anzeigen

@ -42,21 +42,27 @@ index 338a8f4acf413ef24fedab60c19c7a51a0ea19a6..2d8a509446c0ed0d7358f10f67ef29c4
+ // Paper end - add Translatable
}
diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
index f73017bff613bd62b86c974b29576e241c24c927..fc6606e1bf2e2c35cb6c84af78859c3441775907 100644
index f73017bff613bd62b86c974b29576e241c24c927..59c9c970b83f62245d860994c4ac0c21dcc15398 100644
--- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
+++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
@@ -150,6 +150,11 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine
public net.kyori.adventure.text.Component displayName(int level) {
return io.papermc.paper.adventure.PaperAdventure.asAdventure(getHandle().getFullname(level));
@@ -152,6 +152,17 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine
}
+
+ @Override
+ public String translationKey() {
+ return this.handle.getDescriptionId();
+ }
// Paper end
+ // Paper start - add translationKey methods
+ @Override
+ public String translationKey() {
+ if (!(this.getHandle().description().getContents() instanceof final net.minecraft.network.chat.contents.TranslatableContents translatableContents)) {
+ throw new UnsupportedOperationException("Description isn't translatable!"); // Paper
+ }
+ return translatableContents.getKey();
+
+ }
+ // Paper end - add translationKey methods
+
@Override
public String getTranslationKey() {
return Util.makeDescriptionId("enchantment", this.handle.unwrapKey().get().location());
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java
index d20fdd4f06faa09c7d9f9e04f379cf0fa68db9bb..66d773cadb74f9176e6cf68a565568034f52ec63 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java
@ -74,10 +80,10 @@ index d20fdd4f06faa09c7d9f9e04f379cf0fa68db9bb..66d773cadb74f9176e6cf68a56556803
+ // Paper end - add Translatable
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java
index 305eac6845119c36d041bf75930eb0909405911c..8c1d2d0521da52f9a1262f5433da21700b9b0454 100644
index 56dad5ebba54642e783146f1233d6ef44bb866a5..8725cd736d255b070f9f8ce7cf47b21e2407fbdd 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java
@@ -110,7 +110,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta {
@@ -123,7 +123,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta {
return new FireworkExplosion(CraftMetaFirework.getNBT(effect.getType()), colors, fadeColors, effect.hasTrail(), effect.hasFlicker());
}

Datei anzeigen

@ -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 19f13d845467364a25417ac8fd6404f16e18eaa2..45313a53ef181e4494e4d024c5b79a3ca7f803e1 100644
index f0e60add7df4d00ee5b84164a532b75f9d90cfa8..a7b270c0ba76f25876c4bb7bda60e61a670d15d9 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -679,7 +679,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -21,7 +21,7 @@ index 19f13d845467364a25417ac8fd6404f16e18eaa2..45313a53ef181e4494e4d024c5b79a3c
this.lastGoodX = this.awaitingPositionFromClient.x;
this.lastGoodY = this.awaitingPositionFromClient.y;
this.lastGoodZ = this.awaitingPositionFromClient.z;
@@ -1590,7 +1590,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1594,7 +1594,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// CraftBukkit end
this.awaitingTeleportTime = this.tickCount;

Datei anzeigen

@ -11,10 +11,10 @@ This ensures the crystals/pillars are in expected state when the dragon spawns.
See #3522
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
index 6f9c78b124a33212125e98905efc8a09a1891500..79b63082e849f29244352b9d0d6ac9b7df7813f6 100644
index 3aa4301521ea8155287ce97a9bb69fe20d9a54b7..f90d637e5477275b870c1a1963774de04aaa218d 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -472,6 +472,7 @@ public class EndDragonFight {
@@ -474,6 +474,7 @@ public class EndDragonFight {
entityenderdragon.moveTo((double) this.origin.getX(), (double) (128 + this.origin.getY()), (double) this.origin.getZ(), this.level.random.nextFloat() * 360.0F, 0.0F);
this.level.addFreshEntity(entityenderdragon);
this.dragonUUID = entityenderdragon.getUUID();

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Fix for large move vectors crashing server
Check movement distance also based on current position.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 45313a53ef181e4494e4d024c5b79a3ca7f803e1..ffdd7c427bf563b1d87d65586b125fd081e73dd8 100644
index a7b270c0ba76f25876c4bb7bda60e61a670d15d9..172a1acdbdfb639ca4fc6f880570a7829c8b3d45 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -492,9 +492,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -53,7 +53,7 @@ index 45313a53ef181e4494e4d024c5b79a3ca7f803e1..ffdd7c427bf563b1d87d65586b125fd0
boolean flag1 = entity.verticalCollisionBelow;
if (entity instanceof LivingEntity) {
@@ -1249,7 +1258,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1253,7 +1262,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
double d7 = d1 - this.firstGoodY;
double d8 = d2 - this.firstGoodZ;
double d9 = this.player.getDeltaMovement().lengthSqr();
@ -71,7 +71,7 @@ index 45313a53ef181e4494e4d024c5b79a3ca7f803e1..ffdd7c427bf563b1d87d65586b125fd0
if (this.player.isSleeping()) {
if (d10 > 1.0D) {
@@ -1305,9 +1323,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1309,9 +1327,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
AABB axisalignedbb = this.player.getBoundingBox();

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Toggle for removing existing dragon
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
index 79b63082e849f29244352b9d0d6ac9b7df7813f6..3ea0ca395e0561d96044f0f84442a08b42b539bd 100644
index f90d637e5477275b870c1a1963774de04aaa218d..943d9f84ad839562a4e30fff1257a1224d0b70b6 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -209,7 +209,7 @@ public class EndDragonFight {
@@ -211,7 +211,7 @@ public class EndDragonFight {
this.dragonUUID = entityenderdragon.getUUID();
EndDragonFight.LOGGER.info("Found that there's a dragon still alive ({})", entityenderdragon);
this.dragonKilled = false;

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Limit recipe packets
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index ffdd7c427bf563b1d87d65586b125fd081e73dd8..cdf29c17cac7a5bcfcd12d6e306efad0bc87a382 100644
index 172a1acdbdfb639ca4fc6f880570a7829c8b3d45..4bc7ca9ec9eecf3172cf2140a7d2a07c7c708482 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -266,6 +266,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -24,7 +24,7 @@ index ffdd7c427bf563b1d87d65586b125fd081e73dd8..cdf29c17cac7a5bcfcd12d6e306efad0
/* Use thread-safe field access instead
if (this.chatSpamTickCount > 0) {
--this.chatSpamTickCount;
@@ -3065,6 +3067,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3069,6 +3071,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override
public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) {

Datei anzeigen

@ -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 2596159784a6ae0502b9a1b5a7cc573966021380..2be5135d3e17c3344ffbdb3f2f55d45eb6753c61 100644
index 241e6527575c6d6b4facbd3ae1e4a8b65708e397..f4a1f96340f8521bc2fecfb2565f7cc8c6453d47 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -311,6 +311,10 @@ public class CraftEventFactory {
@@ -313,6 +313,10 @@ public class CraftEventFactory {
return BedEnterResult.TOO_FAR_AWAY;
case NOT_SAFE:
return BedEnterResult.NOT_SAFE;

Datei anzeigen

@ -11,10 +11,10 @@ Subject: [PATCH] Fix interact event not being called sometimes
Co-authored-by: Moulberry <james.jenour@protonmail.com>
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index cdf29c17cac7a5bcfcd12d6e306efad0bc87a382..afed142d5155c178807c6b26cb5766ae7d6e328a 100644
index 4bc7ca9ec9eecf3172cf2140a7d2a07c7c708482..b96490d16d9a38be14d6777213d883f2223fd5a4 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1766,7 +1766,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1770,7 +1770,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
MutableComponent ichatmutablecomponent = Component.translatable("build.tooHigh", i - 1).withStyle(ChatFormatting.RED);
this.player.sendSystemMessage(ichatmutablecomponent, true);
@ -23,7 +23,7 @@ index cdf29c17cac7a5bcfcd12d6e306efad0bc87a382..afed142d5155c178807c6b26cb5766ae
this.player.swing(enumhand, true);
}
}
@@ -2387,13 +2387,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2391,13 +2391,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
double d3 = Math.max(this.player.blockInteractionRange(), this.player.entityInteractionRange());
// SPIGOT-5607: Only call interact event if no block or entity is being clicked. Use bukkit ray trace method, because it handles blocks and entities at the same time
// SPIGOT-7429: Make sure to call PlayerInteractEvent for spectators and non-pickable entities

Datei anzeigen

@ -32,10 +32,10 @@ index a08e8571f3a83afc80c2f1758a9029cd28ed6947..91b514967405115f22edf4255775361a
} 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 2be5135d3e17c3344ffbdb3f2f55d45eb6753c61..c01d4302e145c779cc4031927ab555e1c7748155 100644
index f4a1f96340f8521bc2fecfb2565f7cc8c6453d47..c5166b0876eb925d30803277beb181ee01120586 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -2111,4 +2111,12 @@ public class CraftEventFactory {
@@ -2127,4 +2127,12 @@ public class CraftEventFactory {
return org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getPotion());
}
// Paper end - WitchReadyPotionEvent

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerLoomPatternSelectEvent
diff --git a/src/main/java/net/minecraft/world/inventory/LoomMenu.java b/src/main/java/net/minecraft/world/inventory/LoomMenu.java
index 2de558dd205a1078fdcac1bce256d059b9bf5d5f..f76ef029132c6a08d4e70585bc440eccdc626b16 100644
index 2de558dd205a1078fdcac1bce256d059b9bf5d5f..dc23b646e55bb66e0aa584d82b75b4b3d233276a 100644
--- a/src/main/java/net/minecraft/world/inventory/LoomMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/LoomMenu.java
@@ -174,8 +174,32 @@ public class LoomMenu extends AbstractContainerMenu {
@ -16,7 +16,7 @@ index 2de558dd205a1078fdcac1bce256d059b9bf5d5f..f76ef029132c6a08d4e70585bc440ecc
- this.setupResultSlot((Holder) this.selectablePatterns.get(id));
+ // Paper start - Add PlayerLoomPatternSelectEvent
+ int selectablePatternIndex = id;
+ io.papermc.paper.event.player.PlayerLoomPatternSelectEvent event = new io.papermc.paper.event.player.PlayerLoomPatternSelectEvent((Player) player.getBukkitEntity(), ((CraftInventoryLoom) getBukkitView().getTopInventory()), org.bukkit.craftbukkit.block.banner.CraftPatternType.minecraftHolderToBukkit((this.selectablePatterns.get(selectablePatternIndex))));
+ io.papermc.paper.event.player.PlayerLoomPatternSelectEvent event = new io.papermc.paper.event.player.PlayerLoomPatternSelectEvent((Player) player.getBukkitEntity(), ((CraftInventoryLoom) getBukkitView().getTopInventory()), org.bukkit.craftbukkit.block.banner.CraftPatternType.minecraftHolderToBukkit(this.selectablePatterns.get(selectablePatternIndex)));
+ if (!event.callEvent()) {
+ player.containerMenu.sendAllDataToRemote();
+ return false;

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add sendOpLevel API
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 44422100246a61f8353f26d5149f3e96c8832fea..3c7d31725c4a5dd7728fa394f88d37a0e493e919 100644
index 23bd0e0b62fef174b55b5915a44fee32db02c656..7c334ac1ae2a1b14b7570127e775a5e7d7ab2ae7 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1062,6 +1062,11 @@ public abstract class PlayerList {
@@ -1065,6 +1065,11 @@ public abstract class PlayerList {
}
private void sendPlayerPermissionLevel(ServerPlayer player, int permissionLevel) {
@ -20,7 +20,7 @@ index 44422100246a61f8353f26d5149f3e96c8832fea..3c7d31725c4a5dd7728fa394f88d37a0
if (player.connection != null) {
byte b0;
@@ -1076,8 +1081,10 @@ public abstract class PlayerList {
@@ -1079,8 +1084,10 @@ public abstract class PlayerList {
player.connection.send(new ClientboundEntityEventPacket(player, b0));
}
@ -32,7 +32,7 @@ index 44422100246a61f8353f26d5149f3e96c8832fea..3c7d31725c4a5dd7728fa394f88d37a0
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
index a3b1a19fb28dfba93ae04ea0859f744ede1579f6..963ae66acc25602e15134d30d3e496802b17dc41 100644
index 39e8dff2a1b62b8313b4d87ce8d2fad7516452c3..3bc62788d63e98eb9b2a2b381272b262040dcb5f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -677,6 +677,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Configurable max leash distance
diff --git a/src/main/java/net/minecraft/world/entity/Leashable.java b/src/main/java/net/minecraft/world/entity/Leashable.java
index 1f2d04a456c383815b0c5ef331471593556fd128..30d7dd9646ba9d6a9396dc140a61eb2cac07dfc6 100644
index 1f2d04a456c383815b0c5ef331471593556fd128..5c51dd5229689cba459655d488aee59bd159a414 100644
--- a/src/main/java/net/minecraft/world/entity/Leashable.java
+++ b/src/main/java/net/minecraft/world/entity/Leashable.java
@@ -179,7 +179,7 @@ public interface Leashable {
@ -13,7 +13,20 @@ index 1f2d04a456c383815b0c5ef331471593556fd128..30d7dd9646ba9d6a9396dc140a61eb2c
}
- if ((double) f > 10.0D) {
+ if ((double) f > entity.level().paperConfig().misc.maxLeashDistance) { // Paper - Configurable max leash distance
+ if ((double) f > entity.level().paperConfig().misc.maxLeashDistance.or(LEASH_TOO_FAR_DIST)) { // Paper - Configurable max leash distance
((Leashable) entity).leashTooFarBehaviour();
} else if ((double) f > 6.0D) {
((Leashable) entity).elasticRangeLeashBehaviour(entity1, f);
diff --git a/src/main/java/net/minecraft/world/entity/TamableAnimal.java b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
index f2d311a5450eb684603580bbf7e9e7fc73fc2f5c..bf2c9134c7d9d5926add36b55e3cfea79e8c8243 100644
--- a/src/main/java/net/minecraft/world/entity/TamableAnimal.java
+++ b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
@@ -97,7 +97,7 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity {
@Override
public boolean handleLeashAtDistance(Entity leashHolder, float distance) {
if (this.isInSittingPose()) {
- if (distance > 10.0F) {
+ if (distance > (float) this.level().paperConfig().misc.maxLeashDistance.or(Leashable.LEASH_TOO_FAR_DIST)) { // Paper - Configurable max leash distance
this.dropLeash(true, true);
}

Datei anzeigen

@ -29,10 +29,10 @@ index 91b514967405115f22edf4255775361a672e5c2f..ddecf443df3679e3098eb54edd19585a
} else {
// CraftBukkit start - Fire event when pushing items into other inventories
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index c01d4302e145c779cc4031927ab555e1c7748155..97a17f2b782196b51ebbc6740aad1768fc73f7ba 100644
index c5166b0876eb925d30803277beb181ee01120586..6cc729446ff21a5718ff01fcea1496c71f77480c 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -2118,5 +2118,11 @@ public class CraftEventFactory {
@@ -2134,5 +2134,11 @@ public class CraftEventFactory {
io.papermc.paper.event.block.BlockFailedDispenseEvent event = new io.papermc.paper.event.block.BlockFailedDispenseEvent(block);
return event.callEvent();
}

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add toggle for always placing the dragon egg
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
index 3ea0ca395e0561d96044f0f84442a08b42b539bd..f81dab25fedeed08f4d3ba2d7435e2da526e6056 100644
index 943d9f84ad839562a4e30fff1257a1224d0b70b6..412838a4eb3d29da5955bf1c279f66a2e7ccad12 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -407,7 +407,7 @@ public class EndDragonFight {
@@ -409,7 +409,7 @@ public class EndDragonFight {
this.dragonEvent.setVisible(false);
this.spawnExitPortal(true);
this.spawnNewGateway();

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Expand EntityUnleashEvent
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 44efb857aa839bbc0eca608661f22750bb059f4f..1ca18b0c4af08c998636bb3938a3dfdfb1d80cf0 100644
index 7d131f3b3f5739468aa3115e97ed28b6bfeca33d..da184893d617311a43f9ce176a965f8417a2876d 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2574,12 +2574,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@ -26,12 +26,14 @@ index 44efb857aa839bbc0eca608661f22750bb059f4f..1ca18b0c4af08c998636bb3938a3dfdf
this.gameEvent(GameEvent.ENTITY_INTERACT, player);
}
@@ -3450,8 +3453,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -3449,9 +3452,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
protected void removeAfterChangingDimensions() {
this.setRemoved(Entity.RemovalReason.CHANGED_DIMENSION, null); // CraftBukkit - add Bukkit remove cause
if (this instanceof Leashable leashable) {
- if (this instanceof Leashable leashable) {
- this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN)); // CraftBukkit
- leashable.dropLeash(true, false);
+ if (this instanceof Leashable leashable && leashable.isLeashed()) { // Paper - only call if it is leashed
+ // Paper start - Expand EntityUnleashEvent
+ final EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN, false); // CraftBukkit
+ event.callEvent();
@ -41,7 +43,7 @@ index 44efb857aa839bbc0eca608661f22750bb059f4f..1ca18b0c4af08c998636bb3938a3dfdf
}
diff --git a/src/main/java/net/minecraft/world/entity/Leashable.java b/src/main/java/net/minecraft/world/entity/Leashable.java
index 30d7dd9646ba9d6a9396dc140a61eb2cac07dfc6..bc03f1fe2a311bf61449879751360c6775dde6ac 100644
index 5c51dd5229689cba459655d488aee59bd159a414..e7535f15be3cc1537aafee53779ccfb4f21d1f38 100644
--- a/src/main/java/net/minecraft/world/entity/Leashable.java
+++ b/src/main/java/net/minecraft/world/entity/Leashable.java
@@ -166,8 +166,11 @@ public interface Leashable {
@ -78,10 +80,10 @@ index 30d7dd9646ba9d6a9396dc140a61eb2cac07dfc6..bc03f1fe2a311bf61449879751360c67
default void closeRangeLeashBehaviour(Entity entity) {}
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index c2b10c3dba9d4d08e48f8e8836142b85f16b14cb..37a8e426ca65587863bd22d2b7f32fae854c322e 100644
index b46572f6e3b52f498b395d3b8c5def2aa799ff03..e87360e21e6eb7b0161c34a3ac6cb83d18bcd1e8 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -1617,8 +1617,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
@@ -1621,8 +1621,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
boolean flag1 = super.startRiding(entity, force);
if (flag1 && this.isLeashed()) {
@ -95,6 +97,23 @@ index c2b10c3dba9d4d08e48f8e8836142b85f16b14cb..37a8e426ca65587863bd22d2b7f32fae
}
return flag1;
diff --git a/src/main/java/net/minecraft/world/entity/TamableAnimal.java b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
index bf2c9134c7d9d5926add36b55e3cfea79e8c8243..7b7bc1a205dfacbe5709011b6b6799e75af9e4cc 100644
--- a/src/main/java/net/minecraft/world/entity/TamableAnimal.java
+++ b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
@@ -98,7 +98,11 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity {
public boolean handleLeashAtDistance(Entity leashHolder, float distance) {
if (this.isInSittingPose()) {
if (distance > (float) this.level().paperConfig().misc.maxLeashDistance.or(Leashable.LEASH_TOO_FAR_DIST)) { // Paper - Configurable max leash distance
- this.dropLeash(true, true);
+ // Paper start - Expand EntityUnleashEvent
+ org.bukkit.event.entity.EntityUnleashEvent event = new org.bukkit.event.entity.EntityUnleashEvent(this.getBukkitEntity(), org.bukkit.event.entity.EntityUnleashEvent.UnleashReason.DISTANCE, true);
+ if (!event.callEvent()) return false;
+ this.dropLeash(true, event.isDropLeash());
+ // Paper end - Expand EntityUnleashEvent
}
return false;
diff --git a/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java b/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java
index 3c0af74ed65610b1d5e3b72fdcf28c5a3423f0da..01173fc7177d78588978e087e63efda0b0527c2f 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java
@ -121,10 +140,10 @@ index 3c0af74ed65610b1d5e3b72fdcf28c5a3423f0da..01173fc7177d78588978e087e63efda0
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 97a17f2b782196b51ebbc6740aad1768fc73f7ba..2786398e99af94d8dc1251009cdb5fa71206bcf3 100644
index 6cc729446ff21a5718ff01fcea1496c71f77480c..ad49a7cb16de3dac7a5232abded3635a4b0b8848 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1596,8 +1596,10 @@ public class CraftEventFactory {
@@ -1598,8 +1598,10 @@ public class CraftEventFactory {
Bukkit.getPluginManager().callEvent(new PlayerRecipeBookSettingsChangeEvent(player.getBukkitEntity(), bukkitType, open, filter));
}

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add DragonEggFormEvent
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
index f81dab25fedeed08f4d3ba2d7435e2da526e6056..609b20e2b222c5b1fddf22c2621d0d7a88cabcfa 100644
index 412838a4eb3d29da5955bf1c279f66a2e7ccad12..0455c5fd2bb7955a0f343468b4bea760d6d35310 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -407,8 +407,22 @@ public class EndDragonFight {
@@ -409,8 +409,22 @@ public class EndDragonFight {
this.dragonEvent.setVisible(false);
this.spawnExitPortal(true);
this.spawnNewGateway();

Datei anzeigen

@ -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 2786398e99af94d8dc1251009cdb5fa71206bcf3..4f05f8d73b824cd2985e6c6d90338fc7479ef2a5 100644
index ad49a7cb16de3dac7a5232abded3635a4b0b8848..3e1a70fe1e523946512ac71772439f7fd292623f 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -460,13 +460,30 @@ public class CraftEventFactory {
@@ -462,13 +462,30 @@ public class CraftEventFactory {
}
public static void handleBlockDropItemEvent(Block block, BlockState state, ServerPlayer player, List<ItemEntity> items) {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Allow using signs inside spawn protection
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index afed142d5155c178807c6b26cb5766ae7d6e328a..8e888be601190e69389fa5a8596a4e7d52dd1749 100644
index b96490d16d9a38be14d6777213d883f2223fd5a4..1cff57113816614c5b6a43056bb47f29c5839cc5 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1754,8 +1754,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1758,8 +1758,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
int i = this.player.level().getMaxBuildHeight();
if (blockposition.getY() < i) {

Datei anzeigen

@ -20,7 +20,7 @@ index 1963e826548c5a8859c50f57654784c3aef50e44..04a39cb6c13c26e2cb1d73a9da98df5d
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index a29f4992f7927d0f241962f972dd13ce77094d97..f83eb7fd5c9b368ba0bf9e07a568d69c6566a5af 100644
index f79af6910c4c83f1c56bc73434846f3e5270509f..3b1e073f8873e23eee187a2d60529c044e3d2f55 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1181,9 +1181,15 @@ public final class CraftServer implements Server {
@ -56,8 +56,8 @@ index a29f4992f7927d0f241962f972dd13ce77094d97..f83eb7fd5c9b368ba0bf9e07a568d69c
+ // Paper start
+ @Override
+ public World getWorld(NamespacedKey worldKey) {
+ ServerLevel worldServer = console.getLevel(ResourceKey.create(net.minecraft.core.registries.Registries.DIMENSION, CraftNamespacedKey.toMinecraft(worldKey)));
+ public World getWorld(net.kyori.adventure.key.Key worldKey) {
+ ServerLevel worldServer = console.getLevel(ResourceKey.create(net.minecraft.core.registries.Registries.DIMENSION, io.papermc.paper.adventure.PaperAdventure.asVanilla(worldKey)));
+ if (worldServer == null) return null;
+ return worldServer.getWorld();
+ }
@ -67,7 +67,7 @@ index a29f4992f7927d0f241962f972dd13ce77094d97..f83eb7fd5c9b368ba0bf9e07a568d69c
// 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 5fe9b94c342a91d6fb3bc582ac7e84cb25b90a9e..e44bcf61c09245a63d50dd1be3c5b1fca7225ff9 100644
index 481aeb922952578ea68ce2425c84e1a93eff0cf9..b075d4b21b53a3f39094444e4024556b23e399f2 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -516,6 +516,11 @@ public final class CraftMagicNumbers implements UnsafeValues {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Don't ignore result of PlayerEditBookEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 8e888be601190e69389fa5a8596a4e7d52dd1749..773ada940f3bb2cf6a9ff1c32b3306d91dda27d9 100644
index 1cff57113816614c5b6a43056bb47f29c5839cc5..0b6db265a2a7a20be647bf6e3387af20634af68c 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1150,7 +1150,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1154,7 +1154,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
List<Filterable<String>> list1 = pages.stream().map(this::filterableFromOutgoing).toList();
itemstack.set(DataComponents.WRITABLE_BOOK_CONTENT, new WritableBookContent(list1));

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] fix PlayerItemHeldEvent firing twice
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 773ada940f3bb2cf6a9ff1c32b3306d91dda27d9..4ed4a2f5f03790fab394429334881377c1b3ab60 100644
index 0b6db265a2a7a20be647bf6e3387af20634af68c..4b9b8cda8578c871c677f283ba0746460a0fadf0 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1929,6 +1929,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1933,6 +1933,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (this.player.isImmobile()) return; // CraftBukkit
if (packet.getSlot() >= 0 && packet.getSlot() < Inventory.getSelectionSize()) {

Datei anzeigen

@ -134,10 +134,10 @@ index 5de472df78940d1b8320f73d18b2edf3a796227e..073cf184a0e7af41048ae67a9b17b4cd
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 7721d329e9949bf84f31792d4c06ab9e04ab4ade..75cb96d392eff322eb93894b5c2b5ad22c3fd261 100644
index 4b9b8cda8578c871c677f283ba0746460a0fadf0..baa01aaeeb710f160c470702649356e5be124fa9 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2727,7 +2727,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2731,7 +2731,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player = this.server.getPlayerList().respawn(this.player, false, Entity.RemovalReason.KILLED, RespawnReason.DEATH); // CraftBukkit
if (this.server.isHardcore()) {

Datei anzeigen

@ -10,7 +10,7 @@ Co-authored-by: Luis <luisc99@icloud.com>
Co-authored-by: Janet Blackquill <uhhadd@gmail.com>
diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
index fc6606e1bf2e2c35cb6c84af78859c3441775907..edf4df4d13dc814e98b897a3f8a5fd4757284299 100644
index 59c9c970b83f62245d860994c4ac0c21dcc15398..4221a1e9cba35c8dc58e51e162e7fcbd0e8b31af 100644
--- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
+++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
@@ -5,6 +5,7 @@ import java.util.Locale;
@ -30,23 +30,24 @@ index fc6606e1bf2e2c35cb6c84af78859c3441775907..edf4df4d13dc814e98b897a3f8a5fd47
}
@Override
@@ -148,12 +149,66 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine
@@ -148,7 +149,7 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine
// Paper start
@Override
public net.kyori.adventure.text.Component displayName(int level) {
- return io.papermc.paper.adventure.PaperAdventure.asAdventure(getHandle().getFullname(level));
+ return io.papermc.paper.adventure.PaperAdventure.asAdventure(net.minecraft.world.item.enchantment.Enchantment.getFullname(this.handle, level));
}
// Paper end
@Override
public String translationKey() {
- return this.handle.getDescriptionId();
+ if (!(this.getHandle().description().getContents() instanceof final TranslatableContents translatableContents)) {
+ throw new UnsupportedOperationException("Description isn't translatable!"); // Paper
+ }
+ return translatableContents.getKey();
+ }
+
@@ -159,10 +160,62 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine
throw new UnsupportedOperationException("Description isn't translatable!"); // Paper
}
return translatableContents.getKey();
-
}
// Paper end - add translationKey methods
+ // Paper start - more Enchantment API
+ @Override
+ public boolean isTradeable() {
+ return this.handle.is(EnchantmentTags.TRADEABLE);
@ -96,6 +97,9 @@ index fc6606e1bf2e2c35cb6c84af78859c3441775907..edf4df4d13dc814e98b897a3f8a5fd47
+ return this.getHandle().definition().slots().stream()
+ .map(org.bukkit.craftbukkit.CraftEquipmentSlot::getSlot)
+ .collect(java.util.stream.Collectors.toSet());
}
// Paper end
+ }
+ // Paper end - more Enchantment API
+
@Override
public String getTranslationKey() {
return Util.makeDescriptionId("enchantment", this.handle.unwrapKey().get().location());

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Move range check for block placing up
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index e91200b8b1da00b4b13697e950433de661a4e419..091863f559b74b93f129cc0bf5413ab4b81a0155 100644
index baa01aaeeb710f160c470702649356e5be124fa9..0ac4cb57f379b2b96391ab651fc75bc599ddc928 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1741,6 +1741,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1745,6 +1745,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (itemstack.isItemEnabled(worldserver.enabledFeatures())) {
BlockHitResult movingobjectpositionblock = packet.getHitResult();
Vec3 vec3d = movingobjectpositionblock.getLocation();

Datei anzeigen

@ -87,10 +87,10 @@ index d6d7f1c446ba5507f67038ff27775ba75156f4a7..c63c194c44646e6bc1a5942655278701
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 091863f559b74b93f129cc0bf5413ab4b81a0155..9aceb641acde6840b45899e60fe3319a4a89b357 100644
index 0ac4cb57f379b2b96391ab651fc75bc599ddc928..757f0aa42ee945fda11d05864405f9ecb5208226 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2546,6 +2546,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2550,6 +2550,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Spigot Start
public SocketAddress getRawAddress()
{

Datei anzeigen

@ -218,7 +218,7 @@ index 24bf661e76fb421a8be565d9ea68edf7205254d2..feb529adf2168025c785ab92d95a3246
if (this.cserver.getServer().isRunning()) {
this.cserver.getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e7550dcc61d0 100644
index 757f0aa42ee945fda11d05864405f9ecb5208226..f098997bab367e50781e3062fd2de73454a711a3 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -349,7 +349,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -284,7 +284,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755
return;
}
this.player.getInventory().pickSlot(packet.getSlot()); // Paper - Diff above if changed
@@ -1106,14 +1106,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1110,14 +1110,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (byteTotal > byteAllowed) {
ServerGamePacketListenerImpl.LOGGER.warn("{} tried to send a book too large. Book size: {} - Allowed: {} - Pages: {}", this.player.getScoreboardName(), byteTotal, byteAllowed, pageList.size());
@ -301,7 +301,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755
return;
}
this.lastBookTick = MinecraftServer.currentTick;
@@ -1225,7 +1225,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1229,7 +1229,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
public void handleMovePlayer(ServerboundMovePlayerPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (ServerGamePacketListenerImpl.containsInvalidValues(packet.getX(0.0D), packet.getY(0.0D), packet.getZ(0.0D), packet.getYRot(0.0F), packet.getXRot(0.0F))) {
@ -310,7 +310,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755
} else {
ServerLevel worldserver = this.player.serverLevel();
@@ -1663,7 +1663,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1667,7 +1667,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.dropCount++;
if (this.dropCount >= 20) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " dropped their items too quickly!");
@ -319,7 +319,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755
return;
}
}
@@ -1951,7 +1951,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1955,7 +1955,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player.resetLastActionTime();
} else {
ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString());
@ -328,7 +328,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755
}
}
@@ -2149,7 +2149,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2153,7 +2153,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
private void tryHandleChat(String s, Runnable runnable, boolean sync) { // CraftBukkit
if (ServerGamePacketListenerImpl.isChatMessageIllegal(s)) {
@ -337,7 +337,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755
} else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false));
} else {
@@ -2172,7 +2172,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2176,7 +2176,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (optional.isEmpty()) {
ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString());
@ -346,7 +346,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755
}
return optional;
@@ -2358,7 +2358,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2362,7 +2362,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// this.chatSpamTickCount += 20;
if (this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) {
// CraftBukkit end
@ -355,7 +355,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755
}
}
@@ -2370,7 +2370,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2374,7 +2374,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
synchronized (this.lastSeenMessages) {
if (!this.lastSeenMessages.applyOffset(packet.offset())) {
ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString());
@ -364,7 +364,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755
}
}
@@ -2518,7 +2518,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2522,7 +2522,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
if (i > 4096) {
@ -373,7 +373,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755
}
}
@@ -2576,7 +2576,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2580,7 +2580,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Spigot Start
if ( entity == this.player && !this.player.isSpectator() )
{
@ -382,7 +382,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755
return;
}
// Spigot End
@@ -2690,7 +2690,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2694,7 +2694,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
}
@ -391,7 +391,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755
ServerGamePacketListenerImpl.LOGGER.warn("Player {} tried to attack an invalid entity", ServerGamePacketListenerImpl.this.player.getName().getString());
}
});
@@ -3087,7 +3087,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3091,7 +3091,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Paper start - auto recipe limit
if (!org.bukkit.Bukkit.isPrimaryThread()) {
if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
@ -400,7 +400,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755
return;
}
}
@@ -3329,7 +3329,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3333,7 +3333,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (!Objects.equals(profilepublickey_a, profilepublickey_a1)) {
if (profilepublickey_a != null && profilepublickey_a1.expiresAt().isBefore(profilepublickey_a.expiresAt())) {
@ -409,7 +409,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755
} else {
try {
SignatureValidator signaturevalidator = this.server.getProfileKeySignatureValidator();
@@ -3342,7 +3342,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3346,7 +3346,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.resetPlayerChatState(remotechatsession_a.validate(this.player.getGameProfile(), signaturevalidator));
} catch (ProfilePublicKey.ValidationException profilepublickey_b) {
ServerGamePacketListenerImpl.LOGGER.error("Failed to validate profile key: {}", profilepublickey_b.getMessage());
@ -419,7 +419,7 @@ index b908e292d7b2fbff6cc5058ea32648dbde52fa19..c07d6a05737da570e7dc52e73b45e755
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 0cbd4e6bc9b3695fd2ff0b943a69b8fd393e0f36..46f46685081c3c164bd4ba306dfb1220a4e13e52 100644
index 28d99ca33606d2ff44c639c78edfcaa131faf626..2b15648549245962c6427af27c3ea34e443b37f3 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -675,7 +675,7 @@ public abstract class PlayerList {
@ -431,7 +431,7 @@ index 0cbd4e6bc9b3695fd2ff0b943a69b8fd393e0f36..46f46685081c3c164bd4ba306dfb1220
}
// Instead of kicking then returning, we need to store the kick reason
@@ -1273,7 +1273,7 @@ public abstract class PlayerList {
@@ -1276,7 +1276,7 @@ public abstract class PlayerList {
// Paper end
// CraftBukkit start - disconnect safely
for (ServerPlayer player : this.players) {
@ -471,7 +471,7 @@ index f472dea0bd4f834c0c8f0aa59ae7cdae082b14af..2fa51c3a70f43cd23b8f494fc643d66c
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 3f603688b9ad895edc2bfc07093c42bc17a35b19..6bc3209b6039ed3d33131e1c6bc56a47916be3ee 100644
index c9dc7c570e86f420cf8c6343c6ffbdbca427e7a7..7fb6bfe2863d856f27da29a77026f4bc821c929c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -635,7 +635,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -143,10 +143,10 @@ index be787a5b52e90796d4f06e17e564f4324807c3e6..cb34cc9443da56c0497c7a0192c8b836
public boolean isLingering() {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 4f05f8d73b824cd2985e6c6d90338fc7479ef2a5..61caedf05b28b2ba351e231c5f76e4df1ebd271a 100644
index 3e1a70fe1e523946512ac71772439f7fd292623f..88a5b50396fddc18b733a52ad66eedd10751f8ea 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -884,6 +884,32 @@ public class CraftEventFactory {
@@ -886,6 +886,32 @@ public class CraftEventFactory {
return event;
}

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerArmSwingEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 3a656daa941993f240fa7fc54ee1106eaa504673..633c13dc22793f5a5c4c137c614c1bb695308888 100644
index f098997bab367e50781e3062fd2de73454a711a3..9095e6eb99cb00af976ffa48ecbbc69a0c9c931c 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2408,7 +2408,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2412,7 +2412,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} // Paper end - Call interact event
// Arm swing animation

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Fix kick event leave message not being sent
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 38d493b03c02bbfed297b7735590e799d26c07f7..09e72aee16ceb7b300482fbaf28f856d4ed472d3 100644
index f20019261a09f425137731f7a4b92e889b617334..9982940af7d10ca7799e2c21ac994ea3afa0b805 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -290,7 +290,6 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
@ -55,10 +55,10 @@ index feb529adf2168025c785ab92d95a3246e73c0236..b43f87ff4b9853b5d4bbea5ff9686d64
MinecraftServer minecraftserver = this.server;
Connection networkmanager = this.connection;
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 633c13dc22793f5a5c4c137c614c1bb695308888..5276ce5b6fa19e0810da61c9a3c51b6318356339 100644
index 9095e6eb99cb00af976ffa48ecbbc69a0c9c931c..de07fd466c9ac79d6f8122c619f2b4be65f31f69 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1890,6 +1890,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1894,6 +1894,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override
public void onDisconnect(DisconnectionDetails info) {
@ -71,7 +71,7 @@ index 633c13dc22793f5a5c4c137c614c1bb695308888..5276ce5b6fa19e0810da61c9a3c51b63
// CraftBukkit start - Rarely it would send a disconnect line twice
if (this.processedDisconnect) {
return;
@@ -1898,11 +1904,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1902,11 +1908,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
// CraftBukkit end
ServerGamePacketListenerImpl.LOGGER.info("{} lost connection: {}", this.player.getName().getString(), info.reason().getString());
@ -91,7 +91,7 @@ index 633c13dc22793f5a5c4c137c614c1bb695308888..5276ce5b6fa19e0810da61c9a3c51b63
this.chatMessageChain.close();
// CraftBukkit start - Replace vanilla quit message handling with our own.
/*
@@ -1912,7 +1924,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1916,7 +1928,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player.disconnect();
// Paper start - Adventure
@ -101,7 +101,7 @@ index 633c13dc22793f5a5c4c137c614c1bb695308888..5276ce5b6fa19e0810da61c9a3c51b63
this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), false);
// Paper end
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 46f46685081c3c164bd4ba306dfb1220a4e13e52..b36cb031b153c452c7f030105f6963072b5858fc 100644
index 2b15648549245962c6427af27c3ea34e443b37f3..2f22ae87cd467b73883a38553fab23f8590d17a1 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -561,6 +561,11 @@ public abstract class PlayerList {

Datei anzeigen

@ -154,10 +154,10 @@ index d1b21afe48dbe1e53d4a046434336be580497165..2dd10cada8d36ed5565481f3f5a5fba1
public SectionPos getLastSectionPos() {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index b36cb031b153c452c7f030105f6963072b5858fc..d4fa173cebcef5fa86e5d077c2bad8e831392bf0 100644
index 2f22ae87cd467b73883a38553fab23f8590d17a1..bc5088b4b8a60dcd87eb9a7e0858a5c45bd9a7d4 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -841,7 +841,7 @@ public abstract class PlayerList {
@@ -844,7 +844,7 @@ public abstract class PlayerList {
// CraftBukkit end
if (dimensiontransition.missingRespawnBlock()) {
entityplayer1.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.NO_RESPAWN_BLOCK_AVAILABLE, 0.0F));

Datei anzeigen

@ -61,10 +61,10 @@ index 746bb8a36bd6c6ef953289576af499caad588d79..57ebb96707748e90810dc07471f9769f
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 61caedf05b28b2ba351e231c5f76e4df1ebd271a..4180b86620aa18a95e0793f646515779801a343e 100644
index 88a5b50396fddc18b733a52ad66eedd10751f8ea..03a6ca13218d43ad0c5fc461564d004008ee3e06 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1078,7 +1078,7 @@ public class CraftEventFactory {
@@ -1080,7 +1080,7 @@ public class CraftEventFactory {
return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), source.getDirectBlockState(), entity, DamageCause.BLOCK_EXPLOSION, bukkitDamageSource, modifiers, modifierFunctions, cancelled);
}
DamageCause damageCause = (damager.getBukkitEntity() instanceof org.bukkit.entity.TNTPrimed) ? DamageCause.BLOCK_EXPLOSION : DamageCause.ENTITY_EXPLOSION;
@ -73,7 +73,7 @@ index 61caedf05b28b2ba351e231c5f76e4df1ebd271a..4180b86620aa18a95e0793f646515779
} else if (damager != null || source.getDirectEntity() != null) {
DamageCause cause = (source.isSweep()) ? DamageCause.ENTITY_SWEEP_ATTACK : DamageCause.ENTITY_ATTACK;
@@ -1104,7 +1104,7 @@ public class CraftEventFactory {
@@ -1106,7 +1106,7 @@ public class CraftEventFactory {
cause = DamageCause.MAGIC;
}
@ -82,7 +82,7 @@ index 61caedf05b28b2ba351e231c5f76e4df1ebd271a..4180b86620aa18a95e0793f646515779
} else if (source.is(DamageTypes.FELL_OUT_OF_WORLD)) {
return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), source.getDirectBlockState(), entity, DamageCause.VOID, bukkitDamageSource, modifiers, modifierFunctions, cancelled);
} else if (source.is(DamageTypes.LAVA)) {
@@ -1164,13 +1164,13 @@ public class CraftEventFactory {
@@ -1166,13 +1166,13 @@ public class CraftEventFactory {
cause = DamageCause.CUSTOM;
}

Datei anzeigen

@ -17,10 +17,10 @@ Async catch modifications to critical entity state
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 1e442429d30886eee96f68d212548ff741e3e07e..fa1fbd41fce44bb8bb9e3435abfcac4e0652c968 100644
index dd96075fbffb9d912310d7c3d8a1348ade25c3ef..3762cd8bfd1544df5f5a2eefbd0490fe0c656cff 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1573,6 +1573,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1577,6 +1577,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
public void internalTeleport(double d0, double d1, double d2, float f, float f1, Set<RelativeMovement> set) { // Paper
@ -29,7 +29,7 @@ index 1e442429d30886eee96f68d212548ff741e3e07e..fa1fbd41fce44bb8bb9e3435abfcac4e
if (player.isRemoved()) {
LOGGER.info("Attempt to teleport removed player {} restricted", player.getScoreboardName());
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 85f3dcdc8349683cb79ce1d9fe56eff02af2a7a7..4714931fd5218df160e39f013278b7996cc5eca6 100644
index a3a19f288643ce290c1e2119ba794f2409e83ed0..6625d0b4cec8e5660c0dbd7965130495e3c94682 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1122,7 +1122,7 @@ public abstract class LivingEntity extends Entity implements Attackable {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent softlocked end exit portal generation
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
index 609b20e2b222c5b1fddf22c2621d0d7a88cabcfa..b8bba857aa390e5435b8a199a25065a940d6a972 100644
index 0455c5fd2bb7955a0f343468b4bea760d6d35310..e5927f378789e1d8b83ca5c84d657e0e637cc575 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -466,6 +466,11 @@ public class EndDragonFight {
@@ -468,6 +468,11 @@ public class EndDragonFight {
}
}

Datei anzeigen

@ -713,10 +713,10 @@ index e374b9f40eddca13b30855d25a2030f8df98138f..4fc893378fb0568ddcffc7593d66df6b
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 48f320333fa859796f4fff01f721fda903238197..9c85cbc65bf7e1f539f12644ed391c98118c08d2 100644
index 03a6ca13218d43ad0c5fc461564d004008ee3e06..6aa954c168e5503c1e4cf069e13f518da277cdef 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -841,19 +841,19 @@ public class CraftEventFactory {
@@ -843,19 +843,19 @@ public class CraftEventFactory {
/**
* PotionSplashEvent
*/
@ -739,7 +739,7 @@ index 48f320333fa859796f4fff01f721fda903238197..9c85cbc65bf7e1f539f12644ed391c98
hitEntity = ((EntityHitResult) position).getEntity().getBukkitEntity();
}
@@ -862,20 +862,20 @@ public class CraftEventFactory {
@@ -864,20 +864,20 @@ public class CraftEventFactory {
return event;
}

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add TameableDeathMessageEvent
diff --git a/src/main/java/net/minecraft/world/entity/TamableAnimal.java b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
index f2d311a5450eb684603580bbf7e9e7fc73fc2f5c..07ec4837d17a9cb7db2fa310a42fc87e052b3f9b 100644
index 0eebf7ce352e7d811bd5798bf19c399e61affb09..5405792eea1d90492183faa23367f13b88cd1721 100644
--- a/src/main/java/net/minecraft/world/entity/TamableAnimal.java
+++ b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
@@ -237,7 +237,12 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity {
@@ -241,7 +241,12 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity {
@Override
public void die(DamageSource damageSource) {
if (!this.level().isClientSide && this.level().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) {

Datei anzeigen

@ -196,10 +196,10 @@ index edc20745649b0837f1371c8d29e71fc0c8e5528f..932831bb5632ead5850842fc77192c84
}
// CraftBukkit end
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index ffc55cf79d0e7f90ba2816d7604477f018d75ecd..697ef7d19cca2d3f51ccff9e4ab14d87a7ddaf00 100644
index 6aa954c168e5503c1e4cf069e13f518da277cdef..d793566b2b5b0e996e4122087a883e92b24c216f 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1378,11 +1378,11 @@ public class CraftEventFactory {
@@ -1380,11 +1380,11 @@ public class CraftEventFactory {
return event;
}

Datei anzeigen

@ -5,10 +5,10 @@ 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 15bee10f167ebd134688ff570c4773fe088e149a..efa6e8a85f27c18bddd91b7f83656457e58a16bd 100644
index a94c253758200ee91a911783a9505214ddd984ba..6091462cbdecfac5e6bcc92e6bbb45a680f03b05 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3197,7 +3197,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3201,7 +3201,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
BlockPos blockposition = BlockEntity.getPosFromTag(customdata.getUnsafe());
if (this.player.level().isLoaded(blockposition)) {

Datei anzeigen

@ -6,10 +6,10 @@ 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
index 2916328a5b94783e68688756b5ad7685f180e27f..b0a1f6cf2cc96a2ddc8232f929c134501d99411e 100644
index 22c1bf5989065016364505a0665a5205fd8528b5..be842c81ae6c6ec64a233f126d7221a37d66439c 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1389,7 +1389,7 @@ public abstract class PlayerList {
@@ -1392,7 +1392,7 @@ public abstract class PlayerList {
// CraftBukkit start
public ServerStatsCounter getPlayerStats(ServerPlayer entityhuman) {
ServerStatsCounter serverstatisticmanager = entityhuman.getStats();

Datei anzeigen

@ -5,10 +5,10 @@ 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 efa6e8a85f27c18bddd91b7f83656457e58a16bd..52ff31d33edb0c55e2ec4a982525d47e4a19428b 100644
index 6091462cbdecfac5e6bcc92e6bbb45a680f03b05..e804e08e8b99d10b513972bd42a1257a66baeff4 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2379,7 +2379,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2383,7 +2383,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
// Spigot end
// this.chatSpamTickCount += 20;

Datei anzeigen

@ -5,10 +5,10 @@ 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
index 52ff31d33edb0c55e2ec4a982525d47e4a19428b..77e31c3851813651dc00e59f8ef31134e3540b91 100644
index e804e08e8b99d10b513972bd42a1257a66baeff4..857f6dedacf0533856e26b0a9a6f8e25c1f7bad9 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1561,11 +1561,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1565,11 +1565,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
return true; // CraftBukkit - Return event status
}
@ -23,8 +23,8 @@ index 52ff31d33edb0c55e2ec4a982525d47e4a19428b..77e31c3851813651dc00e59f8ef31134
this.cserver.getPluginManager().callEvent(event);
if (event.isCancelled() || !to.equals(event.getTo())) {
- set.clear(); // Can't relative teleport
+ // set.clear(); // Can't relative teleport // Paper - Teleport API; Now you can!
- set = Collections.emptySet(); // Can't relative teleport
+ // set = Collections.emptySet(); // Can't relative teleport // Paper - Teleport API; Now you can!
to = event.isCancelled() ? event.getFrom() : event.getTo();
d0 = to.getX();
d1 = to.getY();
@ -112,7 +112,7 @@ index 4c09f2529dd8eb7ac7d260d177f5292ff2339442..94051ae8ea93ab144f3767345b1cda04
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
index 4b7b812a0203ef8a586c0e0cee10c41935487309..d2f6fb41b16468bf03675b3a331c707e21f8c9ce 100644
index 252309281f440e9b7a6be3118363c4d97e5dd767..78c11d99b6dfdf742dbe24f7b3c2ddbcfd433fd6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1286,13 +1286,101 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

Datei anzeigen

@ -57,10 +57,10 @@ index 4d024956156aefde7df308642dfd0a40779e0633..6abecaac8407b992d208a9108e11fd49
}
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 77e31c3851813651dc00e59f8ef31134e3540b91..719f44cf1bca2cd834b7909e135b0a636c4ccb5e 100644
index 857f6dedacf0533856e26b0a9a6f8e25c1f7bad9..3637eebdf9841b97e2086ce611af27c052ac0461 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1707,8 +1707,28 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1711,8 +1711,28 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
return;
}
// Paper end - Don't allow digging into unloaded chunks

Datei anzeigen

@ -22,10 +22,10 @@ is actually processed, this is honestly really just exposed for the misnomers or
who just wanna ensure that this won't grow over a specific size if chat gets stupidly active
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
index e727414d784debd276dcc42aabf588d6fcbccc91..b2031483a327e22116e2584b278c3f0d59bf90a6 100644
index 45ab7ff5497ceccb85944d2e8d354d9c860abf3b..917bd0c1dd8f356edc3741ee59d24e4d090af182 100644
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -295,7 +295,18 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -296,7 +296,18 @@ public class GlobalConfiguration extends ConfigurationPart {
@PostProcess
private void postProcess() {

Datei anzeigen

@ -25,7 +25,7 @@ index d2dfa49e124460f4762b950f9ded106d2ec15dc2..bc58323801ee16fe9b63c21332144ec0
}
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
index d3d50ec0f4466464c048449d8a844569c447d59b..0192b62fd66621a72fcf2f20896647e5950ba993 100644
index d3d50ec0f4466464c048449d8a844569c447d59b..b9810a1f6ac91ae9631dd1ebc225f009d91b7845 100644
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
@@ -242,11 +242,16 @@ public class PiglinAi {
@ -46,6 +46,15 @@ index d3d50ec0f4466464c048449d8a844569c447d59b..0192b62fd66621a72fcf2f20896647e5
piglin.take(drop, 1);
itemstack = PiglinAi.removeOneItemFromItemEntity(drop);
} else {
@@ -261,7 +266,7 @@ public class PiglinAi {
} else if (PiglinAi.isFood(itemstack) && !PiglinAi.hasEatenRecently(piglin)) {
PiglinAi.eat(piglin);
} else {
- boolean flag = !piglin.equipItemIfPossible(itemstack, drop).equals(ItemStack.EMPTY); // CraftBukkit
+ boolean flag = !piglin.equipItemIfPossible(itemstack, null).equals(ItemStack.EMPTY); // CraftBukkit // Paper - pass null item entity to prevent duplicate pickup item event call - called above.
if (!flag) {
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
index 174d246b0a4d0fc9d769aad08da627ca8487bdf2..bbf21ea433f9e3963aac0ede597ed8d3c8e50ed8 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raider.java

Datei anzeigen

@ -30,10 +30,10 @@ index 03d89f326d320c5d778c3d1e2db7d6b88753faec..717d015dd4637dd9d568b751be1dc104
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 697ef7d19cca2d3f51ccff9e4ab14d87a7ddaf00..668becf24a16af6b834d05608787c8f9420e9ad3 100644
index d793566b2b5b0e996e4122087a883e92b24c216f..e1e5a195c2a415d214c5bf8a2364835f7332751b 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -554,6 +554,12 @@ public class CraftEventFactory {
@@ -556,6 +556,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 targetPos) {
@ -46,7 +46,7 @@ index 697ef7d19cca2d3f51ccff9e4ab14d87a7ddaf00..668becf24a16af6b834d05608787c8f9
Player player = (who == null) ? null : (Player) who.getBukkitEntity();
CraftItemStack itemInHand = CraftItemStack.asCraftMirror(itemstack);
@@ -588,6 +594,11 @@ public class CraftEventFactory {
@@ -590,6 +596,11 @@ public class CraftEventFactory {
if (cancelledBlock) {
event.setUseInteractedBlock(Event.Result.DENY);
}

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add EntityToggleSitEvent
diff --git a/src/main/java/net/minecraft/world/entity/TamableAnimal.java b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
index 07ec4837d17a9cb7db2fa310a42fc87e052b3f9b..39adc89b35213d5d5fb71bb4b7e0c641f77e4a06 100644
index 5405792eea1d90492183faa23367f13b88cd1721..8a4f15964449a40ae4fffc5d16b7789d61c4c594 100644
--- a/src/main/java/net/minecraft/world/entity/TamableAnimal.java
+++ b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
@@ -86,7 +86,7 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity {
@ -17,7 +17,7 @@ index 07ec4837d17a9cb7db2fa310a42fc87e052b3f9b..39adc89b35213d5d5fb71bb4b7e0c641
}
@Override
@@ -162,6 +162,12 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity {
@@ -166,6 +166,12 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity {
}
public void setInSittingPose(boolean inSittingPose) {

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen