vanilla-fixes

Minecraft: Better than Adventure! mod that fixes some issues
git clone git://memoryshards.xyz/vanilla-fixes.git
Log | Files | Refs | README | LICENSE

commit be3b7f4f21680236b6217cf808101f9dba7b00c9
parent 0e4970fb1d0fd744c65613224bb731741af6b6fb
Author: Amb0s <ambos@disroot.org>
Date:   Wed, 23 Aug 2023 18:20:18 +0200

Reverted RAM display changes

Diffstat:
Msrc/main/java/turniplabs/vanillafixes/mixin/GuiIngameMixin.java | 31-------------------------------
1 file changed, 0 insertions(+), 31 deletions(-)

diff --git a/src/main/java/turniplabs/vanillafixes/mixin/GuiIngameMixin.java b/src/main/java/turniplabs/vanillafixes/mixin/GuiIngameMixin.java @@ -2,21 +2,10 @@ package turniplabs.vanillafixes.mixin; import net.minecraft.client.gui.GuiIngame; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.*; -import org.spongepowered.asm.mixin.injection.invoke.arg.Args; @Mixin(value = GuiIngame.class, remap = false) final class GuiIngameMixin { - private static long toMiB(long bytes) { - return bytes / 1024L / 1024L; - } - - @Shadow - private void drawDebugScreenLineRight(String string) { - - } - @ModifyConstant(method = "renderGameOverlay", constant = @Constant(stringValue = "s I: ")) private String deobfuscateWeatherIntensity(String value) { return "s, Intensity: "; @@ -26,24 +15,4 @@ final class GuiIngameMixin { private String deobfuscateWeatherPower(String value) { return "%, Power: "; } - - @ModifyArgs(method = "renderGameOverlay", at = @At(value = "INVOKE", - target = "Lnet/minecraft/client/gui/GuiIngame;drawDebugScreenLineRight(Ljava/lang/String;)V", ordinal = 0), - require = 0) - private void changeUsedRAMDisplay(Args args) { - // https://stackoverflow.com/questions/3571203/what-are-runtime-getruntime-totalmemory-and-freememory - long maxRAM = Runtime.getRuntime().maxMemory(); - long totalRAM = Runtime.getRuntime().totalMemory(); - long freeRAM = Runtime.getRuntime().freeMemory(); - long usedRAM = totalRAM - freeRAM; - - args.set(0, "RAM: " + usedRAM * 100L / maxRAM + "% (" + toMiB(usedRAM) + "/" + toMiB(maxRAM)+ "MB)"); - } - - @ModifyArgs(method = "renderGameOverlay", at = @At(value = "INVOKE", - target = "Lnet/minecraft/client/gui/GuiIngame;drawDebugScreenLineRight(Ljava/lang/String;)V", ordinal = 1), - require = 0) - private void changeAllocatedRAMDisplay2(Args args) { - args.set(0, toMiB(Runtime.getRuntime().totalMemory()) + "MB allocated"); - } }