Strip raytracing for EntityLiving#hasLineOfSight
Co-authored-by: Paul Sauve <paul@technove.co>
This commit is contained in:
@@ -12,14 +12,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
ItemEntity entityitem = (ItemEntity) iterator.next();
|
||||
|
||||
if (entityitem.isMergable()) {
|
||||
+ // Paper Start - Fix items merging through walls
|
||||
+ if (this.level().paperConfig().fixes.fixItemsMergingThroughWalls) {
|
||||
+ net.minecraft.world.level.ClipContext rayTrace = new net.minecraft.world.level.ClipContext(this.position(), entityitem.position(),
|
||||
+ net.minecraft.world.level.ClipContext.Block.COLLIDER, net.minecraft.world.level.ClipContext.Fluid.NONE, this);
|
||||
+ net.minecraft.world.phys.BlockHitResult rayTraceResult = this.level().clip(rayTrace);
|
||||
+ if (rayTraceResult.getType() == net.minecraft.world.phys.HitResult.Type.BLOCK) continue;
|
||||
+ }
|
||||
+ // Paper End
|
||||
+ // Paper start - Fix items merging through walls
|
||||
+ if (this.level().clipDirect(this.position(), entityitem.position(),
|
||||
+ net.minecraft.world.phys.shapes.CollisionContext.of(this)) == net.minecraft.world.phys.HitResult.Type.BLOCK) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ // Paper end - Fix items merging through walls
|
||||
this.tryToMerge(entityitem);
|
||||
if (this.isRemoved()) {
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user