Skip to content

Commit

Permalink
fix for "VOID_AIR" showing up in BlockHitResult with Lithium is insta…
Browse files Browse the repository at this point in the history
…lled.
  • Loading branch information
sakura-ryoko committed Jun 23, 2024
1 parent 15f2c6f commit 2bc9841
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ private boolean renderVerifierOverlay(MinecraftClient mc, DrawContext drawContex
private void renderBlockInfoOverlay(RayTraceWrapper traceWrapper, MinecraftClient mc, DrawContext drawContext)
{
BlockState air = Blocks.AIR.getDefaultState();
BlockState voidAir = Blocks.VOID_AIR.getDefaultState();
World worldSchematic = SchematicWorldHandler.getSchematicWorld();
World worldClient = WorldUtils.getBestWorld(mc);
BlockPos pos = traceWrapper.getBlockHitResult().getBlockPos();
Expand Down Expand Up @@ -596,7 +597,7 @@ else if (hasInvSchematic)
}

// Not just a missing block
if (stateSchematic != stateClient && stateClient != air && stateSchematic != air)
if (stateSchematic != stateClient && stateClient != air && stateSchematic != air && stateSchematic != voidAir)
{
BlockMismatchInfo info = new BlockMismatchInfo(stateSchematic, stateClient);
this.getOverlayPosition(align, info.getTotalWidth(), info.getTotalHeight(), offY, invHeight, mc);
Expand Down Expand Up @@ -637,12 +638,13 @@ private void updateBlockInfoLines(RayTraceWrapper traceWrapper, MinecraftClient

BlockPos pos = traceWrapper.getBlockHitResult().getBlockPos();
BlockState stateClient = mc.world.getBlockState(pos);
BlockState voidAir = Blocks.VOID_AIR.getDefaultState();

World worldSchematic = SchematicWorldHandler.getSchematicWorld();
BlockState stateSchematic = worldSchematic.getBlockState(pos);
String ul = GuiBase.TXT_UNDERLINE;

if (stateSchematic != stateClient && stateClient.isAir() == false && stateSchematic.isAir() == false)
if (stateSchematic != stateClient && stateClient.isAir() == false && stateSchematic.isAir() == false && stateSchematic != voidAir)
{
this.blockInfoLines.add(ul + "Schematic:");
this.addBlockInfoLines(stateSchematic);
Expand Down

0 comments on commit 2bc9841

Please sign in to comment.