Skip to content

Commit

Permalink
Fix hidebehind suffocating in logs/trees (Fixes #17)
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmeow committed Apr 4, 2021
1 parent 9d07e8a commit 4562f38
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,17 @@ public boolean attackEntityAsMob(Entity entity) {
return flag;
}

@Override
public boolean isEntityInsideOpaqueBlock() {
if (this.noClip) {
return false;
} else {
float f1 = this.getWidth() * 0.8F;
AxisAlignedBB axisalignedbb = AxisAlignedBB.withSizeAtOrigin(f1, 0.1F, f1).offset(this.getPosX(), this.getPosYEye(), this.getPosZ());
return this.world.func_241457_a_(this, axisalignedbb, (state, pos) -> !state.isIn(BlockTags.LOGS) && state.isSuffocating(this.world, pos)).findAny().isPresent();
}
}

@Override
public Vector3d getAllowedMovement(Vector3d vec) {
return allowedMove(vec);
Expand Down

0 comments on commit 4562f38

Please sign in to comment.