Remove empty capabilities from itemblocks

This commit is contained in:
Unknown 2019-05-07 01:55:44 +02:00 committed by unknown
parent e44e125436
commit 40b9be0d48

View file

@ -205,6 +205,12 @@ public abstract class TileEntityAbstractBase extends TileEntity implements IBloc
@Override
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) {
tagCompound = super.writeToNBT(tagCompound);
// forge cleanup
if (tagCompound.getCompoundTag("ForgeCaps").isEmpty()) {
tagCompound.removeTag("ForgeCaps");
}
if (!installedUpgrades.isEmpty()) {
final NBTTagCompound nbtTagCompoundUpgrades = new NBTTagCompound();
for (final Entry<Object, Integer> entry : installedUpgrades.entrySet()) {
@ -213,6 +219,7 @@ public abstract class TileEntityAbstractBase extends TileEntity implements IBloc
}
tagCompound.setTag("upgrades", nbtTagCompoundUpgrades);
}
return tagCompound;
}