Some bug fixes and Title display when game starts
This commit is contained in:
parent
49657c4fd1
commit
2547cf6c8b
6 changed files with 33 additions and 14 deletions
|
@ -4,13 +4,12 @@ import cc.polyfrost.oneconfig.events.EventManager;
|
|||
import cc.polyfrost.oneconfig.events.event.InitializationEvent;
|
||||
import cc.polyfrost.oneconfig.libs.eventbus.Subscribe;
|
||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import me.night0721.lilase.features.ah.AHConfig;
|
||||
import me.night0721.lilase.events.PacketReceivedEvent;
|
||||
import me.night0721.lilase.features.ah.AuctionHouse;
|
||||
import me.night0721.lilase.features.flip.Flipper;
|
||||
import me.night0721.lilase.utils.KeyBindingManager;
|
||||
import me.night0721.lilase.events.SniperFlipperEvents;
|
||||
import me.night0721.lilase.features.ah.AHConfig;
|
||||
import me.night0721.lilase.features.ah.AuctionHouse;
|
||||
import me.night0721.lilase.utils.ConfigUtils;
|
||||
import me.night0721.lilase.utils.KeyBindingManager;
|
||||
import me.night0721.lilase.utils.Utils;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiDisconnected;
|
||||
|
@ -25,7 +24,6 @@ import net.minecraftforge.fml.common.Mod;
|
|||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||
import org.lwjgl.opengl.Display;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
@ -45,14 +43,14 @@ public class Lilase {
|
|||
|
||||
@Mod.EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
KeyBindingManager keyBindingManager = new KeyBindingManager();
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
MinecraftForge.EVENT_BUS.register(new KeyBindingManager());
|
||||
MinecraftForge.EVENT_BUS.register(keyBindingManager);
|
||||
MinecraftForge.EVENT_BUS.register(new SniperFlipperEvents());
|
||||
EventManager.INSTANCE.register(this);
|
||||
ConfigUtils.register();
|
||||
auctionHouse = new AuctionHouse();
|
||||
KeyBindingManager.registerKeyBindings();
|
||||
Display.setTitle("Lilase v" + VERSION + " | night0721");
|
||||
keyBindingManager.registerKeyBindings();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
|
|
@ -193,7 +193,7 @@ public class SniperFlipperEvents {
|
|||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onWindowClick(PacketReceivedEvent event) {
|
||||
public void onPacketReceive(PacketReceivedEvent event) {
|
||||
if (event.packet instanceof S33PacketUpdateSign && Utils.checkInHub() && Flipper.state.equals(START)) {
|
||||
new Thread(() -> {
|
||||
try {
|
||||
|
|
|
@ -202,12 +202,12 @@ public class AuctionHouse {
|
|||
|
||||
public void toggleAuction() {
|
||||
if (open) {
|
||||
Utils.sendMessage("Stopped Auction House");
|
||||
Utils.sendMessage("Stopped AH Sniper");
|
||||
open = false;
|
||||
UngrabUtils.regrabMouse();
|
||||
} else {
|
||||
if (Utils.checkInHub()) {
|
||||
Utils.sendMessage("Started Auction House");
|
||||
Utils.sendMessage("Started AH Sniper");
|
||||
open = true;
|
||||
UngrabUtils.ungrabMouse();
|
||||
} else Utils.sendMessage("Detected not in hub, please go to hub to start");
|
||||
|
|
18
src/main/java/me/night0721/lilase/mixins/MixinMinecraft.java
Normal file
18
src/main/java/me/night0721/lilase/mixins/MixinMinecraft.java
Normal file
|
@ -0,0 +1,18 @@
|
|||
package me.night0721.lilase.mixins;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import org.lwjgl.opengl.Display;
|
||||
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 static me.night0721.lilase.Lilase.VERSION;
|
||||
|
||||
@Mixin({Minecraft.class})
|
||||
public class MixinMinecraft {
|
||||
@Inject(method = {"startGame"}, at = {@At("RETURN")})
|
||||
private void startGame(CallbackInfo ci) {
|
||||
Display.setTitle("Lilase v" + VERSION + " | night0721");
|
||||
}
|
||||
}
|
|
@ -8,10 +8,10 @@ import net.minecraftforge.fml.common.gameevent.InputEvent;
|
|||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
public class KeyBindingManager {
|
||||
private static final KeyBinding[] keyBindings = new KeyBinding[4];
|
||||
private final KeyBinding[] keyBindings = new KeyBinding[2];
|
||||
|
||||
public static void registerKeyBindings() {
|
||||
keyBindings[0] = new KeyBinding("Auction House Toggle", Keyboard.KEY_END, Lilase.MOD_NAME);
|
||||
public void registerKeyBindings() {
|
||||
keyBindings[0] = new KeyBinding("Sniper Toggle", Keyboard.KEY_END, Lilase.MOD_NAME);
|
||||
keyBindings[1] = new KeyBinding("Config", Keyboard.KEY_MULTIPLY, Lilase.MOD_NAME);
|
||||
for (KeyBinding keyBinding : keyBindings) {
|
||||
ClientRegistry.registerKeyBinding(keyBinding);
|
||||
|
|
|
@ -6,5 +6,8 @@
|
|||
"minVersion": "0.8.2",
|
||||
"mixins": [
|
||||
"MixinNetworkManager"
|
||||
],
|
||||
"client": [
|
||||
"MixinMinecraft"
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue