Skip to content

Commit 8e8cb6d

Browse files
author
MagicTeaMC
committed
ensure player without permission cant chop tree
1 parent 24d7329 commit 8e8cb6d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/main/java/org/milkteamc/autotreechop/utils/TreeChopUtils.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ public void chopTree(
136136
PlayerConfig playerConfig,
137137
ProtectionCheckUtils.ProtectionHooks hooks) {
138138

139+
if (!player.hasPermission("autotreechop.use")) {
140+
playerConfig.setAutoTreeChopEnabled(false);
141+
return;
142+
}
143+
139144
// Initial protection check
140145
if (!ProtectionCheckUtils.canModifyBlock(player, location, hooks)) {
141146
return;

0 commit comments

Comments
 (0)