Skip to content

Commit 5d6ce68

Browse files
committed
fix automata turtle may dig itself at specific position
fix #698
1 parent 12b1a37 commit 5d6ce68

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/de/srendi/advancedperipherals/common/util/fakeplayer/APFakePlayer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ public double getReachRange() {
167167
public Pair<Boolean, String> digBlock() {
168168
Level world = getLevel();
169169
HitResult hit = findHit(true, false);
170-
if (hit.getType() == HitResult.Type.MISS) {
170+
if (!(hit instanceof BlockHitResult blockHit) || hit.getType() == HitResult.Type.MISS) {
171171
return Pair.of(false, "Nothing to break");
172172
}
173-
BlockPos pos = new BlockPos(hit.getLocation());
173+
BlockPos pos = blockHit.getBlockPos();
174174
BlockState state = world.getBlockState(pos);
175175
Block block = state.getBlock();
176176

0 commit comments

Comments
 (0)