@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(); } }); }
private static IModel getModel(ResourceLocation loc) { return ModelProcessingHelper.uvlock(ModelLoaderRegistry.getModelOrLogError(loc, "Couldn't load " + loc.toString() + " for tomsmodstorage:tm.cable"), true); }
private static IModel getModel(ResourceLocation loc) { return ModelProcessingHelper.uvlock(ModelLoaderRegistry.getModelOrLogError(loc, "Couldn't load " + loc.toString() + " for arkcraft:cable"), true); }