Created
September 24, 2011 20:05
-
-
Save xZise/1239791 to your computer and use it in GitHub Desktop.
getInteger w/ GM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private UserVariables getVariables(CommandSender sender) { | |
final Player player = MinecraftUtil.cast(Player.class, sender); | |
if (player != null) { | |
OverloadedWorldHolder permissions = this.groupManager.getWorldsHolder().getWorldData(player); | |
if (permissions != null) { | |
User user = permissions.getUser(player.getName()); | |
if (user != null) { | |
return user.getVariables(); | |
} | |
} | |
} | |
return null; | |
} | |
@Override | |
public Integer getInteger(CommandSender sender, Permission<Integer> permission) { | |
final UserVariables variables = getVariables(sender); | |
if (variables != null) { | |
return variables.getVarInteger(permission.getName()); | |
} | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment