Skip to content

Commit

Permalink
Add gamerule DISABLE_PLAYER_GRIEFING
Browse files Browse the repository at this point in the history
  • Loading branch information
Euphillya committed Nov 14, 2024
1 parent c199b5f commit 3a10962
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ public enum GameRuleIsland {
/**
* Disables unknown mob griefing on the island.
*/
DISABLE_UNKNOWN_MOB_GRIEFING(2_048);
DISABLE_UNKNOWN_MOB_GRIEFING(2_048),

/**
* Disables player griefing on the island.
*/
DISABLE_PLAYER_GRIEFING(4_096);

private final long permissionValue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public void onGriefingBlock(final EntityChangeBlockEvent event) {
ListenersUtils.checkGameRuleIsland(location, GameRuleIsland.DISABLE_PASSIF_MOB_GRIEFING, event);
} else if (entity instanceof Monster) {
ListenersUtils.checkGameRuleIsland(location, GameRuleIsland.DISABLE_HOSTILE_MOB_GRIEFING, event);
} else if (entity instanceof Player) {
ListenersUtils.checkGameRuleIsland(location, GameRuleIsland.DISABLE_PLAYER_GRIEFING, event);
} else {
ListenersUtils.checkGameRuleIsland(location, GameRuleIsland.DISABLE_UNKNOWN_MOB_GRIEFING, event);
}
Expand Down

0 comments on commit 3a10962

Please sign in to comment.