Skip to content

Commit

Permalink
Merge branch 'trunk/1.18' of github.com:Lothrazar/Cyclic into trunk/1…
Browse files Browse the repository at this point in the history
….19.2
  • Loading branch information
Lothrazar committed Nov 10, 2024
2 parents 15d468a + 3c99568 commit 20db4a1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/main/java/com/lothrazar/cyclic/event/EventRender.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,9 @@ else if (!stHere.isAir()) {
if (distance < LaserItem.RANGE_MAX) {
//first vector is FROM, second is TO
BlockHitResult miss = mc.level.clip(new ClipContext(cameraEyePosition, entityHitResultLocation, ClipContext.Block.VISUAL, ClipContext.Fluid.NONE, mc.player));
// BlockHitResult miss = BlockHitResult.miss(entityHitResultLocation, Direction.getNearest(cameraViewVector.x, cameraViewVector.y, cameraViewVector.z), new BlockPos(entityHitResultLocation));
if (miss.getType() == HitResult.Type.BLOCK) {
//we hit a wall, dont shoot thru walls
}
else {
//Render and Shoot
//Render and Shoot
if (miss.getType() != HitResult.Type.BLOCK) {
//dont shoot thru walls
RenderMiningLaser.renderLaser(event, player, mc.getFrameTime(), stack, InteractionHand.MAIN_HAND);
if (world.getGameTime() % 4 == 0) {
PacketRegistry.INSTANCE.sendToServer(new PacketEntityLaser(ehr.getEntity().getId(), false));
Expand All @@ -229,6 +226,10 @@ else if (!stHere.isAir()) {
}
}
}
else {
//we missed
RenderMiningLaser.renderLaser(event, player, mc.getFrameTime(), stack, InteractionHand.MAIN_HAND);
}
}
}
}
Expand Down

0 comments on commit 20db4a1

Please sign in to comment.