mirror of
https://github.com/refactorinqq/SLC-1.8.9.git
synced 2024-11-10 01:41:33 +01:00
(fix) quickplay bug
This commit is contained in:
parent
7169eaf437
commit
08188bf9e5
@ -4,6 +4,7 @@ import com.google.common.reflect.TypeToken;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.silentclient.client.Client;
|
||||
import net.silentclient.client.event.EventTarget;
|
||||
import net.silentclient.client.event.impl.ConnectToServerEvent;
|
||||
import net.silentclient.client.event.impl.KeyEvent;
|
||||
import net.silentclient.client.gui.quickplay.QuickplayGui;
|
||||
import net.silentclient.client.mods.Mod;
|
||||
@ -68,7 +69,8 @@ public class QuickPlayMod extends Mod {
|
||||
public void updateHashMap() {
|
||||
HashMap<Integer, Setting> map = new HashMap<>();
|
||||
for(Setting setting : Client.getInstance().getSettingsManager().getSettingByMod(this)) {
|
||||
if (setting.isKeybind()) {
|
||||
String[] args = setting.getName().split("&");
|
||||
if (((args[1].equals("Hypixel") && Server.isHypixel()) || (args[1].equals("RuHypixel") && Server.isRuHypixel())) && setting.isKeybind()) {
|
||||
map.put(setting.getKeybind(), setting);
|
||||
}
|
||||
}
|
||||
@ -76,6 +78,11 @@ public class QuickPlayMod extends Mod {
|
||||
hashMap = map;
|
||||
}
|
||||
|
||||
@EventTarget
|
||||
public void onServerJoin(ConnectToServerEvent event) {
|
||||
updateHashMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeSettingValue(Setting setting) {
|
||||
super.onChangeSettingValue(setting);
|
||||
@ -133,7 +140,7 @@ public class QuickPlayMod extends Mod {
|
||||
if(setting != null) {
|
||||
if(setting.getName().equals("Open Menu")) {
|
||||
// Open Menu
|
||||
if(setting.isKeyDown() && (Server.isHypixel() || Server.isRuHypixel())) {
|
||||
if(Server.isHypixel() || Server.isRuHypixel()) {
|
||||
mc.displayGuiScreen(new QuickplayGui());
|
||||
}
|
||||
} else {
|
||||
@ -141,9 +148,7 @@ public class QuickPlayMod extends Mod {
|
||||
return;
|
||||
}
|
||||
String[] args = setting.getName().split("&");
|
||||
if(((args[1].equals("Hypixel") && Server.isHypixel()) || (args[1].equals("RuHypixel") && Server.isRuHypixel())) && setting.isKeyDown()) {
|
||||
runCommand(args[2]);
|
||||
}
|
||||
runCommand(args[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user