private float[] getPositionsDiv16(Vector3f pos1, Vector3f pos2) { float[] afloat = new float[EnumFacing.values().length]; afloat[EnumFaceDirection.Constants.WEST_INDEX] = pos1.x / 16.0F; afloat[EnumFaceDirection.Constants.DOWN_INDEX] = pos1.y / 16.0F; afloat[EnumFaceDirection.Constants.NORTH_INDEX] = pos1.z / 16.0F; afloat[EnumFaceDirection.Constants.EAST_INDEX] = pos2.x / 16.0F; afloat[EnumFaceDirection.Constants.UP_INDEX] = pos2.y / 16.0F; afloat[EnumFaceDirection.Constants.SOUTH_INDEX] = pos2.z / 16.0F; return afloat; }
private void fillVertexData(int[] faceData, int vertexIndex, EnumFacing facing, BlockPartFace partFace, float[] p_178402_5_, TextureAtlasSprite sprite, ModelRotation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) { EnumFacing enumfacing = modelRotationIn.rotateFace(facing); int i = shade ? this.getFaceShadeColor(enumfacing) : -1; EnumFaceDirection.VertexInformation enumfacedirection$vertexinformation = EnumFaceDirection.getFacing(facing).func_179025_a(vertexIndex); Vector3f vector3f = new Vector3f(p_178402_5_[enumfacedirection$vertexinformation.field_179184_a], p_178402_5_[enumfacedirection$vertexinformation.field_179182_b], p_178402_5_[enumfacedirection$vertexinformation.field_179183_c]); this.func_178407_a(vector3f, partRotation); int j = this.rotateVertex(vector3f, facing, vertexIndex, modelRotationIn, uvLocked); this.storeVertexData(faceData, j, vertexIndex, vector3f, i, sprite, partFace.blockFaceUV); }
private void fillVertexData(int[] p_fillVertexData_1_, int p_fillVertexData_2_, EnumFacing p_fillVertexData_3_, BlockFaceUV p_fillVertexData_4_, float[] p_fillVertexData_5_, TextureAtlasSprite p_fillVertexData_6_, ITransformation p_fillVertexData_7_, @Nullable BlockPartRotation p_fillVertexData_8_, boolean p_fillVertexData_9_) { EnumFacing enumfacing = p_fillVertexData_7_.rotate(p_fillVertexData_3_); int i = p_fillVertexData_9_ ? this.getFaceShadeColor(enumfacing) : -1; EnumFaceDirection.VertexInformation enumfacedirection$vertexinformation = EnumFaceDirection.getFacing(p_fillVertexData_3_).getVertexInformation(p_fillVertexData_2_); Vector3f vector3f = new Vector3f(p_fillVertexData_5_[enumfacedirection$vertexinformation.xIndex], p_fillVertexData_5_[enumfacedirection$vertexinformation.yIndex], p_fillVertexData_5_[enumfacedirection$vertexinformation.zIndex]); this.rotatePart(vector3f, p_fillVertexData_8_); int j = this.rotateVertex(vector3f, p_fillVertexData_3_, p_fillVertexData_2_, p_fillVertexData_7_); BlockModelUtils.snapVertexPosition(vector3f); this.storeVertexData(p_fillVertexData_1_, j, p_fillVertexData_2_, vector3f, i, p_fillVertexData_6_, p_fillVertexData_4_); }
private void fillVertexData(int[] p_188015_1_, int p_188015_2_, EnumFacing p_188015_3_, BlockFaceUV p_188015_4_, float[] p_188015_5_, TextureAtlasSprite p_188015_6_, net.minecraftforge.common.model.ITransformation p_188015_7_, BlockPartRotation p_188015_8_, boolean p_188015_9_) { EnumFacing enumfacing = p_188015_7_.rotate(p_188015_3_); int i = p_188015_9_ ? this.getFaceShadeColor(enumfacing) : -1; EnumFaceDirection.VertexInformation enumfacedirection$vertexinformation = EnumFaceDirection.getFacing(p_188015_3_).getVertexInformation(p_188015_2_); Vector3f vector3f = new Vector3f(p_188015_5_[enumfacedirection$vertexinformation.xIndex], p_188015_5_[enumfacedirection$vertexinformation.yIndex], p_188015_5_[enumfacedirection$vertexinformation.zIndex]); this.rotatePart(vector3f, p_188015_8_); int j = this.rotateVertex(vector3f, p_188015_3_, p_188015_2_, p_188015_7_); this.storeVertexData(p_188015_1_, j, p_188015_2_, vector3f, i, p_188015_6_, p_188015_4_); }
private void fillVertexData(int[] p_188015_1_, int p_188015_2_, EnumFacing p_188015_3_, BlockFaceUV p_188015_4_, float[] p_188015_5_, TextureAtlasSprite p_188015_6_, net.minecraftforge.common.model.ITransformation p_188015_7_, BlockPartRotation p_188015_8_, int color) { p_188015_7_.rotate(p_188015_3_); int i = color; EnumFaceDirection.VertexInformation enumfacedirection$vertexinformation = EnumFaceDirection.getFacing(p_188015_3_).getVertexInformation(p_188015_2_); Vector3f vector3f = new Vector3f(p_188015_5_[enumfacedirection$vertexinformation.xIndex], p_188015_5_[enumfacedirection$vertexinformation.yIndex], p_188015_5_[enumfacedirection$vertexinformation.zIndex]); this.rotatePart(vector3f, p_188015_8_); int j = this.rotateVertex(vector3f, p_188015_3_, p_188015_2_, p_188015_7_); this.storeVertexData(p_188015_1_, j, p_188015_2_, vector3f, i, p_188015_6_, p_188015_4_); }
private void func_178408_a(int[] p_178408_1_, EnumFacing p_178408_2_) { int[] aint = new int[p_178408_1_.length]; System.arraycopy(p_178408_1_, 0, aint, 0, p_178408_1_.length); float[] afloat = new float[EnumFacing.values().length]; afloat[EnumFaceDirection.Constants.WEST_INDEX] = 999.0F; afloat[EnumFaceDirection.Constants.DOWN_INDEX] = 999.0F; afloat[EnumFaceDirection.Constants.NORTH_INDEX] = 999.0F; afloat[EnumFaceDirection.Constants.EAST_INDEX] = -999.0F; afloat[EnumFaceDirection.Constants.UP_INDEX] = -999.0F; afloat[EnumFaceDirection.Constants.SOUTH_INDEX] = -999.0F; for (int i = 0; i < 4; ++i) { int j = 7 * i; float f = Float.intBitsToFloat(aint[j]); float f1 = Float.intBitsToFloat(aint[j + 1]); float f2 = Float.intBitsToFloat(aint[j + 2]); if (f < afloat[EnumFaceDirection.Constants.WEST_INDEX]) { afloat[EnumFaceDirection.Constants.WEST_INDEX] = f; } if (f1 < afloat[EnumFaceDirection.Constants.DOWN_INDEX]) { afloat[EnumFaceDirection.Constants.DOWN_INDEX] = f1; } if (f2 < afloat[EnumFaceDirection.Constants.NORTH_INDEX]) { afloat[EnumFaceDirection.Constants.NORTH_INDEX] = f2; } if (f > afloat[EnumFaceDirection.Constants.EAST_INDEX]) { afloat[EnumFaceDirection.Constants.EAST_INDEX] = f; } if (f1 > afloat[EnumFaceDirection.Constants.UP_INDEX]) { afloat[EnumFaceDirection.Constants.UP_INDEX] = f1; } if (f2 > afloat[EnumFaceDirection.Constants.SOUTH_INDEX]) { afloat[EnumFaceDirection.Constants.SOUTH_INDEX] = f2; } } EnumFaceDirection enumfacedirection = EnumFaceDirection.getFacing(p_178408_2_); for (int i1 = 0; i1 < 4; ++i1) { int j1 = 7 * i1; EnumFaceDirection.VertexInformation enumfacedirection$vertexinformation = enumfacedirection.func_179025_a(i1); float f8 = afloat[enumfacedirection$vertexinformation.field_179184_a]; float f3 = afloat[enumfacedirection$vertexinformation.field_179182_b]; float f4 = afloat[enumfacedirection$vertexinformation.field_179183_c]; p_178408_1_[j1] = Float.floatToRawIntBits(f8); p_178408_1_[j1 + 1] = Float.floatToRawIntBits(f3); p_178408_1_[j1 + 2] = Float.floatToRawIntBits(f4); for (int k = 0; k < 4; ++k) { int l = 7 * k; float f5 = Float.intBitsToFloat(aint[l]); float f6 = Float.intBitsToFloat(aint[l + 1]); float f7 = Float.intBitsToFloat(aint[l + 2]); if (MathHelper.epsilonEquals(f8, f5) && MathHelper.epsilonEquals(f3, f6) && MathHelper.epsilonEquals(f4, f7)) { p_178408_1_[j1 + 4] = aint[l + 4]; p_178408_1_[j1 + 4 + 1] = aint[l + 4 + 1]; } } } }
private void func_178408_a(int[] p_178408_1_, EnumFacing p_178408_2_) { int[] aint = new int[p_178408_1_.length]; System.arraycopy(p_178408_1_, 0, aint, 0, p_178408_1_.length); float[] afloat = new float[EnumFacing.values().length]; afloat[EnumFaceDirection.Constants.WEST_INDEX] = 999.0F; afloat[EnumFaceDirection.Constants.DOWN_INDEX] = 999.0F; afloat[EnumFaceDirection.Constants.NORTH_INDEX] = 999.0F; afloat[EnumFaceDirection.Constants.EAST_INDEX] = -999.0F; afloat[EnumFaceDirection.Constants.UP_INDEX] = -999.0F; afloat[EnumFaceDirection.Constants.SOUTH_INDEX] = -999.0F; for (int j = 0; j < 4; ++j) { int i = 7 * j; float f1 = Float.intBitsToFloat(aint[i]); float f2 = Float.intBitsToFloat(aint[i + 1]); float f = Float.intBitsToFloat(aint[i + 2]); if (f1 < afloat[EnumFaceDirection.Constants.WEST_INDEX]) { afloat[EnumFaceDirection.Constants.WEST_INDEX] = f1; } if (f2 < afloat[EnumFaceDirection.Constants.DOWN_INDEX]) { afloat[EnumFaceDirection.Constants.DOWN_INDEX] = f2; } if (f < afloat[EnumFaceDirection.Constants.NORTH_INDEX]) { afloat[EnumFaceDirection.Constants.NORTH_INDEX] = f; } if (f1 > afloat[EnumFaceDirection.Constants.EAST_INDEX]) { afloat[EnumFaceDirection.Constants.EAST_INDEX] = f1; } if (f2 > afloat[EnumFaceDirection.Constants.UP_INDEX]) { afloat[EnumFaceDirection.Constants.UP_INDEX] = f2; } if (f > afloat[EnumFaceDirection.Constants.SOUTH_INDEX]) { afloat[EnumFaceDirection.Constants.SOUTH_INDEX] = f; } } EnumFaceDirection enumfacedirection = EnumFaceDirection.getFacing(p_178408_2_); for (int i1 = 0; i1 < 4; ++i1) { int j1 = 7 * i1; EnumFaceDirection.VertexInformation enumfacedirection$vertexinformation = enumfacedirection.func_179025_a(i1); float f8 = afloat[enumfacedirection$vertexinformation.field_179184_a]; float f3 = afloat[enumfacedirection$vertexinformation.field_179182_b]; float f4 = afloat[enumfacedirection$vertexinformation.field_179183_c]; p_178408_1_[j1] = Float.floatToRawIntBits(f8); p_178408_1_[j1 + 1] = Float.floatToRawIntBits(f3); p_178408_1_[j1 + 2] = Float.floatToRawIntBits(f4); for (int k = 0; k < 4; ++k) { int l = 7 * k; float f5 = Float.intBitsToFloat(aint[l]); float f6 = Float.intBitsToFloat(aint[l + 1]); float f7 = Float.intBitsToFloat(aint[l + 2]); if (MathHelper.epsilonEquals(f8, f5) && MathHelper.epsilonEquals(f3, f6) && MathHelper.epsilonEquals(f4, f7)) { p_178408_1_[j1 + 4] = aint[l + 4]; p_178408_1_[j1 + 4 + 1] = aint[l + 4 + 1]; } } } }
private void applyFacing(int[] p_178408_1_, EnumFacing p_178408_2_) { int[] aint = new int[p_178408_1_.length]; System.arraycopy(p_178408_1_, 0, aint, 0, p_178408_1_.length); float[] afloat = new float[EnumFacing.values().length]; afloat[EnumFaceDirection.Constants.WEST_INDEX] = 999.0F; afloat[EnumFaceDirection.Constants.DOWN_INDEX] = 999.0F; afloat[EnumFaceDirection.Constants.NORTH_INDEX] = 999.0F; afloat[EnumFaceDirection.Constants.EAST_INDEX] = -999.0F; afloat[EnumFaceDirection.Constants.UP_INDEX] = -999.0F; afloat[EnumFaceDirection.Constants.SOUTH_INDEX] = -999.0F; int i = p_178408_1_.length / 4; for (int j = 0; j < 4; ++j) { int k = i * j; float f = Float.intBitsToFloat(aint[k]); float f1 = Float.intBitsToFloat(aint[k + 1]); float f2 = Float.intBitsToFloat(aint[k + 2]); if (f < afloat[EnumFaceDirection.Constants.WEST_INDEX]) { afloat[EnumFaceDirection.Constants.WEST_INDEX] = f; } if (f1 < afloat[EnumFaceDirection.Constants.DOWN_INDEX]) { afloat[EnumFaceDirection.Constants.DOWN_INDEX] = f1; } if (f2 < afloat[EnumFaceDirection.Constants.NORTH_INDEX]) { afloat[EnumFaceDirection.Constants.NORTH_INDEX] = f2; } if (f > afloat[EnumFaceDirection.Constants.EAST_INDEX]) { afloat[EnumFaceDirection.Constants.EAST_INDEX] = f; } if (f1 > afloat[EnumFaceDirection.Constants.UP_INDEX]) { afloat[EnumFaceDirection.Constants.UP_INDEX] = f1; } if (f2 > afloat[EnumFaceDirection.Constants.SOUTH_INDEX]) { afloat[EnumFaceDirection.Constants.SOUTH_INDEX] = f2; } } EnumFaceDirection enumfacedirection = EnumFaceDirection.getFacing(p_178408_2_); for (int j1 = 0; j1 < 4; ++j1) { int k1 = i * j1; EnumFaceDirection.VertexInformation enumfacedirection$vertexinformation = enumfacedirection.getVertexInformation(j1); float f8 = afloat[enumfacedirection$vertexinformation.xIndex]; float f3 = afloat[enumfacedirection$vertexinformation.yIndex]; float f4 = afloat[enumfacedirection$vertexinformation.zIndex]; p_178408_1_[k1] = Float.floatToRawIntBits(f8); p_178408_1_[k1 + 1] = Float.floatToRawIntBits(f3); p_178408_1_[k1 + 2] = Float.floatToRawIntBits(f4); for (int l = 0; l < 4; ++l) { int i1 = i * l; float f5 = Float.intBitsToFloat(aint[i1]); float f6 = Float.intBitsToFloat(aint[i1 + 1]); float f7 = Float.intBitsToFloat(aint[i1 + 2]); if (MathHelper.epsilonEquals(f8, f5) && MathHelper.epsilonEquals(f3, f6) && MathHelper.epsilonEquals(f4, f7)) { p_178408_1_[k1 + 4] = aint[i1 + 4]; p_178408_1_[k1 + 4 + 1] = aint[i1 + 4 + 1]; } } } }
private void applyFacing(int[] p_178408_1_, EnumFacing p_178408_2_) { int[] aint = new int[p_178408_1_.length]; System.arraycopy(p_178408_1_, 0, aint, 0, p_178408_1_.length); float[] afloat = new float[EnumFacing.values().length]; afloat[EnumFaceDirection.Constants.WEST_INDEX] = 999.0F; afloat[EnumFaceDirection.Constants.DOWN_INDEX] = 999.0F; afloat[EnumFaceDirection.Constants.NORTH_INDEX] = 999.0F; afloat[EnumFaceDirection.Constants.EAST_INDEX] = -999.0F; afloat[EnumFaceDirection.Constants.UP_INDEX] = -999.0F; afloat[EnumFaceDirection.Constants.SOUTH_INDEX] = -999.0F; for (int i = 0; i < 4; ++i) { int j = 7 * i; float f = Float.intBitsToFloat(aint[j]); float f1 = Float.intBitsToFloat(aint[j + 1]); float f2 = Float.intBitsToFloat(aint[j + 2]); if (f < afloat[EnumFaceDirection.Constants.WEST_INDEX]) { afloat[EnumFaceDirection.Constants.WEST_INDEX] = f; } if (f1 < afloat[EnumFaceDirection.Constants.DOWN_INDEX]) { afloat[EnumFaceDirection.Constants.DOWN_INDEX] = f1; } if (f2 < afloat[EnumFaceDirection.Constants.NORTH_INDEX]) { afloat[EnumFaceDirection.Constants.NORTH_INDEX] = f2; } if (f > afloat[EnumFaceDirection.Constants.EAST_INDEX]) { afloat[EnumFaceDirection.Constants.EAST_INDEX] = f; } if (f1 > afloat[EnumFaceDirection.Constants.UP_INDEX]) { afloat[EnumFaceDirection.Constants.UP_INDEX] = f1; } if (f2 > afloat[EnumFaceDirection.Constants.SOUTH_INDEX]) { afloat[EnumFaceDirection.Constants.SOUTH_INDEX] = f2; } } EnumFaceDirection enumfacedirection = EnumFaceDirection.getFacing(p_178408_2_); for (int i1 = 0; i1 < 4; ++i1) { int j1 = 7 * i1; EnumFaceDirection.VertexInformation enumfacedirection$vertexinformation = enumfacedirection.getVertexInformation(i1); float f8 = afloat[enumfacedirection$vertexinformation.xIndex]; float f3 = afloat[enumfacedirection$vertexinformation.yIndex]; float f4 = afloat[enumfacedirection$vertexinformation.zIndex]; p_178408_1_[j1] = Float.floatToRawIntBits(f8); p_178408_1_[j1 + 1] = Float.floatToRawIntBits(f3); p_178408_1_[j1 + 2] = Float.floatToRawIntBits(f4); for (int k = 0; k < 4; ++k) { int l = 7 * k; float f5 = Float.intBitsToFloat(aint[l]); float f6 = Float.intBitsToFloat(aint[l + 1]); float f7 = Float.intBitsToFloat(aint[l + 2]); if (MathHelper.epsilonEquals(f8, f5) && MathHelper.epsilonEquals(f3, f6) && MathHelper.epsilonEquals(f4, f7)) { p_178408_1_[j1 + 4] = aint[l + 4]; p_178408_1_[j1 + 4 + 1] = aint[l + 4 + 1]; } } } }