Skip to content

Commit

Permalink
detect open water properly
Browse files Browse the repository at this point in the history
- the detection of open water should start at 2 blocks below, not 1.
- update mod version to 0.10.1-SNAPSHOT
  • Loading branch information
Wudji committed Mar 20, 2024
1 parent 92e5686 commit 85f9e92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/troy/autofish/Autofish.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ private void detectOpenWater(FishingBobberEntity bobber){
int y = bobber.getBlockY();
int z = bobber.getBlockZ();
boolean flag = true;
for(int yi = -1; yi <= 2; yi++){
for(int yi = -2; yi <= 2; yi++){
if(!(BlockPos.stream(x - 2, y + yi, z - 2, x + 2, y + yi, z + 2).allMatch((blockPos ->
// every block is water
bobber.getEntityWorld().getBlockState(blockPos).getBlock() == Blocks.WATER
Expand Down

0 comments on commit 85f9e92

Please sign in to comment.