aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/rosegoldaddons/features/CustomItemMacro.java
diff options
context:
space:
mode:
authorRoseGoldIsntGay <yoavkau@gmail.com>2022-02-04 14:17:32 +0200
committerRoseGoldIsntGay <yoavkau@gmail.com>2022-02-04 14:17:32 +0200
commit20894963147ef84a7ad7d578191de69a856f6403 (patch)
tree34bf1488f2042630c595f557543d324510bd1429 /src/main/java/rosegoldaddons/features/CustomItemMacro.java
parentf4b58abbda168b01513a5ac2ba2870bc00df7074 (diff)
downloadRGA-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.java6
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();
}