Skip to content

Commit

Permalink
add more permission nodes - enderchest,bed,dispenser
Browse files Browse the repository at this point in the history
  • Loading branch information
kuohsuanlo committed May 23, 2018
1 parent 876e886 commit da2e749
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ public enum DPermission {
LIST("list", OP),
LIVES("lives", TRUE),
MAIN("main", TRUE),
ENDERCHEST("enderchest", TRUE),
BED("bed", TRUE),
DISPENSER("dispenser", TRUE),
MESSAGE("msg", OP),
PLAY("play", OP),
PORTAL("portal", OP),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,13 +559,13 @@ public void onPlayerInteract(PlayerInteractEvent event) {
if (dGameWorld != null || DEditWorld.getByWorld(player.getWorld()) != null) {
if (event.getAction() != Action.LEFT_CLICK_BLOCK) {
if (clickedBlock.getType() == Material.ENDER_CHEST) {
if (!DPermission.hasPermission(player, DPermission.BYPASS)) {
if (!DPermission.hasPermission(player, DPermission.ENDERCHEST)) {
MessageUtil.sendMessage(player, DMessage.ERROR_ENDERCHEST.getMessage());
event.setCancelled(true);
}

} else if (LegacyUtil.isBed(clickedBlock.getType())) {
if (!DPermission.hasPermission(player, DPermission.BYPASS)) {
if (!DPermission.hasPermission(player, DPermission.BED)) {
MessageUtil.sendMessage(player, DMessage.ERROR_BED.getMessage());
event.setCancelled(true);
}
Expand All @@ -577,7 +577,7 @@ public void onPlayerInteract(PlayerInteractEvent event) {
if (dGameWorld != null) {
if (event.getAction() != Action.LEFT_CLICK_BLOCK) {
if (clickedBlock.getType() == Material.DISPENSER) {
if (!DPermission.hasPermission(player, DPermission.BYPASS)) {
if (!DPermission.hasPermission(player, DPermission.DISPENSER)) {
MessageUtil.sendMessage(player, DMessage.ERROR_DISPENSER.getMessage());
event.setCancelled(true);
}
Expand Down

0 comments on commit da2e749

Please sign in to comment.