Search in sources :

Example 16 with ItemBuilder

use of simple.brainsynder.api.ItemBuilder in project SimplePets by brainsynder-Dev.

the class Saddle method getItem.

@Override
public ItemBuilder getItem() {
    ItemBuilder item = type.getDataItemByName("saddle", 0);
    try {
        if (entityPet instanceof IEntityPigPet) {
            IEntityPigPet pig = (IEntityPigPet) entityPet;
            item.withName(item.getName().replace("%value%", String.valueOf(pig.hasSaddle())));
        } else if (entityPet instanceof IHorseAbstract) {
            IHorseAbstract var = (IHorseAbstract) entityPet;
            item.withName(item.getName().replace("%value%", String.valueOf(var.isSaddled())));
        }
    } catch (Exception e) {
        item.withName("&6Has Saddle: &cERROR");
    }
    return item;
}
Also used : ItemBuilder(simple.brainsynder.api.ItemBuilder) IEntityPigPet(simplepets.brainsynder.api.entity.passive.IEntityPigPet) IHorseAbstract(simplepets.brainsynder.api.entity.misc.IHorseAbstract)

Example 17 with ItemBuilder

use of simple.brainsynder.api.ItemBuilder in project SimplePets by brainsynder-Dev.

the class Saddle method getDefaultItems.

@Override
public List<ItemBuilder> getDefaultItems() {
    ItemBuilder item = new ItemBuilder(Material.SADDLE);
    item.withName("&6Has Saddle: &e%value%");
    return new ArrayList<>(Collections.singleton(item));
}
Also used : ItemBuilder(simple.brainsynder.api.ItemBuilder) ArrayList(java.util.ArrayList)

Example 18 with ItemBuilder

use of simple.brainsynder.api.ItemBuilder in project SimplePets by brainsynder-Dev.

the class Shaking method getItem.

@Override
public ItemBuilder getItem() {
    ItemBuilder item = type.getDataItemByName("shaking", 0);
    if (entityPet instanceof IEntityZombiePet) {
        IEntityZombiePet var = (IEntityZombiePet) entityPet;
        item.withName(item.getName().replace("%value%", String.valueOf(var.isShaking())));
    }
    return item;
}
Also used : ItemBuilder(simple.brainsynder.api.ItemBuilder) IEntityZombiePet(simplepets.brainsynder.api.entity.hostile.IEntityZombiePet)

Example 19 with ItemBuilder

use of simple.brainsynder.api.ItemBuilder in project SimplePets by brainsynder-Dev.

the class ShulkerClosed method getItem.

@Override
public ItemBuilder getItem() {
    ItemBuilder item = type.getDataItemByName("shulkerclosed", 0);
    if (getEntityPet() instanceof IEntityShulkerPet) {
        IEntityShulkerPet var = (IEntityShulkerPet) getEntityPet();
        item.withName(item.getName().replace("%value%", String.valueOf(var.isClosed())));
    }
    return item;
}
Also used : IEntityShulkerPet(simplepets.brainsynder.api.entity.hostile.IEntityShulkerPet) ItemBuilder(simple.brainsynder.api.ItemBuilder)

Example 20 with ItemBuilder

use of simple.brainsynder.api.ItemBuilder in project SimplePets by brainsynder-Dev.

the class Spell method getDefaultItems.

@Override
public List<ItemBuilder> getDefaultItems() {
    List<ItemBuilder> items = new ArrayList<>();
    ItemBuilder item = ItemBuilder.getColored(simple.brainsynder.utils.MatType.INK_SACK, 0);
    item.withName(WordUtils.capitalize(WizardSpell.BLINDNESS.name().toLowerCase().replace('_', ' ')));
    items.add(item);
    item = ItemBuilder.getColored(simple.brainsynder.utils.MatType.INK_SACK, 12);
    item.withName(WordUtils.capitalize(WizardSpell.DISAPPEAR.name().toLowerCase().replace('_', ' ')));
    items.add(item);
    item = ItemBuilder.getColored(simple.brainsynder.utils.MatType.INK_SACK, 3);
    item.withName(WordUtils.capitalize(WizardSpell.FANGS.name().toLowerCase().replace('_', ' ')));
    items.add(item);
    item = new ItemBuilder(Material.BARRIER);
    item.withName(WordUtils.capitalize(WizardSpell.NONE.name().toLowerCase().replace('_', ' ')));
    items.add(item);
    item = ItemBuilder.getColored(simple.brainsynder.utils.MatType.INK_SACK, 8);
    item.withName(WordUtils.capitalize(WizardSpell.SUMMON_VEX.name().toLowerCase().replace('_', ' ')));
    items.add(item);
    item = ItemBuilder.getColored(simple.brainsynder.utils.MatType.INK_SACK, 14);
    item.withName(WordUtils.capitalize(WizardSpell.WOLOLO.name().toLowerCase().replace('_', ' ')));
    items.add(item);
    return items;
}
Also used : ItemBuilder(simple.brainsynder.api.ItemBuilder) ArrayList(java.util.ArrayList)

Aggregations

ItemBuilder (simple.brainsynder.api.ItemBuilder)108 ArrayList (java.util.ArrayList)65 PetDefault (simplepets.brainsynder.pet.PetDefault)13 List (java.util.List)11 IEntityPet (simplepets.brainsynder.api.entity.IEntityPet)11 MenuItemAbstract (simplepets.brainsynder.menu.menuItems.base.MenuItemAbstract)11 ValueType (simplepets.brainsynder.utils.ValueType)11 ServerVersion (simple.brainsynder.utils.ServerVersion)10 DyeColorWrapper (simplepets.brainsynder.wrapper.DyeColorWrapper)8 JSONArray (org.json.simple.JSONArray)7 IEntityPandaPet (simplepets.brainsynder.api.entity.passive.IEntityPandaPet)6 IEntityFoxPet (simplepets.brainsynder.api.entity.passive.IEntityFoxPet)5 Utilities (simplepets.brainsynder.utils.Utilities)5 ItemStack (org.bukkit.inventory.ItemStack)4 IEntityHorsePet (simplepets.brainsynder.api.entity.passive.IEntityHorsePet)3 IEntityTropicalFishPet (simplepets.brainsynder.api.entity.passive.IEntityTropicalFishPet)3 SkullType (simple.brainsynder.utils.SkullType)2 IEntityArmorStandPet (simplepets.brainsynder.api.entity.ambient.IEntityArmorStandPet)2 IEntityWitherPet (simplepets.brainsynder.api.entity.hostile.IEntityWitherPet)2 IEntityZombiePet (simplepets.brainsynder.api.entity.hostile.IEntityZombiePet)2