mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 00:38:35 +01:00
Hopefully finally fixes spawners reset from time to time after using Spawner Changer.
Closes #162
This commit is contained in:
parent
df4bcf05cf
commit
184ecbc786
1 changed files with 8 additions and 0 deletions
|
@ -67,6 +67,14 @@ public class ItemSpawnerChanger extends ItemBase{
|
||||||
String entity = this.getStoredEntity(stack);
|
String entity = this.getStoredEntity(stack);
|
||||||
if(entity != null){
|
if(entity != null){
|
||||||
MobSpawnerBaseLogic logic = ((TileEntityMobSpawner)tile).getSpawnerBaseLogic();
|
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);
|
logic.setEntityName(entity);
|
||||||
|
|
||||||
tile.markDirty();
|
tile.markDirty();
|
||||||
|
|
Loading…
Reference in a new issue