@Override 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 ); 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 ); UVLModelWrapper.this.uvlightmap.put( blockFace, this.parseUVL( jsonobject ) ); return blockFace; }
public static BakedQuad createQuad(EnumFacing facing, Vector3f from, Vector3f to, TextureAtlasSprite sprite) { float[] uvs = getFaceUvs(facing, to, from); BlockFaceUV uv = new BlockFaceUV(uvs, 0); BlockPartFace bpf = new BlockPartFace(facing, 0, "", uv); return bakery.makeBakedQuad(from, to, bpf, sprite, facing, ModelRotation.X0_Y0, null, true, true); }
Map.Entry<EnumFacing, BlockPartFace> entry = itrMapFace.next(); if(entry.getValue()!=null){ faces.put(entry.getKey(), new BlockPartFace(null, trimIndex, LAYER + trimIndex, entry.getValue().blockFaceUV)); face = part.mapFaces.get(EnumFacing.SOUTH); if (face!=null && (face.tintIndex != backIndex || face.texture == null || !face.texture.equals(LAYER + backIndex))) { part.mapFaces.put(EnumFacing.SOUTH, new BlockPartFace(face.cullFace, backIndex, LAYER + backIndex, face.blockFaceUV)); if(trimIndex!=-1){ if (face!=null && (face.tintIndex != trimIndex || face.texture == null || !face.texture.equals(LAYER + trimIndex))) { part.mapFaces.put(EnumFacing.NORTH, new BlockPartFace(face.cullFace, trimIndex, LAYER + trimIndex, face.blockFaceUV)); part.mapFaces.put(EnumFacing.NORTH, new BlockPartFace(face.cullFace, 0, BASE_LAYER, face.blockFaceUV)); part.mapFaces.put(EnumFacing.SOUTH, new BlockPartFace(face.cullFace, 0, BASE_LAYER, face.blockFaceUV));
@Override public IModelBakerModel bakeModel(boolean flip) { ModelRotation modelRotation = ModelRotation.X0_Y0; if (flip) { modelRotation = ModelRotation.X0_Y180; } // Add baked models to the current model. for (Pair<IBlockState, IBakedModel> bakedModel : bakedModels) { currentModel.addModelQuads(bakedModel); } for (Pair<IBlockState, IBakedModel> bakedModel : bakedModelsPost) { currentModel.addModelQuadsPost(bakedModel); } for (ModelBakerFace face : faces) { EnumFacing facing = face.face; BlockFaceUV uvFace = new BlockFaceUV(UVS, 0); BlockPartFace partFace = new BlockPartFace(facing, face.colorIndex, "", uvFace); BakedQuad quad = FACE_BAKERY.makeBakedQuad(POS_FROM, POS_TO, partFace, face.spite, facing, modelRotation, null, true, true); currentModel.addQuad(facing, quad); } return currentModel; }
final BlockPartFace bpf = new BlockPartFace( side, 1, "", uv );
@Override public IModelBakerModel bakeModel(boolean flip) { ModelRotation mr = ModelRotation.X0_Y0; if (flip) { mr = ModelRotation.X0_Y180; } //Add baked models to the current model. for (Pair<IBlockState, IBakedModel> bakedModel : bakedModels) { currentModel.addModelQuads(bakedModel); } for (Pair<IBlockState, IBakedModel> bakedModel : bakedModelsPost) { currentModel.addModelQuadsPost(bakedModel); } for (BoundModelBakerFace face : faces) { final AxisAlignedBB modelBounds = face.modelBounds; final Vector3f from = new Vector3f((float) modelBounds.minX * 16.0f, (float) modelBounds.minY * 16.0f, (float) modelBounds.minZ * 16.0f); final Vector3f to = new Vector3f((float) modelBounds.maxX * 16.0f, (float) modelBounds.maxY * 16.0f, (float) modelBounds.maxZ * 16.0f); final EnumFacing myFace = face.face; final float[] uvs = getFaceUvs(myFace, to, from); final BlockFaceUV uv = new BlockFaceUV(uvs, 0); final BlockPartFace bpf = new BlockPartFace(myFace, face.colorIndex, "", uv); BakedQuad bf = faceBakery.makeBakedQuad(from, to, bpf, face.spite, myFace, mr, null, true, true); currentModel.addQuad(myFace, bf); } return currentModel; }
final BlockPartFace bpf = new BlockPartFace( myFace, 0, "", uv );