Skip to content

Commit

Permalink
fix: NPE due to passing null
Browse files Browse the repository at this point in the history
  • Loading branch information
2No2Name committed Jul 15, 2024
1 parent 0d17d72 commit 12d15f2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public void getSpread(World world, BlockPos pos, BlockState state, CallbackInfoR
byte blockIndex = indexFromDiamondXZOffset(pos, flowTargetPos, searchRadius);
BlockState flowTargetBlock = world.getBlockState(flowTargetPos);
blockStateCache[blockIndex] = flowTargetBlock;
if (this.canMaybeFlowIntoBlock(world, flowTargetBlock)) {
if (this.canMaybeFlowIntoBlock(world, flowTargetBlock, flowTargetPos)) {
if (onlyPossibleFlowDirection == null) {
onlyPossibleFlowDirection = flowDirection;
onlyBlockPos = flowTargetPos;
Expand Down Expand Up @@ -287,10 +287,10 @@ private void removeDirectionsWithoutHoleAccess(byte holeAccess, Map<Direction, F
* Fast check to eliminate some choices for the flow direction
*/
@Unique
private boolean canMaybeFlowIntoBlock(World world, BlockState blockState) {
private boolean canMaybeFlowIntoBlock(World world, BlockState blockState, BlockPos flowTargetPos) {
//TODO maybe use this in more places
//TODO maybe use the blockstate predicate system
return canFill(world, null, blockState, this.getStill());
return canFill(world, flowTargetPos, blockState, this.getStill());
}

@Unique
Expand Down

0 comments on commit 12d15f2

Please sign in to comment.