From 4d27cc36eb3cc193df1839e985ebfba8d345522e Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Fri, 18 Feb 2022 17:53:42 +0100 Subject: [PATCH 1/3] Sets the event priority for protection events to LOWEST --- .../permissionsigns/listener/BlockListener.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/knarcraft/permissionsigns/listener/BlockListener.java b/src/main/java/net/knarcraft/permissionsigns/listener/BlockListener.java index bf1748e..5b10321 100644 --- a/src/main/java/net/knarcraft/permissionsigns/listener/BlockListener.java +++ b/src/main/java/net/knarcraft/permissionsigns/listener/BlockListener.java @@ -13,6 +13,7 @@ import org.bukkit.block.data.type.WallSign; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockExplodeEvent; @@ -30,27 +31,27 @@ import static net.knarcraft.permissionsigns.PermissionSigns.extensiveSignProtect */ public class BlockListener implements Listener { - @EventHandler + @EventHandler(priority = EventPriority.LOWEST) public void onPistonExtend(BlockPistonExtendEvent event) { preventDestruction(event.getBlocks(), event); } - @EventHandler + @EventHandler(priority = EventPriority.LOWEST) public void onPistonRetract(BlockPistonRetractEvent event) { preventDestruction(event.getBlocks(), event); } - @EventHandler + @EventHandler(priority = EventPriority.LOWEST) public void onBlockExplode(BlockExplodeEvent event) { preventDestruction(event.blockList(), event); } - @EventHandler + @EventHandler(priority = EventPriority.LOWEST) public void onEntityExplode(EntityExplodeEvent event) { preventDestruction(event.blockList(), event); } - @EventHandler + @EventHandler(priority = EventPriority.LOWEST) public void onBlockBreak(BlockBreakEvent event) { Block block = event.getBlock(); Player player = event.getPlayer(); From ff362f8d1da302e24c7946bb42cf262d4e127409 Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Fri, 18 Feb 2022 17:55:30 +0100 Subject: [PATCH 2/3] Updates annotations dependency --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1402012..9bdec8e 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ org.jetbrains annotations - 20.1.0 + 22.0.0 compile From 0451734731ea28f2c33ee26ac3911a7c7e05c53f Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Wed, 2 Mar 2022 13:14:06 +0100 Subject: [PATCH 3/3] Prevents instantiation of the Translator class --- pom.xml | 4 ++-- .../net/knarcraft/permissionsigns/formatting/Translator.java | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 9bdec8e..60c881b 100644 --- a/pom.xml +++ b/pom.xml @@ -33,8 +33,8 @@ maven-compiler-plugin 3.8.1 - ${java.version} - ${java.version} + 17 + 17 diff --git a/src/main/java/net/knarcraft/permissionsigns/formatting/Translator.java b/src/main/java/net/knarcraft/permissionsigns/formatting/Translator.java index 6a907d6..1b09dbb 100644 --- a/src/main/java/net/knarcraft/permissionsigns/formatting/Translator.java +++ b/src/main/java/net/knarcraft/permissionsigns/formatting/Translator.java @@ -21,6 +21,10 @@ public final class Translator { private static Map translatedMessages; private static Map backupTranslatedMessages; + private Translator() { + + } + /** * Loads the languages used by this translator */