Skip to content

Commit

Permalink
fix: make machine manager a bit more stable by disabling line of sigh…
Browse files Browse the repository at this point in the history
…t check
  • Loading branch information
klikli-dev committed Jan 20, 2023
1 parent eaf7834 commit ae85987
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,17 @@ public void tick() {
//region Methods
public boolean canSeeTarget() {

ClipContext context = new ClipContext(this.entity.position(),
Math3DUtil.center(this.moveTarget.getBlockPos()), ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE,
this.entity);
BlockHitResult result = this.entity.level.clip(context);

if (result.getType() != BlockHitResult.Type.MISS) {
BlockPos sidePos = result.getBlockPos();
BlockPos pos = new BlockPos(result.getLocation());
return this.entity.level.isEmptyBlock(sidePos) || this.entity.level.isEmptyBlock(pos) ||
this.entity.level.getBlockEntity(pos) == this.entity.level.getBlockEntity(this.moveTarget.getBlockPos());
}
// ClipContext context = new ClipContext(this.entity.position(),
// Math3DUtil.center(this.moveTarget.getBlockPos()), ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE,
// this.entity);
// BlockHitResult result = this.entity.level.clip(context);
//
// if (result.getType() != BlockHitResult.Type.MISS) {
// BlockPos sidePos = result.getBlockPos();
// BlockPos pos = new BlockPos(result.getLocation());
// return this.entity.level.isEmptyBlock(sidePos) || this.entity.level.isEmptyBlock(pos) ||
// this.entity.level.getBlockEntity(pos) == this.entity.level.getBlockEntity(this.moveTarget.getBlockPos());
// }

return true;
}
Expand Down

0 comments on commit ae85987

Please sign in to comment.