From 589ccc715fc918e8b80e645c9e13c337019c8c07 Mon Sep 17 00:00:00 2001 From: alemi Date: Tue, 7 Mar 2023 23:01:40 +0100 Subject: [PATCH] feat: super crude and clearly original Chams impl --- .../java/ftbsc/bscv/modules/vision/Chams.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/main/java/ftbsc/bscv/modules/vision/Chams.java diff --git a/src/main/java/ftbsc/bscv/modules/vision/Chams.java b/src/main/java/ftbsc/bscv/modules/vision/Chams.java new file mode 100644 index 0000000..81902f6 --- /dev/null +++ b/src/main/java/ftbsc/bscv/modules/vision/Chams.java @@ -0,0 +1,32 @@ +package ftbsc.bscv.modules.vision; + +import org.lwjgl.opengl.GL11; + +import com.google.auto.service.AutoService; +import com.mojang.blaze3d.platform.GlStateManager; + +import ftbsc.bscv.ICommons; +import ftbsc.bscv.api.ILoadable; +import ftbsc.bscv.modules.QuickModule; +import net.minecraftforge.client.event.RenderLivingEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; + +@AutoService(ILoadable.class) +public class Chams extends QuickModule implements ICommons { + + protected int getDefaultKey() { return UNBOUND; } + + @SubscribeEvent + public void onRenderLivingPre(RenderLivingEvent.Pre event) { + GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL); + GlStateManager._enablePolygonOffset(); + GlStateManager._polygonOffset(1.f, -1000000); + } + + @SubscribeEvent + public void onRenderLivingPre(RenderLivingEvent.Post event) { + GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL); + GlStateManager._polygonOffset(1.0F, 1000000); + GlStateManager._disablePolygonOffset(); + } +}