Skip to content

Commit d3d493d

Browse files
committed
Fix #962: Client crash when setting a barrel to use as replace-with item in an Exchange Gadget (from Building Gadgets 2)
1 parent 5847e58 commit d3d493d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/aztech/modern_industrialization/blocks/storage/AbstractStorageBlock.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
5656
protected ItemStack getStack(BlockEntity entity) {
5757
var storageBlockEntity = (AbstractStorageBlockEntity<?>) entity;
5858
ItemStack stack = new ItemStack(asItem());
59-
if (!storageBlockEntity.isEmpty() || storageBlockEntity.isLocked()) {
59+
if (storageBlockEntity != null && (!storageBlockEntity.isEmpty() || storageBlockEntity.isLocked())) {
6060
storageBlockEntity.saveToItem(stack, storageBlockEntity.getLevel().registryAccess());
6161
}
6262
return stack;

0 commit comments

Comments
 (0)