forked from ChomeNS/chipmunkmod
Removed hack features from the GUI and added selfcare and rainbowname to it, also renamed the categories
This commit is contained in:
parent
ec6a142b73
commit
72bec0fbbf
40 changed files with 218 additions and 566 deletions
|
@ -39,7 +39,6 @@ public class CommandManager {
|
|||
AutoSkinCommand.register(this.dispatcher);
|
||||
ReloadConfigCommand.register(this.dispatcher);
|
||||
// LoopCrouchCommand.register(this.dispatcher); // ^???????????????????
|
||||
AutoDeopCommand.register(this.dispatcher);
|
||||
DebugCommand.register(this.dispatcher);
|
||||
ClearAntiChatSpamQueueCommand.register(this.dispatcher);
|
||||
}
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
package land.chipmunk.chipmunkmod.commands;
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.context.CommandContext;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.op.AutoDeopModule;
|
||||
import land.chipmunk.chipmunkmod.util.Chat;
|
||||
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import static com.mojang.brigadier.arguments.StringArgumentType.getString;
|
||||
import static com.mojang.brigadier.arguments.StringArgumentType.string;
|
||||
import static land.chipmunk.chipmunkmod.command.CommandManager.argument;
|
||||
import static land.chipmunk.chipmunkmod.command.CommandManager.literal;
|
||||
|
||||
public class AutoDeopCommand {
|
||||
public static void register (CommandDispatcher<FabricClientCommandSource> dispatcher) {
|
||||
final AutoDeopCommand instance = new AutoDeopCommand();
|
||||
dispatcher.register(
|
||||
literal("autodeop")
|
||||
.then(
|
||||
literal("add")
|
||||
.then(argument("username", string()).executes(instance::add))
|
||||
)
|
||||
.then(
|
||||
literal("remove")
|
||||
.then(argument("username", string()).executes(instance::remove))
|
||||
)
|
||||
.then(
|
||||
literal("list").executes(instance::list)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public int add(CommandContext<FabricClientCommandSource> context) throws CommandSyntaxException {
|
||||
String username = getString(context, "username");
|
||||
if(AutoDeopModule.players.contains(username)) {
|
||||
throw new SimpleCommandExceptionType(Text.translatable("That player is already in the AutoDeop list!")).create();
|
||||
}
|
||||
AutoDeopModule.players.add(username);
|
||||
Chat.sendGreen("Added " + username + " to the AutoDeop list!");
|
||||
return 1;
|
||||
}
|
||||
public int remove(CommandContext<FabricClientCommandSource> context) throws CommandSyntaxException {
|
||||
String username = getString(context, "username");
|
||||
if(!AutoDeopModule.players.contains(username)) {
|
||||
throw new SimpleCommandExceptionType(Text.translatable("That player is not in the AutoDeop list!")).create();
|
||||
}
|
||||
AutoDeopModule.players.remove(username);
|
||||
Chat.sendGreen("Removed " + username + " to the AutoDeop list!");
|
||||
return 1;
|
||||
}
|
||||
public int list(CommandContext<FabricClientCommandSource> context) {
|
||||
Chat.sendGold("AutoDeop player list:");
|
||||
for (String player : AutoDeopModule.players) {
|
||||
Chat.send(" - " + player);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
|
@ -3,19 +3,13 @@ package land.chipmunk.chipmunkmod.commands;
|
|||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.context.CommandContext;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.op.AutoDeopModule;
|
||||
import land.chipmunk.chipmunkmod.util.Chat;
|
||||
import land.chipmunk.chipmunkmod.util.Executor;
|
||||
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import static com.mojang.brigadier.arguments.StringArgumentType.getString;
|
||||
import static com.mojang.brigadier.arguments.StringArgumentType.string;
|
||||
import static land.chipmunk.chipmunkmod.command.CommandManager.argument;
|
||||
import static land.chipmunk.chipmunkmod.command.CommandManager.literal;
|
||||
|
||||
public class ClearAntiChatSpamQueueCommand {
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package land.chipmunk.chipmunkmod.mixin;
|
||||
|
||||
import land.chipmunk.chipmunkmod.ChipmunkMod;
|
||||
import land.chipmunk.chipmunkmod.listeners.Listener;
|
||||
import land.chipmunk.chipmunkmod.listeners.ListenerManager;
|
||||
import land.chipmunk.chipmunkmod.modules.RainbowName;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.op.AutoDeopModule;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.utility.AntiChatSpamModule;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.anti_annoyances.AntiChatSpamModule;
|
||||
import land.chipmunk.chipmunkmod.util.Debug;
|
||||
import land.chipmunk.chipmunkmod.util.Executor;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
@ -21,9 +19,6 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@Mixin(net.minecraft.client.gui.hud.ChatHud.class)
|
||||
public abstract class ChatHudMixin {
|
||||
|
||||
|
@ -33,17 +28,6 @@ public abstract class ChatHudMixin {
|
|||
|
||||
@Shadow protected abstract void logChatMessage(Text message, @Nullable MessageIndicator indicator);
|
||||
|
||||
@Inject(method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignatureData;Lnet/minecraft/client/gui/hud/MessageIndicator;)V", at = @At("TAIL"))
|
||||
private void testclient$autoDeopListener(Text message, MessageSignatureData signature, MessageIndicator indicator, CallbackInfo ci) {
|
||||
String pattern = "\\[(.*?)\\: Made (.*?) a server operator\\]";
|
||||
|
||||
|
||||
Matcher matcher = Pattern.compile(pattern).matcher(message.getString());
|
||||
|
||||
if (matcher.find()) {
|
||||
AutoDeopModule.execute(matcher.group(1), matcher.group(2));
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignatureData;Lnet/minecraft/client/gui/hud/MessageIndicator;)V", at = @At("HEAD"), cancellable = true)
|
||||
public void chipmunkmod$preventDoubleMessageLogging(Text message, MessageSignatureData signature, MessageIndicator indicator, CallbackInfo ci) {
|
||||
|
|
|
@ -2,15 +2,12 @@ package land.chipmunk.chipmunkmod.mixin;
|
|||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.handler.codec.DecoderException;
|
||||
import land.chipmunk.chipmunkmod.ChipmunkMod;
|
||||
import land.chipmunk.chipmunkmod.listeners.Listener;
|
||||
import land.chipmunk.chipmunkmod.listeners.ListenerManager;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.antip2w.DelayPacketsModule;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.utility.AntiParticleKickModule;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.lag_prevention.AntiParticleKickModule;
|
||||
import land.chipmunk.chipmunkmod.util.Chat;
|
||||
import net.minecraft.network.listener.PacketListener;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.RequestCommandCompletionsC2SPacket;
|
||||
import net.minecraft.network.packet.s2c.play.ParticleS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket;
|
||||
|
@ -25,8 +22,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||
|
||||
import java.util.Optional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@Mixin(net.minecraft.network.ClientConnection.class)
|
||||
public class ClientConnectionMixin {
|
||||
@Inject(at = @At("HEAD"), method = "disconnect", cancellable = true)
|
||||
|
@ -88,19 +83,5 @@ public class ClientConnectionMixin {
|
|||
}
|
||||
}
|
||||
|
||||
@Inject(method = "send(Lnet/minecraft/network/packet/Packet;)V", at = @At("HEAD"), cancellable = true)
|
||||
private void testclient$delayPackets(Packet<?> packet, CallbackInfo ci) {
|
||||
if(DelayPacketsModule.instance.isEnabled) {
|
||||
DelayPacketsModule.packetsToSend.add(packet);
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "disconnect", at = @At("TAIL"))
|
||||
private void testclient$disablePacketDelayerOnDisconnect(Text disconnectReason, CallbackInfo ci) {
|
||||
DelayPacketsModule.instance.isEnabled = false;
|
||||
DelayPacketsModule.packetsToSend = new ArrayList<>();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package land.chipmunk.chipmunkmod.mixin;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.utility.BlockGuardianParticlesModule;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.lag_prevention.BlockGuardianParticlesModule;
|
||||
import land.chipmunk.chipmunkmod.util.SharedVariables;
|
||||
import net.minecraft.client.particle.ElderGuardianAppearanceParticle;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package land.chipmunk.chipmunkmod.mixin;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.utility.AntiTextObfuscationLagModule;
|
||||
import land.chipmunk.chipmunkmod.util.Debug;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.lag_prevention.AntiTextObfuscationLagModule;
|
||||
import net.minecraft.client.font.FontStorage;
|
||||
import net.minecraft.client.font.Glyph;
|
||||
import net.minecraft.client.font.GlyphRenderer;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package land.chipmunk.chipmunkmod.mixin;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.antip2w.DelayPacketsModule;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.utility.GuiMoveModule;
|
||||
import net.minecraft.client.Keyboard;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
|
@ -16,18 +14,9 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||
|
||||
@Mixin(Keyboard.class)
|
||||
public class KeyboardMixin {
|
||||
@Inject(method = "onKey", at = @At("HEAD"), cancellable = true)
|
||||
private void testclient$keyBindsOverrides(long window, int key, int scancode, int action, int modifiers, CallbackInfo ci) {
|
||||
if(key == GLFW.GLFW_KEY_KP_0 && action == 1) {
|
||||
DelayPacketsModule.instance.isEnabled = !DelayPacketsModule.instance.isEnabled;
|
||||
if(!DelayPacketsModule.instance.isEnabled) {
|
||||
DelayPacketsModule.instance.deactivateRunnable.run();
|
||||
}
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
// Don't @ me. It half-works
|
||||
// LUNA WHAT THE FUCK IS THIS MIXIN AM I SUPPOSED TO UNDERSTAND THIS
|
||||
@Redirect(method = "onKey(JIIII)V",
|
||||
at = @At(value = "FIELD", target = "Lnet/minecraft/client/MinecraftClient;currentScreen:Lnet/minecraft/client/gui/screen/Screen;", opcode = Opcodes.GETFIELD),
|
||||
slice = @Slice(
|
||||
|
@ -36,10 +25,10 @@ public class KeyboardMixin {
|
|||
)
|
||||
)
|
||||
private Screen currentScreen(MinecraftClient instance) {
|
||||
if (GuiMoveModule.instance.isEnabled) {
|
||||
return null;
|
||||
} else {
|
||||
// if (GuiMoveModule.instance.isEnabled) {
|
||||
// return null;
|
||||
// } else {
|
||||
return instance.currentScreen;
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
package land.chipmunk.chipmunkmod.mixin;
|
||||
|
||||
import net.minecraft.network.PacketBundleHandler;
|
||||
import net.minecraft.network.listener.PacketListener;
|
||||
import net.minecraft.network.packet.BundlePacket;
|
||||
import net.minecraft.network.packet.BundleSplitterPacket;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
@Mixin(PacketBundleHandler.class)
|
||||
public interface PacketBundleHandlerMixin {
|
||||
|
||||
}
|
|
@ -1,6 +1,4 @@
|
|||
package land.chipmunk.chipmunkmod.mixin;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.movement.SlipperyWorldModule;
|
||||
import net.minecraft.block.Block;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
@ -9,10 +7,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|||
|
||||
@Mixin(Block.class)
|
||||
public class PlayerEntityMixin {
|
||||
@Inject(method = "getSlipperiness", at = @At("HEAD"), cancellable = true)
|
||||
private void testclient$slipperyWorld(CallbackInfoReturnable<Float> cir) {
|
||||
if(SlipperyWorldModule.instance.isEnabled) {
|
||||
cir.setReturnValue(((Double) SlipperyWorldModule.instance.optionList.get(0).optionValue).floatValue());
|
||||
}
|
||||
}
|
||||
//slippery world was here
|
||||
//TODO: remove
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package land.chipmunk.chipmunkmod.mixin;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.utility.AntiTextObfuscationLagModule;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.lag_prevention.AntiTextObfuscationLagModule;
|
||||
import net.minecraft.client.render.WorldRenderer;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
|
|
@ -139,6 +139,10 @@ public class CommandCore {
|
|||
final ClientConnection connection = client.getNetworkHandler().getConnection();
|
||||
final BlockPos currentBlock = currentBlockAbsolute();
|
||||
|
||||
// String prefix = new Throwable().getStackTrace()[1].getClassName();
|
||||
// String block = currentBlock.toShortString();
|
||||
// ChipmunkMod.LOGGER.info(prefix + " ran command in block " + block + " of core");
|
||||
|
||||
// TODO: Support using repeating command blocks (on kaboom-like servers) (because less packets)
|
||||
connection.send(new UpdateCommandBlockC2SPacket(currentBlock, "", CommandBlockBlockEntity.Type.REDSTONE, false, false, false));
|
||||
connection.send(new UpdateCommandBlockC2SPacket(currentBlock, command, CommandBlockBlockEntity.Type.REDSTONE, false, false, true));
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package land.chipmunk.chipmunkmod.modules;
|
||||
|
||||
import land.chipmunk.chipmunkmod.ChipmunkMod;
|
||||
import land.chipmunk.chipmunkmod.util.ColorUtilities;
|
||||
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.TextColor;
|
||||
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
|
||||
|
@ -29,6 +29,7 @@ public class RainbowName {
|
|||
public String displayName;
|
||||
|
||||
private int startHue = 0;
|
||||
public double speed = 1;
|
||||
|
||||
public void init () {
|
||||
final TimerTask task = new TimerTask() {
|
||||
|
@ -90,6 +91,7 @@ public class RainbowName {
|
|||
|
||||
public void enable () {
|
||||
enabled = true;
|
||||
this.displayName = ChipmunkMod.CONFIG.defaultUsername;
|
||||
}
|
||||
|
||||
public void disable () {
|
||||
|
@ -100,7 +102,7 @@ public class RainbowName {
|
|||
|
||||
public RainbowName (MinecraftClient client) {
|
||||
this.client = client;
|
||||
this.displayName = client.getSession().getUsername();
|
||||
this.displayName = ChipmunkMod.CONFIG.defaultUsername;
|
||||
}
|
||||
|
||||
private void tick () {
|
||||
|
@ -113,9 +115,8 @@ public class RainbowName {
|
|||
}
|
||||
|
||||
if (!enabled) return;
|
||||
|
||||
int hue = startHue;
|
||||
int increment = (int) (360.0 / Math.max(displayName.length(), 20));
|
||||
int increment = (int) (360.0 / Math.max(displayName.length(), 20) * speed);
|
||||
|
||||
Component component = Component.empty();
|
||||
StringBuilder essentialsNickname = new StringBuilder();
|
||||
|
@ -127,7 +128,7 @@ public class RainbowName {
|
|||
hue = (hue + increment) % 360;
|
||||
}
|
||||
|
||||
CommandCore.INSTANCE.run("essentials:nick " + client.getSession().getUsername() + " " + essentialsNickname);
|
||||
CommandCore.INSTANCE.run("essentials:nick " + ChipmunkMod.CONFIG.defaultUsername + " " + essentialsNickname);
|
||||
|
||||
startHue = (startHue + increment) % 360;
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -3,6 +3,7 @@ package land.chipmunk.chipmunkmod.modules;
|
|||
import land.chipmunk.chipmunkmod.ChipmunkMod;
|
||||
import land.chipmunk.chipmunkmod.listeners.Listener;
|
||||
import land.chipmunk.chipmunkmod.listeners.ListenerManager;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.anti_annoyances.SelfCareModule;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
import net.minecraft.client.network.ClientPlayerEntity;
|
||||
|
@ -81,7 +82,9 @@ public class SelfCare extends Listener {
|
|||
gameMode = -1;
|
||||
|
||||
hasSkin = false;
|
||||
cspy = false;
|
||||
// cspy too mabe?
|
||||
// why was cspy not here lol
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -99,19 +102,21 @@ public class SelfCare extends Listener {
|
|||
}
|
||||
|
||||
public void tick () {
|
||||
final ClientPlayerEntity player = client.player;
|
||||
final ClientPlayNetworkHandler networkHandler = client.getNetworkHandler();
|
||||
|
||||
if (networkHandler == null) {
|
||||
cleanup();
|
||||
return;
|
||||
}
|
||||
if(!SelfCareModule.instance.isEnabled) return;
|
||||
|
||||
final ClientPlayerEntity player = client.player;
|
||||
if (player != null && !player.hasPermissionLevel(2) && opEnabled) { if (serverHasCommand("op")) networkHandler.sendChatCommand("op @s[type=player]"); }
|
||||
else if (gameMode != 1 && gamemodeEnabled) networkHandler.sendChatCommand("gamemode creative");
|
||||
}
|
||||
|
||||
public void chatTick () {
|
||||
if(!SelfCareModule.instance.isEnabled) return;
|
||||
final ClientPlayNetworkHandler networkHandler = client.getNetworkHandler();
|
||||
|
||||
if (!cspy && cspyEnabled) { if (serverHasCommand("c")) networkHandler.sendChatCommand("c on"); }
|
||||
|
|
|
@ -3,28 +3,27 @@ package land.chipmunk.chipmunkmod.testclient.gui;
|
|||
import land.chipmunk.chipmunkmod.testclient.gui.components.Module;
|
||||
import land.chipmunk.chipmunkmod.ChipmunkMod;
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Category;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.antip2w.DelayPacketsModule;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.combat.KillAuraModule;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.movement.*;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.op.AntiTeleportModule;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.op.AutoDeopModule;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.op.AutoOpModule;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.op.AutoSudoKickModule;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.utility.*;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.anti_annoyances.AntiChatSpamModule;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.anti_annoyances.SelfCareModule;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.fun.RainbowNameModule;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.lag_prevention.AntiParticleKickModule;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.lag_prevention.AntiTextObfuscationLagModule;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.lag_prevention.BlockGuardianParticlesModule;
|
||||
import land.chipmunk.chipmunkmod.testclient.modules.anti_annoyances.AntiTeleportModule;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.Drawable;
|
||||
import net.minecraft.client.gui.Element;
|
||||
import net.minecraft.client.gui.Selectable;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
|
||||
public class Gui extends Screen{
|
||||
public class
|
||||
Gui extends Screen{
|
||||
|
||||
public static ArrayList<Category> categoryList = new ArrayList<>();
|
||||
|
||||
|
@ -162,36 +161,22 @@ public class Gui extends Screen{
|
|||
|
||||
|
||||
public static void addComponents() {
|
||||
new Category("Movement")
|
||||
.withModule(new FlightModule())
|
||||
.withModule(new SpeedModule())
|
||||
.withModule(new FreezeModule())
|
||||
.withModule(new AirJumpModule())
|
||||
.withModule(new JesusModule())
|
||||
.withModule(SlipperyWorldModule.instance)
|
||||
.register();
|
||||
new Category("Combat")
|
||||
.withModule(new KillAuraModule())
|
||||
.withModule(new Module("Reach"))
|
||||
.withModule(new Module("Bow Aimbot"))
|
||||
.register();
|
||||
new Category("Utility")
|
||||
.withModule(AutoToolsModule.instance)
|
||||
.withModule(AntiVoidModule.instance)
|
||||
new Category("Lag prevention")
|
||||
.withModule(AntiParticleKickModule.instance) //TODO: make kick prevention module
|
||||
.withModule(BlockGuardianParticlesModule.instance)
|
||||
.withModule(GuiMoveModule.instance)
|
||||
.withModule(AntiChatSpamModule.instance)
|
||||
.withModule(AntiTextObfuscationLagModule.instance)
|
||||
.register();
|
||||
new Category("OP")
|
||||
new Category("Anti annoyances")
|
||||
.withModule(AntiChatSpamModule.instance)
|
||||
.withModule(new AntiTeleportModule())
|
||||
.withModule(AutoDeopModule.instance)
|
||||
.withModule(AutoOpModule.instance)
|
||||
.withModule(AutoSudoKickModule.instance)
|
||||
.withModule(SelfCareModule.instance)
|
||||
.register();
|
||||
new Category("p2w")
|
||||
.withModule(DelayPacketsModule.instance)
|
||||
new Category("Fun")
|
||||
.withModule(RainbowNameModule.instance)
|
||||
.register();
|
||||
// new Category("OP")
|
||||
// .withModule(AutoOpModule.instance) //TODO: make selfcare module
|
||||
// .register();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -112,11 +112,11 @@ public class Module extends ButtonWidget {
|
|||
// }
|
||||
// }
|
||||
|
||||
public Module atActivate(Runnable runnable) {
|
||||
public Module onActivate(Runnable runnable) {
|
||||
activateRunnable = runnable;
|
||||
return this;
|
||||
}
|
||||
public Module atDeactivate(Runnable runnable) {
|
||||
public Module onDeactivate(Runnable runnable) {
|
||||
deactivateRunnable = runnable;
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
package land.chipmunk.chipmunkmod.testclient.gui.components.options;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Option;
|
||||
import net.minecraft.client.gui.widget.CheckboxWidget;
|
||||
import net.minecraft.client.gui.widget.SliderWidget;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
public class BooleanCheckboxOption extends Option<Boolean> {
|
||||
private RunnableWithParameter<Boolean> onPress = value -> {};
|
||||
|
||||
CheckboxWidget checkboxWidget = new CheckboxWidget(0, 0, 20, 20, Text.empty(), optionValue) {
|
||||
@Override
|
||||
public void onPress() {
|
||||
optionValue = !optionValue;
|
||||
onPress.run(optionValue);
|
||||
|
||||
// equivalent of `checked = optionValue`, but checked is private so i have to use this :(
|
||||
try {
|
||||
Field checked = CheckboxWidget.class.getDeclaredField("checked");
|
||||
checked.setAccessible(true);
|
||||
checked.set(this, optionValue);
|
||||
} catch(NoSuchFieldException | IllegalAccessException e) {e.printStackTrace();}
|
||||
}
|
||||
};
|
||||
|
||||
public BooleanCheckboxOption(String name, boolean defaultValue) {
|
||||
super(name, defaultValue);
|
||||
optionValue = defaultValue;
|
||||
widget = checkboxWidget;
|
||||
}
|
||||
public BooleanCheckboxOption(String name, boolean defaultValue, RunnableWithParameter<Boolean> onPress) {
|
||||
super(name, defaultValue);
|
||||
optionValue = defaultValue;
|
||||
widget = checkboxWidget;
|
||||
this.onPress = onPress;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValueFromString(String string) {
|
||||
optionValue = Boolean.valueOf(string);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValueAsString() {
|
||||
return Boolean.toString(optionValue);
|
||||
}
|
||||
|
||||
public interface RunnableWithParameter<T> {
|
||||
void run(T value);
|
||||
}
|
||||
}
|
||||
|
|
@ -5,6 +5,8 @@ import net.minecraft.client.MinecraftClient;
|
|||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class StringOption extends Option<String> {
|
||||
TextFieldWidget textFieldWidget = new TextFieldWidget(MinecraftClient.getInstance().textRenderer, 0, 0, 200, 20, Text.empty());
|
||||
public StringOption(String name, String defaultValue) {
|
||||
|
@ -15,6 +17,16 @@ public class StringOption extends Option<String> {
|
|||
});
|
||||
widget = textFieldWidget;
|
||||
}
|
||||
public StringOption(String name, String defaultValue, Consumer<String> onChanged) {
|
||||
super(name, defaultValue);
|
||||
textFieldWidget.setText(defaultValue);
|
||||
textFieldWidget.setChangedListener(text -> {
|
||||
optionValue = text;
|
||||
onChanged.accept(text);
|
||||
});
|
||||
widget = textFieldWidget;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValueFromString(String string) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package land.chipmunk.chipmunkmod.testclient.modules.utility;
|
||||
package land.chipmunk.chipmunkmod.testclient.modules.anti_annoyances;
|
||||
|
||||
import land.chipmunk.chipmunkmod.ChipmunkMod;
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Module;
|
|
@ -1,4 +1,4 @@
|
|||
package land.chipmunk.chipmunkmod.testclient.modules.op;
|
||||
package land.chipmunk.chipmunkmod.testclient.modules.anti_annoyances;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Module;
|
||||
import land.chipmunk.chipmunkmod.util.Chat;
|
|
@ -0,0 +1,52 @@
|
|||
package land.chipmunk.chipmunkmod.testclient.modules.anti_annoyances;
|
||||
|
||||
import land.chipmunk.chipmunkmod.ChipmunkMod;
|
||||
import land.chipmunk.chipmunkmod.modules.SelfCare;
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Module;
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.options.BooleanCheckboxOption;
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.options.StringOption;
|
||||
|
||||
public class SelfCareModule extends Module {
|
||||
public static SelfCareModule instance = new SelfCareModule();
|
||||
BooleanCheckboxOption opOption = new BooleanCheckboxOption(
|
||||
"OP",
|
||||
SelfCare.INSTANCE.opEnabled,
|
||||
value -> SelfCare.INSTANCE.opEnabled = value
|
||||
);
|
||||
BooleanCheckboxOption gmcOption = new BooleanCheckboxOption(
|
||||
"Creative mode",
|
||||
SelfCare.INSTANCE.gamemodeEnabled,
|
||||
value -> SelfCare.INSTANCE.gamemodeEnabled = value
|
||||
);
|
||||
BooleanCheckboxOption cspyOption = new BooleanCheckboxOption(
|
||||
"Command spy",
|
||||
SelfCare.INSTANCE.cspyEnabled,
|
||||
value -> SelfCare.INSTANCE.cspyEnabled = value
|
||||
);
|
||||
StringOption skinUsernameOption = new StringOption(
|
||||
"Skin's username",
|
||||
ChipmunkMod.CONFIG.defaultUsername,
|
||||
s -> {
|
||||
SelfCare.INSTANCE.hasSkin = false;
|
||||
}
|
||||
);
|
||||
BooleanCheckboxOption skinOption = new BooleanCheckboxOption(
|
||||
"Skin",
|
||||
SelfCare.INSTANCE.skin.equals("off")
|
||||
// value -> {
|
||||
// SelfCare.INSTANCE.skin = value ? skinUsernameOption.optionValue : "off";
|
||||
// }
|
||||
);
|
||||
public SelfCareModule() {
|
||||
super("Self care");
|
||||
withOption(opOption);
|
||||
withOption(gmcOption);
|
||||
withOption(cspyOption);
|
||||
withOption(skinOption);
|
||||
withOption(skinUsernameOption);
|
||||
endTickRunnable = () -> {
|
||||
// make it update the skin self acre username
|
||||
SelfCare.INSTANCE.skin = skinOption.optionValue ? skinUsernameOption.optionValue : "off";
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
package land.chipmunk.chipmunkmod.testclient.modules.antip2w;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Module;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class DelayPacketsModule extends Module {
|
||||
public static DelayPacketsModule instance = new DelayPacketsModule();
|
||||
public static ArrayList<Packet<?>> packetsToSend = new ArrayList<>();
|
||||
public DelayPacketsModule() {
|
||||
super("Delay packets");
|
||||
deactivateRunnable = () -> {
|
||||
packetsToSend.forEach(packet -> {
|
||||
MinecraftClient.getInstance().getNetworkHandler().getConnection().send(packet);
|
||||
});
|
||||
packetsToSend = new ArrayList<>();
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
package land.chipmunk.chipmunkmod.testclient.modules.combat;
|
||||
|
||||
import land.chipmunk.chipmunkmod.ChipmunkMod;
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Module;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.command.argument.EntityAnchorArgumentType;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.math.Box;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Objects;
|
||||
|
||||
public class KillAuraModule extends Module {
|
||||
ArrayList<EntityType> attackEntityList = new ArrayList<>();
|
||||
double reach = 10;
|
||||
static boolean debug = false;
|
||||
public KillAuraModule() {
|
||||
super("KillAura");
|
||||
attackEntityList.add(EntityType.ZOMBIE);
|
||||
endTickRunnable = () -> {
|
||||
|
||||
debug("Ticked!");
|
||||
for (Entity entity : MinecraftClient.getInstance().world.getOtherEntities(MinecraftClient.getInstance().player, Box.of(MinecraftClient.getInstance().player.getEyePos(), reach / 2, reach / 2, reach / 2))) {
|
||||
debug("Found entity " + entity.getType().toString());
|
||||
for (EntityType entityType : attackEntityList) {
|
||||
if(Objects.equals(entity.getType().toString(), entityType.toString())) {
|
||||
debug("And is of the correct entity type");
|
||||
MinecraftClient.getInstance().inGameHud.setSubtitle(Text.literal(entity.getType().toString()));
|
||||
MinecraftClient.getInstance().player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, entity.getPos());
|
||||
if(MinecraftClient.getInstance().player.getAttackCooldownProgress(0)==1) {
|
||||
MinecraftClient.getInstance().interactionManager.attackEntity(MinecraftClient.getInstance().player, entity);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
// for (Entity entity : MinecraftClient.getInstance().world.getEntities()) {
|
||||
// if(entity.equals(MinecraftClient.getInstance().player)) return;
|
||||
// debug(WorldUtil.getPlayerDistance(entity.getPos()) + " blocks away");
|
||||
// if(WorldUtil.getPlayerDistance(entity.getPos()) > reach) return;
|
||||
// debug("Which is close enough to the player");
|
||||
// MinecraftClient.getInstance().inGameHud.setTitle(Text.literal(entity.getType().toString()));
|
||||
// debug("Found entity " + entity.getType().toString());
|
||||
// for (EntityType entityType : attackEntityList) {
|
||||
// if(Objects.equals(entity.getType().toString(), entityType.toString())) {
|
||||
// debug("And is of the correct entity type");
|
||||
// MinecraftClient.getInstance().inGameHud.setSubtitle(Text.literal(entity.getType().toString()));
|
||||
//// MinecraftClient.getInstance().player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, entity.getPos());
|
||||
// MinecraftClient.getInstance().interactionManager.attackEntity(MinecraftClient.getInstance().player, entity);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
};
|
||||
}
|
||||
private static void debug(String message) {
|
||||
if(debug) ChipmunkMod.LOGGER.info("[KillAura] " + message);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package land.chipmunk.chipmunkmod.testclient.modules.fun;
|
||||
|
||||
import land.chipmunk.chipmunkmod.modules.RainbowName;
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Module;
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.options.DoubleSliderOption;
|
||||
|
||||
public class RainbowNameModule extends Module {
|
||||
public static RainbowNameModule instance = new RainbowNameModule();
|
||||
public static DoubleSliderOption speedOption;
|
||||
public RainbowNameModule() {
|
||||
super("Rainbow name");
|
||||
speedOption = new DoubleSliderOption("Speed", 1, 0.1, 2, 2);
|
||||
withOption(speedOption);
|
||||
needsInWorld = true;
|
||||
// onActivate(RainbowName.INSTANCE::enable);
|
||||
onDeactivate(RainbowName.INSTANCE::disable);
|
||||
atEndTick(() -> {
|
||||
RainbowName.INSTANCE.enable();
|
||||
RainbowName.INSTANCE.speed = speedOption.optionValue;
|
||||
});
|
||||
|
||||
}
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
package land.chipmunk.chipmunkmod.testclient.modules.utility;
|
||||
package land.chipmunk.chipmunkmod.testclient.modules.lag_prevention;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Module;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
public class AntiParticleKickModule extends Module {
|
||||
public static AntiParticleKickModule instance = new AntiParticleKickModule();
|
|
@ -1,4 +1,4 @@
|
|||
package land.chipmunk.chipmunkmod.testclient.modules.utility;
|
||||
package land.chipmunk.chipmunkmod.testclient.modules.lag_prevention;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Module;
|
||||
|
|
@ -1,9 +1,8 @@
|
|||
package land.chipmunk.chipmunkmod.testclient.modules.utility;
|
||||
package land.chipmunk.chipmunkmod.testclient.modules.lag_prevention;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Module;
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.options.StringOption;
|
||||
import land.chipmunk.chipmunkmod.util.Chat;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
public class BlockGuardianParticlesModule extends Module {
|
||||
public static BlockGuardianParticlesModule instance = new BlockGuardianParticlesModule();
|
|
@ -1,25 +0,0 @@
|
|||
package land.chipmunk.chipmunkmod.testclient.modules.movement;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Module;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
public class AirJumpModule extends Module {
|
||||
boolean wasSpacePressed;
|
||||
public AirJumpModule() {
|
||||
super("Air Jump");
|
||||
wasSpacePressed = false;
|
||||
endTickRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(MinecraftClient.getInstance().options.jumpKey.wasPressed() && !wasSpacePressed) {
|
||||
wasSpacePressed = true;
|
||||
Vec3d v = MinecraftClient.getInstance().player.getVelocity();
|
||||
MinecraftClient.getInstance().player.setVelocity(v.x, 0.35, v.z);
|
||||
} else if (!MinecraftClient.getInstance().options.jumpKey.wasPressed()) {
|
||||
wasSpacePressed = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package land.chipmunk.chipmunkmod.testclient.modules.movement;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Module;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
public class AntiVoidModule extends Module {
|
||||
public static AntiVoidModule instance = new AntiVoidModule();
|
||||
public AntiVoidModule() {
|
||||
super("Anti void");
|
||||
endTickRunnable = () -> {
|
||||
if(MinecraftClient.getInstance().player.getY() < -64) {
|
||||
MinecraftClient.getInstance().player.setPosition(MinecraftClient.getInstance().player.getX(), -64, MinecraftClient.getInstance().player.getZ());
|
||||
MinecraftClient.getInstance().player.setOnGround(true);
|
||||
}
|
||||
};
|
||||
isEnabled = true;
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package land.chipmunk.chipmunkmod.testclient.modules.movement;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Module;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
public class FlightModule extends Module {
|
||||
public FlightModule() {
|
||||
super("Flight");
|
||||
endTickRunnable = () -> MinecraftClient.getInstance().player.getAbilities().allowFlying = true;
|
||||
deactivateRunnable = () -> {
|
||||
if(MinecraftClient.getInstance().player != null)
|
||||
MinecraftClient.getInstance().player.getAbilities().allowFlying = MinecraftClient.getInstance().player.getAbilities().creativeMode;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
package land.chipmunk.chipmunkmod.testclient.modules.movement;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Module;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
public class FreezeModule extends Module {
|
||||
public static Vec3d mantainPos;
|
||||
public FreezeModule() {
|
||||
super("Freeze");
|
||||
activateRunnable = () -> {
|
||||
mantainPos = MinecraftClient.getInstance().player.getPos();
|
||||
};
|
||||
endTickRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
MinecraftClient.getInstance().player.setVelocity(0, 0, 0);
|
||||
MinecraftClient.getInstance().player.setPosition(mantainPos);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
package land.chipmunk.chipmunkmod.testclient.modules.movement;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Module;
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.options.DoubleSliderOption;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
public class JesusModule extends Module {
|
||||
public static boolean forceOnGround = false;
|
||||
public JesusModule() {
|
||||
super("Jesus");
|
||||
withOption(new DoubleSliderOption("Float strength", 0.2, 0, 2, 3));
|
||||
withOption(new DoubleSliderOption("Recognise top offset", 0.4, 0, 1, 4));
|
||||
withOption(new DoubleSliderOption("Walk offset", 0.4, 0, 1, 4));
|
||||
endTickRunnable = () -> {
|
||||
// do stuffs
|
||||
// Material material = MinecraftClient.getInstance().player.getBlockStateAtPos().getMaterial();
|
||||
Vec3d pos = MinecraftClient.getInstance().player.getPos();
|
||||
pos = new Vec3d(pos.x, pos.y-((double) optionList.get(2).optionValue), pos.z);
|
||||
Block material = MinecraftClient.getInstance().world.getBlockState(BlockPos.ofFloored(pos)).getBlock();
|
||||
Vec3d posRightAbove = new Vec3d(pos.x, ((int) (pos.y+((double) optionList.get(1).optionValue))), pos.z);
|
||||
Vec3d posRightUnder = new Vec3d(pos.x, ((int) (pos.y-((double) optionList.get(1).optionValue))), pos.z);
|
||||
// posRightAbove.floorAlongAxes(EnumSet.of(Direction.Axis.Y));
|
||||
Block materialRightAbove = MinecraftClient.getInstance().world.getBlockState(BlockPos.ofFloored(posRightAbove.x, posRightAbove.y, posRightAbove.z)).getBlock();
|
||||
Block materialRightUnder = MinecraftClient.getInstance().world.getBlockState(BlockPos.ofFloored(posRightUnder.x, posRightUnder.y, posRightUnder.z)).getBlock();
|
||||
Vec3d walkOn = new Vec3d(posRightAbove.x, posRightAbove.y+((double) optionList.get(2).optionValue), posRightAbove.z);
|
||||
|
||||
if(material == Blocks.WATER || material == Blocks.LAVA) {
|
||||
Vec3d v = MinecraftClient.getInstance().player.getVelocity();
|
||||
if(materialRightAbove == Blocks.AIR || materialRightUnder == Blocks.AIR) {
|
||||
MinecraftClient.getInstance().player.setPosition(walkOn);
|
||||
MinecraftClient.getInstance().player.setOnGround(true);
|
||||
MinecraftClient.getInstance().player.setVelocity(v.x, 0, v.z);
|
||||
return;
|
||||
}
|
||||
// if there isn't air *right above* the feet, send player up
|
||||
MinecraftClient.getInstance().player.setVelocity(v.x, ((double) optionList.get(0).optionValue), v.z);
|
||||
} else forceOnGround = false;
|
||||
MinecraftClient.getInstance().player.isOnGround();
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
package land.chipmunk.chipmunkmod.testclient.modules.movement;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Module;
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.options.DoubleSliderOption;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
public class SlipperyWorldModule extends Module {
|
||||
public static SlipperyWorldModule instance = new SlipperyWorldModule();
|
||||
public SlipperyWorldModule() {
|
||||
super("Slippery world");
|
||||
withOption(new DoubleSliderOption("Slipperiness", 0, -5, 5, 2));
|
||||
}
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
package land.chipmunk.chipmunkmod.testclient.modules.movement;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Module;
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.options.DoubleSliderOption;
|
||||
import land.chipmunk.chipmunkmod.util.AttributeModifier;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.entity.attribute.EntityAttributeModifier;
|
||||
import net.minecraft.entity.attribute.EntityAttributes;
|
||||
|
||||
public class SpeedModule extends Module {
|
||||
public static AttributeModifier attributeModifier;
|
||||
public SpeedModule() {
|
||||
super("Speed");
|
||||
withOption(new DoubleSliderOption("multiplier", 0, 0, 10, 3));
|
||||
endTickRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(MinecraftClient.getInstance().player == null) return;
|
||||
if(attributeModifier == null) {
|
||||
attributeModifier = new AttributeModifier(
|
||||
EntityAttributes.GENERIC_MOVEMENT_SPEED,
|
||||
2,
|
||||
EntityAttributeModifier.Operation.MULTIPLY_TOTAL
|
||||
);
|
||||
} else {
|
||||
|
||||
float value = ((Double)optionList.get(0).optionValue).floatValue();
|
||||
if(attributeModifier.getValue() != value) {
|
||||
attributeModifier.setValue(value);
|
||||
// Chat.sendGold("Speed multiplier: " + value);
|
||||
}
|
||||
}
|
||||
if(!attributeModifier.isOnPlayer()) attributeModifier.add();
|
||||
}
|
||||
};
|
||||
deactivateRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
attributeModifier.remove();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
package land.chipmunk.chipmunkmod.testclient.modules.op;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Module;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class AutoDeopModule extends Module {
|
||||
public static ArrayList<String> players = new ArrayList<>();
|
||||
public static AutoDeopModule instance = new AutoDeopModule();
|
||||
public AutoDeopModule() {
|
||||
super("Auto Deop");
|
||||
}
|
||||
|
||||
public static void execute(String opper, String opped) {
|
||||
if(!instance.isEnabled) return;
|
||||
if(players.contains(opped)) {
|
||||
MinecraftClient.getInstance().getNetworkHandler().sendChatCommand("deop " + opped);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package land.chipmunk.chipmunkmod.testclient.modules.op;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Module;
|
||||
import land.chipmunk.chipmunkmod.util.WorldUtil;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
|
||||
public class AutoOpModule extends Module {
|
||||
public static AutoOpModule instance = new AutoOpModule();
|
||||
public AutoOpModule() {
|
||||
super("Auto OP");
|
||||
// endTickRunnable = () -> {
|
||||
// if(!WorldUtil.isPlayerOP()) MinecraftClient.getInstance().getNetworkHandler().sendCommand("op " + MinecraftClient.getInstance().getSession().getUsername());
|
||||
// };
|
||||
}
|
||||
public void run(MinecraftServer server) {
|
||||
if(!WorldUtil.isPlayerOP(server)) MinecraftClient.getInstance().getNetworkHandler().sendCommand("op " + MinecraftClient.getInstance().getSession().getUsername());
|
||||
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package land.chipmunk.chipmunkmod.testclient.modules.op;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Module;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class AutoSudoKickModule extends Module {
|
||||
public static AutoSudoKickModule instance = new AutoSudoKickModule();
|
||||
public static ArrayList<String> players = new ArrayList<>();
|
||||
public AutoSudoKickModule() {
|
||||
super("Auto SudoKick");
|
||||
isEnabled = true;
|
||||
}
|
||||
|
||||
public static void execute(String username) {
|
||||
if(instance.isEnabled && players.contains(username))
|
||||
MinecraftClient.getInstance().getNetworkHandler().sendCommand("sudo " + username + " msg @s @e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e@e");
|
||||
}
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
package land.chipmunk.chipmunkmod.testclient.modules.utility;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Module;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.fabricmc.fabric.api.event.player.AttackBlockCallback;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResult;
|
||||
|
||||
public class AutoToolsModule extends Module {
|
||||
public static AutoToolsModule instance = new AutoToolsModule();
|
||||
|
||||
public AutoToolsModule() {
|
||||
super("Auto tools");
|
||||
// it's all in the event listener below
|
||||
}
|
||||
|
||||
public static void registerListener() {
|
||||
AttackBlockCallback.EVENT.register((player, world, hand, pos, direction) -> {
|
||||
if (!instance.isEnabled) return ActionResult.PASS;
|
||||
final BlockState blockState = world.getBlockState(pos);
|
||||
final PlayerInventory inventory = player.getInventory();
|
||||
|
||||
// If the player already has the appropriate tool, don't do anything
|
||||
if (inventory.getMainHandStack().getMiningSpeedMultiplier(blockState) > 1) return ActionResult.PASS;
|
||||
|
||||
for (int slot = 0; slot < 9; slot++) {
|
||||
if (slot == inventory.selectedSlot) continue; // We already checked the current slot
|
||||
final ItemStack item = inventory.getStack(slot);
|
||||
if (item.getMiningSpeedMultiplier(blockState) > 1) {
|
||||
inventory.selectedSlot = slot;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ActionResult.PASS;
|
||||
});
|
||||
}
|
||||
|
||||
static {
|
||||
registerListener();
|
||||
}
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package land.chipmunk.chipmunkmod.testclient.modules.utility;
|
||||
|
||||
import land.chipmunk.chipmunkmod.testclient.gui.components.Module;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
public class GuiMoveModule extends Module {
|
||||
public static GuiMoveModule instance = new GuiMoveModule();
|
||||
|
||||
public GuiMoveModule() {
|
||||
super("GUI Move");
|
||||
}
|
||||
}
|
|
@ -36,6 +36,7 @@
|
|||
},
|
||||
"mixins": [
|
||||
"NbtIoInvoker",
|
||||
"PacketBundleHandlerMixin",
|
||||
"PlayerEntityMixin",
|
||||
"TextMixin",
|
||||
"TextSerializerMixin"
|
||||
|
|
Loading…
Reference in a new issue