Skip to content

Commit

Permalink
Update 2.14
Browse files Browse the repository at this point in the history
  • Loading branch information
sam302rk committed Feb 14, 2022
2 parents 11aadc2 + 751bff5 commit 7ad0488
Show file tree
Hide file tree
Showing 48 changed files with 858 additions and 404 deletions.
Expand Up @@ -43,14 +43,14 @@ public AbstractClientPlayer(World worldIn, GameProfile playerProfile) {
for (JsonElement capeOwners : JSONUtils.gson.fromJson(capeIndex, JsonArray.class)) {
String finalName = name;
capeOwners.getAsJsonObject().get("usernames").getAsJsonArray().forEach(username -> {
if(username.getAsString().equalsIgnoreCase(finalName))
if(username.getAsString().equalsIgnoreCase(finalName) || username.getAsString().equalsIgnoreCase(playerProfile.getId().toString()))
capeUtils.downloadCape("http://cdn.gamingcraft.de/uclient/", capeOwners.getAsJsonObject().get("file").getAsString());
});
}
} catch (Exception e) {
System.err.println("Please send this error to the UtilityClient developers:");
System.err.println("--- START OF ERROR ---");
System.err.println(e);
e.printStackTrace(System.out);
System.err.println("--- END OF ERROR ---");
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/minecraft/client/gui/GuiButton.java
Expand Up @@ -66,7 +66,7 @@ public GuiButton(int buttonId, int x, int y, int widthIn, int heightIn, String b
* Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over
* this button.
*/
protected int getHoverState(boolean mouseOver)
public int getHoverState(boolean mouseOver)
{
int i = 1;

Expand Down
Expand Up @@ -51,7 +51,7 @@ public void updateScreen()
*/
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
this.drawBackground(0);
this.drawBackground();
this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.downloadingTerrain", new Object[0]), this.width / 2, this.height / 2 - 50, 16777215);
super.drawScreen(mouseX, mouseY, partialTicks);
}
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/net/minecraft/client/gui/GuiIngame.java
Expand Up @@ -303,17 +303,16 @@ public void renderGameOverlay(float partialTicks) {
GlStateManager.disableLighting();
GlStateManager.enableAlpha();
if (UtilityClient.shouldRenderOverlay()){
ModuleHandler.loop(UtilityClient.CURRENT_THEME.getId() == 10 ? Minecraft.getMinecraft().standardGalacticFontRenderer : getFontRenderer());
ModuleHandler.loop(getFontRenderer());
if (UtilityClient.isFulbrightEnabled) getFontRenderer().drawStringWithShadow(EnumChatFormatting.GREEN + "Fulbright enabled", i - 4 - getFontRenderer().getStringWidth("Fulbright enabled"), 4, 0);
Keystrokes.loop();
}
}

protected void renderTooltip(ScaledResolution sr, float partialTicks) {
if (mc.getRenderViewEntity() instanceof EntityPlayer) {
if (mc.getRenderViewEntity() instanceof EntityPlayer entityplayer) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(widgetsTexPath);
EntityPlayer entityplayer = (EntityPlayer) mc.getRenderViewEntity();
int i = sr.getScaledWidth() / 2;
float f = zLevel;
zLevel = -90.0F;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/minecraft/client/gui/GuiMainMenu.java

Large diffs are not rendered by default.

51 changes: 43 additions & 8 deletions src/main/java/net/minecraft/client/gui/GuiMultiplayer.java
Expand Up @@ -12,6 +12,8 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lwjgl.input.Keyboard;
import org.utilityclient.utils.Color;
import org.utilityclient.utils.Utils;

import java.io.IOException;
import java.util.List;
Expand All @@ -20,7 +22,7 @@ public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback
{
private static final Logger logger = LogManager.getLogger();
private final OldServerPinger oldServerPinger = new OldServerPinger();
private GuiScreen parentScreen;
private final GuiScreen parentScreen;
private ServerSelectionList serverListSelector;
private ServerList savedServerList;
private GuiButton btnEditServer;
Expand Down Expand Up @@ -168,7 +170,7 @@ protected void actionPerformed(GuiButton button) throws IOException
{
this.deletingServer = true;
String s = I18n.format("selectServer.deleteQuestion");
String s1 = "\'" + s4 + "\' " + I18n.format("selectServer.deleteWarning");
String s1 = "'" + s4 + "' " + I18n.format("selectServer.deleteWarning");
String s2 = I18n.format("selectServer.deleteButton");
String s3 = I18n.format("gui.cancel");
GuiYesNo guiyesno = new GuiYesNo(this, s, s1, s2, s3, this.serverListSelector.func_148193_k());
Expand Down Expand Up @@ -287,6 +289,39 @@ protected void keyTyped(char typedChar, int keyCode) throws IOException

directConnectTextField.textboxKeyTyped(typedChar, keyCode);

if(keyCode == 210) {
this.addingServer = true;
this.mc.displayGuiScreen(new GuiScreenAddServer(this, this.selectedServer = new ServerData("", "", false)));
}

if (keyCode == 211 && guilistextended$iguilistentry instanceof ServerListEntryNormal)
{
String s4 = ((ServerListEntryNormal)guilistextended$iguilistentry).getServerData().serverName;

if (s4 != null)
{
this.deletingServer = true;
String s = I18n.format("selectServer.deleteQuestion");
String s1 = "'" + s4 + "' " + I18n.format("selectServer.deleteWarning");
String s2 = I18n.format("selectServer.deleteButton");
String s3 = I18n.format("gui.cancel");
GuiYesNo guiyesno = new GuiYesNo(this, s, s1, s2, s3, this.serverListSelector.func_148193_k());
this.mc.displayGuiScreen(guiyesno);
}
}

if(Keyboard.isKeyDown(56) || Keyboard.isKeyDown(184)) {
if(keyCode >= 2 && keyCode <= 11) {
int serverEntry = keyCode - 2;
try {
selectServer(serverEntry);
connectToSelected();
} catch (Exception e) {
Utils.ignore(e);
}
}
}

if (keyCode == 63)
{
this.refreshServerList();
Expand Down Expand Up @@ -371,7 +406,7 @@ else if (keyCode != 28 && keyCode != 156)
}
else
{
this.actionPerformed((GuiButton)this.buttonList.get(2));
this.actionPerformed(this.buttonList.get(2));
}
}
else
Expand All @@ -389,7 +424,7 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks)
this.hoveringText = null;
this.drawDefaultBackground();
this.serverListSelector.drawScreen(mouseX, mouseY, partialTicks);
this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.title"), this.width / 2, 20, 16777215);
this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.title"), this.width / 2, 20, Color.TEXT.color);
super.drawScreen(mouseX, mouseY, partialTicks);
directConnectTextField.drawTextBox();

Expand Down Expand Up @@ -476,17 +511,17 @@ public ServerList getServerList()
return this.savedServerList;
}

public boolean func_175392_a(ServerListEntryNormal p_175392_1_, int p_175392_2_)
public boolean func_175392_a(int p_175392_2_)
{
return p_175392_2_ > 0;
}

public boolean func_175394_b(ServerListEntryNormal p_175394_1_, int p_175394_2_)
public boolean func_175394_b(int p_175394_2_)
{
return p_175394_2_ < this.savedServerList.countServers() - 1;
}

public void func_175391_a(ServerListEntryNormal p_175391_1_, int p_175391_2_, boolean p_175391_3_)
public void func_175391_a(int p_175391_2_, boolean p_175391_3_)
{
int i = p_175391_3_ ? 0 : p_175391_2_ - 1;
this.savedServerList.swapServers(p_175391_2_, i);
Expand All @@ -499,7 +534,7 @@ public void func_175391_a(ServerListEntryNormal p_175391_1_, int p_175391_2_, bo
this.serverListSelector.func_148195_a(this.savedServerList);
}

public void func_175393_b(ServerListEntryNormal p_175393_1_, int p_175393_2_, boolean p_175393_3_)
public void func_175393_b(int p_175393_2_, boolean p_175393_3_)
{
int i = p_175393_3_ ? this.savedServerList.countServers() - 1 : p_175393_2_ + 1;
this.savedServerList.swapServers(p_175393_2_, i);
Expand Down
Expand Up @@ -34,7 +34,7 @@ public GuiOptionSlider(int buttonId, int x, int y, GameSettings.Options options,
* Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over
* this button.
*/
protected int getHoverState(boolean mouseOver)
public int getHoverState(boolean mouseOver)
{
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/minecraft/client/gui/GuiOptions.java
@@ -1,13 +1,13 @@
package net.minecraft.client.gui;

import org.utilityclient.*;
import org.utilityclient.gui.*;
import net.minecraft.client.resources.I18n;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.IChatComponent;
import net.minecraft.world.EnumDifficulty;
import org.utilityclient.gui.options.GuiUtilityClient;

import java.io.IOException;
import java.util.Objects;
Expand Down

0 comments on commit 7ad0488

Please sign in to comment.