diff --git a/src/main/java/vazkii/botania/client/core/handler/ModelHandler.java b/src/main/java/vazkii/botania/client/core/handler/ModelHandler.java index 119a13c90..9add37859 100644 --- a/src/main/java/vazkii/botania/client/core/handler/ModelHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/ModelHandler.java @@ -703,33 +703,16 @@ public final class ModelHandler { } private static void registerStateMappers() { - // Override to let smartmodels work, see RenderEventHandler - ModelLoader.setCustomStateMapper(ModBlocks.floatingSpecialFlower, new StateMapperBase() { - @Override - protected ModelResourceLocation getModelResourceLocation(IBlockState state) { - return new ModelResourceLocation("botania:floatingSpecialFlower", "normal"); - } - }); - - ModelLoader.setCustomStateMapper(ModBlocks.floatingFlower, new StateMapperBase() { - @Override - protected ModelResourceLocation getModelResourceLocation(IBlockState state) { - return new ModelResourceLocation("botania:miniIsland", "normal"); - } - }); - - ModelLoader.setCustomStateMapper(ModBlocks.platform, new StateMapperBase() { - @Override - protected ModelResourceLocation getModelResourceLocation(IBlockState state) { - return new ModelResourceLocation("botania:platform", "normal"); - } - }); + // Override to let smart models work, see MiscellaneousIcons + ModelLoader.setCustomStateMapper(ModBlocks.floatingSpecialFlower, new StateMap.Builder().ignore(BotaniaStateProps.COLOR).build()); + ModelLoader.setCustomStateMapper(ModBlocks.floatingFlower, new StateMap.Builder().ignore(BotaniaStateProps.COLOR).build()); + ModelLoader.setCustomStateMapper(ModBlocks.platform, new StateMap.Builder().ignore(BotaniaStateProps.PLATFORM_VARIANT).build()); // Ignore vanilla facing, variant in double flower ModelLoader.setCustomStateMapper(ModBlocks.doubleFlower1, (new StateMap.Builder()).ignore(BlockDoublePlant.VARIANT, BlockDoublePlant.field_181084_N).build()); ModelLoader.setCustomStateMapper(ModBlocks.doubleFlower2, (new StateMap.Builder()).ignore(BlockDoublePlant.VARIANT, BlockDoublePlant.field_181084_N).build()); - // Ignore color in unstable cube, mana beacon, special flower, and petals (handled by color multiplier) + // Ignore color in unstable cube, mana beacon, special flower, and petals (handled by Block.colorMultiplier) ModelLoader.setCustomStateMapper(ModBlocks.unstableBlock, (new StateMap.Builder()).ignore(BotaniaStateProps.COLOR).build()); ModelLoader.setCustomStateMapper(ModBlocks.manaBeacon, (new StateMap.Builder()).ignore(BotaniaStateProps.COLOR).build()); ModelLoader.setCustomStateMapper(ModBlocks.petalBlock, (new StateMap.Builder()).ignore(BotaniaStateProps.COLOR).build()); diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileCorporeaCrystalCube.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileCorporeaCrystalCube.java index 63bdf3d9b..8bb440b54 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileCorporeaCrystalCube.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileCorporeaCrystalCube.java @@ -143,7 +143,8 @@ public class RenderTileCorporeaCrystalCube extends TileEntitySpecialRenderer, IBakedModel> modelCache = CacheBuilder.newBuilder().maximumSize(10).expireAfterWrite(100, TimeUnit.MILLISECONDS).build(new CacheLoader, IBakedModel>() + // Botania - expanded size to 15 to hold all states, expanded expire time to 1 sec for performance + protected static final LoadingCache, IBakedModel> modelCache = CacheBuilder.newBuilder().maximumSize(15).expireAfterWrite(1000, TimeUnit.MILLISECONDS).build(new CacheLoader, IBakedModel>() { public IBakedModel load(Pair key) throws Exception {