Java 类net.minecraftforge.client.model.ModelProcessingHelper 实例源码

项目:EnderIO    文件:PaintRegistry.java   
@SideOnly(Side.CLIENT)
private IBakedModel paintModel(IModel sourceModel, final @Nullable IBlockState paintSource, IModelState rotation, final PaintMode paintMode) {
  IModelState state = sourceModel.getDefaultState();
  state = combine(state, rotation);
  if (state instanceof UVLock) {
    sourceModel = ModelProcessingHelper.uvlock(sourceModel, true);
    state = ((UVLock) state).getParent();
  }
  return sourceModel.bake(state, Attributes.DEFAULT_BAKED_FORMAT, new Function<ResourceLocation, TextureAtlasSprite>() {
    @Override
    public TextureAtlasSprite apply(@Nullable ResourceLocation location) {
      String locationString = location == null ? "" : location.toString();
      if (paintMode != PaintMode.TAGGED_TEXTURES || locationString.endsWith("PAINT")) {
        if (paintSource == null) {
          return Minecraft.getMinecraft().getTextureMapBlocks().getMissingSprite();
        } else {
          return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getTexture(paintSource);
        }
      } else {
        return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(locationString);
      }
    }

    @Override
    public boolean equals(@Nullable Object obj) {
      return super.equals(obj);
    }

    @Override
    public int hashCode() {
      return super.hashCode();
    }
  });
}
项目:Toms-Mod    文件:CableModel.java   
private static IModel getModel(ResourceLocation loc) {
    return ModelProcessingHelper.uvlock(ModelLoaderRegistry.getModelOrLogError(loc, "Couldn't load " + loc.toString() + " for tomsmodstorage:tm.cable"), true);
}
项目:ARKCraft    文件:ModelCable.java   
private static IModel getModel(ResourceLocation loc) {
    return ModelProcessingHelper.uvlock(ModelLoaderRegistry.getModelOrLogError(loc, "Couldn't load " + loc.toString() + " for arkcraft:cable"), true);
}