|
| 1 | +package me.anemoi.rendertools.modules; |
| 2 | + |
| 3 | +import cc.polyfrost.oneconfig.events.event.HudRenderEvent; |
| 4 | +import cc.polyfrost.oneconfig.libs.eventbus.Subscribe; |
| 5 | +import cc.polyfrost.oneconfig.renderer.RenderManager; |
| 6 | +import me.anemoi.rendertools.config.modules.TestConfig; |
| 7 | +import me.surge.animation.BoundedAnimation; |
| 8 | +import me.surge.animation.Easing; |
| 9 | +import net.minecraftforge.client.event.RenderWorldLastEvent; |
| 10 | +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; |
| 11 | +import org.lwjgl.input.Mouse; |
| 12 | + |
| 13 | +import java.awt.*; |
| 14 | + |
| 15 | +import static me.anemoi.rendertools.RenderTools.mc; |
| 16 | + |
| 17 | +public class TestModule { |
| 18 | + private BoundedAnimation anim = new BoundedAnimation(1, 500, 2000, false, Easing.CUBIC_IN_OUT); |
| 19 | + |
| 20 | + @SubscribeEvent |
| 21 | + public void onRenderWordl(RenderWorldLastEvent event) { |
| 22 | + if (mc.thePlayer == null || mc.theWorld == null || !TestConfig.toggled) return; |
| 23 | + anim.setState(true); |
| 24 | + |
| 25 | + //RenderUtilsNew.renderCircle(new Point3dD(mc.thePlayer.getPositionVector()), (float) anim.getAnimationFactor(), new Color(255, 0, 0, 255), event.partialTicks); |
| 26 | + |
| 27 | + } |
| 28 | + |
| 29 | + @Subscribe |
| 30 | + public void onRenderScreen(HudRenderEvent event) { |
| 31 | + if (mc.thePlayer == null || mc.theWorld == null || !TestConfig.toggled) return; |
| 32 | + RenderManager.setupAndDraw(l -> { |
| 33 | + anim.setState(true); |
| 34 | + RenderManager.drawRect(l, (float) anim.getAnimationFactor(), 10, 20, 20, new Color(255, 0, 0, 255).getRGB()); |
| 35 | + if (Mouse.isButtonDown(0)) { |
| 36 | + anim.resetToDefault(); |
| 37 | + } |
| 38 | + }); |
| 39 | + } |
| 40 | +} |
0 commit comments