Skip to content

Commit 8060883

Browse files
committed
Do not crash when placing field projectors with extended reach
Fixes #385
1 parent 5dcee83 commit 8060883

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/org/dave/compactmachines3/block/BlockFieldProjector.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, Entity
192192
Vec3d lookVec = placer.getLook(1.0f);
193193
Vec3d endVec = posVec.add(lookVec.scale(blockReachDistance));
194194
RayTraceResult trace = world.rayTraceBlocks(posVec, endVec);
195+
if(trace == null) {
196+
return;
197+
}
195198

196199
Vec3d hitPosition = trace.hitVec;
197200
hitPosition = hitPosition.subtract(new Vec3d(trace.getBlockPos()));

0 commit comments

Comments
 (0)