Fixed dropped or picked blocks not always stacking

This commit is contained in:
Unknown 2019-09-28 14:21:05 +02:00 committed by unknown
parent 67d8620f32
commit e5f0f7e918
2 changed files with 6 additions and 2 deletions

View file

@ -206,7 +206,9 @@ public abstract class BlockAbstractContainer extends BlockContainer implements I
final NBTTagCompound tagCompound = new NBTTagCompound();
if (tileEntity instanceof TileEntityAbstractBase) {
((TileEntityAbstractBase) tileEntity).writeItemDropNBT(tagCompound);
itemStack.setTagCompound(tagCompound);
if (!tagCompound.isEmpty()) {
itemStack.setTagCompound(tagCompound);
}
}
return itemStack;
}

View file

@ -729,7 +729,9 @@ public class TileEntityLaser extends TileEntityAbstractLaser implements IBeamFre
@Override
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) {
tagCompound = super.writeToNBT(tagCompound);
tagCompound.setInteger(IBeamFrequency.BEAM_FREQUENCY_TAG, beamFrequency);
if (IBeamFrequency.isValid(beamFrequency)) {
tagCompound.setInteger(IBeamFrequency.BEAM_FREQUENCY_TAG, beamFrequency);
}
return tagCompound;
}