diff options
author | alemi <me@alemi.dev> | 2023-03-07 23:01:40 +0100 |
---|---|---|
committer | alemi <me@alemi.dev> | 2023-03-07 23:01:40 +0100 |
commit | 589ccc715fc918e8b80e645c9e13c337019c8c07 (patch) | |
tree | db0e01f58a6348bd3cf2a77b78259b6a06bb8287 /src/main | |
parent | e102e85f9b4253206926f8ba568c59862e18c57a (diff) |
feat: super crude and clearly original Chams impl
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/ftbsc/bscv/modules/vision/Chams.java | 32 |
1 files changed, 32 insertions, 0 deletions
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(); + } +} |