diff options
author | RoseGoldIsntGay <yoavkau@gmail.com> | 2022-02-04 14:17:32 +0200 |
---|---|---|
committer | RoseGoldIsntGay <yoavkau@gmail.com> | 2022-02-04 14:17:32 +0200 |
commit | 20894963147ef84a7ad7d578191de69a856f6403 (patch) | |
tree | 34bf1488f2042630c595f557543d324510bd1429 /src/main/java/rosegoldaddons/features/CustomItemMacro.java | |
parent | f4b58abbda168b01513a5ac2ba2870bc00df7074 (diff) | |
download | RGA-20894963147ef84a7ad7d578191de69a856f6403.tar.gz RGA-20894963147ef84a7ad7d578191de69a856f6403.tar.bz2 RGA-20894963147ef84a7ad7d578191de69a856f6403.zip |
2.7.1
Diffstat (limited to 'src/main/java/rosegoldaddons/features/CustomItemMacro.java')
-rw-r--r-- | src/main/java/rosegoldaddons/features/CustomItemMacro.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/rosegoldaddons/features/CustomItemMacro.java b/src/main/java/rosegoldaddons/features/CustomItemMacro.java index b776f86..37b4ce3 100644 --- a/src/main/java/rosegoldaddons/features/CustomItemMacro.java +++ b/src/main/java/rosegoldaddons/features/CustomItemMacro.java @@ -16,13 +16,16 @@ import java.lang.reflect.Method; public class CustomItemMacro { private Thread thread; private int milis = 0; + private boolean working = false; @SubscribeEvent - public void onRender(RenderWorldLastEvent event) { + public void onTick(TickEvent.ClientTickEvent event) { + if(event.phase == TickEvent.Phase.END || working) return; if (!Main.autoUseItems) return; if (thread == null || !thread.isAlive()) { thread = new Thread(() -> { try { + working = true; int prevItem = Main.mc.thePlayer.inventory.currentItem; for (String i : UseCooldown.RCitems.keySet()) { if (milis % Math.floor(UseCooldown.RCitems.get(i)/100) == 0) { @@ -46,6 +49,7 @@ public class CustomItemMacro { Main.mc.thePlayer.inventory.currentItem = prevItem; milis++; Thread.sleep(100); + working = false; } catch (Exception e) { e.printStackTrace(); } |