diff --git a/src/main/java/com/actualplayer/modpermissions/ModPermissions.java b/src/main/java/com/actualplayer/modpermissions/ModPermissions.java index 01c393c..a5040d0 100644 --- a/src/main/java/com/actualplayer/modpermissions/ModPermissions.java +++ b/src/main/java/com/actualplayer/modpermissions/ModPermissions.java @@ -157,33 +157,29 @@ public void onEntityInteract(InteractEntityEvent event) { @Listener public void onPreItemPickup(ChangeInventoryEvent.Pickup.Pre event) { - if (configuration.isBlacklistItemPickup()) { - try { - Player player = ((Player) event.getCause().all().get(0)); - String itemId = event.getFinal().get(0).getType().getId(); - - if (!hasPermission(player, itemId, "pickup")) { - event.setCancelled(true); - } - } catch (Exception ignored) { + try { + Player player = ((Player) event.getCause().all().get(0)); + String itemId = event.getFinal().get(0).getType().getId(); + if (!hasPermission(player, itemId, "pickup")) { + event.setCancelled(true); } + } catch (Exception ignored) { + } } @Listener public void onBlockPlace(ChangeBlockEvent.Place event) { - if (configuration.isBlacklistItemPickup()) { - try { - Player player = ((Player) event.getCause().all().get(0)); - String itemId = event.getTransactions().get(0).getDefault().getState().getId(); - - if (!hasPermission(player, itemId, "pickup")) { - event.setCancelled(true); - } - } catch (Exception ignored) { + try { + Player player = ((Player) event.getCause().all().get(0)); + String itemId = event.getTransactions().get(0).getDefault().getState().getId(); + if (!hasPermission(player, itemId, "pickup")) { + event.setCancelled(true); } + } catch (Exception ignored) { + } } diff --git a/src/main/java/com/actualplayer/modpermissions/config/Configuration.java b/src/main/java/com/actualplayer/modpermissions/config/Configuration.java index a3b4087..fc57e33 100644 --- a/src/main/java/com/actualplayer/modpermissions/config/Configuration.java +++ b/src/main/java/com/actualplayer/modpermissions/config/Configuration.java @@ -9,29 +9,18 @@ public class Configuration { public static TypeToken TYPE = TypeToken.of(Configuration.class); - @Setting(value = "blacklistItemPickup", comment = "When a player does not have permission to a mod, also disable picking up of items on the floor.") - private boolean blacklistItemPickup = false; - @Setting(value = "informationMessage", comment = "What message to send to the user when he attempts to use a mod that he does not have permission to use. Leave this empty to disable messaging. %m is the mod id.") private String informationMessage = "You do not have access to %m."; - @Setting(value = "allowBreakingOfBlocks", comment = "Allows breaking of blocks even with the permission to prevent griefing.") + @Setting(value = "allowBreakingOfBlocks", comment = "Allows breaking of blocks disregarding any permission to prevent griefing.") private boolean allowBreakingOfBlocks = true; @Setting(value = "allowItemsToDrop", comment = "If allowBreakingOfBlocks is true, this will also drop the item to the ground. The user will not be able to pick up the item if he has the modpermissions.blacklist.{mod id}.pickup permission") - private boolean allowItemsToDrop = false; + private boolean allowItemsToDrop = true; @Setting(value = "allowItemMove", comment = "Allows the moving of mod items between inventories. This value is ignored if the user attempts to move items from his inventory.") private boolean allowItemMove = true; - public boolean isBlacklistItemPickup() { - return blacklistItemPickup; - } - - public void setBlacklistItemPickup(boolean blacklistItemPickup) { - this.blacklistItemPickup = blacklistItemPickup; - } - public String getInformationMessage() { return informationMessage; }