Move specialflower statemapper to where it belongs

This commit is contained in:
Vincent Lee committed 2016-02-22 23:17:52 -06:00
1 parent 1ed833a4a7
commit 47001131b0
2 files changed
+4 -9

No files matched your search

@@ -88,15 +88,6 @@ public class MiscellaneousIcons {
@SubscribeEvent
public void onModelBake(ModelBakeEvent evt) {
// BlockSpecialFlower
// Ignore all vanilla rules, redirect all blockstates to blockstates/specialFlower.json#normal
evt.modelManager.getBlockModelShapes().registerBlockWithStateMapper(ModBlocks.specialFlower, new DefaultStateMapper() {
@Override
public ModelResourceLocation getModelResourceLocation(IBlockState state) {
return new ModelResourceLocation("botania:specialFlower");
}
});
// Floating flowers
evt.modelRegistry.putObject(new ModelResourceLocation("botania:miniIsland", "normal"), FloatingFlowerModel.INSTANCE);
evt.modelRegistry.putObject(new ModelResourceLocation("botania:miniIsland", "inventory"), FloatingFlowerModel.INSTANCE);
@@ -20,6 +20,7 @@ import net.minecraft.block.BlockWall;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.block.statemap.DefaultStateMapper;
import net.minecraft.client.renderer.block.statemap.StateMap;
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
import net.minecraft.client.resources.IReloadableResourceManager;
@@ -703,6 +704,9 @@ public final class ModelHandler {
}
private static void registerStateMappers() {
// Override to let custom model loader work, see SpecialFlowerModel
ModelLoader.setCustomStateMapper(ModBlocks.specialFlower, new StateMap.Builder().ignore(BotaniaStateProps.COLOR).ignore(((BlockFlower) ModBlocks.specialFlower).getTypeProperty()).build());
// 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());