Skip to content

Commit

Permalink
Updated Upstream (Bukkit/CraftBukkit) (PaperMC#10691)
Browse files Browse the repository at this point in the history
Updated Upstream (Bukkit/CraftBukkit)

Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
fa99e75 PR-1007: Add ItemMeta#getAsComponentString()
94a9178 Fix copy-pasted BlockType.Typed documentation
9b34ac8 Largely restore deprecated PotionData API
51a6449 PR-1008: Deprecate ITEMS_TOOLS, removed in 1.20.5
702d15f Fix Javadoc reference
42f6cdf PR-919: Add internal ItemType and BlockType, delegate Material methods to them
237bb37 SPIGOT-1166, SPIGOT-7647: Expose Damager BlockState in EntityDamageByBlockEvent
035ea14 SPIGOT-6993: Allow #setVelocity to change the speed of a fireball and add a note to #setDirection about it
8c7880f PR-1004: Improve field rename handling and centralize conversion between bukkit and string more
87c90e9 SPIGOT-7650: Add DamageSource for EntityDeathEvent and PlayerDeathEvent

CraftBukkit Changes:
4af0f22 SPIGOT-7664: Item meta should prevail over block states
c2ccc46 SPIGOT-7666: Fix access to llama and horse special slot
124ac66 SPIGOT-7665: Fix ThrownPotion#getEffects() implementation only bringing custom effects
66f1f43 Restore null page behaviour of signed books even though not strictly allowed by API
6118e53 Fix regression listening to minecraft:brand custom payloads
c1a26b3 Fix unnecessary and potential not thread-safe chat visibility check
12360a7 Remove unused imports
147b098 PR-1397: Add ItemMeta#getAsComponentString()
428aefe Largely restore deprecated PotionData API
afe5b5e PR-1275: Add internal ItemType and BlockType, delegate Material methods to them
8afeafa SPIGOT-1166, SPIGOT-7647: Expose Damager BlockState in EntityDamageByBlockEvent
4e7d749 SPIGOT-6993: Allow #setVelocity to change the speed of a fireball and add a note to #setDirection about it
4418807 Support both entity_data and bucket_entity_data on axolotl/fish buckets
0e22fdd Fix custom direct BlockState being not correctly set in DamageSource
f2182ed SPIGOT-7659: TropicalFishBucketMeta should use BUCKET_ENTITY_DATA
2a6207f PR-1393: Improve field rename handling and centralize conversion between bukkit and string more
c024a50 SPIGOT-7650: Add DamageSource for EntityDeathEvent and PlayerDeathEvent
741b844 PR-1390: Improve internal handling of damage sources
0364df4 SPIGOT-7657: Error when loading angry entities
  • Loading branch information
Machine-Maker authored May 11, 2024
1 parent b98d20a commit ac554ad
Show file tree
Hide file tree
Showing 614 changed files with 1,323 additions and 1,435 deletions.
17 changes: 15 additions & 2 deletions patches/api/0004-Code-Generation.patch
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ index 0000000000000000000000000000000000000000..2512dba27edfdccbc4430815b6cba048
+}
diff --git a/src/main/java/io/papermc/paper/registry/RegistryKey.java b/src/main/java/io/papermc/paper/registry/RegistryKey.java
new file mode 100644
index 0000000000000000000000000000000000000000..a505064565f7f029be8727b1951d9ef67c3acf2c
index 0000000000000000000000000000000000000000..7b79bf33074355020e0b3b5ef40c7f2e6ba644b4
--- /dev/null
+++ b/src/main/java/io/papermc/paper/registry/RegistryKey.java
@@ -0,0 +1,128 @@
@@ -0,0 +1,141 @@
+package io.papermc.paper.registry;
+
+import net.kyori.adventure.key.Keyed;
Expand All @@ -100,6 +100,7 @@ index 0000000000000000000000000000000000000000..a505064565f7f029be8727b1951d9ef6
+import org.bukkit.Sound;
+import org.bukkit.attribute.Attribute;
+import org.bukkit.block.Biome;
+import org.bukkit.block.BlockType;
+import org.bukkit.block.banner.PatternType;
+import org.bukkit.damage.DamageType;
+import org.bukkit.enchantments.Enchantment;
Expand All @@ -111,11 +112,13 @@ index 0000000000000000000000000000000000000000..a505064565f7f029be8727b1951d9ef6
+import org.bukkit.entity.memory.MemoryKey;
+import org.bukkit.generator.structure.Structure;
+import org.bukkit.generator.structure.StructureType;
+import org.bukkit.inventory.ItemType;
+import org.bukkit.inventory.meta.trim.TrimMaterial;
+import org.bukkit.inventory.meta.trim.TrimPattern;
+import org.bukkit.map.MapCursor;
+import org.bukkit.potion.PotionEffectType;
+import org.bukkit.potion.PotionType;
+import org.jetbrains.annotations.ApiStatus;
+
+import static io.papermc.paper.registry.RegistryKeyImpl.create;
+
Expand Down Expand Up @@ -162,6 +165,16 @@ index 0000000000000000000000000000000000000000..a505064565f7f029be8727b1951d9ef6
+ * @see io.papermc.paper.registry.keys.MobEffectKeys
+ */
+ RegistryKey<PotionEffectType> MOB_EFFECT = create("mob_effect");
+ /**
+ * @apiNote DO NOT USE
+ */
+ @ApiStatus.Internal
+ RegistryKey<BlockType> BLOCK = create("block");
+ /**
+ * @apiNote DO NOT USE
+ */
+ @ApiStatus.Internal
+ RegistryKey<ItemType> ITEM = create("item");
+
+
+ /* ********************** *
Expand Down
60 changes: 30 additions & 30 deletions patches/api/0006-Adventure.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,7 @@ index ac5e263d737973af077e3406a84a84baca4370db..2d91924b7f5ef16a91d40cdc1bfc3d68
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index ef3c0410ba4f88ec8b51e79abdc97777fdc00d31..913cf8308840ca1f365eb1f456f64b96046ed060 100644
index ce9bb54a6ef8a7d31804ec63aa1f6cbbd6ae2d54..baf49da3dd46039da2f24a4af8b1b8617bb25501 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -30,6 +30,15 @@ import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -3170,10 +3170,10 @@ index f4ac033ff8794a61c82a49dc6c3f863f3291455d..d944d67f544494355f03c5bc9afd8ea7

/**
diff --git a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
index 3c2ea8fec3a748cab7f5ad9100d12bd8213ec6c9..03b4e0300d228e3f3a9f4f75c96e0cf9ed1a7d2d 100644
index 133760be6c73436512ba684a3ac77a514b2d8765..9473303bd8ab1f6b63b6999a5f5ff3eca1cc23d6 100644
--- a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
+++ b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
@@ -11,26 +11,49 @@ import org.jetbrains.annotations.Nullable;
@@ -12,26 +12,49 @@ import org.jetbrains.annotations.Nullable;
*/
public class PlayerDeathEvent extends EntityDeathEvent {
private int newExp = 0;
Expand All @@ -3185,18 +3185,18 @@ index 3c2ea8fec3a748cab7f5ad9100d12bd8213ec6c9..03b4e0300d228e3f3a9f4f75c96e0cf9
private boolean keepInventory = false;
+ // Paper start - adventure
+ @org.jetbrains.annotations.ApiStatus.Internal
+ public PlayerDeathEvent(final @NotNull Player player, final @NotNull List<ItemStack> drops, final int droppedExp, final @Nullable net.kyori.adventure.text.Component deathMessage) {
+ this(player, drops, droppedExp, 0, deathMessage);
+ public PlayerDeathEvent(final @NotNull Player player, final @NotNull DamageSource damageSource, final @NotNull List<ItemStack> drops, final int droppedExp, final @Nullable net.kyori.adventure.text.Component deathMessage) {
+ this(player, damageSource, drops, droppedExp, 0, deathMessage);
+ }
+
+ @org.jetbrains.annotations.ApiStatus.Internal
+ public PlayerDeathEvent(final @NotNull Player player, final @NotNull List<ItemStack> drops, final int droppedExp, final int newExp, final @Nullable net.kyori.adventure.text.Component deathMessage) {
+ this(player, drops, droppedExp, newExp, 0, 0, deathMessage);
+ public PlayerDeathEvent(final @NotNull Player player, final @NotNull DamageSource damageSource, final @NotNull List<ItemStack> drops, final int droppedExp, final int newExp, final @Nullable net.kyori.adventure.text.Component deathMessage) {
+ this(player, damageSource, drops, droppedExp, newExp, 0, 0, deathMessage);
+ }
+
+ @org.jetbrains.annotations.ApiStatus.Internal
+ public PlayerDeathEvent(final @NotNull Player player, final @NotNull List<ItemStack> drops, final int droppedExp, final int newExp, final int newTotalExp, final int newLevel, final @Nullable net.kyori.adventure.text.Component deathMessage) {
+ super(player, drops, droppedExp);
+ public PlayerDeathEvent(final @NotNull Player player, final @NotNull DamageSource damageSource, final @NotNull List<ItemStack> drops, final int droppedExp, final int newExp, final int newTotalExp, final int newLevel, final @Nullable net.kyori.adventure.text.Component deathMessage) {
+ super(player, damageSource, drops, droppedExp);
+ this.newExp = newExp;
+ this.newTotalExp = newTotalExp;
+ this.newLevel = newLevel;
Expand All @@ -3205,18 +3205,18 @@ index 3c2ea8fec3a748cab7f5ad9100d12bd8213ec6c9..03b4e0300d228e3f3a9f4f75c96e0cf9
+ // Paper end - adventure

+ @Deprecated // Paper
public PlayerDeathEvent(@NotNull final Player player, @NotNull final List<ItemStack> drops, final int droppedExp, @Nullable final String deathMessage) {
this(player, drops, droppedExp, 0, deathMessage);
public PlayerDeathEvent(@NotNull final Player player, @NotNull DamageSource damageSource, @NotNull final List<ItemStack> drops, final int droppedExp, @Nullable final String deathMessage) {
this(player, damageSource, drops, droppedExp, 0, deathMessage);
}

+ @Deprecated // Paper
public PlayerDeathEvent(@NotNull final Player player, @NotNull final List<ItemStack> drops, final int droppedExp, final int newExp, @Nullable final String deathMessage) {
this(player, drops, droppedExp, newExp, 0, 0, deathMessage);
public PlayerDeathEvent(@NotNull final Player player, @NotNull DamageSource damageSource, @NotNull final List<ItemStack> drops, final int droppedExp, final int newExp, @Nullable final String deathMessage) {
this(player, damageSource, drops, droppedExp, newExp, 0, 0, deathMessage);
}

+ @Deprecated // Paper
public PlayerDeathEvent(@NotNull final Player player, @NotNull final List<ItemStack> drops, final int droppedExp, final int newExp, final int newTotalExp, final int newLevel, @Nullable final String deathMessage) {
super(player, drops, droppedExp);
public PlayerDeathEvent(@NotNull final Player player, @NotNull DamageSource damageSource, @NotNull final List<ItemStack> drops, final int droppedExp, final int newExp, final int newTotalExp, final int newLevel, @Nullable final String deathMessage) {
super(player, damageSource, drops, droppedExp);
this.newExp = newExp;
this.newTotalExp = newTotalExp;
this.newLevel = newLevel;
Expand All @@ -3225,7 +3225,7 @@ index 3c2ea8fec3a748cab7f5ad9100d12bd8213ec6c9..03b4e0300d228e3f3a9f4f75c96e0cf9
}

@NotNull
@@ -39,25 +62,49 @@ public class PlayerDeathEvent extends EntityDeathEvent {
@@ -40,25 +63,49 @@ public class PlayerDeathEvent extends EntityDeathEvent {
return (Player) entity;
}

Expand Down Expand Up @@ -4294,7 +4294,7 @@ index e12996492c1558fed9fab30de9f8018e0ed7fac3..002acfbdce1db10f7ba1b6a013e678f5

/**
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index 60ebfab9596f26cfd2d75a43f3f88f2dd56575f3..dbaf54018a7dd392378869a5a302a880c7a56338 100644
index b8bb11544bdfb5b9272c2c3c33c95a4c1c7fdf12..86fbc3902989a3baca851ab8c3866af445451787 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -215,4 +215,24 @@ public interface ItemFactory {
Expand Down Expand Up @@ -4323,10 +4323,10 @@ index 60ebfab9596f26cfd2d75a43f3f88f2dd56575f3..dbaf54018a7dd392378869a5a302a880
+ // Paper end - Adventure
}
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 257b5db1aa58d57cfbf5bd1f17f9df6c509bef90..53cc84d1ef6e281e8637ec7406236e1185ad7d82 100644
index 692f67c4e27cf62451130479510d06c89274ad23..22e883c8d737cf9f799c6160ff63d90f99250020 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -23,7 +23,7 @@ import org.jetbrains.annotations.Nullable;
@@ -26,7 +26,7 @@ import org.jetbrains.annotations.Nullable;
* use this class to encapsulate Materials for which {@link Material#isItem()}
* returns false.</b>
*/
Expand All @@ -4335,7 +4335,7 @@ index 257b5db1aa58d57cfbf5bd1f17f9df6c509bef90..53cc84d1ef6e281e8637ec7406236e11
private Material type = Material.AIR;
private int amount = 0;
private MaterialData data = null;
@@ -617,4 +617,21 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
@@ -624,4 +624,21 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
public String getTranslationKey() {
return Bukkit.getUnsafe().getTranslationKey(this);
}
Expand Down Expand Up @@ -4596,10 +4596,10 @@ index 9bab73c3c2ca759b8e1c7d07d98cc593c961666a..f0c6943da3f783101ca647b75b3230fa
throw new UnsupportedOperationException("Not supported yet.");
}
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
index 255f79d5bca15620cb17d7b54ffebb6ff00bff6b..18c2864c99d4dfae16cdb35143486aeebb9a6fd6 100644
index 3a87089ba78f1e603ef582fcda3eb915d11f21a5..a23d030d2204098be17d8b18021fd0bb79b4431b 100644
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
@@ -34,6 +34,24 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -35,6 +35,24 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
*/
boolean hasDisplayName();

Expand All @@ -4624,7 +4624,7 @@ index 255f79d5bca15620cb17d7b54ffebb6ff00bff6b..18c2864c99d4dfae16cdb35143486aee
/**
* Gets the display name that is set.
* <p>
@@ -41,7 +59,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -42,7 +60,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* before calling this method.
*
* @return the display name that is set
Expand All @@ -4634,7 +4634,7 @@ index 255f79d5bca15620cb17d7b54ffebb6ff00bff6b..18c2864c99d4dfae16cdb35143486aee
@NotNull
String getDisplayName();

@@ -49,7 +69,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -50,7 +70,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* Sets the display name.
*
* @param name the name to set
Expand All @@ -4644,7 +4644,7 @@ index 255f79d5bca15620cb17d7b54ffebb6ff00bff6b..18c2864c99d4dfae16cdb35143486aee
void setDisplayName(@Nullable String name);

/**
@@ -62,6 +84,32 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -63,6 +85,32 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
*/
boolean hasItemName();

Expand Down Expand Up @@ -4677,7 +4677,7 @@ index 255f79d5bca15620cb17d7b54ffebb6ff00bff6b..18c2864c99d4dfae16cdb35143486aee
/**
* Gets the item name that is set.
* <br>
@@ -72,7 +120,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -73,7 +121,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* calling this method.
*
* @return the item name that is set
Expand All @@ -4687,7 +4687,7 @@ index 255f79d5bca15620cb17d7b54ffebb6ff00bff6b..18c2864c99d4dfae16cdb35143486aee
@NotNull
String getItemName();

@@ -83,7 +133,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -84,7 +134,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* anvil, is not styled with italics, and does not show labels.
*
* @param name the name to set
Expand All @@ -4697,7 +4697,7 @@ index 255f79d5bca15620cb17d7b54ffebb6ff00bff6b..18c2864c99d4dfae16cdb35143486aee
void setItemName(@Nullable String name);

/**
@@ -124,6 +176,24 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -125,6 +177,24 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
*/
boolean hasLore();

Expand All @@ -4722,7 +4722,7 @@ index 255f79d5bca15620cb17d7b54ffebb6ff00bff6b..18c2864c99d4dfae16cdb35143486aee
/**
* Gets the lore that is set.
* <p>
@@ -131,7 +201,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -132,7 +202,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* calling this method.
*
* @return a list of lore that is set
Expand All @@ -4732,7 +4732,7 @@ index 255f79d5bca15620cb17d7b54ffebb6ff00bff6b..18c2864c99d4dfae16cdb35143486aee
@Nullable
List<String> getLore();

@@ -140,7 +212,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -141,7 +213,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* Removes lore when given null.
*
* @param lore the lore that will be set
Expand Down
9 changes: 5 additions & 4 deletions patches/api/0009-Paper-Plugins.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1347,13 +1347,14 @@ index 0000000000000000000000000000000000000000..6bf3d212a6156ad9ab0e82d1ca0a04f8
+
+}
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 913cf8308840ca1f365eb1f456f64b96046ed060..6e46302c272b468375f2de3f7f992f55f13805b8 100644
index baf49da3dd46039da2f24a4af8b1b8617bb25501..7cf61228754527ddaa6b39b5f1426e0527cdaac9 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -129,4 +129,13 @@ public interface UnsafeValues {
@@ -137,4 +137,14 @@ public interface UnsafeValues {

@ApiStatus.Internal
@NotNull
DamageSource.Builder createDamageSourceBuilder(@NotNull DamageType damageType);
<B extends Keyed> B get(Registry<B> registry, NamespacedKey key);
+
+ // Paper start
+ @Deprecated(forRemoval = true)
+ boolean isSupportedApiVersion(String apiVersion);
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0011-Timings-v2.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2897,7 +2897,7 @@ index 3bf7db7eac81e3cc6f5c6700637d10d1b4b7a47b..77f8b0889cd7039bf041fc052fba33b6
* Sends the component to the player
*
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 6e46302c272b468375f2de3f7f992f55f13805b8..01e796e487cc16710f51b457466a37ba70e1e665 100644
index 7cf61228754527ddaa6b39b5f1426e0527cdaac9..9082e67324f810857db26bb89ecea7e9f866f80d 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -40,6 +40,7 @@ public interface UnsafeValues {
Expand All @@ -2908,7 +2908,7 @@ index 6e46302c272b468375f2de3f7f992f55f13805b8..01e796e487cc16710f51b457466a37ba
Material toLegacy(Material material);

Material fromLegacy(Material material);
@@ -138,4 +139,12 @@ public interface UnsafeValues {
@@ -147,4 +148,12 @@ public interface UnsafeValues {
return !Bukkit.getUnsafe().isSupportedApiVersion(plugin.getDescription().getAPIVersion());
}
// Paper end
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0015-Version-Command-2.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ index 0000000000000000000000000000000000000000..a736d7bcdc5861a01b66ba36158db1c7
+ }
+}
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 01e796e487cc16710f51b457466a37ba70e1e665..d69e5fa40702c283c370a2f712b51dc2ea3a1fa0 100644
index 9082e67324f810857db26bb89ecea7e9f866f80d..da997507b96908027c49dabc6daf7c787dcad95d 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -146,5 +146,12 @@ public interface UnsafeValues {
@@ -155,5 +155,12 @@ public interface UnsafeValues {
* @return name
*/
String getTimingsServerName();
Expand Down
Loading

0 comments on commit ac554ad

Please sign in to comment.