From d209a8cf3c97488cf2bb09027b5be0fa09be2399 Mon Sep 17 00:00:00 2001 From: ThisIsALegitUsername Date: Wed, 11 Jan 2023 03:23:35 +0000 Subject: [PATCH] Major even optimizations. --- src/main/java/dev/resent/event/impl/EventKey.java | 13 ------------- .../dev/resent/module/impl/hud/ComboCounter.java | 8 +------- .../java/dev/resent/module/impl/hud/Freelook.java | 1 - src/main/java/net/minecraft/client/Minecraft.java | 5 ----- 4 files changed, 1 insertion(+), 26 deletions(-) delete mode 100644 src/main/java/dev/resent/event/impl/EventKey.java diff --git a/src/main/java/dev/resent/event/impl/EventKey.java b/src/main/java/dev/resent/event/impl/EventKey.java deleted file mode 100644 index 87705f7c..00000000 --- a/src/main/java/dev/resent/event/impl/EventKey.java +++ /dev/null @@ -1,13 +0,0 @@ -package dev.resent.event.impl; - -public class EventKey extends Event{ - public int key; - - public int getKey() { - return key; - } - - public EventKey(int key) { - this.key = key; - } -} diff --git a/src/main/java/dev/resent/module/impl/hud/ComboCounter.java b/src/main/java/dev/resent/module/impl/hud/ComboCounter.java index 98207a88..39dc1fa5 100644 --- a/src/main/java/dev/resent/module/impl/hud/ComboCounter.java +++ b/src/main/java/dev/resent/module/impl/hud/ComboCounter.java @@ -9,9 +9,8 @@ import net.minecraft.network.play.server.S19PacketEntityStatus; public class ComboCounter extends RenderModule { - private long lastAttack; public static boolean attacked = false; - public int combo = 0; + public static int combo = 0; public BooleanSetting tshadow = new BooleanSetting("Text Shadow", "", true); public ComboCounter() { @@ -21,7 +20,6 @@ public class ComboCounter extends RenderModule { Resent.INSTANCE.events().subscribe(EventAttack.class, event -> { if (this.isEnabled()) { attacked = true; - lastAttack = System.nanoTime(); } }); } @@ -43,10 +41,6 @@ public class ComboCounter extends RenderModule { @Override public void draw() { - if (mc.thePlayer.hurtTime > 3 || System.nanoTime() - lastAttack >= 3.0E9 && this.enabled) { - combo = 0; - } - mc.fontRendererObj.drawString(combo + " Combo", this.x + 2, this.y + 2, -1, tshadow.getValue()); } diff --git a/src/main/java/dev/resent/module/impl/hud/Freelook.java b/src/main/java/dev/resent/module/impl/hud/Freelook.java index df77063c..2015c7f5 100644 --- a/src/main/java/dev/resent/module/impl/hud/Freelook.java +++ b/src/main/java/dev/resent/module/impl/hud/Freelook.java @@ -1,7 +1,6 @@ package dev.resent.module.impl.hud; import dev.resent.Resent; -import dev.resent.event.impl.EventKey; import dev.resent.module.base.Category; import dev.resent.module.base.Mod; import dev.resent.util.misc.W; diff --git a/src/main/java/net/minecraft/client/Minecraft.java b/src/main/java/net/minecraft/client/Minecraft.java index cb7f3270..6661ecbd 100644 --- a/src/main/java/net/minecraft/client/Minecraft.java +++ b/src/main/java/net/minecraft/client/Minecraft.java @@ -23,8 +23,6 @@ import org.apache.commons.lang3.Validate; import com.google.common.collect.Lists; import dev.resent.Resent; -import dev.resent.event.impl.EventKey; -import dev.resent.module.base.ModManager; import dev.resent.ui.mods.ClickGUI; import dev.resent.util.misc.W; import net.lax1dude.eaglercraft.v1_8.Display; @@ -1327,9 +1325,6 @@ public class Minecraft implements IThreadListener { KeyBinding.onTick(k); } - EventKey event = new EventKey(k); - Resent.INSTANCE.events().post(event); - if (this.debugCrashKeyPressTime > 0L) { if (getSystemTime() - this.debugCrashKeyPressTime >= 6000L) { throw new ReportedException(new CrashReport("Manually triggered debug crash", new Throwable()));