Skip to content

Commit

Permalink
bug: Fixed cannon welds not breaking when block is broken
Browse files Browse the repository at this point in the history
  • Loading branch information
rbasamoyai committed Dec 30, 2024
1 parent cd66055 commit 6c5350c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ and freedom tastes of reality..."* \
- Fixed Quick-Firing Breech accepting input from the sides
- Fixed some waterloggable blocks not becoming waterlogged when placed in water
- Fixed Rope Pulley integration making it unmovable in some cases (issue #719)
- Fixed cannon welds not breaking when block is broken

## [5.7.2] - 2024-12-18

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ default void onRemoveCannon(BlockState state, Level level, BlockPos pos, BlockSt
&& cBlock1.canConnectToSide(state1, opposite)
&& be1 instanceof IAutocannonBlockEntity cbe1) {
cbe1.cannonBehavior().setConnectedFace(opposite, false);
cbe1.cannonBehavior().setWelded(opposite, false);
be1.setChanged();
}
}
Expand All @@ -70,6 +71,7 @@ default void onRemoveCannon(BlockState state, Level level, BlockPos pos, BlockSt
&& cBlock2.canConnectToSide(state2, facing)
&& be2 instanceof IAutocannonBlockEntity cbe2) {
cbe2.cannonBehavior().setConnectedFace(facing, false);
cbe2.cannonBehavior().setWelded(facing, false);
be2.setChanged();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ default void onRemoveCannon(BlockState state, Level level, BlockPos pos, BlockSt
&& be1 instanceof IBigCannonBlockEntity cbe1
&& cBlock1.canConnectToSide(state1, opposite)) {
cbe1.cannonBehavior().setConnectedFace(opposite, false);
cbe1.cannonBehavior().setWelded(opposite, false);
if (cbe1 instanceof LayeredBigCannonBlockEntity layered) {
for (CannonCastShape layer : layered.getLayers().keySet()) {
layered.setLayerConnectedTo(opposite, layer, false);
Expand All @@ -101,6 +102,7 @@ default void onRemoveCannon(BlockState state, Level level, BlockPos pos, BlockSt
&& be2 instanceof IBigCannonBlockEntity cbe2
&& cBlock2.canConnectToSide(state2, facing)) {
cbe2.cannonBehavior().setConnectedFace(facing, false);
cbe2.cannonBehavior().setWelded(facing, false);
if (cbe2 instanceof LayeredBigCannonBlockEntity layered) {
for (CannonCastShape layer : layered.getLayers().keySet()) {
layered.setLayerConnectedTo(facing, layer, false);
Expand Down

0 comments on commit 6c5350c

Please sign in to comment.