aboutsummaryrefslogtreecommitdiff
path: root/src/main/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
parentf4b58abbda168b01513a5ac2ba2870bc00df7074 (diff)
downloadRGA-20894963147ef84a7ad7d578191de69a856f6403.tar.gz
RGA-20894963147ef84a7ad7d578191de69a856f6403.tar.bz2
RGA-20894963147ef84a7ad7d578191de69a856f6403.zip
2.7.1
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/rosegoldaddons/Config.java42
-rw-r--r--src/main/java/rosegoldaddons/Main.java148
-rw-r--r--src/main/java/rosegoldaddons/OpenSettings.java3
-rw-r--r--src/main/java/rosegoldaddons/features/AutoGhostBlock.java143
-rw-r--r--src/main/java/rosegoldaddons/features/CanePlanter.java78
-rw-r--r--src/main/java/rosegoldaddons/features/CustomItemMacro.java6
-rw-r--r--src/main/java/rosegoldaddons/features/EndermanMacro.java22
-rw-r--r--src/main/java/rosegoldaddons/features/EntityReach.java1
-rw-r--r--src/main/java/rosegoldaddons/features/ForagingIslandMacro.java23
-rw-r--r--src/main/java/rosegoldaddons/features/GemstoneAura.java19
-rw-r--r--src/main/java/rosegoldaddons/features/HardstoneAura.java77
-rw-r--r--src/main/java/rosegoldaddons/features/MithrilMacro.java34
-rw-r--r--src/main/java/rosegoldaddons/features/MithrilNuker.java10
-rw-r--r--src/main/java/rosegoldaddons/features/PowderMacro.java8
-rw-r--r--src/main/java/rosegoldaddons/features/SexAura.java20
-rw-r--r--src/main/java/rosegoldaddons/mixins/MixinRenderString.java90
-rw-r--r--src/main/java/rosegoldaddons/mixins/MixinRendererLivingEntity.java53
-rw-r--r--src/main/java/rosegoldaddons/utils/RotationUtils.java115
-rw-r--r--src/main/java/rosegoldaddons/utils/ScoreboardUtils.java22
-rw-r--r--src/main/java/rosegoldaddons/utils/ShadyRotation.java118
20 files changed, 658 insertions, 374 deletions
diff --git a/src/main/java/rosegoldaddons/Config.java b/src/main/java/rosegoldaddons/Config.java
index f3394e1..2886ec2 100644
--- a/src/main/java/rosegoldaddons/Config.java
+++ b/src/main/java/rosegoldaddons/Config.java
@@ -13,7 +13,23 @@ public class Config extends Vigilant {
@Property(type = PropertyType.SWITCH, name = "Auto Start Dungeon + Ready", description = "Automatically starts the dungeon and gets ready.",
category = "Dungeons", subcategory = "General")
- public boolean AutoReady = true;
+ public boolean AutoReady = false;
+
+ @Property(type = PropertyType.SELECTOR, name = "Auto Ghost Block", description = "Choose which mode auto ghost block will follow",
+ category = "Dungeons", subcategory = "General", options = {"While Held", "On Press"})
+ public int ghostIndex = 0;
+
+ @Property(type = PropertyType.SWITCH, name = "Auto Ghost Block Stairs", description = "Automatically ghost block stairs you are standing on when you sneak",
+ category = "Dungeons", subcategory = "General")
+ public boolean AutoGB = false;
+
+ @Property(type = PropertyType.SWITCH, name = "Add Flipped Stairs", description = "Ghost Block upside-down stair when jumped into",
+ category = "Dungeons", subcategory = "General")
+ public boolean AutoGBTopStair = false;
+
+ @Property(type = PropertyType.SWITCH, name = "Add Misc. Blocks", description = "Adds other phase-able blocks to Auto Ghost Block",
+ category = "Dungeons", subcategory = "General")
+ public boolean AutoGBMisc = false;
public boolean autoArrowAlign = true;
@@ -41,9 +57,9 @@ public class Config extends Vigilant {
category = "RoseGoldAddons", subcategory = "General", max = 2000)
public int swapFrequency = 500;
- @Property(type = PropertyType.SLIDER, name = "Smooth Look Velocity", description = "How fast should head rotation changes be (in miliseconds)",
- category = "RoseGoldAddons", subcategory = "General", min = 1, max = 200)
- public int smoothLookVelocity = 50;
+ @Property(type = PropertyType.SLIDER, name = "Smooth Look Velocity", description = "How fast should head rotation changes be (in ticks)",
+ category = "RoseGoldAddons", subcategory = "General", min = 1, max = 40)
+ public int smoothLookVelocity = 5;
@Property(type = PropertyType.SLIDER, name = "Macro Range", description = "Look for entities only in radius of the player, 0 = unlimited",
category = "RoseGoldAddons", subcategory = "General", max = 300)
@@ -75,7 +91,7 @@ public class Config extends Vigilant {
@Property(type = PropertyType.SWITCH, name = "Radomize Delay", description = "Add slight randomization to delay",
category = "Foraging", subcategory = "General")
- public boolean randomizeForaging = true;
+ public boolean randomizeForaging = false;
@Property(type = PropertyType.SWITCH, name = "Admin Antisus", description = "Act as if you're there when you get AFK checked (not recommended to leave on)",
category = "Foraging", subcategory = "General")
@@ -86,9 +102,13 @@ public class Config extends Vigilant {
public boolean prioblocks = false;
@Property(type = PropertyType.SLIDER, name = "Hardstone Nuker Height", description = "Range to break above the player",
- category = "Mining", subcategory = "General", max = 5)
+ category = "Mining", subcategory = "General",max = 5)
public int hardrange = 0;
+ @Property(type = PropertyType.SLIDER, name = "Hardstone Nuker Depth", description = "Range to break below the player",
+ category = "Mining", subcategory = "General",max = 3)
+ public int hardrangeDown = 0;
+
@Property(type = PropertyType.SELECTOR, name = "Hardstone Nuker Shape", description = "Choose which pattern hardstone nuker will follow",
category = "Mining", subcategory = "General", options = {"Closest Block", "Facing Axis"})
public int hardIndex = 0;
@@ -125,10 +145,18 @@ public class Config extends Vigilant {
category = "Mining", subcategory = "General")
public boolean ignoreTitanium = false;
- @Property(type = PropertyType.SWITCH, name = "Include Ores", description = "Hardstone & Mithril Nukers will also nuke ores",
+ @Property(type = PropertyType.SWITCH, name = "Include Ores", description = "Hardstone Nuker, Mithril Nuker and Mithril Macro will also target ores",
category = "Mining", subcategory = "General")
public boolean includeOres = false;
+ @Property(type = PropertyType.SWITCH, name = "Include Sand & Gravel", description = "Hardstone Nuker will also target sand and gravel",
+ category = "Mining", subcategory = "General")
+ public boolean includeExcavatable = false;
+
+ @Property(type = PropertyType.SWITCH, name = "Only Ores", description = "Mithril Macro will only target ores",
+ category = "Mining", subcategory = "General")
+ public boolean onlyOres = false;
+
@Property(type = PropertyType.SELECTOR, name = "Mithril Macro Priority", description = "Determine the order the macro will breaks blocks in",
category = "Mining", subcategory = "General", options = {"Highest value to lowest", "Lowest value to highest","Any"})
public int mithrilMacroPrio = 0;
diff --git a/src/main/java/rosegoldaddons/Main.java b/src/main/java/rosegoldaddons/Main.java
index 120e944..def14cd 100644
--- a/src/main/java/rosegoldaddons/Main.java
+++ b/src/main/java/rosegoldaddons/Main.java
@@ -1,6 +1,8 @@
package rosegoldaddons;
+import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
@@ -20,24 +22,17 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.InputEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
-import net.minecraftforge.fml.common.network.FMLNetworkEvent;
import org.lwjgl.input.Keyboard;
import rosegoldaddons.commands.*;
import rosegoldaddons.features.*;
-import rosegoldaddons.utils.ChatUtils;
-import rosegoldaddons.utils.OpenSkyblockGui;
-import rosegoldaddons.utils.PlayerUtils;
-import rosegoldaddons.utils.RotationUtils;
+import rosegoldaddons.utils.*;
import java.io.*;
import java.net.URL;
import java.net.URLConnection;
import java.nio.file.Files;
import java.nio.file.Paths;
-import java.util.Base64;
-import java.util.HashMap;
-import java.util.Objects;
-import java.util.Random;
+import java.util.*;
@Mod(modid = "timechanger", name = "RoseGoldAddons", version = "2.1")
public class Main {
@@ -64,14 +59,20 @@ public class Main {
private static boolean oldanim = false;
public static boolean init = false;
public static boolean mithrilMacro = false;
+ private boolean issue = false;
public static final Minecraft mc = Minecraft.getMinecraft();
+ public static JsonObject rga;
- //Hello decompiler and / or source code checker! this is just some funny stuff, you do not have to worry about it!
+ String info = "Hello decompiler! this is just some funny stuff, you do not have to worry about it!";
private String[] cumsters = null;
private String[] ILILILLILILLILILILL = null;
- public static HashMap<String, String> resp = new HashMap<>();
+ public static HashMap<String, String> nameCache = new HashMap<>();
+ public static HashMap<String, String> rankCache = new HashMap<>();
+ public static ArrayList<String> hashedCache = new ArrayList<>();
+ public static HashMap<String, String> names = new HashMap<>();
+ public static HashMap<String, String> ranks = new HashMap<>();
@Mod.EventHandler
public void onFMLInitialization(FMLPreInitializationEvent event) {
@@ -79,10 +80,18 @@ public class Main {
if (!directory.exists()) {
directory.mkdirs();
}
+
+ try {
+ rga = getJson("https://gist.githubusercontent.com/RoseGoldIsntGay/2d15ef10d53629455a40f5c027db1dfb/raw/").getAsJsonObject();
+ } catch (Exception e) {
+ e.printStackTrace();
+ issue = true;
+ }
}
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
+ if (issue) return;
MinecraftForge.EVENT_BUS.register(this);
MinecraftForge.EVENT_BUS.register(new AutoReady());
MinecraftForge.EVENT_BUS.register(new OpenSkyblockGui());
@@ -107,11 +116,11 @@ public class Main {
MinecraftForge.EVENT_BUS.register(new ForagingNuker());
MinecraftForge.EVENT_BUS.register(new AutoSlayer());
MinecraftForge.EVENT_BUS.register(new PlayerUtils());
- MinecraftForge.EVENT_BUS.register(new CanePlanter());
MinecraftForge.EVENT_BUS.register(new ArmorStandESPs());
MinecraftForge.EVENT_BUS.register(new PinglessMining());
MinecraftForge.EVENT_BUS.register(new MithrilMacro());
- MinecraftForge.EVENT_BUS.register(new RotationUtils());
+ MinecraftForge.EVENT_BUS.register(new AutoGhostBlock());
+ MinecraftForge.EVENT_BUS.register(new ShadyRotation());
configFile.initialize();
ClientCommandHandler.instance.registerCommand(new OpenSettings());
ClientCommandHandler.instance.registerCommand(new Rosedrobe());
@@ -122,22 +131,42 @@ public class Main {
ClientCommandHandler.instance.registerCommand(new AllEntities());
ClientCommandHandler.instance.registerCommand(new SexPlayer());
- String[] temp = getUrlContents("https://gist.github.com/RoseGoldIsntGay/6fa79111ae8efe3f5d269a095d748aa5/raw").split("\n");
- for(String str : temp) {
- if(str.contains(":")) {
- resp.put(str.substring(0, str.indexOf(":")), str.substring(str.indexOf(": ") + 2).replace("&", "§"));
- } else {
- System.out.println(str);
- }
+ JsonArray funnynames = rga.get("funnynames").getAsJsonArray();
+ cumsters = new String[funnynames.size()];
+ Iterator<JsonElement> fn = funnynames.iterator();
+ int count = 0;
+ while(fn.hasNext()) {
+ JsonElement name = fn.next();
+ cumsters[count] = name.getAsString();
+ count++;
}
- init = true;
-
- cumsters = getUrlContents("https://gist.githubusercontent.com/RoseGoldIsntGay/14108940b5c97d01de20213e567b7b9c/raw/").split("\n");
- ILILILLILILLILILILL = getUrlContents("https://gist.githubusercontent.com/RoseGoldIsntGay/2534fa591573120a5f71bbca2ccf0af2/raw/").split("\n");
- for(String str : ILILILLILILLILILILL) {
- System.out.println(str);
+ JsonArray funnymessages = rga.get("funnymessages").getAsJsonArray();
+ ILILILLILILLILILILL = new String[funnymessages.size()];
+ Iterator<JsonElement> fm = funnymessages.iterator();
+ count = 0;
+ while(fm.hasNext()) {
+ JsonElement message = fm.next();
+ ILILILLILILLILILILL[count] = message.getAsString();
+ count++;
}
+ JsonObject replacions = rga.get("replacions").getAsJsonObject();
+ Set<Map.Entry<String, JsonElement>> set = replacions.entrySet();
+
+ set.forEach(stringJsonElementEntry -> {
+ names.put(stringJsonElementEntry.getKey(), stringJsonElementEntry.getValue().getAsString().replace("&", "§"));
+ System.out.println(stringJsonElementEntry.getKey()+": "+stringJsonElementEntry.getValue().getAsString().replace("&", "§"));
+ });
+
+ replacions = rga.get("ranks").getAsJsonObject();
+ set = replacions.entrySet();
+
+ set.forEach(stringJsonElementEntry -> {
+ ranks.put(stringJsonElementEntry.getKey(), stringJsonElementEntry.getValue().getAsString().replace("&", "§"));
+ System.out.println(stringJsonElementEntry.getKey()+": "+stringJsonElementEntry.getValue().getAsString().replace("&", "§"));
+ });
+ init = true;
+
try {
Reader reader = Files.newBufferedReader(Paths.get("./config/rosegoldaddons/rcmacros.json"));
int data = reader.read();
@@ -146,9 +175,7 @@ public class Main {
str += (char) data;
data = reader.read();
}
- str = str.replace("\"","");
- str = str.replace("{","");
- str = str.replace("}","");
+ str = str.replace("\"","").replace("{","").replace("}","");
String[] arr = str.split(",");
for(int i = 0; i < arr.length; i++) {
String[] arr2 = arr[i].split(":");
@@ -163,9 +190,7 @@ public class Main {
str2 += (char) data2;
data2 = reader.read();
}
- str2 = str2.replace("\"","");
- str2 = str2.replace("{","");
- str2 = str2.replace("}","");
+ str2 = str2.replace("\"","").replace("{","").replace("}","");
String[] arr3 = str2.split(",");
for(int i = 0; i < arr3.length; i++) {
String[] arr4 = arr3[i].split(":");
@@ -211,58 +236,41 @@ public class Main {
});
}
-
- @SubscribeEvent
- public void onConnect(FMLNetworkEvent.ClientConnectedToServerEvent event) {
- if(firstLoginThisSession) {
- new Thread(() -> {
- try {
- Thread.sleep(4000);
- ChatComponentText msg1 = new ChatComponentText("§0§7Thanks to ShadyAddons:§b https://cheatersgetbanned.me");
- msg1.setChatStyle(ChatUtils.createClickStyle(ClickEvent.Action.OPEN_URL, "https://cheatersgetbanned.me"));
- ChatComponentText msg2 = new ChatComponentText("§0§7Thanks to Harry282 (SBClient):§b https://github.com/Harry282/Skyblock-Client");
- msg2.setChatStyle(ChatUtils.createClickStyle(ClickEvent.Action.OPEN_URL, "https://github.com/Harry282/Skyblock-Client"));
- ChatComponentText msg3 = new ChatComponentText("§0§7Thanks to pizza boy (Pizza Client):§b https://github.com/PizzaboiBestLegit/Pizza-Client");
- msg3.setChatStyle(ChatUtils.createClickStyle(ClickEvent.Action.OPEN_URL, "https://github.com/PizzaboiBestLegit/Pizza-Client"));
- ChatComponentText msg4 = new ChatComponentText("§0§7Check out the RoseGoldAddons §bDiscord Server!");
- msg4.setChatStyle(ChatUtils.createClickStyle(ClickEvent.Action.OPEN_URL, "https://discord.gg/Tmk2hwzdxm"));
- mc.thePlayer.addChatMessage(msg1);
- mc.thePlayer.addChatMessage(msg2);
- mc.thePlayer.addChatMessage(msg3);
- mc.thePlayer.addChatMessage(msg4);
- firstLoginThisSession = false;
- } catch (Exception e) {
- e.printStackTrace();
- }
- }).start();
- }
- if(oldanim) {
- new Thread(() -> {
- try {
- Thread.sleep(6000);
- ChatUtils.sendMessage("§l§4Old Animations Mod was detected in your mods folder. This mod breaks some key RoseGoldAddons features, please uninstall it before asking for support as it is known to cause a lot of issues. Thanks.");
- } catch (Exception e) {
- e.printStackTrace();
- }
- }).start();
- }
- }
-
@SubscribeEvent
public void onWorldChange(WorldEvent.Unload event) {
- if(forageOnIsland || nukeWood || nukeCrops || mithrilNuker || gemNukeToggle) {
+ if(forageOnIsland || nukeWood || nukeCrops || mithrilNuker || gemNukeToggle || mithrilMacro) {
ChatUtils.sendMessage("§cDetected World Change, Stopping All Macros");
forageOnIsland = false;
nukeWood = false;
nukeCrops = false;
mithrilNuker = false;
gemNukeToggle = false;
+ mithrilMacro = false;
}
}
@SubscribeEvent
public void tick(TickEvent.ClientTickEvent event) {
if (event.phase != TickEvent.Phase.START) return;
+ if(mc.thePlayer == null || mc.theWorld == null) return;
+ if(firstLoginThisSession) {
+ ChatComponentText msg1 = new ChatComponentText("§0§7Thanks to ShadyAddons:§b https://cheatersgetbanned.me");
+ msg1.setChatStyle(ChatUtils.createClickStyle(ClickEvent.Action.OPEN_URL, "https://cheatersgetbanned.me"));
+ ChatComponentText msg2 = new ChatComponentText("§0§7Thanks to Harry282 (SBClient):§b https://github.com/Harry282/Skyblock-Client");
+ msg2.setChatStyle(ChatUtils.createClickStyle(ClickEvent.Action.OPEN_URL, "https://github.com/Harry282/Skyblock-Client"));
+ ChatComponentText msg3 = new ChatComponentText("§0§7Thanks to pizza boy (Pizza Client):§b https://github.com/PizzaboiBestLegit/Pizza-Client");
+ msg3.setChatStyle(ChatUtils.createClickStyle(ClickEvent.Action.OPEN_URL, "https://github.com/PizzaboiBestLegit/Pizza-Client"));
+ ChatComponentText msg4 = new ChatComponentText("§0§7Check out the RoseGoldAddons §bDiscord Server!");
+ msg4.setChatStyle(ChatUtils.createClickStyle(ClickEvent.Action.OPEN_URL, "https://discord.gg/Tmk2hwzdxm"));
+ mc.thePlayer.addChatMessage(msg1);
+ mc.thePlayer.addChatMessage(msg2);
+ mc.thePlayer.addChatMessage(msg3);
+ mc.thePlayer.addChatMessage(msg4);
+ if(oldanim) {
+ ChatUtils.sendMessage("§l§4Old Animations Mod was detected in your mods folder. This mod breaks some key RoseGoldAddons features, please uninstall it before asking for support as it is known to cause a lot of issues. Thanks.");
+ }
+ firstLoginThisSession = false;
+ }
if(mc.gameSettings.limitFramerate == 1) {
mc.gameSettings.setOptionFloatValue(GameSettings.Options.FRAMERATE_LIMIT, 260.0F);
}
diff --git a/src/main/java/rosegoldaddons/OpenSettings.java b/src/main/java/rosegoldaddons/OpenSettings.java
index 0e79b74..73a562d 100644
--- a/src/main/java/rosegoldaddons/OpenSettings.java
+++ b/src/main/java/rosegoldaddons/OpenSettings.java
@@ -28,10 +28,7 @@ public class OpenSettings implements ICommand {
@Override
public void processCommand(ICommandSender sender, String[] args) {
- /*EntityPlayerSP player = (EntityPlayerSP) sender;
- player.addChatMessage(new ChatComponentText("hi "+player.getName()+"!"));*/
Main.display = Main.configFile.gui();
- return;
}
@Override
diff --git a/src/main/java/rosegoldaddons/features/AutoGhostBlock.java b/src/main/java/rosegoldaddons/features/AutoGhostBlock.java
new file mode 100644
index 0000000..76ca185
--- /dev/null
+++ b/src/main/java/rosegoldaddons/features/AutoGhostBlock.java
@@ -0,0 +1,143 @@
+package rosegoldaddons.features;
+
+import net.minecraft.block.state.BlockState;
+import net.minecraft.block.state.IBlockState;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.settings.KeyBinding;
+import net.minecraft.init.Blocks;
+import net.minecraft.util.BlockPos;
+import net.minecraft.util.Vec3;
+import net.minecraft.util.Vec3i;
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
+import net.minecraftforge.fml.common.gameevent.InputEvent;
+import net.minecraftforge.fml.common.gameevent.TickEvent;
+import rosegoldaddons.Main;
+
+public class AutoGhostBlock {
+ private final KeyBinding sneakBind = Minecraft.getMinecraft().gameSettings.keyBindSneak;
+ private final KeyBinding jumpBind = Minecraft.getMinecraft().gameSettings.keyBindJump;
+
+ @SubscribeEvent
+ public void onPlayerTick(TickEvent.PlayerTickEvent event) {
+ if(Main.mc.thePlayer == null || Main.mc.theWorld == null) return;
+ if(Main.configFile.ghostIndex == 0) {
+ if (!Main.configFile.AutoGB || !Main.configFile.AutoGBTopStair) return;
+ if (sneakBind.isKeyDown() && Main.configFile.AutoGB) {
+ BlockPos playerPos = Main.mc.thePlayer.getPosition();
+ Vec3 playerVec = Main.mc.thePlayer.getPositionVector();
+ Vec3i vec3i = new Vec3i(3, 1, 3);
+ Vec3i vec3i2 = new Vec3i(3, 2, 3);
+ for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i2))) {
+ double diffX = Math.abs(blockPos.getX() + 0.5D - playerVec.xCoord);
+ double diffZ = Math.abs(blockPos.getZ() + 0.5D - playerVec.zCoord);
+ double diffY = blockPos.getY() - playerVec.yCoord;
+ if (diffX < 1 && diffZ < 1) {
+ IBlockState blockState = Main.mc.theWorld.getBlockState(blockPos);
+ if (isStair(blockState) && diffY == -0.5) {
+ Main.mc.theWorld.setBlockToAir(blockPos);
+ }
+ if (Main.configFile.AutoGBMisc) {
+ if (blockState.getBlock() == Blocks.skull && diffY == 0 && diffX < 0.5 && diffZ < 0.5) {
+ Main.mc.theWorld.setBlockToAir(blockPos);
+ } else if (blockState.getBlock() == Blocks.hopper && diffY == -0.625) {
+ Main.mc.theWorld.setBlockToAir(blockPos);
+ } else if (isFence(blockState) && diffY <= 0 && diffX < 0.5 && diffZ < 0.5) {
+ Main.mc.theWorld.setBlockToAir(blockPos);
+ }
+ }
+ }
+ }
+ }
+ }
+ if(jumpBind.isKeyDown() && Main.configFile.AutoGBTopStair) {
+ BlockPos playerPos = Main.mc.thePlayer.getPosition();
+ Vec3 playerVec = Main.mc.thePlayer.getPositionVector();
+ Vec3i vec3i = new Vec3i(3, 2, 3);
+ Vec3i vec3i2 = new Vec3i(3, 0, 3);
+ for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i2))) {
+ double diffX = Math.abs(blockPos.getX() + 0.5D - playerVec.xCoord);
+ double diffZ = Math.abs(blockPos.getZ() + 0.5D - playerVec.zCoord);
+ double diffY = blockPos.getY() - playerVec.yCoord;
+ if(diffX < 1 && diffZ < 1) {
+ IBlockState blockState = Main.mc.theWorld.getBlockState(blockPos);
+ if(isStair(blockState) && diffY > 1.2 && diffY < 1.3) {
+ Main.mc.theWorld.setBlockToAir(blockPos);
+ }
+ }
+ }
+ }
+ }
+
+ @SubscribeEvent
+ public void onKeyPress(InputEvent.KeyInputEvent event) {
+ if(Main.mc.thePlayer == null || Main.mc.theWorld == null) return;
+ if(Main.configFile.ghostIndex == 0) return;
+ if(!Main.configFile.AutoGB || !Main.configFile.AutoGBTopStair) return;
+ if(sneakBind.isPressed() && Main.configFile.AutoGB) {
+ BlockPos playerPos = Main.mc.thePlayer.getPosition();
+ Vec3 playerVec = Main.mc.thePlayer.getPositionVector();
+ Vec3i vec3i = new Vec3i(3, 1, 3);
+ Vec3i vec3i2 = new Vec3i(3, 2, 3);
+ for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i2))) {
+ double diffX = Math.abs(blockPos.getX() + 0.5D - playerVec.xCoord);
+ double diffZ = Math.abs(blockPos.getZ() + 0.5D - playerVec.zCoord);
+ double diffY = blockPos.getY() - playerVec.yCoord;
+ if(diffX < 1 && diffZ < 1) {
+ IBlockState blockState = Main.mc.theWorld.getBlockState(blockPos);
+ if(isStair(blockState) && diffY == -0.5) {
+ Main.mc.theWorld.setBlockToAir(blockPos);
+ }
+ if(Main.configFile.AutoGBMisc) {
+ if(blockState.getBlock() == Blocks.skull && diffY == 0 && diffX < 0.5 && diffZ < 0.5) {
+ Main.mc.theWorld.setBlockToAir(blockPos);
+ }
+ else if(blockState.getBlock() == Blocks.hopper && diffY == -0.625) {
+ Main.mc.theWorld.setBlockToAir(blockPos);
+ }
+ else if(isFence(blockState) && diffY <= 0 && diffX < 0.5 && diffZ < 0.5) {
+ Main.mc.theWorld.setBlockToAir(blockPos);
+ }
+ }
+ }
+ }
+ }
+ if(jumpBind.isPressed() && Main.configFile.AutoGBTopStair) {
+ BlockPos playerPos = Main.mc.thePlayer.getPosition();
+ Vec3 playerVec = Main.mc.thePlayer.getPositionVector();
+ Vec3i vec3i = new Vec3i(3, 2, 3);
+ Vec3i vec3i2 = new Vec3i(3, 0, 3);
+ for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i2))) {
+ double diffX = Math.abs(blockPos.getX() + 0.5D - playerVec.xCoord);
+ double diffZ = Math.abs(blockPos.getZ() + 0.5D - playerVec.zCoord);
+ double diffY = blockPos.getY() - playerVec.yCoord;
+ if(diffX < 1 && diffZ < 1) {
+ IBlockState blockState = Main.mc.theWorld.getBlockState(blockPos);
+ if(isStair(blockState) && diffY > 1.2 && diffY < 1.3) {
+ Main.mc.theWorld.setBlockToAir(blockPos);
+ }
+ }
+ }
+ }
+ }
+
+ private boolean isStair(IBlockState blockState) {
+ if(blockState.getBlock() == Blocks.acacia_stairs || blockState.getBlock() == Blocks.birch_stairs ||
+ blockState.getBlock() == Blocks.brick_stairs || blockState.getBlock() == Blocks.stone_brick_stairs ||
+ blockState.getBlock() == Blocks.stone_stairs || blockState.getBlock() == Blocks.dark_oak_stairs ||
+ blockState.getBlock() == Blocks.jungle_stairs || blockState.getBlock() == Blocks.spruce_stairs ||
+ blockState.getBlock() == Blocks.red_sandstone_stairs || blockState.getBlock() == Blocks.sandstone_stairs ||
+ blockState.getBlock() == Blocks.nether_brick_stairs || blockState.getBlock() == Blocks.oak_stairs ||
+ blockState.getBlock() == Blocks.quartz_stairs)
+ return true;
+ return false;
+ }
+
+ private boolean isFence(IBlockState blockState) {
+ if(blockState.getBlock() == Blocks.acacia_fence || blockState.getBlock() == Blocks.birch_fence ||
+ blockState.getBlock() == Blocks.cobblestone_wall || blockState.getBlock() == Blocks.dark_oak_fence ||
+ blockState.getBlock() == Blocks.jungle_fence || blockState.getBlock() == Blocks.spruce_fence ||
+ blockState.getBlock() == Blocks.oak_fence || blockState.getBlock() == Blocks.nether_brick_fence)
+ return true;
+ return false;
+ }
+}
diff --git a/src/main/java/rosegoldaddons/features/CanePlanter.java b/src/main/java/rosegoldaddons/features/CanePlanter.java
deleted file mode 100644
index 5f656d9..0000000
--- a/src/main/java/rosegoldaddons/features/CanePlanter.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package rosegoldaddons.features;
-
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.client.Minecraft;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.BlockPos;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.Vec3;
-import net.minecraft.util.Vec3i;
-import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
-import net.minecraftforge.fml.common.gameevent.TickEvent;
-import rosegoldaddons.Main;
-
-import java.util.ArrayList;
-
-public class CanePlanter {
- //when you're down bad
- @SubscribeEvent
- public void onTick(TickEvent.ClientTickEvent event) {
- if (!Main.placeCane || event.phase == TickEvent.Phase.END) {
- return;
- }
- int cane = findItemInHotbar("Cane");
- BlockPos dirt = furthestEmptyDirt();
- if (cane != -1 && dirt != null) {
- ItemStack item = Main.mc.thePlayer.inventory.getStackInSlot(cane);
- Main.mc.thePlayer.inventory.currentItem = cane;
- Main.mc.playerController.onPlayerRightClick(Main.mc.thePlayer, Main.mc.theWorld, item, dirt, EnumFacing.UP, Main.mc.thePlayer.getLookVec());
- }
- }
-
- private BlockPos furthestEmptyDirt() {
- int r = 5;
- BlockPos playerPos = Main.mc.thePlayer.getPosition();
- playerPos.add(0, 1, 0);
- Vec3 playerVec = Main.mc.thePlayer.getPositionVector();
- Vec3i vec3i = new Vec3i(r, r, r);
- ArrayList<Vec3> dirts = new ArrayList<Vec3>();
- if (playerPos != null) {
- for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i))) {
- IBlockState blockState = Main.mc.theWorld.getBlockState(blockPos);
- IBlockState blockState2 = Main.mc.theWorld.getBlockState(blockPos.add(0, 1, 0));
- //Main.mc.thePlayer.addChatMessage(new ChatComponentText(blockState.getBlock().toString()));
- if (blockState.getBlock() == Blocks.dirt && blockState2.getBlock() == Blocks.air) {
- dirts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5));
- }
- }
- }
- double biggest = -1;
- Vec3 furthest = null;
- for (int i = 0; i < dirts.size(); i++) {
- double dist = dirts.get(i).distanceTo(playerVec);
- if (dist > biggest) {
- biggest = dist;
- furthest = dirts.get(i);
- }
- }
- if (furthest != null && biggest < 4) {
- return new BlockPos(furthest.xCoord, furthest.yCoord, furthest.zCoord);
- }
- return null;
- }
-
- private static int findItemInHotbar(String name) {
- InventoryPlayer inv = Main.mc.thePlayer.inventory;
- for (int i = 0; i < 9; i++) {
- ItemStack curStack = inv.getStackInSlot(i);
- if (curStack != null) {
- if (curStack.getDisplayName().contains(name)) {
- return i;
- }
- }
- }
- return -1;
- }
-}
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();
}
diff --git a/src/main/java/rosegoldaddons/features/EndermanMacro.java b/src/main/java/rosegoldaddons/features/EndermanMacro.java
index b0ff72a..c0f3c6a 100644
--- a/src/main/java/rosegoldaddons/features/EndermanMacro.java
+++ b/src/main/java/rosegoldaddons/features/EndermanMacro.java
@@ -1,14 +1,16 @@
package rosegoldaddons.features;
-import net.minecraft.client.Minecraft;
+import net.minecraft.client.network.NetHandlerPlayClient;
+import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntityEnderman;
+import net.minecraft.network.play.client.C0BPacketEntityAction;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import rosegoldaddons.Main;
import rosegoldaddons.utils.RenderUtils;
-import rosegoldaddons.utils.RotationUtils;
+import rosegoldaddons.utils.ShadyRotation;
import java.awt.*;
@@ -18,9 +20,21 @@ public class EndermanMacro {
@SubscribeEvent
public void onTick(TickEvent.ClientTickEvent event) {
if (!Main.configFile.EndermanESP && !Main.endermanMacro) return;
+ if(event.phase == TickEvent.Phase.END) return;
enderman = getClosestEnderman();
- if(enderman != null && Main.endermanMacro) {
- RotationUtils.faceEntity(enderman);
+ i