aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/rosegoldaddons/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/rosegoldaddons/utils')
-rw-r--r--src/main/java/rosegoldaddons/utils/ChatUtils.java30
-rw-r--r--src/main/java/rosegoldaddons/utils/RotationUtils.java26
2 files changed, 53 insertions, 3 deletions
diff --git a/src/main/java/rosegoldaddons/utils/ChatUtils.java b/src/main/java/rosegoldaddons/utils/ChatUtils.java
new file mode 100644
index 0000000..4295c77
--- /dev/null
+++ b/src/main/java/rosegoldaddons/utils/ChatUtils.java
@@ -0,0 +1,30 @@
+package rosegoldaddons.utils;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.event.ClickEvent;
+import net.minecraft.event.HoverEvent;
+import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.ChatStyle;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.IChatComponent;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Iterator;
+import java.util.List;
+
+
+public class ChatUtils {
+
+ /* § */
+
+ public static void sendMessage(String message) {
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§f[§aRoseGoldAddons§f] "+message));
+ }
+
+ public static ChatStyle createClickStyle(ClickEvent.Action action, String value) {
+ ChatStyle style = new ChatStyle();
+ style.setChatClickEvent(new ClickEvent(action, value));
+ style.setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, (IChatComponent)new ChatComponentText(EnumChatFormatting.YELLOW + value)));
+ return style;
+ }
+}
diff --git a/src/main/java/rosegoldaddons/utils/RotationUtils.java b/src/main/java/rosegoldaddons/utils/RotationUtils.java
index fb4152a..bb899e5 100644
--- a/src/main/java/rosegoldaddons/utils/RotationUtils.java
+++ b/src/main/java/rosegoldaddons/utils/RotationUtils.java
@@ -1,6 +1,8 @@
package rosegoldaddons.utils;
import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.GuiChat;
+import net.minecraft.client.gui.GuiIngameMenu;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntityCreeper;
@@ -17,7 +19,13 @@ public class RotationUtils {
static boolean antiafking = false;
public static void antiAfk() {
- if(snek || Minecraft.getMinecraft().currentScreen != null) return;
+ if(Minecraft.getMinecraft().currentScreen != null) {
+ if (Minecraft.getMinecraft().currentScreen instanceof GuiIngameMenu || Minecraft.getMinecraft().currentScreen instanceof GuiChat) {}
+ else {
+ return;
+ }
+ }
+ if(snek) return;
KeyBinding right = Minecraft.getMinecraft().gameSettings.keyBindRight;
KeyBinding left = Minecraft.getMinecraft().gameSettings.keyBindLeft;
new Thread(() -> {
@@ -36,7 +44,13 @@ public class RotationUtils {
}
public static void shootEman() {
- if(snek || Minecraft.getMinecraft().currentScreen != null) return;
+ if(Minecraft.getMinecraft().currentScreen != null) {
+ if (Minecraft.getMinecraft().currentScreen instanceof GuiIngameMenu || Minecraft.getMinecraft().currentScreen instanceof GuiChat) {}
+ else {
+ return;
+ }
+ }
+ if(snek) return;
new Thread(() -> {
try {
snek = true;
@@ -55,7 +69,13 @@ public class RotationUtils {
}
public static void facePos(Vec3 vector) {
- if(working || Minecraft.getMinecraft().currentScreen != null) return;
+ if(Minecraft.getMinecraft().currentScreen != null) {
+ if (Minecraft.getMinecraft().currentScreen instanceof GuiIngameMenu || Minecraft.getMinecraft().currentScreen instanceof GuiChat) {}
+ else {
+ return;
+ }
+ }
+ if(working) return;
new Thread(() -> {
try {
working = true;