diff --git a/README.md b/README.md index 95b85a0..838b5f8 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +# (All credits to [stdNullPtr/TorchLight-SpigotMC](https://github.com/stdNullPtr/TorchLight-SpigotMC)) + # TorchLight - Offhand Torch Light Plugin **Minecraft API:** 1.19 diff --git a/src/main/java/com/stdnullptr/listener/PlayerActivityEventListener.java b/src/main/java/com/stdnullptr/listener/PlayerActivityEventListener.java index e0bdc58..48f4314 100644 --- a/src/main/java/com/stdnullptr/listener/PlayerActivityEventListener.java +++ b/src/main/java/com/stdnullptr/listener/PlayerActivityEventListener.java @@ -36,6 +36,11 @@ public PlayerActivityEventListener(final PluginMain plugin) { public void onPlayerMove(final PlayerMoveEvent event) { final Player player = event.getPlayer(); final UUID playerId = player.getUniqueId(); + + // Skip if off permission + if(player.hasPermission("torchlight.off") == true) { + return; + } // Skip if moved too recently final long currentTime = System.currentTimeMillis(); @@ -85,6 +90,10 @@ public void onPlayerMove(final PlayerMoveEvent event) { // Schedule task to revert the block to its original state Bukkit.getScheduler().runTaskLater(plugin, () -> { + // Skip if permanent permission + if(player.hasPermission("torchlight.permanent")) { + return; + } if (blockAtPlayerLocation.getType() == Material.LIGHT && playerLightLocations.containsKey(playerId) && playerLightLocations.get(playerId).equals(blockLocationAtPlayer) diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index c0e35f3..328e505 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -11,3 +11,9 @@ permissions: torchlight.toggle: description: Allows toggling the offhand torch lighting feature. default: op + torchlight.off: + description: Disable light for the player. + default: false + torchlight.permanent: + description: offhand torch never light off. + default: false \ No newline at end of file