More fps options

This commit is contained in:
ThisIsALegitUsername 2023-03-05 00:29:40 +00:00
parent 28b4dc7e28
commit c5267f2fe6
7 changed files with 30176 additions and 30156 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -3,44 +3,49 @@ package dev.resent.module.impl.misc;
import dev.resent.annotation.Module; import dev.resent.annotation.Module;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category; import dev.resent.module.base.Mod.Category;
import dev.resent.module.base.ModManager;
import dev.resent.module.base.setting.BooleanSetting; import dev.resent.module.base.setting.BooleanSetting;
import dev.resent.module.base.setting.CustomRectSettingDraw; import dev.resent.module.base.setting.CustomRectSettingDraw;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums; import net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums;
import net.minecraft.client.settings.GameSettings; import net.minecraft.client.settings.GameSettings;
import net.minecraft.util.Timer;
@Module(name = "FPS Options", category = Category.MISC, hasSetting = true) @Module(name = "FPS Options", category = Category.MISC, hasSetting = true)
public class FPSOptions extends Mod{ public class FPSOptions extends Mod{
public BooleanSetting batchRendering = new BooleanSetting("Batch rendering", "", false); public BooleanSetting batchRendering = new BooleanSetting("Batch rendering", "", true);
public BooleanSetting blockEffects = new BooleanSetting("Remove block effects", "", true);
public BooleanSetting limit = new BooleanSetting("Limit particles", "", true);
public BooleanSetting lowTick = new BooleanSetting("Low animation", "", true);
public CustomRectSettingDraw minSetting = new CustomRectSettingDraw("Minimal settings", ""){ public CustomRectSettingDraw minSetting = new CustomRectSettingDraw("Minimal settings", ""){
@Override @Override
public void onChange(){ public void onChange(){
GameSettings gameSettings = mc.gameSettings; GameSettings gameSettings = mc.gameSettings;
Timer timer = mc.timer;
GlStateManager.enableTexture2D(); GlStateManager.enableTexture2D();
GlStateManager.shadeModel(RealOpenGLEnums.GL_SMOOTH); GlStateManager.shadeModel(RealOpenGLEnums.GL_SMOOTH);
GlStateManager.clearDepth(1.0f); GlStateManager.clearDepth(1.0f);
GlStateManager.disableDepth(); GlStateManager.disableDepth();
GlStateManager.enableAlpha(); GlStateManager.enableAlpha();
GlStateManager.alphaFunc(RealOpenGLEnums.GL_GREATER, 0.1F); GlStateManager.alphaFunc(RealOpenGLEnums.GL_GREATER, 0.1F);
gameSettings.limitFramerate = 120; gameSettings.limitFramerate = 120;
gameSettings.enableVsync = false; gameSettings.enableVsync = false;
gameSettings.fancyGraphics = false; gameSettings.fancyGraphics = false;
gameSettings.clouds = 0; gameSettings.clouds = 0;
gameSettings.particleSetting = 2; gameSettings.particleSetting = 2;
gameSettings.viewBobbing = false; gameSettings.viewBobbing = false;
gameSettings.mipmapLevels = 0; gameSettings.mipmapLevels = 0;
gameSettings.renderDistanceChunks = 1; gameSettings.renderDistanceChunks = 1;
gameSettings.ambientOcclusion = 0; gameSettings.ambientOcclusion = 0;
gameSettings.snooperEnabled = false; gameSettings.snooperEnabled = false;
gameSettings.fog = false; gameSettings.fog = false;
gameSettings.allowBlockAlternatives = false; gameSettings.allowBlockAlternatives = false;
gameSettings.fxaa = 0; gameSettings.fxaa = 0;
gameSettings.field_181151_V = false; gameSettings.field_181151_V = false;
ModManager.noParticles.setEnabled(true);
ModManager.fpsb.setEnabled(true);
} }
}; };
//public BooleanSetting delay = new BooleanSetting("Chunk delay", "", false); //public BooleanSetting delay = new BooleanSetting("Chunk delay", "", false);

View File

@ -276,6 +276,7 @@ public class WorldClient extends World {
ItemStack itemstack = this.mc.thePlayer.getHeldItem(); ItemStack itemstack = this.mc.thePlayer.getHeldItem();
boolean flag = this.mc.playerController.getCurrentGameType() == WorldSettings.GameType.CREATIVE && itemstack != null && Block.getBlockFromItem(itemstack.getItem()) == Blocks.barrier; boolean flag = this.mc.playerController.getCurrentGameType() == WorldSettings.GameType.CREATIVE && itemstack != null && Block.getBlockFromItem(itemstack.getItem()) == Blocks.barrier;
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
int
for (int i = 0; i < 1000; ++i) { for (int i = 0; i < 1000; ++i) {
int j = parInt1 + this.rand.nextInt(b0) - this.rand.nextInt(b0); int j = parInt1 + this.rand.nextInt(b0) - this.rand.nextInt(b0);

View File

@ -4,6 +4,9 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import dev.resent.module.base.ModManager;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -150,7 +153,8 @@ public class EffectRenderer {
public void addEffect(EntityFX effect) { public void addEffect(EntityFX effect) {
int i = effect.getFXLayer(); int i = effect.getFXLayer();
int j = effect.getAlpha() != 1.0F ? 0 : 1; int j = effect.getAlpha() != 1.0F ? 0 : 1;
if (this.fxLayers[i][j].size() >= 4000) { int uwu = ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.limit.getValue() ? 100 : 4000;
if (this.fxLayers[i][j].size() >= uwu) {
this.fxLayers[i][j].remove(0); this.fxLayers[i][j].remove(0);
} }
@ -355,6 +359,9 @@ public class EffectRenderer {
} }
public void addBlockDestroyEffects(BlockPos pos, IBlockState state) { public void addBlockDestroyEffects(BlockPos pos, IBlockState state) {
if(ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.blockEffects.getValue())
return;
if (state.getBlock().getMaterial() != Material.air) { if (state.getBlock().getMaterial() != Material.air) {
state = state.getBlock().getActualState(state, this.worldObj, pos); state = state.getBlock().getActualState(state, this.worldObj, pos);
byte b0 = 4; byte b0 = 4;
@ -376,6 +383,9 @@ public class EffectRenderer {
* Adds block hit particles for the specified block * Adds block hit particles for the specified block
*/ */
public void addBlockHitEffects(BlockPos pos, EnumFacing side) { public void addBlockHitEffects(BlockPos pos, EnumFacing side) {
if(ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.blockEffects.getValue())
return;
IBlockState iblockstate = this.worldObj.getBlockState(pos); IBlockState iblockstate = this.worldObj.getBlockState(pos);
Block block = iblockstate.getBlock(); Block block = iblockstate.getBlock();
if (block.getRenderType() != -1) { if (block.getRenderType() != -1) {

View File

@ -802,6 +802,8 @@ public abstract class Entity {
* sprinting and not in water. * sprinting and not in water.
*/ */
public void spawnRunningParticles() { public void spawnRunningParticles() {
if(!this.onGround)
return;
if (this.isSprinting() && !this.isInWater()) { if (this.isSprinting() && !this.isInWater()) {
this.createRunningParticles(); this.createRunningParticles();
} }