Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Added ability to hide chunk name
Browse files Browse the repository at this point in the history
Yes, the entire commit
  • Loading branch information
Buj Itself committed Sep 7, 2022
1 parent 2eb4291 commit f5977fa
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package net.minecraft.src.buttons;

import net.minecraft.src.GameSettings;
import net.minecraft.src.GuiButton;
import net.minecraft.src.GuiOptionsButton;
import net.minecraft.src.GuiScreen;

public class RenderChunkNameButton implements GuiOptionsButton {
GameSettings settings;

public RenderChunkNameButton(GameSettings settings) {
this.settings = settings;
}

@Override
public String getText() {
return "Show chunk name: " + (settings.renderChunkName ? "Yes" : "No");
}

@Override
public void run(GuiButton button, GuiScreen parent) {
settings.renderChunkName = !settings.renderChunkName;
}
}
44 changes: 26 additions & 18 deletions client/patches/net/minecraft/src/GameSettings.java.diff
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@
+ public static final String[] CHEAT_MENU_MODES;
public boolean musicVolume;
public boolean soundVolume;
@@ -23,4 +20,6 @@
@@ -23,4 +20,7 @@
public boolean limitFramerate;
public boolean fancyGraphics;
+ public boolean acceptRemoteScripts;
+ public boolean renderQAName;
+ public boolean renderChunkName;
public KeyBinding keyBindForward;
public KeyBinding keyBindLeft;
@@ -32,9 +31,12 @@
@@ -32,9 +32,12 @@
public KeyBinding keyBindChat;
public KeyBinding keyBindToggleFog;
+ public KeyBinding keyBindDash;
Expand All @@ -47,13 +48,13 @@
+ public int cheatMenuMode;
public boolean thirdPersonView;

@@ -42,4 +44,5 @@
@@ -42,4 +45,5 @@
RENDER_DISTANCES = new String[] { "FAR", "NORMAL", "SHORT", "TINY" };
DIFFICULTY_LEVELS = new String[] { "Peaceful", "Easy", "Normal", "Hard", "Frail" };
+ CHEAT_MENU_MODES = new String[] { "Default", "One", "Stack", "Inf", "Disabled" };
}

@@ -50,8 +53,11 @@
@@ -50,8 +54,12 @@
this.showFPS = false;
this.renderDistance = 0;
+ this.cheatMenuMode = 0;
Expand All @@ -63,9 +64,10 @@
this.fancyGraphics = true;
+ this.acceptRemoteScripts = false;
+ this.renderQAName = true;
+ this.renderChunkName = true;
this.keyBindForward = new KeyBinding("Forward", 17);
this.keyBindLeft = new KeyBinding("Left", 30);
@@ -60,9 +66,11 @@
@@ -60,9 +68,11 @@
this.keyBindJump = new KeyBinding("Jump", 57);
this.keyBindInventory = new KeyBinding("Inventory", 23);
+ this.keyBindDash = new KeyBinding("Dash", 42);
Expand All @@ -79,7 +81,7 @@
+ this.keyBindings = new KeyBinding[] { this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindToggleFog, this.keyBindOpenGMEnv, this.keyBindDash, this.keyBindHideGUI };
this.difficulty = 2;
this.thirdPersonView = false;
@@ -78,8 +86,11 @@
@@ -78,8 +88,12 @@
this.showFPS = false;
this.renderDistance = 0;
+ this.cheatMenuMode = 0;
Expand All @@ -89,9 +91,10 @@
this.fancyGraphics = true;
+ this.acceptRemoteScripts = false;
+ this.renderQAName = true;
+ this.renderChunkName = true;
this.keyBindForward = new KeyBinding("Forward", 17);
this.keyBindLeft = new KeyBinding("Left", 30);
@@ -88,9 +99,11 @@
@@ -88,9 +102,11 @@
this.keyBindJump = new KeyBinding("Jump", 57);
this.keyBindInventory = new KeyBinding("Inventory", 23);
+ this.keyBindDash = new KeyBinding("Dash", 42);
Expand All @@ -105,7 +108,7 @@
+ this.keyBindings = new KeyBinding[] { this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindToggleFog, this.keyBindOpenGMEnv, this.keyBindDash, this.keyBindHideGUI };
this.difficulty = 2;
this.thirdPersonView = false;
@@ -106,4 +119,81 @@
@@ -106,4 +122,82 @@
}

+ public int getCheatMenuItemAmount(int type) {
Expand Down Expand Up @@ -152,7 +155,8 @@
+ context.topButtons.add(new GraphicsModeButton(this));
+ context.topButtons.add(new GuiScalingButton(this));
+ context.topButtons.add(new RenderQANameButton(this));
+
+ context.topButtons.add(new RenderChunkNameButton(this));
+
+ return context;
+ }
+
Expand Down Expand Up @@ -187,49 +191,52 @@
+
public void setOptionValue(final int optionIndex, final int value) {
if (optionIndex == 0) {
@@ -141,4 +231,7 @@
@@ -141,4 +235,7 @@
this.mc.renderGlobal.loadRenderers();
}
+ if (optionIndex == 10) {
+ this.acceptRemoteScripts = !this.acceptRemoteScripts;
+ }
this.saveOptions();
}
@@ -175,4 +268,7 @@
@@ -175,4 +272,7 @@
return new StringBuilder().append("Graphics: ").append(this.fancyGraphics ? "FANCY" : "FAST").toString();
}
+ if (optionIndex == 10) {
+ return "Remote Scripts: " + (this.acceptRemoteScripts ? "ASK" : "DENY");
+ }
return "";
}
@@ -183,5 +279,5 @@
@@ -183,5 +283,5 @@
return;
}
- final BufferedReader bufferedReader = new BufferedReader((Reader)new FileReader(this.optionsFile));
+ final BufferedReader bufferedReader = new BufferedReader(new FileReader(this.optionsFile));
String line;
while ((line = bufferedReader.readLine()) != null) {
@@ -217,4 +313,7 @@
@@ -217,4 +317,7 @@
this.difficulty = Integer.parseInt(split[1]);
}
+ if (split[0].equals("guiScaling")) {
+ ScaledResolution.guiScaling = Integer.parseInt(split[1]);
+ }
if (split[0].equals("a1605ext_gamepadSens")) {
InputHandler.lookSens = Integer.parseInt(split[1]);
@@ -223,4 +322,10 @@
@@ -223,4 +326,13 @@
this.fancyGraphics = split[1].equals("true");
}
+ if (split[0].equals("acceptRemoteScripts")) {
+ this.acceptRemoteScripts = split[1].equals("true");
+ }
+ if (split[0].equals("renderQAName")) {
+ this.renderQAName = split[1].equals("true");
+ }
+ if (split[0].equals("renderChunkName")) {
+ this.renderChunkName = split[1].equals("true");
+ }
for (int i = 0; i < this.keyBindings.length; ++i) {
if (split[0].equals(new StringBuilder("key_").append(this.keyBindings[i].keyDescription).toString())) {
@@ -238,6 +343,7 @@
@@ -238,6 +350,7 @@

public void saveOptions() {
+ PrintWriter printWriter = null;
Expand All @@ -238,21 +245,22 @@
+ printWriter = new PrintWriter(new FileWriter(this.optionsFile));
printWriter.println(new StringBuilder().append("music:").append(this.musicVolume).toString());
printWriter.println(new StringBuilder().append("sound:").append(this.soundVolume).toString());
@@ -250,4 +356,7 @@
@@ -250,4 +363,8 @@
printWriter.println(new StringBuilder().append("limitFramerate:").append(this.limitFramerate).toString());
printWriter.println(new StringBuilder().append("fancyGraphics:").append(this.fancyGraphics).toString());
+ printWriter.println(new StringBuilder().append("acceptRemoteScripts:").append(this.acceptRemoteScripts).toString());
+ printWriter.println(new StringBuilder().append("renderQAName:").append(this.renderQAName).toString());
+ printWriter.println(new StringBuilder().append("renderChunkName:").append(this.renderChunkName).toString());
+ printWriter.println(new StringBuilder().append("guiScaling:").append(ScaledResolution.guiScaling).toString());
printWriter.println("# Settings below are specific to 1605 extension.");
printWriter.println(new StringBuilder().append("a1605ext_difficulty:").append(this.difficulty).toString());
@@ -256,5 +365,4 @@
@@ -256,5 +373,4 @@
printWriter.println(new StringBuilder("key_").append(this.keyBindings[i].keyDescription).append(":").append(this.keyBindings[i].keyCode).toString());
}
- printWriter.close();
}
catch (Exception ex) {
@@ -262,4 +370,11 @@
@@ -262,4 +378,11 @@
ex.printStackTrace();
}
+ if (printWriter != null) {
Expand Down
39 changes: 29 additions & 10 deletions client/patches/net/minecraft/src/GuiIngame.java.diff
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
- armorItemInSlot.getItem();
final int maxDamage = armorItemInSlot.getMaxDamage();
final int n3 = maxDamage - armorItemInSlot.itemDmg;
@@ -242,26 +248,58 @@
@@ -242,40 +248,74 @@
GL11.glDisable(32826);
if (this.mc.gameSettings.showFPS) {
- fontRenderer.drawStringWithShadow("Minecraft Alpha 1.0.16.05_13 Lilypad (LPUJ v106)", 2, 2, 16777215);
Expand Down Expand Up @@ -138,14 +138,33 @@
+ if (!Objects.equals(GuiIngame.uqKey, "")) {
fontRenderer.drawStringWithShadow(GuiIngame.uqKey, 2, 12, 16777215);
}
@@ -271,5 +309,5 @@
this.ResetNamegen();
}
- GL11.glPushMatrix();
- if (this.NamegenNeedsReset()) {
- this.ResetNamegen();
+ if (mc.gameSettings.renderChunkName) {
+ GL11.glPushMatrix();
+ if (this.NamegenNeedsReset()) {
+ this.ResetNamegen();
+ }
+ final float n7 = (float) (Math.pow(0.5f, (float) this.currentArea.length() / 10.0f));
+ GL11.glScalef(1.0f + n7, 1.0f + n7, 1.0f + n7);
+ final int n = (int) (255.0f * Math.max(1.0f - Math.min(System.currentTimeMillis() - this.areaTimer, 5000L) / 5000.0f, 0.3f));
+ if (n != 0) {
+ fontRenderer.drawStringWithShadow(this.currentArea, scaledWidth / 2 - 80, 20, 16777215 + n * 16777216);
+ }
+ GL11.glPopMatrix();
}
- final float n7 = (float)(1.0 * Math.pow(0.5, (double)(this.currentArea.length() / 10)));
+ final float n7 = (float)(Math.pow(0.5f, (float)this.currentArea.length() / 10.0f));
GL11.glScalef(1.0f + n7, 1.0f + n7, 1.0f + n7);
final int n = (int)(255.0f * Math.max(1.0f - Math.min(System.currentTimeMillis() - this.areaTimer, 5000L) / 5000.0f, 0.3f));
@@ -306,10 +344,12 @@
- GL11.glScalef(1.0f + n7, 1.0f + n7, 1.0f + n7);
- final int n = (int)(255.0f * Math.max(1.0f - Math.min(System.currentTimeMillis() - this.areaTimer, 5000L) / 5000.0f, 0.3f));
- if (n != 0) {
- fontRenderer.drawStringWithShadow(this.currentArea, scaledWidth / 2 - 80, 20, 16777215 + n * 16777216);
- }
- GL11.glPopMatrix();
GL11.glBindTexture(3553, this.mc.renderEngine.getTexture("/gui/icons.png"));
if (this.recordPlayingUpFor > 0) {
@@ -306,10 +346,12 @@
GL11.glPushMatrix();
GL11.glTranslatef(0.0f, (float)(scaledHeight - 48), 0.0f);
- if (GuiScreen.currentID != "") {
Expand All @@ -161,7 +180,7 @@
+ !Item.ITEMS_LIST[int1].getVanilla() && NetClientHandler.rosepadMeta == null)) {
fontRenderer.drawStringWithShadow("(INVALID)", 2, 30, 16711680);
}
@@ -341,7 +381,7 @@
@@ -341,7 +383,7 @@
}
}
- if (this.renderQAName) {
Expand All @@ -171,15 +190,15 @@
+ fontRenderer.drawStringWithShadow("QA BUILD: " + GuiScreenInputPass.name, 5, 0, 553320302);
}
GL11.glPopMatrix();
@@ -410,6 +450,5 @@
@@ -410,6 +452,5 @@
++this.updateCounter;
for (int i = 0; i < this.chatMessageList.size(); ++i) {
- final ChatLine chatLine2;
- final ChatLine chatLine = chatLine2 = (ChatLine)this.chatMessageList.get(i);
+ final ChatLine chatLine2 = this.chatMessageList.get(i);
++chatLine2.updateCounter;
}
@@ -417,4 +456,5 @@
@@ -417,4 +458,5 @@

public void addChatMessage(String message) {
+ if (message.length() > 2000) message = message.substring(message.length() - 2000).trim();
Expand Down

0 comments on commit f5977fa

Please sign in to comment.