Second update pass (2/3) - 82 -> 0 errors
Second update pass which fixes all compile errors. Some parts may have aftermath effect, hence why 3rd pass will check those maked with "aftermath". Errors: 82 -> 0. Mod can be launched.
This commit is contained in:
@@ -5,6 +5,8 @@ import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.lwjgl.util.vector.Vector3f;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -19,10 +21,14 @@ import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.block.model.ModelRotation;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
@@ -35,7 +41,6 @@ import appeng.client.texture.MissingIcon;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.items.parts.ItemMultiPart;
|
||||
|
||||
//TODO 1.9.4 - Just all
|
||||
public class BakingModelGenerator implements ModelGenerator
|
||||
{
|
||||
private static final class CachedModel implements IBakedModel
|
||||
@@ -133,19 +138,28 @@ public class BakingModelGenerator implements ModelGenerator
|
||||
private EnumFacing currentFace = EnumFacing.UP;
|
||||
private int color = -1;
|
||||
|
||||
public void setRenderBoundsFromBlock( final Block block )
|
||||
public void setRenderBoundsFromBlock( final IBlockState state, final @Nullable BlockPos pos )
|
||||
{
|
||||
if( block == null )
|
||||
if( state == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.setRenderMinX( block.getBlockBoundsMinX() );
|
||||
this.setRenderMinY( block.getBlockBoundsMinY() );
|
||||
this.setRenderMinZ( block.getBlockBoundsMinZ() );
|
||||
this.setRenderMaxX( block.getBlockBoundsMaxX() );
|
||||
this.setRenderMaxY( block.getBlockBoundsMaxY() );
|
||||
this.setRenderMaxZ( block.getBlockBoundsMaxZ() );
|
||||
AxisAlignedBB boundingBox;
|
||||
try
|
||||
{
|
||||
boundingBox = state.getBoundingBox( getBlockAccess(), pos );
|
||||
}
|
||||
catch( NullPointerException e )
|
||||
{
|
||||
boundingBox = Block.FULL_BLOCK_AABB;
|
||||
}
|
||||
this.setRenderMinX( boundingBox.minX );
|
||||
this.setRenderMinY( boundingBox.minY );
|
||||
this.setRenderMinZ( boundingBox.minZ );
|
||||
this.setRenderMaxX( boundingBox.maxX );
|
||||
this.setRenderMaxY( boundingBox.maxY );
|
||||
this.setRenderMaxZ( boundingBox.maxZ );
|
||||
}
|
||||
|
||||
public void setRenderBounds( final double d, final double e, final double f, final double g, final double h, final double i )
|
||||
@@ -289,6 +303,7 @@ public class BakingModelGenerator implements ModelGenerator
|
||||
return this.getIcon( state );
|
||||
}
|
||||
|
||||
//TODO 1.9.4 aftermath - Check that this shit still works.
|
||||
public void addVertexWithUV( final EnumFacing face, final double x, final double y, final double z, final double u, final double v )
|
||||
{
|
||||
this.points[this.point++] = new float[] { (float) x + this.tx, (float) y + this.ty, (float) z + this.tz, (float) u, (float) v };
|
||||
@@ -297,40 +312,43 @@ public class BakingModelGenerator implements ModelGenerator
|
||||
{
|
||||
this.brightness = -1;
|
||||
final int[] vertData = {
|
||||
Float.floatToRawIntBits( this.points[0][0] ),
|
||||
Float.floatToRawIntBits( this.points[0][1] ),
|
||||
Float.floatToRawIntBits( this.points[0][2] ),
|
||||
this.brightness,
|
||||
Float.floatToRawIntBits( this.points[0][3] ),
|
||||
Float.floatToRawIntBits( this.points[0][4] ),
|
||||
0,
|
||||
Float.floatToRawIntBits( this.points[0][0] ),
|
||||
Float.floatToRawIntBits( this.points[0][1] ),
|
||||
Float.floatToRawIntBits( this.points[0][2] ),
|
||||
// this.brightness,
|
||||
Float.floatToRawIntBits( this.points[0][3] ),
|
||||
Float.floatToRawIntBits( this.points[0][4] ),
|
||||
// 0,
|
||||
|
||||
Float.floatToRawIntBits( this.points[1][0] ),
|
||||
Float.floatToRawIntBits( this.points[1][1] ),
|
||||
Float.floatToRawIntBits( this.points[1][2] ),
|
||||
this.brightness,
|
||||
Float.floatToRawIntBits( this.points[1][3] ),
|
||||
Float.floatToRawIntBits( this.points[1][4] ),
|
||||
0,
|
||||
Float.floatToRawIntBits( this.points[1][0] ),
|
||||
Float.floatToRawIntBits( this.points[1][1] ),
|
||||
Float.floatToRawIntBits( this.points[1][2] ),
|
||||
// this.brightness,
|
||||
Float.floatToRawIntBits( this.points[1][3] ),
|
||||
Float.floatToRawIntBits( this.points[1][4] ),
|
||||
// 0,
|
||||
|
||||
Float.floatToRawIntBits( this.points[2][0] ),
|
||||
Float.floatToRawIntBits( this.points[2][1] ),
|
||||
Float.floatToRawIntBits( this.points[2][2] ),
|
||||
this.brightness,
|
||||
Float.floatToRawIntBits( this.points[2][3] ),
|
||||
Float.floatToRawIntBits( this.points[2][4] ),
|
||||
0,
|
||||
Float.floatToRawIntBits( this.points[2][0] ),
|
||||
Float.floatToRawIntBits( this.points[2][1] ),
|
||||
Float.floatToRawIntBits( this.points[2][2] ),
|
||||
// this.brightness,
|
||||
Float.floatToRawIntBits( this.points[2][3] ),
|
||||
Float.floatToRawIntBits( this.points[2][4] ),
|
||||
// 0,
|
||||
|
||||
Float.floatToRawIntBits( this.points[3][0] ),
|
||||
Float.floatToRawIntBits( this.points[3][1] ),
|
||||
Float.floatToRawIntBits( this.points[3][2] ),
|
||||
this.brightness,
|
||||
Float.floatToRawIntBits( this.points[3][3] ),
|
||||
Float.floatToRawIntBits( this.points[3][4] ),
|
||||
0,
|
||||
};
|
||||
Float.floatToRawIntBits( this.points[3][0] ),
|
||||
Float.floatToRawIntBits( this.points[3][1] ),
|
||||
Float.floatToRawIntBits( this.points[3][2] ),
|
||||
// this.brightness,
|
||||
Float.floatToRawIntBits( this.points[3][3] ),
|
||||
Float.floatToRawIntBits( this.points[3][4] ),
|
||||
// 0,
|
||||
};
|
||||
|
||||
this.generatedModel.general.add( new IColoredBakedQuad.ColoredBakedQuad( vertData, this.color, face ) );
|
||||
for( List<BakedQuad> list : this.generatedModel.faces )
|
||||
{
|
||||
list.add( new BakedQuad( vertData, this.color, face, Minecraft.getMinecraft().getTextureMapBlocks().getTextureExtry( TextureMap.LOCATION_BLOCKS_TEXTURE.toString() ), true, DefaultVertexFormats.POSITION_TEX ) );
|
||||
}
|
||||
|
||||
this.point = 0;
|
||||
}
|
||||
@@ -556,15 +574,18 @@ public class BakingModelGenerator implements ModelGenerator
|
||||
final BlockPartFace bpf = new BlockPartFace( myFace, face.getColor(), "", uv );
|
||||
|
||||
BakedQuad bf = this.faceBakery.makeBakedQuad( face.getTo(), face.getFrom(), bpf, face.getSpite(), myFace, mr, null, true, true );
|
||||
bf = new IColoredBakedQuad.ColoredBakedQuad( bf.getVertexData(), face.getColor(), bf.getFace() );
|
||||
bf = new BakedQuad( bf.getVertexData(), face.getColor(), bf.getFace(), Minecraft.getMinecraft().getTextureMapBlocks().getTextureExtry( TextureMap.LOCATION_BLOCKS_TEXTURE.toString() ), true, DefaultVertexFormats.POSITION_TEX );
|
||||
|
||||
if( face.isEdge() )
|
||||
{
|
||||
this.generatedModel.getFaceQuads( myFace ).add( bf );
|
||||
this.generatedModel.faces[myFace.ordinal()].add( bf );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.generatedModel.getGeneralQuads().add( bf );
|
||||
for( List<BakedQuad> list : this.generatedModel.faces )
|
||||
{
|
||||
list.add( bf );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -694,7 +694,7 @@ public class BaseBlockRender<B extends AEBaseBlock, T extends AEBaseTile>
|
||||
renderer.setTranslation( -pos.getX(), -pos.getY(), -pos.getZ() );
|
||||
|
||||
// note that this is a terrible approach...
|
||||
renderer.setRenderBoundsFromBlock( block );
|
||||
renderer.setRenderBoundsFromBlock( block.getDefaultState(), pos );
|
||||
renderer.renderStandardBlock( block, pos );
|
||||
|
||||
renderer.setTranslation( 0, 0, 0 );
|
||||
|
||||
@@ -62,7 +62,7 @@ public final class WorldRender implements ISimpleBlockRenderingHandler
|
||||
public boolean renderWorldBlock( final IBlockAccess world, final BlockPos pos, final Block block, final int modelId, final ModelGenerator renderer )
|
||||
{
|
||||
final AEBaseBlock blk = (AEBaseBlock) block;
|
||||
renderer.setRenderBoundsFromBlock( block );
|
||||
renderer.setRenderBoundsFromBlock( world.getBlockState( pos ), pos );
|
||||
return this.getRender( blk ).renderInWorld( blk, world, pos, renderer );
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public final class WorldRender implements ISimpleBlockRenderingHandler
|
||||
if( blk instanceof AEBaseBlock )
|
||||
{
|
||||
final AEBaseBlock block = (AEBaseBlock) blk;
|
||||
this.renderer.setRenderBoundsFromBlock( block );
|
||||
this.renderer.setRenderBoundsFromBlock( block.getDefaultState(), null );
|
||||
|
||||
this.renderer.setUvRotateBottom( this.renderer.setUvRotateEast( this.renderer.setUvRotateNorth( this.renderer.setUvRotateSouth( this.renderer.setUvRotateTop( this.renderer.setUvRotateWest( 0 ) ) ) ) ) );
|
||||
this.getRender( block ).renderInventory( block, item, this.renderer, type, data );
|
||||
|
||||
@@ -28,9 +28,10 @@ import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.EffectType;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.entity.EntityFloatingItem;
|
||||
import appeng.entity.ICanDie;
|
||||
|
||||
|
||||
public class AssemblerFX extends Particle
|
||||
public class AssemblerFX extends Particle implements ICanDie
|
||||
{
|
||||
|
||||
private final EntityFloatingItem fi;
|
||||
@@ -47,8 +48,12 @@ public class AssemblerFX extends Particle
|
||||
this.fi = new EntityFloatingItem( this, w, x, y, z, is.getItemStack() );
|
||||
w.spawnEntityInWorld( this.fi );
|
||||
this.particleMaxAge = (int) Math.ceil( Math.max( 1, 100.0f / speed ) ) + 2;
|
||||
//TODO 1.9.4 - noClip => ?
|
||||
this.noClip = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDead()
|
||||
{
|
||||
return isExpired;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -61,7 +66,20 @@ public class AssemblerFX extends Particle
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
super.onUpdate();
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
if (this.particleAge++ >= this.particleMaxAge)
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
|
||||
this.motionY -= 0.04D * (double)this.particleGravity;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
this.motionX *= 0.9800000190734863D;
|
||||
this.motionY *= 0.9800000190734863D;
|
||||
this.motionZ *= 0.9800000190734863D;
|
||||
|
||||
if( this.isExpired )
|
||||
{
|
||||
|
||||
@@ -58,9 +58,6 @@ public class CraftingFx extends ParticleBreaking
|
||||
this.startBlkX = MathHelper.floor_double( this.posX );
|
||||
this.startBlkY = MathHelper.floor_double( this.posY );
|
||||
this.startBlkZ = MathHelper.floor_double( this.posZ );
|
||||
|
||||
//TODO 1.9.4 - noClip => ?
|
||||
this.noClip = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -116,7 +113,20 @@ public class CraftingFx extends ParticleBreaking
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
super.onUpdate();
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
if (this.particleAge++ >= this.particleMaxAge)
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
|
||||
this.motionY -= 0.04D * (double)this.particleGravity;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
this.motionX *= 0.9800000190734863D;
|
||||
this.motionY *= 0.9800000190734863D;
|
||||
this.motionZ *= 0.9800000190734863D;
|
||||
this.particleScale *= 0.51f;
|
||||
this.particleAlpha *= 0.51f;
|
||||
}
|
||||
|
||||
@@ -57,9 +57,6 @@ public class EnergyFx extends ParticleBreaking
|
||||
this.startBlkX = MathHelper.floor_double( this.posX );
|
||||
this.startBlkY = MathHelper.floor_double( this.posY );
|
||||
this.startBlkZ = MathHelper.floor_double( this.posZ );
|
||||
|
||||
//TODO 1.9.4 - noClip => ?
|
||||
this.noClip = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -106,9 +103,23 @@ public class EnergyFx extends ParticleBreaking
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
super.onUpdate();
|
||||
this.particleScale *= 0.89f;
|
||||
this.particleAlpha *= 0.89f;
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
if (this.particleAge++ >= this.particleMaxAge)
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
|
||||
this.motionY -= 0.04D * (double)this.particleGravity;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
this.motionX *= 0.9800000190734863D;
|
||||
this.motionY *= 0.9800000190734863D;
|
||||
this.motionZ *= 0.9800000190734863D;
|
||||
|
||||
this.particleScale *= 0.89f;
|
||||
this.particleAlpha *= 0.89f;
|
||||
}
|
||||
|
||||
public void setMotionX( float motionX )
|
||||
|
||||
@@ -35,8 +35,6 @@ public class LightningArcFX extends LightningFX
|
||||
public LightningArcFX( final World w, final double x, final double y, final double z, final double ex, final double ey, final double ez, final double r, final double g, final double b )
|
||||
{
|
||||
super( w, x, y, z, r, g, b, 6 );
|
||||
//TODO 1.9.4 - noClip => ?
|
||||
this.noClip = true;
|
||||
|
||||
this.rx = ex - x;
|
||||
this.ry = ey - y;
|
||||
|
||||
@@ -55,8 +55,6 @@ public class LightningFX extends Particle
|
||||
this.motionY = 0;
|
||||
this.motionZ = 0;
|
||||
this.particleMaxAge = maxAge;
|
||||
//TODO 1.9.4 - noClip => ?
|
||||
this.noClip = true;
|
||||
}
|
||||
|
||||
protected void regen()
|
||||
@@ -83,6 +81,25 @@ public class LightningFX extends Particle
|
||||
final int j1 = 13;
|
||||
return j1 << 20 | j1 << 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
if (this.particleAge++ >= this.particleMaxAge)
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
|
||||
this.motionY -= 0.04D * (double)this.particleGravity;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
this.motionX *= 0.9800000190734863D;
|
||||
this.motionY *= 0.9800000190734863D;
|
||||
this.motionZ *= 0.9800000190734863D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle( final VertexBuffer tess, final Entity p_180434_2_, final float l, final float rX, final float rY, final float rZ, final float rYZ, final float rXY )
|
||||
|
||||
@@ -48,8 +48,6 @@ public class MatterCannonFX extends ParticleBreaking
|
||||
this.motionY = 0.0f;
|
||||
this.motionZ = 0.0f;
|
||||
this.particleTextureIndex = ExtraBlockTextures.BlockMatterCannonParticle.getIcon().getAtlas();
|
||||
//TODO 1.9.4 - noClip => ?
|
||||
this.noClip = true;
|
||||
}
|
||||
|
||||
public void fromItem( final AEPartLocation d )
|
||||
@@ -60,7 +58,21 @@ public class MatterCannonFX extends ParticleBreaking
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
super.onUpdate();
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
if (this.particleAge++ >= this.particleMaxAge)
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
|
||||
this.motionY -= 0.04D * (double)this.particleGravity;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
this.motionX *= 0.9800000190734863D;
|
||||
this.motionY *= 0.9800000190734863D;
|
||||
this.motionZ *= 0.9800000190734863D;
|
||||
|
||||
this.particleScale *= 1.19f;
|
||||
this.particleAlpha *= 0.59f;
|
||||
}
|
||||
|
||||
@@ -46,8 +46,6 @@ public class VibrantFX extends Particle
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.particleMaxAge = (int) ( 20.0D / ( Math.random() * 0.8D + 0.1D ) );
|
||||
//TODO 1.9.4 - noClip => ?
|
||||
this.noClip = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user