ChangedSign armourSign = null;
if (right.getType() == Material.WALL_SIGN)
armourSign = BukkitUtil.toChangedSign(right);
for (int i = 0; i < amount; i++) {
Entity ent = BukkitUtil.toSign(getSign()).getWorld().spawn(location, type.getEntityClass());
if (armourSign != null) { // Apply armor
if (ent instanceof LivingEntity) {
for (int s = 0; s < 4; s++) {
String bit = armourSign.getLine(s);
ItemStack slot = ItemUtil.makeItemValid(ItemSyntax.getItem(bit));
switch (s) {
case 0:
((LivingEntity) ent).getEquipment().setHelmet(slot);
break;
case 1:
((LivingEntity) ent).getEquipment().setChestplate(slot);
break;
case 2:
((LivingEntity) ent).getEquipment().setLeggings(slot);
break;
case 3:
((LivingEntity) ent).getEquipment().setBoots(slot);
break;
}
}
}
}
Boolean upwards = null;
while (effectSign != null) { // Apply effects
for (int s = 0; s < 4; s++) {
String bit = effectSign.getLine(s);
if (bit == null || bit.trim().isEmpty()) continue;
String[] data = RegexUtil.COLON_PATTERN.split(bit);
if (data[0].equalsIgnoreCase("e")) EntityUtil.setEntityData(ent, bit.substring(2));
else if (data[0].equalsIgnoreCase("r")) {
EntityType rider = EntityType.fromName(data[1].trim());
Entity rid = BukkitUtil.toSign(getSign()).getWorld().spawnEntity(location, rider);
ent.setPassenger(rid);
} else if (data[0].equalsIgnoreCase("p") && ent instanceof LivingEntity) {
for (int a = 1; a < data.length; a++) {
try {
String[] potionBits = RegexUtil.SEMICOLON_PATTERN.split(data[a]);