use of simplepets.brainsynder.api.entity.misc.IColorable in project SimplePets by brainsynder-Dev.
the class ShulkerColor method onRightClick.
@Override
public void onRightClick() {
if (entityPet instanceof IColorable) {
IColorable var = (IColorable) entityPet;
DyeColorWrapper wrapper = DyeColorWrapper.PURPLE;
if (var.getColor() != null)
wrapper = var.getColor();
var.setColor(DyeColorWrapper.getPrevious(wrapper));
}
}
use of simplepets.brainsynder.api.entity.misc.IColorable in project SimplePets by brainsynder-Dev.
the class ShulkerColor method getItem.
@Override
public ItemBuilder getItem() {
ItemBuilder item = null;
if (getEntityPet() instanceof IColorable) {
IColorable var = (IColorable) getEntityPet();
DyeColorWrapper typeID = DyeColorWrapper.PURPLE;
if (var.getColor() != null)
typeID = var.getColor();
item = type.getDataItemByName("shulkercolor", typeID.getWoolData());
DyeColorWrapper prev = DyeColorWrapper.getPrevious(typeID);
DyeColorWrapper next = DyeColorWrapper.getNext(typeID);
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("%curr_color%", "§" + typeID.getChatChar()).replace("%curr_name%", WordUtils.capitalize(typeID.name().toLowerCase())).replace("%next_color%", "§" + next.getChatChar()).replace("%next_name%", WordUtils.capitalize(next.name().toLowerCase())));
}
item.withLore(lore);
}
return item;
}
use of simplepets.brainsynder.api.entity.misc.IColorable in project SimplePets by brainsynder-Dev.
the class Color method onLeftClick.
@Override
public void onLeftClick() {
if (entityPet instanceof IColorable) {
IColorable var = (IColorable) entityPet;
DyeColorWrapper wrapper = DyeColorWrapper.WHITE;
if (var.getColor() != null)
wrapper = var.getColor();
var.setColor(DyeColorWrapper.getNext(wrapper));
}
}
use of simplepets.brainsynder.api.entity.misc.IColorable in project SimplePets by brainsynder-Dev.
the class ShulkerColor method onLeftClick.
@Override
public void onLeftClick() {
if (entityPet instanceof IColorable) {
IColorable var = (IColorable) entityPet;
DyeColorWrapper wrapper = DyeColorWrapper.PURPLE;
if (var.getColor() != null)
wrapper = var.getColor();
var.setColor(DyeColorWrapper.getNext(wrapper));
}
}
use of simplepets.brainsynder.api.entity.misc.IColorable in project SimplePets by brainsynder-Dev.
the class Color method onRightClick.
@Override
public void onRightClick() {
if (entityPet instanceof IColorable) {
IColorable var = (IColorable) entityPet;
DyeColorWrapper wrapper = DyeColorWrapper.WHITE;
if (var.getColor() != null)
wrapper = var.getColor();
var.setColor(DyeColorWrapper.getPrevious(wrapper));
}
}
Aggregations