1
0
Fork 0
This commit is contained in:
HoosierTransfer 2024-04-27 17:47:58 -04:00
parent c381d62a58
commit 200cf8d5dc
9 changed files with 45098 additions and 23658 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

File diff suppressed because one or more lines are too long

View File

@ -32,4 +32,9 @@ public class Config {
public static boolean animateTick() {
return false;
}
public static boolean renderParticles() {
return false;
}
}

View File

@ -5,6 +5,7 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;
import net.hoosiertransfer.Config;
/**
* Copyright (c) 2022 lax1dude. All Rights Reserved.
@ -47,12 +48,14 @@ public class AcceleratedEffectRenderer implements IAcceleratedParticleEngine {
@Override
public void draw(float texCoordWidth, float texCoordHeight) {
if (!Config.renderParticles()) return;
InstancedParticleRenderer.render(texCoordWidth, texCoordHeight, 0.0625f, f1, f5, f2, f3, f4);
}
@Override
public void drawParticle(Entity entityIn, int particleIndexX, int particleIndexY, int lightMapData,
int texSize, float particleSize, float r, float g, float b, float a) {
if (!Config.renderParticles()) return;
float xx = (float) (entityIn.prevPosX + (entityIn.posX - entityIn.prevPosX) * (double) partialTicks - EntityFX.interpPosX);
float yy = (float) (entityIn.prevPosY + (entityIn.posY - entityIn.prevPosY) * (double) partialTicks - EntityFX.interpPosY);
float zz = (float) (entityIn.prevPosZ + (entityIn.posZ - entityIn.prevPosZ) * (double) partialTicks - EntityFX.interpPosZ);
@ -62,6 +65,7 @@ public class AcceleratedEffectRenderer implements IAcceleratedParticleEngine {
@Override
public void drawParticle(Entity entityIn, int particleIndexX, int particleIndexY, int lightMapData,
int texSize, float particleSize, int rgba) {
if (!Config.renderParticles()) return;
float xx = (float) (entityIn.prevPosX + (entityIn.posX - entityIn.prevPosX) * (double) partialTicks - EntityFX.interpPosX);
float yy = (float) (entityIn.prevPosY + (entityIn.posY - entityIn.prevPosY) * (double) partialTicks - EntityFX.interpPosY);
float zz = (float) (entityIn.prevPosZ + (entityIn.posZ - entityIn.prevPosZ) * (double) partialTicks - EntityFX.interpPosZ);
@ -71,6 +75,7 @@ public class AcceleratedEffectRenderer implements IAcceleratedParticleEngine {
@Override
public void drawParticle(float posX, float posY, float posZ, int particleIndexX, int particleIndexY,
int lightMapData, int texSize, float particleSize, float r, float g, float b, float a) {
if (!Config.renderParticles()) return;
InstancedParticleRenderer.appendParticle(posX, posY, posZ, particleIndexX, particleIndexY, lightMapData & 0xFF,
(lightMapData >> 16) & 0xFF, (int)(particleSize * 16.0f), texSize, r, g, b, a);
}
@ -78,6 +83,7 @@ public class AcceleratedEffectRenderer implements IAcceleratedParticleEngine {
@Override
public void drawParticle(float posX, float posY, float posZ, int particleIndexX, int particleIndexY,
int lightMapData, int texSize, float particleSize, int rgba) {
if (!Config.renderParticles()) return;
InstancedParticleRenderer.appendParticle(posX, posY, posZ, particleIndexX, particleIndexY, lightMapData & 0xFF,
(lightMapData >> 16) & 0xFF, (int)(particleSize * 16.0f), texSize, rgba);
}

View File

@ -46,6 +46,7 @@ public class ChunkUpdateManager {
}
private void runGenerator(ChunkCompileTaskGenerator generator, Entity entity) {
Minecraft.getMinecraft().mcProfiler.startSection("chunkCompile");
generator.setRegionRenderCacheBuilder(renderCache);
float f = (float) entity.posX;
float f1 = (float) entity.posY + entity.getEyeHeight();
@ -101,6 +102,7 @@ public class ChunkUpdateManager {
}
public boolean updateChunks(long timeout) {
Entity entity = Minecraft.getMinecraft().getRenderViewEntity();
if (entity == null) {
queue.clear();

View File

@ -1,6 +1,8 @@
package net.minecraft.block;
import java.util.List;
import net.hoosiertransfer.Config;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.minecraft.block.material.Material;

View File

@ -5,6 +5,8 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import net.hoosiertransfer.Config;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.minecraft.AcceleratedEffectRenderer;
import net.lax1dude.eaglercraft.v1_8.minecraft.IAcceleratedParticleEngine;
@ -36,6 +38,7 @@ import net.minecraft.util.MathHelper;
import net.minecraft.util.ReportedException;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.hoosiertransfer.Config;
/**+
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
@ -151,6 +154,7 @@ public class EffectRenderer {
*/
public EntityFX spawnEffectParticle(int particleId, double parDouble1, double parDouble2, double parDouble3,
double parDouble4, double parDouble5, double parDouble6, int... parArrayOfInt) {
if (!Config.renderParticles()) return null;
IParticleFactory iparticlefactory = (IParticleFactory) this.particleTypes.get(Integer.valueOf(particleId));
if (iparticlefactory != null) {
EntityFX entityfx = iparticlefactory.getEntityFX(particleId, this.worldObj, parDouble1, parDouble2,
@ -214,6 +218,7 @@ public class EffectRenderer {
}
private void tickParticle(final EntityFX parEntityFX) {
if (!Config.renderParticles()) return;
try {
parEntityFX.onUpdate();
} catch (Throwable throwable) {
@ -248,6 +253,7 @@ public class EffectRenderer {
* Renders all current particles. Args player, partialTickTime
*/
public void renderParticles(Entity entityIn, float partialTicks, int pass) {
if (!Config.renderParticles()) return;
float f = ActiveRenderInfo.getRotationX();
float f1 = ActiveRenderInfo.getRotationZ();
float f2 = ActiveRenderInfo.getRotationYZ();
@ -354,6 +360,7 @@ public class EffectRenderer {
}
public void renderLitParticles(Entity entityIn, float parFloat1) {
if (!Config.renderParticles()) return;
float f = 0.017453292F;
float f1 = MathHelper.cos(entityIn.rotationYaw * 0.017453292F);
float f2 = MathHelper.sin(entityIn.rotationYaw * 0.017453292F);
@ -389,6 +396,7 @@ public class EffectRenderer {
}
public void addBlockDestroyEffects(BlockPos pos, IBlockState state) {
if (!Config.renderParticles()) return;
if (state.getBlock().getMaterial() != Material.air) {
state = state.getBlock().getActualState(state, this.worldObj, pos);
byte b0 = 4;
@ -413,6 +421,7 @@ public class EffectRenderer {
* Adds block hit particles for the specified block
*/
public void addBlockHitEffects(BlockPos pos, EnumFacing side) {
if (!Config.renderParticles()) return;
IBlockState iblockstate = this.worldObj.getBlockState(pos);
Block block = iblockstate.getBlock();
if (block.getRenderType() != -1) {

View File

@ -10,6 +10,7 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import net.hoosiertransfer.Config;
import net.hoosiertransfer.Alfheim.ILightInfoProvider;
import net.hoosiertransfer.Alfheim.ILightLevelProvider;
import net.hoosiertransfer.Alfheim.ILightingEngineProvider;
@ -857,18 +858,21 @@ public abstract class World implements IBlockAccess, ILightingEngineProvider, IL
public void spawnParticle(EnumParticleTypes particleType, double xCoord, double yCoord, double zCoord,
double xOffset, double yOffset, double zOffset, int... parArrayOfInt) {
if (!Config.renderParticles()) return;
this.spawnParticle(particleType.getParticleID(), particleType.getShouldIgnoreRange(), xCoord, yCoord, zCoord,
xOffset, yOffset, zOffset, parArrayOfInt);
}
public void spawnParticle(EnumParticleTypes particleType, boolean xCoord, double yCoord, double zCoord,
double xOffset, double yOffset, double zOffset, double parDouble6, int... parArrayOfInt) {
if (!Config.renderParticles()) return;
this.spawnParticle(particleType.getParticleID(), particleType.getShouldIgnoreRange() | xCoord, yCoord, zCoord,
xOffset, yOffset, zOffset, parDouble6, parArrayOfInt);
}
private void spawnParticle(int particleID, boolean xCood, double yCoord, double zCoord, double xOffset,
double yOffset, double zOffset, double parDouble6, int... parArrayOfInt) {
if (!Config.renderParticles()) return;
for (int i = 0; i < this.worldAccesses.size(); ++i) {
((IWorldAccess) this.worldAccesses.get(i)).spawnParticle(particleID, xCood, yCoord, zCoord, xOffset,
yOffset, zOffset, parDouble6, parArrayOfInt);