Skip to content

Commit

Permalink
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10164)
Browse files Browse the repository at this point in the history
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:
63c208dd Remove no longer used import
70be76c7 PR-958: Further clarify deprecation of TAG_CONTAINER_ARRAY
ae21f4ac PR-955: Add methods to place structures with block/entity transformers
e3d960f2 SPIGOT-7547: Remark that Damageable#setAbsorptionAmount() is capped to a specific value
b125516c Fix typo in RecipeChoice.ExactChoice docs
309497c1 Add EntityMountEvent and EntityDismount Event
2fd45ae3 Improve ItemFactory#enchantItem consistency
2b198268 PR-933: Define native persistent data types for lists

CraftBukkit Changes:
771182f PR-1327: Add methods to place structures with block/entity transformers
e41ad4c SPIGOT-7567: SpawnReason for SNOWMAN is reported as BUILD_IRONGOLEM
76931e8 Add EntityMountEvent and EntityDismount Event
9b29b21 PR-1183: Better handle lambda expression and renaming of classes in Commodore
1462ebe Reformat Commodore.java
9fde4c0 PR-1324: Improve ItemFactory#enchantItem consistency
4e419c7 PR-1295: Define native persistent data types for lists
dd8cca3 SPIGOT-7562: Fix Score#getScore and Score#isScoreSet
6902782 Only fetch an online UUID in online mode
1da8d9a Fire PreLogin events even in offline mode
2e88514 PR-1325: Use CraftBlockType and CraftItemType instead of CraftMagicNumbers to convert between minecraft and bukkit block / item representation

Spigot Changes:
864e4acc Restore accidentally removed package-info.java
f91a10d5 Remove obsolete EntityMountEvent and EntityDismountEvent
828f0593 SPIGOT-7558: Deprecate silenceable lightning API as sound is now client-side and cannot be removed
cdc4e035 Remove obsolete patch fetching correct mode UUIDs
49e36b8e Merge related BungeeCord patches
6e87b9ab Remove obsolete firing of PreLogin events in offline mode
5c76b183 Remove redundant patch dealing with exceptions in the crash reporter
3a2219d1 Remove redundant patch logging cause of unexpected exception
  • Loading branch information
