mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-08 03:40:04 +01:00
Add enderchest, bed and dispenser permissions in addition to bypass node; resolves #417
Co-Authored-By: LogoCat <kuohsuanlo@users.noreply.github.com>
This commit is contained in:
parent
887e0c9af1
commit
4922803bd9
@ -32,6 +32,7 @@ import static org.bukkit.permissions.PermissionDefault.*;
|
|||||||
public enum DPermission {
|
public enum DPermission {
|
||||||
|
|
||||||
// Main nodes
|
// Main nodes
|
||||||
|
BED("bed", OP),
|
||||||
BREAK("break", OP),
|
BREAK("break", OP),
|
||||||
BYPASS("bypass", OP),
|
BYPASS("bypass", OP),
|
||||||
CHAT("chat", TRUE),
|
CHAT("chat", TRUE),
|
||||||
@ -41,6 +42,8 @@ public enum DPermission {
|
|||||||
DELETE("delete", OP),
|
DELETE("delete", OP),
|
||||||
DUNGEON_ITEM("dungeonitem", OP),
|
DUNGEON_ITEM("dungeonitem", OP),
|
||||||
EDIT("edit", OP),
|
EDIT("edit", OP),
|
||||||
|
ENDER_CHEST("enderchest", OP),
|
||||||
|
DISPENSER("dispenser", OP),
|
||||||
ENTER("enter", OP),
|
ENTER("enter", OP),
|
||||||
ESCAPE("escape", TRUE),
|
ESCAPE("escape", TRUE),
|
||||||
GAME("game", TRUE),
|
GAME("game", TRUE),
|
||||||
|
@ -536,13 +536,13 @@ public class DPlayerListener implements Listener {
|
|||||||
if (dGameWorld != null || DEditWorld.getByWorld(player.getWorld()) != null) {
|
if (dGameWorld != null || DEditWorld.getByWorld(player.getWorld()) != null) {
|
||||||
if (event.getAction() != Action.LEFT_CLICK_BLOCK) {
|
if (event.getAction() != Action.LEFT_CLICK_BLOCK) {
|
||||||
if (VanillaItem.ENDER_CHEST.is(clickedBlock)) {
|
if (VanillaItem.ENDER_CHEST.is(clickedBlock)) {
|
||||||
if (!DPermission.hasPermission(player, DPermission.BYPASS)) {
|
if (!DPermission.hasPermission(player, DPermission.BYPASS) && !DPermission.hasPermission(player, DPermission.ENDER_CHEST)) {
|
||||||
MessageUtil.sendMessage(player, DMessage.ERROR_ENDERCHEST.getMessage());
|
MessageUtil.sendMessage(player, DMessage.ERROR_ENDERCHEST.getMessage());
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (Category.BEDS.containsBlock(clickedBlock)) {
|
} else if (Category.BEDS.containsBlock(clickedBlock)) {
|
||||||
if (!DPermission.hasPermission(player, DPermission.BYPASS)) {
|
if (!DPermission.hasPermission(player, DPermission.BYPASS) && !DPermission.hasPermission(player, DPermission.BED)) {
|
||||||
MessageUtil.sendMessage(player, DMessage.ERROR_BED.getMessage());
|
MessageUtil.sendMessage(player, DMessage.ERROR_BED.getMessage());
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -554,7 +554,7 @@ public class DPlayerListener implements Listener {
|
|||||||
if (dGameWorld != null) {
|
if (dGameWorld != null) {
|
||||||
if (event.getAction() != Action.LEFT_CLICK_BLOCK) {
|
if (event.getAction() != Action.LEFT_CLICK_BLOCK) {
|
||||||
if (VanillaItem.DISPENSER.is(clickedBlock)) {
|
if (VanillaItem.DISPENSER.is(clickedBlock)) {
|
||||||
if (!DPermission.hasPermission(player, DPermission.BYPASS)) {
|
if (!DPermission.hasPermission(player, DPermission.BYPASS) && !DPermission.hasPermission(player, DPermission.DISPENSER)) {
|
||||||
MessageUtil.sendMessage(player, DMessage.ERROR_DISPENSER.getMessage());
|
MessageUtil.sendMessage(player, DMessage.ERROR_DISPENSER.getMessage());
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user