public Optional<TRSRTransformation> apply(Optional<? extends IModelPart> part) {
   Optional<TRSRTransformation> normal = state.apply(part);
   Optional<TRSRTransformation> multi =
       state.apply(Optional.of(new PartPart(model, index, part)));
   if (normal.isPresent() && multi.isPresent()) {
     return Optional.of(normal.get().compose(multi.get()));
   }
   return normal.or(multi);
 }
Example #2
0
 public IBakedModel bake(
     IModelState state,
     VertexFormat format,
     Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {
   ImmutableMap<TransformType, TRSRTransformation> map =
       IPerspectiveAwareModel.MapWrapper.getTransforms(state);
   return new BakedFluid(
       state.apply(Optional.<IModelPart>absent()),
       map,
       format,
       fluid.getColor(),
       bakedTextureGetter.apply(fluid.getStill()),
       bakedTextureGetter.apply(fluid.getFlowing()),
       fluid.isGaseous(),
       Optional.<IExtendedBlockState>absent());
 }
 public static IModelState getPartState(IModelState state, IModel model, int index) {
   if (state.apply(Optional.of(new MultiModelPart(model, index))).isPresent()) {
     return new PartState(state, model, index);
   }
   return state;
 }