diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/render/ESP.java b/Client/src/main/java/de/com/baseband/client/feature/modules/render/ESP.java index 4f9cb49..2df1a77 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/modules/render/ESP.java +++ b/Client/src/main/java/de/com/baseband/client/feature/modules/render/ESP.java @@ -10,11 +10,11 @@ import de.com.baseband.client.registry.annotation.Range; import de.com.baseband.client.util.adapt.Marker; import de.com.baseband.client.util.render.Pixels; import de.com.baseband.client.util.render.RenderAdapter; -import net.minecraft.block.BlockAir; import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.Vec3d; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -37,9 +37,9 @@ public class ESP extends Feature { @Marker(0) public boolean highlight; - @Config("Highlight Air") + @Config("Highlight Nothing") @Gate(0) - public boolean hightlightAir; + public boolean hightlightNothing; @Config("Entities") public boolean entities; @@ -113,9 +113,11 @@ public class ESP extends Feature { } if(highlight) { - BlockPos pos = mc.objectMouseOver.getBlockPos(); - if(!(mc.world.getBlockState(pos).getBlock() instanceof BlockAir) || !hightlightAir) { - renderer.accept(mc.world.getBlockState(pos).getBoundingBox(mc.world, pos).offset(pos)); + if(mc.objectMouseOver != null) { + BlockPos pos = mc.objectMouseOver.getBlockPos(); + if (!(mc.objectMouseOver.typeOfHit == RayTraceResult.Type.MISS) || !hightlightNothing) { + renderer.accept(mc.world.getBlockState(pos).getBoundingBox(mc.world, pos).offset(pos)); + } } } }