Preserve getOrCreateStack

This commit is contained in:
VoidLeech 2024-07-05 01:08:44 +02:00
parent d67f345146
commit a6f5c51d6a
No known key found for this signature in database

View file

@ -158,7 +158,7 @@ public class BacktankBlock extends HorizontalKineticBlock
ItemStack stack = new ItemStack(item);
Optional<BacktankBlockEntity> blockEntityOptional = getBlockEntityOptional(blockGetter, pos);
CompoundTag tag = blockEntityOptional.map(BacktankBlockEntity::getFullNbt).orElse(stack.getOrCreateTag());
CompoundTag tag = stack.getOrCreateTag().merge(blockEntityOptional.map(BacktankBlockEntity::getFullNbt).orElse(new CompoundTag()));
int air = blockEntityOptional.map(BacktankBlockEntity::getAirLevel)
.orElse(0);