use of pl.plajer.villagedefense3.User in project Village_Defense by Plajer.
the class AdminCommands method addOrbs.
public void addOrbs(CommandSender sender, String number) {
if (!checkIsInGameInstance((Player) sender))
return;
if (!hasPermission(sender, "villagedefense.admin.addorbs"))
return;
if (NumberUtils.isNumber(number)) {
User user = UserManager.getUser(((Player) sender).getUniqueId());
user.setInt("orbs", user.getInt("orbs") + Integer.parseInt(number));
sender.sendMessage(ChatManager.PLUGIN_PREFIX + ChatManager.colorMessage("Commands.Admin-Commands.Added-Orbs"));
} else {
sender.sendMessage(ChatColor.RED + "Wrong usage. Do /villagedefense addorbs <amount>");
}
}
use of pl.plajer.villagedefense3.User in project Village_Defense by Plajer.
the class KitManager method checkIfIsUnlocked.
@EventHandler
public void checkIfIsUnlocked(VillagePlayerChooseKitEvent event) {
if (event.getKit().isUnlockedByPlayer(event.getPlayer())) {
User user = UserManager.getUser(event.getPlayer().getUniqueId());
user.setKit(event.getKit());
String chosenkitmessage = ChatManager.colorMessage("Kits.Choose-Message");
chosenkitmessage = ChatManager.formatMessage(chosenkitmessage, event.getKit());
event.getPlayer().sendMessage(chosenkitmessage);
} else {
String chosenKitMessageButNotUnlocked = ChatManager.colorMessage("Kits.Not-Unlocked-Message");
event.getPlayer().sendMessage(ChatManager.formatMessage(chosenKitMessageButNotUnlocked, event.getKit()));
}
}
use of pl.plajer.villagedefense3.User in project actframework by actframework.
the class GHIssue353 method testPost.
@Test
public void testPost() throws Exception {
url("/gh/353").accept(H.Format.JSON).postJSON(user);
String s = resp().body().string();
User user2 = JSON.parseObject(s, User.class);
eq(user.name, user2.name);
}
Aggregations