Possible fps improvements, improve tabgui

This commit is contained in:
ThisIsALegitUsername 2023-02-06 15:27:20 +00:00
parent 1deb2e3fad
commit 01bbe7a4a2
7 changed files with 26988 additions and 27012 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -37,7 +37,6 @@ import dev.resent.module.impl.misc.Scoreboard;
import dev.resent.module.impl.misc.SelfNametag;
import dev.resent.module.impl.misc.Sprint;
import dev.resent.module.impl.misc.TabGui;
import dev.resent.module.impl.misc.Tooltips;
public class ModManager {
public List<Mod> modules = new ArrayList<>();
@ -66,7 +65,6 @@ public class ModManager {
public static Scoreboard scoreboard = new Scoreboard();
public static SelfNametag selfNametag = new SelfNametag();
public static ClearChat clearChat = new ClearChat();
public static Tooltips tooltips;
public static FPSB fpsb = new FPSB();
public static Animations animations = new Animations();
public static MinimalViewBobbing minimalViewBobbing = new MinimalViewBobbing();
@ -117,7 +115,6 @@ public class ModManager {
register(scoreboard);
//register(selfNametag = new SelfNametag());
register(clearChat);
register(tooltips = new Tooltips());
register(animations);
}

View File

@ -26,7 +26,7 @@ public class TabGui extends RenderMod{
public void draw() {
Gui.drawRect(x, y, x+70, y+3+Category.values().length*16, 0x90000000);
RenderUtils.drawChromaRectangle(x, y+current*16, x+70, y+19f+current*16, 10, 0xff900000);
RenderUtils.drawChromaRectangle(x, y+current*16, x+70, y+19f+current*16, 0.6f, 0xff900000);
int offset = 0;
for(Category c : Category.values()){
@ -41,7 +41,7 @@ public class TabGui extends RenderMod{
return;
Gui.drawRect(x+70, y, x+138, y+3+Resent.INSTANCE.modManager.modsInCategory(category).size()*16, 0x90000000);
RenderUtils.drawChromaRectangle(x+70, y+category.i*16, x+138, y+19f+category.i*16, 20, 0xff900000);
RenderUtils.drawChromaRectangle(x+70, y+category.i*16, x+138, y+19f+category.i*16, 0.6f, 0xff900000);
offset = 0;
for(Mod m : Resent.INSTANCE.modManager.modsInCategory(category)){

View File

@ -1,19 +0,0 @@
package dev.resent.module.impl.misc;
import dev.resent.annotation.Module;
import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.Mod;
@Module(name = "Tooltips", category = Category.MISC)
public class Tooltips extends Mod {
@Override
public void onEnable() {
if (mc.theWorld != null) mc.gameSettings.advancedItemTooltips = true;
}
@Override
public void onDisable() {
if (mc.theWorld != null) mc.gameSettings.advancedItemTooltips = false;
}
}

View File

@ -169,7 +169,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
private double cameraYaw;
private double cameraPitch;
private int frameCount;
private GameOverlayFramebuffer overlayFramebuffer;
public GameOverlayFramebuffer overlayFramebuffer;
public EntityRenderer(Minecraft mcIn, IResourceManager resourceManagerIn) {
this.frameCount = 0;
@ -1013,7 +1013,10 @@ public class EntityRenderer implements IResourceManagerReloadListener {
}
public void renderWorld(float partialTicks, long finishTimeNano) {
this.updateLightmap(partialTicks);
long framebufferAge = this.overlayFramebuffer.getAge();
if (framebufferAge == -1l || framebufferAge > (Minecraft.getDebugFPS() < 25 ? 125l : 75l)) {
this.updateLightmap(partialTicks);
}
if (this.mc.getRenderViewEntity() == null) {
this.mc.setRenderViewEntity(this.mc.thePlayer);
}
@ -1154,11 +1157,13 @@ public class EntityRenderer implements IResourceManagerReloadListener {
if (!this.debugView) {
this.enableLightmap();
this.mc.mcProfiler.endStartSection("litParticles");
if(!W.noParticles().isEnabled())
effectrenderer.renderLitParticles(entity, partialTicks);
RenderHelper.disableStandardItemLighting();
this.setupFog(0, partialTicks);
this.mc.mcProfiler.endStartSection("particles");
if (!W.noParticles().isEnabled()) effectrenderer.renderParticles(entity, partialTicks);
if (!W.noParticles().isEnabled())
effectrenderer.renderParticles(entity, partialTicks);
this.disableLightmap();
}

View File

@ -1,5 +1,7 @@
package net.minecraft.world;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.util.Vec3;
import net.minecraft.world.border.WorldBorder;
@ -43,6 +45,8 @@ public class WorldProviderHell extends WorldProvider {
* Creates the light to brightness table
*/
protected void generateLightBrightnessTable() {
long framebufferAge = Minecraft.getMinecraft().entityRenderer.overlayFramebuffer.getAge();
if (framebufferAge == -1l || framebufferAge > (Minecraft.getDebugFPS() < 25 ? 125l : 75l)) {
float f = 0.1F;
for (int i = 0; i <= 15; ++i) {
@ -50,6 +54,7 @@ public class WorldProviderHell extends WorldProvider {
this.lightBrightnessTable[i] = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f;
}
}
}
/**+
* Returns 'true' if in the "main surface world", but 'false' if