Last active
August 29, 2015 14:07
-
-
Save theresajayne/c9706452d40bef675de2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /** | |
| * Edit XP | |
| * @param player The player to edit XP for | |
| * @param xpChange The Xp to set add or remove | |
| * @param command The command to execute | |
| */ | |
| public void editxp(Player player, int xpChange, String command) | |
| { | |
| /** | |
| * The Current Experience | |
| */ | |
| int currentXp = player.getExp(); | |
| switch(command) { | |
| case "set": | |
| player.setExp(xpChange); | |
| break; | |
| case "add": | |
| player.setExp(currentXp+xpChange); | |
| break; | |
| case "rem": | |
| player.setExp(currentXp - xpChange); | |
| break; | |
| default: | |
| log.error("Unexpected Command"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment