Skip to content

Commit

Permalink
Remove the modern F3 screen
Browse files Browse the repository at this point in the history
Added to Angelica
  • Loading branch information
embeddedt committed Dec 24, 2023
1 parent 2ba0900 commit a44f61d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 90 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,6 @@ public class ArchaicConfig {
@Config.DefaultBoolean(true)
public static boolean showSplashMemoryBar;

@Config.Comment("Tweak F3 screen to be closer to modern versions.")
@Config.DefaultBoolean(true)
public static boolean modernizeF3Screen;

@Config.Comment("Replace tall grass texture with modern version.")
@Config.DefaultBoolean(false)
public static boolean modernizeTextures;
Expand Down
86 changes: 0 additions & 86 deletions src/main/java/org/embeddedt/archaicfix/proxy/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,92 +73,6 @@ public void onGuiOpen(GuiOpenEvent event) {
}
}

@SubscribeEvent(priority = EventPriority.LOWEST)
public void onRenderOverlay(RenderGameOverlayEvent.Text event) {
Minecraft mc = Minecraft.getMinecraft();
if(event.isCanceled() || !mc.gameSettings.showDebugInfo || event.left.size() < 1)
return;
NetHandlerPlayClient cl = mc.getNetHandler();
if(cl != null) {
IntegratedServer srv = mc.getIntegratedServer();

if (srv != null) {
String s = String.format("Integrated server @ %.0f ms ticks", lastIntegratedTickTime);
event.left.add(1, s);
}
}
if(ArchaicConfig.showBlockDebugInfo && mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
if(!event.right.isEmpty() && Objects.firstNonNull(event.right.get(event.right.size() - 1), "").length() > 0)
event.right.add("");
Block block = mc.theWorld.getBlock(mc.objectMouseOver.blockX, mc.objectMouseOver.blockY, mc.objectMouseOver.blockZ);
int meta = mc.theWorld.getBlockMetadata(mc.objectMouseOver.blockX, mc.objectMouseOver.blockY, mc.objectMouseOver.blockZ);
event.right.add(Block.blockRegistry.getNameForObject(block));
event.right.add("meta: " + meta);
}
if(ArchaicConfig.modernizeF3Screen) {
boolean hasReplacedXYZ = false;
for(int i = 0; i < event.left.size() - 3; i++) {
/* These checks should not be inefficient as most of the time the first one will already fail */
if(!hasReplacedXYZ && Objects.firstNonNull(event.left.get(i), "").startsWith("x:")
&& Objects.firstNonNull(event.left.get(i + 1), "").startsWith("y:")
&& Objects.firstNonNull(event.left.get(i + 2), "").startsWith("z:")
&& Objects.firstNonNull(event.left.get(i + 3), "").startsWith("f:")) {
hasReplacedXYZ = true;
int heading = MathHelper.floor_double((double)(mc.thePlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
String heading_str;
switch(heading) {
case 0:
heading_str = "Towards positive Z";
break;
case 1:
heading_str = "Towards negative X";
break;
case 2:
heading_str = "Towards negative Z";
break;
case 3:
heading_str = "Towards positive X";
break;
default:
throw new RuntimeException();
}
event.left.set(i, String.format("XYZ: %.3f / %.5f / %.3f", mc.thePlayer.posX, mc.thePlayer.boundingBox.minY, mc.thePlayer.posZ));
int blockX = MathHelper.floor_double(mc.thePlayer.posX);
int blockY = MathHelper.floor_double(mc.thePlayer.boundingBox.minY);
int blockZ = MathHelper.floor_double(mc.thePlayer.posZ);
event.left.set(i + 1, String.format("Block: %d %d %d [%d %d %d]", blockX, blockY, blockZ, blockX & 15, blockY & 15, blockZ & 15));
event.left.set(i + 2, String.format("Chunk: %d %d %d", blockX >> 4, blockY >> 4, blockZ >> 4));
event.left.set(i + 3, String.format("Facing: %s (%s) (%.1f / %.1f)", Direction.directions[heading].toLowerCase(Locale.ROOT), heading_str, MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw), MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationPitch)));
}
}
event.setCanceled(true);
/* render ourselves */
FontRenderer fontrenderer = mc.fontRenderer;
int fontColor = 0xe0e0e0;
int rectColor = 0x90505050;
for (int x = 0; x < event.left.size(); x++)
{
String msg = event.left.get(x);
if (msg == null) continue;
int strX = 2;
int strY = 2 + x * fontrenderer.FONT_HEIGHT;
Gui.drawRect(1, strY - 1, strX + fontrenderer.getStringWidth(msg) + 1, strY + fontrenderer.FONT_HEIGHT - 1, rectColor);
fontrenderer.drawString(msg, strX, strY, fontColor);
}
int width = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight).getScaledWidth();
for (int x = 0; x < event.right.size(); x++)
{
String msg = event.right.get(x);
if (msg == null) continue;
int w = fontrenderer.getStringWidth(msg);
int strX = width - w - 2;
int strY = 2 + x * fontrenderer.FONT_HEIGHT;
Gui.drawRect(strX - 1, strY - 1, strX + w + 1, strY + fontrenderer.FONT_HEIGHT - 1, rectColor);
fontrenderer.drawString(msg, strX, strY, fontColor);
}
}
}

@SubscribeEvent
public void onSoundSetup(SoundLoadEvent event) {
soundSystemReloadLock = false;
Expand Down

0 comments on commit a44f61d

Please sign in to comment.