Some additional fixes from other branch.
This commit is contained in:
@@ -40,7 +40,7 @@ import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.ItemLayerModel;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.util.Random;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
@@ -55,7 +55,7 @@ public class SpatialSkyRender extends IRenderHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render( final float partialTicks, final WorldClient world, final Minecraft mc )
|
||||
public void render(final float partialTicks, final ClientWorld world, final Minecraft mc )
|
||||
{
|
||||
|
||||
final long now = System.currentTimeMillis();
|
||||
|
||||
@@ -46,7 +46,7 @@ public class TesrRenderHelper
|
||||
*/
|
||||
public static void moveToFace( Direction face )
|
||||
{
|
||||
GlStateManager.translate( face.getFrontOffsetX() * 0.50, face.getFrontOffsetY() * 0.50, face.getFrontOffsetZ() * 0.50 );
|
||||
GlStateManager.translate( face.getXOffset() * 0.50, face.getYOffset() * 0.50, face.getZOffset() * 0.50 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -434,7 +434,7 @@ public class CubeBuilder
|
||||
builder.put( i, x, y, z );
|
||||
break;
|
||||
case NORMAL:
|
||||
builder.put( i, face.getFrontOffsetX(), face.getFrontOffsetY(), face.getFrontOffsetZ() );
|
||||
builder.put( i, face.getXOffset(), face.getYOffset(), face.getZOffset() );
|
||||
break;
|
||||
case COLOR:
|
||||
// Color format is RGBA
|
||||
|
||||
@@ -222,7 +222,7 @@ class ItemEncodedPatternBakedModel implements IBakedModel
|
||||
@Override
|
||||
public IBakedModel handleItemState( IBakedModel originalModel, ItemStack stack, World world, LivingEntity entity )
|
||||
{
|
||||
boolean shiftHeld = Keyboard.isKeyDown( Keyboard.KEY_LSHIFT ) || Keyboard.isKeyDown( Keyboard.KEY_RSHIFT );
|
||||
boolean shiftHeld = Keyboard.isKeyDown( GLFW.GLFW_KEY_LSHIFT ) || Keyboard.isKeyDown( GLFW.GLFW_KEY_RSHIFT );
|
||||
if( shiftHeld )
|
||||
{
|
||||
ItemEncodedPattern iep = (ItemEncodedPattern) stack.getItem();
|
||||
|
||||
@@ -19,7 +19,10 @@
|
||||
package appeng.client.render.effects;
|
||||
|
||||
|
||||
import com.mojang.blaze3d.vertex.IVertexBuilder;
|
||||
import net.minecraft.client.particle.IParticleRenderType;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.renderer.ActiveRenderInfo;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -48,8 +51,8 @@ public class AssemblerFX extends Particle implements ICanDie
|
||||
this.speed = speed;
|
||||
final ItemStack displayItem = is.asItemStackRepresentation();
|
||||
this.fi = new EntityFloatingItem( this, w, x, y, z, displayItem );
|
||||
w.spawnEntity( this.fi );
|
||||
this.particleMaxAge = (int) Math.ceil( Math.max( 1, 100.0f / speed ) ) + 2;
|
||||
w.addEntity( this.fi );
|
||||
this.maxAge = (int) Math.ceil( Math.max( 1, 100.0f / speed ) ) + 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -66,13 +69,13 @@ public class AssemblerFX extends Particle implements ICanDie
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
public void tick()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
if( this.particleAge++ >= this.particleMaxAge )
|
||||
if( this.age++ >= this.maxAge )
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
@@ -85,19 +88,25 @@ public class AssemblerFX extends Particle implements ICanDie
|
||||
|
||||
if( this.isExpired )
|
||||
{
|
||||
this.fi.setDead();
|
||||
this.fi.remove();
|
||||
}
|
||||
else
|
||||
{
|
||||
final float lifeSpan = (float) this.particleAge / (float) this.particleMaxAge;
|
||||
final float lifeSpan = (float) this.age / (float) this.maxAge;
|
||||
this.fi.setProgress( lifeSpan );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle( final BufferBuilder par1Tessellator, final Entity p_180434_2_, final float l, final float rX, final float rY, final float rZ, final float rYZ, final float rXY )
|
||||
public IParticleRenderType getRenderType() {
|
||||
// TODO: FIXME
|
||||
return IParticleRenderType.NO_RENDER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle( IVertexBuilder buffer, ActiveRenderInfo renderInfo, float partialTicks )
|
||||
{
|
||||
this.time += l;
|
||||
this.time += partialTicks;
|
||||
if( this.time > 4.0 )
|
||||
{
|
||||
this.time -= 4.0;
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
package appeng.client.render.effects;
|
||||
|
||||
|
||||
import net.minecraft.client.particle.ParticleRedstone;
|
||||
import net.minecraft.client.particle.RedstoneParticle;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
||||
public class ChargedOreFX extends ParticleRedstone
|
||||
public class ChargedOreFX extends RedstoneParticle
|
||||
{
|
||||
|
||||
public ChargedOreFX( final World w, final double x, final double y, final double z, final float r, final float g, final float b )
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
package appeng.client.render.effects;
|
||||
|
||||
|
||||
import net.minecraft.client.particle.ParticleBreaking;
|
||||
import net.minecraft.client.particle.BreakingParticle;
|
||||
import net.minecraft.client.particle.IParticleRenderType;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -34,7 +35,7 @@ import appeng.client.render.textures.ParticleTextures;
|
||||
|
||||
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public class CraftingFx extends ParticleBreaking
|
||||
public class CraftingFx extends BreakingParticle
|
||||
{
|
||||
|
||||
private final TextureAtlasSprite particleTextureIndex;
|
||||
@@ -53,11 +54,11 @@ public class CraftingFx extends ParticleBreaking
|
||||
this.particleAlpha = 1.3f;
|
||||
this.particleScale = 1.5f;
|
||||
this.particleTextureIndex = ParticleTextures.BlockEnergyParticle;
|
||||
this.particleMaxAge /= 1.2;
|
||||
this.maxAge /= 1.2;
|
||||
|
||||
this.startBlkX = MathHelper.floor( this.posX );
|
||||
this.startBlkY = MathHelper.floor( this.posY );
|
||||
this.startBlkZ = MathHelper.floor( this.posZ );
|
||||
this.startBlkX = MathHelper.floor( this.getPosX() );
|
||||
this.startBlkY = MathHelper.floor( this.getPosY() );
|
||||
this.startBlkZ = MathHelper.floor( this.getPosZ() );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -66,6 +67,12 @@ public class CraftingFx extends ParticleBreaking
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IParticleRenderType getRenderType() {
|
||||
// TODO: FIXME
|
||||
return IParticleRenderType.NO_RENDER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle( final BufferBuilder par1Tessellator, final Entity p_180434_2_, final float partialTick, final float x, final float y, final float z, final float rx, final float rz )
|
||||
{
|
||||
@@ -80,9 +87,9 @@ public class CraftingFx extends ParticleBreaking
|
||||
final float f9 = this.particleTextureIndex.getMaxV();
|
||||
final float scale = 0.1F * this.particleScale;
|
||||
|
||||
float offX = (float) ( this.prevPosX + ( this.posX - this.prevPosX ) * partialTick );
|
||||
float offY = (float) ( this.prevPosY + ( this.posY - this.prevPosY ) * partialTick );
|
||||
float offZ = (float) ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * partialTick );
|
||||
float offX = (float) ( this.prevPosX + ( this.getPosX() - this.prevPosX ) * partialTick );
|
||||
float offY = (float) ( this.prevPosY + ( this.getPosY() - this.prevPosY ) * partialTick );
|
||||
float offZ = (float) ( this.prevPosZ + ( this.getPosZ() - this.prevPosZ ) * partialTick );
|
||||
|
||||
final int blkX = MathHelper.floor( offX );
|
||||
final int blkY = MathHelper.floor( offY );
|
||||
@@ -124,20 +131,20 @@ public class CraftingFx extends ParticleBreaking
|
||||
|
||||
public void fromItem( final AEPartLocation d )
|
||||
{
|
||||
this.posX += 0.2 * d.xOffset;
|
||||
this.posY += 0.2 * d.yOffset;
|
||||
this.posZ += 0.2 * d.zOffset;
|
||||
this.getPosX() += 0.2 * d.xOffset;
|
||||
this.getPosY() += 0.2 * d.yOffset;
|
||||
this.getPosZ() += 0.2 * d.zOffset;
|
||||
this.particleScale *= 0.8f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
public void tick()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.prevPosX = this.getPosX();
|
||||
this.prevPosY = this.getPosY();
|
||||
this.prevPosZ = this.getPosZ();
|
||||
|
||||
if( this.particleAge++ >= this.particleMaxAge )
|
||||
if( this.age++ >= this.maxAge )
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
package appeng.client.render.effects;
|
||||
|
||||
|
||||
import net.minecraft.client.particle.ParticleBreaking;
|
||||
import net.minecraft.client.particle.BreakingParticle;
|
||||
import net.minecraft.client.particle.IParticleRenderType;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -34,7 +35,7 @@ import appeng.client.render.textures.ParticleTextures;
|
||||
|
||||
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public class EnergyFx extends ParticleBreaking
|
||||
public class EnergyFx extends BreakingParticle
|
||||
{
|
||||
|
||||
private final TextureAtlasSprite particleTextureIndex;
|
||||
@@ -54,9 +55,9 @@ public class EnergyFx extends ParticleBreaking
|
||||
this.particleScale = 3.5f;
|
||||
this.particleTextureIndex = ParticleTextures.BlockEnergyParticle;
|
||||
|
||||
this.startBlkX = MathHelper.floor( this.posX );
|
||||
this.startBlkY = MathHelper.floor( this.posY );
|
||||
this.startBlkZ = MathHelper.floor( this.posZ );
|
||||
this.startBlkX = MathHelper.floor( this.getPosX() );
|
||||
this.startBlkY = MathHelper.floor( this.getPosY() );
|
||||
this.startBlkZ = MathHelper.floor( this.getPosZ() );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -65,6 +66,12 @@ public class EnergyFx extends ParticleBreaking
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IParticleRenderType getRenderType() {
|
||||
// TODO: FIXME
|
||||
return IParticleRenderType.NO_RENDER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle( final BufferBuilder par1Tessellator, final Entity p_180434_2_, final float partialTicks, final float par3, final float par4, final float par5, final float par6, final float par7 )
|
||||
{
|
||||
@@ -74,13 +81,13 @@ public class EnergyFx extends ParticleBreaking
|
||||
final float f9 = this.particleTextureIndex.getMaxV();
|
||||
final float f10 = 0.1F * this.particleScale;
|
||||
|
||||
final float f11 = (float) ( this.prevPosX + ( this.posX - this.prevPosX ) * partialTicks - interpPosX );
|
||||
final float f12 = (float) ( this.prevPosY + ( this.posY - this.prevPosY ) * partialTicks - interpPosY );
|
||||
final float f13 = (float) ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * partialTicks - interpPosZ );
|
||||
final float f11 = (float) ( this.prevPosX + ( this.getPosX() - this.prevPosX ) * partialTicks - interpPosX );
|
||||
final float f12 = (float) ( this.prevPosY + ( this.getPosY() - this.prevPosY ) * partialTicks - interpPosY );
|
||||
final float f13 = (float) ( this.prevPosZ + ( this.getPosZ() - this.prevPosZ ) * partialTicks - interpPosZ );
|
||||
|
||||
final int blkX = MathHelper.floor( this.posX );
|
||||
final int blkY = MathHelper.floor( this.posY );
|
||||
final int blkZ = MathHelper.floor( this.posZ );
|
||||
final int blkX = MathHelper.floor( this.getPosX() );
|
||||
final int blkY = MathHelper.floor( this.getPosY() );
|
||||
final int blkZ = MathHelper.floor( this.getPosZ() );
|
||||
|
||||
if( blkX == this.startBlkX && blkY == this.startBlkY && blkZ == this.startBlkZ )
|
||||
{
|
||||
@@ -114,20 +121,20 @@ public class EnergyFx extends ParticleBreaking
|
||||
|
||||
public void fromItem( final AEPartLocation d )
|
||||
{
|
||||
this.posX += 0.2 * d.xOffset;
|
||||
this.posY += 0.2 * d.yOffset;
|
||||
this.posZ += 0.2 * d.zOffset;
|
||||
this.getPosX() += 0.2 * d.xOffset;
|
||||
this.getPosY() += 0.2 * d.yOffset;
|
||||
this.getPosZ() += 0.2 * d.zOffset;
|
||||
this.particleScale *= 0.8f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
public void tick()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.prevPosX = this.getPosX();
|
||||
this.prevPosY = this.getPosY();
|
||||
this.prevPosZ = this.getPosZ();
|
||||
|
||||
if( this.particleAge++ >= this.particleMaxAge )
|
||||
if( this.age++ >= this.maxAge )
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ package appeng.client.render.effects;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.IParticleRenderType;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -55,7 +56,7 @@ public class LightningFX extends Particle
|
||||
this.motionX = 0;
|
||||
this.motionY = 0;
|
||||
this.motionZ = 0;
|
||||
this.particleMaxAge = maxAge;
|
||||
this.maxAge = maxAge;
|
||||
}
|
||||
|
||||
protected void regen()
|
||||
@@ -77,13 +78,19 @@ public class LightningFX extends Particle
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
public IParticleRenderType getRenderType() {
|
||||
// TODO: FIXME
|
||||
return IParticleRenderType.NO_RENDER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
if( this.particleAge++ >= this.particleMaxAge )
|
||||
if( this.age++ >= this.maxAge )
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
@@ -104,7 +111,7 @@ public class LightningFX extends Particle
|
||||
float blue = this.particleBlue * j;
|
||||
final float alpha = this.particleAlpha;
|
||||
|
||||
if( this.particleAge == 3 )
|
||||
if( this.age == 3 )
|
||||
{
|
||||
this.regen();
|
||||
}
|
||||
@@ -157,9 +164,9 @@ public class LightningFX extends Particle
|
||||
{
|
||||
this.clear();
|
||||
|
||||
double x = ( this.prevPosX + ( this.posX - this.prevPosX ) * l - interpPosX ) - offX;
|
||||
double y = ( this.prevPosY + ( this.posY - this.prevPosY ) * l - interpPosY ) - offY;
|
||||
double z = ( this.prevPosZ + ( this.posZ - this.prevPosZ ) * l - interpPosZ ) - offZ;
|
||||
double x = ( this.prevPosX + ( this.getPosX() - this.prevPosX ) * l - interpPosX ) - offX;
|
||||
double y = ( this.prevPosY + ( this.getPosY() - this.prevPosY ) * l - interpPosY ) - offY;
|
||||
double z = ( this.prevPosZ + ( this.getPosZ() - this.prevPosZ ) * l - interpPosZ ) - offZ;
|
||||
|
||||
for( int s = 0; s < LightningFX.STEPS; s++ )
|
||||
{
|
||||
|
||||
@@ -19,23 +19,24 @@
|
||||
package appeng.client.render.effects;
|
||||
|
||||
|
||||
import net.minecraft.client.particle.ParticleBreaking;
|
||||
import net.minecraft.client.particle.BreakingParticle;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.client.render.textures.ParticleTextures;
|
||||
|
||||
|
||||
public class MatterCannonFX extends ParticleBreaking
|
||||
public class MatterCannonFX extends BreakingParticle
|
||||
{
|
||||
|
||||
private final TextureAtlasSprite particleTextureIndex;
|
||||
|
||||
public MatterCannonFX( final World par1World, final double par2, final double par4, final double par6, final Item par8Item )
|
||||
public MatterCannonFX( final World par1World, final double par2, final double par4, final double par6, final ItemStack par8Item )
|
||||
{
|
||||
super( par1World, par2, par4, par6, par8Item );
|
||||
this.particleGravity = 0;
|
||||
@@ -56,13 +57,13 @@ public class MatterCannonFX extends ParticleBreaking
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
public void tick()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
if( this.particleAge++ >= this.particleMaxAge )
|
||||
if( this.age++ >= this.maxAge )
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
|
||||
@@ -42,10 +42,10 @@ public class VibrantFX extends Particle
|
||||
this.motionX = 0.0D;
|
||||
this.motionY = 0.0D;
|
||||
this.motionZ = 0.0D;
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.particleMaxAge = (int) ( 20.0D / ( Math.random() * 0.8D + 0.1D ) );
|
||||
this.prevPosX = this.getPosX();
|
||||
this.prevPosY = this.getPosY();
|
||||
this.prevPosZ = this.getPosZ();
|
||||
this.maxAge = (int) ( 20.0D / ( Math.random() * 0.8D + 0.1D ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,18 +59,18 @@ public class VibrantFX extends Particle
|
||||
* Called to update the entity's position/logic.
|
||||
*/
|
||||
@Override
|
||||
public void onUpdate()
|
||||
public void tick()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.prevPosX = this.getPosX();
|
||||
this.prevPosY = this.getPosY();
|
||||
this.prevPosZ = this.getPosZ();
|
||||
// this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
this.particleScale *= 0.95;
|
||||
|
||||
if( this.particleMaxAge <= 0 || this.particleScale < 0.1 )
|
||||
if( this.maxAge <= 0 || this.particleScale < 0.1 )
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
this.particleMaxAge--;
|
||||
this.maxAge--;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user