Skip to content

Commit

Permalink
Linux support
Browse files Browse the repository at this point in the history
  • Loading branch information
sam302rk committed Jan 19, 2022
2 parents dac176c + 0d934f2 commit 927dd0d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -135,7 +135,7 @@
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.0.23.Final</version>
<version>4.0.56.Final</version>
</dependency>

<dependency>
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/net/minecraft/client/Minecraft.java
Expand Up @@ -825,8 +825,6 @@ else if (guiScreenIn == null && this.thePlayer.getHealth() <= 0.0F)
this.mcSoundHandler.resumeSounds();
this.setIngameFocus();
}

new Thread(System::gc).start(); // UC2: Garbage collection on screen change
}

/**
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/net/minecraft/network/PacketBuffer.java
Expand Up @@ -285,14 +285,22 @@ else if (i < 0)
}
else
{
String s = new String(this.readBytes(i).array(), Charsets.UTF_8);
String s;
ByteBuf x = this.readBytes(i);

byte[] bytes = new byte[x.readableBytes()];
x.duplicate().readBytes(bytes);

s = new String(bytes, Charsets.UTF_8);

if (s.length() > maxLength)
{
x.release();
throw new DecoderException("The received string length is longer than maximum allowed (" + i + " > " + maxLength + ")");
}
else
{
x.release();
return s;
}
}
Expand Down
13 changes: 5 additions & 8 deletions src/main/java/org/utilityclient/UtilityClient.java
Expand Up @@ -21,19 +21,16 @@
import java.io.IOException;
import java.util.ArrayList;

import static org.utilityclient.discord.DiscordRP.core;

public class UtilityClient extends Thread {
public static final CPSThread CPS_THREAD_INSTANCE = new CPSThread();
public static final DiscordRP DISCORD_INSTANCE = new DiscordRP();
private static final String CLIENT_NAME = "Utility Client";
private static final String CLIENT_VERSION = "2.13-DEV";
private static final String CLIENT_VERSION = "2.13-PRE-3";
private static final UtilityClient CLIENT_INSTANCE = new UtilityClient();
public static float fovModifier = 1.0f;
public static ArrayList<KeyBinding> keyBinds = new ArrayList<>();
public static Theme CURRENT_THEME = Theme.RED;
public static boolean renderOverlay = true;
public static boolean isSprinting = false;
public static boolean isFulbrightEnabled = false;
public static boolean streamerMode = false;

Expand Down Expand Up @@ -74,7 +71,7 @@ public void run() {
addKeyBind(I18n.format("uc.keybinding.fulbright"), Config.getInteger(ConfigEntry.HOTKEY_FULBRIGHT), false);
addKeyBind(I18n.format("uc.keybinding.overlay"), Config.getInteger(ConfigEntry.HOTKEY_OVERLAY), false);
addKeyBind(I18n.format("uc.keybinding.copyCoords"), 66, false);
addKeyBind("Debug hotkey", 67, false);
//addKeyBind("Debug hotkey", 67, false);

try {
CrosshairManager.run();
Expand Down Expand Up @@ -123,9 +120,9 @@ public void loop() {
clipboard.setContents(stringSelection, null);
}

if(keyBinds.get(4).isPressed()) {
Minecraft.getMinecraft().ingameGUI.setRecordPlaying("Running temporary test code.", false);
}
//if(keyBinds.get(4).isPressed()) {
// Minecraft.getMinecraft().ingameGUI.setRecordPlaying("Running temporary test code.", false);
//}
}
MacroManager.loop();
}
Expand Down
Expand Up @@ -10,7 +10,11 @@ public String getName() {

@Override
public String getValue() {
return mc().thePlayer.sendQueue.getPlayerInfo(mc().thePlayer.getUniqueID()).getResponseTime() + "ms";
try {
return mc().thePlayer.sendQueue.getPlayerInfo(mc().thePlayer.getUniqueID()).getResponseTime() + "ms";
} catch (Exception ignored) {
return "Error";
}
}

@Override
Expand Down

0 comments on commit 927dd0d

Please sign in to comment.