Search in sources :

Example 1 with ModelConveyor

use of blusunrize.immersiveengineering.client.models.ModelConveyor in project ImmersiveEngineering by BluSunrize.

the class ImmersiveModelRegistry method onModelBakeEvent.

@SubscribeEvent
public void onModelBakeEvent(ModelBakeEvent event) {
    for (Map.Entry<ModelResourceLocation, ItemModelReplacement> entry : itemModelReplacements.entrySet()) {
        Object object = event.getModelRegistry().getObject(entry.getKey());
        if (object instanceof IBakedModel) {
            try {
                IBakedModel existingModel = (IBakedModel) object;
                event.getModelRegistry().putObject(entry.getKey(), entry.getValue().createBakedModel(existingModel));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
    ModelResourceLocation mLoc = new ModelResourceLocation(new ResourceLocation("immersiveengineering", IEContent.itemCoresample.itemName), "inventory");
    event.getModelRegistry().putObject(mLoc, new ModelCoresample());
    ModelConveyor modelConveyor = new ModelConveyor();
    mLoc = new ModelResourceLocation(new ResourceLocation("immersiveengineering", "conveyor"), "normal");
    event.getModelRegistry().putObject(mLoc, modelConveyor);
    mLoc = new ModelResourceLocation(new ResourceLocation("immersiveengineering", "conveyor"), "inventory");
    event.getModelRegistry().putObject(mLoc, modelConveyor);
}
Also used : ModelConveyor(blusunrize.immersiveengineering.client.models.ModelConveyor) ModelCoresample(blusunrize.immersiveengineering.client.models.ModelCoresample) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) ResourceLocation(net.minecraft.util.ResourceLocation) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) IBakedModel(net.minecraft.client.renderer.block.model.IBakedModel) HashMap(java.util.HashMap) Map(java.util.Map) ImmutableMap(com.google.common.collect.ImmutableMap) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

ModelConveyor (blusunrize.immersiveengineering.client.models.ModelConveyor)1 ModelCoresample (blusunrize.immersiveengineering.client.models.ModelCoresample)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 IBakedModel (net.minecraft.client.renderer.block.model.IBakedModel)1 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1