anti water lag

This commit is contained in:
ThisIsALegitUsername 2023-03-05 04:36:18 +00:00
parent 040d376c6e
commit d59fd57dd5
9 changed files with 41765 additions and 41720 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

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
cd javascript cd javascript
mv assets.epk as.epk mv assets.epk as.epk
cd javascript/badwifi cd badwifi
rm EaglercraftX_1.8_Offline_en_US.html rm EaglercraftX_1.8_Offline_en_US.html
rm EaglercraftX_1.8_Offline_International.html rm EaglercraftX_1.8_Offline_International.html
rm Resent_3.6_patch__1.8_US.html rm Resent_3.6_patch__1.8_US.html

View File

@ -18,6 +18,8 @@ public class FPSOptions extends Mod{
public BooleanSetting limit = new BooleanSetting("Limit particles", "", true); public BooleanSetting limit = new BooleanSetting("Limit particles", "", true);
public BooleanSetting lowTick = new BooleanSetting("Low animation", "", true); public BooleanSetting lowTick = new BooleanSetting("Low animation", "", true);
public BooleanSetting lightUpdates = new BooleanSetting("Light updates", "", false); public BooleanSetting lightUpdates = new BooleanSetting("Light updates", "", false);
public BooleanSetting noArmSwing = new BooleanSetting("No limb swing", "", true);
public BooleanSetting reducedWater = new BooleanSetting("Reduced water lag", "", true);
public CustomRectSettingDraw minSetting = new CustomRectSettingDraw("Minimal settings", ""){ public CustomRectSettingDraw minSetting = new CustomRectSettingDraw("Minimal settings", ""){
@Override @Override
public void onChange(){ public void onChange(){
@ -52,7 +54,7 @@ public class FPSOptions extends Mod{
//public BooleanSetting delay = new BooleanSetting("Chunk delay", "", false); //public BooleanSetting delay = new BooleanSetting("Chunk delay", "", false);
public FPSOptions(){ public FPSOptions(){
addSetting(batchRendering, blockEffects, limit, lowTick, lightUpdates, minSetting); addSetting(batchRendering, blockEffects, limit, lowTick, lightUpdates, noArmSwing, reducedWater, minSetting);
} }
} }

View File

@ -1,6 +1,8 @@
package net.minecraft.block; package net.minecraft.block;
import java.util.List; import java.util.List;
import dev.resent.module.base.ModManager;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.minecraft.block.material.MapColor; import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
@ -1037,10 +1039,19 @@ public class Block {
registerBlock(5, (String) "planks", block1); registerBlock(5, (String) "planks", block1);
registerBlock(6, (String) "sapling", (new BlockSapling()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("sapling")); registerBlock(6, (String) "sapling", (new BlockSapling()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("sapling"));
registerBlock(7, (String) "bedrock", (new Block(Material.rock)).setBlockUnbreakable().setResistance(6000000.0F).setStepSound(soundTypePiston).setUnlocalizedName("bedrock").disableStats().setCreativeTab(CreativeTabs.tabBlock)); registerBlock(7, (String) "bedrock", (new Block(Material.rock)).setBlockUnbreakable().setResistance(6000000.0F).setStepSound(soundTypePiston).setUnlocalizedName("bedrock").disableStats().setCreativeTab(CreativeTabs.tabBlock));
if(ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.reducedWater.getValue()){
registerBlock(8, (String) "flowing_water", (new BlockDynamicLiquid(Material.water)).setHardness(100.0F).setUnlocalizedName("water").disableStats());
registerBlock(9, (String) "water", (new BlockStaticLiquid(Material.water)).setHardness(100.0F).setUnlocalizedName("water").disableStats());
registerBlock(10, (String) "flowing_lava", (new BlockDynamicLiquid(Material.lava)).setHardness(100.0F).setUnlocalizedName("lava").disableStats());
registerBlock(11, (String) "lava", (new BlockStaticLiquid(Material.lava)).setHardness(100.0F).setUnlocalizedName("lava").disableStats());
}else {
registerBlock(8, (String) "flowing_water", (new BlockDynamicLiquid(Material.water)).setHardness(100.0F).setLightOpacity(3).setUnlocalizedName("water").disableStats()); registerBlock(8, (String) "flowing_water", (new BlockDynamicLiquid(Material.water)).setHardness(100.0F).setLightOpacity(3).setUnlocalizedName("water").disableStats());
registerBlock(9, (String) "water", (new BlockStaticLiquid(Material.water)).setHardness(100.0F).setLightOpacity(3).setUnlocalizedName("water").disableStats()); registerBlock(9, (String) "water", (new BlockStaticLiquid(Material.water)).setHardness(100.0F).setLightOpacity(3).setUnlocalizedName("water").disableStats());
registerBlock(10, (String) "flowing_lava", (new BlockDynamicLiquid(Material.lava)).setHardness(100.0F).setLightLevel(1.0F).setUnlocalizedName("lava").disableStats()); registerBlock(10, (String) "flowing_lava", (new BlockDynamicLiquid(Material.lava)).setHardness(100.0F).setLightLevel(1.0F).setUnlocalizedName("lava").disableStats());
registerBlock(11, (String) "lava", (new BlockStaticLiquid(Material.lava)).setHardness(100.0F).setLightLevel(1.0F).setUnlocalizedName("lava").disableStats()); registerBlock(11, (String) "lava", (new BlockStaticLiquid(Material.lava)).setHardness(100.0F).setLightLevel(1.0F).setUnlocalizedName("lava").disableStats());
}
registerBlock(12, (String) "sand", (new BlockSand()).setHardness(0.5F).setStepSound(soundTypeSand).setUnlocalizedName("sand")); registerBlock(12, (String) "sand", (new BlockSand()).setHardness(0.5F).setStepSound(soundTypeSand).setUnlocalizedName("sand"));
registerBlock(13, (String) "gravel", (new BlockGravel()).setHardness(0.6F).setStepSound(soundTypeGravel).setUnlocalizedName("gravel")); registerBlock(13, (String) "gravel", (new BlockGravel()).setHardness(0.6F).setStepSound(soundTypeGravel).setUnlocalizedName("gravel"));
registerBlock(14, (String) "gold_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setUnlocalizedName("oreGold")); registerBlock(14, (String) "gold_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setUnlocalizedName("oreGold"));

View File

@ -2,9 +2,12 @@ package net.minecraft.block;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.Set; import java.util.Set;
import dev.resent.module.base.ModManager;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.util.BlockPos; import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
@ -41,6 +44,9 @@ public class BlockDynamicLiquid extends BlockLiquid {
} }
public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) {
long framebufferAge = Minecraft.getMinecraft().entityRenderer.overlayFramebuffer.getAge();
if (framebufferAge == -1l || framebufferAge > (Minecraft.getDebugFPS() < 25 ? 125l : 75l)) {
if(ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.reducedWater.getValue()){
int i = ((Integer) iblockstate.getValue(LEVEL)).intValue(); int i = ((Integer) iblockstate.getValue(LEVEL)).intValue();
byte b0 = 1; byte b0 = 1;
if (this.blockMaterial == Material.lava && !world.provider.doesWaterVaporize()) { if (this.blockMaterial == Material.lava && !world.provider.doesWaterVaporize()) {
@ -129,6 +135,8 @@ public class BlockDynamicLiquid extends BlockLiquid {
} }
} }
} }
}
}
private void tryFlowInto(World worldIn, BlockPos pos, IBlockState state, int level) { private void tryFlowInto(World worldIn, BlockPos pos, IBlockState state, int level) {
if (this.canFlowInto(worldIn, pos, state)) { if (this.canFlowInto(worldIn, pos, state)) {

View File

@ -1,12 +1,14 @@
package net.minecraft.client.renderer.entity; package net.minecraft.client.renderer.entity;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_GREATER;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_ONE_MINUS_SRC_ALPHA;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.GL_SRC_ALPHA;
import java.util.List;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import dev.resent.module.base.ModManager; import dev.resent.module.base.ModManager;
import java.util.List;
import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer; import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
@ -15,7 +17,6 @@ import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.OpenGlHelper; import net.lax1dude.eaglercraft.v1_8.opengl.OpenGlHelper;
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer; import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.GLAllocation; import net.minecraft.client.renderer.GLAllocation;
@ -126,8 +127,8 @@ public abstract class RendererLivingEntity<T extends EntityLivingBase> extends R
this.preRenderCallback(entitylivingbase, f1); this.preRenderCallback(entitylivingbase, f1);
float f6 = 0.0625F; float f6 = 0.0625F;
GlStateManager.translate(0.0F, -1.5078125F, 0.0F); GlStateManager.translate(0.0F, -1.5078125F, 0.0F);
float f7 = entitylivingbase.prevLimbSwingAmount + (entitylivingbase.limbSwingAmount - entitylivingbase.prevLimbSwingAmount) * f1; float f7 = ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.noArmSwing.getValue() ? 0 : entitylivingbase.prevLimbSwingAmount + (entitylivingbase.limbSwingAmount - entitylivingbase.prevLimbSwingAmount) * f1;
float f8 = entitylivingbase.limbSwing - entitylivingbase.limbSwingAmount * (1.0F - f1); float f8 = ModManager.fpsOptions.isEnabled() && ModManager.fpsOptions.noArmSwing.getValue() ? 0 : entitylivingbase.limbSwing - entitylivingbase.limbSwingAmount * (1.0F - f1);
if (entitylivingbase.isChild()) { if (entitylivingbase.isChild()) {
f8 *= 3.0F; f8 *= 3.0F;
} }

View File

@ -3,6 +3,8 @@ package net.minecraft.world;
import com.google.common.base.Predicate; import com.google.common.base.Predicate;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import dev.resent.module.base.ModManager;
import dev.resent.util.misc.W; import dev.resent.util.misc.W;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
@ -2106,6 +2108,9 @@ public abstract class World implements IBlockAccess {
} }
public boolean checkLightFor(EnumSkyBlock lightType, BlockPos pos) { public boolean checkLightFor(EnumSkyBlock lightType, BlockPos pos) {
if(!ModManager.fpsOptions.lightUpdates.getValue()){
return true;
}
if (!this.isAreaLoaded(pos, 17, false)) { if (!this.isAreaLoaded(pos, 17, false)) {
return false; return false;
} else { } else {