From 184ecbc786c709ad91c1bbe6d241b2c16e9e128a Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 30 Jul 2016 17:20:07 +0200 Subject: [PATCH] Hopefully finally fixes spawners reset from time to time after using Spawner Changer. Closes #162 --- .../actuallyadditions/mod/items/ItemSpawnerChanger.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSpawnerChanger.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSpawnerChanger.java index b1d0c7b4b..0511693e4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSpawnerChanger.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSpawnerChanger.java @@ -67,6 +67,14 @@ public class ItemSpawnerChanger extends ItemBase{ String entity = this.getStoredEntity(stack); if(entity != null){ MobSpawnerBaseLogic logic = ((TileEntityMobSpawner)tile).getSpawnerBaseLogic(); + + //This is a hacky way to remove the spawn potentials that make the spawner reset from time to time + //Don't judge, there isn't a method for it and it's better than Reflection hackiness + NBTTagCompound compound = new NBTTagCompound(); + logic.writeToNBT(compound); + compound.removeTag("SpawnPotentials"); + logic.readFromNBT(compound); + logic.setEntityName(entity); tile.markDirty();