Skip to content

Commit

Permalink
Set game mode at start and end of runs.
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Aug 28, 2021
1 parent c18f70f commit deab506
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ public void onStartEndSet(PlayerInteractEvent e) {
e.getPlayer().playSound(l, Sound.ENTITY_FIREWORK_ROCKET_LAUNCH, 1F, 1F);
timers.put(e.getPlayer().getUniqueId(), System.currentTimeMillis());
checkpoints.put(user.getUniqueId(), e.getPlayer().getLocation());
user.setGameMode(GameMode.SURVIVAL);
}
} else if (metaEnd.filter(mdv -> isLocEquals(l, mdv.asString())).isPresent()) {
if (timers.containsKey(e.getPlayer().getUniqueId())) {
Expand All @@ -174,6 +175,10 @@ public void onStartEndSet(PlayerInteractEvent e) {
// Say rank
user.sendMessage("parkour.top.your-rank", TextVariables.NUMBER, String.valueOf(addon.getPm().getRank(island, e.getPlayer().getUniqueId())));

// set creative
if (addon.getIslands().userIsOnIsland(addon.getOverWorld(), user)) {
user.setGameMode(GameMode.CREATIVE);
}
}
}
}
Expand Down

0 comments on commit deab506

Please sign in to comment.