diff --git a/bukkit/src/main/java/com/viaversion/viaversion/bukkit/platform/PaperViaInjector.java b/bukkit/src/main/java/com/viaversion/viaversion/bukkit/platform/PaperViaInjector.java index 78b370c13..22eaf5021 100644 --- a/bukkit/src/main/java/com/viaversion/viaversion/bukkit/platform/PaperViaInjector.java +++ b/bukkit/src/main/java/com/viaversion/viaversion/bukkit/platform/PaperViaInjector.java @@ -98,9 +98,9 @@ public final class PaperViaInjector { } } - public static boolean hasMethod(final Class clazz, final String method) { + public static boolean hasMethod(final Class clazz, final String method, final Class... params) { try { - clazz.getDeclaredMethod(method); + clazz.getDeclaredMethod(method, params); return true; } catch (final NoSuchMethodException e) { return false; diff --git a/bukkit/src/main/java/com/viaversion/viaversion/bukkit/providers/BukkitPickItemProvider.java b/bukkit/src/main/java/com/viaversion/viaversion/bukkit/providers/BukkitPickItemProvider.java index d1dd33572..ce3659aaf 100644 --- a/bukkit/src/main/java/com/viaversion/viaversion/bukkit/providers/BukkitPickItemProvider.java +++ b/bukkit/src/main/java/com/viaversion/viaversion/bukkit/providers/BukkitPickItemProvider.java @@ -29,6 +29,7 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemFactory; import org.bukkit.inventory.ItemStack; @@ -37,8 +38,8 @@ import org.bukkit.inventory.meta.BlockStateMeta; import org.checkerframework.checker.nullness.qual.Nullable; public final class BukkitPickItemProvider extends PickItemProvider { - private static final boolean HAS_PLACEMENT_MATERIAL_METHOD = PaperViaInjector.hasMethod("org.bukkit.block.BlockData", "getPlacementMaterial"); - private static final boolean HAS_SPAWN_EGG_METHOD = PaperViaInjector.hasMethod(ItemFactory.class, "getSpawnEgg"); + private static final boolean HAS_PLACEMENT_MATERIAL_METHOD = PaperViaInjector.hasMethod("org.bukkit.block.data.BlockData", "getPlacementMaterial"); + private static final boolean HAS_SPAWN_EGG_METHOD = PaperViaInjector.hasMethod(ItemFactory.class, "getSpawnEgg", EntityType.class); private static final double BLOCK_RANGE = 4.5 + 1; private static final double BLOCK_RANGE_SQUARED = BLOCK_RANGE * BLOCK_RANGE; private static final double ENTITY_RANGE = 3 + 3;