diff --git a/.gradle/4.9/fileHashes/fileHashes.bin b/.gradle/4.9/fileHashes/fileHashes.bin index 4e60171e..5c47045b 100644 Binary files a/.gradle/4.9/fileHashes/fileHashes.bin and b/.gradle/4.9/fileHashes/fileHashes.bin differ diff --git a/.gradle/4.9/fileHashes/fileHashes.lock b/.gradle/4.9/fileHashes/fileHashes.lock index 58c1184c..d7a29cba 100644 Binary files a/.gradle/4.9/fileHashes/fileHashes.lock and b/.gradle/4.9/fileHashes/fileHashes.lock differ diff --git a/src/main/java/com/snoworange/mousse/Main.java b/src/main/java/com/snoworange/mousse/Main.java index 35a50b24..2791db4f 100644 --- a/src/main/java/com/snoworange/mousse/Main.java +++ b/src/main/java/com/snoworange/mousse/Main.java @@ -9,7 +9,6 @@ import com.snoworange.mousse.ui.Hud; import com.snoworange.mousse.ui.theme.ThemeManager; import com.snoworange.mousse.util.misc.FileUtils; -import com.snoworange.mousse.util.render.JColor; import net.minecraft.client.Minecraft; import net.minecraft.client.settings.KeyBinding; import net.minecraft.util.text.TextComponentString; @@ -24,8 +23,6 @@ import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.Display; -import java.io.File; - @Mod(modid = Main.MOD_ID, name = Main.NAME, version = Main.VERSION) public class Main { @@ -42,7 +39,7 @@ public class Main { public static final String MOD_ID = "mousse"; public static final String NAME = "Mousse"; - public static final String VERSION = "v0.5.7"; + public static final String VERSION = "v0.6.0"; public static Minecraft mc = Minecraft.getMinecraft(); diff --git a/src/main/java/com/snoworange/mousse/command/CommandManager.java b/src/main/java/com/snoworange/mousse/command/CommandManager.java index aa8cee43..978451e1 100644 --- a/src/main/java/com/snoworange/mousse/command/CommandManager.java +++ b/src/main/java/com/snoworange/mousse/command/CommandManager.java @@ -22,8 +22,6 @@ public CommandManager() { commands.add(new Peek()); commands.add(new Say()); - //commands.add(new Dispenser32kRedstoneDelay()); - //commands.add(new Dispenser32kAutoClose()); commands.add(new Load()); commands.add(new Save()); } @@ -61,44 +59,8 @@ public void onChat(final ClientChatEvent event) { } } - /* - @EventHandler - public Listener listener = new Listener<>(event -> { - - String message = event.getMessage(); - - if (!message.startsWith(prefix)) { - return; - } - - event.setCanceled(true); - message = message.substring(prefix.length()); - - if(message.split(" ").length > 0) { - boolean commandFound = false; - String commandName = message.split(" ")[0]; - if(commandName.equals("") || commandName.equals("help")) { - ChatFormatting GRAY = ChatFormatting.GRAY; - ChatFormatting BOLD = ChatFormatting.BOLD; - ChatFormatting RESET = ChatFormatting.RESET; - sendCommandDescriptions(); - } else { - for (Command c : commands) { - if (c.aliases.contains(commandName) || c.name.equalsIgnoreCase(commandName)) { - c.onCommand(Arrays.copyOfRange(message.split(" "), 1, message.split(" ").length), message); - commandFound = true; - break; - } - } - if (!commandFound) { - sendClientChatMessage(ChatFormatting.DARK_RED + "command does not exist, use " + ChatFormatting.ITALIC + prefix + "help " + ChatFormatting.RESET + "" + ChatFormatting.DARK_RED + "for help.", true); - } - } - } - }); - */ private void sendCommandDescriptions() { - sendClientChatMessage("\n", false); + sendClientChatMessage("Commands:", false); for (Command c : Main.commandManager.commands) { sendClientChatMessage(c.name + " - " + c.description + " [" + c.syntax + "]", false); } diff --git a/src/main/java/com/snoworange/mousse/command/impl/Peek.java b/src/main/java/com/snoworange/mousse/command/impl/Peek.java index 9e29cf99..622b9740 100644 --- a/src/main/java/com/snoworange/mousse/command/impl/Peek.java +++ b/src/main/java/com/snoworange/mousse/command/impl/Peek.java @@ -10,6 +10,5 @@ public Peek() { @Override public void onCommand(String[] args, String command) { Main.moduleManager.getModule("ShulkerPeek").toggle(); - Main.sendMessage("Opened shulker box."); } } diff --git a/src/main/java/com/snoworange/mousse/event/ForgeEventHandeler.java b/src/main/java/com/snoworange/mousse/event/ForgeEventHandeler.java index 0a23d190..013a2021 100644 --- a/src/main/java/com/snoworange/mousse/event/ForgeEventHandeler.java +++ b/src/main/java/com/snoworange/mousse/event/ForgeEventHandeler.java @@ -9,6 +9,8 @@ public class ForgeEventHandeler { + //TODO: fix this + @SubscribeEvent public void onTick(TickEvent.ClientTickEvent event) { for (Module m : Main.moduleManager.modules) { diff --git a/src/main/java/com/snoworange/mousse/mixin/mixins/MixinGuiMainMenu.java b/src/main/java/com/snoworange/mousse/mixin/mixins/MixinGuiMainMenu.java index c6c8aade..29908275 100644 --- a/src/main/java/com/snoworange/mousse/mixin/mixins/MixinGuiMainMenu.java +++ b/src/main/java/com/snoworange/mousse/mixin/mixins/MixinGuiMainMenu.java @@ -14,6 +14,6 @@ public class MixinGuiMainMenu extends GuiScreen { @Inject(method = {"drawScreen"}, at = {@At("TAIL")}, cancellable = true) public void drawText(int mouseX, int mouseY, float partialTicks, CallbackInfo ci) { FontRenderer fr = mc.fontRenderer; - fr.drawStringWithShadow(Main.NAME + " by Jonakip, Snow_orange__ & Huub", 2, 12, -1); + fr.drawStringWithShadow(Main.NAME + " by Jonakip, Snoworange & Huub", 2, 12, -1); } } diff --git a/src/main/java/com/snoworange/mousse/module/Category.java b/src/main/java/com/snoworange/mousse/module/Category.java index c35daa8f..74e07e41 100644 --- a/src/main/java/com/snoworange/mousse/module/Category.java +++ b/src/main/java/com/snoworange/mousse/module/Category.java @@ -2,12 +2,29 @@ public enum Category { - COMBAT("Combat"), EXPLOIT("Exploit"), RENDER("Render"), MOVEMENT("Movement"), PLAYER("Player"), MISC("Misc"); + COMBAT("Combat"), EXPLOIT("Exploit"), RENDER("Render"), MOVEMENT("Movement"), PLAYER("Player"), MISC("Misc"), SYSTEM("System"); public String name; - public int moduleIndex; + public boolean opened; Category(String name) { this.name = name; + this.opened = true; } -} + + public boolean isOpened() { + return this.opened; + } + + public void setOpened(boolean opened) { + this.opened = opened; + } + + public void toggle() { + if (!this.opened) { + this.opened = true; + } else if (this.opened) { + this.opened = false; + } + } +} \ No newline at end of file diff --git a/src/main/java/com/snoworange/mousse/module/ModuleManager.java b/src/main/java/com/snoworange/mousse/module/ModuleManager.java index ff7e118f..336f80db 100644 --- a/src/main/java/com/snoworange/mousse/module/ModuleManager.java +++ b/src/main/java/com/snoworange/mousse/module/ModuleManager.java @@ -32,7 +32,7 @@ public ModuleManager() { modules.add(new FastAura()); modules.add(new AutoAuto32k()); modules.add(new Grab32k()); - //modules.add(new SelfBow()); + modules.add(new SelfBow()); modules.add(new Auto32k2019()); //EXPLOIT diff --git a/src/main/java/com/snoworange/mousse/module/modules/combat/Auto32k2019.java b/src/main/java/com/snoworange/mousse/module/modules/combat/Auto32k2019.java index a9a45cbd..86c7815e 100644 --- a/src/main/java/com/snoworange/mousse/module/modules/combat/Auto32k2019.java +++ b/src/main/java/com/snoworange/mousse/module/modules/combat/Auto32k2019.java @@ -16,6 +16,7 @@ import net.minecraft.inventory.ContainerDispenser; import net.minecraft.inventory.ContainerHopper; import net.minecraft.item.Item; +import net.minecraft.item.ItemAir; import net.minecraft.item.ItemShulkerBox; import net.minecraft.item.ItemStack; import net.minecraft.network.play.client.CPacketEntityAction; @@ -214,6 +215,21 @@ public void onTick(TickEvent.ClientTickEvent event) { } } + int airindex = -1; + + for (int i = 0; i < 9; i++) { + + ItemStack itemStack = mc.player.inventory.mainInventory.get(i); + + if (itemStack.getItem() instanceof ItemAir) { + airindex = i; + } + } + + if (airindex != -1) { + update(airindex); + } + if (enchantedSwordIndex != -1) { mc.playerController.windowClick(mc.player.openContainer.windowId, enchantedSwordIndex, mc.player.inventory.currentItem, ClickType.SWAP, mc.player); Main.sendMessage("32k found in slot " + enchantedSwordIndex); diff --git a/src/main/java/com/snoworange/mousse/module/modules/combat/AutoXP.java b/src/main/java/com/snoworange/mousse/module/modules/combat/AutoXP.java index 8802b2b0..219cc463 100644 --- a/src/main/java/com/snoworange/mousse/module/modules/combat/AutoXP.java +++ b/src/main/java/com/snoworange/mousse/module/modules/combat/AutoXP.java @@ -14,9 +14,6 @@ public class AutoXP extends Module { - public int delay = 6; - public int tick = 0; - public AutoXP() { super("AutoXP", "", Category.COMBAT, 0); } @@ -37,8 +34,6 @@ public void onTick(TickEvent.PlayerTickEvent event) { if (mc.world == null || mc.player == null) return; - tick++; - int xpIndex = -1; for (int i = 8; i > -1; i--) { @@ -51,12 +46,9 @@ public void onTick(TickEvent.PlayerTickEvent event) { if (xpIndex == -1) return; - if (tick >= delay) { - mc.player.connection.sendPacket(new CPacketHeldItemChange(xpIndex)); - mc.playerController.updateController(); - mc.player.connection.sendPacket(new CPacketPlayerTryUseItem(EnumHand.MAIN_HAND)); - tick = 0; - } + mc.player.connection.sendPacket(new CPacketHeldItemChange(xpIndex)); + mc.playerController.updateController(); + mc.player.connection.sendPacket(new CPacketPlayerTryUseItem(EnumHand.MAIN_HAND)); mc.player.connection.sendPacket(new CPacketHeldItemChange(mc.player.inventory.currentItem)); } diff --git a/src/main/java/com/snoworange/mousse/module/modules/combat/Dispenser32k.java b/src/main/java/com/snoworange/mousse/module/modules/combat/Dispenser32k.java index 1e728eab..70df7ffd 100644 --- a/src/main/java/com/snoworange/mousse/module/modules/combat/Dispenser32k.java +++ b/src/main/java/com/snoworange/mousse/module/modules/combat/Dispenser32k.java @@ -90,11 +90,11 @@ public void init() { swapToSuperweaponIndex = new BooleanSetting("Select 32k Slot", true); speed = new ModeSetting("Speed", "Safe", "Safe", "2-Tick"); autoDisable = new BooleanSetting("Auto Disable", true); - openHopperWithPacket = new BooleanSetting("Open Hopper with Packet", false); + openHopperWithPacket = new BooleanSetting("Open Hopper with Packet", true); blockShulker = new BooleanSetting("Block Shulker", false); disableOnDeath = new BooleanSetting("Disable on Death", true); - addSetting(autoClose, redstoneDelay, fastHopper, allowVertical, renderCircle, silentSwap, swapToSuperweaponIndex, speed, autoDisable, openHopperWithPacket, disableOnDeath); + addSetting(autoClose, /* redstoneDelay, */ fastHopper, allowVertical, renderCircle, silentSwap, swapToSuperweaponIndex, speed, autoDisable, openHopperWithPacket, disableOnDeath); } @Override diff --git a/src/main/java/com/snoworange/mousse/module/modules/combat/FastAura.java b/src/main/java/com/snoworange/mousse/module/modules/combat/FastAura.java index 76205f11..a50388d4 100644 --- a/src/main/java/com/snoworange/mousse/module/modules/combat/FastAura.java +++ b/src/main/java/com/snoworange/mousse/module/modules/combat/FastAura.java @@ -110,6 +110,7 @@ public void onUpdate(LivingEvent.LivingUpdateEvent event) { } } + //Does this work accutually?... public void attack(EntityPlayer target, ModeSetting attackMode) { Attack1.attack(target, attackMode); Attack2.attack(target, attackMode); diff --git a/src/main/java/com/snoworange/mousse/module/modules/combat/Grab32k.java b/src/main/java/com/snoworange/mousse/module/modules/combat/Grab32k.java index 24d23243..e3cf5587 100644 --- a/src/main/java/com/snoworange/mousse/module/modules/combat/Grab32k.java +++ b/src/main/java/com/snoworange/mousse/module/modules/combat/Grab32k.java @@ -4,10 +4,8 @@ import com.snoworange.mousse.module.Category; import com.snoworange.mousse.module.Module; import com.snoworange.mousse.setting.settings.BooleanSetting; -import com.snoworange.mousse.setting.settings.NumberSetting; import net.minecraft.block.BlockHopper; import net.minecraft.block.BlockShulkerBox; -import net.minecraft.client.gui.GuiHopper; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Enchantments; @@ -31,7 +29,7 @@ public Grab32k() { } BooleanSetting autoClose; - NumberSetting slot; + BooleanSetting swap; boolean clickedHopper; @@ -40,8 +38,8 @@ public void init() { super.init(); autoClose = new BooleanSetting("Auto Close", true); - slot = new NumberSetting("Slot", 1, 1, 9, 1); - addSetting(autoClose, slot); + swap = new BooleanSetting("Swap 32k to empty slot", true); + addSetting(autoClose, swap); } @Override @@ -53,7 +51,6 @@ public void onEnable() { @Override public void onDisable() { super.onDisable(); - clickedHopper = false; } @SubscribeEvent @@ -63,10 +60,10 @@ public void onUpdate(LivingEvent.LivingUpdateEvent event) { if (this.toggled && event.getEntityLiving() instanceof EntityPlayer) { - if (Main.moduleManager.getModule("Dispenser32k").isToggled()) return; - int enchantedSwordIndex = -1; + int shitIndex; + //32k Check for (int i = 0; i < 9; i++) { ItemStack itemStack = mc.player.inventory.mainInventory.get(i); @@ -79,7 +76,7 @@ public void onUpdate(LivingEvent.LivingUpdateEvent event) { double hopperBlockDistance = 4; BlockPos closestHopperPos = null; - for (BlockPos hopperPos : BlockPos.getAllInBox(new BlockPos(mc.player.posX - 3, mc.player.posY - 2, mc.player.posZ - 3), new BlockPos(mc.player.posX + 3, mc.player.posY + 2, mc.player.posZ + 3))) { + for (BlockPos hopperPos : BlockPos.getAllInBox(new BlockPos(mc.player.posX - 4, mc.player.posY - 3, mc.player.posZ - 4), new BlockPos(mc.player.posX + 4, mc.player.posY + 3, mc.player.posZ + 4))) { if (mc.player.getDistance(hopperPos.getX(), hopperPos.getY(), hopperPos.getZ()) < hopperBlockDistance && mc.world.getBlockState(hopperPos.up()).getBlock() instanceof BlockShulkerBox && mc.world.getBlockState(hopperPos).getBlock() instanceof BlockHopper) { hopperBlockDistance = mc.player.getDistance(hopperPos.getX(), hopperPos.getY(), hopperPos.getZ()); @@ -105,15 +102,70 @@ public void onUpdate(LivingEvent.LivingUpdateEvent event) { if (mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(i).getItem().equals(Items.DIAMOND_SWORD) && EnchantmentHelper.getEnchantmentLevel(Enchantments.SHARPNESS, mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(i)) >= Short.MAX_VALUE) { enchantedSwordIndex = i; break; + } else if (mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(i).getItem().equals(Items.DIAMOND_SWORD) && !(EnchantmentHelper.getEnchantmentLevel(Enchantments.SHARPNESS, mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(i)) >= Short.MAX_VALUE)) { + shitIndex = i; + mc.playerController.windowClick(mc.player.openContainer.windowId, shitIndex, shitIndex, ClickType.THROW, mc.player); + break; } } + //Instant sword throw + if (mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(1).getItem().equals(Items.DIAMOND_SWORD) && EnchantmentHelper.getEnchantmentLevel(Enchantments.SHARPNESS, mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(0)) >= Short.MAX_VALUE) { + enchantedSwordIndex = 0; + } else if (mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(0).getItem().equals(Items.DIAMOND_SWORD) && !(EnchantmentHelper.getEnchantmentLevel(Enchantments.SHARPNESS, mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(0)) >= Short.MAX_VALUE)) { + shitIndex = 0; + mc.playerController.windowClick(mc.player.openContainer.windowId, shitIndex, shitIndex, ClickType.THROW, mc.player); + } + + if (mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(1).getItem().equals(Items.DIAMOND_SWORD) && EnchantmentHelper.getEnchantmentLevel(Enchantments.SHARPNESS, mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(1)) >= Short.MAX_VALUE) { + enchantedSwordIndex = 1; + } else if (mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(1).getItem().equals(Items.DIAMOND_SWORD) && !(EnchantmentHelper.getEnchantmentLevel(Enchantments.SHARPNESS, mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(1)) >= Short.MAX_VALUE)) { + shitIndex = 1; + mc.playerController.windowClick(mc.player.openContainer.windowId, shitIndex, shitIndex, ClickType.THROW, mc.player); + } + + if (mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(2).getItem().equals(Items.DIAMOND_SWORD) && EnchantmentHelper.getEnchantmentLevel(Enchantments.SHARPNESS, mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(2)) >= Short.MAX_VALUE) { + enchantedSwordIndex = 2; + } else if (mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(2).getItem().equals(Items.DIAMOND_SWORD) && !(EnchantmentHelper.getEnchantmentLevel(Enchantments.SHARPNESS, mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(2)) >= Short.MAX_VALUE)) { + shitIndex = 2; + mc.playerController.windowClick(mc.player.openContainer.windowId, shitIndex, shitIndex, ClickType.THROW, mc.player); + } + + if (mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(3).getItem().equals(Items.DIAMOND_SWORD) && EnchantmentHelper.getEnchantmentLevel(Enchantments.SHARPNESS, mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(3)) >= Short.MAX_VALUE) { + enchantedSwordIndex = 3; + } else if (mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(3).getItem().equals(Items.DIAMOND_SWORD) && !(EnchantmentHelper.getEnchantmentLevel(Enchantments.SHARPNESS, mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(3)) >= Short.MAX_VALUE)) { + shitIndex = 3; + mc.playerController.windowClick(mc.player.openContainer.windowId, shitIndex, shitIndex, ClickType.THROW, mc.player); + } + + if (mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(4).getItem().equals(Items.DIAMOND_SWORD) && EnchantmentHelper.getEnchantmentLevel(Enchantments.SHARPNESS, mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(4)) >= Short.MAX_VALUE) { + enchantedSwordIndex = 4; + } else if (mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(4).getItem().equals(Items.DIAMOND_SWORD) && !(EnchantmentHelper.getEnchantmentLevel(Enchantments.SHARPNESS, mc.player.openContainer.inventorySlots.get(0).inventory.getStackInSlot(4)) >= Short.MAX_VALUE)) { + shitIndex = 4; + mc.playerController.windowClick(mc.player.openContainer.windowId, shitIndex, shitIndex, ClickType.THROW, mc.player); + } + if (enchantedSwordIndex == -1) { return; } - mc.playerController.windowClick(mc.player.openContainer.windowId, enchantedSwordIndex, (int) slot.getValue(), ClickType.SWAP, mc.player); - Main.sendMessage("Swapped 32k in slot " + enchantedSwordIndex + " to slot " + (int) slot.getValue()); + if (swap.enable) { + for (int i = 0; i < 9; i++) { + ItemStack itemStack = mc.player.inventory.mainInventory.get(i); + if (itemStack.getItem() instanceof ItemAir) { + if (mc.player.inventory.currentItem != i) { + mc.player.connection.sendPacket(new CPacketHeldItemChange(i)); + mc.player.inventory.currentItem = i; + mc.playerController.updateController(); + } + break; + } + } + } + + + mc.playerController.windowClick(mc.player.openContainer.windowId, enchantedSwordIndex, mc.player.inventory.currentItem, ClickType.SWAP, mc.player); + Main.sendMessage("Grabbed 32k in slot " + enchantedSwordIndex + " to " + mc.player.inventory.currentItem); if (autoClose.enable) { mc.player.closeScreen(); diff --git a/src/main/java/com/snoworange/mousse/module/modules/combat/SelfBow.java b/src/main/java/com/snoworange/mousse/module/modules/combat/SelfBow.java index dc473355..1f68fa6f 100644 --- a/src/main/java/com/snoworange/mousse/module/modules/combat/SelfBow.java +++ b/src/main/java/com/snoworange/mousse/module/modules/combat/SelfBow.java @@ -1,13 +1,16 @@ package com.snoworange.mousse.module.modules.combat; +import com.snoworange.mousse.Main; import com.snoworange.mousse.module.Category; import com.snoworange.mousse.module.Module; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; -import net.minecraft.item.EnumAction; -import net.minecraft.network.play.client.*; +import net.minecraft.network.play.client.CPacketPlayer; +import net.minecraft.network.play.client.CPacketPlayerDigging; +import net.minecraft.util.math.BlockPos; import net.minecraftforge.event.entity.living.LivingEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.input.Keyboard; public class SelfBow extends Module { @@ -15,9 +18,12 @@ public SelfBow() { super("Selfbow", "shoots yourself when you use bow", Category.COMBAT); } + int tick = 0; + @Override public void onEnable() { super.onEnable(); + tick = 0; } @Override @@ -32,10 +38,19 @@ public void onUpdate(LivingEvent.LivingUpdateEvent event) { if (mc.player == null || mc.world == null) return; if (mc.player.inventory.getCurrentItem().getItem().equals(Items.BOW)) { - if (mc.player.inventory.getCurrentItem().getItemUseAction() == EnumAction.BOW) { - mc.player.connection.sendPacket(new CPacketPlayer.Rotation(mc.player.rotationYaw, -90, mc.player.onGround)); + + tick++; + + if (tick >= 10) { + + mc.player.connection.sendPacket(new CPacketPlayer.Rotation(0, -90, mc.player.onGround)); + mc.player.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, mc.player.getHorizontalFacing())); + mc.player.resetActiveHand(); + tick = 0; } + } else { + tick = 0; } } } -} +} \ No newline at end of file diff --git a/src/main/java/com/snoworange/mousse/module/modules/misc/BetterChat.java b/src/main/java/com/snoworange/mousse/module/modules/misc/BetterChat.java index cc6118c3..54bddc05 100644 --- a/src/main/java/com/snoworange/mousse/module/modules/misc/BetterChat.java +++ b/src/main/java/com/snoworange/mousse/module/modules/misc/BetterChat.java @@ -31,8 +31,8 @@ public BetterChat() { public void init() { super.init(); - customPrefix = new BooleanSetting("Custom Prefix", false); - customSuffix = new BooleanSetting("Custom Suffix", false); + customPrefix = new BooleanSetting("Custom Prefix", true); + customSuffix = new BooleanSetting("Custom Suffix", true); addSetting(customPrefix, customSuffix); } diff --git a/src/main/java/com/snoworange/mousse/module/modules/render/ShulkerPeek.java b/src/main/java/com/snoworange/mousse/module/modules/render/ShulkerPeek.java index e0dd8512..8e3b43d8 100644 --- a/src/main/java/com/snoworange/mousse/module/modules/render/ShulkerPeek.java +++ b/src/main/java/com/snoworange/mousse/module/modules/render/ShulkerPeek.java @@ -75,10 +75,12 @@ public void onUpdate(LivingEvent.LivingUpdateEvent event) { mc.displayGuiScreen((GuiScreen) new GuiChest((IInventory) mc.player.inventory, (IInventory) new InventoryBasic("Shulker Box", true, 27))); } + Main.sendMessage("Opened shulker box."); mc.world.playSound(mc.player, mc.player.posX, mc.player.posY, mc.player.posZ, SoundEvents.BLOCK_SHULKER_BOX_OPEN, SoundCategory.BLOCKS, 0.5f, 1.0f); } else { Main.sendMessage("Coudn't find shulker box in your hands!"); } + disable(); } } diff --git a/src/main/java/com/snoworange/mousse/ui/ClickGui.java b/src/main/java/com/snoworange/mousse/ui/ClickGui.java index 20403148..223271c5 100644 --- a/src/main/java/com/snoworange/mousse/ui/ClickGui.java +++ b/src/main/java/com/snoworange/mousse/ui/ClickGui.java @@ -9,48 +9,31 @@ import com.snoworange.mousse.setting.settings.NumberSetting; import com.snoworange.mousse.ui.theme.ThemeManager; import com.snoworange.mousse.util.misc.FileUtils; -import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.resources.I18n; import org.lwjgl.input.Keyboard; import java.awt.*; import java.io.IOException; -import java.math.RoundingMode; import java.util.Locale; -import java.math.BigDecimal; -import java.math.RoundingMode; public class ClickGui extends GuiScreen { - public double posX, posY, width, height, dragX, dragY; + private double posX, posY, dragX, dragY; private double posX2, posY2, dragX2, dragY2; - public boolean dragging; - public boolean dragging2; - public Category selectedCategory; + public boolean dragging, dragging2; private Module selectedModule; - public int modeIndex; - public boolean openedCombat = true; - public boolean openedExploit = true; - public boolean openedRender = true; - public boolean openedMovement = true; - public boolean openedPlayer = true; - public boolean openedMisc = true; public boolean listeningForKey; - public boolean listeningForNumericInput; //TODO: Clickgui rewrite public ClickGui() { dragging = false; - dragging2 = false; posX = 100; posY = 50; posX2 = 650; posY2 = 50; - width = posX + 150 * 2; height = height + 200; } @@ -59,14 +42,6 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) { drawDefaultBackground(); super.drawScreen(mouseX, mouseY, partialTicks); - mc.fontRenderer.drawString("Mousse Client by Jonakip, Snoworange & Huub" ,0, 5, -1); - - /* - mc.fontRenderer.drawString("PosX, PosY: " + posX + " " + posY, 100, 100, -1); - mc.fontRenderer.drawString("MouseX, MouseY: " + mouseX + " " + mouseY, 100, 115, -1); - mc.fontRenderer.drawString("PosX2, PosY2: " + posX2 + " " + posY2, 100, 135, -1); - */ - if (dragging) { posX = mouseX - dragX; posY = mouseY - dragY; @@ -77,82 +52,30 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) { posY2 = mouseY - dragY2; } - width = posX + 285; - height = posY + 150; - + //Draw category int offset = 0; - - offset = 0; for (Category category : Category.values()) { Gui.drawRect((int) posX + 1 + offset, (int) posY, (int) (posX + 80 + offset), (int) posY + 15, ThemeManager.getTheme().c0.getRGB()); mc.fontRenderer.drawString(category.name, (int) (posX + 4.5) + offset, (int) ((float) posY + 4.5), -1); offset += 80; } - //Combat - - offset = 15; - for (Module m : Main.moduleManager.getModuleList()) { - if (openedCombat && m.getCategory() == Category.COMBAT) { - Gui.drawRect((int) posX, (int) (posY + 1 + offset), (int) (posX + 80), (int) ((float) posY + 17.5 + offset), m.isToggled() ? ThemeManager.getTheme().getC1().getRGB() : ThemeManager.getTheme().getC5().getRGB()); - mc.fontRenderer.drawString(m.getName(), (int) ((float) posX + 2.5), (int) ((float) posY + 6.5) + offset, new Color(170, 170, 170).getRGB()); - offset += 17.5; - } - } - - //Exploit - - offset = 15; - for (Module m : Main.moduleManager.getModuleList()) { - if (openedExploit && m.getCategory() == Category.EXPLOIT) { - Gui.drawRect((int) posX + 80, (int) (posY + 1 + offset), (int) (posX + 160), (int) ((float) posY + 17.5 + offset), m.isToggled() ? ThemeManager.getTheme().getC1().getRGB() : ThemeManager.getTheme().getC5().getRGB()); - mc.fontRenderer.drawString(m.getName(), (int) ((float) posX + 82.5), (int) ((float) posY + 6.5) + offset, new Color(170, 170, 170).getRGB()); - offset += 17.5; - } - } - - //Render - - offset = 15; - for (Module m : Main.moduleManager.getModuleList()) { - if (openedRender && m.getCategory() == Category.RENDER) { - Gui.drawRect((int) posX + 160, (int) (posY + 1 + offset), (int) (posX + 240), (int) ((float) posY + 17.5 + offset), m.isToggled() ? ThemeManager.getTheme().getC1().getRGB() : ThemeManager.getTheme().getC5().getRGB()); - mc.fontRenderer.drawString(m.getName(), (int) ((float) posX + 162.5), (int) ((float) posY + 6.5) + offset, new Color(170, 170, 170).getRGB()); - offset += 17.5; - } - } - - //Movement - - offset = 15; - for (Module m : Main.moduleManager.getModuleList()) { - if (openedMovement && m.getCategory() == Category.MOVEMENT) { - Gui.drawRect((int) posX + 240, (int) (posY + 1 + offset), (int) (posX + 320), (int) ((float) posY + 17.5 + offset), m.isToggled() ? ThemeManager.getTheme().getC1().getRGB() : ThemeManager.getTheme().getC5().getRGB()); - mc.fontRenderer.drawString(m.getName(), (int) ((float) posX + 242.5), (int) ((float) posY + 6.5) + offset, new Color(170, 170, 170).getRGB()); - offset += 17.5; + //Draw modules + int yoffsetModules = 15; + int xoffsetModules = 0; + for (Category c : Category.values()) { + for (Module m : Main.moduleManager.getModuleList()) { + if (c.equals(m.getCategory())) { + if (c.opened) { + Gui.drawRect((int) posX + xoffsetModules, (int) (posY + 1 + yoffsetModules), (int) (posX + 80 + xoffsetModules), (int) ((float) posY + 17.5 + yoffsetModules), m.isToggled() ? ThemeManager.getTheme().getC1().getRGB() : ThemeManager.getTheme().getC5().getRGB()); + mc.fontRenderer.drawString(m.getName(), (int) ((float) posX + 2.5 + xoffsetModules), (int) ((float) posY + 6.5) + yoffsetModules, new Color(170, 170, 170).getRGB()); + yoffsetModules += 17.5; + } + } } - } - //Player - - offset = 15; - for (Module m : Main.moduleManager.getModuleList()) { - if (openedPlayer && m.getCategory() == Category.PLAYER) { - Gui.drawRect((int) posX + 320, (int) (posY + 1 + offset), (int) (posX + 400), (int) ((float) posY + 17.5 + offset), m.isToggled() ? ThemeManager.getTheme().getC1().getRGB() : ThemeManager.getTheme().getC5().getRGB()); - mc.fontRenderer.drawString(m.getName(), (int) ((float) posX + 322.5), (int) ((float) posY + 6.5) + offset, new Color(170, 170, 170).getRGB()); - offset += 17.5; - } - } - - //Misc - - offset = 15; - for (Module m : Main.moduleManager.getModuleList()) { - if (openedMisc && m.getCategory() == Category.MISC) { - Gui.drawRect((int) posX + 400, (int) (posY + 1 + offset), (int) (posX + 480), (int) ((float) posY + 17.5 + offset), m.isToggled() ? ThemeManager.getTheme().getC1().getRGB() : ThemeManager.getTheme().getC5().getRGB()); - mc.fontRenderer.drawString(m.getName(), (int) ((float) posX + 402.5), (int) ((float) posY + 6.5) + offset, new Color(170, 170, 170).getRGB()); - offset += 17.5; - } + xoffsetModules += 80; + yoffsetModules = 15; } //SettingsManager @@ -176,7 +99,7 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) { for (Setting setting : selectedModule.settings) { Gui.drawRect((int) (posX2), (int) (posY2 + 35 + offY), (int) (posX2 + 150), (int) (posY2 + 35 + 17.5 + offY), setting instanceof BooleanSetting ? ((BooleanSetting) setting).isEnable() ? ThemeManager.getTheme().getC2().getRGB() : ThemeManager.getTheme().getC5().getRGB() : ThemeManager.getTheme().getC5().getRGB()); - fontRenderer.drawString(setting instanceof ModeSetting ? setting.name + " > " + ((ModeSetting) setting).getMode() : setting instanceof NumberSetting ? listeningForNumericInput ? "Press a numeric key..." : setting.name + " > " + setting.value : setting.name, (int) posX2 + 5, (int) (posY2 + 40 + offY), -1); + fontRenderer.drawString(setting instanceof ModeSetting ? setting.name + " > " + ((ModeSetting) setting).getMode() : setting instanceof NumberSetting ? setting.name + " > " + setting.value : setting.name, (int) posX2 + 5, (int) (posY2 + 40 + offY), -1); offY += 17.5; } } @@ -209,21 +132,23 @@ public static String getKeyDisplayString(int key) @Override protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { super.mouseClicked(mouseX, mouseY, mouseButton); - if (isInside(mouseX, mouseY, posX, posY - 12.5, width + 160, posY + 12.5) && mouseButton == 0) { + + //Drag module shit + if (isInside(mouseX, mouseY, posX, posY - 12.5, posX + 480, posY + 12.5) && mouseButton == 0) { dragging = true; dragX = mouseX - posX; dragY = mouseY - posY; } - if (isInside2(mouseX, mouseY, posX2, posY2, posX2 + 250, posY2 + 250) && mouseButton == 0) { + //Drag setting panel + if (isInside(mouseX, mouseY, posX2, posY2, posX2 + 250, posY2 + 15) && mouseButton == 0) { dragging2 = true; dragX2 = mouseX - posX2; dragY2 = mouseY - posY2; } //Settingsmanager - - if (isInside2(mouseX, mouseY, posX2, posY2 + 17.5, posX2 + 150, posY2 + 30)) { + if (isInside(mouseX, mouseY, posX2, posY2 + 17.5, posX2 + 150, posY2 + 30)) { if (!listeningForKey) { listeningForKey = true; } else if (listeningForKey) { @@ -231,221 +156,57 @@ protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOEx } } - int offset = 0; - - //Combat - - offset = 15; - for (Module m : Main.moduleManager.getModuleList()) { - if (m.getCategory() == Category.COMBAT) { - if (isInside(mouseX, mouseY, posX, posY + 1 + offset, posX + 80, posY + 15 + offset)) { - if (mouseButton == 0) { - m.toggle(); - } - - if (mouseButton == 1) { - selectedModule = m; - } - } - offset += 17.5; - } - } - - //Exploit - - offset = 15; - for (Module m : Main.moduleManager.getModuleList()) { - if (m.getCategory() == Category.EXPLOIT) { - if (isInside(mouseX, mouseY, posX + 80, posY + 1 + offset, posX + 160, posY + 15 + offset)) { - if (mouseButton == 0) { - m.toggle(); - } - - if (mouseButton == 1) { - selectedModule = m; - } - } - offset += 17.5; - } - } - - //Render - - offset = 15; - for (Module m : Main.moduleManager.getModuleList()) { - if (m.getCategory() == Category.RENDER) { - if (isInside(mouseX, mouseY, posX + 160, posY + 1 + offset, posX + 240, posY + 15 + offset)) { - if (mouseButton == 0) { - m.toggle(); - } - - if (mouseButton == 1) { - selectedModule = m; - } - } - offset += 17.5; - } - } + int yoffsetModules = 15; + int xoffsetModules = 0; - //Movement + //Click stuff + for (Category c : Category.values()) { + for (Module m : Main.moduleManager.getModuleList()) { + if (c.equals(m.getCategory())) { + if (c.opened) { + if (isInside(mouseX, mouseY, posX + xoffsetModules, posY + 1 + yoffsetModules, posX + 80 + xoffsetModules, posY + 15 + yoffsetModules)) { + if (mouseButton == 0) { + m.toggle(); + } - offset = 15; - for (Module m : Main.moduleManager.getModuleList()) { - if (m.getCategory() == Category.MOVEMENT) { - if (isInside(mouseX, mouseY, posX + 240, posY + 1 + offset, posX + 320, posY + 15 + offset)) { - if (mouseButton == 0) { - m.toggle(); - } + if (mouseButton == 1) { + selectedModule = m; + } + } - if (mouseButton == 1) { - selectedModule = m; + yoffsetModules += 17.5; } } - offset += 17.5; } - } - - //Player - - offset = 15; - for (Module m : Main.moduleManager.getModuleList()) { - if (m.getCategory() == Category.PLAYER) { - if (isInside(mouseX, mouseY, posX + 320, posY + 1 + offset, posX + 400, posY + 15 + offset)) { - if (mouseButton == 0) { - m.toggle(); - } - if (mouseButton == 1) { - selectedModule = m; - } - } - offset += 17.5; - } + xoffsetModules += 80; + yoffsetModules = 15; } - //Misc - - offset = 15; - for (Module m : Main.moduleManager.getModuleList()) { - if (m.getCategory() == Category.MISC) { - if (isInside(mouseX, mouseY, posX + 400, posY + 1 + offset, posX + 480, posY + 15 + offset)) { - if (mouseButton == 0) { - m.toggle(); - } - - if (mouseButton == 1) { - selectedModule = m; - } - } - offset += 17.5; - } - } - - offset = 0; - - //Combat - if (isInside(mouseX, mouseY, posX, posY + 1 + offset, posX + 75, posY + 12.5 + offset)) { - if (mouseButton == 1 || mouseButton == 0) { - - selectedCategory = Category.COMBAT; - - if (mouseButton == 1) { - if (!openedCombat) { - openedCombat = true; - } else if (openedCombat) { - openedCombat = false; - } - } - } - } - - //Exploit - if (isInside(mouseX, mouseY, posX + 80, posY + 1 + offset, posX + 155, posY + 12.5 + offset)) { - if (mouseButton == 1 || mouseButton == 0) { - - selectedCategory = Category.EXPLOIT; + //Implementing opening stuff soon... + /* + int cpoffset = 0; + for (Category c : Category.values()) { + if (isInside(mouseX, mouseY, posX, posY + 1, posX + cpoffset, posY + 12.5)) { if (mouseButton == 1) { - if (!openedExploit) { - openedExploit = true; - } else if (openedExploit) { - openedExploit = false; - } - } - } - } - - //Render - if (isInside(mouseX, mouseY, posX + 155, posY + 1 + offset, posX + 235, posY + 12.5 + offset)) { - if (mouseButton == 1 || mouseButton == 0) { - - selectedCategory = Category.RENDER; + c.toggle(); - if (mouseButton == 1) { - if (!openedRender) { - openedRender = true; - } else if (openedRender) { - openedRender = false; - } + Main.sendMessage(c.name); } } - } - - //Movement - if (isInside(mouseX, mouseY, posX + 235, posY + 1 + offset, posX + 315, posY + 12.5 + offset)) { - if (mouseButton == 1 || mouseButton == 0) { - selectedCategory = Category.MOVEMENT; - - if (mouseButton == 1) { - if (!openedMovement) { - openedMovement = true; - } else if (openedMovement) { - openedMovement = false; - } - } - } + cpoffset += 80; } - //Player - if (isInside(mouseX, mouseY, posX + 315, posY + 1 + offset, posX + 395, posY + 12.5 + offset)) { - if (mouseButton == 1 || mouseButton == 0) { - - selectedCategory = Category.PLAYER; - - if (mouseButton == 1) { - if (!openedPlayer) { - openedPlayer = true; - } else if (openedPlayer) { - openedPlayer = false; - } - } - } - } - - //Misc - if (isInside(mouseX, mouseY, posX + 395, posY + 1 + offset, posX + 475, posY + 12.5 + offset)) { - if (mouseButton == 1 || mouseButton == 0) { - - selectedCategory = Category.MISC; - - if (mouseButton == 1) { - if (!openedMisc) { - openedMisc = true; - } else if (openedMisc) { - openedMisc = false; - } - } - } - } - - int offY = 0; + */ //Settings stuff - if (selectedModule == null) return; + int offY = 0; + for (Setting setting : selectedModule.settings) { if (isInside(mouseX, mouseY, (int) (posX2), (int) (posY2 + 35 + offY), (int) (posX2 + 150), (int) (posY2 + 35 + 17.5 + offY))) { if (mouseButton == 0) { @@ -455,14 +216,22 @@ protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOEx ((ModeSetting) setting).cycle(); } else if (setting instanceof NumberSetting) { + double settingValue = ((NumberSetting) setting).getValue(); + float minx = (float) posX2; + float maxx = (float) posX2 + 150; + + if (mouseX <= minx) { + ((NumberSetting) setting).setValue(((NumberSetting) setting).getMinimum()); + } + + if (mouseX >= maxx) { + ((NumberSetting) setting).setValue(((NumberSetting) setting).getMaximum()); + } } else { Main.sendMessage("?!"); } } - if ((mouseButton == 0 || mouseButton == 1) && setting instanceof NumberSetting) { - listeningForNumericInput = true; - } } offY += 17.5; } @@ -479,11 +248,7 @@ protected void mouseReleased(int mouseX, int mouseY, int state) { protected void keyTyped(char typedChar, int keyCode) throws IOException { super.keyTyped(typedChar, keyCode); - if (selectedModule == null) { - return; - } - - if (keyCode <= 0) { + if (selectedModule == null || keyCode <= 0) { return; } @@ -497,15 +262,6 @@ protected void keyTyped(char typedChar, int keyCode) throws IOException { listeningForKey = false; } } - - if (listeningForNumericInput) { - for (Setting setting : selectedModule.settings) { - if (setting instanceof NumberSetting) { - setting.value = Integer.parseInt(keyCode < 256 ? Keyboard.getKeyName(keyCode) : String.format(String.valueOf((char)(keyCode - 256)).toUpperCase(Locale.ROOT))); - listeningForNumericInput = false; - } - } - } } @Override @@ -518,7 +274,6 @@ public void initGui() { super.initGui(); dragging = false; - dragging2 = false; } @Override @@ -530,13 +285,4 @@ public void onGuiClosed() { public boolean isInside(int mouseX, int mouseY, double x, double y, double x2, double y2) { return (mouseX > x && mouseX < x2) && (mouseY > y && mouseY < y2); } - - public boolean isInside2(int mouseX, int mouseY, double x, double y, double x2, double y2) { - return (mouseX > x && mouseX < x2) && (mouseY > y && mouseY < y2); - } - - public ScaledResolution getScaledRes() { - return new ScaledResolution(Minecraft.getMinecraft()); - } - } \ No newline at end of file