Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,26 +118,31 @@ public void onPlayerInteractWithInvItem(PlayerInteractEvent e) {
@EventHandler
public void onLobbyInteractProtection(PlayerInteractEvent e) {
Player player = e.getPlayer();
if (!isInLobbyWorld(player) || player.hasPermission("zpp.admin")) {
return;
}
Profile profile = ProfileManager.getInstance().getProfile(player);
ProfileStatus profileStatus = profile.getStatus();

Block clickedBlock = e.getClickedBlock();
if (clickedBlock == null) {
return;
}
if (isLobbyStatus(profileStatus)) {
if (!isLobbyProtectionAllowed("allow-lobby-interact")
&& !player.hasPermission("zpp.admin")) {

Action action = e.getAction();
Material type = clickedBlock.getType();
Block clickedBlock = e.getClickedBlock();
if (clickedBlock == null) return;

if (action == Action.PHYSICAL && Tag.PRESSURE_PLATES.isTagged(type)) {
e.setCancelled(true);
return;
}
Action action = e.getAction();
Material type = clickedBlock.getType();

if ((action == Action.RIGHT_CLICK_BLOCK || action == Action.LEFT_CLICK_BLOCK)
&& (Tag.TRAPDOORS.isTagged(type) || isProtectedWorkstation(type))) {
e.setCancelled(true);
if (action == Action.PHYSICAL && Tag.PRESSURE_PLATES.isTagged(type)) {
e.setCancelled(true);
return;
}

if ((action == Action.RIGHT_CLICK_BLOCK || action == Action.LEFT_CLICK_BLOCK)
&& (Tag.TRAPDOORS.isTagged(type) || isProtectedWorkstation(type))) {
e.setCancelled(true);
}
}

return;
}
}

Expand Down
3 changes: 2 additions & 1 deletion core/src/main/resources/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION: 57
VERSION: 58

# Mysql database setup.
MYSQL-DATABASE:
Expand Down Expand Up @@ -656,6 +656,7 @@ PLAYER:
allow-hunger: false
allow-block-break: false
allow-block-place: false
allow-lobby-interact: false
LOBBY-NAMETAG:
ENABLED: true
NAMETAG-MANAGEMENT:
Expand Down