1.16 port

This commit is contained in:
yueh
2020-07-22 16:44:42 +02:00
parent 662dbca3e1
commit 56ecda5173
225 changed files with 1214 additions and 969 deletions
@@ -29,11 +29,11 @@ import net.minecraft.client.particle.IParticleRenderType;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.particle.SpriteTexturedParticle;
import net.minecraft.client.renderer.ActiveRenderInfo;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.particles.BasicParticleType;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -49,14 +49,14 @@ public class LightningFX extends SpriteTexturedParticle {
private final double[] verticesWithUV = new double[3];
private boolean hasData = false;
private LightningFX(final World w, final double x, final double y, final double z, final double r, final double g,
final double b) {
private LightningFX(final ClientWorld w, final double x, final double y, final double z, final double r,
final double g, final double b) {
this(w, x, y, z, r, g, b, 6);
this.regen();
}
protected LightningFX(final World w, final double x, final double y, final double z, final double r, final double g,
final double b, final int maxAge) {
protected LightningFX(final ClientWorld w, final double x, final double y, final double z, final double r,
final double g, final double b, final int maxAge) {
super(w, x, y, z, r, g, b);
this.precomputedSteps = new double[LightningFX.STEPS][3];
this.motionX = 0;
@@ -108,10 +108,10 @@ public class LightningFX extends SpriteTexturedParticle {
@Override
public void renderParticle(IVertexBuilder buffer, ActiveRenderInfo renderInfo, float partialTicks) {
Vec3d vec3d = renderInfo.getProjectedView();
float centerX = (float) (MathHelper.lerp(partialTicks, this.prevPosX, this.posX) - vec3d.getX());
float centerY = (float) (MathHelper.lerp(partialTicks, this.prevPosY, this.posY) - vec3d.getY());
float centerZ = (float) (MathHelper.lerp(partialTicks, this.prevPosZ, this.posZ) - vec3d.getZ());
Vector3d Vector3d = renderInfo.getProjectedView();
float centerX = (float) (MathHelper.lerp(partialTicks, this.prevPosX, this.posX) - Vector3d.getX());
float centerY = (float) (MathHelper.lerp(partialTicks, this.prevPosY, this.posY) - Vector3d.getY());
float centerZ = (float) (MathHelper.lerp(partialTicks, this.prevPosZ, this.posZ) - Vector3d.getZ());
final float j = 1.0f;
float red = this.particleRed * j * 0.9f;
@@ -253,7 +253,7 @@ public class LightningFX extends SpriteTexturedParticle {
}
@Override
public Particle makeParticle(BasicParticleType typeIn, World worldIn, double x, double y, double z,
public Particle makeParticle(BasicParticleType typeIn, ClientWorld worldIn, double x, double y, double z,
double xSpeed, double ySpeed, double zSpeed) {
LightningFX lightningFX = new LightningFX(worldIn, x, y, z, xSpeed, ySpeed, zSpeed);
lightningFX.selectSpriteRandomly(this.spriteSet);