use of simplepets.brainsynder.api.entity.passive.IEntityTropicalFishPet in project SimplePets by brainsynder-Dev.
the class BodyColor method onRightClick.
@Override
public void onRightClick() {
if (entityPet instanceof IEntityTropicalFishPet) {
IEntityTropicalFishPet var = (IEntityTropicalFishPet) entityPet;
DyeColorWrapper wrapper = DyeColorWrapper.WHITE;
if (var.getBodyColor() != null)
wrapper = var.getBodyColor();
var.setBodyColor(DyeColorWrapper.getPrevious(wrapper));
}
}
use of simplepets.brainsynder.api.entity.passive.IEntityTropicalFishPet 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 simplepets.brainsynder.api.entity.passive.IEntityTropicalFishPet in project SimplePets by brainsynder-Dev.
the class Pattern method getItem.
@Override
public ItemBuilder getItem() {
ItemBuilder item = type.getDataItemByName("pattern", 0);
if (getEntityPet() instanceof IEntityTropicalFishPet) {
IEntityTropicalFishPet var = (IEntityTropicalFishPet) getEntityPet();
TropicalPattern typeID = TropicalPattern.KOB;
if (var.getPattern() != null)
typeID = var.getPattern();
TropicalPattern prev = TropicalPattern.getPrevious(typeID);
TropicalPattern next = TropicalPattern.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_state%", WordUtils.capitalize(prev.name().toLowerCase().replace("_", " "))).replace("%curr_state%", WordUtils.capitalize(typeID.name().toLowerCase().replace("_", " "))).replace("%next_state%", WordUtils.capitalize(next.name().toLowerCase().replace("_", " "))));
}
item.withLore(lore);
}
return item;
}
use of simplepets.brainsynder.api.entity.passive.IEntityTropicalFishPet in project SimplePets by brainsynder-Dev.
the class Pattern method onLeftClick.
@Override
public void onLeftClick() {
if (entityPet instanceof IEntityTropicalFishPet) {
IEntityTropicalFishPet var = (IEntityTropicalFishPet) entityPet;
TropicalPattern wrapper = TropicalPattern.KOB;
if (var.getPattern() != null)
wrapper = var.getPattern();
var.setPattern(TropicalPattern.getNext(wrapper));
}
}
use of simplepets.brainsynder.api.entity.passive.IEntityTropicalFishPet in project SimplePets by brainsynder-Dev.
the class Pattern method onRightClick.
@Override
public void onRightClick() {
if (entityPet instanceof IEntityTropicalFishPet) {
IEntityTropicalFishPet var = (IEntityTropicalFishPet) entityPet;
TropicalPattern wrapper = TropicalPattern.KOB;
if (var.getPattern() != null)
wrapper = var.getPattern();
var.setPattern(TropicalPattern.getPrevious(wrapper));
}
}
Aggregations