Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
Snoworange420 committed Nov 18, 2022
1 parent 18e2514 commit 7e2a658
Show file tree
Hide file tree
Showing 18 changed files with 200 additions and 399 deletions.
Binary file modified .gradle/4.9/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/4.9/fileHashes/fileHashes.lock
Binary file not shown.
5 changes: 1 addition & 4 deletions src/main/java/com/snoworange/mousse/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand All @@ -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();

Expand Down
40 changes: 1 addition & 39 deletions src/main/java/com/snoworange/mousse/command/CommandManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down Expand Up @@ -61,44 +59,8 @@ public void onChat(final ClientChatEvent event) {
}
}

/*
@EventHandler
public Listener<ClientChatEvent> 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);
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/snoworange/mousse/command/impl/Peek.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ public Peek() {
@Override
public void onCommand(String[] args, String command) {
Main.moduleManager.getModule("ShulkerPeek").toggle();
Main.sendMessage("Opened shulker box.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

public class ForgeEventHandeler {

//TODO: fix this

@SubscribeEvent
public void onTick(TickEvent.ClientTickEvent event) {
for (Module m : Main.moduleManager.modules) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
23 changes: 20 additions & 3 deletions src/main/java/com/snoworange/mousse/module/Category.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@

public class AutoXP extends Module {

public int delay = 6;
public int tick = 0;

public AutoXP() {
super("AutoXP", "", Category.COMBAT, 0);
}
Expand All @@ -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--) {
Expand All @@ -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));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -31,7 +29,7 @@ public Grab32k() {
}

BooleanSetting autoClose;
NumberSetting slot;
BooleanSetting swap;

boolean clickedHopper;

Expand All @@ -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
Expand All @@ -53,7 +51,6 @@ public void onEnable() {
@Override
public void onDisable() {
super.onDisable();
clickedHopper = false;
}

@SubscribeEvent
Expand All @@ -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);
Expand All @@ -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());
Expand All @@ -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();
Expand Down
Loading

0 comments on commit 7e2a658

Please sign in to comment.