Search in sources :

Example 66 with User

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>");
    }
}
Also used : Player(org.bukkit.entity.Player) User(pl.plajer.villagedefense3.User)

Example 67 with User

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()));
    }
}
Also used : User(pl.plajer.villagedefense3.User) EventHandler(org.bukkit.event.EventHandler)

Example 68 with User

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);
}
Also used : User(testapp.endpoint.ghissues.gh353.User) Test(org.junit.Test)

Aggregations

User (pl.plajer.villagedefense3.User)30 Player (org.bukkit.entity.Player)19 User (org.gluu.oxtrust.model.scim2.User)17 EventHandler (org.bukkit.event.EventHandler)11 GluuCustomPerson (org.gluu.oxtrust.model.GluuCustomPerson)10 ScimPatchUser (org.gluu.oxtrust.model.scim2.ScimPatchUser)10 User (org.openstack4j.model.identity.v3.User)10 Arena (pl.plajer.villagedefense3.arena.Arena)9 DuplicateEntryException (org.gluu.site.ldap.exception.DuplicateEntryException)8 ArrayList (java.util.ArrayList)7 EntryPersistenceException (org.gluu.site.ldap.persistence.exception.EntryPersistenceException)7 Date (java.util.Date)6 SimpleUser (me.zhanghai.android.douya.network.api.info.apiv2.SimpleUser)6 User (me.zhanghai.android.douya.network.api.info.apiv2.User)6 ItemStack (org.bukkit.inventory.ItemStack)5 PersonRequiredFieldsException (org.gluu.oxtrust.exception.PersonRequiredFieldsException)5 Test (org.junit.Test)5 ApiOperation (com.wordnik.swagger.annotations.ApiOperation)4 BigDecimal (java.math.BigDecimal)4 URI (java.net.URI)4