1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 11:45:51 +00:00

Fix broken spawner error

This commit is contained in:
dNiym 2019-08-23 01:29:51 -04:00
parent deb904f338
commit da8def9d4f

View File

@ -2689,7 +2689,9 @@ public class SlimefunSetup {
if (SlimefunManager.isItemSimiliar(item, SlimefunItems.REPAIRED_SPAWNER, false)) {
EntityType type = null;
for (String line: item.getItemMeta().getLore()) {
if (ChatColor.stripColor(line).startsWith("Type: ")) type = EntityType.valueOf(ChatColor.stripColor(line).replace("Type: ", "").replace(" ", "_").toUpperCase());
if (ChatColor.stripColor(line).startsWith("Type: ") && !line.contains("<Type>"))
type = EntityType.valueOf(ChatColor.stripColor(line).replace("Type: ", "").replace(" ", "_").toUpperCase());
}
if (type != null) {
CreatureSpawner spawner = (CreatureSpawner) e.getBlock().getState();