mirror of
https://github.com/refactorinqq/SLC-1.8.9.git
synced 2024-11-10 07:11:31 +01:00
New Mod View
This commit is contained in:
parent
dec8280da7
commit
6874904b15
@ -30,6 +30,7 @@ import net.silentclient.client.mods.SettingsManager;
|
|||||||
import net.silentclient.client.mods.settings.FPSBoostMod;
|
import net.silentclient.client.mods.settings.FPSBoostMod;
|
||||||
import net.silentclient.client.mods.settings.GeneralMod;
|
import net.silentclient.client.mods.settings.GeneralMod;
|
||||||
import net.silentclient.client.mods.util.PingSource;
|
import net.silentclient.client.mods.util.PingSource;
|
||||||
|
import net.silentclient.client.mods.util.Server;
|
||||||
import net.silentclient.client.mods.util.Utils;
|
import net.silentclient.client.mods.util.Utils;
|
||||||
import net.silentclient.client.premium.PremiumCosmeticsGui;
|
import net.silentclient.client.premium.PremiumCosmeticsGui;
|
||||||
import net.silentclient.client.premium.PremiumUtils;
|
import net.silentclient.client.premium.PremiumUtils;
|
||||||
@ -512,6 +513,8 @@ public class Client {
|
|||||||
this.updateUserInformation();
|
this.updateUserInformation();
|
||||||
Client.logger.info("Update Connection Server: " + event.getServerData().serverIP);
|
Client.logger.info("Update Connection Server: " + event.getServerData().serverIP);
|
||||||
silentSocket.getSocket().emit("update_information", event.getServerData().serverIP);
|
silentSocket.getSocket().emit("update_information", event.getServerData().serverIP);
|
||||||
|
Server.setHypixel(Server.checkIsHypixel());
|
||||||
|
Server.setRuHypixel(Server.checkIsRuHypixel());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventTarget
|
@EventTarget
|
||||||
@ -522,6 +525,8 @@ public class Client {
|
|||||||
this.updateUserInformation();
|
this.updateUserInformation();
|
||||||
Client.logger.info("Update Connection Server: null");
|
Client.logger.info("Update Connection Server: null");
|
||||||
silentSocket.getSocket().emit("update_information", "");
|
silentSocket.getSocket().emit("update_information", "");
|
||||||
|
Server.setHypixel(Server.checkIsHypixel());
|
||||||
|
Server.setRuHypixel(Server.checkIsRuHypixel());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventTarget
|
@EventTarget
|
||||||
@ -532,6 +537,8 @@ public class Client {
|
|||||||
this.updateUserInformation();
|
this.updateUserInformation();
|
||||||
Client.logger.info("Update Connection Server: null");
|
Client.logger.info("Update Connection Server: null");
|
||||||
silentSocket.getSocket().emit("update_information", "");
|
silentSocket.getSocket().emit("update_information", "");
|
||||||
|
Server.setHypixel(Server.checkIsHypixel());
|
||||||
|
Server.setRuHypixel(Server.checkIsRuHypixel());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Instances
|
// Instances
|
||||||
|
@ -54,7 +54,7 @@ public class HudMod extends ModDraggable {
|
|||||||
boolean brackets = Client.getInstance().getSettingsManager().getSettingByName(this, "Brackets").getValBoolean();
|
boolean brackets = Client.getInstance().getSettingsManager().getSettingByName(this, "Brackets").getValBoolean();
|
||||||
|
|
||||||
if(background) {
|
if(background) {
|
||||||
return (font.getStringWidth((brackets ? "[" : "") + getText() + (brackets ? "]" : "")) > 58 ? font.getStringWidth((brackets ? "[" : "") + getText() + (brackets ? "]" : "")) + 1 : 57);
|
return (font.getStringWidth((brackets ? "[" : "") + getText() + (brackets ? "]" : "")) > 64 ? font.getStringWidth((brackets ? "[" : "") + getText() + (brackets ? "]" : "")) + 2 : 64);
|
||||||
}
|
}
|
||||||
|
|
||||||
return font.getStringWidth((brackets ? "[" : "") + getTextForRender() + (brackets ? "]" : ""));
|
return font.getStringWidth((brackets ? "[" : "") + getTextForRender() + (brackets ? "]" : ""));
|
||||||
@ -70,7 +70,7 @@ public class HudMod extends ModDraggable {
|
|||||||
boolean brackets = Client.getInstance().getSettingsManager().getSettingByName(this, "Brackets").getValBoolean();
|
boolean brackets = Client.getInstance().getSettingsManager().getSettingByName(this, "Brackets").getValBoolean();
|
||||||
|
|
||||||
if(background) {
|
if(background) {
|
||||||
return (font.getStringWidth((brackets ? "[" : "") + getText() + (brackets ? "]" : "")) > 58 ? font.getStringWidth((brackets ? "[" : "") + getText() + (brackets ? "]" : "")) + 2 : 58);
|
return (font.getStringWidth((brackets ? "[" : "") + getText() + (brackets ? "]" : "")) > 64 ? font.getStringWidth((brackets ? "[" : "") + getText() + (brackets ? "]" : "")) + 2 : 64);
|
||||||
}
|
}
|
||||||
|
|
||||||
return font.getStringWidth((brackets ? "[" : "") + getTextForRender() + (brackets ? "]" : ""));
|
return font.getStringWidth((brackets ? "[" : "") + getTextForRender() + (brackets ? "]" : ""));
|
||||||
|
@ -43,7 +43,7 @@ public abstract class ModDraggable extends Mod implements IRenderer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
this.addSliderSetting("Scale", this, 3.0F, 1.0F, 5.0F, false);
|
this.addSliderSetting("Scale", this, 2.0F, 1.0F, 5.0F, false);
|
||||||
super.setup();
|
super.setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ public class KeystrokesMod extends ModDraggable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
super.setup();
|
this.addSliderSetting("Scale", this, 2.23F, 1.0F, 5.0F, false);
|
||||||
setUpdated(true);
|
setUpdated(true);
|
||||||
ArrayList<String> cpsModes = new ArrayList<>();
|
ArrayList<String> cpsModes = new ArrayList<>();
|
||||||
cpsModes.add("None");
|
cpsModes.add("None");
|
||||||
|
@ -2,11 +2,29 @@ package net.silentclient.client.mods.util;
|
|||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
|
||||||
import java.net.URL;
|
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
public class Server {
|
public class Server {
|
||||||
|
public static boolean hypixel = false;
|
||||||
|
public static boolean ruHypixel = false;
|
||||||
|
|
||||||
public static boolean isHypixel() {
|
public static boolean isHypixel() {
|
||||||
|
return hypixel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setHypixel(boolean hypixel) {
|
||||||
|
Server.hypixel = hypixel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isRuHypixel() {
|
||||||
|
return ruHypixel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setRuHypixel(boolean ruHypixel) {
|
||||||
|
Server.ruHypixel = ruHypixel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean checkIsHypixel() {
|
||||||
if(Minecraft.getMinecraft().isSingleplayer()) {
|
if(Minecraft.getMinecraft().isSingleplayer()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -21,24 +39,7 @@ public class Server {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isSilent() {
|
public static boolean checkIsRuHypixel() {
|
||||||
if(Minecraft.getMinecraft().isSingleplayer()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
String serverIp = Minecraft.getMinecraft().getCurrentServerData().serverIP.toString();
|
|
||||||
if(!serverIp.startsWith("http") && !serverIp.startsWith("https")){
|
|
||||||
serverIp = "http://" + serverIp;
|
|
||||||
}
|
|
||||||
URL serverUrl = new URL(serverIp);
|
|
||||||
|
|
||||||
return (serverUrl.getHost().toString().toLowerCase().equals("mc.silentclient.net") || serverUrl.getHost().toString().equals("practice.silentclient.net"));
|
|
||||||
} catch (Exception err) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isRuHypixel() {
|
|
||||||
if(Minecraft.getMinecraft().isSingleplayer()) {
|
if(Minecraft.getMinecraft().isSingleplayer()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user