update to 1.19.3 and starts of clickgui
This commit is contained in:
parent
412cabff8a
commit
05ff377b5c
11 changed files with 115 additions and 15 deletions
|
@ -4,9 +4,9 @@ org.gradle.parallel=true
|
|||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/develop
|
||||
minecraft_version=1.19.2
|
||||
yarn_mappings=1.19.2+build.28
|
||||
loader_version=0.14.10
|
||||
minecraft_version=1.19.3
|
||||
yarn_mappings=1.19.3+build.1
|
||||
loader_version=0.14.11
|
||||
|
||||
# Mod Properties
|
||||
mod_version = dev
|
||||
|
@ -14,4 +14,4 @@ org.gradle.parallel=true
|
|||
archives_base_name = moonlight
|
||||
|
||||
# Dependencies
|
||||
fabric_version=0.67.0+1.19.2
|
||||
fabric_version=0.68.1+1.19.3
|
||||
|
|
|
@ -28,6 +28,7 @@ public class CommandManager
|
|||
add(new VClip());
|
||||
add(new Help());
|
||||
add(new Toggle());
|
||||
add(new Teleport());
|
||||
commands.sort(Comparator.comparing(Command::getName));
|
||||
}
|
||||
|
||||
|
@ -81,6 +82,6 @@ public class CommandManager
|
|||
}
|
||||
|
||||
public String getPrefix() {
|
||||
return "?";
|
||||
return ".";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
package me.kawaiizenbo.moonlight.command.commands;
|
||||
|
||||
import com.mojang.brigadier.arguments.DoubleArgumentType;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
|
||||
import me.kawaiizenbo.moonlight.command.Command;
|
||||
import net.minecraft.client.network.ClientPlayerEntity;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class Teleport extends Command
|
||||
{
|
||||
|
||||
public Teleport()
|
||||
{
|
||||
super("teleport", "Teleports you to specified coordinates.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void build(LiteralArgumentBuilder<CommandSource> builder)
|
||||
{
|
||||
builder
|
||||
.then(argument("x", DoubleArgumentType.doubleArg())
|
||||
.then(argument("y", DoubleArgumentType.doubleArg())
|
||||
.then(argument("z", DoubleArgumentType.doubleArg())
|
||||
.executes(context ->
|
||||
{
|
||||
ClientPlayerEntity player = mc.player;
|
||||
assert player != null;
|
||||
|
||||
double x = context.getArgument("x", Double.class);
|
||||
double y = context.getArgument("y", Double.class);
|
||||
double z = context.getArgument("z", Double.class);
|
||||
|
||||
if (player.hasVehicle())
|
||||
{
|
||||
Entity vehicle = player.getVehicle();
|
||||
vehicle.setPosition(x, y, z);
|
||||
}
|
||||
player.setPosition(x, y, z);
|
||||
|
||||
return SINGLE_SUCCESS;
|
||||
}))));
|
||||
}
|
||||
|
||||
}
|
|
@ -38,7 +38,7 @@ public abstract class ChatInputSuggestorMixin
|
|||
|
||||
@Shadow private SuggestionWindow window;
|
||||
|
||||
@Shadow protected abstract void showCommandSuggestions();
|
||||
@Shadow abstract void showCommandSuggestions();
|
||||
|
||||
@Inject(method = "refresh",
|
||||
at = @At(value = "INVOKE", target = "Lcom/mojang/brigadier/StringReader;canRead()Z", remap = false),
|
||||
|
|
|
@ -23,8 +23,14 @@ public class MultiplayerScreenMixin extends Screen
|
|||
@Inject(at = @At("TAIL"), method = "init")
|
||||
private void altManagerButton(CallbackInfo callbackInfo)
|
||||
{
|
||||
this.addDrawableChild(new ButtonWidget(this.width - 102, 2, 100, 20, Text.literal("Alt Manager"), (button) -> {
|
||||
MinecraftClient.getInstance().setScreen(AltManagerScreen.INSTANCE);
|
||||
})).active = true;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,8 +49,14 @@ public abstract class TitleScreenMixin extends Screen
|
|||
@Inject(at = @At("TAIL"), method = "init")
|
||||
private void altManagerButton(CallbackInfo callbackInfo)
|
||||
{
|
||||
this.addDrawableChild(new ButtonWidget(this.width - 102, 2, 100, 20, Text.literal("Alt Manager"), (button) -> {
|
||||
MinecraftClient.getInstance().setScreen(AltManagerScreen.INSTANCE);
|
||||
})).active = true;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
18
src/main/java/me/kawaiizenbo/moonlight/module/Category.java
Normal file
18
src/main/java/me/kawaiizenbo/moonlight/module/Category.java
Normal file
|
@ -0,0 +1,18 @@
|
|||
package me.kawaiizenbo.moonlight.module;
|
||||
|
||||
public enum Category
|
||||
{
|
||||
COMBAT("Combat"),
|
||||
MOVEMENT("Movement"),
|
||||
RENDER("Render"),
|
||||
WORLD("World"),
|
||||
PLAYER("Player"),
|
||||
CHAT("Chat");
|
||||
|
||||
public String name;
|
||||
|
||||
Category(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
}
|
|
@ -7,12 +7,14 @@ public abstract class Module_
|
|||
protected static MinecraftClient mc = MinecraftClient.getInstance();
|
||||
public String name;
|
||||
public String description;
|
||||
public Category category;
|
||||
public boolean enabled;
|
||||
|
||||
public Module_(String name, String description)
|
||||
public Module_(String name, String description, Category category)
|
||||
{
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public void onEnable() {}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package me.kawaiizenbo.moonlight.module.modules;
|
||||
|
||||
import me.kawaiizenbo.moonlight.module.Category;
|
||||
import me.kawaiizenbo.moonlight.module.Module_;
|
||||
|
||||
public class Fly extends Module_
|
||||
|
@ -7,7 +8,7 @@ public class Fly extends Module_
|
|||
|
||||
public Fly()
|
||||
{
|
||||
super("Fly", "Allows you to fly in survival mode.");
|
||||
super("Fly", "Allows you to fly in survival mode.", Category.MOVEMENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package me.kawaiizenbo.moonlight.module.modules;
|
||||
|
||||
import me.kawaiizenbo.moonlight.module.Category;
|
||||
import me.kawaiizenbo.moonlight.module.Module_;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
|
||||
|
||||
public class NoFall extends Module_
|
||||
{
|
||||
public NoFall()
|
||||
{
|
||||
super("NoFall", "Prevents you from taking fall damage.", Category.PLAYER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick()
|
||||
{
|
||||
if(mc.player.fallDistance >= 2.5) mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.OnGroundOnly(true));
|
||||
}
|
||||
}
|
|
@ -10,7 +10,8 @@
|
|||
"MultiplayerScreenMixin",
|
||||
"InGameHUDMixin",
|
||||
"ChatInputSuggestorMixin",
|
||||
"ClientConnectionMixin"
|
||||
"ClientConnectionMixin",
|
||||
"LivingEntityMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
|
Loading…
Add table
Reference in a new issue