Skip to content

Commit

Permalink
Implements new setting mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelillo15 committed May 1, 2024
1 parent 715ef97 commit 7eb91ba
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ private void enableStaffMode(boolean silentJoin) {
setItems();
sendMiniMessage(messages.get().staffMode.toggledOn());
writeStaffModeState(true);
enableVanish(true);

if (config.get().staffMode.enableVanishOnStaffEnable()) {
writeVanishState(true);
enableVanish(true);
}

eventMessenger.publish(this, new StaffModeEnabledEvent(getUniqueId()));
eventMessenger.publish(this, new BroadcastMessageExcept(messages.get().staffMode.toggledOnOthers()
Expand All @@ -188,13 +192,17 @@ private void enableStaffMode(boolean silentJoin) {

private void disableStaffMode() {
long time = System.currentTimeMillis();
disableVanish(true);
disablePlayerPerks();
restoreInventory();
if (config.get().staffMode.teleportToPreviousLocation()) loadPreviousLocation();
sendMiniMessage(messages.get().staffMode.toggledOff());
writeStaffModeState(false);

if (config.get().staffMode.disableVanishOnStaffDisable()) {
writeVanishState(false);
disableVanish(true);
}

eventMessenger.publish(this, new StaffModeDisabledEvent(getUniqueId()));
eventMessenger.publish(this, new BroadcastMessageExcept(messages.get().staffMode.toggledOffOthers()
.replace("{player}", player.getName()),
Expand Down

0 comments on commit 7eb91ba

Please sign in to comment.