aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/gregtech/common/render
diff options
context:
space:
mode:
authorJason Mitchell <mitchej@gmail.com>2023-05-01 02:45:56 -0700
committerGitHub <noreply@github.com>2023-05-01 11:45:56 +0200
commitb2c8cfb4ec8b82337a95f51364277964ec968b52 (patch)
treed4cf94acc93249cd649b33ec13c5b0d75f1f75db /src/main/java/gtPlusPlus/xmod/gregtech/common/render
parentd2eda84e457d549ad9a51f40e9dd159147a141f8 (diff)
downloadGT5-Unofficial-b2c8cfb4ec8b82337a95f51364277964ec968b52.tar.gz
GT5-Unofficial-b2c8cfb4ec8b82337a95f51364277964ec968b52.tar.bz2
GT5-Unofficial-b2c8cfb4ec8b82337a95f51364277964ec968b52.zip
ForgeDirection (#608)
* ForgeDirection WIP * Fix GTPP_Render_MachineBlock Fix handling of getTexture with facing mask for pipes Kill a bunch of magic numbers * spotlessApply (#612) Co-authored-by: GitHub GTNH Actions <> * Bump bw/tt deps --------- Co-authored-by: Léa Gris <lea.gris@noiraude.net> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common/render')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_FlaskRenderer.java3
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java1019
2 files changed, 766 insertions, 256 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_FlaskRenderer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_FlaskRenderer.java
index 6267609aba..93e139ef66 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_FlaskRenderer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_FlaskRenderer.java
@@ -25,14 +25,17 @@ public final class GTPP_FlaskRenderer implements net.minecraftforge.client.IItem
MinecraftForgeClient.registerItemRenderer(GregtechItemList.VOLUMETRIC_FLASK_32k.getItem(), this);
}
+ @Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
return type != ItemRenderType.FIRST_PERSON_MAP;
}
+ @Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, IItemRenderer.ItemRendererHelper helper) {
return type == ItemRenderType.ENTITY;
}
+ @Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
GT_VolumetricFlask cell = (GT_VolumetricFlask) item.getItem();
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java
index 5d7209b203..a7458fa10b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java
@@ -1,10 +1,29 @@
package gtPlusPlus.xmod.gregtech.common.render;
+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_FOAM;
+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.WEST;
+
+import java.util.EnumMap;
+import java.util.EnumSet;
+
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess;
+import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
@@ -15,6 +34,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.interfaces.tileentity.IPipeRenderedTileEntity;
import gregtech.api.interfaces.tileentity.ITexturedTileEntity;
+import gregtech.api.metatileentity.MetaPipeEntity;
import gregtech.common.blocks.GT_Block_Machines;
import gregtech.common.render.GT_Renderer_Block;
import gtPlusPlus.xmod.gregtech.common.blocks.GTPP_Block_Machines;
@@ -30,10 +50,16 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block {
RenderingRegistry.registerBlockHandler(this);
}
- private static ITexture[] getTexture(IMetaTileEntity arg0, int arg1, int arg2, int arg3, boolean arg4,
- boolean arg5) {
- IGregTechTileEntity arg0b = arg0.getBaseMetaTileEntity();
- return arg0.getTexture(arg0b, (byte) arg1, (byte) arg2, (byte) arg3, arg4, arg5);
+ private static ITexture[] getTexture(IMetaTileEntity tile, ForgeDirection side, ForgeDirection facing,
+ int colorIndex, boolean active, boolean arg5) {
+ final IGregTechTileEntity gtTile = tile.getBaseMetaTileEntity();
+ return tile.getTexture(gtTile, side, facing, (byte) colorIndex, active, arg5);
+ }
+
+ private static ITexture[] getTexture(IMetaTileEntity tile, ForgeDirection side, int facingMask, int colorIndex,
+ boolean active, boolean arg5) {
+ final MetaPipeEntity gtTile = (MetaPipeEntity) tile.getBaseMetaTileEntity();
+ return gtTile.getTexture((IGregTechTileEntity) tile, side, facingMask, colorIndex, active, arg5);
}
private static void renderNormalInventoryMetaTileEntity(Block aBlock, int aMeta, RenderBlocks aRenderer) {
@@ -44,155 +70,154 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block {
aRenderer.setRenderBoundsFromBlock(aBlock);
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
- if (tMetaTileEntity.getBaseMetaTileEntity() instanceof IPipeRenderedTileEntity) {
- float tThickness = ((IPipeRenderedTileEntity) tMetaTileEntity.getBaseMetaTileEntity())
- .getThickNess();
+ if (tMetaTileEntity.getBaseMetaTileEntity() instanceof IPipeRenderedTileEntity pipeRenderedTile) {
+ float tThickness = pipeRenderedTile.getThickNess();
float sp = (1.0F - tThickness) / 2.0F;
aBlock.setBlockBounds(0.0F, sp, sp, 1.0F, sp + tThickness, sp + tThickness);
aRenderer.setRenderBoundsFromBlock(aBlock);
Tessellator.instance.startDrawingQuads();
Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F);
renderNegativeYFacing(
- (IBlockAccess) null,
+ null,
aRenderer,
aBlock,
0,
0,
0,
- getTexture(tMetaTileEntity, 0, 9, -1, false, false),
+ getTexture(tMetaTileEntity, DOWN, 0b001001, -1, false, false),
true);
Tessellator.instance.draw();
Tessellator.instance.startDrawingQuads();
Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F);
renderPositiveYFacing(
- (IBlockAccess) null,
+ null,
aRenderer,
aBlock,
0,
0,
0,
- getTexture(tMetaTileEntity, 1, 9, -1, false, false),
+ getTexture(tMetaTileEntity, UP, 0b001001, -1, false, false),
true);
Tessellator.instance.draw();
Tessellator.instance.startDrawingQuads();
Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F);
renderNegativeZFacing(
- (IBlockAccess) null,
+ null,
aRenderer,
aBlock,
0,
0,
0,
- getTexture(tMetaTileEntity, 2, 9, -1, false, false),
+ getTexture(tMetaTileEntity, ForgeDirection.NORTH, 0b001001, -1, false, false),
true);
Tessellator.instance.draw();
Tessellator.instance.startDrawingQuads();
Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F);
renderPositiveZFacing(
- (IBlockAccess) null,
+ null,
aRenderer,
aBlock,
0,
0,
0,
- getTexture(tMetaTileEntity, 3, 9, -1, false, false),
+ getTexture(tMetaTileEntity, ForgeDirection.SOUTH, 0b001001, -1, false, false),
true);
Tessellator.instance.draw();
Tessellator.instance.startDrawingQuads();
Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F);
renderNegativeXFacing(
- (IBlockAccess) null,
+ null,
aRenderer,
aBlock,
0,
0,
0,
- getTexture(tMetaTileEntity, 4, 9, -1, true, false),
+ getTexture(tMetaTileEntity, ForgeDirection.WEST, 0b001001, -1, true, false),
true);
Tessellator.instance.draw();
Tessellator.instance.startDrawingQuads();
Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F);
renderPositiveXFacing(
- (IBlockAccess) null,
+ null,
aRenderer,
aBlock,
0,
0,
0,
- getTexture(tMetaTileEntity, 5, 9, -1, true, false),
+ getTexture(tMetaTileEntity, ForgeDirection.EAST, 0b001001, -1, true, false),
true);
Tessellator.instance.draw();
} else {
Tessellator.instance.startDrawingQuads();
Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F);
renderNegativeYFacing(
- (IBlockAccess) null,
+ null,
aRenderer,
aBlock,
0,
0,
0,
- getTexture(tMetaTileEntity, 0, 4, -1, true, false),
+ getTexture(tMetaTileEntity, DOWN, ForgeDirection.WEST, -1, true, false),
true);
Tessellator.instance.draw();
Tessellator.instance.startDrawingQuads();
Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F);
renderPositiveYFacing(
- (IBlockAccess) null,
+ null,
aRenderer,
aBlock,
0,
0,
0,
- getTexture(tMetaTileEntity, 1, 4, -1, true, false),
+ getTexture(tMetaTileEntity, UP, ForgeDirection.WEST, -1, true, false),
true);
Tessellator.instance.draw();
Tessellator.instance.startDrawingQuads();
Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F);
renderNegativeZFacing(
- (IBlockAccess) null,
+ null,
aRenderer,
aBlock,
0,
0,
0,
- getTexture(tMetaTileEntity, 2, 4, -1, true, false),
+ getTexture(tMetaTileEntity, ForgeDirection.NORTH, ForgeDirection.WEST, -1, true, false),
true);
Tessellator.instance.draw();
Tessellator.instance.startDrawingQuads();
Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F);
renderPositiveZFacing(
- (IBlockAccess) null,
+ null,
aRenderer,
aBlock,
0,
0,
0,
- getTexture(tMetaTileEntity, 3, 4, -1, true, false),
+ getTexture(tMetaTileEntity, ForgeDirection.SOUTH, ForgeDirection.WEST, -1, true, false),
true);
Tessellator.instance.draw();
Tessellator.instance.startDrawingQuads();
Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F);
renderNegativeXFacing(
- (IBlockAccess) null,
+ null,
aRenderer,
aBlock,
0,
0,
0,
- getTexture(tMetaTileEntity, 4, 4, -1, true, false),
+ getTexture(tMetaTileEntity, ForgeDirection.WEST, ForgeDirection.WEST, -1, true, false),
true);
Tessellator.instance.draw();
Tessellator.instance.startDrawingQuads();
Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F);
renderPositiveXFacing(
- (IBlockAccess) null,
+ null,
aRenderer,
aBlock,
0,
0,
0,
- getTexture(tMetaTileEntity, 5, 4, -1, true, false),
+ getTexture(tMetaTileEntity, ForgeDirection.EAST, ForgeDirection.WEST, -1, true, false),
true);
Tessellator.instance.draw();
}
@@ -216,12 +241,12 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block {
aZ,
aBlock,
aRenderer,
- new ITexture[][] { GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 0),
- GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 1),
- GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 2),
- GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 3),
- GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 4),
- GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 5) })
+ new ITexture[][] { GT_MethodHelper.getTexture(tTileEntity, aBlock, DOWN),
+ GT_MethodHelper.getTexture(tTileEntity, aBlock, UP),
+ GT_MethodHelper.getTexture(tTileEntity, aBlock, ForgeDirection.NORTH),
+ GT_MethodHelper.getTexture(tTileEntity, aBlock, ForgeDirection.SOUTH),
+ GT_MethodHelper.getTexture(tTileEntity, aBlock, ForgeDirection.WEST),
+ GT_MethodHelper.getTexture(tTileEntity, aBlock, ForgeDirection.EAST) })
: false;
}
@@ -229,19 +254,19 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block {
RenderBlocks aRenderer, ITexture[][] aTextures) {
aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[0], true);
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[1], true);
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[2], true);
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[3], true);
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[4], true);
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[5], true);
+ renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[DOWN.ordinal()], true);
+ renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[UP.ordinal()], true);
+ renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[ForgeDirection.NORTH.ordinal()], true);
+ renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[ForgeDirection.SOUTH.ordinal()], true);
+ renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[ForgeDirection.WEST.ordinal()], true);
+ renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[ForgeDirection.EAST.ordinal()], true);
return true;
}
public static boolean renderPipeBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock,
IPipeRenderedTileEntity aTileEntity, RenderBlocks aRenderer) {
- byte aConnections = aTileEntity.getConnections();
- if ((aConnections & 192) != 0) {
+ final int aConnections = aTileEntity.getConnections();
+ if ((aConnections & HAS_FOAM) != 0) {
return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer);
} else {
float tThickness = aTileEntity.getThickNess();
@@ -249,312 +274,790 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block {
return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer);
} else {
float sp = (1.0F - tThickness) / 2.0F;
- byte tConnections = 0;
+ int connexionSidesBits = 0;
- for (byte tIsCovered = 0; tIsCovered < 6; ++tIsCovered) {
- if ((aConnections & 1 << tIsCovered) != 0) {
- tConnections = (byte) (tConnections | 1 << (tIsCovered + 2) % 6);
+ for (int ordinalSide = 0; ordinalSide < 6; ++ordinalSide) {
+ if ((aConnections & 1 << ordinalSide) != 0) {
+ connexionSidesBits = connexionSidesBits | 1 << (ordinalSide + 2) % 6;
}
}
- boolean[] arg14 = new boolean[6];
+ final EnumSet<ForgeDirection> coveredSides = EnumSet.noneOf(ForgeDirection.class);
- for (byte tIcons = 0; tIcons < 6; ++tIcons) {
- arg14[tIcons] = aTileEntity.getCoverIDAtSide(tIcons) != 0;
+ for (final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) {
+ if (aTileEntity.getCoverIDAtSide(side) != 0) coveredSides.add(side);
}
- if (arg14[0] && arg14[1] && arg14[2] && arg14[3] && arg14[4] && arg14[5]) {
+ if (coveredSides.containsAll(EnumSet.of(DOWN, UP, NORTH, SOUTH, WEST, EAST))) {
return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer);
} else {
- ITexture[][] arg15 = new ITexture[6][];
- ITexture[][] tCovers = new ITexture[6][];
+ final EnumMap<ForgeDirection, ITexture[]> texture = new EnumMap<>(ForgeDirection.class);
+ final EnumMap<ForgeDirection, ITexture[]> textureUncovered = new EnumMap<>(ForgeDirection.class);
- for (byte i = 0; i < 6; ++i) {
- tCovers[i] = GT_MethodHelper.getTexture((TileEntity) aTileEntity, aBlock, i);
- arg15[i] = aTileEntity.getTextureUncovered(i);
+ for (final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) {
+ texture.put(side, GT_MethodHelper.getTexture((TileEntity) aTileEntity, aBlock, side));
+ textureUncovered.put(side, aTileEntity.getTextureUncovered(side));
}
- if (tConnections == 0) {
- aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
- } else if (tConnections == 3) {
- aBlock.setBlockBounds(0.0F, sp, sp, 1.0F, sp + tThickness, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
- if (!arg14[4]) {
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
- }
-
- if (!arg14[5]) {
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
- }
- } else if (tConnections == 12) {
- aBlock.setBlockBounds(sp, 0.0F, sp, sp + tThickness, 1.0F, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
- if (!arg14[0]) {
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
- }
-
- if (!arg14[1]) {
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
- }
- } else if (tConnections == 48) {
- aBlock.setBlockBounds(sp, sp, 0.0F, sp + tThickness, sp + tThickness, 1.0F);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
- if (!arg14[2]) {
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
- }
-
- if (!arg14[3]) {
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
- }
- } else {
- if ((tConnections & 1) == 0) {
+ switch (connexionSidesBits) {
+ case NO_CONNECTION -> {
aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness);
aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
- } else {
- aBlock.setBlockBounds(0.0F, sp, sp, sp, sp + tThickness, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
- if (!arg14[4]) {
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
- }
+ renderNegativeYFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ textureUncovered.get(DOWN),
+ false);
+ renderPositiveYFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ textureUncovered.get(UP),
+ false);
+ renderNegativeZFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ textureUncovered.get(NORTH),
+ false);
+ renderPositiveZFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ textureUncovered.get(SOUTH),
+ false);
+ renderNegativeXFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ textureUncovered.get(WEST),
+ false);
+ renderPositiveXFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ textureUncovered.get(EAST),
+ false);
}
-
- if ((tConnections & 2) == 0) {
- aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness);
+ case (CONNECTED_DOWN | CONNECTED_UP) -> {
+ aBlock.setBlockBounds(0.0F, sp, sp, 1.0F, sp + tThickness, sp + tThickness);
aRenderer.setRenderBoundsFromBlock(aBlock);
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
- } else {
- aBlock.setBlockBounds(sp + tThickness, sp, sp, 1.0F, sp + tThickness, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
- if (!arg14[5]) {
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
+ renderNegativeYFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ textureUncovered.get(DOWN),
+ false);
+ renderPositiveYFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ textureUncovered.get(UP),
+ false);
+ renderNegativeZFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ textureUncovered.get(NORTH),
+ false);
+ renderPositiveZFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ textureUncovered.get(SOUTH),
+ false);
+ if (!coveredSides.contains(WEST)) {
+ renderNegativeXFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ textureUncovered.get(WEST),
+ false);
}
- }
-
- if ((tConnections & 4) == 0) {
- aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
- } else {
- aBlock.setBlockBounds(sp, 0.0F, sp, sp + tThickness, sp, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
- if (!arg14[0]) {
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
+ if (!coveredSides.contains(EAST)) {
+ renderPositiveXFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ textureUncovered.get(EAST),
+ false);
}
}
-
- if ((tConnections & 8) == 0) {
- aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness);
+ case (CONNECTED_NORTH | CONNECTED_SOUTH) -> {
+ aBlock.setBlockBounds(sp, 0.0F, sp, sp + tThickness, 1.0F, sp + tThickness);
aRenderer.setRenderBoundsFromBlock(aBlock);
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
- } else {
- aBlock.setBlockBounds(sp, sp + tThickness, sp, sp + tThickness, 1.0F, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
- renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[3], false);
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
- if (!arg14[1]) {
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
+ renderNegativeZFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ textureUncovered.get(NORTH),
+ false);
+ renderPositiveZFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ textureUncovered.get(SOUTH),
+ false);
+ renderNegativeXFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ textureUncovered.get(WEST),
+ false);
+ renderPositiveXFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ textureUncovered.get(EAST),
+ false);
+ if (!coveredSides.contains(DOWN)) {
+ renderNegativeYFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ textureUncovered.get(DOWN),
+ false);
+ }
+ if (!coveredSides.contains(UP)) {
+ renderPositiveYFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ textureUncovered.get(UP),
+ false);
}
}
-
- if ((tConnections & 16) == 0) {
- aBlock.setBlockBounds(sp, sp, sp, sp + tThickness, sp + tThickness, sp + tThickness);
- aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
- } else {
- aBlock.setBlockBounds(sp, sp, 0.0F, sp + tThickness, sp + tThickness, sp);
+ case (CONNECTED_WEST | CONNECTED_EAST) -> {
+ aBlock.setBlockBounds(sp, sp, 0.0F, sp + tThickness, sp + tThickness, 1.0F);
aRenderer.setRenderBoundsFromBlock(aBlock);
- renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[0], false);
- renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[1], false);
- renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[4], false);
- renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[5], false);
- if (!arg14[2]) {
- renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, arg15[2], false);
+ renderNegativeYFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ textureUncovered.get(DOWN),
+ false);
+ renderPositiveYFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ textureUncovered.get(UP),
+ false);
+ renderNegativeXFacing(
+ aWorld,
+ aRenderer,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ textureUncovered.get(WEST),
+ false);
+ renderPositiveXFacing(
+