aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/render/GT_Renderer_Block.java
diff options
context:
space:
mode:
authorRaven Szewczyk <git@eigenraven.me>2022-08-27 10:19:57 +0100
committerGitHub <noreply@github.com>2022-08-27 11:19:57 +0200
commit6f31720697bcc351421a4d86ba3bf749375dd12c (patch)
tree3adf8f318f22c892d74cd7c9d30b6dd3f11f11bd /src/main/java/gregtech/common/render/GT_Renderer_Block.java
parentc3eac50decd33ee2be8703dfb2ecf9cdc31c2b67 (diff)
downloadGT5-Unofficial-6f31720697bcc351421a4d86ba3bf749375dd12c.tar.gz
GT5-Unofficial-6f31720697bcc351421a4d86ba3bf749375dd12c.tar.bz2
GT5-Unofficial-6f31720697bcc351421a4d86ba3bf749375dd12c.zip
Update buildscript & apply spotless (#1306)
* Update dependencies * Update buildscript, apply spotless
Diffstat (limited to 'src/main/java/gregtech/common/render/GT_Renderer_Block.java')
-rw-r--r--src/main/java/gregtech/common/render/GT_Renderer_Block.java526
1 files changed, 423 insertions, 103 deletions
diff --git a/src/main/java/gregtech/common/render/GT_Renderer_Block.java b/src/main/java/gregtech/common/render/GT_Renderer_Block.java
index ef8748064f..5831c76bf4 100644
--- a/src/main/java/gregtech/common/render/GT_Renderer_Block.java
+++ b/src/main/java/gregtech/common/render/GT_Renderer_Block.java
@@ -1,5 +1,26 @@
package gregtech.common.render;
+import static gregtech.api.enums.GT_Values.ALL_VALID_SIDES;
+import static gregtech.api.enums.GT_Values.OFFX;
+import static gregtech.api.enums.GT_Values.OFFY;
+import static gregtech.api.enums.GT_Values.OFFZ;
+import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_DOWN;
+import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_EAST;
+import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_NORTH;
+import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_SOUTH;
+import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_UP;
+import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_WEST;
+import static gregtech.api.interfaces.metatileentity.IConnectable.HAS_FRESHFOAM;
+import static gregtech.api.interfaces.metatileentity.IConnectable.HAS_HARDENEDFOAM;
+import static gregtech.api.interfaces.metatileentity.IConnectable.NO_CONNECTION;
+import static net.minecraftforge.common.util.ForgeDirection.DOWN;
+import static net.minecraftforge.common.util.ForgeDirection.EAST;
+import static net.minecraftforge.common.util.ForgeDirection.NORTH;
+import static net.minecraftforge.common.util.ForgeDirection.SOUTH;
+import static net.minecraftforge.common.util.ForgeDirection.UP;
+import static net.minecraftforge.common.util.ForgeDirection.VALID_DIRECTIONS;
+import static net.minecraftforge.common.util.ForgeDirection.WEST;
+
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.relauncher.Side;
@@ -25,33 +46,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-
import org.lwjgl.opengl.GL11;
-import java.util.Arrays;
-import java.util.Collections;
-
-import static gregtech.api.enums.GT_Values.ALL_VALID_SIDES;
-import static gregtech.api.enums.GT_Values.OFFX;
-import static gregtech.api.enums.GT_Values.OFFY;
-import static gregtech.api.enums.GT_Values.OFFZ;
-import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_DOWN;
-import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_EAST;
-import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_NORTH;
-import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_SOUTH;
-import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_UP;
-import static gregtech.api.interfaces.metatileentity.IConnectable.CONNECTED_WEST;
-import static gregtech.api.interfaces.metatileentity.IConnectable.HAS_FRESHFOAM;
-import static gregtech.api.interfaces.metatileentity.IConnectable.HAS_HARDENEDFOAM;
-import static gregtech.api.interfaces.metatileentity.IConnectable.NO_CONNECTION;
-import static net.minecraftforge.common.util.ForgeDirection.DOWN;
-import static net.minecraftforge.common.util.ForgeDirection.EAST;
-import static net.minecraftforge.common.util.ForgeDirection.NORTH;
-import static net.minecraftforge.common.util.ForgeDirection.SOUTH;
-import static net.minecraftforge.common.util.ForgeDirection.UP;
-import static net.minecraftforge.common.util.ForgeDirection.VALID_DIRECTIONS;
-import static net.minecraftforge.common.util.ForgeDirection.WEST;
-
public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
public static final float blockMin = 0.0F;
public static final float blockMax = 1.0F;
@@ -67,31 +63,34 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
RenderingRegistry.registerBlockHandler(this);
}
- public static boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) {
+ public static boolean renderStandardBlock(
+ IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) {
final TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if ((tTileEntity instanceof IPipeRenderedTileEntity)) {
- return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer, new ITexture[][]{
- ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) DOWN.ordinal()),
- ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) UP.ordinal()),
- ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) NORTH.ordinal()),
- ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) SOUTH.ordinal()),
- ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) WEST.ordinal()),
- ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) EAST.ordinal())});
+ return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer, new ITexture[][] {
+ ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) DOWN.ordinal()),
+ ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) UP.ordinal()),
+ ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) NORTH.ordinal()),
+ ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) SOUTH.ordinal()),
+ ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) WEST.ordinal()),
+ ((IPipeRenderedTileEntity) tTileEntity).getTextureCovered((byte) EAST.ordinal())
+ });
}
if ((tTileEntity instanceof ITexturedTileEntity)) {
- return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer, new ITexture[][]{
- ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) DOWN.ordinal()),
- ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) UP.ordinal()),
- ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) NORTH.ordinal()),
- ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) SOUTH.ordinal()),
- ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) WEST.ordinal()),
- ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) EAST.ordinal())}
- );
+ return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer, new ITexture[][] {
+ ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) DOWN.ordinal()),
+ ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) UP.ordinal()),
+ ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) NORTH.ordinal()),
+ ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) SOUTH.ordinal()),
+ ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) WEST.ordinal()),
+ ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) EAST.ordinal())
+ });
}
return false;
}
- public static boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer, ITexture[][] aTextures) {
+ public static boolean renderStandardBlock(
+ IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer, ITexture[][] aTextures) {
aBlock.setBlockBounds(blockMin, blockMin, blockMin, blockMax, blockMax, blockMax);
aRenderer.setRenderBoundsFromBlock(aBlock);
@@ -104,7 +103,14 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
return true;
}
- public static boolean renderPipeBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, IPipeRenderedTileEntity aTileEntity, RenderBlocks aRenderer) {
+ public static boolean renderPipeBlock(
+ IBlockAccess aWorld,
+ int aX,
+ int aY,
+ int aZ,
+ Block aBlock,
+ IPipeRenderedTileEntity aTileEntity,
+ RenderBlocks aRenderer) {
final byte aConnections = aTileEntity.getConnections();
if ((aConnections & (HAS_FRESHFOAM | HAS_HARDENEDFOAM)) != 0) {
return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer);
@@ -465,7 +471,8 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
}
@SideOnly(Side.CLIENT)
- public static void addHitEffects(EffectRenderer effectRenderer, Block block, World world, int x, int y, int z, int side) {
+ public static void addHitEffects(
+ EffectRenderer effectRenderer, Block block, World world, int x, int y, int z, int side) {
double rX = x + XSTR.XSTR_INSTANCE.nextDouble() * 0.8 + 0.1;
double rY = y + XSTR.XSTR_INSTANCE.nextDouble() * 0.8 + 0.1;
double rZ = z + XSTR.XSTR_INSTANCE.nextDouble() * 0.8 + 0.1;
@@ -482,7 +489,11 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
} else if (side == 5) {
rX = x + 1.1;
}
- effectRenderer.addEffect((new EntityDiggingFX(world, rX, rY, rZ, 0.0, 0.0, 0.0, block, block.getDamageValue(world, x, y, z), side)).applyColourMultiplier(x, y, z).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
+ effectRenderer.addEffect((new EntityDiggingFX(
+ world, rX, rY, rZ, 0.0, 0.0, 0.0, block, block.getDamageValue(world, x, y, z), side))
+ .applyColourMultiplier(x, y, z)
+ .multiplyVelocity(0.2F)
+ .multipleParticleScaleBy(0.6F));
}
@SideOnly(Side.CLIENT)
@@ -493,7 +504,17 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
final double bX = x + (iX + 0.5) / 4.0;
final double bY = y + (iY + 0.5) / 4.0;
final double bZ = z + (iZ + 0.5) / 4.0;
- effectRenderer.addEffect((new EntityDiggingFX(world, bX, bY, bZ, bX - x - 0.5, bY - y - 0.5, bZ - z - 0.5, block, block.getDamageValue(world, x, y, z))).applyColourMultiplier(x, y, z));
+ effectRenderer.addEffect((new EntityDiggingFX(
+ world,
+ bX,
+ bY,
+ bZ,
+ bX - x - 0.5,
+ bY - y - 0.5,
+ bZ - z - 0.5,
+ block,
+ block.getDamageValue(world, x, y, z)))
+ .applyColourMultiplier(x, y, z));
}
}
}
@@ -506,13 +527,12 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
- if(aBlock instanceof IRenderedBlock) {
+ if (aBlock instanceof IRenderedBlock) {
boolean tNeedsToSetBounds = true;
final ItemStack aStack = new ItemStack(aBlock, 1, aMeta);
- IRenderedBlock tRenderer = ((IRenderedBlock)aBlock).passRenderingToObject(aStack);
+ IRenderedBlock tRenderer = ((IRenderedBlock) aBlock).passRenderingToObject(aStack);
if (tRenderer != null) tRenderer = tRenderer.passRenderingToObject(aStack);
- if (tRenderer == null)
- tRenderer = IRenderedBlock.ErrorRenderer.INSTANCE;
+ if (tRenderer == null) tRenderer = IRenderedBlock.ErrorRenderer.INSTANCE;
for (int i = 0, j = tRenderer.getRenderPasses(aBlock); i < j; i++) {
if (tRenderer.usesRenderPass(i)) {
if (tRenderer.setBlockBounds(aBlock, i)) {
@@ -524,12 +544,60 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
tNeedsToSetBounds = false;
}
- renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tRenderer.getTexture(aBlock, (byte) DOWN.ordinal(), true, i), !tNeedsToSetBounds);
- renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tRenderer.getTexture(aBlock, (byte) UP.ordinal(), true, i), !tNeedsToSetBounds);
- renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tRenderer.getTexture(aBlock, (byte) NORTH.ordinal(), true, i), !tNeedsToSetBounds);
- renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tRenderer.getTexture(aBlock, (byte) SOUTH.ordinal(), true, i), !tNeedsToSetBounds);
- renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tRenderer.getTexture(aBlock, (byte) WEST.ordinal(), true, i), !tNeedsToSetBounds);
- renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tRenderer.getTexture(aBlock, (byte) EAST.ordinal(), true, i), !tNeedsToSetBounds);
+ renderNegativeYFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ tRenderer.getTexture(aBlock, (byte) DOWN.ordinal(), true, i),
+ !tNeedsToSetBounds);
+ renderPositiveYFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ tRenderer.getTexture(aBlock, (byte) UP.ordinal(), true, i),
+ !tNeedsToSetBounds);
+ renderNegativeZFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ tRenderer.getTexture(aBlock, (byte) NORTH.ordinal(), true, i),
+ !tNeedsToSetBounds);
+ renderPositiveZFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ tRenderer.getTexture(aBlock, (byte) SOUTH.ordinal(), true, i),
+ !tNeedsToSetBounds);
+ renderNegativeXFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ tRenderer.getTexture(aBlock, (byte) WEST.ordinal(), true, i),
+ !tNeedsToSetBounds);
+ renderPositiveXFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ tRenderer.getTexture(aBlock, (byte) EAST.ordinal(), true, i),
+ !tNeedsToSetBounds);
}
}
if (tNeedsToSetBounds) aBlock.setBlockBounds(0, 0, 0, 1, 1, 1);
@@ -541,18 +609,23 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
aBlock.setBlockBoundsForItemRender();
aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) DOWN.ordinal()), true);
- renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) UP.ordinal()), true);
- renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) NORTH.ordinal()), true);
- renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) SOUTH.ordinal()), true);
- renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) WEST.ordinal()), true);
- renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) EAST.ordinal()), true);
+ renderNegativeYFacing(
+ null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) DOWN.ordinal()), true);
+ renderPositiveYFacing(
+ null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) UP.ordinal()), true);
+ renderNegativeZFacing(
+ null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) NORTH.ordinal()), true);
+ renderPositiveZFacing(
+ null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) SOUTH.ordinal()), true);
+ renderNegativeXFacing(
+ null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) WEST.ordinal()), true);
+ renderPositiveXFacing(
+ null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) EAST.ordinal()), true);
} else if (aMeta > 0
- && (aMeta < GregTech_API.METATILEENTITIES.length)
- && aBlock instanceof GT_Block_Machines
- && (GregTech_API.METATILEENTITIES[aMeta] != null)
- && (!GregTech_API.METATILEENTITIES[aMeta].renderInInventory(aBlock, aMeta, aRenderer)))
- {
+ && (aMeta < GregTech_API.METATILEENTITIES.length)
+ && aBlock instanceof GT_Block_Machines
+ && (GregTech_API.METATILEENTITIES[aMeta] != null)
+ && (!GregTech_API.METATILEENTITIES[aMeta].renderInInventory(aBlock, aMeta, aRenderer))) {
renderNormalInventoryMetaTileEntity(aBlock, aMeta, aRenderer);
}
aBlock.setBlockBounds(blockMin, blockMin, blockMin, blockMax, blockMax, blockMax);
@@ -584,26 +657,173 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
aBlock.setBlockBounds(blockMin, pipeMin, pipeMin, blockMax, pipeMax, pipeMax);
aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) DOWN.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, false, false), true);
- renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) UP.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, false, false), true);
- renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) NORTH.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, false, false), true);
- renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) SOUTH.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, false, false), true);
- renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) WEST.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, true, false), true);
- renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) EAST.ordinal(), (byte) (CONNECTED_WEST | CONNECTED_EAST), (byte) -1, true, false), true);
+ renderNegativeYFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ tMetaTileEntity.getTexture(
+ iGregTechTileEntity,
+ (byte) DOWN.ordinal(),
+ (byte) (CONNECTED_WEST | CONNECTED_EAST),
+ (byte) -1,
+ false,
+ false),
+ true);
+ renderPositiveYFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ tMetaTileEntity.getTexture(
+ iGregTechTileEntity,
+ (byte) UP.ordinal(),
+ (byte) (CONNECTED_WEST | CONNECTED_EAST),
+ (byte) -1,
+ false,
+ false),
+ true);
+ renderNegativeZFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ tMetaTileEntity.getTexture(
+ iGregTechTileEntity,
+ (byte) NORTH.ordinal(),
+ (byte) (CONNECTED_WEST | CONNECTED_EAST),
+ (byte) -1,
+ false,
+ false),
+ true);
+ renderPositiveZFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ tMetaTileEntity.getTexture(
+ iGregTechTileEntity,
+ (byte) SOUTH.ordinal(),
+ (byte) (CONNECTED_WEST | CONNECTED_EAST),
+ (byte) -1,
+ false,
+ false),
+ true);
+ renderNegativeXFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ tMetaTileEntity.getTexture(
+ iGregTechTileEntity,
+ (byte) WEST.ordinal(),
+ (byte) (CONNECTED_WEST | CONNECTED_EAST),
+ (byte) -1,
+ true,
+ false),
+ true);
+ renderPositiveXFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ tMetaTileEntity.getTexture(
+ iGregTechTileEntity,
+ (byte) EAST.ordinal(),
+ (byte) (CONNECTED_WEST | CONNECTED_EAST),
+ (byte) -1,
+ true,
+ false),
+ true);
} else {
- renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) DOWN.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true);
- renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) UP.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true);
- renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) NORTH.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true);
- renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) SOUTH.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true);
- renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) WEST.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true);
- renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tMetaTileEntity.getTexture(iGregTechTileEntity, (byte) EAST.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false), true);
+ renderNegativeYFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ tMetaTileEntity.getTexture(
+ iGregTechTileEntity, (byte) DOWN.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false),
+ true);
+ renderPositiveYFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ tMetaTileEntity.getTexture(
+ iGregTechTileEntity, (byte) UP.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false),
+ true);
+ renderNegativeZFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ tMetaTileEntity.getTexture(
+ iGregTechTileEntity, (byte) NORTH.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false),
+ true);
+ renderPositiveZFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ tMetaTileEntity.getTexture(
+ iGregTechTileEntity, (byte) SOUTH.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false),
+ true);
+ renderNegativeXFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ tMetaTileEntity.getTexture(
+ iGregTechTileEntity, (byte) WEST.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false),
+ true);
+ renderPositiveXFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ tMetaTileEntity.getTexture(
+ iGregTechTileEntity, (byte) EAST.ordinal(), (byte) WEST.ordinal(), (byte) -1, true, false),
+ true);
}
}
- public static void renderNegativeYFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) {
+ public static void renderNegativeYFacing(
+ IBlockAccess aWorld,
+ RenderBlocks aRenderer,
+ Block aBlock,
+ int aX,
+ int aY,
+ int aZ,
+ ITexture[] aIcon,
+ boolean aFullBlock) {
if (aWorld != null) {
if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY - 1, aZ, 0))) return;
- Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY - 1 : aY, aZ));
+ Tessellator.instance.setBrightness(
+ aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY - 1 : aY, aZ));
}
if (aIcon == null) return;
for (ITexture iTexture : aIcon) {
@@ -613,10 +833,19 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
}
}
- public static void renderPositiveYFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) {
+ public static void renderPositiveYFacing(
+ IBlockAccess aWorld,
+ RenderBlocks aRenderer,
+ Block aBlock,
+ int aX,
+ int aY,
+ int aZ,
+ ITexture[] aIcon,
+ boolean aFullBlock) {
if (aWorld != null) {
if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY + 1, aZ, 1))) return;
- Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY + 1 : aY, aZ));
+ Tessellator.instance.setBrightness(
+ aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY + 1 : aY, aZ));
}
if (aIcon == null) return;
for (ITexture iTexture : aIcon) {
@@ -626,10 +855,19 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
}
}
- public static void renderNegativeZFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) {
+ public static void renderNegativeZFacing(
+ IBlockAccess aWorld,
+ RenderBlocks aRenderer,
+ Block aBlock,
+ int aX,
+ int aY,
+ int aZ,
+ ITexture[] aIcon,
+ boolean aFullBlock) {
if (aWorld != null) {
if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ - 1, 2))) return;
- Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ - 1 : aZ));
+ Tessellator.instance.setBrightness(
+ aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ - 1 : aZ));
}
if (aIcon == null) return;
for (ITexture iTexture : aIcon) {
@@ -639,10 +877,19 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
}
}
- public static void renderPositiveZFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) {
+ public static void renderPositiveZFacing(
+ IBlockAccess aWorld,
+ RenderBlocks aRenderer,
+ Block aBlock,
+ int aX,
+ int aY,
+ int aZ,
+ ITexture[] aIcon,
+ boolean aFullBlock) {
if (aWorld != null) {
if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ + 1, 3))) return;
- Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ + 1 : aZ));
+ Tessellator.instance.setBrightness(
+ aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ + 1 : aZ));
}
if (aIcon == null) return;
for (ITexture iTexture : aIcon) {
@@ -652,10 +899,19 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
}
}
- public static void renderNegativeXFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) {
+ public static void renderNegativeXFacing(
+ IBlockAccess aWorld,
+ RenderBlocks aRenderer,
+ Block aBlock,
+ int aX,
+ int aY,
+ int aZ,
+ ITexture[] aIcon,
+ boolean aFullBlock) {
if (aWorld != null) {
if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX - 1, aY, aZ, 4))) return;
- Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX - 1 : aX, aY, aZ));
+ Tessellator.instance.setBrightness(
+ aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX - 1 : aX, aY, aZ));
}
if (aIcon == null) return;
for (ITexture iTexture : aIcon) {
@@ -665,10 +921,19 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
}
}
- public static void renderPositiveXFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) {
+ public static void renderPositiveXFacing(
+ IBlockAccess aWorld,
+ RenderBlocks aRenderer,
+ Block aBlock,
+ int aX,
+ int aY,
+ int aZ,
+ ITexture[] aIcon,
+ boolean aFullBlock) {
if (aWorld != null) {
if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX + 1, aY, aZ, 5))) return;
- Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX + 1 : aX, aY, aZ));
+ Tessellator.instance.setBrightness(
+ aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX + 1 : aX, aY, aZ));
}
if (aIcon == null) return;
for (ITexture iTexture : aIcon) {
@@ -679,11 +944,12 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
}
@Override
- public boolean renderWorldBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int aModelID, RenderBlocks aRenderer) {
+ public boolean renderWorldBlock(
+ IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int aModelID, RenderBlocks aRenderer) {
aRenderer.enableAO = Minecraft.isAmbientOcclusionEnabled() && GT_Mod.gregtechproxy.mRenderTileAmbientOcclusion;
aRenderer.useInventoryTint = false;
if (aBlock instanceof IRenderedBlock) {
- IRenderedBlock tRenderer = ((IRenderedBlock)aBlock).passRenderingToObject(aWorld, aX, aY, aZ);
+ IRenderedBlock tRenderer = ((IRenderedBlock) aBlock).passRenderingToObject(aWorld, aX, aY, aZ);
if (tRenderer != null) tRenderer = tRenderer.passRenderingToObject(aWorld, aX, aY, aZ);
if (tRenderer == null) tRenderer = IRenderedBlock.ErrorRenderer.INSTANCE;
boolean tNeedsToSetBounds = true;
@@ -693,9 +959,13 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
} else {
final boolean[] tSides = new boolean[6];
if (tRenderer instanceof IRenderedBlockSideCheck) {
- for (byte tSide : ALL_VALID_SIDES) rReturn |= (tSides[tSide] = ((IRenderedBlockSideCheck)tRenderer).renderFullBlockSide(aBlock, aRenderer, tSide));
+ for (byte tSide : ALL_VALID_SIDES)
+ rReturn |= (tSides[tSide] =
+ ((IRenderedBlockSideCheck) tRenderer).renderFullBlockSide(aBlock, aRenderer, tSide));
} else {
- for (byte tSide : ALL_VALID_SIDES) rReturn |= (tSides[tSide] = aBlock.shouldSideBeRendered(aWorld, aX+OFFX[tSide], aY+OFFY[tSide], aZ+OFFZ[tSide], tSide));
+ for (byte tSide : ALL_VALID_SIDES)
+ rReturn |= (tSides[tSide] = aBlock.shouldSideBeRendered(
+ aWorld, aX + OFFX[tSide], aY + OFFY[tSide], aZ + OFFZ[tSide], tSide));
}
for (int i = 0, j = tRenderer.getRenderPasses(aBlock); i < j; i++) {
if (tRenderer.usesRenderPass(i)) {
@@ -707,12 +977,60 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
aRenderer.setRenderBoundsFromBlock(aBlock);
tNeedsToSetBounds = false;
}
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tRenderer.getTexture(aBlock, (byte) DOWN.ordinal(), i, tSides), tSides[DOWN.ordinal()]);
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tRenderer.getTexture(aBlock, (byte) UP.ordinal(), i, tSides), tSides[UP.ordinal()]);
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tRenderer.getTexture(aBlock, (byte) NORTH.ordinal(), i, tSides), tSides[NORTH.ordinal()]);
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tRenderer.getTexture(aBlock, (byte) SOUTH.ordinal(), i, tSides), tSides[SOUTH.ordinal()]);
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tRenderer.getTexture(aBlock, (byte) WEST.ordinal(), i, tSides), tSides[WEST.ordinal()]);
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, tRenderer.getTexture(aBlock, (byte) EAST.ordinal(), i, tSides), tSides[EAST.ordinal()]);
+ renderNegativeYFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ tRenderer.getTexture(aBlock, (byte) DOWN.ordinal(), i, tSides),
+ tSides[DOWN.ordinal()]);
+ renderPositiveYFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ tRenderer.getTexture(aBlock, (byte) UP.ordinal(), i, tSides),
+ tSides[UP.ordinal()]);
+ renderNegativeZFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ tRenderer.getTexture(aBlock, (byte) NORTH.ordinal(), i, tSides),
+ tSides[NORTH.ordinal()]);
+ renderPositiveZFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ tRenderer.getTexture(aBlock, (byte) SOUTH.ordinal(), i, tSides),
+ tSides[SOUTH.ordinal()]);
+ renderNegativeXFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ tRenderer.getTexture(aBlock, (byte) WEST.ordinal(), i, tSides),
+ tSides[WEST.ordinal()]);
+ renderPositiveXFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ tRenderer.getTexture(aBlock, (byte) EAST.ordinal(), i, tSides),
+ tSides[EAST.ordinal()]);
}
}
if (tNeedsToSetBounds) aBlock.setBlockBounds(0, 0, 0, 1, 1, 1);
@@ -725,12 +1043,14 @@ public class GT_Renderer_Block implements ISimpleBlockRenderingHandler {
if (tileEntity == null) return false;
if (tileEntity instanceof IGregTechTileEntity) {
final IMetaTileEntity metaTileEntity;
- if ((metaTileEntity = ((IGregTechTileEntity) tileEntity).getMetaTileEntity()) != null && metaTileEntity.renderInWorld(aWorld, aX, aY, aZ, aBlock, aRenderer)) {
+ if ((metaTileEntity = ((IGregTechTileEntity) tileEntity).getMetaTileEntity()) != null
+ && metaTileEntity.renderInWorld(aWorld, aX, aY, aZ, aBlock, aRenderer)) {
aRenderer.enableAO = false;
return true;
}
}
- if (tileEntity instanceof IPipeRenderedTileEntity && renderPipeBlock(aWorld, aX, aY, aZ, aBlock, (IPipeRenderedTileEntity) tileEntity, aRenderer)) {
+ if (tileEntity instanceof IPipeRenderedTileEntity
+ && renderPipeBlock(aWorld, aX, aY, aZ, aBlock, (IPipeRenderedTileEntity) tileEntity, aRenderer)) {
aRenderer.enableAO = false;
return true;
}