1.15 port
This commit is contained in:
@@ -21,11 +21,11 @@ package appeng.client.render;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.color.IBlockColor;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
|
||||
import appeng.api.implementations.tiles.IColorableTile;
|
||||
import appeng.api.util.AEColor;
|
||||
@@ -40,7 +40,7 @@ public class ColorableTileBlockColor implements IBlockColor
|
||||
public static final ColorableTileBlockColor INSTANCE = new ColorableTileBlockColor();
|
||||
|
||||
@Override
|
||||
public int colorMultiplier( IBlockState state, @Nullable IBlockAccess worldIn, @Nullable BlockPos pos, int tintIndex )
|
||||
public int colorMultiplier( BlockState state, @Nullable IBlockReader worldIn, @Nullable BlockPos pos, int tintIndex )
|
||||
{
|
||||
AEColor color = AEColor.TRANSPARENT; // Default to a neutral color
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@ import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
|
||||
|
||||
/**
|
||||
@@ -48,7 +48,7 @@ public class DummyFluidBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getQuads( @Nullable IBlockState state, @Nullable EnumFacing side, long rand )
|
||||
public List<BakedQuad> getQuads( @Nullable BlockState state, @Nullable Direction side, long rand )
|
||||
{
|
||||
return this.quads;
|
||||
}
|
||||
|
||||
@@ -28,15 +28,15 @@ import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.ItemLayerModel;
|
||||
@@ -66,7 +66,7 @@ public class DummyFluidDispatcherBakedModel extends DelegateBakedModel
|
||||
|
||||
// This is never used. See the item override list below.
|
||||
@Override
|
||||
public List<BakedQuad> getQuads( @Nullable IBlockState state, @Nullable EnumFacing side, long rand )
|
||||
public List<BakedQuad> getQuads( @Nullable BlockState state, @Nullable Direction side, long rand )
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
@@ -89,7 +89,7 @@ public class DummyFluidDispatcherBakedModel extends DelegateBakedModel
|
||||
return new ItemOverrideList( Collections.emptyList() )
|
||||
{
|
||||
@Override
|
||||
public IBakedModel handleItemState( IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity )
|
||||
public IBakedModel handleItemState( IBakedModel originalModel, ItemStack stack, World world, LivingEntity entity )
|
||||
{
|
||||
if( !( stack.getItem() instanceof FluidDummyItem ) )
|
||||
{
|
||||
|
||||
@@ -25,12 +25,12 @@ import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
|
||||
import appeng.client.render.cablebus.FacadeBuilder;
|
||||
|
||||
@@ -55,7 +55,7 @@ public class FacadeBakedItemModel extends DelegateBakedModel
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getQuads( @Nullable IBlockState state, @Nullable EnumFacing side, long rand )
|
||||
public List<BakedQuad> getQuads( @Nullable BlockState state, @Nullable Direction side, long rand )
|
||||
{
|
||||
if( side != null )
|
||||
{
|
||||
@@ -64,7 +64,7 @@ public class FacadeBakedItemModel extends DelegateBakedModel
|
||||
if( quads == null )
|
||||
{
|
||||
quads = new ArrayList<>();
|
||||
quads.addAll( this.facadeBuilder.buildFacadeItemQuads( this.textureStack, EnumFacing.NORTH ) );
|
||||
quads.addAll( this.facadeBuilder.buildFacadeItemQuads( this.textureStack, Direction.NORTH ) );
|
||||
quads.addAll( this.getBaseModel().getQuads( state, side, rand ) );
|
||||
quads = Collections.unmodifiableList( quads );
|
||||
}
|
||||
|
||||
@@ -27,14 +27,14 @@ import javax.annotation.Nullable;
|
||||
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.client.render.cablebus.FacadeBuilder;
|
||||
@@ -61,7 +61,7 @@ public class FacadeDispatcherBakedModel extends DelegateBakedModel
|
||||
|
||||
// This is never used. See the item override list below.
|
||||
@Override
|
||||
public List<BakedQuad> getQuads( @Nullable IBlockState state, @Nullable EnumFacing side, long rand )
|
||||
public List<BakedQuad> getQuads( @Nullable BlockState state, @Nullable Direction side, long rand )
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public class FacadeDispatcherBakedModel extends DelegateBakedModel
|
||||
return new ItemOverrideList( Collections.emptyList() )
|
||||
{
|
||||
@Override
|
||||
public IBakedModel handleItemState( IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity )
|
||||
public IBakedModel handleItemState( IBakedModel originalModel, ItemStack stack, World world, LivingEntity entity )
|
||||
{
|
||||
if( !( stack.getItem() instanceof ItemFacade ) )
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ import javax.vecmath.Matrix4f;
|
||||
import javax.vecmath.Vector3f;
|
||||
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
|
||||
|
||||
@@ -102,14 +102,14 @@ public enum FacingToRotation
|
||||
GlStateManager.rotate( this.rot.z, 0, 0, 1 );
|
||||
}
|
||||
|
||||
public EnumFacing rotate( EnumFacing facing )
|
||||
public Direction rotate( Direction facing )
|
||||
{
|
||||
return TRSRTransformation.rotate( this.mat, facing );
|
||||
}
|
||||
|
||||
public EnumFacing resultingRotate( EnumFacing facing )
|
||||
public Direction resultingRotate( Direction facing )
|
||||
{
|
||||
for( EnumFacing face : EnumFacing.values() )
|
||||
for( Direction face : Direction.values() )
|
||||
{
|
||||
if( this.rotate( face ) == facing )
|
||||
{
|
||||
@@ -119,7 +119,7 @@ public enum FacingToRotation
|
||||
return null;
|
||||
}
|
||||
|
||||
public static FacingToRotation get( EnumFacing forward, EnumFacing up )
|
||||
public static FacingToRotation get( Direction forward, Direction up )
|
||||
{
|
||||
return values()[forward.ordinal() * 6 + up.ordinal()];
|
||||
}
|
||||
|
||||
@@ -21,10 +21,10 @@ package appeng.client.render;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.color.IBlockColor;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
|
||||
import appeng.api.util.AEColor;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class StaticBlockColor implements IBlockColor
|
||||
}
|
||||
|
||||
@Override
|
||||
public int colorMultiplier( IBlockState state, @Nullable IBlockAccess worldIn, @Nullable BlockPos pos, int tintIndex )
|
||||
public int colorMultiplier( BlockState state, @Nullable IBlockReader worldIn, @Nullable BlockPos pos, int tintIndex )
|
||||
{
|
||||
return this.color.getVariantByTintIndex( tintIndex );
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.util.IWideReadableNumberConverter;
|
||||
@@ -44,7 +44,7 @@ public class TesrRenderHelper
|
||||
* Move the current coordinate system to the center of the given block face, assuming that the origin is currently
|
||||
* at the center of a block.
|
||||
*/
|
||||
public static void moveToFace( EnumFacing face )
|
||||
public static void moveToFace( Direction face )
|
||||
{
|
||||
GlStateManager.translate( face.getFrontOffsetX() * 0.50, face.getFrontOffsetY() * 0.50, face.getFrontOffsetZ() * 0.50 );
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public class TesrRenderHelper
|
||||
* the given face as if it was
|
||||
* a 2D canvas.
|
||||
*/
|
||||
public static void rotateToFace( EnumFacing face, byte spin )
|
||||
public static void rotateToFace( Direction face, byte spin )
|
||||
{
|
||||
switch( face )
|
||||
{
|
||||
@@ -112,7 +112,7 @@ public class TesrRenderHelper
|
||||
// Position the item icon at the top middle of the panel
|
||||
GlStateManager.translate( -8, -11, 0 );
|
||||
|
||||
RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
|
||||
RenderItem renderItem = Minecraft.getInstance().getRenderItem();
|
||||
renderItem.renderItemAndEffectIntoGUI( itemStack, 0, 0 );
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
@@ -134,7 +134,7 @@ public class TesrRenderHelper
|
||||
final String renderedStackSize = NUMBER_CONVERTER.toWideReadableForm( stackSize );
|
||||
|
||||
// Render the item count
|
||||
final FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
|
||||
final FontRenderer fr = Minecraft.getInstance().fontRenderer;
|
||||
final int width = fr.getStringWidth( renderedStackSize );
|
||||
GlStateManager.translate( 0.0f, spacing, 0 );
|
||||
GlStateManager.scale( 1.0f / 62.0f, 1.0f / 62.0f, 1.0f / 62.0f );
|
||||
|
||||
@@ -26,10 +26,10 @@ import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import appeng.api.util.AECableType;
|
||||
@@ -159,7 +159,7 @@ class CableBuilder
|
||||
}
|
||||
}
|
||||
|
||||
public void addGlassConnection( EnumFacing facing, AEColor cableColor, AECableType connectionType, boolean cableBusAdjacent, List<BakedQuad> quadsOut )
|
||||
public void addGlassConnection( Direction facing, AEColor cableColor, AECableType connectionType, boolean cableBusAdjacent, List<BakedQuad> quadsOut )
|
||||
{
|
||||
CubeBuilder cubeBuilder = new CubeBuilder( this.format, quadsOut );
|
||||
|
||||
@@ -201,7 +201,7 @@ class CableBuilder
|
||||
}
|
||||
}
|
||||
|
||||
public void addStraightGlassConnection( EnumFacing facing, AEColor cableColor, List<BakedQuad> quadsOut )
|
||||
public void addStraightGlassConnection( Direction facing, AEColor cableColor, List<BakedQuad> quadsOut )
|
||||
{
|
||||
CubeBuilder cubeBuilder = new CubeBuilder( this.format, quadsOut );
|
||||
|
||||
@@ -229,7 +229,7 @@ class CableBuilder
|
||||
}
|
||||
}
|
||||
|
||||
public void addConstrainedGlassConnection( EnumFacing facing, AEColor cableColor, int distanceFromEdge, List<BakedQuad> quadsOut )
|
||||
public void addConstrainedGlassConnection( Direction facing, AEColor cableColor, int distanceFromEdge, List<BakedQuad> quadsOut )
|
||||
{
|
||||
|
||||
// Glass connections reach only 6 voxels from the edge
|
||||
@@ -266,7 +266,7 @@ class CableBuilder
|
||||
}
|
||||
}
|
||||
|
||||
public void addCoveredConnection( EnumFacing facing, AEColor cableColor, AECableType connectionType, boolean cableBusAdjacent, List<BakedQuad> quadsOut )
|
||||
public void addCoveredConnection( Direction facing, AEColor cableColor, AECableType connectionType, boolean cableBusAdjacent, List<BakedQuad> quadsOut )
|
||||
{
|
||||
|
||||
CubeBuilder cubeBuilder = new CubeBuilder( this.format, quadsOut );
|
||||
@@ -286,7 +286,7 @@ class CableBuilder
|
||||
addCoveredCableSizedCube( facing, cubeBuilder );
|
||||
}
|
||||
|
||||
public void addStraightCoveredConnection( EnumFacing facing, AEColor cableColor, List<BakedQuad> quadsOut )
|
||||
public void addStraightCoveredConnection( Direction facing, AEColor cableColor, List<BakedQuad> quadsOut )
|
||||
{
|
||||
CubeBuilder cubeBuilder = new CubeBuilder( this.format, quadsOut );
|
||||
|
||||
@@ -299,35 +299,35 @@ class CableBuilder
|
||||
|
||||
}
|
||||
|
||||
private static void setStraightCableUVs( CubeBuilder cubeBuilder, EnumFacing facing, int x, int y )
|
||||
private static void setStraightCableUVs( CubeBuilder cubeBuilder, Direction facing, int x, int y )
|
||||
{
|
||||
switch( facing )
|
||||
{
|
||||
case DOWN:
|
||||
case UP:
|
||||
cubeBuilder.setCustomUv( EnumFacing.NORTH, x, 0, y, x );
|
||||
cubeBuilder.setCustomUv( EnumFacing.EAST, x, 0, y, x );
|
||||
cubeBuilder.setCustomUv( EnumFacing.SOUTH, x, 0, y, x );
|
||||
cubeBuilder.setCustomUv( EnumFacing.WEST, x, 0, y, x );
|
||||
cubeBuilder.setCustomUv( Direction.NORTH, x, 0, y, x );
|
||||
cubeBuilder.setCustomUv( Direction.EAST, x, 0, y, x );
|
||||
cubeBuilder.setCustomUv( Direction.SOUTH, x, 0, y, x );
|
||||
cubeBuilder.setCustomUv( Direction.WEST, x, 0, y, x );
|
||||
break;
|
||||
case EAST:
|
||||
case WEST:
|
||||
cubeBuilder.setCustomUv( EnumFacing.UP, 0, x, x, y );
|
||||
cubeBuilder.setCustomUv( EnumFacing.DOWN, 0, x, x, y );
|
||||
cubeBuilder.setCustomUv( EnumFacing.NORTH, 0, x, x, y );
|
||||
cubeBuilder.setCustomUv( EnumFacing.SOUTH, 0, x, x, y );
|
||||
cubeBuilder.setCustomUv( Direction.UP, 0, x, x, y );
|
||||
cubeBuilder.setCustomUv( Direction.DOWN, 0, x, x, y );
|
||||
cubeBuilder.setCustomUv( Direction.NORTH, 0, x, x, y );
|
||||
cubeBuilder.setCustomUv( Direction.SOUTH, 0, x, x, y );
|
||||
break;
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
cubeBuilder.setCustomUv( EnumFacing.UP, x, 0, y, x );
|
||||
cubeBuilder.setCustomUv( EnumFacing.DOWN, x, 0, y, x );
|
||||
cubeBuilder.setCustomUv( EnumFacing.EAST, 0, x, x, y );
|
||||
cubeBuilder.setCustomUv( EnumFacing.WEST, 0, x, x, y );
|
||||
cubeBuilder.setCustomUv( Direction.UP, x, 0, y, x );
|
||||
cubeBuilder.setCustomUv( Direction.DOWN, x, 0, y, x );
|
||||
cubeBuilder.setCustomUv( Direction.EAST, 0, x, x, y );
|
||||
cubeBuilder.setCustomUv( Direction.WEST, 0, x, x, y );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void addConstrainedCoveredConnection( EnumFacing facing, AEColor cableColor, int distanceFromEdge, List<BakedQuad> quadsOut )
|
||||
public void addConstrainedCoveredConnection( Direction facing, AEColor cableColor, int distanceFromEdge, List<BakedQuad> quadsOut )
|
||||
{
|
||||
// The core of a covered cable reaches up to 5 voxels from the block edge, so
|
||||
// drawing a connection can only occur from there onwards
|
||||
@@ -345,7 +345,7 @@ class CableBuilder
|
||||
|
||||
}
|
||||
|
||||
public void addSmartConnection( EnumFacing facing, AEColor cableColor, AECableType connectionType, boolean cableBusAdjacent, int channels, List<BakedQuad> quadsOut )
|
||||
public void addSmartConnection( Direction facing, AEColor cableColor, AECableType connectionType, boolean cableBusAdjacent, int channels, List<BakedQuad> quadsOut )
|
||||
{
|
||||
if( connectionType == AECableType.COVERED || connectionType == AECableType.GLASS )
|
||||
{
|
||||
@@ -399,7 +399,7 @@ class CableBuilder
|
||||
addCoveredCableSizedCube( facing, cubeBuilder );
|
||||
}
|
||||
|
||||
public void addStraightSmartConnection( EnumFacing facing, AEColor cableColor, int channels, List<BakedQuad> quadsOut )
|
||||
public void addStraightSmartConnection( Direction facing, AEColor cableColor, int channels, List<BakedQuad> quadsOut )
|
||||
{
|
||||
CubeBuilder cubeBuilder = new CubeBuilder( this.format, quadsOut );
|
||||
|
||||
@@ -425,7 +425,7 @@ class CableBuilder
|
||||
addStraightCoveredCableSizedCube( facing, cubeBuilder );
|
||||
}
|
||||
|
||||
public void addConstrainedSmartConnection( EnumFacing facing, AEColor cableColor, int distanceFromEdge, int channels, List<BakedQuad> quadsOut )
|
||||
public void addConstrainedSmartConnection( Direction facing, AEColor cableColor, int distanceFromEdge, int channels, List<BakedQuad> quadsOut )
|
||||
{
|
||||
// Same as with covered cables, the smart cable's core extends up to 5 voxels away from the edge.
|
||||
// Drawing a connection to any point before that point is fruitless
|
||||
@@ -456,7 +456,7 @@ class CableBuilder
|
||||
addCoveredCableSizedCube( facing, distanceFromEdge, cubeBuilder );
|
||||
}
|
||||
|
||||
public void addDenseCoveredConnection( EnumFacing facing, AEColor cableColor, AECableType connectionType, boolean cableBusAdjacent, List<BakedQuad> quadsOut )
|
||||
public void addDenseCoveredConnection( Direction facing, AEColor cableColor, AECableType connectionType, boolean cableBusAdjacent, List<BakedQuad> quadsOut )
|
||||
{
|
||||
// Dense cables only render their connections as dense if the adjacent blocks actually wants that
|
||||
if( connectionType == AECableType.COVERED || connectionType == AECableType.SMART || connectionType == AECableType.GLASS )
|
||||
@@ -480,7 +480,7 @@ class CableBuilder
|
||||
cubeBuilder.setTexture( texture );
|
||||
}
|
||||
|
||||
public void addDenseSmartConnection( EnumFacing facing, AEColor cableColor, AECableType connectionType, boolean cableBusAdjacent, int channels, List<BakedQuad> quadsOut )
|
||||
public void addDenseSmartConnection( Direction facing, AEColor cableColor, AECableType connectionType, boolean cableBusAdjacent, int channels, List<BakedQuad> quadsOut )
|
||||
{
|
||||
// Dense cables only render their connections as dense if the adjacent blocks actually wants that
|
||||
if( connectionType == AECableType.SMART )
|
||||
@@ -532,7 +532,7 @@ class CableBuilder
|
||||
|
||||
}
|
||||
|
||||
public void addStraightDenseCoveredConnection( EnumFacing facing, AEColor cableColor, List<BakedQuad> quadsOut )
|
||||
public void addStraightDenseCoveredConnection( Direction facing, AEColor cableColor, List<BakedQuad> quadsOut )
|
||||
{
|
||||
CubeBuilder cubeBuilder = new CubeBuilder( this.format, quadsOut );
|
||||
|
||||
@@ -544,7 +544,7 @@ class CableBuilder
|
||||
addStraightDenseCableSizedCube( facing, cubeBuilder );
|
||||
}
|
||||
|
||||
public void addStraightDenseSmartConnection( EnumFacing facing, AEColor cableColor, int channels, List<BakedQuad> quadsOut )
|
||||
public void addStraightDenseSmartConnection( Direction facing, AEColor cableColor, int channels, List<BakedQuad> quadsOut )
|
||||
{
|
||||
CubeBuilder cubeBuilder = new CubeBuilder( this.format, quadsOut );
|
||||
|
||||
@@ -573,7 +573,7 @@ class CableBuilder
|
||||
addStraightDenseCableSizedCube( facing, cubeBuilder );
|
||||
}
|
||||
|
||||
private static void addDenseCableSizedCube( EnumFacing facing, CubeBuilder cubeBuilder )
|
||||
private static void addDenseCableSizedCube( Direction facing, CubeBuilder cubeBuilder )
|
||||
{
|
||||
switch( facing )
|
||||
{
|
||||
@@ -600,31 +600,31 @@ class CableBuilder
|
||||
|
||||
// Adds a cube to the given cube builder that has the size of a dense cable connection and spans the entire block
|
||||
// for the given direction
|
||||
private static void addStraightDenseCableSizedCube( EnumFacing facing, CubeBuilder cubeBuilder )
|
||||
private static void addStraightDenseCableSizedCube( Direction facing, CubeBuilder cubeBuilder )
|
||||
{
|
||||
switch( facing )
|
||||
{
|
||||
case DOWN:
|
||||
case UP:
|
||||
cubeBuilder.setUvRotation( EnumFacing.EAST, 3 );
|
||||
cubeBuilder.setUvRotation( Direction.EAST, 3 );
|
||||
cubeBuilder.addCube( 3, 0, 3, 13, 16, 13 );
|
||||
cubeBuilder.setUvRotation( EnumFacing.EAST, 0 );
|
||||
cubeBuilder.setUvRotation( Direction.EAST, 0 );
|
||||
break;
|
||||
case EAST:
|
||||
case WEST:
|
||||
cubeBuilder.setUvRotation( EnumFacing.SOUTH, 3 );
|
||||
cubeBuilder.setUvRotation( EnumFacing.NORTH, 3 );
|
||||
cubeBuilder.setUvRotation( Direction.SOUTH, 3 );
|
||||
cubeBuilder.setUvRotation( Direction.NORTH, 3 );
|
||||
cubeBuilder.addCube( 0, 3, 3, 16, 13, 13 );
|
||||
cubeBuilder.setUvRotation( EnumFacing.SOUTH, 0 );
|
||||
cubeBuilder.setUvRotation( EnumFacing.NORTH, 0 );
|
||||
cubeBuilder.setUvRotation( Direction.SOUTH, 0 );
|
||||
cubeBuilder.setUvRotation( Direction.NORTH, 0 );
|
||||
break;
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
cubeBuilder.setUvRotation( EnumFacing.EAST, 3 );
|
||||
cubeBuilder.setUvRotation( EnumFacing.WEST, 3 );
|
||||
cubeBuilder.setUvRotation( Direction.EAST, 3 );
|
||||
cubeBuilder.setUvRotation( Direction.WEST, 3 );
|
||||
cubeBuilder.addCube( 3, 3, 0, 13, 13, 16 );
|
||||
cubeBuilder.setUvRotation( EnumFacing.EAST, 0 );
|
||||
cubeBuilder.setUvRotation( EnumFacing.WEST, 0 );
|
||||
cubeBuilder.setUvRotation( Direction.EAST, 0 );
|
||||
cubeBuilder.setUvRotation( Direction.WEST, 0 );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -632,7 +632,7 @@ class CableBuilder
|
||||
|
||||
// Adds a cube to the given cube builder that has the size of a covered cable connection from the core of the cable
|
||||
// to the given face
|
||||
private static void addCoveredCableSizedCube( EnumFacing facing, CubeBuilder cubeBuilder )
|
||||
private static void addCoveredCableSizedCube( Direction facing, CubeBuilder cubeBuilder )
|
||||
{
|
||||
switch( facing )
|
||||
{
|
||||
@@ -659,36 +659,36 @@ class CableBuilder
|
||||
|
||||
// Adds a cube to the given cube builder that has the size of a covered cable connection and spans the entire block
|
||||
// for the given direction
|
||||
private static void addStraightCoveredCableSizedCube( EnumFacing facing, CubeBuilder cubeBuilder )
|
||||
private static void addStraightCoveredCableSizedCube( Direction facing, CubeBuilder cubeBuilder )
|
||||
{
|
||||
switch( facing )
|
||||
{
|
||||
case DOWN:
|
||||
case UP:
|
||||
cubeBuilder.setUvRotation( EnumFacing.EAST, 3 );
|
||||
cubeBuilder.setUvRotation( Direction.EAST, 3 );
|
||||
cubeBuilder.addCube( 5, 0, 5, 11, 16, 11 );
|
||||
cubeBuilder.setUvRotation( EnumFacing.EAST, 0 );
|
||||
cubeBuilder.setUvRotation( Direction.EAST, 0 );
|
||||
break;
|
||||
case EAST:
|
||||
case WEST:
|
||||
cubeBuilder.setUvRotation( EnumFacing.SOUTH, 3 );
|
||||
cubeBuilder.setUvRotation( EnumFacing.NORTH, 3 );
|
||||
cubeBuilder.setUvRotation( Direction.SOUTH, 3 );
|
||||
cubeBuilder.setUvRotation( Direction.NORTH, 3 );
|
||||
cubeBuilder.addCube( 0, 5, 5, 16, 11, 11 );
|
||||
cubeBuilder.setUvRotation( EnumFacing.SOUTH, 0 );
|
||||
cubeBuilder.setUvRotation( EnumFacing.NORTH, 0 );
|
||||
cubeBuilder.setUvRotation( Direction.SOUTH, 0 );
|
||||
cubeBuilder.setUvRotation( Direction.NORTH, 0 );
|
||||
break;
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
cubeBuilder.setUvRotation( EnumFacing.EAST, 3 );
|
||||
cubeBuilder.setUvRotation( EnumFacing.WEST, 3 );
|
||||
cubeBuilder.setUvRotation( Direction.EAST, 3 );
|
||||
cubeBuilder.setUvRotation( Direction.WEST, 3 );
|
||||
cubeBuilder.addCube( 5, 5, 0, 11, 11, 16 );
|
||||
cubeBuilder.setUvRotation( EnumFacing.EAST, 0 );
|
||||
cubeBuilder.setUvRotation( EnumFacing.WEST, 0 );
|
||||
cubeBuilder.setUvRotation( Direction.EAST, 0 );
|
||||
cubeBuilder.setUvRotation( Direction.WEST, 0 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private static void addCoveredCableSizedCube( EnumFacing facing, int distanceFromEdge, CubeBuilder cubeBuilder )
|
||||
private static void addCoveredCableSizedCube( Direction facing, int distanceFromEdge, CubeBuilder cubeBuilder )
|
||||
{
|
||||
switch( facing )
|
||||
{
|
||||
@@ -719,7 +719,7 @@ class CableBuilder
|
||||
* that do not want to be connected to using a glass cable connection. This applies to most machines (interfaces,
|
||||
* etc.)
|
||||
*/
|
||||
private void addBigCoveredCableSizedCube( EnumFacing facing, CubeBuilder cubeBuilder )
|
||||
private void addBigCoveredCableSizedCube( Direction facing, CubeBuilder cubeBuilder )
|
||||
{
|
||||
switch( facing )
|
||||
{
|
||||
|
||||
@@ -30,16 +30,16 @@ import java.util.Map.Entry;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
@@ -64,7 +64,7 @@ public class CableBusBakedModel implements IBakedModel
|
||||
|
||||
private final TextureAtlasSprite particleTexture;
|
||||
|
||||
private final TextureMap textureMap = Minecraft.getMinecraft().getTextureMapBlocks();
|
||||
private final TextureMap textureMap = Minecraft.getInstance().getTextureMapBlocks();
|
||||
|
||||
CableBusBakedModel( CableBuilder cableBuilder, FacadeBuilder facadeBuilder, Map<ResourceLocation, IBakedModel> partModels, TextureAtlasSprite particleTexture )
|
||||
{
|
||||
@@ -75,7 +75,7 @@ public class CableBusBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getQuads( @Nullable IBlockState state, @Nullable EnumFacing side, long rand )
|
||||
public List<BakedQuad> getQuads( @Nullable BlockState state, @Nullable Direction side, long rand )
|
||||
{
|
||||
CableBusRenderState renderState = getRenderingState( state );
|
||||
|
||||
@@ -104,7 +104,7 @@ public class CableBusBakedModel implements IBakedModel
|
||||
quads.addAll( cableModel );
|
||||
|
||||
// Then handle attachments
|
||||
for( EnumFacing facing : EnumFacing.values() )
|
||||
for( Direction facing : Direction.values() )
|
||||
{
|
||||
final IPartModel partModel = renderState.getAttachments().get( facing );
|
||||
if( partModel == null )
|
||||
@@ -133,7 +133,7 @@ public class CableBusBakedModel implements IBakedModel
|
||||
|
||||
// Rotate quads accordingly
|
||||
QuadRotator rotator = new QuadRotator();
|
||||
partQuads = rotator.rotateQuads( partQuads, facing, EnumFacing.UP );
|
||||
partQuads = rotator.rotateQuads( partQuads, facing, Direction.UP );
|
||||
|
||||
quads.addAll( partQuads );
|
||||
}
|
||||
@@ -145,16 +145,16 @@ public class CableBusBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
// Determines whether a cable is connected to exactly two sides that are opposite each other
|
||||
private static boolean isStraightLine( AECableType cableType, EnumMap<EnumFacing, AECableType> sides )
|
||||
private static boolean isStraightLine( AECableType cableType, EnumMap<Direction, AECableType> sides )
|
||||
{
|
||||
final Iterator<Entry<EnumFacing, AECableType>> it = sides.entrySet().iterator();
|
||||
final Iterator<Entry<Direction, AECableType>> it = sides.entrySet().iterator();
|
||||
if( !it.hasNext() )
|
||||
{
|
||||
return false; // No connections
|
||||
}
|
||||
|
||||
final Entry<EnumFacing, AECableType> nextConnection = it.next();
|
||||
final EnumFacing firstSide = nextConnection.getKey();
|
||||
final Entry<Direction, AECableType> nextConnection = it.next();
|
||||
final Direction firstSide = nextConnection.getKey();
|
||||
final AECableType firstType = nextConnection.getValue();
|
||||
|
||||
if( !it.hasNext() )
|
||||
@@ -184,14 +184,14 @@ public class CableBusBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
AEColor cableColor = renderState.getCableColor();
|
||||
EnumMap<EnumFacing, AECableType> connectionTypes = renderState.getConnectionTypes();
|
||||
EnumMap<Direction, AECableType> connectionTypes = renderState.getConnectionTypes();
|
||||
|
||||
// If the connection is straight, no busses are attached, and no covered core has been forced (in case of glass
|
||||
// cables), then render the cable as a simplified straight line.
|
||||
boolean noAttachments = !renderState.getAttachments().values().stream().anyMatch( IPartModel::requireCableConnection );
|
||||
if( noAttachments && isStraightLine( cableType, connectionTypes ) )
|
||||
{
|
||||
EnumFacing facing = connectionTypes.keySet().iterator().next();
|
||||
Direction facing = connectionTypes.keySet().iterator().next();
|
||||
|
||||
switch( cableType )
|
||||
{
|
||||
@@ -220,8 +220,8 @@ public class CableBusBakedModel implements IBakedModel
|
||||
this.cableBuilder.addCableCore( renderState.getCoreType(), cableColor, quadsOut );
|
||||
|
||||
// Render all internal connections to attachments
|
||||
EnumMap<EnumFacing, Integer> attachmentConnections = renderState.getAttachmentConnections();
|
||||
for( EnumFacing facing : attachmentConnections.keySet() )
|
||||
EnumMap<Direction, Integer> attachmentConnections = renderState.getAttachmentConnections();
|
||||
for( Direction facing : attachmentConnections.keySet() )
|
||||
{
|
||||
int distance = attachmentConnections.get( facing );
|
||||
int channels = renderState.getChannelsOnSide().get( facing );
|
||||
@@ -247,9 +247,9 @@ public class CableBusBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
// Render all outgoing connections using the appropriate type
|
||||
for( final Entry<EnumFacing, AECableType> connection : connectionTypes.entrySet() )
|
||||
for( final Entry<Direction, AECableType> connection : connectionTypes.entrySet() )
|
||||
{
|
||||
final EnumFacing facing = connection.getKey();
|
||||
final Direction facing = connection.getKey();
|
||||
final AECableType connectionType = connection.getValue();
|
||||
final boolean cableBusAdjacent = renderState.getCableBusAdjacent().contains( facing );
|
||||
final int channels = renderState.getChannelsOnSide().get( facing );
|
||||
@@ -293,7 +293,7 @@ public class CableBusBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
// If no core is present, just use the first part that comes into play
|
||||
for( EnumFacing side : renderState.getAttachments().keySet() )
|
||||
for( Direction side : renderState.getAttachments().keySet() )
|
||||
{
|
||||
IPartModel partModel = renderState.getAttachments().get( side );
|
||||
|
||||
@@ -320,7 +320,7 @@ public class CableBusBakedModel implements IBakedModel
|
||||
return result;
|
||||
}
|
||||
|
||||
private static CableBusRenderState getRenderingState( IBlockState state )
|
||||
private static CableBusRenderState getRenderingState( BlockState state )
|
||||
{
|
||||
if( state == null || !( state instanceof IExtendedBlockState ) )
|
||||
{
|
||||
|
||||
@@ -26,10 +26,10 @@ import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
|
||||
import appeng.api.parts.IPartModel;
|
||||
import appeng.api.util.AECableType;
|
||||
@@ -52,28 +52,28 @@ public class CableBusRenderState
|
||||
private AEColor cableColor = AEColor.TRANSPARENT;
|
||||
|
||||
// Describes the outgoing connections of this cable bus to other blocks, and how they should be rendered
|
||||
private EnumMap<EnumFacing, AECableType> connectionTypes = new EnumMap<>( EnumFacing.class );
|
||||
private EnumMap<Direction, AECableType> connectionTypes = new EnumMap<>( Direction.class );
|
||||
|
||||
// Indicate on which sides signified by connectionTypes above, there is another cable bus. If a side is connected,
|
||||
// but it is absent from this
|
||||
// set, then it means that there is a Grid host, but not a cable bus on that side (i.e. an interface, a controller,
|
||||
// etc.)
|
||||
private EnumSet<EnumFacing> cableBusAdjacent = EnumSet.noneOf( EnumFacing.class );
|
||||
private EnumSet<Direction> cableBusAdjacent = EnumSet.noneOf( Direction.class );
|
||||
|
||||
// Specifies the number of channels used for the connection to a given side. Only contains entries if
|
||||
// connections contains a corresponding entry.
|
||||
private EnumMap<EnumFacing, Integer> channelsOnSide = new EnumMap<>( EnumFacing.class );
|
||||
private EnumMap<Direction, Integer> channelsOnSide = new EnumMap<>( Direction.class );
|
||||
|
||||
private EnumMap<EnumFacing, IPartModel> attachments = new EnumMap<>( EnumFacing.class );
|
||||
private EnumMap<Direction, IPartModel> attachments = new EnumMap<>( Direction.class );
|
||||
|
||||
// For each attachment, this contains the distance from the edge until which a cable connection should be drawn
|
||||
private EnumMap<EnumFacing, Integer> attachmentConnections = new EnumMap<>( EnumFacing.class );
|
||||
private EnumMap<Direction, Integer> attachmentConnections = new EnumMap<>( Direction.class );
|
||||
|
||||
// Contains the facade to use for each side that has a facade attached
|
||||
private EnumMap<EnumFacing, FacadeRenderState> facades = new EnumMap<>( EnumFacing.class );
|
||||
private EnumMap<Direction, FacadeRenderState> facades = new EnumMap<>( Direction.class );
|
||||
|
||||
// Used for Facades.
|
||||
private WeakReference<IBlockAccess> world;
|
||||
private WeakReference<IBlockReader> world;
|
||||
private BlockPos pos;
|
||||
|
||||
// Contains the bounding boxes of all parts on the cable bus to allow facades to cut out holes for the parts. This
|
||||
@@ -81,7 +81,7 @@ public class CableBusRenderState
|
||||
// facades on this cable bus
|
||||
private List<AxisAlignedBB> boundingBoxes = new ArrayList<>();
|
||||
|
||||
private EnumMap<EnumFacing, Long> partFlags = new EnumMap<>( EnumFacing.class );
|
||||
private EnumMap<Direction, Long> partFlags = new EnumMap<>( Direction.class );
|
||||
|
||||
public CableCoreType getCoreType()
|
||||
{
|
||||
@@ -113,57 +113,57 @@ public class CableBusRenderState
|
||||
this.cableColor = cableColor;
|
||||
}
|
||||
|
||||
public EnumMap<EnumFacing, Integer> getChannelsOnSide()
|
||||
public EnumMap<Direction, Integer> getChannelsOnSide()
|
||||
{
|
||||
return this.channelsOnSide;
|
||||
}
|
||||
|
||||
public EnumMap<EnumFacing, AECableType> getConnectionTypes()
|
||||
public EnumMap<Direction, AECableType> getConnectionTypes()
|
||||
{
|
||||
return this.connectionTypes;
|
||||
}
|
||||
|
||||
public void setConnectionTypes( EnumMap<EnumFacing, AECableType> connectionTypes )
|
||||
public void setConnectionTypes( EnumMap<Direction, AECableType> connectionTypes )
|
||||
{
|
||||
this.connectionTypes = connectionTypes;
|
||||
}
|
||||
|
||||
public void setChannelsOnSide( EnumMap<EnumFacing, Integer> channelsOnSide )
|
||||
public void setChannelsOnSide( EnumMap<Direction, Integer> channelsOnSide )
|
||||
{
|
||||
this.channelsOnSide = channelsOnSide;
|
||||
}
|
||||
|
||||
public EnumSet<EnumFacing> getCableBusAdjacent()
|
||||
public EnumSet<Direction> getCableBusAdjacent()
|
||||
{
|
||||
return this.cableBusAdjacent;
|
||||
}
|
||||
|
||||
public void setCableBusAdjacent( EnumSet<EnumFacing> cableBusAdjacent )
|
||||
public void setCableBusAdjacent( EnumSet<Direction> cableBusAdjacent )
|
||||
{
|
||||
this.cableBusAdjacent = cableBusAdjacent;
|
||||
}
|
||||
|
||||
public EnumMap<EnumFacing, IPartModel> getAttachments()
|
||||
public EnumMap<Direction, IPartModel> getAttachments()
|
||||
{
|
||||
return this.attachments;
|
||||
}
|
||||
|
||||
public EnumMap<EnumFacing, Integer> getAttachmentConnections()
|
||||
public EnumMap<Direction, Integer> getAttachmentConnections()
|
||||
{
|
||||
return this.attachmentConnections;
|
||||
}
|
||||
|
||||
public EnumMap<EnumFacing, FacadeRenderState> getFacades()
|
||||
public EnumMap<Direction, FacadeRenderState> getFacades()
|
||||
{
|
||||
return this.facades;
|
||||
}
|
||||
|
||||
public IBlockAccess getWorld()
|
||||
public IBlockReader getWorld()
|
||||
{
|
||||
return this.world.get();
|
||||
}
|
||||
|
||||
public void setWorld( IBlockAccess world )
|
||||
public void setWorld( IBlockReader world )
|
||||
{
|
||||
this.world = new WeakReference<>( world );
|
||||
}
|
||||
@@ -183,7 +183,7 @@ public class CableBusRenderState
|
||||
return this.boundingBoxes;
|
||||
}
|
||||
|
||||
public EnumMap<EnumFacing, Long> getPartFlags()
|
||||
public EnumMap<Direction, Long> getPartFlags()
|
||||
{
|
||||
return this.partFlags;
|
||||
}
|
||||
|
||||
@@ -24,16 +24,15 @@ import java.util.EnumMap;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import javax.vecmath.Vector4f;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.Vector4f;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormatElement;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad;
|
||||
|
||||
import appeng.client.render.VertexFormats;
|
||||
@@ -49,13 +48,13 @@ public class CubeBuilder
|
||||
|
||||
private final List<BakedQuad> output;
|
||||
|
||||
private final EnumMap<EnumFacing, TextureAtlasSprite> textures = new EnumMap<>( EnumFacing.class );
|
||||
private final EnumMap<Direction, TextureAtlasSprite> textures = new EnumMap<>( Direction.class );
|
||||
|
||||
private EnumSet<EnumFacing> drawFaces = EnumSet.allOf( EnumFacing.class );
|
||||
private EnumSet<Direction> drawFaces = EnumSet.allOf( Direction.class );
|
||||
|
||||
private final EnumMap<EnumFacing, Vector4f> customUv = new EnumMap<>( EnumFacing.class );
|
||||
private final EnumMap<Direction, Vector4f> customUv = new EnumMap<>( Direction.class );
|
||||
|
||||
private byte[] uvRotations = new byte[EnumFacing.values().length];
|
||||
private byte[] uvRotations = new byte[Direction.values().length];
|
||||
|
||||
private int color = 0xFFFFFFFF;
|
||||
|
||||
@@ -92,7 +91,7 @@ public class CubeBuilder
|
||||
this.format = VertexFormats.getFormatWithLightMap( this.format );
|
||||
}
|
||||
|
||||
for( EnumFacing face : this.drawFaces )
|
||||
for( Direction face : this.drawFaces )
|
||||
{
|
||||
this.putFace( face, x1, y1, z1, x2, y2, z2 );
|
||||
}
|
||||
@@ -104,7 +103,7 @@ public class CubeBuilder
|
||||
}
|
||||
}
|
||||
|
||||
public void addQuad( EnumFacing face, float x1, float y1, float z1, float x2, float y2, float z2 )
|
||||
public void addQuad( Direction face, float x1, float y1, float z1, float x2, float y2, float z2 )
|
||||
{
|
||||
// If brightness is forced to specific values, extend the vertex format to contain the multi-texturing lightmap
|
||||
// offset
|
||||
@@ -136,7 +135,7 @@ public class CubeBuilder
|
||||
float v2;
|
||||
}
|
||||
|
||||
private void putFace( EnumFacing face, float x1, float y1, float z1, float x2, float y2, float z2 )
|
||||
private void putFace( Direction face, float x1, float y1, float z1, float x2, float y2, float z2 )
|
||||
{
|
||||
|
||||
TextureAtlasSprite texture = this.textures.get( face );
|
||||
@@ -210,7 +209,7 @@ public class CubeBuilder
|
||||
this.output.add( builder.build() );
|
||||
}
|
||||
|
||||
private UvVector getDefaultUv( EnumFacing face, TextureAtlasSprite texture, float x1, float y1, float z1, float x2, float y2, float z2 )
|
||||
private UvVector getDefaultUv( Direction face, TextureAtlasSprite texture, float x1, float y1, float z1, float x2, float y2, float z2 )
|
||||
{
|
||||
|
||||
UvVector uv = new UvVector();
|
||||
@@ -258,7 +257,7 @@ public class CubeBuilder
|
||||
return uv;
|
||||
}
|
||||
|
||||
private UvVector getStandardUv( EnumFacing face, TextureAtlasSprite texture, float x1, float y1, float z1, float x2, float y2, float z2 )
|
||||
private UvVector getStandardUv( Direction face, TextureAtlasSprite texture, float x1, float y1, float z1, float x2, float y2, float z2 )
|
||||
{
|
||||
UvVector uv = new UvVector();
|
||||
switch( face )
|
||||
@@ -304,7 +303,7 @@ public class CubeBuilder
|
||||
}
|
||||
|
||||
// uv.u1, uv.v1
|
||||
private void putVertexTL( UnpackedBakedQuad.Builder builder, EnumFacing face, float x, float y, float z, UvVector uv )
|
||||
private void putVertexTL( UnpackedBakedQuad.Builder builder, Direction face, float x, float y, float z, UvVector uv )
|
||||
{
|
||||
float u, v;
|
||||
|
||||
@@ -333,7 +332,7 @@ public class CubeBuilder
|
||||
}
|
||||
|
||||
// uv.u2, uv.v1
|
||||
private void putVertexTR( UnpackedBakedQuad.Builder builder, EnumFacing face, float x, float y, float z, UvVector uv )
|
||||
private void putVertexTR( UnpackedBakedQuad.Builder builder, Direction face, float x, float y, float z, UvVector uv )
|
||||
{
|
||||
float u, v;
|
||||
|
||||
@@ -361,7 +360,7 @@ public class CubeBuilder
|
||||
}
|
||||
|
||||
// uv.u2, uv.v2
|
||||
private void putVertexBR( UnpackedBakedQuad.Builder builder, EnumFacing face, float x, float y, float z, UvVector uv )
|
||||
private void putVertexBR( UnpackedBakedQuad.Builder builder, Direction face, float x, float y, float z, UvVector uv )
|
||||
{
|
||||
|
||||
float u;
|
||||
@@ -392,7 +391,7 @@ public class CubeBuilder
|
||||
}
|
||||
|
||||
// uv.u1, uv.v2
|
||||
private void putVertexBL( UnpackedBakedQuad.Builder builder, EnumFacing face, float x, float y, float z, UvVector uv )
|
||||
private void putVertexBL( UnpackedBakedQuad.Builder builder, Direction face, float x, float y, float z, UvVector uv )
|
||||
{
|
||||
|
||||
float u;
|
||||
@@ -422,7 +421,7 @@ public class CubeBuilder
|
||||
this.putVertex( builder, face, x, y, z, u, v );
|
||||
}
|
||||
|
||||
private void putVertex( UnpackedBakedQuad.Builder builder, EnumFacing face, float x, float y, float z, float u, float v )
|
||||
private void putVertex( UnpackedBakedQuad.Builder builder, Direction face, float x, float y, float z, float u, float v )
|
||||
{
|
||||
VertexFormat format = builder.getVertexFormat();
|
||||
|
||||
@@ -468,7 +467,7 @@ public class CubeBuilder
|
||||
|
||||
public void setTexture( TextureAtlasSprite texture )
|
||||
{
|
||||
for( EnumFacing face : EnumFacing.values() )
|
||||
for( Direction face : Direction.values() )
|
||||
{
|
||||
this.textures.put( face, texture );
|
||||
}
|
||||
@@ -476,20 +475,20 @@ public class CubeBuilder
|
||||
|
||||
public void setTextures( TextureAtlasSprite up, TextureAtlasSprite down, TextureAtlasSprite north, TextureAtlasSprite south, TextureAtlasSprite east, TextureAtlasSprite west )
|
||||
{
|
||||
this.textures.put( EnumFacing.UP, up );
|
||||
this.textures.put( EnumFacing.DOWN, down );
|
||||
this.textures.put( EnumFacing.NORTH, north );
|
||||
this.textures.put( EnumFacing.SOUTH, south );
|
||||
this.textures.put( EnumFacing.EAST, east );
|
||||
this.textures.put( EnumFacing.WEST, west );
|
||||
this.textures.put( Direction.UP, up );
|
||||
this.textures.put( Direction.DOWN, down );
|
||||
this.textures.put( Direction.NORTH, north );
|
||||
this.textures.put( Direction.SOUTH, south );
|
||||
this.textures.put( Direction.EAST, east );
|
||||
this.textures.put( Direction.WEST, west );
|
||||
}
|
||||
|
||||
public void setTexture( EnumFacing facing, TextureAtlasSprite sprite )
|
||||
public void setTexture( Direction facing, TextureAtlasSprite sprite )
|
||||
{
|
||||
this.textures.put( facing, sprite );
|
||||
}
|
||||
|
||||
public void setDrawFaces( EnumSet<EnumFacing> drawFaces )
|
||||
public void setDrawFaces( EnumSet<Direction> drawFaces )
|
||||
{
|
||||
this.drawFaces = drawFaces;
|
||||
}
|
||||
@@ -517,12 +516,12 @@ public class CubeBuilder
|
||||
this.renderFullBright = renderFullBright;
|
||||
}
|
||||
|
||||
public void setCustomUv( EnumFacing facing, float u1, float v1, float u2, float v2 )
|
||||
public void setCustomUv( Direction facing, float u1, float v1, float u2, float v2 )
|
||||
{
|
||||
this.customUv.put( facing, new Vector4f( u1, v1, u2, v2 ) );
|
||||
}
|
||||
|
||||
public void setUvRotation( EnumFacing facing, int rotation )
|
||||
public void setUvRotation( Direction facing, int rotation )
|
||||
{
|
||||
if( rotation == 2 )
|
||||
{
|
||||
|
||||
@@ -21,30 +21,30 @@ package appeng.client.render.cablebus;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.WorldType;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
|
||||
/**
|
||||
* This is used to retrieve the ExtendedState of a block for facade rendering.
|
||||
* It fakes the block at BlockPos provided as the IBlockState provided.
|
||||
* It fakes the block at BlockPos provided as the BlockState provided.
|
||||
*
|
||||
* @author covers1624
|
||||
*/
|
||||
public class FacadeBlockAccess implements IBlockAccess
|
||||
public class FacadeBlockAccess implements IBlockReader
|
||||
{
|
||||
|
||||
private final IBlockAccess world;
|
||||
private final IBlockReader world;
|
||||
private final BlockPos pos;
|
||||
private final EnumFacing side;
|
||||
private final IBlockState state;
|
||||
private final Direction side;
|
||||
private final BlockState state;
|
||||
|
||||
public FacadeBlockAccess( IBlockAccess world, BlockPos pos, EnumFacing side, IBlockState state )
|
||||
public FacadeBlockAccess( IBlockReader world, BlockPos pos, Direction side, BlockState state )
|
||||
{
|
||||
this.world = world;
|
||||
this.pos = pos;
|
||||
@@ -66,7 +66,7 @@ public class FacadeBlockAccess implements IBlockAccess
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getBlockState( BlockPos pos )
|
||||
public BlockState getBlockState( BlockPos pos )
|
||||
{
|
||||
if( this.pos == pos )
|
||||
{
|
||||
@@ -78,7 +78,7 @@ public class FacadeBlockAccess implements IBlockAccess
|
||||
@Override
|
||||
public boolean isAirBlock( BlockPos pos )
|
||||
{
|
||||
IBlockState state = this.getBlockState( pos );
|
||||
BlockState state = this.getBlockState( pos );
|
||||
return state.getBlock().isAir( state, this.world, pos );
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public class FacadeBlockAccess implements IBlockAccess
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStrongPower( BlockPos pos, EnumFacing direction )
|
||||
public int getStrongPower( BlockPos pos, Direction direction )
|
||||
{
|
||||
return this.world.getStrongPower( pos, direction );
|
||||
}
|
||||
@@ -101,7 +101,7 @@ public class FacadeBlockAccess implements IBlockAccess
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSideSolid( BlockPos pos, EnumFacing side, boolean _default )
|
||||
public boolean isSideSolid( BlockPos pos, Direction side, boolean _default )
|
||||
{
|
||||
if( pos.getX() < -30000000 || pos.getZ() < -30000000 || pos.getX() >= 30000000 || pos.getZ() >= 30000000 )
|
||||
{
|
||||
|
||||
@@ -29,20 +29,20 @@ import java.util.function.Function;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BlockRendererDispatcher;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.color.BlockColors;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumFacing.Axis;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Direction.Axis;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -110,17 +110,17 @@ public class FacadeBuilder
|
||||
BakedPipeline pipeline = this.pipelines.get();
|
||||
Quad collectorQuad = this.collectors.get();
|
||||
boolean transparent = AEApi.instance().partHelper().getCableRenderMode().transparentFacades;
|
||||
Map<EnumFacing, FacadeRenderState> facadeStates = renderState.getFacades();
|
||||
Map<Direction, FacadeRenderState> facadeStates = renderState.getFacades();
|
||||
List<AxisAlignedBB> partBoxes = renderState.getBoundingBoxes();
|
||||
Set<EnumFacing> sidesWithParts = renderState.getAttachments().keySet();
|
||||
IBlockAccess parentWorld = renderState.getWorld();
|
||||
Set<Direction> sidesWithParts = renderState.getAttachments().keySet();
|
||||
IBlockReader parentWorld = renderState.getWorld();
|
||||
BlockPos pos = renderState.getPos();
|
||||
BlockColors blockColors = Minecraft.getMinecraft().getBlockColors();
|
||||
BlockColors blockColors = Minecraft.getInstance().getBlockColors();
|
||||
boolean thinFacades = isUseThinFacades( partBoxes );
|
||||
|
||||
for( Entry<EnumFacing, FacadeRenderState> entry : facadeStates.entrySet() )
|
||||
for( Entry<Direction, FacadeRenderState> entry : facadeStates.entrySet() )
|
||||
{
|
||||
EnumFacing side = entry.getKey();
|
||||
Direction side = entry.getKey();
|
||||
int sideIndex = side.ordinal();
|
||||
FacadeRenderState facadeRenderState = entry.getValue();
|
||||
boolean renderStilt = !sidesWithParts.contains( side );
|
||||
@@ -130,7 +130,7 @@ public class FacadeBuilder
|
||||
{
|
||||
IBakedModel partModel = modelLookup.apply( part );
|
||||
QuadRotator rotator = new QuadRotator();
|
||||
quads.addAll( rotator.rotateQuads( gatherQuads( partModel, null, rand ), side, EnumFacing.UP ) );
|
||||
quads.addAll( rotator.rotateQuads( gatherQuads( partModel, null, rand ), side, Direction.UP ) );
|
||||
}
|
||||
}
|
||||
// If we are forcing transparency and this isn't the Translucent layer.
|
||||
@@ -139,7 +139,7 @@ public class FacadeBuilder
|
||||
continue;
|
||||
}
|
||||
|
||||
IBlockState blockState = facadeRenderState.getSourceBlock();
|
||||
BlockState blockState = facadeRenderState.getSourceBlock();
|
||||
// If we aren't forcing transparency let the block decide if it should render.
|
||||
if( !transparent && layer != null )
|
||||
{
|
||||
@@ -156,7 +156,7 @@ public class FacadeBuilder
|
||||
{
|
||||
double offset = thinFacades ? THIN_THICKNESS : THICK_THICKNESS;
|
||||
AEAxisAlignedBB tmpBB = null;
|
||||
for( EnumFacing face : EnumFacing.VALUES )
|
||||
for( Direction face : Direction.VALUES )
|
||||
{
|
||||
// Only faces that aren't on our axis
|
||||
if( face.getAxis() != side.getAxis() )
|
||||
@@ -202,9 +202,9 @@ public class FacadeBuilder
|
||||
|
||||
AEAxisAlignedBB cutOutBox = getCutOutBox( facadeBox, partBoxes );
|
||||
List<AxisAlignedBB> holeStrips = getBoxes( facadeBox, cutOutBox, side.getAxis() );
|
||||
IBlockAccess facadeAccess = new FacadeBlockAccess( parentWorld, pos, side, blockState );
|
||||
IBlockReader facadeAccess = new FacadeBlockAccess( parentWorld, pos, side, blockState );
|
||||
|
||||
BlockRendererDispatcher dispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
|
||||
BlockRendererDispatcher dispatcher = Minecraft.getInstance().getBlockRendererDispatcher();
|
||||
|
||||
try
|
||||
{
|
||||
@@ -261,9 +261,9 @@ public class FacadeBuilder
|
||||
|
||||
// calculate the side mask.
|
||||
int facadeMask = 0;
|
||||
for( Entry<EnumFacing, FacadeRenderState> ent : facadeStates.entrySet() )
|
||||
for( Entry<Direction, FacadeRenderState> ent : facadeStates.entrySet() )
|
||||
{
|
||||
EnumFacing s = ent.getKey();
|
||||
Direction s = ent.getKey();
|
||||
if( s.getAxis() != side.getAxis() )
|
||||
{
|
||||
FacadeRenderState otherState = ent.getValue();
|
||||
@@ -324,10 +324,10 @@ public class FacadeBuilder
|
||||
*
|
||||
* @return The model.
|
||||
*/
|
||||
public List<BakedQuad> buildFacadeItemQuads( ItemStack textureItem, EnumFacing side )
|
||||
public List<BakedQuad> buildFacadeItemQuads( ItemStack textureItem, Direction side )
|
||||
{
|
||||
List<BakedQuad> facadeQuads = new ArrayList<>();
|
||||
IBakedModel model = Minecraft.getMinecraft().getRenderItem().getItemModelWithOverrides( textureItem, null, null );
|
||||
IBakedModel model = Minecraft.getInstance().getRenderItem().getItemModelWithOverrides( textureItem, null, null );
|
||||
List<BakedQuad> modelQuads = gatherQuads( model, null, 0 );
|
||||
|
||||
BakedPipeline pipeline = this.pipelines.get();
|
||||
@@ -348,7 +348,7 @@ public class FacadeBuilder
|
||||
// If we have a tint index, setup the tinter and enable it.
|
||||
if( quad.hasTintIndex() )
|
||||
{
|
||||
tinter.setTint( Minecraft.getMinecraft().getItemColors().colorMultiplier( textureItem, quad.getTintIndex() ) );
|
||||
tinter.setTint( Minecraft.getInstance().getItemColors().colorMultiplier( textureItem, quad.getTintIndex() ) );
|
||||
pipeline.enableElement( "tinter" );
|
||||
}
|
||||
// Disable elements we don't need for items.
|
||||
@@ -370,10 +370,10 @@ public class FacadeBuilder
|
||||
}
|
||||
|
||||
// Helper to gather all quads from a model into a list.
|
||||
private static List<BakedQuad> gatherQuads( IBakedModel model, IBlockState state, long rand )
|
||||
private static List<BakedQuad> gatherQuads( IBakedModel model, BlockState state, long rand )
|
||||
{
|
||||
List<BakedQuad> modelQuads = new ArrayList<>();
|
||||
for( EnumFacing face : EnumFacing.VALUES )
|
||||
for( Direction face : Direction.VALUES )
|
||||
{
|
||||
modelQuads.addAll( model.getQuads( state, face, rand ) );
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
package appeng.client.render.cablebus;
|
||||
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
|
||||
|
||||
/**
|
||||
@@ -12,17 +12,17 @@ public class FacadeRenderState
|
||||
{
|
||||
|
||||
// The block state to use for rendering this facade
|
||||
private final IBlockState sourceBlock;
|
||||
private final BlockState sourceBlock;
|
||||
|
||||
private final boolean transparent;
|
||||
|
||||
public FacadeRenderState( IBlockState sourceBlock, boolean transparent )
|
||||
public FacadeRenderState( BlockState sourceBlock, boolean transparent )
|
||||
{
|
||||
this.sourceBlock = sourceBlock;
|
||||
this.transparent = transparent;
|
||||
}
|
||||
|
||||
public IBlockState getSourceBlock()
|
||||
public BlockState getSourceBlock()
|
||||
{
|
||||
return this.sourceBlock;
|
||||
}
|
||||
|
||||
@@ -9,13 +9,13 @@ import java.util.concurrent.ExecutionException;
|
||||
import com.google.common.cache.Cache;
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
|
||||
import appeng.api.parts.IPartBakedModel;
|
||||
import appeng.api.util.AEColor;
|
||||
@@ -66,7 +66,7 @@ public class P2PTunnelFrequencyBakedModel implements IBakedModel, IPartBakedMode
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getQuads( IBlockState state, EnumFacing side, long rand )
|
||||
public List<BakedQuad> getQuads( BlockState state, Direction side, long rand )
|
||||
{
|
||||
if( side != null )
|
||||
{
|
||||
|
||||
@@ -26,10 +26,10 @@ import javax.vecmath.Matrix4f;
|
||||
import javax.vecmath.Point3f;
|
||||
import javax.vecmath.Vector3f;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormatElement;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
|
||||
import appeng.client.render.FacingToRotation;
|
||||
import appeng.core.AELog;
|
||||
@@ -42,9 +42,9 @@ import appeng.core.AELog;
|
||||
public class QuadRotator
|
||||
{
|
||||
|
||||
public List<BakedQuad> rotateQuads( List<BakedQuad> quads, EnumFacing newForward, EnumFacing newUp )
|
||||
public List<BakedQuad> rotateQuads( List<BakedQuad> quads, Direction newForward, Direction newUp )
|
||||
{
|
||||
if( newForward == EnumFacing.NORTH && newUp == EnumFacing.UP )
|
||||
if( newForward == Direction.NORTH && newUp == Direction.UP )
|
||||
{
|
||||
return quads; // This is the default orientation
|
||||
}
|
||||
@@ -59,18 +59,18 @@ public class QuadRotator
|
||||
return result;
|
||||
}
|
||||
|
||||
private BakedQuad rotateQuad( BakedQuad quad, EnumFacing forward, EnumFacing up )
|
||||
private BakedQuad rotateQuad( BakedQuad quad, Direction forward, Direction up )
|
||||
{
|
||||
// Sanitize forward/up
|
||||
if( forward.getAxis() == up.getAxis() )
|
||||
{
|
||||
if( up.getAxis() == EnumFacing.Axis.Y )
|
||||
if( up.getAxis() == Direction.Axis.Y )
|
||||
{
|
||||
up = EnumFacing.NORTH;
|
||||
up = Direction.NORTH;
|
||||
}
|
||||
else
|
||||
{
|
||||
up = EnumFacing.UP;
|
||||
up = Direction.UP;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ public class QuadRotator
|
||||
}
|
||||
}
|
||||
|
||||
EnumFacing newFace = rotation.rotate( quad.getFace() );
|
||||
Direction newFace = rotation.rotate( quad.getFace() );
|
||||
return new BakedQuad( newData, quad.getTintIndex(), newFace, quad.getSprite(), quad.shouldApplyDiffuseLighting(), quad.getFormat() );
|
||||
}
|
||||
|
||||
|
||||
@@ -26,14 +26,14 @@ import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
|
||||
import appeng.block.crafting.BlockCraftingUnit;
|
||||
@@ -65,7 +65,7 @@ abstract class CraftingCubeBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getQuads( @Nullable IBlockState state, @Nullable EnumFacing side, long rand )
|
||||
public List<BakedQuad> getQuads( @Nullable BlockState state, @Nullable Direction side, long rand )
|
||||
{
|
||||
|
||||
if( side == null )
|
||||
@@ -73,7 +73,7 @@ abstract class CraftingCubeBakedModel implements IBakedModel
|
||||
return Collections.emptyList(); // No generic quads for this model
|
||||
}
|
||||
|
||||
EnumSet<EnumFacing> connections = getConnections( state );
|
||||
EnumSet<Direction> connections = getConnections( state );
|
||||
|
||||
List<BakedQuad> quads = new ArrayList<>();
|
||||
CubeBuilder builder = new CubeBuilder( this.format, quads );
|
||||
@@ -84,14 +84,14 @@ abstract class CraftingCubeBakedModel implements IBakedModel
|
||||
this.addRing( builder, side, connections );
|
||||
|
||||
// Calculate the bounds of the "inner" block that is framed by the border drawn above
|
||||
float x2 = connections.contains( EnumFacing.EAST ) ? 16 : 13.01f;
|
||||
float x1 = connections.contains( EnumFacing.WEST ) ? 0 : 2.99f;
|
||||
float x2 = connections.contains( Direction.EAST ) ? 16 : 13.01f;
|
||||
float x1 = connections.contains( Direction.WEST ) ? 0 : 2.99f;
|
||||
|
||||
float y2 = connections.contains( EnumFacing.UP ) ? 16 : 13.01f;
|
||||
float y1 = connections.contains( EnumFacing.DOWN ) ? 0 : 2.99f;
|
||||
float y2 = connections.contains( Direction.UP ) ? 16 : 13.01f;
|
||||
float y1 = connections.contains( Direction.DOWN ) ? 0 : 2.99f;
|
||||
|
||||
float z2 = connections.contains( EnumFacing.SOUTH ) ? 16 : 13.01f;
|
||||
float z1 = connections.contains( EnumFacing.NORTH ) ? 0 : 2.99f;
|
||||
float z2 = connections.contains( Direction.SOUTH ) ? 16 : 13.01f;
|
||||
float z1 = connections.contains( Direction.NORTH ) ? 0 : 2.99f;
|
||||
|
||||
// On the axis of the side that we're currently drawing, extend the dimensions
|
||||
// out to the outer face of the block
|
||||
@@ -119,21 +119,21 @@ abstract class CraftingCubeBakedModel implements IBakedModel
|
||||
return quads;
|
||||
}
|
||||
|
||||
private void addRing( CubeBuilder builder, @Nullable EnumFacing side, EnumSet<EnumFacing> connections )
|
||||
private void addRing( CubeBuilder builder, @Nullable Direction side, EnumSet<Direction> connections )
|
||||
{
|
||||
// Fill in the corners
|
||||
builder.setTexture( this.ringCorner );
|
||||
this.addCornerCap( builder, connections, side, EnumFacing.UP, EnumFacing.EAST, EnumFacing.NORTH );
|
||||
this.addCornerCap( builder, connections, side, EnumFacing.UP, EnumFacing.EAST, EnumFacing.SOUTH );
|
||||
this.addCornerCap( builder, connections, side, EnumFacing.UP, EnumFacing.WEST, EnumFacing.NORTH );
|
||||
this.addCornerCap( builder, connections, side, EnumFacing.UP, EnumFacing.WEST, EnumFacing.SOUTH );
|
||||
this.addCornerCap( builder, connections, side, EnumFacing.DOWN, EnumFacing.EAST, EnumFacing.NORTH );
|
||||
this.addCornerCap( builder, connections, side, EnumFacing.DOWN, EnumFacing.EAST, EnumFacing.SOUTH );
|
||||
this.addCornerCap( builder, connections, side, EnumFacing.DOWN, EnumFacing.WEST, EnumFacing.NORTH );
|
||||
this.addCornerCap( builder, connections, side, EnumFacing.DOWN, EnumFacing.WEST, EnumFacing.SOUTH );
|
||||
this.addCornerCap( builder, connections, side, Direction.UP, Direction.EAST, Direction.NORTH );
|
||||
this.addCornerCap( builder, connections, side, Direction.UP, Direction.EAST, Direction.SOUTH );
|
||||
this.addCornerCap( builder, connections, side, Direction.UP, Direction.WEST, Direction.NORTH );
|
||||
this.addCornerCap( builder, connections, side, Direction.UP, Direction.WEST, Direction.SOUTH );
|
||||
this.addCornerCap( builder, connections, side, Direction.DOWN, Direction.EAST, Direction.NORTH );
|
||||
this.addCornerCap( builder, connections, side, Direction.DOWN, Direction.EAST, Direction.SOUTH );
|
||||
this.addCornerCap( builder, connections, side, Direction.DOWN, Direction.WEST, Direction.NORTH );
|
||||
this.addCornerCap( builder, connections, side, Direction.DOWN, Direction.WEST, Direction.SOUTH );
|
||||
|
||||
// Fill in the remaining stripes of the face
|
||||
for( EnumFacing a : EnumFacing.values() )
|
||||
for( Direction a : Direction.values() )
|
||||
{
|
||||
if( a == side || a == side.getOpposite() )
|
||||
{
|
||||
@@ -141,11 +141,11 @@ abstract class CraftingCubeBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
// Select the horizontal or vertical ring texture depending on which side we're filling in
|
||||
if( ( side.getAxis() != EnumFacing.Axis.Y ) && ( a == EnumFacing.NORTH || a == EnumFacing.EAST || a == EnumFacing.WEST || a == EnumFacing.SOUTH ) )
|
||||
if( ( side.getAxis() != Direction.Axis.Y ) && ( a == Direction.NORTH || a == Direction.EAST || a == Direction.WEST || a == Direction.SOUTH ) )
|
||||
{
|
||||
builder.setTexture( this.ringVer );
|
||||
}
|
||||
else if( side.getAxis() == EnumFacing.Axis.Y && ( a == EnumFacing.EAST || a == EnumFacing.WEST ) )
|
||||
else if( side.getAxis() == Direction.Axis.Y && ( a == Direction.EAST || a == Direction.WEST ) )
|
||||
{
|
||||
builder.setTexture( this.ringVer );
|
||||
}
|
||||
@@ -194,8 +194,8 @@ abstract class CraftingCubeBakedModel implements IBakedModel
|
||||
// drawn in those directions. Since a corner is drawn if the three touching faces dont have adjacent
|
||||
// crafting cube blocks, we'd have to check for a, side, and the perpendicular direction. But in this
|
||||
// block, we've already checked for side (due to face culling) and a (see above).
|
||||
EnumFacing perpendicular = a.rotateAround( side.getAxis() );
|
||||
for( EnumFacing cornerCandidate : EnumSet.of( perpendicular, perpendicular.getOpposite() ) )
|
||||
Direction perpendicular = a.rotateAround( side.getAxis() );
|
||||
for( Direction cornerCandidate : EnumSet.of( perpendicular, perpendicular.getOpposite() ) )
|
||||
{
|
||||
if( !connections.contains( cornerCandidate ) )
|
||||
{
|
||||
@@ -232,7 +232,7 @@ abstract class CraftingCubeBakedModel implements IBakedModel
|
||||
/**
|
||||
* Adds a 3x3x3 corner cap to the cube builder if there are no adjacent crafting cubes on that corner.
|
||||
*/
|
||||
private void addCornerCap( CubeBuilder builder, EnumSet<EnumFacing> connections, EnumFacing side, EnumFacing down, EnumFacing west, EnumFacing north )
|
||||
private void addCornerCap( CubeBuilder builder, EnumSet<Direction> connections, Direction side, Direction down, Direction west, Direction north )
|
||||
{
|
||||
if( connections.contains( down ) || connections.contains( west ) || connections.contains( north ) )
|
||||
{
|
||||
@@ -245,35 +245,35 @@ abstract class CraftingCubeBakedModel implements IBakedModel
|
||||
return;
|
||||
}
|
||||
|
||||
float x1 = ( west == EnumFacing.WEST ? 0 : 13 );
|
||||
float y1 = ( down == EnumFacing.DOWN ? 0 : 13 );
|
||||
float z1 = ( north == EnumFacing.NORTH ? 0 : 13 );
|
||||
float x2 = ( west == EnumFacing.WEST ? 3 : 16 );
|
||||
float y2 = ( down == EnumFacing.DOWN ? 3 : 16 );
|
||||
float z2 = ( north == EnumFacing.NORTH ? 3 : 16 );
|
||||
float x1 = ( west == Direction.WEST ? 0 : 13 );
|
||||
float y1 = ( down == Direction.DOWN ? 0 : 13 );
|
||||
float z1 = ( north == Direction.NORTH ? 0 : 13 );
|
||||
float x2 = ( west == Direction.WEST ? 3 : 16 );
|
||||
float y2 = ( down == Direction.DOWN ? 3 : 16 );
|
||||
float z2 = ( north == Direction.NORTH ? 3 : 16 );
|
||||
builder.addCube( x1, y1, z1, x2, y2, z2 );
|
||||
}
|
||||
|
||||
// Retrieve the cube connection state from the block state
|
||||
// If none is present, just assume there are no adjacent crafting cube blocks
|
||||
private static EnumSet<EnumFacing> getConnections( @Nullable IBlockState state )
|
||||
private static EnumSet<Direction> getConnections( @Nullable BlockState state )
|
||||
{
|
||||
if( !( state instanceof IExtendedBlockState ) )
|
||||
{
|
||||
return EnumSet.noneOf( EnumFacing.class );
|
||||
return EnumSet.noneOf( Direction.class );
|
||||
}
|
||||
|
||||
IExtendedBlockState extState = (IExtendedBlockState) state;
|
||||
CraftingCubeState cubeState = extState.getValue( BlockCraftingUnit.STATE );
|
||||
if( cubeState == null )
|
||||
{
|
||||
return EnumSet.noneOf( EnumFacing.class );
|
||||
return EnumSet.noneOf( Direction.class );
|
||||
}
|
||||
|
||||
return cubeState.getConnections();
|
||||
}
|
||||
|
||||
protected abstract void addInnerCube( EnumFacing facing, IBlockState state, CubeBuilder builder, float x1, float y1, float z1, float x2, float y2, float z2 );
|
||||
protected abstract void addInnerCube( Direction facing, BlockState state, CubeBuilder builder, float x1, float y1, float z1, float x2, float y2, float z2 );
|
||||
|
||||
@Override
|
||||
public boolean isAmbientOcclusion()
|
||||
|
||||
@@ -23,11 +23,11 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.block.crafting.BlockCraftingUnit;
|
||||
import appeng.bootstrap.BlockRenderingCustomizer;
|
||||
@@ -53,7 +53,7 @@ public class CraftingCubeRendering extends BlockRenderingCustomizer
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
|
||||
{
|
||||
ResourceLocation baseName = new ResourceLocation( AppEng.MOD_ID, this.registryName );
|
||||
@@ -82,10 +82,10 @@ public class CraftingCubeRendering extends BlockRenderingCustomizer
|
||||
|
||||
}
|
||||
|
||||
private Map<IBlockState, ModelResourceLocation> mapState( Block block, ModelResourceLocation defaultModel, ModelResourceLocation formedModel )
|
||||
private Map<BlockState, ModelResourceLocation> mapState( Block block, ModelResourceLocation defaultModel, ModelResourceLocation formedModel )
|
||||
{
|
||||
Map<IBlockState, ModelResourceLocation> result = new HashMap<>();
|
||||
for( IBlockState state : block.getBlockState().getValidStates() )
|
||||
Map<BlockState, ModelResourceLocation> result = new HashMap<>();
|
||||
for( BlockState state : block.getBlockState().getValidStates() )
|
||||
{
|
||||
if( state.getValue( BlockCraftingUnit.FORMED ) )
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ package appeng.client.render.crafting;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
|
||||
|
||||
/**
|
||||
@@ -31,14 +31,14 @@ public final class CraftingCubeState
|
||||
{
|
||||
|
||||
// Contains information on which sides of the block are connected to other parts of a formed crafting cube
|
||||
private final EnumSet<EnumFacing> connections;
|
||||
private final EnumSet<Direction> connections;
|
||||
|
||||
public CraftingCubeState( EnumSet<EnumFacing> connections )
|
||||
public CraftingCubeState( EnumSet<Direction> connections )
|
||||
{
|
||||
this.connections = connections;
|
||||
}
|
||||
|
||||
public EnumSet<EnumFacing> getConnections()
|
||||
public EnumSet<Direction> getConnections()
|
||||
{
|
||||
return this.connections;
|
||||
}
|
||||
|
||||
@@ -21,9 +21,9 @@ package appeng.client.render.crafting;
|
||||
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.render.TesrRenderHelper;
|
||||
@@ -33,7 +33,7 @@ import appeng.tile.crafting.TileCraftingMonitorTile;
|
||||
/**
|
||||
* Renders the item currently being crafted
|
||||
*/
|
||||
@SideOnly( Side.CLIENT )
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public class CraftingMonitorTESR extends TileEntitySpecialRenderer<TileCraftingMonitorTile>
|
||||
{
|
||||
|
||||
@@ -45,7 +45,7 @@ public class CraftingMonitorTESR extends TileEntitySpecialRenderer<TileCraftingM
|
||||
return;
|
||||
}
|
||||
|
||||
EnumFacing facing = te.getForward();
|
||||
Direction facing = te.getForward();
|
||||
|
||||
IAEItemStack jobProgress = te.getJobProgress();
|
||||
if( jobProgress != null )
|
||||
|
||||
@@ -12,17 +12,17 @@ import com.google.common.collect.ImmutableMap;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.PerspectiveMapWrapper;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
@@ -53,7 +53,7 @@ class ItemEncodedPatternBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getQuads( @Nullable IBlockState state, @Nullable EnumFacing side, long rand )
|
||||
public List<BakedQuad> getQuads( @Nullable BlockState state, @Nullable Direction side, long rand )
|
||||
{
|
||||
return this.baseModel.getQuads( state, side, rand );
|
||||
}
|
||||
@@ -157,7 +157,7 @@ class ItemEncodedPatternBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getQuads( @Nullable IBlockState state, @Nullable EnumFacing side, long rand )
|
||||
public List<BakedQuad> getQuads( @Nullable BlockState state, @Nullable Direction side, long rand )
|
||||
{
|
||||
// This may be called for items on the ground, in which case we will always fall back to the pattern
|
||||
return ItemEncodedPatternBakedModel.this.baseModel.getQuads( state, side, rand );
|
||||
@@ -220,7 +220,7 @@ class ItemEncodedPatternBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBakedModel handleItemState( IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity )
|
||||
public IBakedModel handleItemState( IBakedModel originalModel, ItemStack stack, World world, LivingEntity entity )
|
||||
{
|
||||
boolean shiftHeld = Keyboard.isKeyDown( Keyboard.KEY_LSHIFT ) || Keyboard.isKeyDown( Keyboard.KEY_RSHIFT );
|
||||
if( shiftHeld )
|
||||
@@ -229,7 +229,7 @@ class ItemEncodedPatternBakedModel implements IBakedModel
|
||||
ItemStack output = iep.getOutput( stack );
|
||||
if( !output.isEmpty() )
|
||||
{
|
||||
IBakedModel realModel = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel( output );
|
||||
IBakedModel realModel = Minecraft.getInstance().getRenderItem().getItemModelMesher().getItemModel( output );
|
||||
// Give the item model a chance to handle the overrides as well
|
||||
realModel = realModel.getOverrides().handleItemState( realModel, output, world, entity );
|
||||
return new ShiftHoldingModelWrapper( realModel );
|
||||
|
||||
@@ -4,8 +4,8 @@ package appeng.client.render.crafting;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.bootstrap.IItemRendering;
|
||||
import appeng.bootstrap.ItemRenderingCustomizer;
|
||||
@@ -18,7 +18,7 @@ public class ItemEncodedPatternRendering extends ItemRenderingCustomizer
|
||||
private static final ResourceLocation MODEL = new ResourceLocation( AppEng.MOD_ID, "builtin/encoded_pattern" );
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public void customize( IItemRendering rendering )
|
||||
{
|
||||
rendering.builtInModel( "models/item/builtin/encoded_pattern", new ItemEncodedPatternModel() );
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
package appeng.client.render.crafting;
|
||||
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
|
||||
import appeng.block.crafting.BlockCraftingUnit;
|
||||
import appeng.client.render.cablebus.CubeBuilder;
|
||||
@@ -47,7 +47,7 @@ class LightBakedModel extends CraftingCubeBakedModel
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addInnerCube( EnumFacing facing, IBlockState state, CubeBuilder builder, float x1, float y1, float z1, float x2, float y2, float z2 )
|
||||
protected void addInnerCube( Direction facing, BlockState state, CubeBuilder builder, float x1, float y1, float z1, float x2, float y2, float z2 )
|
||||
{
|
||||
builder.setTexture( this.baseTexture );
|
||||
builder.addCube( x1, y1, z1, x2, y2, z2 );
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
package appeng.client.render.crafting;
|
||||
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
|
||||
import appeng.api.util.AEColor;
|
||||
@@ -61,9 +61,9 @@ class MonitorBakedModel extends CraftingCubeBakedModel
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addInnerCube( EnumFacing side, IBlockState state, CubeBuilder builder, float x1, float y1, float z1, float x2, float y2, float z2 )
|
||||
protected void addInnerCube( Direction side, BlockState state, CubeBuilder builder, float x1, float y1, float z1, float x2, float y2, float z2 )
|
||||
{
|
||||
EnumFacing forward = getForward( state );
|
||||
Direction forward = getForward( state );
|
||||
|
||||
// For sides other than the front, use the chassis texture
|
||||
if( side != forward )
|
||||
@@ -96,7 +96,7 @@ class MonitorBakedModel extends CraftingCubeBakedModel
|
||||
|
||||
}
|
||||
|
||||
private static AEColor getColor( IBlockState state )
|
||||
private static AEColor getColor( BlockState state )
|
||||
{
|
||||
if( state instanceof IExtendedBlockState )
|
||||
{
|
||||
@@ -111,18 +111,18 @@ class MonitorBakedModel extends CraftingCubeBakedModel
|
||||
return AEColor.TRANSPARENT;
|
||||
}
|
||||
|
||||
private static EnumFacing getForward( IBlockState state )
|
||||
private static Direction getForward( BlockState state )
|
||||
{
|
||||
if( state instanceof IExtendedBlockState )
|
||||
{
|
||||
IExtendedBlockState extState = (IExtendedBlockState) state;
|
||||
EnumFacing forward = extState.getValue( BlockCraftingMonitor.FORWARD );
|
||||
Direction forward = extState.getValue( BlockCraftingMonitor.FORWARD );
|
||||
if( forward != null )
|
||||
{
|
||||
return forward;
|
||||
}
|
||||
}
|
||||
|
||||
return EnumFacing.NORTH;
|
||||
return Direction.NORTH;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
package appeng.client.render.crafting;
|
||||
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
|
||||
import appeng.client.render.cablebus.CubeBuilder;
|
||||
|
||||
@@ -42,7 +42,7 @@ class UnitBakedModel extends CraftingCubeBakedModel
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addInnerCube( EnumFacing facing, IBlockState state, CubeBuilder builder, float x1, float y1, float z1, float x2, float y2, float z2 )
|
||||
protected void addInnerCube( Direction facing, BlockState state, CubeBuilder builder, float x1, float y1, float z1, float x2, float y2, float z2 )
|
||||
{
|
||||
builder.setTexture( this.unitTexture );
|
||||
builder.addCube( x1, y1, z1, x2, y2, z2 );
|
||||
|
||||
@@ -26,14 +26,14 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.client.render.textures.ParticleTextures;
|
||||
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public class CraftingFx extends ParticleBreaking
|
||||
{
|
||||
|
||||
|
||||
@@ -26,14 +26,14 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.client.render.textures.ParticleTextures;
|
||||
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public class EnergyFx extends ParticleBreaking
|
||||
{
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -125,7 +125,7 @@ public class LightningFX extends Particle
|
||||
double oy = 0;
|
||||
double oz = 0;
|
||||
|
||||
final EntityPlayer p = Minecraft.getMinecraft().player;
|
||||
final PlayerEntity p = Minecraft.getInstance().player;
|
||||
double offX = -rZ;
|
||||
double offY = MathHelper.cos( (float) ( Math.PI / 2.0f + p.rotationPitch * 0.017453292F ) );
|
||||
double offZ = rX;
|
||||
|
||||
@@ -21,11 +21,11 @@ package appeng.client.render.effects;
|
||||
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public class VibrantFX extends Particle
|
||||
{
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
package appeng.client.render.model;
|
||||
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.util.Direction;
|
||||
|
||||
|
||||
/**
|
||||
@@ -28,12 +28,12 @@ import net.minecraft.util.EnumFacing;
|
||||
*/
|
||||
final class AutoRotatingCacheKey
|
||||
{
|
||||
private final IBlockState blockState;
|
||||
private final EnumFacing forward;
|
||||
private final EnumFacing up;
|
||||
private final EnumFacing side;
|
||||
private final BlockState blockState;
|
||||
private final Direction forward;
|
||||
private final Direction up;
|
||||
private final Direction side;
|
||||
|
||||
AutoRotatingCacheKey( IBlockState blockState, EnumFacing forward, EnumFacing up, EnumFacing side )
|
||||
AutoRotatingCacheKey( BlockState blockState, Direction forward, Direction up, Direction side )
|
||||
{
|
||||
this.blockState = blockState;
|
||||
this.forward = forward;
|
||||
@@ -41,22 +41,22 @@ final class AutoRotatingCacheKey
|
||||
this.side = side;
|
||||
}
|
||||
|
||||
public IBlockState getBlockState()
|
||||
public BlockState getBlockState()
|
||||
{
|
||||
return this.blockState;
|
||||
}
|
||||
|
||||
public EnumFacing getForward()
|
||||
public Direction getForward()
|
||||
{
|
||||
return this.forward;
|
||||
}
|
||||
|
||||
public EnumFacing getUp()
|
||||
public Direction getUp()
|
||||
{
|
||||
return this.up;
|
||||
}
|
||||
|
||||
public EnumFacing getSide()
|
||||
public Direction getSide()
|
||||
{
|
||||
return this.side;
|
||||
}
|
||||
|
||||
@@ -30,15 +30,15 @@ import com.google.common.cache.CacheBuilder;
|
||||
import com.google.common.cache.CacheLoader;
|
||||
import com.google.common.cache.LoadingCache;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormatElement;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
import net.minecraftforge.client.model.pipeline.IVertexConsumer;
|
||||
import net.minecraftforge.client.model.pipeline.QuadGatheringTransformer;
|
||||
@@ -69,7 +69,7 @@ public class AutoRotatingModel implements IBakedModel
|
||||
} );
|
||||
}
|
||||
|
||||
private List<BakedQuad> getRotatedModel( IBlockState state, EnumFacing side, EnumFacing forward, EnumFacing up )
|
||||
private List<BakedQuad> getRotatedModel( BlockState state, Direction side, Direction forward, Direction up )
|
||||
{
|
||||
FacingToRotation f2r = FacingToRotation.get( forward, up );
|
||||
List<BakedQuad> original = AutoRotatingModel.this.parent.getQuads( state, f2r.resultingRotate( side ), 0 );
|
||||
@@ -143,7 +143,7 @@ public class AutoRotatingModel implements IBakedModel
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getQuads( IBlockState state, EnumFacing side, long rand )
|
||||
public List<BakedQuad> getQuads( BlockState state, Direction side, long rand )
|
||||
{
|
||||
if( !( state instanceof IExtendedBlockState ) )
|
||||
{
|
||||
@@ -152,8 +152,8 @@ public class AutoRotatingModel implements IBakedModel
|
||||
|
||||
IExtendedBlockState extState = (IExtendedBlockState) state;
|
||||
|
||||
EnumFacing forward = extState.getValue( AEBaseTileBlock.FORWARD );
|
||||
EnumFacing up = extState.getValue( AEBaseTileBlock.UP );
|
||||
Direction forward = extState.getValue( AEBaseTileBlock.FORWARD );
|
||||
Direction up = extState.getValue( AEBaseTileBlock.UP );
|
||||
|
||||
if( forward == null || up == null )
|
||||
{
|
||||
@@ -177,9 +177,9 @@ public class AutoRotatingModel implements IBakedModel
|
||||
public static class VertexRotator extends QuadGatheringTransformer
|
||||
{
|
||||
private final FacingToRotation f2r;
|
||||
private final EnumFacing face;
|
||||
private final Direction face;
|
||||
|
||||
public VertexRotator( FacingToRotation f2r, EnumFacing face )
|
||||
public VertexRotator( FacingToRotation f2r, Direction face )
|
||||
{
|
||||
this.f2r = f2r;
|
||||
this.face = face;
|
||||
@@ -317,7 +317,7 @@ public class AutoRotatingModel implements IBakedModel
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setQuadOrientation( EnumFacing orientation )
|
||||
public void setQuadOrientation( Direction orientation )
|
||||
{
|
||||
this.parent.setQuadOrientation( orientation );
|
||||
}
|
||||
|
||||
@@ -17,16 +17,16 @@ import com.mojang.authlib.GameProfile;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
|
||||
@@ -74,7 +74,7 @@ class BiometricCardBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getQuads( @Nullable IBlockState state, @Nullable EnumFacing side, long rand )
|
||||
public List<BakedQuad> getQuads( @Nullable BlockState state, @Nullable Direction side, long rand )
|
||||
{
|
||||
|
||||
List<BakedQuad> quads = this.baseModel.getQuads( state, side, rand );
|
||||
@@ -171,7 +171,7 @@ class BiometricCardBakedModel implements IBakedModel
|
||||
return new ItemOverrideList( Collections.emptyList() )
|
||||
{
|
||||
@Override
|
||||
public IBakedModel handleItemState( IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity )
|
||||
public IBakedModel handleItemState( IBakedModel originalModel, ItemStack stack, World world, LivingEntity entity )
|
||||
{
|
||||
String username = "";
|
||||
if( stack.getItem() instanceof IBiometricCard )
|
||||
|
||||
@@ -23,8 +23,8 @@ import java.util.Map;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import net.minecraft.client.resources.IResourceManager;
|
||||
import net.minecraft.client.resources.IResourceManagerReloadListener;
|
||||
import net.minecraft.resources.IResourceManager;
|
||||
import net.minecraft.resources.IResourceManagerReloadListener;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.ICustomModelLoader;
|
||||
import net.minecraftforge.client.model.IModel;
|
||||
|
||||
@@ -13,13 +13,13 @@ import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.client.model.PerspectiveMapWrapper;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
|
||||
@@ -31,7 +31,7 @@ class ColorApplicatorBakedModel implements IBakedModel
|
||||
|
||||
private final ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transforms;
|
||||
|
||||
private final EnumMap<EnumFacing, List<BakedQuad>> quadsBySide;
|
||||
private final EnumMap<Direction, List<BakedQuad>> quadsBySide;
|
||||
|
||||
private final List<BakedQuad> generalQuads;
|
||||
|
||||
@@ -42,14 +42,14 @@ class ColorApplicatorBakedModel implements IBakedModel
|
||||
|
||||
// Put the tint indices in... Since this is an item model, we are ignoring rand
|
||||
this.generalQuads = this.fixQuadTint( null, texDark, texMedium, texBright );
|
||||
this.quadsBySide = new EnumMap<>( EnumFacing.class );
|
||||
for( EnumFacing facing : EnumFacing.values() )
|
||||
this.quadsBySide = new EnumMap<>( Direction.class );
|
||||
for( Direction facing : Direction.values() )
|
||||
{
|
||||
this.quadsBySide.put( facing, this.fixQuadTint( facing, texDark, texMedium, texBright ) );
|
||||
}
|
||||
}
|
||||
|
||||
private List<BakedQuad> fixQuadTint( EnumFacing facing, TextureAtlasSprite texDark, TextureAtlasSprite texMedium, TextureAtlasSprite texBright )
|
||||
private List<BakedQuad> fixQuadTint( Direction facing, TextureAtlasSprite texDark, TextureAtlasSprite texMedium, TextureAtlasSprite texBright )
|
||||
{
|
||||
List<BakedQuad> quads = this.baseModel.getQuads( null, facing, 0 );
|
||||
List<BakedQuad> result = new ArrayList<>( quads.size() );
|
||||
@@ -84,7 +84,7 @@ class ColorApplicatorBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getQuads( @Nullable IBlockState state, @Nullable EnumFacing side, long rand )
|
||||
public List<BakedQuad> getQuads( @Nullable BlockState state, @Nullable Direction side, long rand )
|
||||
{
|
||||
if( side == null )
|
||||
{
|
||||
|
||||
@@ -24,16 +24,16 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.vecmath.Matrix4f;
|
||||
import javax.vecmath.Vector3f;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.Matrix4f;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
|
||||
@@ -54,7 +54,7 @@ public class DriveBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getQuads( @Nullable IBlockState state, @Nullable EnumFacing side, long rand )
|
||||
public List<BakedQuad> getQuads( @Nullable BlockState state, @Nullable Direction side, long rand )
|
||||
{
|
||||
|
||||
List<BakedQuad> result = new ArrayList<>();
|
||||
|
||||
@@ -30,14 +30,14 @@ import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
@@ -98,7 +98,7 @@ class GlassBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getQuads( @Nullable IBlockState state, @Nullable EnumFacing side, long rand )
|
||||
public List<BakedQuad> getQuads( @Nullable BlockState state, @Nullable Direction side, long rand )
|
||||
{
|
||||
if( !( state instanceof IExtendedBlockState ) || side == null )
|
||||
{
|
||||
@@ -160,28 +160,28 @@ class GlassBakedModel implements IBakedModel
|
||||
/**
|
||||
* Creates the bitmask that indicates, in which directions (in terms of u,v space) a border should be drawn.
|
||||
*/
|
||||
private static int makeBitmask( GlassState state, EnumFacing side )
|
||||
private static int makeBitmask( GlassState state, Direction side )
|
||||
{
|
||||
switch( side )
|
||||
{
|
||||
case DOWN:
|
||||
return makeBitmask( state, EnumFacing.SOUTH, EnumFacing.EAST, EnumFacing.NORTH, EnumFacing.WEST );
|
||||
return makeBitmask( state, Direction.SOUTH, Direction.EAST, Direction.NORTH, Direction.WEST );
|
||||
case UP:
|
||||
return makeBitmask( state, EnumFacing.SOUTH, EnumFacing.WEST, EnumFacing.NORTH, EnumFacing.EAST );
|
||||
return makeBitmask( state, Direction.SOUTH, Direction.WEST, Direction.NORTH, Direction.EAST );
|
||||
case NORTH:
|
||||
return makeBitmask( state, EnumFacing.UP, EnumFacing.WEST, EnumFacing.DOWN, EnumFacing.EAST );
|
||||
return makeBitmask( state, Direction.UP, Direction.WEST, Direction.DOWN, Direction.EAST );
|
||||
case SOUTH:
|
||||
return makeBitmask( state, EnumFacing.UP, EnumFacing.EAST, EnumFacing.DOWN, EnumFacing.WEST );
|
||||
return makeBitmask( state, Direction.UP, Direction.EAST, Direction.DOWN, Direction.WEST );
|
||||
case WEST:
|
||||
return makeBitmask( state, EnumFacing.UP, EnumFacing.SOUTH, EnumFacing.DOWN, EnumFacing.NORTH );
|
||||
return makeBitmask( state, Direction.UP, Direction.SOUTH, Direction.DOWN, Direction.NORTH );
|
||||
case EAST:
|
||||
return makeBitmask( state, EnumFacing.UP, EnumFacing.NORTH, EnumFacing.DOWN, EnumFacing.SOUTH );
|
||||
return makeBitmask( state, Direction.UP, Direction.NORTH, Direction.DOWN, Direction.SOUTH );
|
||||
default:
|
||||
throw new IllegalArgumentException( "Unsupported side!" );
|
||||
}
|
||||
}
|
||||
|
||||
private static int makeBitmask( GlassState state, EnumFacing up, EnumFacing right, EnumFacing down, EnumFacing left )
|
||||
private static int makeBitmask( GlassState state, Direction up, Direction right, Direction down, Direction left )
|
||||
{
|
||||
|
||||
int bitmask = 0;
|
||||
@@ -205,12 +205,12 @@ class GlassBakedModel implements IBakedModel
|
||||
return bitmask;
|
||||
}
|
||||
|
||||
private BakedQuad createQuad( EnumFacing side, List<Vec3d> corners, TextureAtlasSprite sprite, float uOffset, float vOffset )
|
||||
private BakedQuad createQuad( Direction side, List<Vec3d> corners, TextureAtlasSprite sprite, float uOffset, float vOffset )
|
||||
{
|
||||
return this.createQuad( side, corners.get( 0 ), corners.get( 1 ), corners.get( 2 ), corners.get( 3 ), sprite, uOffset, vOffset );
|
||||
}
|
||||
|
||||
private BakedQuad createQuad( EnumFacing side, Vec3d c1, Vec3d c2, Vec3d c3, Vec3d c4, TextureAtlasSprite sprite, float uOffset, float vOffset )
|
||||
private BakedQuad createQuad( Direction side, Vec3d c1, Vec3d c2, Vec3d c3, Vec3d c4, TextureAtlasSprite sprite, float uOffset, float vOffset )
|
||||
{
|
||||
Vec3d normal = new Vec3d( side.getDirectionVec() );
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import javax.vecmath.Vector4f;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormatElement;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.client.model.pipeline.QuadGatheringTransformer;
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ final class MatrixVertexTransformer extends QuadGatheringTransformer
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setQuadOrientation( EnumFacing orientation )
|
||||
public void setQuadOrientation( Direction orientation )
|
||||
{
|
||||
this.parent.setQuadOrientation( orientation );
|
||||
}
|
||||
|
||||
@@ -17,16 +17,16 @@ import com.google.common.collect.ImmutableList;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
|
||||
@@ -78,7 +78,7 @@ class MemoryCardBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getQuads( @Nullable IBlockState state, @Nullable EnumFacing side, long rand )
|
||||
public List<BakedQuad> getQuads( @Nullable BlockState state, @Nullable Direction side, long rand )
|
||||
{
|
||||
|
||||
List<BakedQuad> quads = this.baseModel.getQuads( state, side, rand );
|
||||
@@ -150,7 +150,7 @@ class MemoryCardBakedModel implements IBakedModel
|
||||
return new ItemOverrideList( Collections.emptyList() )
|
||||
{
|
||||
@Override
|
||||
public IBakedModel handleItemState( IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity )
|
||||
public IBakedModel handleItemState( IBakedModel originalModel, ItemStack stack, World world, LivingEntity entity )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.List;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
|
||||
@@ -33,27 +33,27 @@ import net.minecraft.util.math.Vec3d;
|
||||
final class RenderHelper
|
||||
{
|
||||
|
||||
private static EnumMap<EnumFacing, List<Vec3d>> cornersForFacing = generateCornersForFacings();
|
||||
private static EnumMap<Direction, List<Vec3d>> cornersForFacing = generateCornersForFacings();
|
||||
|
||||
private RenderHelper()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static List<Vec3d> getFaceCorners( EnumFacing side )
|
||||
static List<Vec3d> getFaceCorners( Direction side )
|
||||
{
|
||||
return cornersForFacing.get( side );
|
||||
}
|
||||
|
||||
private static EnumMap<EnumFacing, List<Vec3d>> generateCornersForFacings()
|
||||
private static EnumMap<Direction, List<Vec3d>> generateCornersForFacings()
|
||||
{
|
||||
EnumMap<EnumFacing, List<Vec3d>> result = new EnumMap<>( EnumFacing.class );
|
||||
EnumMap<Direction, List<Vec3d>> result = new EnumMap<>( Direction.class );
|
||||
|
||||
for( EnumFacing facing : EnumFacing.values() )
|
||||
for( Direction facing : Direction.values() )
|
||||
{
|
||||
List<Vec3d> corners;
|
||||
|
||||
float offset = ( facing.getAxisDirection() == EnumFacing.AxisDirection.NEGATIVE ) ? 0 : 1;
|
||||
float offset = ( facing.getAxisDirection() == Direction.AxisDirection.NEGATIVE ) ? 0 : 1;
|
||||
|
||||
switch( facing.getAxis() )
|
||||
{
|
||||
@@ -69,7 +69,7 @@ final class RenderHelper
|
||||
break;
|
||||
}
|
||||
|
||||
if( facing.getAxisDirection() == EnumFacing.AxisDirection.NEGATIVE )
|
||||
if( facing.getAxisDirection() == Direction.AxisDirection.NEGATIVE )
|
||||
{
|
||||
corners = Lists.reverse( corners );
|
||||
}
|
||||
@@ -80,7 +80,7 @@ final class RenderHelper
|
||||
return result;
|
||||
}
|
||||
|
||||
private static Vec3d adjust( Vec3d vec, EnumFacing.Axis axis, double delta )
|
||||
private static Vec3d adjust( Vec3d vec, Direction.Axis axis, double delta )
|
||||
{
|
||||
switch( axis )
|
||||
{
|
||||
|
||||
@@ -25,19 +25,19 @@ import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.vecmath.AxisAngle4f;
|
||||
import javax.vecmath.Matrix4f;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.entity.EntityPlayerSP;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.entity.PlayerEntitySP;
|
||||
import net.minecraft.client.renderer.Matrix4f;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad;
|
||||
@@ -68,7 +68,7 @@ public class SkyCompassBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getQuads( @Nullable IBlockState state, @Nullable EnumFacing side, long rand )
|
||||
public List<BakedQuad> getQuads( @Nullable BlockState state, @Nullable Direction side, long rand )
|
||||
{
|
||||
float rotation = 0;
|
||||
// Get rotation from the special block state
|
||||
@@ -159,11 +159,11 @@ public class SkyCompassBakedModel implements IBakedModel
|
||||
{
|
||||
|
||||
@Override
|
||||
public IBakedModel handleItemState( IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity )
|
||||
public IBakedModel handleItemState( IBakedModel originalModel, ItemStack stack, World world, LivingEntity entity )
|
||||
{
|
||||
if( world != null && entity instanceof EntityPlayerSP )
|
||||
if( world != null && entity instanceof PlayerEntitySP )
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
PlayerEntity player = (PlayerEntity) entity;
|
||||
|
||||
float offRads = (float) ( player.rotationYaw / 180.0f * (float) Math.PI + Math.PI );
|
||||
|
||||
|
||||
@@ -48,27 +48,26 @@ import com.google.gson.JsonParseException;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.lwjgl.util.vector.Vector3f;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.BlockFaceUV;
|
||||
import net.minecraft.client.renderer.block.model.BlockPart;
|
||||
import net.minecraft.client.renderer.block.model.BlockPartFace;
|
||||
import net.minecraft.client.renderer.block.model.BlockPartRotation;
|
||||
import net.minecraft.client.renderer.block.model.FaceBakery;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverride;
|
||||
import net.minecraft.client.renderer.block.model.ItemTransformVec3f;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.client.renderer.block.model.ModelBlock;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.model.BlockFaceUV;
|
||||
import net.minecraft.client.renderer.model.BlockPart;
|
||||
import net.minecraft.client.renderer.model.BlockPartFace;
|
||||
import net.minecraft.client.renderer.model.BlockPartRotation;
|
||||
import net.minecraft.client.renderer.model.FaceBakery;
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.model.ItemOverride;
|
||||
import net.minecraft.client.renderer.model.ItemTransformVec3f;
|
||||
import net.minecraft.client.renderer.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.client.resources.IResource;
|
||||
import net.minecraft.client.resources.IResourceManager;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.JsonUtils;
|
||||
import net.minecraft.resources.IResource;
|
||||
import net.minecraft.resources.IResourceManager;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.ICustomModelLoader;
|
||||
import net.minecraftforge.client.model.IModel;
|
||||
@@ -191,7 +190,7 @@ public enum UVLModelLoader implements ICustomModelLoader
|
||||
modelPath = modelPath.substring( "models/".length() );
|
||||
}
|
||||
|
||||
try( InputStreamReader io = new InputStreamReader( Minecraft.getMinecraft()
|
||||
try( InputStreamReader io = new InputStreamReader( Minecraft.getInstance()
|
||||
.getResourceManager()
|
||||
.getResource( new ResourceLocation( modelLocation.getResourceDomain(), "models/" + modelPath + ".json" ) )
|
||||
.getInputStream() ) )
|
||||
@@ -246,7 +245,7 @@ public enum UVLModelLoader implements ICustomModelLoader
|
||||
{
|
||||
String s = modelLocation.getResourcePath();
|
||||
|
||||
iresource = Minecraft.getMinecraft()
|
||||
iresource = Minecraft.getInstance()
|
||||
.getResourceManager()
|
||||
.getResource(
|
||||
new ResourceLocation( modelLocation.getResourceDomain(), "models/" + modelPath + ".json" ) );
|
||||
@@ -304,11 +303,11 @@ public enum UVLModelLoader implements ICustomModelLoader
|
||||
public BlockPartFace deserialize( JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_ ) throws JsonParseException
|
||||
{
|
||||
JsonObject jsonobject = p_deserialize_1_.getAsJsonObject();
|
||||
EnumFacing enumfacing = this.parseCullFace( jsonobject );
|
||||
Direction Direction = this.parseCullFace( jsonobject );
|
||||
int i = this.parseTintIndex( jsonobject );
|
||||
String s = this.parseTexture( jsonobject );
|
||||
BlockFaceUV blockfaceuv = (BlockFaceUV) p_deserialize_3_.deserialize( jsonobject, BlockFaceUV.class );
|
||||
BlockPartFace blockFace = new BlockPartFace( enumfacing, i, s, blockfaceuv );
|
||||
BlockPartFace blockFace = new BlockPartFace( Direction, i, s, blockfaceuv );
|
||||
UVLModelWrapper.this.uvlightmap.put( blockFace, this.parseUVL( jsonobject ) );
|
||||
return blockFace;
|
||||
}
|
||||
@@ -324,10 +323,10 @@ public enum UVLModelLoader implements ICustomModelLoader
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private EnumFacing parseCullFace( JsonObject object )
|
||||
private Direction parseCullFace( JsonObject object )
|
||||
{
|
||||
String s = JsonUtils.getString( object, "cullface", "" );
|
||||
return EnumFacing.byName( s );
|
||||
return Direction.byName( s );
|
||||
}
|
||||
|
||||
protected Pair<Float, Float> parseUVL( JsonObject object )
|
||||
@@ -345,7 +344,7 @@ public enum UVLModelLoader implements ICustomModelLoader
|
||||
{
|
||||
|
||||
@Override
|
||||
public BakedQuad makeBakedQuad( Vector3f posFrom, Vector3f posTo, BlockPartFace face, TextureAtlasSprite sprite, EnumFacing facing, ITransformation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade )
|
||||
public BakedQuad makeBakedQuad( Vector3f posFrom, Vector3f posTo, BlockPartFace face, TextureAtlasSprite sprite, Direction facing, ITransformation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade )
|
||||
{
|
||||
BakedQuad quad = super.makeBakedQuad( posFrom, posTo, face, sprite, facing, modelRotationIn, partRotation, uvLocked, shade );
|
||||
|
||||
@@ -354,7 +353,7 @@ public enum UVLModelLoader implements ICustomModelLoader
|
||||
{
|
||||
VertexFormat newFormat = VertexFormats.getFormatWithLightMap( quad.getFormat() );
|
||||
UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder( newFormat );
|
||||
VertexLighterFlat trans = new VertexLighterFlat( Minecraft.getMinecraft().getBlockColors() )
|
||||
VertexLighterFlat trans = new VertexLighterFlat( Minecraft.getInstance().getBlockColors() )
|
||||
{
|
||||
|
||||
@Override
|
||||
|
||||
@@ -58,7 +58,7 @@ public class ItemRenderable<T extends TileEntity> implements Renderable<T>
|
||||
matrix.flip();
|
||||
GlStateManager.multMatrix( matrix );
|
||||
}
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem( pair.getLeft(), TransformType.GROUND );
|
||||
Minecraft.getInstance().getRenderItem().renderItem( pair.getLeft(), TransformType.GROUND );
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,14 +26,14 @@ import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
|
||||
import appeng.block.spatial.BlockSpatialPylon;
|
||||
@@ -58,7 +58,7 @@ class SpatialPylonBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getQuads( @Nullable IBlockState state, @Nullable EnumFacing side, long rand )
|
||||
public List<BakedQuad> getQuads( @Nullable BlockState state, @Nullable Direction side, long rand )
|
||||
{
|
||||
int flags = this.getFlags( state );
|
||||
|
||||
@@ -66,75 +66,75 @@ class SpatialPylonBakedModel implements IBakedModel
|
||||
|
||||
if( flags != 0 )
|
||||
{
|
||||
EnumFacing ori = null;
|
||||
Direction ori = null;
|
||||
int displayAxis = flags & TileSpatialPylon.DISPLAY_Z;
|
||||
if( displayAxis == TileSpatialPylon.DISPLAY_X )
|
||||
{
|
||||
ori = EnumFacing.EAST;
|
||||
ori = Direction.EAST;
|
||||
|
||||
if( ( flags & TileSpatialPylon.DISPLAY_MIDDLE ) == TileSpatialPylon.DISPLAY_END_MAX )
|
||||
{
|
||||
builder.setUvRotation( EnumFacing.SOUTH, 1 );
|
||||
builder.setUvRotation( EnumFacing.NORTH, 1 );
|
||||
builder.setUvRotation( EnumFacing.UP, 2 );
|
||||
builder.setUvRotation( EnumFacing.DOWN, 2 );
|
||||
builder.setUvRotation( Direction.SOUTH, 1 );
|
||||
builder.setUvRotation( Direction.NORTH, 1 );
|
||||
builder.setUvRotation( Direction.UP, 2 );
|
||||
builder.setUvRotation( Direction.DOWN, 2 );
|
||||
}
|
||||
else if( ( flags & TileSpatialPylon.DISPLAY_MIDDLE ) == TileSpatialPylon.DISPLAY_END_MIN )
|
||||
{
|
||||
builder.setUvRotation( EnumFacing.SOUTH, 2 );
|
||||
builder.setUvRotation( EnumFacing.NORTH, 2 );
|
||||
builder.setUvRotation( EnumFacing.UP, 1 );
|
||||
builder.setUvRotation( EnumFacing.DOWN, 1 );
|
||||
builder.setUvRotation( Direction.SOUTH, 2 );
|
||||
builder.setUvRotation( Direction.NORTH, 2 );
|
||||
builder.setUvRotation( Direction.UP, 1 );
|
||||
builder.setUvRotation( Direction.DOWN, 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.setUvRotation( EnumFacing.SOUTH, 1 );
|
||||
builder.setUvRotation( EnumFacing.NORTH, 1 );
|
||||
builder.setUvRotation( EnumFacing.UP, 1 );
|
||||
builder.setUvRotation( EnumFacing.DOWN, 1 );
|
||||
builder.setUvRotation( Direction.SOUTH, 1 );
|
||||
builder.setUvRotation( Direction.NORTH, 1 );
|
||||
builder.setUvRotation( Direction.UP, 1 );
|
||||
builder.setUvRotation( Direction.DOWN, 1 );
|
||||
}
|
||||
}
|
||||
|
||||
else if( displayAxis == TileSpatialPylon.DISPLAY_Y )
|
||||
{
|
||||
ori = EnumFacing.UP;
|
||||
ori = Direction.UP;
|
||||
if( ( flags & TileSpatialPylon.DISPLAY_MIDDLE ) == TileSpatialPylon.DISPLAY_END_MAX )
|
||||
{
|
||||
builder.setUvRotation( EnumFacing.NORTH, 3 );
|
||||
builder.setUvRotation( EnumFacing.SOUTH, 3 );
|
||||
builder.setUvRotation( EnumFacing.EAST, 3 );
|
||||
builder.setUvRotation( EnumFacing.WEST, 3 );
|
||||
builder.setUvRotation( Direction.NORTH, 3 );
|
||||
builder.setUvRotation( Direction.SOUTH, 3 );
|
||||
builder.setUvRotation( Direction.EAST, 3 );
|
||||
builder.setUvRotation( Direction.WEST, 3 );
|
||||
}
|
||||
}
|
||||
|
||||
else if( displayAxis == TileSpatialPylon.DISPLAY_Z )
|
||||
{
|
||||
ori = EnumFacing.NORTH;
|
||||
ori = Direction.NORTH;
|
||||
if( ( flags & TileSpatialPylon.DISPLAY_MIDDLE ) == TileSpatialPylon.DISPLAY_END_MAX )
|
||||
{
|
||||
builder.setUvRotation( EnumFacing.EAST, 2 );
|
||||
builder.setUvRotation( EnumFacing.WEST, 1 );
|
||||
builder.setUvRotation( Direction.EAST, 2 );
|
||||
builder.setUvRotation( Direction.WEST, 1 );
|
||||
}
|
||||
else if( ( flags & TileSpatialPylon.DISPLAY_MIDDLE ) == TileSpatialPylon.DISPLAY_END_MIN )
|
||||
{
|
||||
builder.setUvRotation( EnumFacing.EAST, 1 );
|
||||
builder.setUvRotation( EnumFacing.WEST, 2 );
|
||||
builder.setUvRotation( EnumFacing.UP, 3 );
|
||||
builder.setUvRotation( EnumFacing.DOWN, 3 );
|
||||
builder.setUvRotation( Direction.EAST, 1 );
|
||||
builder.setUvRotation( Direction.WEST, 2 );
|
||||
builder.setUvRotation( Direction.UP, 3 );
|
||||
builder.setUvRotation( Direction.DOWN, 3 );
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.setUvRotation( EnumFacing.EAST, 1 );
|
||||
builder.setUvRotation( EnumFacing.WEST, 2 );
|
||||
builder.setUvRotation( Direction.EAST, 1 );
|
||||
builder.setUvRotation( Direction.WEST, 2 );
|
||||
}
|
||||
}
|
||||
|
||||
builder.setTextures( this.textures.get( getTextureTypeFromSideOutside( flags, ori, EnumFacing.UP ) ),
|
||||
this.textures.get( getTextureTypeFromSideOutside( flags, ori, EnumFacing.DOWN ) ),
|
||||
this.textures.get( getTextureTypeFromSideOutside( flags, ori, EnumFacing.NORTH ) ),
|
||||
this.textures.get( getTextureTypeFromSideOutside( flags, ori, EnumFacing.SOUTH ) ),
|
||||
this.textures.get( getTextureTypeFromSideOutside( flags, ori, EnumFacing.EAST ) ),
|
||||
this.textures.get( getTextureTypeFromSideOutside( flags, ori, EnumFacing.WEST ) ) );
|
||||
builder.setTextures( this.textures.get( getTextureTypeFromSideOutside( flags, ori, Direction.UP ) ),
|
||||
this.textures.get( getTextureTypeFromSideOutside( flags, ori, Direction.DOWN ) ),
|
||||
this.textures.get( getTextureTypeFromSideOutside( flags, ori, Direction.NORTH ) ),
|
||||
this.textures.get( getTextureTypeFromSideOutside( flags, ori, Direction.SOUTH ) ),
|
||||
this.textures.get( getTextureTypeFromSideOutside( flags, ori, Direction.EAST ) ),
|
||||
this.textures.get( getTextureTypeFromSideOutside( flags, ori, Direction.WEST ) ) );
|
||||
builder.addCube( 0, 0, 0, 16, 16, 16 );
|
||||
|
||||
if( ( flags & TileSpatialPylon.DISPLAY_POWERED_ENABLED ) == TileSpatialPylon.DISPLAY_POWERED_ENABLED )
|
||||
@@ -142,12 +142,12 @@ class SpatialPylonBakedModel implements IBakedModel
|
||||
builder.setRenderFullBright( true );
|
||||
}
|
||||
|
||||
builder.setTextures( this.textures.get( getTextureTypeFromSideInside( flags, ori, EnumFacing.UP ) ),
|
||||
this.textures.get( getTextureTypeFromSideInside( flags, ori, EnumFacing.DOWN ) ),
|
||||
this.textures.get( getTextureTypeFromSideInside( flags, ori, EnumFacing.NORTH ) ),
|
||||
this.textures.get( getTextureTypeFromSideInside( flags, ori, EnumFacing.SOUTH ) ),
|
||||
this.textures.get( getTextureTypeFromSideInside( flags, ori, EnumFacing.EAST ) ),
|
||||
this.textures.get( getTextureTypeFromSideInside( flags, ori, EnumFacing.WEST ) ) );
|
||||
builder.setTextures( this.textures.get( getTextureTypeFromSideInside( flags, ori, Direction.UP ) ),
|
||||
this.textures.get( getTextureTypeFromSideInside( flags, ori, Direction.DOWN ) ),
|
||||
this.textures.get( getTextureTypeFromSideInside( flags, ori, Direction.NORTH ) ),
|
||||
this.textures.get( getTextureTypeFromSideInside( flags, ori, Direction.SOUTH ) ),
|
||||
this.textures.get( getTextureTypeFromSideInside( flags, ori, Direction.EAST ) ),
|
||||
this.textures.get( getTextureTypeFromSideInside( flags, ori, Direction.WEST ) ) );
|
||||
builder.addCube( 0, 0, 0, 16, 16, 16 );
|
||||
}
|
||||
else
|
||||
@@ -162,7 +162,7 @@ class SpatialPylonBakedModel implements IBakedModel
|
||||
return builder.getOutput();
|
||||
}
|
||||
|
||||
private int getFlags( IBlockState state )
|
||||
private int getFlags( BlockState state )
|
||||
{
|
||||
if( !( state instanceof IExtendedBlockState ) )
|
||||
{
|
||||
@@ -174,7 +174,7 @@ class SpatialPylonBakedModel implements IBakedModel
|
||||
return extState.getValue( BlockSpatialPylon.STATE );
|
||||
}
|
||||
|
||||
private static SpatialPylonTextureType getTextureTypeFromSideOutside( int flags, EnumFacing ori, EnumFacing dir )
|
||||
private static SpatialPylonTextureType getTextureTypeFromSideOutside( int flags, Direction ori, Direction dir )
|
||||
{
|
||||
if( ori == dir || ori.getOpposite() == dir )
|
||||
{
|
||||
@@ -197,7 +197,7 @@ class SpatialPylonBakedModel implements IBakedModel
|
||||
return SpatialPylonTextureType.BASE;
|
||||
}
|
||||
|
||||
private static SpatialPylonTextureType getTextureTypeFromSideInside( int flags, EnumFacing ori, EnumFacing dir )
|
||||
private static SpatialPylonTextureType getTextureTypeFromSideInside( int flags, Direction ori, Direction dir )
|
||||
{
|
||||
final boolean good = ( flags & TileSpatialPylon.DISPLAY_ENABLED ) == TileSpatialPylon.DISPLAY_ENABLED;
|
||||
|
||||
|
||||
@@ -24,11 +24,11 @@ import java.util.Map;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.bootstrap.BlockRenderingCustomizer;
|
||||
import appeng.bootstrap.IBlockRendering;
|
||||
@@ -42,14 +42,14 @@ public class SpatialPylonRendering extends BlockRenderingCustomizer
|
||||
private static final ResourceLocation MODEL_ID = new ResourceLocation( AppEng.MOD_ID, "models/blocks/spatial_pylon/builtin" );
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
|
||||
{
|
||||
rendering.builtInModel( MODEL_ID.getResourcePath(), new SpatialPylonModel() );
|
||||
rendering.stateMapper( this::mapState );
|
||||
}
|
||||
|
||||
private Map<IBlockState, ModelResourceLocation> mapState( Block block )
|
||||
private Map<BlockState, ModelResourceLocation> mapState( Block block )
|
||||
{
|
||||
return ImmutableMap.of( block.getDefaultState(), new ModelResourceLocation( MODEL_ID, "normal" ) );
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ package appeng.client.render.tesr;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BlockRendererDispatcher;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
@@ -32,8 +32,8 @@ import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.client.render.FacingToRotation;
|
||||
import appeng.tile.grindstone.TileCrank;
|
||||
@@ -43,7 +43,7 @@ import appeng.tile.grindstone.TileCrank;
|
||||
* This FastTESR only handles the animated model of the turning crank. When the crank is at rest, it is rendered using a
|
||||
* normal model.
|
||||
*/
|
||||
@SideOnly( Side.CLIENT )
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public class CrankTESR extends TileEntitySpecialRenderer<TileCrank>
|
||||
{
|
||||
|
||||
@@ -67,9 +67,9 @@ public class CrankTESR extends TileEntitySpecialRenderer<TileCrank>
|
||||
GlStateManager.shadeModel( GL11.GL_FLAT );
|
||||
}
|
||||
|
||||
IBlockState blockState = te.getWorld().getBlockState( te.getPos() );
|
||||
BlockState blockState = te.getWorld().getBlockState( te.getPos() );
|
||||
|
||||
BlockRendererDispatcher dispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
|
||||
BlockRendererDispatcher dispatcher = Minecraft.getInstance().getBlockRendererDispatcher();
|
||||
IBakedModel model = dispatcher.getModelForState( blockState );
|
||||
|
||||
BufferBuilder buffer = tessellator.getBuffer();
|
||||
|
||||
@@ -14,7 +14,7 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
@@ -56,7 +56,7 @@ public final class InscriberTESR extends TileEntitySpecialRenderer<TileInscriber
|
||||
|
||||
// render sides of stamps
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
mc.renderEngine.bindTexture( TextureMap.LOCATION_BLOCKS_TEXTURE );
|
||||
|
||||
// << 20 | light << 4;
|
||||
@@ -187,12 +187,12 @@ public final class InscriberTESR extends TileEntitySpecialRenderer<TileInscriber
|
||||
GlStateManager.scale( ITEM_RENDER_SCALE, ITEM_RENDER_SCALE, ITEM_RENDER_SCALE );
|
||||
|
||||
// heuristic to scale items down much further than blocks
|
||||
if( !( sis.getItem() instanceof ItemBlock ) )
|
||||
if( !( sis.getItem() instanceof BlockItem ) )
|
||||
{
|
||||
GlStateManager.scale( 0.5, 0.5, 0.5 );
|
||||
}
|
||||
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem( sis, ItemCameraTransforms.TransformType.FIXED );
|
||||
Minecraft.getInstance().getRenderItem().renderItem( sis, ItemCameraTransforms.TransformType.FIXED );
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,30 +19,34 @@
|
||||
package appeng.client.render.tesr;
|
||||
|
||||
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.client.render.FacingToRotation;
|
||||
import appeng.client.render.renderable.Renderable;
|
||||
import appeng.tile.AEBaseTile;
|
||||
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public class ModularTESR<T extends AEBaseTile> extends TileEntitySpecialRenderer<T>
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public class ModularTESR<T extends AEBaseTile> extends TileEntityRenderer<T>
|
||||
{
|
||||
|
||||
private final Renderable[] renderables;
|
||||
|
||||
public ModularTESR( Renderable... renderables )
|
||||
public ModularTESR( TileEntityRendererDispatcher rendererDispatcherIn, Renderable... renderables )
|
||||
{
|
||||
super( rendererDispatcherIn );
|
||||
this.renderables = renderables;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render( T te, double x, double y, double z, float partialTicks, int destroyStage, float p_render_10_ )
|
||||
public void render( T te, float partialTicks, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn )
|
||||
{
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate( x, y, z );
|
||||
@@ -56,19 +60,4 @@ public class ModularTESR<T extends AEBaseTile> extends TileEntitySpecialRenderer
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityFast( T te, double x, double y, double z, float partialTicks, int destroyStage, float p_render_10_, BufferBuilder buffer )
|
||||
{
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate( x, y, z );
|
||||
GlStateManager.translate( 0.5, 0.5, 0.5 );
|
||||
FacingToRotation.get( te.getForward(), te.getUp() ).glRotateCurrentMat();
|
||||
GlStateManager.translate( -0.5, -0.5, -0.5 );
|
||||
for( Renderable renderable : this.renderables )
|
||||
{
|
||||
renderable.renderTileEntityFast( te, x, y, z, partialTicks, destroyStage, buffer );
|
||||
}
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,10 +23,10 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.client.model.ModelChest;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.block.storage.BlockSkyChest;
|
||||
import appeng.block.storage.BlockSkyChest.SkyChestType;
|
||||
@@ -35,7 +35,7 @@ import appeng.core.AppEng;
|
||||
import appeng.tile.storage.TileSkyChest;
|
||||
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public class SkyChestTESR extends TileEntitySpecialRenderer<TileSkyChest>
|
||||
{
|
||||
|
||||
@@ -84,23 +84,23 @@ public class SkyChestTESR extends TileEntitySpecialRenderer<TileSkyChest>
|
||||
{
|
||||
GlStateManager.translate( 0.5F, 0.5F, 0.5F );
|
||||
// In the vanilla chest model, north and south are flipped
|
||||
EnumFacing forward = te.getForward();
|
||||
EnumFacing up = te.getUp();
|
||||
if( forward == EnumFacing.SOUTH )
|
||||
Direction forward = te.getForward();
|
||||
Direction up = te.getUp();
|
||||
if( forward == Direction.SOUTH )
|
||||
{
|
||||
forward = EnumFacing.NORTH;
|
||||
forward = Direction.NORTH;
|
||||
}
|
||||
else if( forward == EnumFacing.NORTH )
|
||||
else if( forward == Direction.NORTH )
|
||||
{
|
||||
forward = EnumFacing.SOUTH;
|
||||
forward = Direction.SOUTH;
|
||||
}
|
||||
if( up == EnumFacing.SOUTH )
|
||||
if( up == Direction.SOUTH )
|
||||
{
|
||||
up = EnumFacing.NORTH;
|
||||
up = Direction.NORTH;
|
||||
}
|
||||
else if( up == EnumFacing.NORTH )
|
||||
else if( up == Direction.NORTH )
|
||||
{
|
||||
up = EnumFacing.SOUTH;
|
||||
up = Direction.SOUTH;
|
||||
}
|
||||
FacingToRotation.get( forward, up ).glRotateCurrentMat();
|
||||
GlStateManager.translate( -0.5F, -0.5F, -0.5F );
|
||||
|
||||
@@ -19,20 +19,20 @@
|
||||
package appeng.client.render.tesr;
|
||||
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BlockRendererDispatcher;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.client.model.animation.FastTESR;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
import net.minecraftforge.common.property.Properties;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.block.misc.BlockSkyCompass;
|
||||
@@ -40,7 +40,7 @@ import appeng.client.render.model.SkyCompassBakedModel;
|
||||
import appeng.tile.misc.TileSkyCompass;
|
||||
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public class SkyCompassTESR extends FastTESR<TileSkyCompass>
|
||||
{
|
||||
|
||||
@@ -57,12 +57,12 @@ public class SkyCompassTESR extends FastTESR<TileSkyCompass>
|
||||
|
||||
if( blockRenderer == null )
|
||||
{
|
||||
blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher();
|
||||
blockRenderer = Minecraft.getInstance().getBlockRendererDispatcher();
|
||||
}
|
||||
|
||||
BlockPos pos = te.getPos();
|
||||
IBlockAccess world = MinecraftForgeClient.getRegionRenderCache( te.getWorld(), pos );
|
||||
IBlockState state = world.getBlockState( pos );
|
||||
IBlockReader world = MinecraftForgeClient.getRegionRenderCache( te.getWorld(), pos );
|
||||
BlockState state = world.getBlockState( pos );
|
||||
if( state.getPropertyKeys().contains( Properties.StaticProperty ) )
|
||||
{
|
||||
state = state.withProperty( Properties.StaticProperty, false );
|
||||
@@ -76,13 +76,13 @@ public class SkyCompassTESR extends FastTESR<TileSkyCompass>
|
||||
exState = exState.withProperty( BlockSkyCompass.ROTATION, getRotation( te ) );
|
||||
|
||||
// Flip forward/up for rendering, the base model is facing up without any rotation
|
||||
EnumFacing forward = exState.getValue( AEBaseTileBlock.FORWARD );
|
||||
EnumFacing up = exState.getValue( AEBaseTileBlock.UP );
|
||||
Direction forward = exState.getValue( AEBaseTileBlock.FORWARD );
|
||||
Direction up = exState.getValue( AEBaseTileBlock.UP );
|
||||
// This ensures the needle isn't flipped by the model rotator. Since the model is symmetrical, this should
|
||||
// not affect the appearance
|
||||
if( forward == EnumFacing.UP || forward == EnumFacing.DOWN )
|
||||
if( forward == Direction.UP || forward == Direction.DOWN )
|
||||
{
|
||||
up = EnumFacing.NORTH;
|
||||
up = Direction.NORTH;
|
||||
}
|
||||
exState = exState.withProperty( AEBaseTileBlock.FORWARD, up )
|
||||
.withProperty( AEBaseTileBlock.UP, forward );
|
||||
@@ -97,7 +97,7 @@ public class SkyCompassTESR extends FastTESR<TileSkyCompass>
|
||||
{
|
||||
float rotation;
|
||||
|
||||
if( skyCompass.getForward() == EnumFacing.UP || skyCompass.getForward() == EnumFacing.DOWN )
|
||||
if( skyCompass.getForward() == Direction.UP || skyCompass.getForward() == Direction.DOWN )
|
||||
{
|
||||
rotation = SkyCompassBakedModel.getAnimatedRotation( skyCompass.getPos(), false );
|
||||
}
|
||||
@@ -106,7 +106,7 @@ public class SkyCompassTESR extends FastTESR<TileSkyCompass>
|
||||
rotation = SkyCompassBakedModel.getAnimatedRotation( null, false );
|
||||
}
|
||||
|
||||
if( skyCompass.getForward() == EnumFacing.DOWN )
|
||||
if( skyCompass.getForward() == Direction.DOWN )
|
||||
{
|
||||
rotation = flipidiy( rotation );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user