Skip to content

Commit

Permalink
Deoptimize to allow more future edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Dec 11, 2024
1 parent d3677fa commit d90b312
Showing 1 changed file with 8 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,10 @@ private int registerRequiredFreeBlocks(SubscriptionConsumer blockSubscribers) {
new MovementBreakSafetyCheckSubscription(blockIndex, BlockSafetyData.BlockSafetyType.FALLING_AND_FLUIDS));
}

var blockDirection = direction.toSkyDirection();

var leftDirectionSide = blockDirection.leftSide();
var rightDirectionSide = blockDirection.rightSide();
blockSubscribers.subscribe(direction.offset(block),
new MovementBreakSafetyCheckSubscription(blockIndex, BlockSafetyData.BlockSafetyType.FLUIDS));
blockSubscribers.subscribe(leftDirectionSide.offset(block),
new MovementBreakSafetyCheckSubscription(blockIndex, BlockSafetyData.BlockSafetyType.FLUIDS));
blockSubscribers.subscribe(rightDirectionSide.offset(block),
new MovementBreakSafetyCheckSubscription(blockIndex, BlockSafetyData.BlockSafetyType.FLUIDS));
for (var skyDirection : SkyDirection.VALUES) {
blockSubscribers.subscribe(skyDirection.offset(block),
new MovementBreakSafetyCheckSubscription(blockIndex, BlockSafetyData.BlockSafetyType.FLUIDS));
}
}
}

Expand All @@ -181,17 +175,10 @@ private int registerRequiredFreeBlocks(SubscriptionConsumer blockSubscribers) {

// Require free blocks to fall into the target position
if (allowBlockActions) {
var blockDirection = direction.toSkyDirection();

var leftDirectionSide = blockDirection.leftSide();
var rightDirectionSide = blockDirection.rightSide();

blockSubscribers.subscribe(direction.offset(fallFree),
new MovementBreakSafetyCheckSubscription(fallOneBlockIndex, BlockSafetyData.BlockSafetyType.FLUIDS));
blockSubscribers.subscribe(leftDirectionSide.offset(fallFree),
new MovementBreakSafetyCheckSubscription(fallOneBlockIndex, BlockSafetyData.BlockSafetyType.FLUIDS));
blockSubscribers.subscribe(rightDirectionSide.offset(fallFree),
new MovementBreakSafetyCheckSubscription(fallOneBlockIndex, BlockSafetyData.BlockSafetyType.FLUIDS));
for (var skyDirection : SkyDirection.VALUES) {
blockSubscribers.subscribe(skyDirection.offset(fallFree),
new MovementBreakSafetyCheckSubscription(fallOneBlockIndex, BlockSafetyData.BlockSafetyType.FLUIDS));
}
}
}
case FALL_2 -> {
Expand Down

0 comments on commit d90b312

Please sign in to comment.