Skip to content

Commit ec63231

Browse files
authored
add permission check for changing gamemode (#18)
still excludes actually playing the course not given by default to avoid op perms including it
1 parent 812bd1d commit ec63231

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

src/main/java/world/bentobox/parkour/listeners/CourseRunnerListener.java

+4
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ public void onTeleport(PlayerTeleportEvent e) {
217217
}
218218

219219
private void updateGamemode(Island island, User user) {
220+
if (user.hasPermission("parkour.mod.bypassgamemodechange")) {
221+
return;
222+
}
223+
220224
if (island.getFlag(addon.PARKOUR_CREATIVE) <= island.getRank(user)) {
221225
user.setGameMode(GameMode.CREATIVE);
222226
} else {

src/main/resources/addon.yml

+3-18
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ permissions:
4040
parkour.mod.bypasslock:
4141
description: Bypasses an course lock
4242
default: op
43+
parkour.mod.bypassgamemodechange:
44+
description: Bypasses the changing of your gamemode when entering your island.
45+
default: false
4346
parkour.mod.bypassban:
4447
description: Bypasses course ban
4548
default: op
@@ -89,18 +92,6 @@ permissions:
8992
parkour.mod.team.setowner:
9093
description: Allow use of '/pkadmin team setowner' command - transfers course ownership to the player
9194
default: op
92-
parkour.mod.team.add:
93-
description: Allow use of '/pkadmin add' command - add player to owner's team
94-
default: op
95-
parkour.mod.team.kick:
96-
description: Allow use of '/pkadmin kick' command - kick a player from a team
97-
default: op
98-
parkour.mod.team.disband:
99-
description: Allow use of '/pkadmin disband' command - disband owner's team
100-
default: op
101-
parkour.mod.team.setowner:
102-
description: Allow use of '/pkadmin setowner' command - transfers course ownership to the player
103-
default: op
10495
parkour.admin.blueprint:
10596
description: Allow use of '/pkadmin blueprint' command - manipulate blueprints
10697
default: op
@@ -170,9 +161,6 @@ permissions:
170161
parkour.admin.resets.add:
171162
description: Allow use of '/pkadmin resets add' command - adds this player's course reset count
172163
default: op
173-
parkour.admin.resets.remove:
174-
description: Allow use of '/pkadmin resets remove' command - reduces the player's course reset count
175-
default: op
176164
parkour.admin.delete:
177165
description: Allow use of '/pkadmin delete' command - deletes a player and regenerates their course
178166
default: op
@@ -296,9 +284,6 @@ permissions:
296284
parkour.island.team.coop:
297285
description: Allow use of '/parkour team coop' command - make a player coop rank on your course
298286
default: true
299-
parkour.island.team.coop:
300-
description: Allow use of '/parkour team uncoop' command - remove a coop rank from player
301-
default: true
302287
parkour.island.team.trust:
303288
description: Allow use of '/parkour team trust', '/parkour team untrust' command - remove trusted player rank from player
304289
default: true

0 commit comments

Comments
 (0)