Machine-Maker authored Jan 14, 2024
1 parent 78fcb8e commit 8657cd9
Show file tree
Hide file tree
Showing 181 changed files with 922 additions and 979 deletions.
29 changes: 29 additions & 0 deletions build-data/spigot-server-patches/re-add-asm-dependency.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--- /dev/null 2024-01-13 10:03:30.400485704 -0800
+++ CraftBukkit-Patches/9999-re-add-asm-dependency.patch 2024-01-13 21:41:27.650692678 -0800
@@ -0,0 +1,26 @@
+From e5eb4fb3bfb61dfd2dc97411cfab5fa94033b90c Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <jake.m.potrebic@gmail.com>
+Date: Sat, 13 Jan 2024 21:41:02 -0800
+Subject: [PATCH] re add asm dependency
+
+
+diff --git a/pom.xml b/pom.xml
+index 266853a682..d18fdadf92 100644
+--- a/pom.xml
++++ b/pom.xml
+@@ -58,6 +58,12 @@
+ <version>2.19.0</version>
+ <scope>compile</scope>
+ </dependency>
++ <dependency>
++ <groupId>org.ow2.asm</groupId>
++ <artifactId>asm</artifactId>
++ <version>9.5</version>
++ <scope>compile</scope>
++ </dependency>
+ <dependency>
+ <groupId>org.ow2.asm</groupId>
+ <artifactId>asm-commons</artifactId>
+--
+2.43.0
+
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ paperweight {
mappingsPatch = layout.projectDirectory.file("build-data/mappings-patch.tiny")
reobfMappingsPatch = layout.projectDirectory.file("build-data/reobf-mappings-patch.tiny")

spigotServerPatchPatchesDir = layout.projectDirectory.dir("build-data/spigot-server-patches")

reobfPackagesToFix.addAll(
"co.aikar.timings",
"com.destroystokyo.paper",
Expand Down
6 changes: 3 additions & 3 deletions patches/api/0006-Adventure.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1522,7 +1522,7 @@ index efb97712cc9dc7c1e12a59f5b94e4f2ad7c6b7d8..3024468af4c073324e536c1cb26beffb
return warning == null || warning.value();
}
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 6e7d5545e0f79d81832ccd5c8405a70d8daa256f..d59acc729ad5af515b8ef4c98a3edeb440854820 100644
index d453a9753620e23e93e24b0c62bec5515d11dbcc..4c878531d9d8d0aee6832fd10b339a32f219fa9a 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -45,7 +45,7 @@ import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -4185,10 +4185,10 @@ index e12996492c1558fed9fab30de9f8018e0ed7fac3..002acfbdce1db10f7ba1b6a013e678f5

/**
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index e606f63a284db71663aee667597447b875e20627..6b1c55249b39a45c33ac49bacef4e9d80ba8cc3a 100644
index 096e0d60c4542fec66898b6aa8ea9820a1ef483b..3e7f92dc0aea0ea555dd02c50a1102da46fe74c4 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -217,4 +217,24 @@ public interface ItemFactory {
@@ -215,4 +215,24 @@ public interface ItemFactory {
*/
@NotNull
ItemStack enchantItem(@NotNull final ItemStack item, final int level, final boolean allowTreasures);
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0018-Add-view-distance-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ Add per player no-tick, tick, and send view distances.
Also add send/no-tick view distance to World.

diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index d59acc729ad5af515b8ef4c98a3edeb440854820..33f0cecdcd28efd721c58ebf1eb664bb5dba3803 100644
index 4c878531d9d8d0aee6832fd10b339a32f219fa9a..52977ba7aba446f74bf6befe065f722eaafee0c2 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -2869,6 +2869,62 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -2875,6 +2875,62 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Set<FeatureFlag> getFeatureFlags();

Expand Down
4 changes: 2 additions & 2 deletions patches/api/0066-Add-getI18NDisplayName-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ Currently the server only supports the English language. To override this,
You must replace the language file embedded in the server jar.

diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index 6b1c55249b39a45c33ac49bacef4e9d80ba8cc3a..cccf5d3dfd368c434dcafb0e9319f09a668c7ec2 100644
index 3e7f92dc0aea0ea555dd02c50a1102da46fe74c4..16131648915ad4065b82905ab7c799e7554cca2d 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -237,4 +237,20 @@ public interface ItemFactory {
@@ -235,4 +235,20 @@ public interface ItemFactory {
@NotNull
net.kyori.adventure.text.Component displayName(@NotNull ItemStack itemStack);
// Paper end - Adventure
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0067-ensureServerConversions-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr
to ensure it meets latest minecraft expectations.

diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index cccf5d3dfd368c434dcafb0e9319f09a668c7ec2..246b58f52e914c45f357240b155c826b1d40b202 100644
index 16131648915ad4065b82905ab7c799e7554cca2d..a3d40ca984202a5fec0cfcc97266f32408c37638 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -253,4 +253,18 @@ public interface ItemFactory {
@@ -251,4 +251,18 @@ public interface ItemFactory {
@Deprecated
String getI18NDisplayName(@Nullable ItemStack item);
// Paper end - add getI18NDisplayName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,48 @@ this is going to be the best soultion all around.

Improvements/suggestions welcome!

diff --git a/src/main/java/org/bukkit/event/entity/EntityDismountEvent.java b/src/main/java/org/bukkit/event/entity/EntityDismountEvent.java
index 00c3f50532392455070ae77ee4ad77cbf8d8827c..91188d77ff350aef20c3bde2bd27a8096825f337 100644
--- a/src/main/java/org/bukkit/event/entity/EntityDismountEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityDismountEvent.java
@@ -13,10 +13,18 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private final Entity dismounted;
+ private final boolean isCancellable; // Paper

public EntityDismountEvent(@NotNull Entity what, @NotNull Entity dismounted) {
+ // Paper start
+ this(what, dismounted, true);
+ }
+
+ public EntityDismountEvent(@NotNull Entity what, @NotNull Entity dismounted, boolean isCancellable) {
+ // Paper end
super(what);
this.dismounted = dismounted;
+ this.isCancellable = isCancellable; // Paper
}

/**
@@ -36,9 +44,18 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable {

@Override
public void setCancelled(boolean cancel) {
+ // Paper start
+ if (cancel && !this.isCancellable) {
+ return;
+ }
this.cancelled = cancel;
}

+ public boolean isCancellable() {
+ return this.isCancellable;
+ // Paper end
+ }
+
@NotNull
@Override
public HandlerList getHandlers() {
diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java
index 963b9ead4ca0426b2e95c5641b0e89317c48853d..39f6afd2f9cbcff6a74a91a21dcc3e29d2497dd8 100644
--- a/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java
Expand Down Expand Up @@ -64,10 +106,10 @@ index 963b9ead4ca0426b2e95c5641b0e89317c48853d..39f6afd2f9cbcff6a74a91a21dcc3e29
@Override
public HandlerList getHandlers() {
diff --git a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java
index 00d8ec81b4ae6ca5e438161ec9135e3c1edea6f4..a7632c8f5cb1bce4be0e456ec34f4a69c5ce80f3 100644
index be9560ffaa2d136ff1b5cd944baa678c1a938533..6533d1e0c5cb23e4a5e2831a56c5dbebe2d20f76 100644
--- a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java
+++ b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java
@@ -14,10 +14,19 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable {
@@ -21,10 +21,19 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private final Entity dismounted;
Expand All @@ -88,7 +130,7 @@ index 00d8ec81b4ae6ca5e438161ec9135e3c1edea6f4..a7632c8f5cb1bce4be0e456ec34f4a69
}

@NotNull
@@ -32,9 +41,18 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable {
@@ -39,9 +48,18 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable {

@Override
public void setCancelled(boolean cancel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ Redirects some of upstream's APIs to these new methods to avoid
usage of magic values and the deprecated RecipeChoice#getItemStack

diff --git a/src/main/java/org/bukkit/inventory/RecipeChoice.java b/src/main/java/org/bukkit/inventory/RecipeChoice.java
index 90208bc96085f05a3b657b9467b1670d00b03104..523818cbb0d6c90481ec97123e7fe0e2ff4eea14 100644
index 6734bc9d7a6eee8ee40419ae3fe245b67eabaca6..db8bcc66bdc4bedfffb4705db6338eda4c0ad29a 100644
--- a/src/main/java/org/bukkit/inventory/RecipeChoice.java
+++ b/src/main/java/org/bukkit/inventory/RecipeChoice.java
@@ -146,8 +146,6 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
/**
* Represents a choice that will be valid only one of the stacks is exactly
* matched (aside from stack size).
* Represents a choice that will be valid only if one of the stacks is
* exactly matched (aside from stack size).
- * <br>
- * <b>Only valid for shaped recipes</b>
*/
Expand Down
51 changes: 9 additions & 42 deletions patches/api/0173-Fix-Spigot-annotation-mistakes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ index e455eb21abf121dc6ff10ff8a13dd06f67096a8f..bbc01e7c192ae6689c301670047ff114
return origin;
}
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 313602704694c85bbac96b68deab67cd25f9913c..44ed5e72f17f156c9cf270fee31a9b80cf047a75 100644
index b13f6d4ae42c981b051c6ef81b0f572039faded4..59a52583f433859b0a12a44c53970db87cde08aa 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -416,9 +416,8 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
Expand All @@ -622,31 +622,7 @@ index 313602704694c85bbac96b68deab67cd25f9913c..44ed5e72f17f156c9cf270fee31a9b80
public class Spigot {

/**
@@ -3712,8 +3712,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* @param loc The location to strike lightning
* @param isSilent Whether this strike makes no sound
* @return The lightning entity.
+ * @deprecated The lightning strike sound has been moved into the client and
+ * this doesn't prevent the sound being played. Use the regular (non spigot) methods instead
+ * for a consistent behavior.
*/
@NotNull
+ @Deprecated // Paper
public LightningStrike strikeLightning(@NotNull Location loc, boolean isSilent) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -3724,14 +3728,22 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* @param loc The location to strike lightning
* @param isSilent Whether this strike makes no sound
* @return The lightning entity.
+ * @deprecated The lightning strike sound has been moved into the client and
+ * this doesn't prevent the sound being played. Use the regular (non spigot) methods instead
+ * for a consistent behavior.
*/
@NotNull
+ @Deprecated // Paper
public LightningStrike strikeLightningEffect(@NotNull Location loc, boolean isSilent) {
throw new UnsupportedOperationException("Not supported yet.");
@@ -3737,7 +3737,11 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
}
}

Expand All @@ -658,7 +634,7 @@ index 313602704694c85bbac96b68deab67cd25f9913c..44ed5e72f17f156c9cf270fee31a9b80
Spigot spigot();
// Spigot end

@@ -3918,9 +3930,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -3924,9 +3928,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* Gets the dimension ID of this environment
*
* @return dimension ID
Expand All @@ -670,7 +646,7 @@ index 313602704694c85bbac96b68deab67cd25f9913c..44ed5e72f17f156c9cf270fee31a9b80
public int getId() {
return id;
}
@@ -3930,9 +3942,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -3936,9 +3940,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
*
* @param id The ID of the environment
* @return The environment
Expand Down Expand Up @@ -802,10 +778,10 @@ index e3f440c9d9ce3b5710ed1b7f71522899fb98459f..a4578c520aa1078a741aac4b12fe89bf
@Nullable
public static EntityType fromName(@Nullable String name) {
diff --git a/src/main/java/org/bukkit/entity/LightningStrike.java b/src/main/java/org/bukkit/entity/LightningStrike.java
index c49628f2638da68e1ec126e53c8b7c74b0d81b22..8dc433baba7060df5cfe6fc10210a5a27287987d 100644
index b27447d7a2833f84cf05946c851f5b6740a578e3..5afeb2f6c82e8f752229462c2d7846f6ae7a4b44 100644
--- a/src/main/java/org/bukkit/entity/LightningStrike.java
+++ b/src/main/java/org/bukkit/entity/LightningStrike.java
@@ -84,20 +84,31 @@ public interface LightningStrike extends Entity {
@@ -84,6 +84,10 @@ public interface LightningStrike extends Entity {
public void setCausingPlayer(@Nullable Player player);

// Spigot start
Expand All @@ -815,17 +791,8 @@ index c49628f2638da68e1ec126e53c8b7c74b0d81b22..8dc433baba7060df5cfe6fc10210a5a2
+ @Deprecated // Paper
public class Spigot extends Entity.Spigot {

- /*
+ /**
* Returns whether the strike is silent.
*
* @return whether the strike is silent.
+ * @deprecated The lightning strike sound has been moved into the client and
+ * this can't predict if the sound will be played or not accurately.
*/
+ @Deprecated // Paper
public boolean isSilent() {
throw new UnsupportedOperationException("Not supported yet.");
/**
@@ -98,8 +102,12 @@ public interface LightningStrike extends Entity {
}
}

Expand Down Expand Up @@ -1410,7 +1377,7 @@ index 002acfbdce1db10f7ba1b6a013e678f504ac6e69..8d14426eb1ebea27058d5f22ea652f22
return getPlayer().getItemOnCursor();
}
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index 246b58f52e914c45f357240b155c826b1d40b202..53457348eaf2e1ef2e844eae87ac94f701525c92 100644
index a3d40ca984202a5fec0cfcc97266f32408c37638..6aeae6b78106b8fd434614591adb5ead41dec8e1 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -30,7 +30,7 @@ public interface ItemFactory {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Create HoverEvent from ItemStack Entity


diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index 53457348eaf2e1ef2e844eae87ac94f701525c92..8c248dac47464757e013c25393fe9bf604ded7c2 100644
index 6aeae6b78106b8fd434614591adb5ead41dec8e1..198eebd45a2efa6986a8f4b613424eb8b6d3a039 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -267,4 +267,65 @@ public interface ItemFactory {
@@ -265,4 +265,65 @@ public interface ItemFactory {
@NotNull
ItemStack ensureServerConversions(@NotNull ItemStack item);
// Paper end - ensure server conversions API
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0227-More-lightning-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] More lightning API


diff --git a/src/main/java/org/bukkit/entity/LightningStrike.java b/src/main/java/org/bukkit/entity/LightningStrike.java
index 8dc433baba7060df5cfe6fc10210a5a27287987d..0b9e02bb88a1b1fe7378c11f1cca9c93b183f814 100644
index 5afeb2f6c82e8f752229462c2d7846f6ae7a4b44..924ee7fcc3f87eb8553ef473a7d9671f0f469dd1 100644
--- a/src/main/java/org/bukkit/entity/LightningStrike.java
+++ b/src/main/java/org/bukkit/entity/LightningStrike.java
@@ -22,7 +22,9 @@ public interface LightningStrike extends Entity {
Expand All @@ -28,7 +28,7 @@ index 8dc433baba7060df5cfe6fc10210a5a27287987d..0b9e02bb88a1b1fe7378c11f1cca9c93
public void setFlashes(int flashes);

/**
@@ -111,4 +115,42 @@ public interface LightningStrike extends Entity {
@@ -110,4 +114,42 @@ public interface LightningStrike extends Entity {
@Deprecated // Paper
Spigot spigot();
// Spigot end
Expand Down
18 changes: 9 additions & 9 deletions patches/api/0355-Add-enchantWithLevels-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ Deprecate upstream's newer and poorly implemented similar
API.

diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index 8c248dac47464757e013c25393fe9bf604ded7c2..0217f98a74140bbae454d467de27c12b6060ca75 100644
index 198eebd45a2efa6986a8f4b613424eb8b6d3a039..f680545b6b59bf8d2ad154b0472dda4cba42a162 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -185,8 +185,11 @@ public interface ItemFactory {
* @param level the level to use, which is the level in the enchantment table
* @param allowTreasures allows treasure enchants, e.g. mending, if true.
* @return the modified ItemStack, or a copy if the ItemStack cannot be enchanted directly
* @return a new ItemStack containing the result of the Enchantment
+ * @deprecated use {@link #enchantWithLevels(ItemStack, int, boolean, java.util.Random)}. This method's implementation is poorly
+ * designed and was originally broken.
*/
Expand All @@ -22,10 +22,10 @@ index 8c248dac47464757e013c25393fe9bf604ded7c2..0217f98a74140bbae454d467de27c12b
ItemStack enchantItem(@NotNull final Entity entity, @NotNull final ItemStack item, final int level, final boolean allowTreasures);

/**
@@ -200,8 +203,11 @@ public interface ItemFactory {
@@ -199,8 +202,11 @@ public interface ItemFactory {
* @param level the level to use, which is the level in the enchantment table
* @param allowTreasures allow the treasure enchants, e.g. mending, if true.
* @return the modified ItemStack, or a copy if the ItemStack cannot be
* enchanted directly
* @return a new ItemStack containing the result of the Enchantment
+ * @deprecated use {@link #enchantWithLevels(ItemStack, int, boolean, java.util.Random)}. This method's implementation is poorly
+ * designed and was originally broken.
*/
Expand All @@ -34,10 +34,10 @@ index 8c248dac47464757e013c25393fe9bf604ded7c2..0217f98a74140bbae454d467de27c12b
ItemStack enchantItem(@NotNull final World world, @NotNull final ItemStack item, final int level, final boolean allowTreasures);

/**
@@ -214,8 +220,11 @@ public interface ItemFactory {
@@ -212,8 +218,11 @@ public interface ItemFactory {
* @param level the level to use, which is the level in the enchantment table
* @param allowTreasures allow treasure enchantments, e.g. mending, if true.
* @return the modified ItemStack, or a copy if the ItemStack cannot be
* enchanted directly
* @return a new ItemStack containing the result of the Enchantment
+ * @deprecated use {@link #enchantWithLevels(ItemStack, int, boolean, java.util.Random)}. This method's implementation is poorly
+ * designed and was originally broken.
*/
Expand All @@ -46,7 +46,7 @@ index 8c248dac47464757e013c25393fe9bf604ded7c2..0217f98a74140bbae454d467de27c12b
ItemStack enchantItem(@NotNull final ItemStack item, final int level, final boolean allowTreasures);

// Paper start - Adventure
@@ -328,4 +337,22 @@ public interface ItemFactory {
@@ -326,4 +335,22 @@ public interface ItemFactory {
@Deprecated
net.md_5.bungee.api.chat.hover.content.Content hoverContentOf(@NotNull org.bukkit.entity.Entity entity, @NotNull net.md_5.bungee.api.chat.BaseComponent[] customName);
// Paper end - bungee hover events
Expand Down
Loading

0 comments on commit 8657cd9

Please sign in to comment.