diff --git a/src/main/java/net/knarcraft/permissionsigns/listener/SignListener.java b/src/main/java/net/knarcraft/permissionsigns/listener/SignListener.java index 9ac3a5d..357ac2d 100644 --- a/src/main/java/net/knarcraft/permissionsigns/listener/SignListener.java +++ b/src/main/java/net/knarcraft/permissionsigns/listener/SignListener.java @@ -50,7 +50,7 @@ public class SignListener implements Listener { } Sign sign = (Sign) block.getState(); - handleSignClick(sign, player, event.getAction()); + handleSignClick(sign, player, event.getAction(), event); } /** @@ -59,8 +59,9 @@ public class SignListener implements Listener { * @param sign

The clicked sign

* @param player

The player that clicked the sign

* @param action

The hand the player used to interact with the sign

+ * @param event

The player interact event which was triggered

*/ - private void handleSignClick(Sign sign, Player player, Action action) { + private void handleSignClick(Sign sign, Player player, Action action, PlayerInteractEvent event) { //Check if the sign is a registered permission sign PermissionSign permissionSign = SignManager.getSign(sign.getLocation()); if (permissionSign != null) { @@ -72,6 +73,7 @@ public class SignListener implements Listener { return; } if (player.isSneaking()) { + event.setCancelled(true); handlePermissionSignInteract(permissionSign, player); } else { player.sendMessage(getSignInfoText(permissionSign)); diff --git a/src/main/java/net/knarcraft/permissionsigns/utility/FileHelper.java b/src/main/java/net/knarcraft/permissionsigns/utility/FileHelper.java index 4fe271d..54a8b99 100644 --- a/src/main/java/net/knarcraft/permissionsigns/utility/FileHelper.java +++ b/src/main/java/net/knarcraft/permissionsigns/utility/FileHelper.java @@ -9,7 +9,11 @@ import java.nio.charset.StandardCharsets; /** * A helper class for dealing with files */ -public class FileHelper { +public final class FileHelper { + + private FileHelper() { + + } /** * Gets a buffered reader for