Search in sources :

Example 26 with ItemBuilder

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

the class FoxColor method getDefaultItems.

@Override
public List<ItemBuilder> getDefaultItems() {
    List<ItemBuilder> items = new ArrayList<>();
    ItemBuilder builder = ItemBuilder.getSkull(simple.brainsynder.utils.SkullType.PLAYER);
    items.add(builder.clone().withName("&6Type: &eRed").setTexture("http://textures.minecraft.net/texture/d8954a42e69e0881ae6d24d4281459c144a0d5a968aed35d6d3d73a3c65d26a"));
    items.add(builder.clone().withName("&6Type: &eWhite").setTexture("http://textures.minecraft.net/texture/ddcd0db8cbe8f1e0ab1ec0a9385fb9288da84d3202c1c397da76ee1035e608b0"));
    return items;
}
Also used : ItemBuilder(simple.brainsynder.api.ItemBuilder) ArrayList(java.util.ArrayList)

Example 27 with ItemBuilder

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

the class PandaSit method getItem.

@Override
public ItemBuilder getItem() {
    ItemBuilder builder = type.getDataItemByName(getTargetName(), 0);
    builder.withName(formatName(builder, (entity, name) -> {
        name = name.replace("%value%", String.valueOf(entity.isScared()));
        return name;
    }));
    return builder;
}
Also used : ServerVersion(simple.brainsynder.utils.ServerVersion) Utilities(simplepets.brainsynder.utils.Utilities) List(java.util.List) PetDefault(simplepets.brainsynder.pet.PetDefault) ItemBuilder(simple.brainsynder.api.ItemBuilder) IEntityPet(simplepets.brainsynder.api.entity.IEntityPet) ValueType(simplepets.brainsynder.utils.ValueType) IEntityPandaPet(simplepets.brainsynder.api.entity.passive.IEntityPandaPet) MenuItemAbstract(simplepets.brainsynder.menu.menuItems.base.MenuItemAbstract) ArrayList(java.util.ArrayList) ItemBuilder(simple.brainsynder.api.ItemBuilder)

Example 28 with ItemBuilder

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

the class PandaSneeze method getItem.

@Override
public ItemBuilder getItem() {
    ItemBuilder builder = type.getDataItemByName(getTargetName(), 0);
    builder.withName(formatName(builder, (entity, name) -> {
        name = name.replace("%value%", String.valueOf(entity.isSneezing()));
        return name;
    }));
    return builder;
}
Also used : ServerVersion(simple.brainsynder.utils.ServerVersion) List(java.util.List) PetDefault(simplepets.brainsynder.pet.PetDefault) ItemBuilder(simple.brainsynder.api.ItemBuilder) IEntityPet(simplepets.brainsynder.api.entity.IEntityPet) ValueType(simplepets.brainsynder.utils.ValueType) SkullType(simple.brainsynder.utils.SkullType) IEntityPandaPet(simplepets.brainsynder.api.entity.passive.IEntityPandaPet) MenuItemAbstract(simplepets.brainsynder.menu.menuItems.base.MenuItemAbstract) ArrayList(java.util.ArrayList) ItemBuilder(simple.brainsynder.api.ItemBuilder)

Example 29 with ItemBuilder

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

the class PatternColor method getItem.

@Override
public ItemBuilder getItem() {
    ItemBuilder item = new ItemBuilder(Material.AIR);
    if (getEntityPet() instanceof IEntityTropicalFishPet) {
        IEntityTropicalFishPet var = (IEntityTropicalFishPet) getEntityPet();
        DyeColorWrapper wrapper = DyeColorWrapper.WHITE;
        if (var.getPatternColor() != null)
            wrapper = var.getPatternColor();
        item = type.getDataItemByName("patterncolor", wrapper.getWoolData());
        DyeColorWrapper prev = DyeColorWrapper.getPrevious(wrapper);
        DyeColorWrapper next = DyeColorWrapper.getNext(wrapper);
        List<String> lore = new ArrayList<>();
        for (Object s : (JSONArray) item.toJSON().get("lore")) {
            String str = String.valueOf(s);
            lore.add(str.replace("%prev_color%", "§" + prev.getChatChar()).replace("%prev_name%", WordUtils.capitalize(prev.name().toLowerCase().replace("_", " "))).replace("%curr_color%", "§" + wrapper.getChatChar()).replace("%curr_name%", WordUtils.capitalize(wrapper.name().toLowerCase().replace("_", " "))).replace("%next_color%", "§" + next.getChatChar()).replace("%next_name%", WordUtils.capitalize(next.name().toLowerCase().replace("_", " "))));
        }
        item.withLore(lore);
    }
    return item;
}
Also used : ItemBuilder(simple.brainsynder.api.ItemBuilder) DyeColorWrapper(simplepets.brainsynder.wrapper.DyeColorWrapper) ArrayList(java.util.ArrayList) JSONArray(org.json.simple.JSONArray) IEntityTropicalFishPet(simplepets.brainsynder.api.entity.passive.IEntityTropicalFishPet)

Example 30 with ItemBuilder

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

the class WitherShield method getItem.

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

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