aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api
diff options
context:
space:
mode:
Diffstat (limited to 'patches/api')
-rw-r--r--patches/api/0207-Add-methods-to-get-translation-keys.patch76
-rw-r--r--patches/api/0259-Improve-Item-Rarity-API.patch16
-rw-r--r--patches/api/0282-Attributes-API-for-item-defaults.patch16
-rw-r--r--patches/api/0314-Add-hasCollision-methods-to-various-places.patch (renamed from patches/api/0314-Add-isCollidable-methods-to-various-places.patch)60
-rw-r--r--patches/api/0364-Add-NamespacedKey-biome-methods.patch11
-rw-r--r--patches/api/0412-Fix-custom-statistic-criteria-creation.patch9
-rw-r--r--patches/api/0450-Add-api-for-spawn-egg-texture-colors.patch8
-rw-r--r--patches/api/0451-Add-Lifecycle-Event-system.patch4
-rw-r--r--patches/api/0452-ItemStack-Tooltip-API.patch4
9 files changed, 134 insertions, 70 deletions
diff --git a/patches/api/0207-Add-methods-to-get-translation-keys.patch b/patches/api/0207-Add-methods-to-get-translation-keys.patch
index d504fbdf2a..8c3241281f 100644
--- a/patches/api/0207-Add-methods-to-get-translation-keys.patch
+++ b/patches/api/0207-Add-methods-to-get-translation-keys.patch
@@ -144,7 +144,7 @@ index dc66bd69646ac949d1386ce8f6ff913e9475439d..4482e8f2c617c2f51b2b53762e775d11
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
-index feebabf946913263461e1d0f13a478cf4bfd0f68..d6e2ec415eab4f55fd925a3b0982e869befbd088 100644
+index feebabf946913263461e1d0f13a478cf4bfd0f68..ebf505bbdc1b44d1fcd3c30f4143f6e5b89d09e9 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -129,7 +129,7 @@ import org.jetbrains.annotations.Nullable;
@@ -156,23 +156,25 @@ index feebabf946913263461e1d0f13a478cf4bfd0f68..d6e2ec415eab4f55fd925a3b0982e869
//<editor-fold desc="Materials" defaultstate="collapsed">
AIR(9648, 0),
STONE(22948),
-@@ -4743,6 +4743,15 @@ public enum Material implements Keyed, Translatable {
- }
- return false;
+@@ -4745,6 +4745,17 @@ public enum Material implements Keyed, Translatable {
}
-+
+ // Paper end
+
++ // Paper start - add Translatable
+ @Override
+ public @NotNull String translationKey() {
+ if (this.isItem()) {
-+ return Bukkit.getUnsafe().getItemTranslationKey(this);
++ return java.util.Objects.requireNonNull(this.asItemType()).translationKey();
+ } else {
-+ return Bukkit.getUnsafe().getBlockTranslationKey(this);
++ return java.util.Objects.requireNonNull(this.asBlockType()).translationKey();
+ }
+ }
- // Paper end
-
++ // Paper end - add Translatable
++
/**
-@@ -5494,9 +5503,11 @@ public enum Material implements Keyed, Translatable {
+ * Do not use for any reason.
+ *
+@@ -5494,9 +5505,11 @@ public enum Material implements Keyed, Translatable {
* material
* @see #getBlockTranslationKey()
* @see #getItemTranslationKey()
@@ -309,6 +311,33 @@ index bf29d9b733afc7c62725d259f4920c4f211cc6d0..1d3812db989a55b6f31bb30dffe70323
+ String getTranslationKey();
// Paper end
}
+diff --git a/src/main/java/org/bukkit/block/BlockType.java b/src/main/java/org/bukkit/block/BlockType.java
+index 95cedd536fed5a195fb2dd76da1c451598250f53..d4e824ad18714b951cf161031a9566e6796ab507 100644
+--- a/src/main/java/org/bukkit/block/BlockType.java
++++ b/src/main/java/org/bukkit/block/BlockType.java
+@@ -125,7 +125,7 @@ import org.jetbrains.annotations.Nullable;
+ * changes may occur. Do not use this API in plugins.
+ */
+ @ApiStatus.Internal
+-public interface BlockType extends Keyed, Translatable {
++public interface BlockType extends Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper - add translatable
+
+ /**
+ * Typed represents a subtype of {@link BlockType}s that have a known block
+@@ -3602,4 +3602,13 @@ public interface BlockType extends Keyed, Translatable {
+ @Nullable
+ @Deprecated
+ Material asMaterial();
++
++ // Paper start - add Translatable
++ /**
++ * @deprecated use {@link #translationKey()} and {@link net.kyori.adventure.text.Component#translatable(net.kyori.adventure.translation.Translatable)}
++ */
++ @Deprecated(forRemoval = true)
++ @Override
++ @NotNull String getTranslationKey();
++ // Paper end - add Translatable
+ }
diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/java/org/bukkit/enchantments/Enchantment.java
index f4ec7891bdcedc73bff6938e3eddb7ee43d23ec1..4e41980dfbb256356231bc9565f6a90ea66aab76 100644
--- a/src/main/java/org/bukkit/enchantments/Enchantment.java
@@ -517,3 +546,30 @@ index 066f99a1f4cc42cf0e87d495f97a0685817dfa18..23686519b8c1338dd6e9f1c5a0e73467
+ }
// Paper end
}
+diff --git a/src/main/java/org/bukkit/inventory/ItemType.java b/src/main/java/org/bukkit/inventory/ItemType.java
+index aa0f66b7187c800cd22905bfa43af3ffb53edb5f..3d30c4957a2950ac8d4635ed7bb9bf39ca8cd158 100644
+--- a/src/main/java/org/bukkit/inventory/ItemType.java
++++ b/src/main/java/org/bukkit/inventory/ItemType.java
+@@ -49,7 +49,7 @@ import org.jetbrains.annotations.Nullable;
+ * changes may occur. Do not use this API in plugins.
+ */
+ @ApiStatus.Internal
+-public interface ItemType extends Keyed, Translatable {
++public interface ItemType extends Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper - add Translatable
+
+ /**
+ * Typed represents a subtype of {@link ItemType}s that have a known item meta type
+@@ -2419,4 +2419,13 @@ public interface ItemType extends Keyed, Translatable {
+ @Nullable
+ @Deprecated
+ Material asMaterial();
++
++ // Paper start - add Translatable
++ /**
++ * @deprecated use {@link #translationKey()} and {@link net.kyori.adventure.text.Component#translatable(net.kyori.adventure.translation.Translatable)}
++ */
++ @Deprecated(forRemoval = true)
++ @Override
++ @NotNull String getTranslationKey();
++ // Paper end - add Translatable
+ }
diff --git a/patches/api/0259-Improve-Item-Rarity-API.patch b/patches/api/0259-Improve-Item-Rarity-API.patch
index 3c1ddd5e14..bef6de4e65 100644
--- a/patches/api/0259-Improve-Item-Rarity-API.patch
+++ b/patches/api/0259-Improve-Item-Rarity-API.patch
@@ -43,14 +43,14 @@ index 0000000000000000000000000000000000000000..f1cd5a4f37eee8975ac3d0421b524afc
+ }
+}
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
-index d6e2ec415eab4f55fd925a3b0982e869befbd088..044c563daee7898c676bd6ba58ee395c52eda121 100644
+index ebf505bbdc1b44d1fcd3c30f4143f6e5b89d09e9..04cb8279f2296cc42405355c7c1f120e761202c4 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
-@@ -4752,6 +4752,19 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
- return Bukkit.getUnsafe().getBlockTranslationKey(this);
- }
+@@ -4756,6 +4756,21 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
}
-+
+ // Paper end - add Translatable
+
++ // Paper start - item rarity API
+ /**
+ * Returns the item rarity for the item. The Material <b>MUST</b> be an Item not a block.
+ * Use {@link #isItem()} before this.
@@ -63,9 +63,11 @@ index d6e2ec415eab4f55fd925a3b0982e869befbd088..044c563daee7898c676bd6ba58ee395c
+ public io.papermc.paper.inventory.ItemRarity getItemRarity() {
+ return new org.bukkit.inventory.ItemStack(this).getRarity();
+ }
- // Paper end
-
++ // Paper end - item rarity API
++
/**
+ * Do not use for any reason.
+ *
diff --git a/src/main/java/org/bukkit/inventory/ItemRarity.java b/src/main/java/org/bukkit/inventory/ItemRarity.java
index e7931f73f10fe35ebd5fe4a04b036d53bb117ebd..cbce835ed6d44e5b8c9aaae4e36a77f8e5bed45f 100644
--- a/src/main/java/org/bukkit/inventory/ItemRarity.java
diff --git a/patches/api/0282-Attributes-API-for-item-defaults.patch b/patches/api/0282-Attributes-API-for-item-defaults.patch
index 7fbe487dca..a7e57fedef 100644
--- a/patches/api/0282-Attributes-API-for-item-defaults.patch
+++ b/patches/api/0282-Attributes-API-for-item-defaults.patch
@@ -6,14 +6,14 @@ Subject: [PATCH] Attributes API for item defaults
(Now replaced by upstream's API)
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
-index 044c563daee7898c676bd6ba58ee395c52eda121..f6c3a4de2f07348d599e44d0b3173b8674ee85ac 100644
+index 04cb8279f2296cc42405355c7c1f120e761202c4..1df815c2e430a308baea08c9a7f3ca43377dc16e 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
-@@ -4765,6 +4765,21 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
- public io.papermc.paper.inventory.ItemRarity getItemRarity() {
- return new org.bukkit.inventory.ItemStack(this).getRarity();
+@@ -4771,6 +4771,23 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
}
-+
+ // Paper end - item rarity API
+
++ // Paper start - item default attributes API
+ /**
+ * Returns an immutable multimap of attributes for the slot.
+ * {@link #isItem()} must be true for this material.
@@ -28,6 +28,8 @@ index 044c563daee7898c676bd6ba58ee395c52eda121..f6c3a4de2f07348d599e44d0b3173b86
+ public Multimap<Attribute, AttributeModifier> getItemAttributes(@NotNull EquipmentSlot equipmentSlot) {
+ return this.getDefaultAttributeModifiers(equipmentSlot);
+ }
- // Paper end
-
++ // Paper end - item default attributes API
++
/**
+ * Do not use for any reason.
+ *
diff --git a/patches/api/0314-Add-isCollidable-methods-to-various-places.patch b/patches/api/0314-Add-hasCollision-methods-to-various-places.patch
index a5b82e6e22..267a64fe76 100644
--- a/patches/api/0314-Add-isCollidable-methods-to-various-places.patch
+++ b/patches/api/0314-Add-hasCollision-methods-to-various-places.patch
@@ -1,18 +1,18 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <[email protected]>
Date: Thu, 4 Nov 2021 11:50:35 -0700
-Subject: [PATCH] Add isCollidable methods to various places
+Subject: [PATCH] Add hasCollision methods to various places
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
-index f6c3a4de2f07348d599e44d0b3173b8674ee85ac..4ad5f2d40c10e7b059a9096dcc6a3b0b618411a0 100644
+index 1df815c2e430a308baea08c9a7f3ca43377dc16e..195bd298cfc2d43720550d5bf5a3347c064e9a7a 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
-@@ -4780,6 +4780,16 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
- public Multimap<Attribute, AttributeModifier> getItemAttributes(@NotNull EquipmentSlot equipmentSlot) {
- return this.getDefaultAttributeModifiers(equipmentSlot);
+@@ -4788,6 +4788,21 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
}
-+
+ // Paper end - item default attributes API
+
++ // Paper start - isCollidable API
+ /**
+ * Checks if this material is collidable.
+ *
@@ -20,30 +20,16 @@ index f6c3a4de2f07348d599e44d0b3173b8674ee85ac..4ad5f2d40c10e7b059a9096dcc6a3b0b
+ * @throws IllegalArgumentException if {@link #isBlock()} is false
+ */
+ public boolean isCollidable() {
-+ return Bukkit.getUnsafe().isCollidable(this);
++ if (this.isBlock()) {
++ return this.asBlockType().hasCollision();
++ }
++ throw new IllegalArgumentException(this + " isn't a block type");
+ }
- // Paper end
-
- /**
-diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
-index cbc63144e5eb35799548209f8fbee70d0c20a53d..891204af265ac4ef1f654407421e9962c0ff549b 100644
---- a/src/main/java/org/bukkit/UnsafeValues.java
-+++ b/src/main/java/org/bukkit/UnsafeValues.java
-@@ -212,5 +212,14 @@ public interface UnsafeValues {
- * @throws IllegalArgumentException if the entity does not exist of have default attributes (use {@link #hasDefaultEntityAttributes(NamespacedKey)} first)
- */
- @org.jetbrains.annotations.NotNull org.bukkit.attribute.Attributable getDefaultEntityAttributes(@org.jetbrains.annotations.NotNull NamespacedKey entityKey);
++ // Paper end - isCollidable API
+
-+ /**
-+ * Checks if this material is collidable.
-+ *
-+ * @param material the material to check
-+ * @return true if collidable
-+ * @throws IllegalArgumentException if {@link Material#isBlock()} is false
-+ */
-+ boolean isCollidable(@org.jetbrains.annotations.NotNull Material material);
- // Paper end
- }
+ /**
+ * Do not use for any reason.
+ *
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
index b5fe76a6353816a2d009dfa5921f8ada92984f34..42cc4f2ee960c0abf9c6688aeee4150754612c32 100644
--- a/src/main/java/org/bukkit/block/Block.java
@@ -80,3 +66,21 @@ index fd4a9bdcfb6775dfbdb7492e6c9eb90722d2ecdc..e573e70d9e74e444783a7363e6cdac12
+ boolean isCollidable();
+ // Paper end
}
+diff --git a/src/main/java/org/bukkit/block/BlockType.java b/src/main/java/org/bukkit/block/BlockType.java
+index d4e824ad18714b951cf161031a9566e6796ab507..61a73e813f7c14c61fac358e96aaaa64c41e560b 100644
+--- a/src/main/java/org/bukkit/block/BlockType.java
++++ b/src/main/java/org/bukkit/block/BlockType.java
+@@ -3611,4 +3611,13 @@ public interface BlockType extends Keyed, Translatable, net.kyori.adventure.tran
+ @Override
+ @NotNull String getTranslationKey();
+ // Paper end - add Translatable
++
++ // Paper start - hasCollision API
++ /**
++ * Checks if this block type has collision.
++ * <p>
++ * @return false if this block never has collision, true if it <b>might</b> have collision
++ */
++ boolean hasCollision();
++ // Paper end - hasCollision API
+ }
diff --git a/patches/api/0364-Add-NamespacedKey-biome-methods.patch b/patches/api/0364-Add-NamespacedKey-biome-methods.patch
index d4c0137a3f..29bd350af8 100644
--- a/patches/api/0364-Add-NamespacedKey-biome-methods.patch
+++ b/patches/api/0364-Add-NamespacedKey-biome-methods.patch
@@ -6,14 +6,15 @@ Subject: [PATCH] Add NamespacedKey biome methods
Co-authored-by: Thonk <[email protected]>
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
-index 20ddbfdad6856135a4c6a4778f81caee953f0fb4..c49f73355da362abb1c0e52f867dcfad8d4680f3 100644
+index 240ac3f658ed24d3980707e146e6dfee6c9b31a0..dad90b98413b57a878f940b8f423bd77e36fd179 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
-@@ -229,5 +229,32 @@ public interface UnsafeValues {
- * @throws IllegalArgumentException if {@link Material#isBlock()} is false
+@@ -221,4 +221,33 @@ public interface UnsafeValues {
*/
- boolean isCollidable(@org.jetbrains.annotations.NotNull Material material);
+ @org.jetbrains.annotations.NotNull org.bukkit.attribute.Attributable getDefaultEntityAttributes(@org.jetbrains.annotations.NotNull NamespacedKey entityKey);
+ // Paper end
+
++ // Paper start - namespaced key biome methods
+ /**
+ * Gets the {@link NamespacedKey} for the biome at the given location.
+ *
@@ -40,5 +41,5 @@ index 20ddbfdad6856135a4c6a4778f81caee953f0fb4..c49f73355da362abb1c0e52f867dcfad
+ * @throws IllegalStateException if no biome by the given key is registered.
+ */
+ void setBiomeKey(RegionAccessor accessor, int x, int y, int z, NamespacedKey biomeKey);
- // Paper end
++ // Paper end - namespaced key biome methods
}
diff --git a/patches/api/0412-Fix-custom-statistic-criteria-creation.patch b/patches/api/0412-Fix-custom-statistic-criteria-creation.patch
index bbfdc162d8..f4070d7bb4 100644
--- a/patches/api/0412-Fix-custom-statistic-criteria-creation.patch
+++ b/patches/api/0412-Fix-custom-statistic-criteria-creation.patch
@@ -5,16 +5,15 @@ Subject: [PATCH] Fix custom statistic criteria creation
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
-index c49f73355da362abb1c0e52f867dcfad8d4680f3..289346bcd0ef42cfaf2afc270eeb7525e520ce80 100644
+index dad90b98413b57a878f940b8f423bd77e36fd179..f261bd5971003e542e4806c1a989add8e0143466 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
-@@ -256,5 +256,7 @@ public interface UnsafeValues {
- * @throws IllegalStateException if no biome by the given key is registered.
+@@ -250,4 +250,6 @@ public interface UnsafeValues {
*/
void setBiomeKey(RegionAccessor accessor, int x, int y, int z, NamespacedKey biomeKey);
+ // Paper end - namespaced key biome methods
+
-+ String getStatisticCriteriaKey(@NotNull org.bukkit.Statistic statistic);
- // Paper end
++ String getStatisticCriteriaKey(@NotNull org.bukkit.Statistic statistic); // Paper - fix custom stats criteria creation
}
diff --git a/src/main/java/org/bukkit/scoreboard/Criteria.java b/src/main/java/org/bukkit/scoreboard/Criteria.java
index 7d79d7fadab19bfbefc4797d7e5bbd3e9d733b53..3bc3abaf093d13e22b6ac2ee59ab584c92b4666a 100644
diff --git a/patches/api/0450-Add-api-for-spawn-egg-texture-colors.patch b/patches/api/0450-Add-api-for-spawn-egg-texture-colors.patch
index 082f5a3005..23541c0b38 100644
--- a/patches/api/0450-Add-api-for-spawn-egg-texture-colors.patch
+++ b/patches/api/0450-Add-api-for-spawn-egg-texture-colors.patch
@@ -5,13 +5,13 @@ Subject: [PATCH] Add api for spawn egg texture colors
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
-index 289346bcd0ef42cfaf2afc270eeb7525e520ce80..ffb22192e08b9d47ac2667efa0d62a548f14d46b 100644
+index f261bd5971003e542e4806c1a989add8e0143466..02d34db5f44ed63c4635077eb2b3cb98ac94b7b2 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
-@@ -259,4 +259,17 @@ public interface UnsafeValues {
+@@ -252,4 +252,17 @@ public interface UnsafeValues {
+ // Paper end - namespaced key biome methods
- String getStatisticCriteriaKey(@NotNull org.bukkit.Statistic statistic);
- // Paper end
+ String getStatisticCriteriaKey(@NotNull org.bukkit.Statistic statistic); // Paper - fix custom stats criteria creation
+
+ // Paper start - spawn egg color visibility
+ /**
diff --git a/patches/api/0451-Add-Lifecycle-Event-system.patch b/patches/api/0451-Add-Lifecycle-Event-system.patch
index b40399205b..66895fac79 100644
--- a/patches/api/0451-Add-Lifecycle-Event-system.patch
+++ b/patches/api/0451-Add-Lifecycle-Event-system.patch
@@ -528,10 +528,10 @@ index 0000000000000000000000000000000000000000..304f978e40e1759bb19704cc5cec3995
+ }
+}
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
-index ffb22192e08b9d47ac2667efa0d62a548f14d46b..6b67c32343876f345459300a4bb6b692412bfc52 100644
+index 02d34db5f44ed63c4635077eb2b3cb98ac94b7b2..3f1b48fd65df954e874e6dc6b9093cb12370e2c5 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
-@@ -272,4 +272,12 @@ public interface UnsafeValues {
+@@ -265,4 +265,12 @@ public interface UnsafeValues {
*/
@Nullable org.bukkit.Color getSpawnEggLayerColor(org.bukkit.entity.EntityType entityType, int layer);
// Paper end - spawn egg color visibility
diff --git a/patches/api/0452-ItemStack-Tooltip-API.patch b/patches/api/0452-ItemStack-Tooltip-API.patch
index 3983a283cd..b5c800bcb4 100644
--- a/patches/api/0452-ItemStack-Tooltip-API.patch
+++ b/patches/api/0452-ItemStack-Tooltip-API.patch
@@ -108,10 +108,10 @@ index 0000000000000000000000000000000000000000..1d9bed6691f581529c53b577b26f1d0f
+ }
+}
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
-index 6b67c32343876f345459300a4bb6b692412bfc52..0857a65ecbc36e0e4b8a7d0cda52be35f238f660 100644
+index 3f1b48fd65df954e874e6dc6b9093cb12370e2c5..0e9ccfee7a03d341e7c4d271f53b4ed168b404ef 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
-@@ -280,4 +280,6 @@ public interface UnsafeValues {
+@@ -273,4 +273,6 @@ public interface UnsafeValues {
@org.jetbrains.annotations.ApiStatus.Internal
io.papermc.paper.plugin.lifecycle.event.LifecycleEventManager<org.bukkit.plugin.Plugin> createPluginLifecycleEventManager(final org.bukkit.plugin.java.JavaPlugin plugin, final java.util.function.BooleanSupplier registrationCheck);
// Paper end - lifecycle event API