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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations