Add raytrace logic to the GuiOverlayDebugForge, so that the debug overlay can show the currently targetted block and liquid. (#5278)

This commit is contained in:
David Quintana authored and LexManos committed 2018-12-16 12:47:16 -08:00
1 parent e47a4ea514
commit 152836c907
2 files changed
+10

No files matched your search

@@ -52,6 +52,7 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StringUtils;
import net.minecraft.util.Util;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.RayTraceFluidMode;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.world.GameType;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
@@ -617,6 +618,7 @@ public class GuiIngameForge extends GuiIngame
if (this.mc.gameSettings.showDebugInfo && !pre(DEBUG))
{
debugOverlay.update();
listL.addAll(debugOverlay.getLeft());
listR.addAll(debugOverlay.getRight());
post(DEBUG);
@@ -832,6 +834,12 @@ public class GuiIngameForge extends GuiIngame
super(mc);
this.mc = mc;
}
public void update()
{
Entity entity = this.mc.getRenderViewEntity();
this.rayTraceBlock = entity.rayTrace(20.0D, 0.0F, RayTraceFluidMode.NEVER);
this.rayTraceFluid = entity.rayTrace(20.0D, 0.0F, RayTraceFluidMode.ALWAYS);
}
@Override protected void renderDebugInfoLeft(){}
@Override protected void renderDebugInfoRight(){}
private List<String> getLeft()