stuff
This commit is contained in:
parent
48547a2c66
commit
dc1e189d38
25 changed files with 259 additions and 157 deletions
|
@ -19,7 +19,6 @@ public class ClientConnectionMixin
|
|||
@Inject(method = "send(Lnet/minecraft/network/packet/Packet;)V", at = @At("HEAD"), cancellable = true)
|
||||
public void send(Packet<?> packet, CallbackInfo ci)
|
||||
{
|
||||
// Call commands if the prefix is sent
|
||||
if(packet instanceof ChatMessageC2SPacket && ((ChatMessageC2SPacket) packet).chatMessage().startsWith(CommandManager.get().getPrefix()))
|
||||
{
|
||||
try
|
||||
|
|
|
@ -6,7 +6,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import me.kawaiizenbo.moonlight.module.ModuleManager;
|
||||
import me.kawaiizenbo.moonlight.module.Module_;
|
||||
import me.kawaiizenbo.moonlight.module.Module;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.network.ClientPlayerEntity;
|
||||
import net.minecraft.entity.MovementType;
|
||||
|
@ -18,7 +18,7 @@ public class ClientPlayerEntityMixin
|
|||
@Inject(method = "move", at = @At(value = "TAIL"), cancellable = true)
|
||||
public void onMove(MovementType type, Vec3d movement, CallbackInfo ci)
|
||||
{
|
||||
for (Module_ m : ModuleManager.INSTANCE.getEnabledModules())
|
||||
for (Module m : ModuleManager.INSTANCE.getEnabledModules())
|
||||
{
|
||||
m.onMotion(type, movement);
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public class ClientPlayerEntityMixin
|
|||
@Inject(method = "tick", at = @At(value = "HEAD"), cancellable = true)
|
||||
public void onTick(CallbackInfo ci)
|
||||
{
|
||||
for (Module_ m : ModuleManager.INSTANCE.getEnabledModules())
|
||||
for (Module m : ModuleManager.INSTANCE.getEnabledModules())
|
||||
{
|
||||
if (MinecraftClient.getInstance().player != null) m.tick();
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public class ClientPlayerEntityMixin
|
|||
@Inject(method = "init", at = @At(value = "TAIL"), cancellable = true)
|
||||
public void onInit(CallbackInfo ci)
|
||||
{
|
||||
for (Module_ m : ModuleManager.INSTANCE.getEnabledModules())
|
||||
for (Module m : ModuleManager.INSTANCE.getEnabledModules())
|
||||
{
|
||||
m.onEnable();
|
||||
}
|
||||
|
|
|
@ -8,6 +8,8 @@ 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.module.Module;
|
||||
import me.kawaiizenbo.moonlight.module.ModuleManager;
|
||||
import me.kawaiizenbo.moonlight.ui.clickgui.ClickGUIScreen;
|
||||
import net.minecraft.client.Keyboard;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
@ -17,7 +19,18 @@ public abstract class KeyboardMixin {
|
|||
@Shadow @Final private MinecraftClient client;
|
||||
|
||||
@Inject(method = "onKey", at = @At("HEAD"), cancellable = true)
|
||||
public void onKey(long window, int key, int scancode, int action, int modifiers, CallbackInfo info) {
|
||||
public void onKey(long window, int key, int scancode, int action, int modifiers, CallbackInfo info)
|
||||
{
|
||||
System.out.println("Keyboard event occured: " + java.awt.event.KeyEvent.getKeyText(key) + " (keycode "+key+")");
|
||||
if (key == GLFW.GLFW_KEY_RIGHT_ALT) MinecraftClient.getInstance().setScreen(ClickGUIScreen.INSTANCE);
|
||||
for (Module m : ModuleManager.INSTANCE.modules)
|
||||
{
|
||||
System.out.println("checking against module:" + m.name);
|
||||
if (key == m.keybind.value)
|
||||
{
|
||||
System.out.println("yup, we gotem :3");
|
||||
m.toggle();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue