feat: super crude and clearly original Chams impl

This commit is contained in:
əlemi 2023-03-07 23:01:40 +01:00
parent e102e85f9b
commit 589ccc715f
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -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();
}
}