add some new modules, kill off alt manager, clean up other code
This commit is contained in:
parent
4b1e0b4fa9
commit
3ad5af7ea7
13 changed files with 120 additions and 95 deletions
Binary file not shown.
Before Width: | Height: | Size: 532 KiB After Width: | Height: | Size: 555 KiB |
|
@ -1,36 +0,0 @@
|
||||||
package me.kawaiizenbo.moonlight.mixin;
|
|
||||||
|
|
||||||
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.CallbackInfo;
|
|
||||||
|
|
||||||
import me.kawaiizenbo.moonlight.ui.altmanager.AltManagerScreen;
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
|
||||||
import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen;
|
|
||||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
|
||||||
import net.minecraft.text.Text;
|
|
||||||
|
|
||||||
@Mixin(MultiplayerScreen.class)
|
|
||||||
public class MultiplayerScreenMixin extends Screen
|
|
||||||
{
|
|
||||||
protected MultiplayerScreenMixin(Text title)
|
|
||||||
{
|
|
||||||
super(title);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Inject(at = @At("TAIL"), method = "init")
|
|
||||||
private void altManagerButton(CallbackInfo callbackInfo)
|
|
||||||
{
|
|
||||||
this.addDrawableChild(ButtonWidget.builder(Text.literal("Alt Manager"), this::gotoAltManagerScreen)
|
|
||||||
.position(this.width - 102, 2)
|
|
||||||
.size(100, 20)
|
|
||||||
.build());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void gotoAltManagerScreen(ButtonWidget button)
|
|
||||||
{
|
|
||||||
MinecraftClient.getInstance().setScreen(AltManagerScreen.INSTANCE);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +1,6 @@
|
||||||
package me.kawaiizenbo.moonlight.mixin;
|
package me.kawaiizenbo.moonlight.mixin;
|
||||||
|
|
||||||
import me.kawaiizenbo.moonlight.Moonlight;
|
import me.kawaiizenbo.moonlight.Moonlight;
|
||||||
import me.kawaiizenbo.moonlight.ui.altmanager.AltManagerScreen;
|
|
||||||
|
|
||||||
import org.spongepowered.asm.mixin.Final;
|
import org.spongepowered.asm.mixin.Final;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
@ -10,12 +9,9 @@ import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
|
||||||
import net.minecraft.client.gui.DrawContext;
|
import net.minecraft.client.gui.DrawContext;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
import net.minecraft.client.gui.screen.TitleScreen;
|
import net.minecraft.client.gui.screen.TitleScreen;
|
||||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
|
||||||
import net.minecraft.text.Text;
|
|
||||||
import net.minecraft.util.Util;
|
import net.minecraft.util.Util;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
|
@ -44,18 +40,4 @@ public abstract class TitleScreenMixin extends Screen
|
||||||
|
|
||||||
drawContext.drawTextWithShadow(this.textRenderer, Moonlight.clientTag + " " + Moonlight.versionTag, 2, 2, 16777215 | l);
|
drawContext.drawTextWithShadow(this.textRenderer, Moonlight.clientTag + " " + Moonlight.versionTag, 2, 2, 16777215 | l);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(at = @At("TAIL"), method = "init")
|
|
||||||
private void altManagerButton(CallbackInfo callbackInfo)
|
|
||||||
{
|
|
||||||
this.addDrawableChild(ButtonWidget.builder(Text.literal("Alt Manager"), this::gotoAltManagerScreen)
|
|
||||||
.position(this.width - 102, 2)
|
|
||||||
.size(100, 20)
|
|
||||||
.build());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void gotoAltManagerScreen(ButtonWidget button)
|
|
||||||
{
|
|
||||||
MinecraftClient.getInstance().setScreen(AltManagerScreen.INSTANCE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,9 @@ public class ModuleManager
|
||||||
new Fullbright(),
|
new Fullbright(),
|
||||||
new Speed(),
|
new Speed(),
|
||||||
new ModulesList(),
|
new ModulesList(),
|
||||||
new TestModule()
|
new ChatSpammer(),
|
||||||
|
new Rotation(),
|
||||||
|
new AutoJump()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
package me.kawaiizenbo.moonlight.module.modules;
|
||||||
|
|
||||||
|
import me.kawaiizenbo.moonlight.module.Category;
|
||||||
|
import me.kawaiizenbo.moonlight.module.Module;
|
||||||
|
import me.kawaiizenbo.moonlight.module.settings.DoubleSetting;
|
||||||
|
import me.kawaiizenbo.moonlight.util.Timer;
|
||||||
|
|
||||||
|
public class AutoJump extends Module
|
||||||
|
{
|
||||||
|
public DoubleSetting delay = new DoubleSetting("Delay (Seconds)", 1, 0.1, 10, 1);
|
||||||
|
private Timer timer = new Timer();
|
||||||
|
|
||||||
|
public AutoJump()
|
||||||
|
{
|
||||||
|
super("Auto Jump", "Automatically jumps on a timer.", Category.MOVEMENT);
|
||||||
|
settings.add(delay);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void tick()
|
||||||
|
{
|
||||||
|
if (timer.hasTimeElapsed((long)delay.value * 1000, true) && mc.player.isOnGround() && mc.player.hasVehicle() == false)
|
||||||
|
{
|
||||||
|
mc.player.jump();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package me.kawaiizenbo.moonlight.module.modules;
|
||||||
|
|
||||||
|
import me.kawaiizenbo.moonlight.module.Category;
|
||||||
|
import me.kawaiizenbo.moonlight.module.Module;
|
||||||
|
import me.kawaiizenbo.moonlight.module.settings.DoubleSetting;
|
||||||
|
import me.kawaiizenbo.moonlight.module.settings.StringSetting;
|
||||||
|
import me.kawaiizenbo.moonlight.util.Timer;
|
||||||
|
|
||||||
|
public class ChatSpammer extends Module
|
||||||
|
{
|
||||||
|
public StringSetting message = new StringSetting("Message", "E4PE4J");
|
||||||
|
public DoubleSetting delay = new DoubleSetting("Delay (Seconds)", 1, 0.1, 10, 1);
|
||||||
|
private Timer timer = new Timer();
|
||||||
|
|
||||||
|
public ChatSpammer()
|
||||||
|
{
|
||||||
|
super("Chat Spammer", "Spams a selected message in chat.", Category.CHAT);
|
||||||
|
settings.add(message);
|
||||||
|
settings.add(delay);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void tick()
|
||||||
|
{
|
||||||
|
if (timer.hasTimeElapsed((long)delay.value * 1000, true))
|
||||||
|
{
|
||||||
|
mc.player.networkHandler.sendChatMessage(message.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package me.kawaiizenbo.moonlight.module.modules;
|
||||||
|
|
||||||
|
import me.kawaiizenbo.moonlight.module.Category;
|
||||||
|
import me.kawaiizenbo.moonlight.module.Module;
|
||||||
|
import me.kawaiizenbo.moonlight.module.settings.DoubleSetting;
|
||||||
|
|
||||||
|
public class Rotation extends Module
|
||||||
|
{
|
||||||
|
DoubleSetting pitch = new DoubleSetting("Pitch", 0, 0, 360, 0);
|
||||||
|
DoubleSetting yaw = new DoubleSetting("Yaw", 0, 0, 360, 0);
|
||||||
|
|
||||||
|
public Rotation()
|
||||||
|
{
|
||||||
|
super("Rotation", "Locks camera to specified pitch and yaw.", Category.PLAYER);
|
||||||
|
settings.add(pitch);
|
||||||
|
settings.add(yaw);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void tick()
|
||||||
|
{
|
||||||
|
mc.player.setPitch((float)pitch.value);
|
||||||
|
mc.player.setYaw((float)yaw.value);
|
||||||
|
}
|
||||||
|
}
|
|
@ -25,7 +25,7 @@ public class ModulesListOverlay
|
||||||
{
|
{
|
||||||
if (!m.showInModulesList.value) continue;
|
if (!m.showInModulesList.value) continue;
|
||||||
int nameWidth = mc.textRenderer.getWidth(m.name);
|
int nameWidth = mc.textRenderer.getWidth(m.name);
|
||||||
drawContext.fill(scaledWidth - nameWidth - 8, yOffset, scaledWidth, yOffset+12, 0x55222222);
|
drawContext.fill(scaledWidth - nameWidth - 8, yOffset, scaledWidth, yOffset+12, 0x77222222);
|
||||||
drawContext.fill(scaledWidth - 2, yOffset, scaledWidth, yOffset+12, Moonlight.uiColorA);
|
drawContext.fill(scaledWidth - 2, yOffset, scaledWidth, yOffset+12, Moonlight.uiColorA);
|
||||||
drawContext.drawText(mc.textRenderer, m.name, scaledWidth - nameWidth - 4, yOffset + 2, 0xFFFFFFFF, false);
|
drawContext.drawText(mc.textRenderer, m.name, scaledWidth - nameWidth - 4, yOffset + 2, 0xFFFFFFFF, false);
|
||||||
yOffset += 12;
|
yOffset += 12;
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
package me.kawaiizenbo.moonlight.ui.altmanager;
|
|
||||||
|
|
||||||
import net.minecraft.client.gui.DrawContext;
|
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
|
||||||
import net.minecraft.text.Text;
|
|
||||||
|
|
||||||
public class AltManagerScreen extends Screen
|
|
||||||
{
|
|
||||||
public static AltManagerScreen INSTANCE = new AltManagerScreen();
|
|
||||||
|
|
||||||
protected AltManagerScreen()
|
|
||||||
{
|
|
||||||
super(Text.literal("Alt Manager"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void render(DrawContext drawContext, int mouseX, int mouseY, float delta)
|
|
||||||
{
|
|
||||||
renderBackgroundTexture(drawContext);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -36,7 +36,7 @@ public class SettingsScreen extends Screen
|
||||||
drawContext.fill(x, y, x+windowWidth, y+windowHeight, 0xFF222222);
|
drawContext.fill(x, y, x+windowWidth, y+windowHeight, 0xFF222222);
|
||||||
drawContext.fill(x, y, x+windowWidth, y+16, module.category.color);
|
drawContext.fill(x, y, x+windowWidth, y+16, module.category.color);
|
||||||
drawContext.fill(x+2, y+2, x+(windowWidth-2), y+14, 0xFF222222);
|
drawContext.fill(x+2, y+2, x+(windowWidth-2), y+14, 0xFF222222);
|
||||||
drawContext.drawCenteredTextWithShadow(textRenderer, "Module Settings: "+module.name, x+(windowWidth/2), y+4, 0xFFFFFF);
|
drawContext.drawCenteredTextWithShadow(textRenderer, module.name, x+(windowWidth/2), y+4, 0xFFFFFF);
|
||||||
drawContext.drawText(textRenderer, module.description, x+8, y+24, 0xFFFFFF, true);
|
drawContext.drawText(textRenderer, module.description, x+8, y+24, 0xFFFFFF, true);
|
||||||
backButton = new TextButton(ColorUtils.underline + "< Back", x+4, y+4, 0xFFFFFF);
|
backButton = new TextButton(ColorUtils.underline + "< Back", x+4, y+4, 0xFFFFFF);
|
||||||
backButton.render(drawContext, textRenderer, mouseX, mouseY);
|
backButton.render(drawContext, textRenderer, mouseX, mouseY);
|
||||||
|
|
|
@ -1,29 +1,15 @@
|
||||||
package me.kawaiizenbo.moonlight.util;
|
package me.kawaiizenbo.moonlight.util;
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
import net.minecraft.util.Formatting;
|
|
||||||
|
|
||||||
public class ChatUtils
|
public class ChatUtils
|
||||||
{
|
{
|
||||||
private static MinecraftClient mc = MinecraftClient.getInstance();
|
private static MinecraftClient mc = MinecraftClient.getInstance();
|
||||||
|
|
||||||
public static void sendMsg(String message)
|
public static void sendMsg(String message)
|
||||||
{
|
|
||||||
sendMsg(null, null, Text.literal(message));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void sendMsg(@Nullable String prefixTitle, @Nullable Formatting prefixColor, Text msg)
|
|
||||||
{
|
{
|
||||||
if (mc.world == null) return;
|
if (mc.world == null) return;
|
||||||
|
mc.inGameHud.getChatHud().addMessage(Text.literal(message));
|
||||||
//Text message = Text.literal("");
|
|
||||||
//message.append(CommandManager.get().getPrefix());
|
|
||||||
//if (prefixTitle != null) message.append(CommandManager.get().getPrefix());
|
|
||||||
//message.append(msg);
|
|
||||||
|
|
||||||
mc.inGameHud.getChatHud().addMessage(msg);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
32
src/main/java/me/kawaiizenbo/moonlight/util/Timer.java
Normal file
32
src/main/java/me/kawaiizenbo/moonlight/util/Timer.java
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
package me.kawaiizenbo.moonlight.util;
|
||||||
|
|
||||||
|
public class Timer
|
||||||
|
{
|
||||||
|
public long lastMS = System.currentTimeMillis();
|
||||||
|
|
||||||
|
public void reset()
|
||||||
|
{
|
||||||
|
lastMS = System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasTimeElapsed(long time, boolean reset)
|
||||||
|
{
|
||||||
|
if (lastMS > System.currentTimeMillis())
|
||||||
|
{
|
||||||
|
lastMS = System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (System.currentTimeMillis()-lastMS > time)
|
||||||
|
{
|
||||||
|
if (reset) reset();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,7 +7,6 @@
|
||||||
],
|
],
|
||||||
"client": [
|
"client": [
|
||||||
"TitleScreenMixin",
|
"TitleScreenMixin",
|
||||||
"MultiplayerScreenMixin",
|
|
||||||
"InGameHudMixin",
|
"InGameHudMixin",
|
||||||
"ChatInputSuggestorMixin",
|
"ChatInputSuggestorMixin",
|
||||||
"ClientConnectionMixin",
|
"ClientConnectionMixin",
|
||||||
|
|
Loading…
Add table
Reference in a new issue