Updated Upstream (Bukkit/CraftBukkit) (#10379)

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:
f02baa38 PR-988: Add World#getIntersectingChunks(BoundingBox)
9321d665 Move getItemInUse up to LivingEntity
819eef73 PR-959: Add access to current item's remaining ticks
c4fdadb0 SPIGOT-7601: Add AbstractArrow#getItem
be8261ca Add support for Java 22
26119676 PR-979: Add more translation keys
66753362 PR-985: Correct book maximum pages and characters per page documentation
c8be92fa PR-980: Improve getArmorContents() documentation
f1120ee2 PR-983: Expose riptide velocity to PlayerRiptideEvent

CraftBukkit Changes:
dfaa89bbe PR-1369: Add World#getIntersectingChunks(BoundingBox)
51bbab2b9 Move getItemInUse up to LivingEntity
668e09602 PR-1331: Add access to current item's remaining ticks
a639406d1 SPIGOT-7601: Add AbstractArrow#getItem
0398930fc SPIGOT-7602: Allow opening in-world horse and related inventories
ffd15611c SPIGOT-7608: Allow empty lists to morph to any PDT list
2188dcfa9 Add support for Java 22
45d6a609f SPIGOT-7604: Revert "SPIGOT-7365: DamageCause blocked by shield should trigger invulnerableTime"
06d915943 SPIGOT-7365: DamageCause blocked by shield should trigger invulnerableTime
ca3bc3707 PR-1361: Add more translation keys
366c3ca80 SPIGOT-7600: EntityChangeBlockEvent is not fired for frog eggs
06d0f9ba8 SPIGOT-7593: Fix sapling growth physics / client-side updates
45c2608e4 PR-1366: Expose riptide velocity to PlayerRiptideEvent
29b6bb79b SPIGOT-7587: Remove fixes for now-resolved MC-142590 and MC-109346
This commit is contained in:
Jake Potrebic 2024-04-06 12:53:39 -07:00
parent 61dc3d0b17
commit 68e86d7297
59 changed files with 502 additions and 327 deletions

View File

@ -17,7 +17,7 @@ dependencies {
testImplementation("junit:junit:4.13.2")
testImplementation("org.hamcrest:hamcrest-library:1.3")
testImplementation("org.ow2.asm:asm-tree:9.2")
testImplementation("org.ow2.asm:asm-tree:9.7")
}
configure<PublishingExtension> {

View File

@ -57,10 +57,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @param amount the amount of damage to do
*/
void damageItemStack(org.bukkit.inventory.@NotNull EquipmentSlot slot, int amount);
// Paper end - ItemStack damage API
+
+ // Paper start - body yaw API
+ /**
+ * Gets entity body yaw
+ *
@ -76,5 +77,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @see Location#setYaw(float)
+ */
+ void setBodyYaw(float bodyYaw);
// Paper end
+ // Paper end - body yaw API
}

View File

@ -9,16 +9,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@NotNull
org.bukkit.inventory.ItemStack getActiveItem();
*/
org.bukkit.inventory.@NotNull ItemStack getActiveItem();
+ // Paper start
+ /**
+ * Interrupts any ongoing active "usage" or consumption or an item.
+ */
+ void clearActiveItem();
+ // Paper end
+
/**
* Get's remaining time a player needs to keep hands raised with an item to finish using it.
* @return Remaining ticks to use the item
* Gets the remaining number of ticks for {@link #getActiveItem()}'s usage.
*

View File

@ -9,10 +9,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
@Deprecated
void setHurtDirection(float hurtDirection);
// Paper end - hurt direction API
+
+ // Paper start - swing hand API
+ /**
+ * Makes this entity swing their hand.
+ *
@ -30,5 +31,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.swingOffHand();
+ }
+ }
// Paper end
+ // Paper end - swing hand API
}

View File

@ -9,10 +9,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
this.swingOffHand();
}
}
// Paper end - swing hand API
+
+ // Paper start - knockback API
+ /**
+ * Knocks back this entity from a specific direction with a specified strength. Mechanics such
+ * as knockback resistance will be factored in.
@ -24,5 +25,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @param directionZ The relative z position of the knockback source direction
+ */
+ void knockback(double strength, double directionX, double directionZ);
// Paper end
+ // Paper end - knockback API
}

View File

