Remove empty capabilities from itemblocks
This commit is contained in:
parent
e44e125436
commit
40b9be0d48
1 changed files with 7 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue