1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-08-29 08:42:17 +00:00

fix: correct cable with wired modem highlight

The right thing would be to fix Mixin, just like it is done in Forge, but I think that's enough for now
This commit is contained in:
Nikita Savyolov
2021-10-18 21:45:33 +03:00
parent 67b7cd7a14
commit 7a667b9028
2 changed files with 6 additions and 2 deletions

View File

@@ -44,7 +44,6 @@ import java.util.EnumSet;
import java.util.List;
import java.util.concurrent.TimeUnit;
import static dan200.computercraft.shared.ComputerCraftRegistry.ModBlocks;
import static dan200.computercraft.shared.ComputerCraftRegistry.init;
public final class ComputerCraft implements ModInitializer

View File

@@ -18,6 +18,7 @@ import net.minecraft.client.render.Camera;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.Entity;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.*;
import net.minecraft.util.shape.VoxelShape;
@@ -40,8 +41,12 @@ public final class CableHighlightRenderer
return false;
}
HitResult hitResult = MinecraftClient.getInstance().crosshairTarget;
Vec3d hitPos = hitResult != null ? hitResult.getPos() : new Vec3d( d, e, f );
VoxelShape shape = WorldUtil.isVecInside( CableShapes.getModemShape( state ),
new Vec3d( d, e, f ).subtract( pos.getX(),
hitPos.subtract( pos.getX(),
pos.getY(),
pos.getZ() ) ) ? CableShapes.getModemShape( state ) : CableShapes.getCableShape(
state );