diff options
author | RoseGoldIsntGay <yoavkau@gmail.com> | 2022-01-20 04:18:11 +0200 |
---|---|---|
committer | RoseGoldIsntGay <yoavkau@gmail.com> | 2022-01-20 04:18:11 +0200 |
commit | e46e11ebf0cfc244e95ee5299bf3f362f029d24a (patch) | |
tree | bc82ee31931f84a2c56cb01eaabe25d1e5165c27 | |
parent | c3fd62c5c1cb96a4c80e09dff8e440fc1088e902 (diff) | |
download | RGA-e46e11ebf0cfc244e95ee5299bf3f362f029d24a.tar.gz RGA-e46e11ebf0cfc244e95ee5299bf3f362f029d24a.tar.bz2 RGA-e46e11ebf0cfc244e95ee5299bf3f362f029d24a.zip |
2.6.0
biggie
-rw-r--r-- | build.gradle | 2 | ||||
-rw-r--r-- | src/main/java/rosegoldaddons/Config.java | 6 | ||||
-rw-r--r-- | src/main/java/rosegoldaddons/Main.java | 30 | ||||
-rw-r--r-- | src/main/java/rosegoldaddons/features/AutoSlayer.java | 9 | ||||
-rw-r--r-- | src/main/java/rosegoldaddons/features/CropNuker.java | 335 | ||||
-rw-r--r-- | src/main/java/rosegoldaddons/features/DamagePerSecond.java | 12 | ||||
-rw-r--r-- | src/main/java/rosegoldaddons/features/SwordSwapping.java | 2 | ||||
-rw-r--r-- | src/main/java/rosegoldaddons/mixins/MixinRenderString.java | 34 | ||||
-rw-r--r-- | src/main/java/rosegoldaddons/mixins/MixinRendererLivingEntity.java | 6 | ||||
-rw-r--r-- | src/main/resources/mixins.rosegoldaddons.json | 3 |
10 files changed, 405 insertions, 34 deletions
diff --git a/build.gradle b/build.gradle index 22c097e..964d113 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ plugins { id "org.spongepowered.mixin" version "0.6-SNAPSHOT" } -version = "2.5.4" +version = "2.6.0" group = "rosegoldaddons" archivesBaseName = "RoseGoldAddons" diff --git a/src/main/java/rosegoldaddons/Config.java b/src/main/java/rosegoldaddons/Config.java index fb0866b..37f1675 100644 --- a/src/main/java/rosegoldaddons/Config.java +++ b/src/main/java/rosegoldaddons/Config.java @@ -89,7 +89,7 @@ public class Config extends Vigilant { category = "Mining", subcategory = "General", max = 5) public int hardrange = 0; - @Property(type = PropertyType.SELECTOR, name = "Hardstone Nuker Type", description = "Choose which pattern hardstone nuker will follow", + @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; @@ -113,6 +113,10 @@ public class Config extends Vigilant { category = "Farming", subcategory = "General", options = {"Any Crop Except Cane or Cactus", "Cane or Cactus", "Nether Wart", "Wheat", "Carrot", "Potato", "Pumpkin", "Melon", "Mushroom", "Cocoa"}) public int farmNukeIndex = 0; + @Property(type = PropertyType.SELECTOR, name = "Crop Nuker Shape", description = "Choose which pattern crop nuker will follow", + category = "Farming", subcategory = "General", options = {"Closest Block", "Facing Axis"}) + public int farmShapeIndex = 0; + @Property(type = PropertyType.SWITCH, name = "Look at nuked block", description = "Looks at currently nuked block to look less sus", category = "Mining", subcategory = "General") public boolean mithrilLook = false; diff --git a/src/main/java/rosegoldaddons/Main.java b/src/main/java/rosegoldaddons/Main.java index 47d7752..495114b 100644 --- a/src/main/java/rosegoldaddons/Main.java +++ b/src/main/java/rosegoldaddons/Main.java @@ -1,5 +1,8 @@ package rosegoldaddons; +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; import net.minecraft.client.settings.GameSettings; @@ -32,6 +35,8 @@ 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; @Mod(modid = "timechanger", name = "RoseGoldAddons", version = "2.1") @@ -57,10 +62,12 @@ public class Main { public static boolean placeCane = false; private static boolean firstLoginThisSession = true; private static boolean oldanim = false; + public static boolean init = false; //Hello decompiler and / or source code checker! 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<>(); @Mod.EventHandler @@ -99,6 +106,7 @@ public class Main { MinecraftForge.EVENT_BUS.register(new PlayerUtils()); MinecraftForge.EVENT_BUS.register(new CanePlanter()); MinecraftForge.EVENT_BUS.register(new ArmorStandESPs()); + MinecraftForge.EVENT_BUS.register(new DamagePerSecond()); configFile.initialize(); ClientCommandHandler.instance.registerCommand(new OpenSettings()); ClientCommandHandler.instance.registerCommand(new Rosedrobe()); @@ -109,6 +117,12 @@ 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) { + resp.put(str.substring(0, str.indexOf(":")), str.substring(str.indexOf(": ") + 2)); + } + 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) { @@ -339,6 +353,22 @@ public class Main { return str; } + public static JsonElement getJson(String jsonUrl) { + return (new JsonParser()).parse(Objects.requireNonNull(getInputStream(jsonUrl))); + } + + public static InputStreamReader getInputStream(String url) { + try { + URLConnection conn = (new URL(url)).openConnection(); + conn.setRequestProperty("User-Agent", "Mozilla/5.0"); + return new InputStreamReader(conn.getInputStream()); + } catch (Exception var2) { + var2.printStackTrace(); + return null; + } + } + + private static String getUrlContents(String theUrl) { StringBuilder content = new StringBuilder(); diff --git a/src/main/java/rosegoldaddons/features/AutoSlayer.java b/src/main/java/rosegoldaddons/features/AutoSlayer.java index 839e238..bcea552 100644 --- a/src/main/java/rosegoldaddons/features/AutoSlayer.java +++ b/src/main/java/rosegoldaddons/features/AutoSlayer.java @@ -11,12 +11,10 @@ import net.minecraft.util.IChatComponent; import net.minecraft.util.StringUtils; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.GuiScreenEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.InputEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import rosegoldaddons.Main; -import rosegoldaddons.utils.ChatUtils; import rosegoldaddons.utils.ScoreboardUtils; import java.util.List; @@ -126,28 +124,21 @@ public class AutoSlayer { Container container = ((GuiChest) event.gui).inventorySlots; if (container instanceof ContainerChest) { String chestName = ((ContainerChest) container).getLowerChestInventory().getDisplayName().getUnformattedText(); - ChatUtils.sendMessage(chestName); if (chestName.contains("Slayer")) { - ChatUtils.sendMessage(slayerSlot +" "+slotLevel); List<Slot> chestInventory = ((GuiChest) Minecraft.getMinecraft().currentScreen).inventorySlots.inventorySlots; if (!chestInventory.get(13).getHasStack()) return; if (chestInventory.get(13).getStack().getDisplayName().contains("Ongoing")) { } else if (chestInventory.get(13).getStack().getDisplayName().contains("Complete")) { - ChatUtils.sendMessage("will now commence clicks"); clickSlot(13, 2, 0); clickSlot(slayerSlot, 2, 1); clickSlot(slotLevel, 2, 2); clickSlot(11, 2, 3); //confirm - ChatUtils.sendMessage("clicked"); } else { - ChatUtils.sendMessage("will now commence clicks"); clickSlot(slayerSlot, 2, 0); clickSlot(slotLevel, 2, 1); clickSlot(11, 2, 2); //confirm - ChatUtils.sendMessage("clicked"); } - ChatUtils.sendMessage("resetting variables"); slayerSlot = 0; slotLevel = 0; startSlayer = false; diff --git a/src/main/java/rosegoldaddons/features/CropNuker.java b/src/main/java/rosegoldaddons/features/CropNuker.java index f4dc4e6..208dbd0 100644 --- a/src/main/java/rosegoldaddons/features/CropNuker.java +++ b/src/main/java/rosegoldaddons/features/CropNuker.java @@ -13,18 +13,17 @@ import rosegoldaddons.utils.PlayerUtils; import java.util.ArrayList; public class CropNuker { - private static BlockPos crop; - private static ArrayList<BlockPos> broken = new ArrayList<>(); + private static final ArrayList<BlockPos> broken = new ArrayList<>(); private static int ticks = 0; @SubscribeEvent public void onTick(TickEvent.ClientTickEvent event) { - if(event.phase == TickEvent.Phase.END) return; + //if(event.phase == TickEvent.Phase.END) return; if (!Main.nukeCrops || Minecraft.getMinecraft().thePlayer == null) { broken.clear(); return; } - crop = closestCrop(); + BlockPos crop = closestCrop(); if (crop != null) { Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.START_DESTROY_BLOCK, crop, EnumFacing.DOWN)); PlayerUtils.swingItem(); @@ -47,8 +46,45 @@ public class CropNuker { for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i))) { IBlockState blockState = Minecraft.getMinecraft().theWorld.getBlockState(blockPos); if (blockState.getBlock() == Blocks.nether_wart || blockState.getBlock() == Blocks.potatoes || blockState.getBlock() == Blocks.wheat || blockState.getBlock() == Blocks.carrots || blockState.getBlock() == Blocks.pumpkin || blockState.getBlock() == Blocks.melon_block || blockState.getBlock() == Blocks.brown_mushroom || blockState.getBlock() == Blocks.red_mushroom || blockState.getBlock() == Blocks.cocoa) { - if (!broken.contains(blockPos)) { - warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + if(Main.configFile.hardIndex == 0) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + else if(Main.configFile.hardIndex == 1) { + EnumFacing dir = Minecraft.getMinecraft().thePlayer.getHorizontalFacing(); + int x = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posX); + int z = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posZ); + switch (dir) { + case NORTH: + if(blockPos.getZ() < z && blockPos.getX() == x) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case SOUTH: + if(blockPos.getZ() > z && blockPos.getX() == x) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case WEST: + if(blockPos.getX() < x && blockPos.getZ() == z) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case EAST: + if(blockPos.getX() > x && blockPos.getZ() == z) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + } } } } @@ -67,8 +103,45 @@ public class CropNuker { for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i))) { IBlockState blockState = Minecraft.getMinecraft().theWorld.getBlockState(blockPos); if (blockState.getBlock() == Blocks.nether_wart) { - if (!broken.contains(blockPos)) { - warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + if(Main.configFile.hardIndex == 0) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + else if(Main.configFile.hardIndex == 1) { + EnumFacing dir = Minecraft.getMinecraft().thePlayer.getHorizontalFacing(); + int x = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posX); + int z = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posZ); + switch (dir) { + case NORTH: + if(blockPos.getZ() < z && blockPos.getX() == x) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case SOUTH: + if(blockPos.getZ() > z && blockPos.getX() == x) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case WEST: + if(blockPos.getX() < x && blockPos.getZ() == z) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case EAST: + if(blockPos.getX() > x && blockPos.getZ() == z) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + } } } } @@ -77,8 +150,45 @@ public class CropNuker { for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i))) { IBlockState blockState = Minecraft.getMinecraft().theWorld.getBlockState(blockPos); if (blockState.getBlock() == Blocks.wheat) { - if (!broken.contains(blockPos)) { - warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + if(Main.configFile.hardIndex == 0) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + else if(Main.configFile.hardIndex == 1) { + EnumFacing dir = Minecraft.getMinecraft().thePlayer.getHorizontalFacing(); + int x = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posX); + int z = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posZ); + switch (dir) { + case NORTH: + if(blockPos.getZ() < z && blockPos.getX() == x) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case SOUTH: + if(blockPos.getZ() > z && blockPos.getX() == x) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case WEST: + if(blockPos.getX() < x && blockPos.getZ() == z) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case EAST: + if(blockPos.getX() > x && blockPos.getZ() == z) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + } } } } @@ -87,8 +197,45 @@ public class CropNuker { for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i))) { IBlockState blockState = Minecraft.getMinecraft().theWorld.getBlockState(blockPos); if (blockState.getBlock() == Blocks.carrots) { - if (!broken.contains(blockPos)) { - warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + if(Main.configFile.hardIndex == 0) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + else if(Main.configFile.hardIndex == 1) { + EnumFacing dir = Minecraft.getMinecraft().thePlayer.getHorizontalFacing(); + int x = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posX); + int z = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posZ); + switch (dir) { + case NORTH: + if(blockPos.getZ() < z && blockPos.getX() == x) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case SOUTH: + if(blockPos.getZ() > z && blockPos.getX() == x) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case WEST: + if(blockPos.getX() < x && blockPos.getZ() == z) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case EAST: + if(blockPos.getX() > x && blockPos.getZ() == z) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + } } } } @@ -97,8 +244,45 @@ public class CropNuker { for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i))) { IBlockState blockState = Minecraft.getMinecraft().theWorld.getBlockState(blockPos); if (blockState.getBlock() == Blocks.potatoes) { - if (!broken.contains(blockPos)) { - warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + if(Main.configFile.hardIndex == 0) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + else if(Main.configFile.hardIndex == 1) { + EnumFacing dir = Minecraft.getMinecraft().thePlayer.getHorizontalFacing(); + int x = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posX); + int z = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posZ); + switch (dir) { + case NORTH: + if(blockPos.getZ() < z && blockPos.getX() == x) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case SOUTH: + if(blockPos.getZ() > z && blockPos.getX() == x) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case WEST: + if(blockPos.getX() < x && blockPos.getZ() == z) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case EAST: + if(blockPos.getX() > x && blockPos.getZ() == z) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + } } } } @@ -107,8 +291,45 @@ public class CropNuker { for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i))) { IBlockState blockState = Minecraft.getMinecraft().theWorld.getBlockState(blockPos); if (blockState.getBlock() == Blocks.pumpkin) { - if (!broken.contains(blockPos)) { - warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + if(Main.configFile.hardIndex == 0) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + else if(Main.configFile.hardIndex == 1) { + EnumFacing dir = Minecraft.getMinecraft().thePlayer.getHorizontalFacing(); + int x = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posX); + int z = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posZ); + switch (dir) { + case NORTH: + if(blockPos.getZ() < z && blockPos.getX() == x) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case SOUTH: + if(blockPos.getZ() > z && blockPos.getX() == x) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case WEST: + if(blockPos.getX() < x && blockPos.getZ() == z) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case EAST: + if(blockPos.getX() > x && blockPos.getZ() == z) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + } } } } @@ -117,8 +338,45 @@ public class CropNuker { for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i))) { IBlockState blockState = Minecraft.getMinecraft().theWorld.getBlockState(blockPos); if (blockState.getBlock() == Blocks.melon_block) { - if (!broken.contains(blockPos)) { - warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + if(Main.configFile.hardIndex == 0) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + else if(Main.configFile.hardIndex == 1) { + EnumFacing dir = Minecraft.getMinecraft().thePlayer.getHorizontalFacing(); + int x = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posX); + int z = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posZ); + switch (dir) { + case NORTH: + if(blockPos.getZ() < z && blockPos.getX() == x) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case SOUTH: + if(blockPos.getZ() > z && blockPos.getX() == x) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case WEST: + if(blockPos.getX() < x && blockPos.getZ() == z) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case EAST: + if(blockPos.getX() > x && blockPos.getZ() == z) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + } } } } @@ -127,8 +385,45 @@ public class CropNuker { for (BlockPos blockPos : BlockPos.getAllInBox(playerPos.add(vec3i), playerPos.subtract(vec3i))) { IBlockState blockState = Minecraft.getMinecraft().theWorld.getBlockState(blockPos); if (blockState.getBlock() == Blocks.cocoa) { - if (!broken.contains(blockPos)) { - warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + if(Main.configFile.hardIndex == 0) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + else if(Main.configFile.hardIndex == 1) { + EnumFacing dir = Minecraft.getMinecraft().thePlayer.getHorizontalFacing(); + int x = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posX); + int z = (int) Math.floor(Minecraft.getMinecraft().thePlayer.posZ); + switch (dir) { + case NORTH: + if(blockPos.getZ() < z && blockPos.getX() == x) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case SOUTH: + if(blockPos.getZ() > z && blockPos.getX() == x) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case WEST: + if(blockPos.getX() < x && blockPos.getZ() == z) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + case EAST: + if(blockPos.getX() > x && blockPos.getZ() == z) { + if (!broken.contains(blockPos)) { + warts.add(new Vec3(blockPos.getX() + 0.5, blockPos.getY(), blockPos.getZ() + 0.5)); + } + } + break; + } } } } diff --git a/src/main/java/rosegoldaddons/features/DamagePerSecond.java b/src/main/java/rosegoldaddons/features/DamagePerSecond.java new file mode 100644 index 0000000..e0d990f --- /dev/null +++ b/src/main/java/rosegoldaddons/features/DamagePerSecond.java @@ -0,0 +1,12 @@ +package rosegoldaddons.features; + +import net.minecraft.client.Minecraft; +import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class DamagePerSecond { + @SubscribeEvent + public void onEntityJoin(EntityJoinWorldEvent event) { + + } +} diff --git a/src/main/java/rosegoldaddons/features/SwordSwapping.java b/src/main/java/rosegoldaddons/features/SwordSwapping.java index 099b9d7..4a309f0 100644 --- a/src/main/java/rosegoldaddons/features/SwordSwapping.java +++ b/src/main/java/rosegoldaddons/features/SwordSwapping.java @@ -20,7 +20,7 @@ public class SwordSwapping { public static void rightClick() { try { - Method rightClickMouse = null; + Method rightClickMouse; try { rightClickMouse = Minecraft.class.getDeclaredMethod("rightClickMouse"); } catch (NoSuchMethodException e) { diff --git a/src/main/java/rosegoldaddons/mixins/MixinRenderString.java b/src/main/java/rosegoldaddons/mixins/MixinRenderString.java new file mode 100644 index 0000000..7990f61 --- /dev/null +++ b/src/main/java/rosegoldaddons/mixins/MixinRenderString.java @@ -0,0 +1,34 @@ +package rosegoldaddons.mixins; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import rosegoldaddons.Main; +import rosegoldaddons.utils.ChatUtils; + +import java.util.Map; + +@Mixin(value = FontRenderer.class, priority = 999) +public abstract class MixinRenderString { + @Shadow + protected abstract void renderStringAtPos(String text, boolean shadow); + + @Inject(method = "renderStringAtPos", at = @At("HEAD"), cancellable = true) + private void renderString(String text, boolean shadow, CallbackInfo ci) { + if (Main.init) { + for (Map.Entry<String, String> entry : Main.resp.entrySet()) { + String key = entry.getKey(); + String value = entry.getValue(); + + if (text.contains(key)) { + ci.cancel(); + renderStringAtPos(text.replaceAll(key, value).replace("&", "ยง"), shadow); + } + } + } + } +} diff --git a/src/main/java/rosegoldaddons/mixins/MixinRendererLivingEntity.java b/src/main/java/rosegoldaddons/mixins/MixinRendererLivingEntity.java index bc1033f..f7e715a 100644 --- a/src/main/java/rosegoldaddons/mixins/MixinRendererLivingEntity.java +++ b/src/main/java/rosegoldaddons/mixins/MixinRendererLivingEntity.java @@ -3,6 +3,8 @@ package rosegoldaddons.mixins; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RendererLivingEntity; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.util.IChatComponent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -10,10 +12,12 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import rosegoldaddons.events.RenderLivingEntityEvent; +import rosegoldaddons.utils.ChatUtils; -@Mixin(RendererLivingEntity.class) +@Mixin(value = RendererLivingEntity.class, priority = 1001) @SideOnly(Side.CLIENT) public abstract class MixinRendererLivingEntity { diff --git a/src/main/resources/mixins.rosegoldaddons.json b/src/main/resources/mixins.rosegoldaddons.json index 4636ab6..5f4d645 100644 --- a/src/main/resources/mixins.rosegoldaddons.json +++ b/src/main/resources/mixins.rosegoldaddons.json @@ -8,6 +8,7 @@ ], "client": [ "MixinMinecraft", - "MixinRendererLivingEntity" + "MixinRendererLivingEntity", + "MixinRenderString" ] } |