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 /src/main/java/rosegoldaddons/features | |
parent | c3fd62c5c1cb96a4c80e09dff8e440fc1088e902 (diff) | |
download | RGA-e46e11ebf0cfc244e95ee5299bf3f362f029d24a.tar.gz RGA-e46e11ebf0cfc244e95ee5299bf3f362f029d24a.tar.bz2 RGA-e46e11ebf0cfc244e95ee5299bf3f362f029d24a.zip |
2.6.0
biggie
Diffstat (limited to 'src/main/java/rosegoldaddons/features')
4 files changed, 328 insertions, 30 deletions
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) { |