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

Commit

Permalink
idk, first push from Intellij. (updated to v0.5.7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Snoworange420 committed Nov 14, 2022
1 parent c6655c1 commit 2b99c17
Show file tree
Hide file tree
Showing 19 changed files with 167 additions and 179 deletions.
22 changes: 10 additions & 12 deletions src/main/java/com/snoworange/mousse/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.mojang.realmsclient.gui.ChatFormatting;
import com.snoworange.mousse.command.CommandManager;
import com.snoworange.mousse.event.ForgeEventHandeler;
import com.snoworange.mousse.module.Module;
import com.snoworange.mousse.module.ModuleManager;
import com.snoworange.mousse.ui.ClickGui;
Expand All @@ -23,38 +24,32 @@
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 {
public static ThemeManager themeManager = new ThemeManager();

public static ModuleManager moduleManager;

public static Hud hud;
public static KeyBinding ClickGUI;
public static ThemeManager themeManager;
public static CommandManager commandManager;
private ClickGui clickgui;
//public ClickGui clickGui;
public static ClickGui clickgui;
public static ForgeEventHandeler forgeEventHandeler;

//

public static final String MOD_ID = "mousse";
public static final String NAME = "Mousse";
public static final String VERSION = "v0.5.4";
public static final String VERSION = "v0.5.7";

public static Minecraft mc = Minecraft.getMinecraft();

public static final JColor MOUSSE_COLOR = new JColor(131, 141, 59);

//
@Mod.Instance
public Main instance;


@Mod.EventHandler
public void PreInit(FMLPreInitializationEvent event) {
}

public void initFilesystem() {
FileUtils.createDirectory();
FileUtils.loadAll();
Expand All @@ -72,6 +67,8 @@ public void init(FMLPreInitializationEvent event) {
commandManager = new CommandManager();
hud = new Hud();
clickgui = new ClickGui();
themeManager = new ThemeManager();
forgeEventHandeler = new ForgeEventHandeler();

ClickGUI = new KeyBinding("ClickGUI", Keyboard.KEY_NONE, "Mousse");
ClientRegistry.registerKeyBinding(ClickGUI);
Expand Down Expand Up @@ -115,6 +112,7 @@ public static void sendMessage(String msg) {
@SubscribeEvent
public void displayGuiScreen(TickEvent.ClientTickEvent event) {
if (Main.ClickGUI.isPressed()) {
FileUtils.loadTheme(FileUtils.mousse);
mc.displayGuiScreen(new ClickGui());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.snoworange.mousse.Main;
import com.snoworange.mousse.module.modules.player.Capes;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.network.NetworkPlayerInfo;
import net.minecraft.util.ResourceLocation;
Expand All @@ -23,15 +22,16 @@ public abstract class MixinAbstractClientPlayer {

@Inject(method={"getLocationCape"}, at={@At(value="HEAD")}, cancellable=true)
public void getLocationCape(CallbackInfoReturnable<ResourceLocation> callbackInfoReturnable) {
NetworkPlayerInfo info = this.getPlayerInfo();
UUID uuid = null;
if (info != null) {
uuid = this.getPlayerInfo().getGameProfile().getId();
}

if (Main.moduleManager.getModule("Capes").isToggled()) {
NetworkPlayerInfo info = this.getPlayerInfo();
UUID uuid = null;
if (info != null) {
uuid = this.getPlayerInfo().getGameProfile().getId();
}

ResourceLocation cape = Capes.getCapeResource((AbstractClientPlayer) (Object) this);
if (uuid != null && Minecraft.getMinecraft().getSession().getUsername().equals(this.getPlayerInfo().getGameProfile().getName())) {

if (uuid != null) {
callbackInfoReturnable.setReturnValue(cape);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ public void updateScreen() {

@Inject(method = "drawWorldBackground(I)V", at = @At("HEAD"), cancellable = true)
private void drawWorldBackgroundWrapper(final int tint, final CallbackInfo ci) {
if (Minecraft.getMinecraft().world != null && (Main.moduleManager.getModule("CleanGUI").isToggled() || Main.moduleManager.getModule("Particles").isToggled())) {
if (Minecraft.getMinecraft().world != null && Main.moduleManager.getModule("CleanGUI").isToggled()) {
ci.cancel();
}

if (Minecraft.getMinecraft().world != null) {

if (Main.moduleManager.getModule("Particles").isToggled()) {
if (Main.moduleManager.getModule("Particles").isToggled()) {
final ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
final int width = scaledResolution.getScaledWidth();
final int height = scaledResolution.getScaledHeight();
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/com/snoworange/mousse/module/Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ public boolean isToggled() {
return toggled;
}

public boolean isEnabled() {
return toggled;
}

public boolean isDisabled() {
return !toggled;
}

public void setToggled(boolean toggled) {
if (toggled) {
if (!this.toggled) {
Expand Down Expand Up @@ -107,6 +115,18 @@ public void onDisable() {
}
}

public void onTick() {

}

public void onPlayerTick() {

}

public void onUpdate() {

}

public void enable() {
this.onEnable();
this.toggled = true;
Expand Down

This file was deleted.

15 changes: 3 additions & 12 deletions src/main/java/com/snoworange/mousse/module/ModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public ModuleManager() {
modules.add(new AutoAuto32k());
modules.add(new Grab32k());
//modules.add(new SelfBow());
modules.add(new Auto32k2019());

//EXPLOIT
modules.add(new SecretClose());
Expand Down Expand Up @@ -63,6 +64,8 @@ public ModuleManager() {
modules.add(new DiscordRPC());
modules.add(new Announcer());
modules.add(new GuiTheme());
//modules.add(new TrueDurability());
//modules.add(new DebugModule());

//RENDER
modules.add(new ShulkerPeek());
Expand Down Expand Up @@ -106,16 +109,4 @@ public static List<Module> getModulesByCategory(Category c) {
}
return modules;
}

public static Module getModuleP(final Predicate predicate) {
return (Module)getModulesP().stream().filter(predicate).findFirst().orElse(null);
}

public static List getModulesP(final Predicate predicate) {
return (List)getModulesP().stream().filter(predicate).collect(Collectors.toList());
}

public static List getModulesP() {
return getInstance().modules;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import com.snoworange.mousse.Main;
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.BlockAir;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.enchantment.EnchantmentHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void ez(final EntityPlayer entityPlayer) {
final int rand = new Random().nextInt(this.ezMessages.size());
AutoEz.targets.remove(name);

final String ezMessage = this.ezMessages.get(rand).replace("$name$", name);
final String ezMessage = this.ezMessages.get(rand).replace("$name$", name).replace("$clientname$", Main.NAME).replace("$version$", Main.VERSION);

mc.player.sendChatMessage(ezMessage);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -759,68 +759,60 @@ public void onRender3d(RenderWorldLastEvent event) {
public void placeStuff(int hopperIndex, int shulkerIndex, int redstoneIndex, int dispenserIndex, int obsidianIndex, BlockPos blockPos, EnumFacing enumFacing, Vec3d vec3d) {
mc.player.connection.sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.START_SNEAKING));

//Place obby (if empty)
//Place obby (forced)
if (mc.world.getBlockState(blockPos.up()).getBlock() instanceof BlockAir) {

if (obsidianIndex != -1) {

if (silentSwap.enable) {
mc.player.connection.sendPacket(new CPacketHeldItemChange(obsidianIndex));
mc.playerController.updateController();
} else {
mc.player.connection.sendPacket(new CPacketHeldItemChange(obsidianIndex));
mc.player.inventory.currentItem = obsidianIndex;
mc.playerController.updateController();
}

//mc.playerController.processRightClickBlock(mc.player, mc.world, blockPos, enumFacing, vec3d, EnumHand.MAIN_HAND);
placeBlock(blockPos);
mc.player.connection.sendPacket(new CPacketHeldItemChange(mc.player.inventory.currentItem));
mc.player.swingArm(EnumHand.MAIN_HAND);
if (silentSwap.enable) {
mc.player.connection.sendPacket(new CPacketHeldItemChange(obsidianIndex));
mc.playerController.updateController();
} else {
Main.sendMessage("Missing obsidian in your hotbar!");
disable();
mc.player.connection.sendPacket(new CPacketHeldItemChange(obsidianIndex));
mc.player.inventory.currentItem = obsidianIndex;
mc.playerController.updateController();
}

mc.playerController.processRightClickBlock(mc.player, mc.world, blockPos, EnumFacing.UP, new Vec3d(blockPos.getX(), blockPos.getY(), blockPos.getZ()), EnumHand.MAIN_HAND);
mc.player.connection.sendPacket(new CPacketHeldItemChange(mc.player.inventory.currentItem));
mc.player.swingArm(EnumHand.MAIN_HAND);
}

this.placedPos = blockPos.up();

//Dispenser placing phase
if ((mc.world.getBlockState(this.placedPos).getBlock().equals(Blocks.OBSIDIAN) || mc.world.getBlockState(this.placedPos).getBlock().equals(Blocks.BEDROCK) || mc.world.getBlockState(this.placedPos).isFullBlock()) && mc.world.getBlockState(this.placedPos.up()).getBlock() instanceof BlockAir) {

//Check witch direction the player needs to be rotate to rotate dispenser
float yaw = 0.0f;

if (dispenserDirection == EnumFacing.NORTH) {
yaw = -179.0f;
} else if (dispenserDirection == EnumFacing.EAST) {
yaw = -89.0f;
} else if (dispenserDirection == EnumFacing.SOUTH) {
yaw = 1.0f;
} else if (dispenserDirection == EnumFacing.WEST) {
yaw = 91.0f;
}
//if (mc.world.getBlockState(this.placedPos).isFullBlock() && mc.world.getBlockState(this.placedPos.up()).getBlock() instanceof BlockAir) {

//Check witch direction the player needs to be rotate to rotate dispenser
float yaw = 0.0f;

if (dispenserDirection == EnumFacing.NORTH) {
yaw = -179.0f;
} else if (dispenserDirection == EnumFacing.EAST) {
yaw = -89.0f;
} else if (dispenserDirection == EnumFacing.SOUTH) {
yaw = 1.0f;
} else if (dispenserDirection == EnumFacing.WEST) {
yaw = 91.0f;
}

if (silentSwap.enable) {
mc.player.connection.sendPacket(new CPacketHeldItemChange(dispenserIndex));
mc.playerController.updateController();
} else {
mc.player.connection.sendPacket(new CPacketHeldItemChange(dispenserIndex));
mc.player.inventory.currentItem = dispenserIndex;
mc.playerController.updateController();
}
if (silentSwap.enable) {
mc.player.connection.sendPacket(new CPacketHeldItemChange(dispenserIndex));
mc.playerController.updateController();
} else {
mc.player.connection.sendPacket(new CPacketHeldItemChange(dispenserIndex));
mc.player.inventory.currentItem = dispenserIndex;
mc.playerController.updateController();
}

//Sends rotation packet to rotate dispenser
mc.player.connection.sendPacket(new CPacketPlayer.Rotation(yaw, 0, mc.player.onGround));
mc.playerController.processRightClickBlock(mc.player, mc.world, this.placedPos, EnumFacing.UP, new Vec3d(this.placedPos.getX(), this.placedPos.getY(), this.placedPos.getZ()), EnumHand.MAIN_HAND);
//placeBlock(this.placedPos);
//Sends rotation packet to rotate dispenser
mc.player.connection.sendPacket(new CPacketPlayer.Rotation(yaw, 0, mc.player.onGround));
mc.playerController.processRightClickBlock(mc.player, mc.world, this.placedPos, EnumFacing.UP, new Vec3d(this.placedPos.getX(), this.placedPos.getY(), this.placedPos.getZ()), EnumHand.MAIN_HAND);
//placeBlock(this.placedPos);

mc.player.connection.sendPacket(new CPacketHeldItemChange(mc.player.inventory.currentItem));
mc.player.connection.sendPacket(new CPacketHeldItemChange(mc.player.inventory.currentItem));

prepareFastHopper = true;
prepareFastHopper = true;

mc.player.swingArm(EnumHand.MAIN_HAND);
}
mc.player.swingArm(EnumHand.MAIN_HAND);
//}

this.placedPos = blockPos.up(2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ public void onUpdate(LivingEvent.LivingUpdateEvent event) {
public void onPacketSend(PacketEvent.Send event) {
if (this.toggled) {
if (event.getPacket() instanceof CPacketCloseWindow) {
Label_0236:
Label_69420:
{
if (mode.is("Hopper")) {
if (!(lastGui instanceof GuiHopper)) {
if (!(mc.currentScreen instanceof GuiHopper)) {
break Label_0236;
break Label_69420;
}
}
event.setCanceled(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,37 +77,40 @@ public void onDisable() {
@SubscribeEvent
public void onChat(final ClientChatEvent event) {

for (final String s : Arrays.asList("/", ".", "-", ",", ":", ";", "'", "\"", "+", "@", "#", "&", "_")) {
if (event.getMessage().startsWith(s)) return;
}

if (customPrefix.enable) {
if (this.toggled) {

if (this.chatModifiers.size() == 0) {
Main.sendMessage("The BetterChat.txt file is empty. No prefix will be sent.");
return;
for (final String s : Arrays.asList("/", ".", "-", ",", ":", ";", "'", "\"", "+", "@", "#", "&", "_")) {
if (event.getMessage().startsWith(s)) return;
}

final String prefix = this.chatModifiers.get(0);
if (customPrefix.enable) {

event.setMessage(prefix + " " + event.getMessage());
} else if (!customPrefix.enable) {
event.setMessage("> " + event.getMessage());
}
if (this.chatModifiers.size() == 0) {
Main.sendMessage("The BetterChat.txt file is empty. No prefix will be sent.");
return;
}

if (customSuffix.enable) {
final String prefix = this.chatModifiers.get(0);

if (this.chatModifiers.size() <= 1) {
Main.sendMessage("The suffix text in BetterChat.txt is empty. No suffix will be sent.");
return;
event.setMessage(prefix + " " + event.getMessage());
} else if (!customPrefix.enable) {
event.setMessage("> " + event.getMessage());
}

final String suffix = this.chatModifiers.get(1);
if (customSuffix.enable) {

event.setMessage(event.getMessage() + suffix);
if (this.chatModifiers.size() <= 1) {
Main.sendMessage("The suffix text in BetterChat.txt is empty. No suffix will be sent.");
return;
}

final String suffix = this.chatModifiers.get(1);

} else if (!customSuffix.enable) {
event.setMessage(event.getMessage() + " / Mousse");
event.setMessage(event.getMessage() + suffix);

} else if (!customSuffix.enable) {
event.setMessage(event.getMessage() + " / Mousse");
}
}
}
}
Loading

0 comments on commit 2b99c17

Please sign in to comment.