@ -240,19 +240,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/**
* Types of attributes which may be present on an {@link Attributable}.
*/
-public enum Attribute implements Keyed {
+public enum Attribute implements Keyed, net.kyori.adventure.translation.Translatable { // Paper - Adventure translations
-public enum Attribute implements Keyed, Translatable {
+public enum Attribute implements Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper - Adventure translations
/**
* Maximum health of an Entity.
@@ -0,0 +0,0 @@ public enum Attribute implements Keyed {
public NamespacedKey getKey() {
return key;
@@ -0,0 +0,0 @@ public enum Attribute implements Keyed, Translatable {
public String getTranslationKey() {
return Bukkit.getUnsafe().getTranslationKey(this);
}
+
+ // Paper start
+ @SuppressWarnings("deprecation")
+ @Override
+ public @NotNull String translationKey() {
+ return "attribute.name." + this.key.getKey();
+ return Bukkit.getUnsafe().getTranslationKey(this);
+ }
+ // Paper end
}
@ -315,8 +317,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/**
* The various type of enchantments that may be added to armour or weapons
*/
-public abstract class Enchantment implements Keyed {
+public abstract class Enchantment implements Keyed, net.kyori.adventure.translation.Translatable { // Paper - Adventure translations
-public abstract class Enchantment implements Keyed, Translatable {
+public abstract class Enchantment implements Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper - Adventure translations
/**
* Provides protection against environmental damage
*/

View File

@ -9,10 +9,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @param jumping entity jump state
*/
void setJumping(boolean jumping);
// Paper end - entity jump API
+
+ // Paper start - pickup animation API
+ /**
+ * Plays pickup item animation towards this entity.
+ * <p>
@ -35,5 +36,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @param quantity quantity of item
+ */
+ void playPickupItemAnimation(@NotNull Item item, int quantity);
// Paper end
+ // Paper end - pickup animation API
}

View File

@ -2183,7 +2183,7 @@ diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/j
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/enchantments/Enchantment.java
+++ b/src/main/java/org/bukkit/enchantments/Enchantment.java
@@ -0,0 +0,0 @@ public abstract class Enchantment implements Keyed {
@@ -0,0 +0,0 @@ public abstract class Enchantment implements Keyed, Translatable {
* @return True if the enchantment may be applied, otherwise False
*/
public abstract boolean canEnchantItem(@NotNull ItemStack item);
@ -4510,7 +4510,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/**
@@ -0,0 +0,0 @@ public interface BookMeta extends ItemMeta {
* pages. Maximum 100 pages with 256 characters per page.
* pages. Maximum 100 pages with 1024 characters per page.
*
* @param pages A list of pages to set the book to use
+ * @deprecated in favour of {@link #pages(List)}
@ -4520,7 +4520,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/**
@@ -0,0 +0,0 @@ public interface BookMeta extends ItemMeta {
* pages. Maximum 50 pages with 256 characters per page.
* pages. Maximum 100 pages with 1024 characters per page.
*
* @param pages A list of strings, each being a page
+ * @deprecated in favour of {@link #pages(net.kyori.adventure.text.Component...)}
@ -4530,7 +4530,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/**
@@ -0,0 +0,0 @@ public interface BookMeta extends ItemMeta {
* 256 characters per page.
* 1024 characters per page.
*
* @param pages A list of strings, each being a page
+ * @deprecated in favour of {@link #addPages(net.kyori.adventure.text.Component...)}
@ -4695,6 +4695,58 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
void setLore(@Nullable List<String> lore);
/**
diff --git a/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java b/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java
+++ b/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java
@@ -0,0 +0,0 @@ public interface TrimMaterial extends Keyed, Translatable {
* {@link Material#AMETHYST_SHARD}.
*/
public static final TrimMaterial AMETHYST = Registry.TRIM_MATERIAL.get(NamespacedKey.minecraft("amethyst"));
+
+ // Paper start - adventure
+ /**
+ * Get the description of this {@link TrimMaterial}.
+ *
+ * @return the description
+ */
+ net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component description();
+
+ /**
+ * @deprecated this method assumes that {@link #description()} will
+ * always be a translatable component which is not guaranteed.
+ */
+ @Override
+ @Deprecated(forRemoval = true)
+ @org.jetbrains.annotations.NotNull String getTranslationKey();
+ // Paper end - adventure
}
diff --git a/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java b/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java
+++ b/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java
@@ -0,0 +0,0 @@ public interface TrimPattern extends Keyed, Translatable {
* {@link Material#HOST_ARMOR_TRIM_SMITHING_TEMPLATE}.
*/
public static final TrimPattern HOST = Registry.TRIM_PATTERN.get(NamespacedKey.minecraft("host"));
+
+ // Paper start - adventure
+ /**
+ * Get the description of this {@link TrimPattern}.
+ *
+ * @return the description
+ */
+ net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component description();
+
+ /**
+ * @deprecated this method assumes that {@link #description()} will
+ * always be a translatable component which is not guaranteed.
+ */
+ @Override
+ @Deprecated(forRemoval = true)
+ @org.jetbrains.annotations.NotNull String getTranslationKey();
+ // Paper end - adventure
}
diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/map/MapCursor.java

View File

@ -33,8 +33,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ api("org.apache.logging.log4j:log4j-api:$log4jVersion")
+ api("org.slf4j:slf4j-api:$slf4jVersion")
implementation("org.ow2.asm:asm:9.5")
implementation("org.ow2.asm:asm-commons:9.5")
implementation("org.ow2.asm:asm:9.7")
implementation("org.ow2.asm:asm-commons:9.7")
@@ -0,0 +0,0 @@ tasks.withType<Javadoc> {
"https://jd.advntr.dev/text-serializer-legacy/$adventureVersion/",
"https://jd.advntr.dev/text-serializer-plain/$adventureVersion/",

View File

@ -19,7 +19,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
java {
@@ -0,0 +0,0 @@ dependencies {
testImplementation("org.ow2.asm:asm-tree:9.5")
testImplementation("org.ow2.asm:asm-tree:9.7")
}
+// Paper start

View File

@ -63,8 +63,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ testImplementation("org.apache.commons:commons-lang3:3.12.0")
+ testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
+ testImplementation("org.hamcrest:hamcrest:2.2")
+ testImplementation("org.mockito:mockito-core:5.5.0")
+ testImplementation("org.ow2.asm:asm-tree:9.5")
+ testImplementation("org.mockito:mockito-core:5.11.0")
+ testImplementation("org.ow2.asm:asm-tree:9.7")
+}
+
+configure<PublishingExtension> {
@ -237,13 +237,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <version>5.5.0</version>
- <version>5.11.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.ow2.asm</groupId>
- <artifactId>asm-tree</artifactId>
- <version>9.5</version>
- <version>9.7</version>
- <scope>test</scope>
- </dependency>
- </dependencies>

View File

@ -65,10 +65,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
@NotNull
org.bukkit.inventory.EquipmentSlot getHandRaised();
return this.getActiveItemHand();
}
// Paper end - active item API
+
+ // Paper start - entity jump API
+ /**
+ * Get entity jump state.
+ * <p>
@ -88,5 +89,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @param jumping entity jump state
+ */
+ void setJumping(boolean jumping);
// Paper end
+ // Paper end - entity jump API
}

View File

@ -30,10 +30,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @param quantity quantity of item
*/
void playPickupItemAnimation(@NotNull Item item, int quantity);
// Paper end - pickup animation API
+
+ // Paper start - hurt direction API
+ /**
+ * Gets player hurt direction
+ *
@ -49,5 +50,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */
+ @Deprecated
+ void setHurtDirection(float hurtDirection);
// Paper end
+ // Paper end - hurt direction API
}

View File

@ -1442,8 +1442,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/inventory/PlayerInventory.java
+++ b/src/main/java/org/bukkit/inventory/PlayerInventory.java
@@ -0,0 +0,0 @@ public interface PlayerInventory extends Inventory {
*
* @return All the ItemStacks from the armor slots. Individual items can be null.
* null and are returned in a fixed order starting from the boots and going
* up to the helmet
*/
- @NotNull
- public ItemStack[] getArmorContents();
@ -1865,7 +1865,7 @@ diff --git a/src/main/java/org/bukkit/potion/PotionEffectType.java b/src/main/ja
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/potion/PotionEffectType.java
+++ b/src/main/java/org/bukkit/potion/PotionEffectType.java
@@ -0,0 +0,0 @@ public abstract class PotionEffectType implements Keyed {
@@ -0,0 +0,0 @@ public abstract class PotionEffectType implements Keyed, Translatable {
* Returns the unique ID of this type.
*
* @return Unique ID
@ -1877,7 +1877,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public abstract int getId();
/**
@@ -0,0 +0,0 @@ public abstract class PotionEffectType implements Keyed {
@@ -0,0 +0,0 @@ public abstract class PotionEffectType implements Keyed, Translatable {
*
* @param id Unique ID to fetch
* @return Resulting type, or null if not found.

View File

@ -1161,12 +1161,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/**
@@ -0,0 +0,0 @@ public interface EntityEquipment {
void setBoots(@Nullable ItemStack boots, boolean silent);
/**
- * Gets a copy of all worn armor
+ * Gets all worn armor
+ *
* Gets all ItemStacks from the armor slots.
*
+ * <p>
+ * This returns a copy if this equipment instance is from a non-player,
+ * or it's an empty stack (has AIR as its type).
@ -1180,8 +1177,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * equipment.getArmorContents(); // will return an array of copies
+ * }
+ * }</pre>
*
* @return The array of worn armor. Individual items may be null.
+ *
* @return all the ItemStacks from the armor slots. Individual items can be
* null and are returned in a fixed order starting from the boots and going
* up to the helmet
*/
- @NotNull
- ItemStack[] getArmorContents();

View File

@ -80,11 +80,12 @@ diff --git a/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java b/sr
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java
+++ b/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java
@@ -0,0 +0,0 @@ public interface TrimMaterial extends Keyed {
* {@link Material#AMETHYST_SHARD}.
*/
public static final TrimMaterial AMETHYST = Registry.TRIM_MATERIAL.get(NamespacedKey.minecraft("amethyst"));
+ // Paper start
@@ -0,0 +0,0 @@ public interface TrimMaterial extends Keyed, Translatable {
@Deprecated(forRemoval = true)
@org.jetbrains.annotations.NotNull String getTranslationKey();
// Paper end - adventure
+
+ // Paper start - Registry#getKey
+ /**
+ * @deprecated use {@link Registry#getKey(Keyed)} and {@link Registry#TRIM_MATERIAL}. TrimMaterials
+ * can exist without a key.
@ -92,17 +93,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @Deprecated(forRemoval = true, since = "1.20.4")
+ @Override
+ org.bukkit.@org.jetbrains.annotations.NotNull NamespacedKey getKey();
+ // Paper end
+ // Paper end - Registry#getKey
}
diff --git a/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java b/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java
+++ b/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java
@@ -0,0 +0,0 @@ public interface TrimPattern extends Keyed {
* {@link Material#HOST_ARMOR_TRIM_SMITHING_TEMPLATE}.
*/
public static final TrimPattern HOST = Registry.TRIM_PATTERN.get(NamespacedKey.minecraft("host"));
+ // Paper start
@@ -0,0 +0,0 @@ public interface TrimPattern extends Keyed, Translatable {
@Deprecated(forRemoval = true)
@org.jetbrains.annotations.NotNull String getTranslationKey();
// Paper end - adventure
+
+ // Paper start - Registry#getKey
+ /**
+ * @deprecated use {@link Registry#getKey(Keyed)} and {@link Registry#TRIM_PATTERN}. TrimPatterns
+ * can exist without a key.
@ -110,5 +112,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @Deprecated(forRemoval = true, since = "1.20.4")
+ @Override
+ org.bukkit.@org.jetbrains.annotations.NotNull NamespacedKey getKey();
+ // Paper end
+ // Paper end - Registry#getKey
}

View File

@ -12,10 +12,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @param directionZ The relative z position of the knockback source direction
*/
void knockback(double strength, double directionX, double directionZ);
// Paper end - knockback API
+
+ // Paper start - ItemStack damage API
+ /**
+ * Notifies all clients tracking this entity that the item in
+ * the slot of this entity broke.
@ -62,7 +63,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @param amount the amount of damage to do
+ */
+ void damageItemStack(org.bukkit.inventory.@NotNull EquipmentSlot slot, int amount);
// Paper end
+ // Paper end - ItemStack damage API
}
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644

View File

@ -0,0 +1,160 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 29 Jun 2018 00:19:19 -0400
Subject: [PATCH] LivingEntity Active Item API
API relating to items being actively used by a LivingEntity
such as a bow or eating food.
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -0,0 +0,0 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
* blocking).
*
* @return Whether their hand is raised
+ * @see LivingEntity#hasActiveItem()
*/
+ @org.jetbrains.annotations.ApiStatus.Obsolete(since = "1.20.4") // Paper - active item API
public boolean isHandRaised();
/**
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*
* @return the item being used by the player, or null if they are not using
* an item
+ * @deprecated Use {@link #getActiveItem()}
*/
@Nullable
+ @Deprecated(forRemoval = true, since = "1.20.4") // Paper
public ItemStack getItemInUse();
/**
* Gets the number of ticks remaining for the current item's usage.
*
* @return The number of ticks remaining
+ * @deprecated use {@link #getActiveItemRemainingTime()}
*/
+ @Deprecated(forRemoval = true, since = "1.20.4") // Paper
public int getItemInUseTicks();
/**
@@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* or throwing a trident.
*
* @param ticks The number of ticks remaining
+ * @deprecated use {@link #setActiveItemRemainingTime(int)}
*/
+ @Deprecated(forRemoval = true, since = "1.20.4") // Paper
public void setItemInUseTicks(int ticks);
/**
@@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
void setShieldBlockingDelay(int delay);
// Paper end
+
+ // Paper start - active item API
+ /**
+ * Gets the item being actively "used" or consumed.
+ *
+ * @return the item
+ */
+ org.bukkit.inventory.@NotNull ItemStack getActiveItem();
+
+ /**
+ * Gets the remaining number of ticks for {@link #getActiveItem()}'s usage.
+ *
+ * @return remaining ticks to use {@link #getActiveItem()}
+ */
+ int getActiveItemRemainingTime();
+
+ /**
+ * Sets the number of ticks that remain for {@link #getActiveItem()}'s
+ * usage.
+ * <p>
+ * Valid values are between 0 and the max item use duration for
+ * the specific item type.
+ *
+ * @param ticks time in ticks remaining
+ */
+ void setActiveItemRemainingTime(@org.jetbrains.annotations.Range(from = 0, to = Integer.MAX_VALUE) int ticks);
+
+ /**
+ * Gets if the entity is using an item (eating, drinking, etc).
+ *
+ * @return true if using an item
+ */
+ boolean hasActiveItem();
+
+ /**
+ * Get how long the {@link #getActiveItem()} has been in use for.
+ *
+ * @return time used in ticks
+ */
+ int getActiveItemUsedTime();
+
+ /**
+ * Get the hand using the active item. Will be either
+ * {@link org.bukkit.inventory.EquipmentSlot#HAND} or
+ * {@link org.bukkit.inventory.EquipmentSlot#OFF_HAND}.
+ *
+ * @return the hand being used
+ */
+ org.bukkit.inventory.@NotNull EquipmentSlot getActiveItemHand();
+
+ /**
+ * Gets remaining time a player needs to keep hands raised with an item to finish using it.
+ *
+ * @return remaining ticks to use the item
+ * @see #getActiveItemRemainingTime()
+ */
+ @org.jetbrains.annotations.ApiStatus.Obsolete(since = "1.20.4")
+ default int getItemUseRemainingTime() {
+ return this.getActiveItemRemainingTime();
+ }
+
+ /**
+ * Get how long the entity's hands have been raised (Charging Bow attack, using a potion, etc)
+ *
+ * @return Get how long the players hands have been raised (Charging Bow attack, using a potion, etc)
+ * @see #getActiveItemUsedTime()
+ */
+ @org.jetbrains.annotations.ApiStatus.Obsolete(since = "1.20.4")
+ default int getHandRaisedTime() {
+ return this.getActiveItemUsedTime();
+ }
+
+ /**
+ * Whether this entity is using or charging an attack (Bow pulled back, drinking potion, eating food)
+ *
+ * @return whether this entity is using or charging an attack (Bow pulled back, drinking potion, eating food)
+ * @see #hasActiveItem()
+ */
+ @org.jetbrains.annotations.ApiStatus.Obsolete(since = "1.20.4")
+ default boolean isHandRaised() {
+ return this.hasActiveItem();
+ }
+
+ /**
+ * Gets the hand raised by this living entity. Will be either
+ * {@link org.bukkit.inventory.EquipmentSlot#HAND} or
+ * {@link org.bukkit.inventory.EquipmentSlot#OFF_HAND}.
+ *
+ * @return the hand raised
+ * @see #getActiveItemHand()
+ */
+ @NotNull
+ @org.jetbrains.annotations.ApiStatus.Obsolete(since = "1.20.4")
+ default org.bukkit.inventory.EquipmentSlot getHandRaised() {
+ return this.getActiveItemHand();
+ }
+ // Paper end - active item API
}

View File

@ -1,68 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 29 Jun 2018 00:19:19 -0400
Subject: [PATCH] LivingEntity Hand Raised/Item Use API
How long an entity has raised hands to charge an attack or use an item
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -0,0 +0,0 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
*
* @return the item being used by the player, or null if they are not using
* an item
+ * @deprecated Deprecated in favor of {@link LivingEntity#getActiveItem()}
*/
+ @Deprecated // Paper
@Nullable
public ItemStack getItemInUse();
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @param delay Delay in ticks
*/
void setShieldBlockingDelay(int delay);
+
+ /**
+ * Get's the item being actively "used" or consumed.
+ * @return The item
+ */
+ @NotNull
+ org.bukkit.inventory.ItemStack getActiveItem();
+
+ /**
+ * Get's remaining time a player needs to keep hands raised with an item to finish using it.
+ * @return Remaining ticks to use the item
+ */
+ int getItemUseRemainingTime();
+
+ /**
+ * Get how long the players hands have been raised (Charging Bow attack, using a potion, etc)
+ *
+ * @return Get how long the players hands have been raised (Charging Bow attack, using a potion, etc)
+ */
+ int getHandRaisedTime();
+
+ /**
+ * Whether or not this entity is using or charging an attack (Bow pulled back, drinking potion, eating food)
+ *
+ * @return Whether or not this entity is using or charging an attack (Bow pulled back, drinking potion, eating food)
+ */
+ boolean isHandRaised();
+
+ /**
+ * Gets the hand raised by this living entity. Will be either
+ * {@link org.bukkit.inventory.EquipmentSlot#HAND} or
+ * {@link org.bukkit.inventory.EquipmentSlot#OFF_HAND}.
+ *
+ * @return the hand raised
+ */
+ @NotNull
+ org.bukkit.inventory.EquipmentSlot getHandRaised();
// Paper end
}

View File

@ -605,10 +605,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// Paper start
@@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
void clearActiveItem();
void setShieldBlockingDelay(int delay);
// Paper end
+ // Paper start
+ // Paper start - missing entity API
+ /**
+ * Retrieves the sideways movement direction of the entity.
+ * <p>
@ -657,11 +657,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @return Forwards movement direction, ranging from -1 (backward) to 1 (forward).
+ */
+ float getForwardsMovement();
+ // Paper end
+ // Paper end - missing entity API
+
// Paper start - active item API
/**
* Get's remaining time a player needs to keep hands raised with an item to finish using it.
* @return Remaining ticks to use the item
* Gets the item being actively "used" or consumed.
diff --git a/src/main/java/org/bukkit/entity/Llama.java b/src/main/java/org/bukkit/entity/Llama.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/Llama.java

View File

@ -39,7 +39,7 @@ diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/j
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/enchantments/Enchantment.java
+++ b/src/main/java/org/bukkit/enchantments/Enchantment.java
@@ -0,0 +0,0 @@ public abstract class Enchantment implements Keyed, net.kyori.adventure.translat
@@ -0,0 +0,0 @@ public abstract class Enchantment implements Keyed, Translatable, net.kyori.adve
* Cursed enchantments are found the same way treasure enchantments are
*
* @return true if the enchantment is cursed
@ -51,7 +51,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public abstract boolean isCursed();
/**
@@ -0,0 +0,0 @@ public abstract class Enchantment implements Keyed, net.kyori.adventure.translat
@@ -0,0 +0,0 @@ public abstract class Enchantment implements Keyed, Translatable, net.kyori.adve
* @return the name of the enchantment with {@code level} applied
*/
public abstract net.kyori.adventure.text.@NotNull Component displayName(int level);

View File

@ -48,12 +48,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/**
* Represents a type of potion and its effect on an entity.
*/
-public abstract class PotionEffectType implements Keyed {
+public abstract class PotionEffectType implements Keyed, net.kyori.adventure.translation.Translatable { // Paper - implement Translatable
-public abstract class PotionEffectType implements Keyed, Translatable {
+public abstract class PotionEffectType implements Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper - implement Translatable
private static final BiMap<Integer, PotionEffectType> ID_MAP = HashBiMap.create();
/**
@@ -0,0 +0,0 @@ public abstract class PotionEffectType implements Keyed {
@@ -0,0 +0,0 @@ public abstract class PotionEffectType implements Keyed, Translatable {
return from;
}

View File

@ -10,10 +10,33 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/entity/AbstractArrow.java
+++ b/src/main/java/org/bukkit/entity/AbstractArrow.java
@@ -0,0 +0,0 @@ public interface AbstractArrow extends Projectile {
ALLOWED,
* Gets the ItemStack which will be picked up from this arrow.
*
* @return The picked up ItemStack
+ * @deprecated use {@link #getItemStack()}
*/
@NotNull
@ApiStatus.Experimental
+ @Deprecated(forRemoval = true, since = "1.20.4") // Paper
public ItemStack getItem();
/**
* Sets the ItemStack which will be picked up from this arrow.
*
* @param item ItemStack set to be picked up
+ * @deprecated until 1.20.5 when the behavior is more defined
*/
@ApiStatus.Experimental
+ @Deprecated // Paper - remove in 1.20.5
public void setItem(@NotNull ItemStack item);
/**
@@ -0,0 +0,0 @@ public interface AbstractArrow extends Projectile {
CREATIVE_ONLY;
}
// Paper end
+
+ // Paper start - more projectile API
+ /**
+ * Gets the ItemStack for this arrow.
+ *
@ -51,7 +74,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @param sound sound that is played
+ */
+ void setHitSound(@NotNull org.bukkit.Sound sound);
// Paper end
+ // Paper end - more projectile API
}
diff --git a/src/main/java/org/bukkit/entity/Firework.java b/src/main/java/org/bukkit/entity/Firework.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644

View File

@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -0,0 +0,0 @@ dependencies {
implementation("org.ow2.asm:asm-commons:9.5")
implementation("org.ow2.asm:asm-commons:9.7")
// Paper end
- compileOnly("org.apache.maven:maven-resolver-provider:3.9.6")

View File

@ -14,8 +14,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
apiAndDocs("net.kyori:adventure-text-serializer-plain")
apiAndDocs("net.kyori:adventure-text-logger-slf4j")
+
+ implementation("org.ow2.asm:asm:9.5")
+ implementation("org.ow2.asm:asm-commons:9.5")
+ implementation("org.ow2.asm:asm:9.7")
+ implementation("org.ow2.asm:asm-commons:9.7")
// Paper end
compileOnly("org.apache.maven:maven-resolver-provider:3.9.6")

View File

@ -45,19 +45,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
this.damageItemStack0(this.getHandle().getItemBySlot(nmsSlot), amount, nmsSlot);
this.getHandle().frictionState = state;
}
// Paper end - friction API
+
+ // Paper start - body yaw API
+ @Override
+ public float getBodyYaw() {
+ return this.getHandle().getVisualRotationYInDegrees();
+ }
+
+ @Override
+ public void setBodyYaw(float bodyYaw) {
+ public void setBodyYaw(final float bodyYaw) {
+ this.getHandle().setYBodyRot(bodyYaw);
+ }
+
private void damageItemStack0(net.minecraft.world.item.ItemStack nmsStack, int amount, net.minecraft.world.entity.EquipmentSlot slot) {
nmsStack.hurtAndBreak(amount, this.getHandle(), livingEntity -> {
if (slot != null) {
+ // Paper end - body yaw API
}

View File

@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return getHandle().getUseItem().asBukkitMirror();
return this.getHandle().getUseItem().asBukkitMirror();
}
+ // Paper start
@ -20,5 +20,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end
+
@Override
public int getItemUseRemainingTime() {
return getHandle().getUseItemRemainingTicks();
public int getActiveItemRemainingTime() {
return this.getHandle().getUseItemRemainingTicks();

View File

@ -237,12 +237,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -0,0 +0,0 @@ public class CraftEventFactory {
return event;
player.level().getCraftServer().getPluginManager().callEvent(event);
}
- public static BlockShearEntityEvent callBlockShearEntityEvent(Entity animal, org.bukkit.block.Block dispenser, CraftItemStack is) {
- BlockShearEntityEvent bse = new BlockShearEntityEvent(dispenser, animal.getBukkitEntity(), is);
+ public static BlockShearEntityEvent callBlockShearEntityEvent(Entity animal, Block dispenser, CraftItemStack is, List<ItemStack> drops) { // Paper - custom shear drops
+ public static BlockShearEntityEvent callBlockShearEntityEvent(Entity animal, org.bukkit.block.Block dispenser, CraftItemStack is, List<ItemStack> drops) { // Paper - custom shear drops
+ BlockShearEntityEvent bse = new BlockShearEntityEvent(dispenser, animal.getBukkitEntity(), is, Lists.transform(drops, CraftItemStack::asCraftMirror)); // Paper - custom shear drops
Bukkit.getPluginManager().callEvent(bse);
return bse;

View File

@ -9,14 +9,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
}
throw new IllegalArgumentException(entityCategory + " is an unrecognized entity category");
}
// Paper end - more enchant API
+
+ // Paper start - knockback API
+ @Override
+ public void knockback(double strength, double directionX, double directionZ) {
+ public void knockback(final double strength, final double directionX, final double directionZ) {
+ Preconditions.checkArgument(strength > 0, "Knockback strength must be > 0");
+ getHandle().knockback(strength, directionX, directionZ);
+ this.getHandle().knockback(strength, directionX, directionZ);
+ };
// Paper end
+ // Paper end - knockback API
}

View File

@ -9,13 +9,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
((Mob) getHandle()).getJumpControl().jump();
}
}
// Paper end - entity jump API
+
+ // Paper start - pickup animation API
+ @Override
+ public void playPickupItemAnimation(org.bukkit.entity.Item item, int quantity) {
+ getHandle().take(((CraftItem) item).getHandle(), quantity);
+ public void playPickupItemAnimation(final org.bukkit.entity.Item item, final int quantity) {
+ this.getHandle().take(((CraftItem) item).getHandle(), quantity);
+ }
// Paper end
+ // Paper end - pickup animation API
}

View File

@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ implementation("io.netty:netty-codec-haproxy:4.1.97.Final") // Paper - Add support for proxy protocol
// Paper end
implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
implementation("org.ow2.asm:asm-commons:9.5")
implementation("org.ow2.asm:asm-commons:9.7")
diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java

View File

@ -4054,7 +4054,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end
@Override
public boolean equals(Object other) {
public String getTranslationKey() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@ -5167,6 +5167,44 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override
public boolean hasRepairCost() {
return this.repairCost > 0;
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimMaterial.java b/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimMaterial.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimMaterial.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimMaterial.java
@@ -0,0 +0,0 @@ public class CraftTrimMaterial implements TrimMaterial, Handleable<net.minecraft
@NotNull
@Override
public String getTranslationKey() {
+ if (!(this.handle.description().getContents() instanceof TranslatableContents)) throw new UnsupportedOperationException("Description isn't translatable!"); // Paper
return ((TranslatableContents) this.handle.description().getContents()).getKey();
}
+
+ // Paper start - adventure
+ @Override
+ public net.kyori.adventure.text.Component description() {
+ return io.papermc.paper.adventure.PaperAdventure.asAdventure(this.handle.description());
+ }
+ // Paper end - adventure
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimPattern.java b/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimPattern.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimPattern.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimPattern.java
@@ -0,0 +0,0 @@ public class CraftTrimPattern implements TrimPattern, Handleable<net.minecraft.w
@NotNull
@Override
public String getTranslationKey() {
+ if (!(this.handle.description().getContents() instanceof TranslatableContents)) throw new UnsupportedOperationException("Description isn't translatable!"); // Paper
return ((TranslatableContents) this.handle.description().getContents()).getKey();
}
+
+ // Paper start - adventure
+ @Override
+ public net.kyori.adventure.text.Component description() {
+ return io.papermc.paper.adventure.PaperAdventure.asAdventure(this.handle.description());
+ }
+ // Paper end - adventure
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftCustomInventoryConverter.java b/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftCustomInventoryConverter.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftCustomInventoryConverter.java

View File

@ -20,7 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- exclude(group = "org.apache.logging.log4j", module = "log4j-api")
- }
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
implementation("org.ow2.asm:asm-commons:9.5")
implementation("org.ow2.asm:asm-commons:9.7")
implementation("commons-lang:commons-lang:2.6")
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
@@ -0,0 +0,0 @@ tasks.jar {

View File

@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -0,0 +0,0 @@ dependencies {
implementation("org.ow2.asm:asm-commons:9.5")
implementation("org.ow2.asm:asm-commons:9.7")
implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files
implementation("commons-lang:commons-lang:2.6")
+ implementation("net.fabricmc:mapping-io:0.5.0") // Paper - needed to read mappings for stacktrace deobfuscation

View File

@ -59,7 +59,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
engine.execute(() -> { // Paper - Fix preemptive player kick on a server shutdown
+ packetProcessing.push(listener); // Paper - detailed watchdog information
+ try { // Paper - detailed watchdog information
if (MinecraftServer.getServer().hasStopped() || (listener instanceof ServerCommonPacketListenerImpl && ((ServerCommonPacketListenerImpl) listener).processedDisconnect)) return; // CraftBukkit, MC-142590
if (listener instanceof ServerCommonPacketListenerImpl serverCommonPacketListener && serverCommonPacketListener.processedDisconnect) return; // CraftBukkit - Don't handle sync packets for kicked players
if (listener.shouldHandleMessage(packet)) {
co.aikar.timings.Timing timing = co.aikar.timings.MinecraftTimings.getPacketTiming(packet); // Paper - timings
@@ -0,0 +0,0 @@ public class PacketUtils {

View File

@ -54,10 +54,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
public org.bukkit.inventory.EquipmentSlot getHandRaised() {
return getHandle().getUsedItemHand() == net.minecraft.world.InteractionHand.MAIN_HAND ? org.bukkit.inventory.EquipmentSlot.HAND : org.bukkit.inventory.EquipmentSlot.OFF_HAND;
return org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(this.getHandle().getUsedItemHand());
}
// Paper end - active item API
+
+ // Paper start - entity jump API
+ @Override
+ public boolean isJumping() {
+ return getHandle().jumping;
@ -71,5 +72,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ ((Mob) getHandle()).getJumpControl().jump();
+ }
+ }
// Paper end
+ // Paper end - entity jump API
}

View File

@ -40,18 +40,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
public void playPickupItemAnimation(org.bukkit.entity.Item item, int quantity) {
getHandle().take(((CraftItem) item).getHandle(), quantity);
this.getHandle().take(((CraftItem) item).getHandle(), quantity);
}
// Paper end - pickup animation API
+
+ // Paper start - hurt direction API
+ @Override
+ public float getHurtDirection() {
+ return this.getHandle().getHurtDir();
+ }
+
+ @Override
+ public void setHurtDirection(float hurtDirection) {
+ public void setHurtDirection(final float hurtDirection) {
+ throw new UnsupportedOperationException("Cannot set the hurt direction on a non player");
+ }
// Paper end
+ // Paper end - hurt direction API
}

View File

@ -79,23 +79,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
world.setBlockAndUpdate(blockposition1Final, iblockdata1); // CraftBukkit - decompile error
});
world.levelEvent(3002, blockposition1, -1);
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.java b/src/main/java/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.java
@@ -0,0 +0,0 @@ public class TryLaySpawnOnWaterNearLand {
BlockPos blockPos3 = blockPos2.above();
if (world.getBlockState(blockPos3).isAir()) {
BlockState blockState = frogSpawn.defaultBlockState();
+ // Paper start
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entity, blockPos3, blockState)) {
+ isPregnant.erase(); // forgot pregnant memory
+ return true;
+ }
+ // Paper end
world.setBlock(blockPos3, blockState, 3);
world.gameEvent(GameEvent.BLOCK_PLACE, blockPos3, GameEvent.Context.of(entity, blockState));
world.playSound((Player)null, entity, SoundEvents.FROG_LAY_SPAWN, SoundSource.BLOCKS, 1.0F, 1.0F);
diff --git a/src/main/java/net/minecraft/world/item/AxeItem.java b/src/main/java/net/minecraft/world/item/AxeItem.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/item/AxeItem.java

View File

@ -18,6 +18,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (!engine.isSameThread()) {
- engine.executeIfPossible(() -> {
+ engine.execute(() -> { // Paper - Fix preemptive player kick on a server shutdown
if (MinecraftServer.getServer().hasStopped() || (listener instanceof ServerCommonPacketListenerImpl && ((ServerCommonPacketListenerImpl) listener).processedDisconnect)) return; // CraftBukkit, MC-142590
if (listener instanceof ServerCommonPacketListenerImpl serverCommonPacketListener && serverCommonPacketListener.processedDisconnect) return; // CraftBukkit - Don't handle sync packets for kicked players
if (listener.shouldHandleMessage(packet)) {
co.aikar.timings.Timing timing = co.aikar.timings.MinecraftTimings.getPacketTiming(packet); // Paper - timings

View File

@ -139,7 +139,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
});
}
// Paper end - ItemStack damage API
+
+ // Paper start - friction API
+ @org.jetbrains.annotations.NotNull
+ @Override
+ public net.kyori.adventure.util.TriState getFrictionState() {
@ -151,7 +153,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ java.util.Objects.requireNonNull(state, "state may not be null");
+ this.getHandle().frictionState = state;
+ }
+
@Override
public void knockback(double strength, double directionX, double directionZ) {
Preconditions.checkArgument(strength > 0, "Knockback strength must be > 0");
+ // Paper end - friction API
}

View File

@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
testImplementation("org.hamcrest:hamcrest:2.2")
testImplementation("org.mockito:mockito-core:5.5.0")
testImplementation("org.mockito:mockito-core:5.11.0")
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java
new file mode 100644
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000

View File

@ -47,7 +47,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (true) return java.util.Objects.requireNonNull(org.bukkit.Registry.TRIM_MATERIAL.getKey(this), () -> this + " doesn't have a key"); // Paper
return this.key;
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimPattern.java b/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimPattern.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimPattern.java
@ -59,7 +59,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (true) return java.util.Objects.requireNonNull(org.bukkit.Registry.TRIM_PATTERN.getKey(this), () -> this + " doesn't have a key"); // Paper
return this.key;
}
}
diff --git a/src/test/java/org/bukkit/registry/PerRegistryTest.java b/src/test/java/org/bukkit/registry/PerRegistryTest.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/test/java/org/bukkit/registry/PerRegistryTest.java

View File

@ -20,8 +20,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- System.err.println("Unsupported Java detected (" + javaVersion + "). This version of Minecraft requires at least Java 17. Check your Java version with the command 'java -version'.");
- return;
- }
- if (javaVersion > 65.0) {
- System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 21 is supported.");
- if (javaVersion > 66.0) {
- System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 22 is supported.");
+ boolean isOldVersion = javaVersion < 61.0;
+ if (!skip && isOldVersion) {
+ System.err.println("Unsupported Java detected (" + javaVersion + "). This version of Minecraft requires at least Java 17. Check your Java version with the command 'java -version'. For more info see https://docs.papermc.io/misc/java-install");

View File

@ -15,16 +15,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
throw new IllegalArgumentException(entityCategory + " is an unrecognized entity category");
}
+ @Override
+ public void broadcastSlotBreak(org.bukkit.inventory.EquipmentSlot slot) {
this.getHandle().knockback(strength, directionX, directionZ);
};
// Paper end - knockback API
+
+ // Paper start - ItemStack damage API
+ public void broadcastSlotBreak(final org.bukkit.inventory.EquipmentSlot slot) {
+ this.getHandle().broadcastBreakEvent(org.bukkit.craftbukkit.CraftEquipmentSlot.getNMS(slot));
+ }
+
+ @Override
+ public void broadcastSlotBreak(org.bukkit.inventory.EquipmentSlot slot, Collection<org.bukkit.entity.Player> players) {
+ public void broadcastSlotBreak(final org.bukkit.inventory.EquipmentSlot slot, final Collection<org.bukkit.entity.Player> players) {
+ if (players.isEmpty()) {
+ return;
+ }
@ -36,9 +37,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ @Override
+ public ItemStack damageItemStack(ItemStack stack, int amount) {
+ public ItemStack damageItemStack(ItemStack stack, final int amount) {
+ final net.minecraft.world.item.ItemStack nmsStack;
+ if (stack instanceof CraftItemStack craftItemStack) {
+ if (stack instanceof final CraftItemStack craftItemStack) {
+ if (craftItemStack.handle == null || craftItemStack.handle.isEmpty()) {
+ return stack;
+ }
@ -52,19 +53,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ @Override
+ public void damageItemStack(org.bukkit.inventory.EquipmentSlot slot, int amount) {
+ public void damageItemStack(final org.bukkit.inventory.EquipmentSlot slot, final int amount) {
+ final net.minecraft.world.entity.EquipmentSlot nmsSlot = org.bukkit.craftbukkit.CraftEquipmentSlot.getNMS(slot);
+ this.damageItemStack0(this.getHandle().getItemBySlot(nmsSlot), amount, nmsSlot);
+ }
+
+ private void damageItemStack0(net.minecraft.world.item.ItemStack nmsStack, int amount, net.minecraft.world.entity.EquipmentSlot slot) {
+ private void damageItemStack0(final net.minecraft.world.item.ItemStack nmsStack, final int amount, final net.minecraft.world.entity.EquipmentSlot slot) {
+ nmsStack.hurtAndBreak(amount, this.getHandle(), livingEntity -> {
+ if (slot != null) {
+ livingEntity.broadcastBreakEvent(slot);
+ }
+ });
+ }
+
@Override
public void knockback(double strength, double directionX, double directionZ) {
Preconditions.checkArgument(strength > 0, "Knockback strength must be > 0");
+ // Paper end - ItemStack damage API
}

View File

@ -0,0 +1,53 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 29 Jun 2018 00:21:28 -0400
Subject: [PATCH] LivingEntity Active Item API
API relating to items being actively used by a LivingEntity
such as a bow or eating food.
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
getHandle().setShieldBlockingDelay(delay);
}
// Paper end
+
+ // Paper start - active item API
+ @Override
+ public ItemStack getActiveItem() {
+ return this.getHandle().getUseItem().asBukkitMirror();
+ }
+
+ @Override
+ public int getActiveItemRemainingTime() {
+ return this.getHandle().getUseItemRemainingTicks();
+ }
+
+ @Override
+ public void setActiveItemRemainingTime(final int ticks) {
+ Preconditions.checkArgument(ticks >= 0, "ticks must be >= 0");
+ Preconditions.checkArgument(ticks <= this.getHandle().getUseItem().getUseDuration(), "ticks must be <= item use duration");
+ this.getHandle().useItemRemaining = ticks;
+ }
+
+ @Override
+ public int getActiveItemUsedTime() {
+ return this.getHandle().getTicksUsingItem();
+ }
+
+ @Override
+ public boolean hasActiveItem() {
+ return this.getHandle().isUsingItem();
+ }
+
+ @Override
+ public org.bukkit.inventory.EquipmentSlot getActiveItemHand() {
+ return org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(this.getHandle().getUsedItemHand());
+ }
+ // Paper end - active item API
}

View File

@ -1,42 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 29 Jun 2018 00:21:28 -0400
Subject: [PATCH] LivingEntity Hand Raised/Item Use API
How long an entity has raised hands to charge an attack or use an item
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
public void setShieldBlockingDelay(int delay) {
getHandle().setShieldBlockingDelay(delay);
}
+
+ @Override
+ public ItemStack getActiveItem() {
+ return getHandle().getUseItem().asBukkitMirror();
+ }
+
+ @Override
+ public int getItemUseRemainingTime() {
+ return getHandle().getUseItemRemainingTicks();
+ }
+
+ @Override
+ public int getHandRaisedTime() {
+ return getHandle().getTicksUsingItem();
+ }
+
+ @Override
+ public boolean isHandRaised() {
+ return getHandle().isUsingItem();
+ }
+
+ @Override
+ public org.bukkit.inventory.EquipmentSlot getHandRaised() {
+ return getHandle().getUsedItemHand() == net.minecraft.world.InteractionHand.MAIN_HAND ? org.bukkit.inventory.EquipmentSlot.HAND : org.bukkit.inventory.EquipmentSlot.OFF_HAND;
+ }
// Paper end
}

View File

@ -82,10 +82,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
public void setHurtDirection(float hurtDirection) {
throw new UnsupportedOperationException("Cannot set the hurt direction on a non player");
}
// Paper end - hurt direction API
+
+ // Paper start - more enchant API
+ public static MobType fromBukkitEntityCategory(EntityCategory entityCategory) {
+ switch (entityCategory) {
+ case NONE:
@ -101,7 +102,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ throw new IllegalArgumentException(entityCategory + " is an unrecognized entity category");
+ }
// Paper end
+ // Paper end - more enchant API
}
diff --git a/src/test/java/io/papermc/paper/enchantments/EnchantmentRarityTest.java b/src/test/java/io/papermc/paper/enchantments/EnchantmentRarityTest.java
new file mode 100644

View File

@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java
+++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java
@@ -0,0 +0,0 @@ public class CraftPotionEffectType extends PotionEffectType implements Handleabl
return Color.fromRGB(this.handle.getColor());
return this.handle.getDescriptionId();
}
+ // Paper start

View File

@ -7268,7 +7268,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end
@Override
public FeatureFlag getFeatureFlag(NamespacedKey namespacedKey) {
public String getTranslationKey(final Attribute attribute) {
diff --git a/src/main/resources/META-INF/services/io.papermc.paper.plugin.entrypoint.classloader.ClassloaderBytecodeModifier b/src/main/resources/META-INF/services/io.papermc.paper.plugin.entrypoint.classloader.ClassloaderBytecodeModifier
new file mode 100644
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000

View File

@ -21,7 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ dependencies {
implementation("jline:jline:2.12.1")
implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
implementation("org.ow2.asm:asm-commons:9.5")
implementation("org.ow2.asm:asm-commons:9.7")
+ implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files
implementation("commons-lang:commons-lang:2.6")
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")

View File

@ -1,23 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Date: Sat, 23 Sep 2023 01:51:22 -0400
Subject: [PATCH] Remove Spigot Bug Fix for MC-109346
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -0,0 +0,0 @@ public class ServerEntity {
((LivingEntity) this.entity).detectEquipmentUpdatesPublic(); // CraftBukkit - SPIGOT-3789: sync again immediately after sending
}
- // CraftBukkit start - MC-109346: Fix for nonsensical head yaw
- if (this.entity instanceof ServerPlayer) {
- sender.accept(new ClientboundRotateHeadPacket(this.entity, (byte) Mth.floor(this.entity.getYHeadRot() * 256.0F / 360.0F)));
- }
- // CraftBukkit end
-
if (!this.entity.getPassengers().isEmpty()) {
sender.accept(new ClientboundSetPassengersPacket(this.entity));
}

View File

@ -15668,14 +15668,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
continue;
}
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit start
@Override
public boolean isSameThread() {
- return super.isSameThread() || this.isStopped(); // CraftBukkit - MC-142590
+ return io.papermc.paper.util.TickThread.isTickThread(); // Paper - rewrite chunk system
}
+ // Paper start - rewrite chunk system
+ @Override
+ public boolean isSameThread() {
+ return io.papermc.paper.util.TickThread.isTickThread();
+ }
+ // Paper end - rewrite chunk system
+
// CraftBukkit start
public boolean isDebugging() {
return false;
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java

View File

@ -46,7 +46,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") {
+ exclude(group = "org.apache.logging.log4j", module = "log4j-api")
+ }
+ implementation("org.ow2.asm:asm-commons:9.5")
+ implementation("org.ow2.asm:asm-commons:9.7")
+ implementation("commons-lang:commons-lang:2.6")
+ runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
+ runtimeOnly("com.mysql:mysql-connector-j:8.2.0")
@ -57,8 +57,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
+ testImplementation("org.hamcrest:hamcrest:2.2")
+ testImplementation("org.mockito:mockito-core:5.5.0")
+ testImplementation("org.ow2.asm:asm-tree:9.5")
+ testImplementation("org.mockito:mockito-core:5.11.0")
+ testImplementation("org.ow2.asm:asm-tree:9.7")
+}
+
+val craftbukkitPackageVersion = "1_20_R3" // Paper
@ -242,7 +242,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <dependency>
- <groupId>org.ow2.asm</groupId>
- <artifactId>asm-commons</artifactId>
- <version>9.5</version>
- <version>9.7</version>
- <scope>compile</scope>
- </dependency>
- <!-- Mojang depends -->
@ -466,13 +466,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <version>5.5.0</version>
- <version>5.11.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.ow2.asm</groupId>
- <artifactId>asm-tree</artifactId>
- <version>9.5</version>
- <version>9.7</version>
- <scope>test</scope>
- </dependency>
- </dependencies>

View File

@ -10,8 +10,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/build.gradle.kts
@@ -0,0 +0,0 @@ dependencies {
testImplementation("org.hamcrest:hamcrest:2.2")
testImplementation("org.mockito:mockito-core:5.5.0")
testImplementation("org.ow2.asm:asm-tree:9.5")
testImplementation("org.mockito:mockito-core:5.11.0")
testImplementation("org.ow2.asm:asm-tree:9.7")
+ testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest
}

View File

@ -705,7 +705,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
@@ -0,0 +0,0 @@ public class PacketUtils {
engine.executeIfPossible(() -> {
if (MinecraftServer.getServer().hasStopped() || (listener instanceof ServerCommonPacketListenerImpl && ((ServerCommonPacketListenerImpl) listener).processedDisconnect)) return; // CraftBukkit, MC-142590
if (listener instanceof ServerCommonPacketListenerImpl serverCommonPacketListener && serverCommonPacketListener.processedDisconnect) return; // CraftBukkit - Don't handle sync packets for kicked players
if (listener.shouldHandleMessage(packet)) {
- try {
+ co.aikar.timings.Timing timing = co.aikar.timings.MinecraftTimings.getPacketTiming(packet); // Paper - timings

View File

@ -1,18 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Date: Sat, 18 Feb 2023 16:23:18 +0100
Subject: [PATCH] Update the flag when a captured block state is outdated
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
blockstate = CapturedBlockState.getTreeBlockState(this, pos, flags);
this.capturedBlockStates.put(pos.immutable(), blockstate);
}
+ blockstate.setFlag(flags); // Paper - update the flag also
blockstate.setData(state);
return true;
}

View File

@ -58,7 +58,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ alsoShade(log4jPlugins.output)
+ // Paper end
implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
implementation("org.ow2.asm:asm-commons:9.5")
implementation("org.ow2.asm:asm-commons:9.7")
implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files
@@ -0,0 +0,0 @@ relocation {
}

@ -1 +1 @@
Subproject commit 7ca2b46c1a7d7479e45a79aa2db86de5c7fd20d8
Subproject commit f02baa38696abb62cc2588af8aaed4c9e0e1b30f

@ -1 +1 @@
Subproject commit 176c0ad39fffd8a6003e686b910fc02b669f1434
Subproject commit dfaa89bbe33da3db95b8cc61f9897845076ba757