Skip to content

Commit

Permalink
Fix Fabric crash on explosion, Closes #174
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Nov 19, 2024
1 parent 3c4fff5 commit 41b1935
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ org.gradle.daemon=false
org.gradle.caching=true

# Common dependencies
cyclopscore_version=1.25.1-627
cyclopscore_version=1.25.3-636
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
public class ChestWallFabric extends ChestWall {
public ChestWallFabric(Properties properties, ChestMaterial material) {
super(properties, material);
IBlockExplodedEvent.EVENT.register((blockState, level, blockPos, explosion, biConsumer) -> onBlockExplodedCommon(blockState, level, blockPos, explosion));
IBlockExplodedEvent.EVENT.register((blockState, level, blockPos, explosion, biConsumer) -> {
if (blockState.getBlock() == this) {
onBlockExplodedCommon(blockState, level, blockPos, explosion);
}
});
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
public class ColossalChestFabric extends ColossalChest {
public ColossalChestFabric(Properties properties, ChestMaterial material) {
super(properties, material, BlockEntityColossalChest::new);
IBlockExplodedEvent.EVENT.register((blockState, level, blockPos, explosion, biConsumer) -> onBlockExplodedCommon(blockState, level, blockPos, explosion));
IBlockExplodedEvent.EVENT.register((blockState, level, blockPos, explosion, biConsumer) -> {
if (blockState.getBlock() == this) {
onBlockExplodedCommon(blockState, level, blockPos, explosion);
}
});
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
public class InterfaceFabric extends Interface {
public InterfaceFabric(Properties properties, ChestMaterial material) {
super(properties, material, BlockEntityInterface::new);
IBlockExplodedEvent.EVENT.register((blockState, level, blockPos, explosion, biConsumer) -> onBlockExplodedCommon(blockState, level, blockPos, explosion));
IBlockExplodedEvent.EVENT.register((blockState, level, blockPos, explosion, biConsumer) -> {
if (blockState.getBlock() == this) {
onBlockExplodedCommon(blockState, level, blockPos, explosion);
}
});
}

@Override
Expand Down

0 comments on commit 41b1935

Please sign in to comment.