Lots of compile fixes

This commit is contained in:
Sebastian Hartte
2020-06-04 03:02:48 +02:00
parent 6eb2a9504a
commit 237463dd94
241 changed files with 3438 additions and 3474 deletions
@@ -39,7 +39,7 @@ public class StaticItemColor implements IItemColor
}
@Override
public int colorMultiplier( ItemStack stack, int tintIndex )
public int getColor( ItemStack stack, int tintIndex )
{
return this.color.getVariantByTintIndex( tintIndex );
}
@@ -19,9 +19,14 @@
package appeng.client.render;
import appeng.api.storage.data.IAEItemStack;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.Vector3f;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction;
import appeng.util.IWideReadableNumberConverter;
@@ -91,52 +96,50 @@ public class TesrRenderHelper
}
//TODO, A different approach will have to be used for this from TESRs, -covers, i have ideas.
// /**
// * Render an item in 2D.
// */
// public static void renderItem2d( ItemStack itemStack, float scale )
// {
// if( !itemStack.isEmpty() )
// {
// RenderSystem.glMultiTexCoord2f( GL13.GL_TEXTURE22, 240.f, 240.0f );
//
// RenderSystem.pushMatrix();
//
// // The Z-scaling by 0.0001 causes the model to be visually "flattened"
// // This cannot replace a proper projection, but it's cheap and gives the desired
// // effect at least from head-on
// RenderSystem.scaled( scale / 32.0f, scale / 32.0f, 0.0001f );
// // Position the item icon at the top middle of the panel
// RenderSystem.translated( -8, -11, 0 );
//
// ItemRenderer renderItem = Minecraft.getInstance().getItemRenderer();
// renderItem.renderItemAndEffectIntoGUI( itemStack, 0, 0 );
//
// RenderSystem.popMatrix();
// }
// }
//
// /**
// * Render an item in 2D and the given text below it.
// *
// * @param spacing Specifies how far apart the item and the item stack amount are rendered.
// */
// public static void renderItem2dWithAmount( IAEItemStack itemStack, float itemScale, float spacing )
// {
// final ItemStack renderStack = itemStack.asItemStackRepresentation();
//
// TesrRenderHelper.renderItem2d( renderStack, itemScale );
//
// final long stackSize = itemStack.getStackSize();
// final String renderedStackSize = NUMBER_CONVERTER.toWideReadableForm( stackSize );
//
// // Render the item count
// final FontRenderer fr = Minecraft.getInstance().fontRenderer;
// final int width = fr.getStringWidth( renderedStackSize );
// RenderSystem.translated( 0.0f, spacing, 0 );
// RenderSystem.scaled( 1.0f / 62.0f, 1.0f / 62.0f, 1.0f / 62.0f );
// RenderSystem.translated( -0.5f * width, 0.0f, 0.5f );
// fr.drawString( renderedStackSize, 0, 0, 0 );
//
// }
/**
* Render an item in 2D.
*/
public static void renderItem2d(MatrixStack matrixStack, IRenderTypeBuffer buffers, ItemStack itemStack, float scale)
{
if( !itemStack.isEmpty() )
{
// FIXME RenderSystem.glMultiTexCoord2f( GL13.GL_TEXTURE22, 240.f, 240.0f );
// FIXME RenderSystem.pushMatrix();
// FIXME // The Z-scaling by 0.0001 causes the model to be visually "flattened"
// FIXME // This cannot replace a proper projection, but it's cheap and gives the desired
// FIXME // effect at least from head-on
// FIXME RenderSystem.scaled( scale / 32.0f, scale / 32.0f, 0.0001f );
// FIXME // Position the item icon at the top middle of the panel
// FIXME RenderSystem.translated( -8, -11, 0 );
// FIXME ItemRenderer renderItem = Minecraft.getInstance().getItemRenderer();
// FIXME renderItem.renderItemAndEffectIntoGUI( itemStack, 0, 0 );
// FIXME RenderSystem.popMatrix();
}
}
/**
* Render an item in 2D and the given text below it.
*
* @param matrixStack
* @param buffers
* @param spacing Specifies how far apart the item and the item stack amount are rendered.
*/
public static void renderItem2dWithAmount(MatrixStack matrixStack, IRenderTypeBuffer buffers, IAEItemStack itemStack, float itemScale, float spacing)
{
final ItemStack renderStack = itemStack.asItemStackRepresentation();
TesrRenderHelper.renderItem2d( matrixStack, buffers, renderStack, itemScale );
final long stackSize = itemStack.getStackSize();
final String renderedStackSize = NUMBER_CONVERTER.toWideReadableForm( stackSize );
// Render the item count
final FontRenderer fr = Minecraft.getInstance().fontRenderer;
final int width = fr.getStringWidth( renderedStackSize );
matrixStack.translate( 0.0f, spacing, 0 );
matrixStack.scale( 1.0f / 62.0f, 1.0f / 62.0f, 1.0f / 62.0f );
matrixStack.translate( -0.5f * width, 0.0f, 0.5f );
fr.drawString( renderedStackSize, 0, 0, 0 );
}
}
@@ -29,7 +29,6 @@ import java.util.Objects;
import net.minecraft.util.Direction;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.ILightReader;
import net.minecraftforge.client.model.data.ModelProperty;
@@ -36,7 +36,7 @@ import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.util.Direction;
import net.minecraftforge.common.property.IExtendedBlockState;
import appeng.block.crafting.BlockCraftingUnit;
import appeng.block.crafting.AbstractCraftingUnitBlock;
import appeng.client.render.cablebus.CubeBuilder;
@@ -264,7 +264,7 @@ abstract class CraftingCubeBakedModel implements IBakedModel
}
IExtendedBlockState extState = (IExtendedBlockState) state;
CraftingCubeState cubeState = extState.getValue( BlockCraftingUnit.STATE );
CraftingCubeState cubeState = extState.getValue( AbstractCraftingUnitBlock.STATE );
if( cubeState == null )
{
return EnumSet.noneOf( Direction.class );
@@ -33,7 +33,7 @@ import net.minecraftforge.client.model.IModel;
import net.minecraftforge.common.model.IModelState;
import net.minecraftforge.common.model.TRSRTransformation;
import appeng.block.crafting.BlockCraftingUnit;
import appeng.block.crafting.AbstractCraftingUnitBlock;
import appeng.core.AppEng;
@@ -58,9 +58,9 @@ class CraftingCubeModel implements IModel
private final static ResourceLocation MONITOR_LIGHT_MEDIUM = texture( "monitor_light_medium" );
private final static ResourceLocation MONITOR_LIGHT_BRIGHT = texture( "monitor_light_bright" );
private final BlockCraftingUnit.CraftingUnitType type;
private final AbstractCraftingUnitBlock.CraftingUnitType type;
CraftingCubeModel( BlockCraftingUnit.CraftingUnitType type )
CraftingCubeModel( AbstractCraftingUnitBlock.CraftingUnitType type )
{
this.type = type;
}
@@ -106,7 +106,7 @@ class CraftingCubeModel implements IModel
}
}
private static TextureAtlasSprite getLightTexture( Function<ResourceLocation, TextureAtlasSprite> textureGetter, BlockCraftingUnit.CraftingUnitType type )
private static TextureAtlasSprite getLightTexture( Function<ResourceLocation, TextureAtlasSprite> textureGetter, AbstractCraftingUnitBlock.CraftingUnitType type )
{
switch( type )
{
@@ -19,21 +19,15 @@
package appeng.client.render.crafting;
import java.util.HashMap;
import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.block.crafting.BlockCraftingUnit;
import appeng.block.crafting.AbstractCraftingUnitBlock;
import appeng.bootstrap.BlockRenderingCustomizer;
import appeng.bootstrap.IBlockRendering;
import appeng.bootstrap.IItemRendering;
import appeng.core.AppEng;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
/**
@@ -44,9 +38,9 @@ public class CraftingCubeRendering extends BlockRenderingCustomizer
private final String registryName;
private final BlockCraftingUnit.CraftingUnitType type;
private final AbstractCraftingUnitBlock.CraftingUnitType type;
public CraftingCubeRendering( String registryName, BlockCraftingUnit.CraftingUnitType type )
public CraftingCubeRendering( String registryName, AbstractCraftingUnitBlock.CraftingUnitType type )
{
this.registryName = registryName;
this.type = type;
@@ -56,48 +50,47 @@ public class CraftingCubeRendering extends BlockRenderingCustomizer
@OnlyIn( Dist.CLIENT )
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
{
if (type != AbstractCraftingUnitBlock.CraftingUnitType.MONITOR) {
rendering.renderType(RenderType.getCutout());
}
ResourceLocation baseName = new ResourceLocation( AppEng.MOD_ID, this.registryName );
// Disable auto-rotation
if( this.type != BlockCraftingUnit.CraftingUnitType.MONITOR )
if( this.type != AbstractCraftingUnitBlock.CraftingUnitType.MONITOR )
{
rendering.modelCustomizer( ( loc, model ) -> model );
}
// This is the standard blockstate model
ModelResourceLocation defaultModel = new ModelResourceLocation( baseName, "normal" );
// This is the built-in model
String builtInName = "models/block/crafting/" + this.registryName + "/builtin";
ModelResourceLocation builtInModelName = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, builtInName ), "normal" );
rendering.builtInModel( builtInName, new CraftingCubeModel( this.type ) );
rendering.stateMapper( block -> this.mapState( block, defaultModel, builtInModelName ) );
if( this.type == BlockCraftingUnit.CraftingUnitType.MONITOR )
{
rendering.tileEntityRenderer( new CraftingMonitorTESR() );
}
// FIXME // This is the standard blockstate model
// FIXME ModelResourceLocation defaultModel = new ModelResourceLocation( baseName, "normal" );
// FIXME
// FIXME // This is the built-in model
// FIXME String builtInName = "models/block/crafting/" + this.registryName + "/builtin";
// FIXME ModelResourceLocation builtInModelName = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, builtInName ), "normal" );
// FIXME
// FIXME rendering.builtInModel( builtInName, new CraftingCubeModel( this.type ) );
// FIXME
// FIXME rendering.stateMapper( block -> this.mapState( block, defaultModel, builtInModelName ) );
}
private Map<BlockState, ModelResourceLocation> mapState( Block block, ModelResourceLocation defaultModel, ModelResourceLocation formedModel )
{
Map<BlockState, ModelResourceLocation> result = new HashMap<>();
for( BlockState state : block.getBlockState().getValidStates() )
{
if( state.getValue( BlockCraftingUnit.FORMED ) )
{
// Always use the builtin model if the multiblock is formed
result.put( state, formedModel );
}
else
{
// Use the default model
result.put( state, defaultModel );
}
}
return result;
}
// FIXME private Map<BlockState, ModelResourceLocation> mapState( Block block, ModelResourceLocation defaultModel, ModelResourceLocation formedModel )
// FIXME {
// FIXME Map<BlockState, ModelResourceLocation> result = new HashMap<>();
// FIXME for( BlockState state : block.getBlockState().getValidStates() )
// FIXME {
// FIXME if( state.get( AbstractCraftingUnitBlock.FORMED ) )
// FIXME {
// FIXME // Always use the builtin model if the multiblock is formed
// FIXME result.put( state, formedModel );
// FIXME }
// FIXME else
// FIXME {
// FIXME // Use the default model
// FIXME result.put( state, defaultModel );
// FIXME }
// FIXME }
// FIXME return result;
// FIXME }
}
@@ -19,8 +19,10 @@
package appeng.client.render.crafting;
import net.minecraft.client.renderer.GlStateManager;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.util.Direction;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -37,27 +39,26 @@ import appeng.tile.crafting.TileCraftingMonitorTile;
public class CraftingMonitorTESR extends TileEntityRenderer<TileCraftingMonitorTile>
{
public CraftingMonitorTESR(TileEntityRendererDispatcher rendererDispatcherIn) {
super(rendererDispatcherIn);
}
@Override
public void render( TileCraftingMonitorTile te, double x, double y, double z, float partialTicks, int destroyStage, float p_render_10_ )
{
if( te == null )
{
return;
}
public void render(TileCraftingMonitorTile te, float partialTicks, MatrixStack matrixStack, IRenderTypeBuffer buffers, int combinedLight, int combinedOverlay) {
Direction facing = te.getForward();
IAEItemStack jobProgress = te.getJobProgress();
if( jobProgress != null )
{
GlStateManager.pushMatrix();
GlStateManager.translate( x + 0.5, y + 0.5, z + 0.5 );
matrixStack.push();
matrixStack.translate(0.5, 0.5, 0.5);
TesrRenderHelper.moveToFace( facing );
TesrRenderHelper.rotateToFace( facing, (byte) 0 );
TesrRenderHelper.renderItem2dWithAmount( jobProgress, 0.7f, 0.1f );
TesrRenderHelper.moveToFace( matrixStack, facing );
TesrRenderHelper.rotateToFace( matrixStack, facing, (byte) 0 );
TesrRenderHelper.renderItem2dWithAmount(matrixStack, buffers, jobProgress, 0.7f, 0.1f );
GlStateManager.popMatrix();
matrixStack.pop();
}
}
}
@@ -24,7 +24,7 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.util.Direction;
import appeng.block.crafting.BlockCraftingUnit;
import appeng.block.crafting.AbstractCraftingUnitBlock;
import appeng.client.render.cablebus.CubeBuilder;
@@ -52,7 +52,7 @@ class LightBakedModel extends CraftingCubeBakedModel
builder.setTexture( this.baseTexture );
builder.addCube( x1, y1, z1, x2, y2, z2 );
boolean powered = state.getValue( BlockCraftingUnit.POWERED );
boolean powered = state.get( AbstractCraftingUnitBlock.POWERED );
builder.setRenderFullBright( powered );
builder.setTexture( this.lightTexture );
builder.addCube( x1, y1, z1, x2, y2, z2 );
@@ -78,7 +78,7 @@ class MonitorBakedModel extends CraftingCubeBakedModel
// Now add the three layered light textures
AEColor color = getColor( state );
boolean powered = state.getValue( BlockCraftingMonitor.POWERED );
boolean powered = state.get( BlockCraftingMonitor.POWERED );
builder.setRenderFullBright( powered );
@@ -25,26 +25,26 @@ 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.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.api.util.AEPartLocation;
import appeng.client.render.textures.ParticleTextures;
@OnlyIn( Dist.CLIENT )
public class EnergyFx extends BreakingParticle
{
private final TextureAtlasSprite particleTextureIndex;
// FIXME private final TextureAtlasSprite particleTextureIndex;
private final int startBlkX;
private final int startBlkY;
private final int startBlkZ;
public EnergyFx( final World par1World, final double par2, final double par4, final double par6, final Item par8Item )
public EnergyFx( final World par1World, final double par2, final double par4, final double par6, final ItemStack par8Item )
{
super( par1World, par2, par4, par6, par8Item );
this.particleGravity = 0;
@@ -53,102 +53,102 @@ public class EnergyFx extends BreakingParticle
this.particleRed = 1;
this.particleAlpha = 1.4f;
this.particleScale = 3.5f;
this.particleTextureIndex = ParticleTextures.BlockEnergyParticle;
// FIXME this.particleTextureIndex = ParticleTextures.BlockEnergyParticle;
this.startBlkX = MathHelper.floor( this.getPosX() );
this.startBlkY = MathHelper.floor( this.getPosY() );
this.startBlkZ = MathHelper.floor( this.getPosZ() );
}
@Override
public int getFXLayer()
{
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 )
{
final float f6 = this.particleTextureIndex.getMinU();
final float f7 = this.particleTextureIndex.getMaxU();
final float f8 = this.particleTextureIndex.getMinV();
final float f9 = this.particleTextureIndex.getMaxV();
final float f10 = 0.1F * this.particleScale;
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.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 )
{
int i = this.getBrightnessForRender( partialTicks );
int j = i >> 16 & 65535;
int k = i & 65535;
final float f14 = 1.0F;
par1Tessellator.pos( f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10 )
.tex( f7, f9 )
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
.lightmap( j, k )
.endVertex();
par1Tessellator.pos( f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10 )
.tex( f7, f8 )
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
.lightmap( j, k )
.endVertex();
par1Tessellator.pos( f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10 )
.tex( f6, f8 )
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
.lightmap( j, k )
.endVertex();
par1Tessellator.pos( f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10 )
.tex( f6, f9 )
.color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
.lightmap( j, k )
.endVertex();
}
}
public void fromItem( final AEPartLocation d )
{
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 tick()
{
this.prevPosX = this.getPosX();
this.prevPosY = this.getPosY();
this.prevPosZ = this.getPosZ();
if( this.age++ >= this.maxAge )
{
this.setExpired();
}
this.motionY -= 0.04D * this.particleGravity;
this.move( 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;
this.startBlkX = MathHelper.floor( this.posX );
this.startBlkY = MathHelper.floor( this.posY );
this.startBlkZ = MathHelper.floor( this.posZ );
}
// FIXME @Override
// FIXME public int getFXLayer()
// FIXME {
// FIXME return 1;
// FIXME }
// FIXME
// FIXME @Override
// FIXME public IParticleRenderType getRenderType() {
// FIXME // TODO: FIXME
// FIXME return IParticleRenderType.NO_RENDER;
// FIXME }
// FIXME
// FIXME @Override
// FIXME 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 )
// FIXME {
// FIXME final float f6 = this.particleTextureIndex.getMinU();
// FIXME final float f7 = this.particleTextureIndex.getMaxU();
// FIXME final float f8 = this.particleTextureIndex.getMinV();
// FIXME final float f9 = this.particleTextureIndex.getMaxV();
// FIXME final float f10 = 0.1F * this.particleScale;
// FIXME
// FIXME final float f11 = (float) ( this.prevPosX + ( this.getPosX() - this.prevPosX ) * partialTicks - interpPosX );
// FIXME final float f12 = (float) ( this.prevPosY + ( this.getPosY() - this.prevPosY ) * partialTicks - interpPosY );
// FIXME final float f13 = (float) ( this.prevPosZ + ( this.getPosZ() - this.prevPosZ ) * partialTicks - interpPosZ );
// FIXME
// FIXME final int blkX = MathHelper.floor( this.getPosX() );
// FIXME final int blkY = MathHelper.floor( this.getPosY() );
// FIXME final int blkZ = MathHelper.floor( this.getPosZ() );
// FIXME
// FIXME if( blkX == this.startBlkX && blkY == this.startBlkY && blkZ == this.startBlkZ )
// FIXME {
// FIXME int i = this.getBrightnessForRender( partialTicks );
// FIXME int j = i >> 16 & 65535;
// FIXME int k = i & 65535;
// FIXME
// FIXME final float f14 = 1.0F;
// FIXME par1Tessellator.pos( f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10 )
// FIXME .tex( f7, f9 )
// FIXME .color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
// FIXME .lightmap( j, k )
// FIXME .endVertex();
// FIXME par1Tessellator.pos( f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10 )
// FIXME .tex( f7, f8 )
// FIXME .color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
// FIXME .lightmap( j, k )
// FIXME .endVertex();
// FIXME par1Tessellator.pos( f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10 )
// FIXME .tex( f6, f8 )
// FIXME .color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
// FIXME .lightmap( j, k )
// FIXME .endVertex();
// FIXME par1Tessellator.pos( f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10 )
// FIXME .tex( f6, f9 )
// FIXME .color( this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha )
// FIXME .lightmap( j, k )
// FIXME .endVertex();
// FIXME }
// FIXME }
// FIXME
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.particleScale *= 0.8f;
}
// FIXME
// FIXME @Override
// FIXME public void tick()
// FIXME {
// FIXME this.prevPosX = this.getPosX();
// FIXME this.prevPosY = this.getPosY();
// FIXME this.prevPosZ = this.getPosZ();
// FIXME
// FIXME if( this.age++ >= this.maxAge )
// FIXME {
// FIXME this.setExpired();
// FIXME }
// FIXME
// FIXME this.motionY -= 0.04D * this.particleGravity;
// FIXME this.move( this.motionX, this.motionY, this.motionZ );
// FIXME this.motionX *= 0.9800000190734863D;
// FIXME this.motionY *= 0.9800000190734863D;
// FIXME this.motionZ *= 0.9800000190734863D;
// FIXME
// FIXME this.particleScale *= 0.89f;
// FIXME this.particleAlpha *= 0.89f;
// FIXME }
// FIXME
public void setMotionX( float motionX )
{
this.motionX = motionX;
@@ -2,18 +2,15 @@
package appeng.client.render.tesr;
import org.lwjgl.opengl.GL11;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import net.minecraft.client.renderer.*;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
@@ -39,32 +36,35 @@ public final class InscriberTESR extends TileEntityRenderer<TileInscriber>
private static TextureAtlasSprite textureInside;
public InscriberTESR(TileEntityRendererDispatcher rendererDispatcherIn) {
super(rendererDispatcherIn);
}
@Override
public void render( final TileInscriber tile, final double x, final double y, final double z, final float partialTicks, final int destroyStage, final float p_render_10_ )
{
public void render(TileInscriber tile, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffers, int combinedLight, int combinedOverlay) {
// render inscriber
GlStateManager.pushMatrix();
GlStateManager.translate( x, y, z );
GlStateManager.translate( 0.5F, 0.5F, 0.5F );
FacingToRotation.get( tile.getForward(), tile.getUp() ).push(matrixStack);
GlStateManager.translate( -0.5F, -0.5F, -0.5F );
ms.push();
ms.translate( 0.5F, 0.5F, 0.5F );
FacingToRotation.get( tile.getForward(), tile.getUp() ).push(ms);
ms.translate( -0.5F, -0.5F, -0.5F );
RenderSystem.color4f( 1.0F, 1.0F, 1.0F, 1.0F );
RenderSystem.disableLighting();
GlStateManager.disableRescaleNormal();
// FIXME RenderSystem.color4f( 1.0F, 1.0F, 1.0F, 1.0F );
// FIXME RenderSystem.disableLighting();
// FIXME RenderSystem.disableRescaleNormal();
// render sides of stamps
Minecraft mc = Minecraft.getInstance();
mc.renderEngine.bindTexture( AtlasTexture.LOCATION_BLOCKS_TEXTURE );
// FIXME RenderingEngine.getInstance().bindTexture( AtlasTexture.LOCATION_BLOCKS_TEXTURE );
// << 20 | light << 4;
final int br = tile.getWorld().getCombinedLight( tile.getPos(), 0 );
final int var11 = br % 65536;
final int var12 = br / 65536;
// FIXME final int br = combinedLight;
// FIXME final int var11 = br % 65536;
// FIXME final int var12 = br / 65536;
OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.lightmapTexUnit, var11, var12 );
// FIXME OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.lightmapTexUnit, var11, var12 );
long absoluteProgress = 0;
@@ -88,8 +88,10 @@ public final class InscriberTESR extends TileEntityRenderer<TileInscriber>
float press = 0.2f;
press -= progress / 5.0f;
final BufferBuilder buffer = Tessellator.getInstance().getBuffer();
buffer.begin( GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX );
IVertexBuilder buffer = buffers.getBuffer(RenderType.getSolid());
// final BufferBuilder buffer = Tessellator.getInstance().getBuffer();
// FIXME buffer.begin( GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX );
float middle = 0.5f;
middle += 0.02f;
@@ -128,7 +130,7 @@ public final class InscriberTESR extends TileEntityRenderer<TileInscriber>
Tessellator.getInstance().draw();
// render items.
RenderSystem.color4f( 1.0F, 1.0F, 1.0F, 1.0F );
// FIXME RenderSystem.color4f( 1.0F, 1.0F, 1.0F, 1.0F );
IItemHandler tileInv = tile.getInternalInventory();
@@ -159,46 +161,46 @@ public final class InscriberTESR extends TileEntityRenderer<TileInscriber>
}
}
this.renderItem( is, 0.0f, tile, x, y, z );
this.renderItem( ms, is, 0.0f, buffers, combinedLight, combinedOverlay );
}
else
{
this.renderItem( tileInv.getStackInSlot( 0 ), press, tile, x, y, z );
this.renderItem( tileInv.getStackInSlot( 1 ), -press, tile, x, y, z );
this.renderItem( tileInv.getStackInSlot( 2 ), 0.0f, tile, x, y, z );
this.renderItem( ms, tileInv.getStackInSlot( 0 ), press, buffers, combinedLight, combinedOverlay );
this.renderItem( ms, tileInv.getStackInSlot( 1 ), -press, buffers, combinedLight, combinedOverlay );
this.renderItem( ms, tileInv.getStackInSlot( 2 ), 0.0f, buffers, combinedLight, combinedOverlay );
}
GlStateManager.popMatrix();
RenderSystem.enableLighting();
GlStateManager.enableRescaleNormal();
ms.pop();
// FIXME RenderSystem.enableLighting();
// FIXME GlStateManager.enableRescaleNormal();
}
private void renderItem( final ItemStack stack, final float o, final AEBaseTile tile, final double x, final double y, final double z )
private void renderItem( MatrixStack ms, final ItemStack stack, final float o, IRenderTypeBuffer buffers, int combinedLight, int combinedOverlay )
{
if( !stack.isEmpty() )
{
final ItemStack sis = stack.copy();
final ItemStack sis = stack.copy(); // FIXME WHY????
GlStateManager.pushMatrix();
ms.push();
// move to center
GlStateManager.translate( 0.5f, 0.5f + o, 0.5f );
GlStateManager.rotate( 90, 1, 0, 0 );
ms.translate( 0.5f, 0.5f + o, 0.5f );
ms.rotate( new Quaternion(90, 0, 0, true) );
// set scale
GlStateManager.scale( ITEM_RENDER_SCALE, ITEM_RENDER_SCALE, ITEM_RENDER_SCALE );
ms.scale( ITEM_RENDER_SCALE, ITEM_RENDER_SCALE, ITEM_RENDER_SCALE );
// heuristic to scale items down much further than blocks
if( !( sis.getItem() instanceof BlockItem ) )
{
GlStateManager.scale( 0.5, 0.5, 0.5 );
ms.scale( 0.5f, 0.5f, 0.5f );
}
Minecraft.getInstance().getRenderItem().renderItem( sis, ItemCameraTransforms.TransformType.FIXED );
GlStateManager.popMatrix();
Minecraft.getInstance().getItemRenderer().renderItem(sis, ItemCameraTransforms.TransformType.FIXED, combinedLight, combinedOverlay, ms, buffers);
ms.pop();
}
}
public static void registerTexture( TextureStitchEvent.Pre event )
{
textureInside = event.getMap().registerSprite( TEXTURE_INSIDE );
// FIXME textureInside = event.getMap().registerSprite( TEXTURE_INSIDE );
}
}