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

Merge pull request #1029 from dniym/SpawnerFix

Fix broken spawner error
This commit is contained in:
TheBusyBiscuit 2019-08-23 09:07:55 +02:00 committed by GitHub
commit 6575e1c538
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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();