Skip to content

Instantly share code, notes, and snippets.

@volgar1x
Created May 7, 2015 18:47
Show Gist options
  • Save volgar1x/d296ee69df20b1f20dfe to your computer and use it in GitHub Desktop.
Save volgar1x/d296ee69df20b1f20dfe to your computer and use it in GitHub Desktop.
class Player implements Restricted<Player> {
@Getter
final Permission<Player> permission =
Alpha.let("connect").raiseIf("You are banned", this::isBanned)
.raiseIf("Already playing", this::isAlreadyPlaying)
.let("move").raiseIf("You are jailed", this::isJailed)
.raiseIf("Too heavy", this::isTooHeavy)
.let("move:teleport").raiseUnless("You are not an admin", this::isAdmin)
;
;
}
player.must("move:teleport");
player.teleportTo(BONTA);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment