Skip to content

Commit

Permalink
Replace all the bookshelf models, in a more robust manner
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamSpen210 committed Dec 29, 2019
1 parent 612cbd9 commit d02f290
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -11,9 +11,11 @@
import knightminer.inspirations.library.client.ClientUtil;
import knightminer.inspirations.library.util.TextureBlockUtil;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScreenManager;
import net.minecraft.client.renderer.BlockModelShapes;
import net.minecraft.client.renderer.color.BlockColors;
import net.minecraft.client.renderer.color.ItemColors;
import net.minecraft.client.renderer.model.ModelResourceLocation;
Expand Down Expand Up @@ -184,8 +186,8 @@ private static void replaceBookshelfModel(ModelBakeEvent event, BookshelfBlock s
if (shelf.getRegistryName() == null) {
throw new AssertionError("Null registry name");
}
for(Direction facing : Direction.Plane.HORIZONTAL){
ModelResourceLocation location = new ModelResourceLocation(shelf.getRegistryName(), String.format("facing=%s", facing.getName()));
for (BlockState state:shelf.getStateContainer().getValidStates()) {
ModelResourceLocation location = BlockModelShapes.getModelLocation(shelf.getRegistryName(), state);
replaceModel(event, location, BookshelfModel::new);
}
replaceTexturedModel(event, new ModelResourceLocation(shelf.getRegistryName(), "inventory"), "texture",true);
Expand Down

0 comments on commit d02f290

Please sign in to comment.