diff --git a/src/main/lombok/nl/SBDeveloper/V10Lift/Commands/V10LiftTabCompleter.java b/src/main/lombok/nl/SBDeveloper/V10Lift/Commands/V10LiftTabCompleter.java index 3605485..ddf2604 100644 --- a/src/main/lombok/nl/SBDeveloper/V10Lift/Commands/V10LiftTabCompleter.java +++ b/src/main/lombok/nl/SBDeveloper/V10Lift/Commands/V10LiftTabCompleter.java @@ -14,7 +14,7 @@ public class V10LiftTabCompleter implements TabCompleter { private static final List COMMANDS = Arrays.asList("create", "delete", "rename", "abort", "whois", "edit", "floor", "input", "build", "rope", "door", "speed", "realistic", "repair", "whitelist", "reload", "help", "start", "stop", "offline"); - + @Override public List onTabComplete(@Nonnull CommandSender commandSender, @Nonnull Command cmd, @Nonnull String label, @Nonnull String[] args) { if (label.equalsIgnoreCase("v10lift")) { diff --git a/src/main/lombok/nl/SBDeveloper/V10Lift/Listeners/PlayerInteractListener.java b/src/main/lombok/nl/SBDeveloper/V10Lift/Listeners/PlayerInteractListener.java index ee524c1..db46d91 100644 --- a/src/main/lombok/nl/SBDeveloper/V10Lift/Listeners/PlayerInteractListener.java +++ b/src/main/lombok/nl/SBDeveloper/V10Lift/Listeners/PlayerInteractListener.java @@ -15,17 +15,21 @@ import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockState; import org.bukkit.block.Sign; +import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; -import org.bukkit.event.player.PlayerAnimationEvent; +import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; -import java.util.*; +import java.util.Iterator; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; public class PlayerInteractListener implements Listener { //BUTTON CLICK @@ -67,8 +71,10 @@ public class PlayerInteractListener implements Listener { //Gamemode adventure left click fix @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) - public void onPlayerLeftClickSign(PlayerAnimationEvent e) { - Player p = e.getPlayer(); + public void onPlayerLeftClickSign(EntityDamageByEntityEvent e) { + Entity ent = e.getDamager(); + if (!(ent instanceof Player)) return; + Player p = (Player) e.getDamager(); if (p.getGameMode() != GameMode.ADVENTURE) return;