Fix more compile issues

This commit is contained in:
Nassim Jahnke
2024-06-14 14:11:52 +02:00
parent 9206b1ea14
commit bcdf841f2d
25 changed files with 206 additions and 265 deletions

View File

@@ -9,28 +9,20 @@ diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/o
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -0,0 +0,0 @@ import org.bukkit.Translatable;
import org.bukkit.Utility;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.enchantments.Enchantment;
+import org.bukkit.entity.LivingEntity;
import org.bukkit.inventory.meta.Damageable;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.material.MaterialData;
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
public String getI18NDisplayName() {
return Bukkit.getServer().getItemFactory().getI18NDisplayName(this);
}
+
+ /**
+ * @deprecated use {@link #getMaxItemUseDuration(LivingEntity)}; crossbows, later possibly more items require an entity parameter
+ * @deprecated use {@link #getMaxItemUseDuration(org.bukkit.entity.LivingEntity)}; crossbows, later possibly more items require an entity parameter
+ */
+ @Deprecated(forRemoval = true)
+ public int getMaxItemUseDuration() {
+ return getMaxItemUseDuration(null);
+ }
+
+ public int getMaxItemUseDuration(@NotNull final LivingEntity entity) {
+ public int getMaxItemUseDuration(@NotNull final org.bukkit.entity.LivingEntity entity) {
+ if (type == null || type == Material.AIR || !type.isItem()) {
+ return 0;
+ }