if(!tr.isMultiblock()) {
return blockIcon;
}
ForgeDirection side = ForgeDirection.getOrientation(blockSide);
Pos pos = tr.pos;
if(tr.front == side || tr.front == side.getOpposite()) { // 2x2 area
boolean isRight;
if(tr.isVertical()) { // to to flip right and left for back faces of
// vertical multiblocks
isRight = !pos.isRight(side);
} else {
isRight = pos.isRight(side);
}
if(pos.isTop) {
return isRight ? mbIcons[MbFace.TR.ordinal()] : mbIcons[MbFace.TL.ordinal()];
} else {
return isRight ? mbIcons[MbFace.BR.ordinal()] : mbIcons[MbFace.BL.ordinal()];
}
}
if(tr.up == side || tr.up == side.getOpposite()) { // up or down face
if(tr.isVertical()) {
if(tr.right.offsetX != 0) {
return pos.isRight ? mbIcons[MbFace.L.ordinal()] : mbIcons[MbFace.R.ordinal()];
} else {
return pos.isRight ? mbIcons[MbFace.T.ordinal()] : mbIcons[MbFace.B.ordinal()];
}
} else {
if(tr.up == side) {
return pos.isRight ? mbIcons[MbFace.L.ordinal()] : mbIcons[MbFace.R.ordinal()];
} else {
return pos.isRight ? mbIcons[MbFace.R.ordinal()] : mbIcons[MbFace.L.ordinal()];
}
}
} else {
if(tr.isVertical()) {
return pos.isTop ? mbIcons[MbFace.T.ordinal()] : mbIcons[MbFace.B.ordinal()];
} else {
return pos.isTop(side) ? mbIcons[MbFace.L.ordinal()] : mbIcons[MbFace.R.ordinal()];
}
}
}