Search in sources :

Example 1 with FeedthroughModel

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

the class ImmersiveModelRegistry method onModelBakeEvent.

@SubscribeEvent
public void onModelBakeEvent(ModelBakeEvent event) {
    for (Map.Entry<ModelResourceLocation, ItemModelReplacement> entry : itemModelReplacements.entrySet()) {
        IBakedModel object = event.getModelRegistry().getObject(entry.getKey());
        if (object != null) {
            try {
                event.getModelRegistry().putObject(entry.getKey(), entry.getValue().createBakedModel(object));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
    ModelResourceLocation mLoc = new ModelResourceLocation(new ResourceLocation("immersiveengineering", IEContent.itemCoresample.itemName), "inventory");
    event.getModelRegistry().putObject(mLoc, new ModelCoresample());
    IConveyorBelt belt = ConveyorHandler.getConveyor(new ResourceLocation(ImmersiveEngineering.MODID, "conveyor"), null);
    ModelConveyor modelConveyor = new ModelConveyor(belt);
    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);
    mLoc = new ModelResourceLocation(new ResourceLocation(ImmersiveEngineering.MODID, "connector"), "inventory,type=feedthrough");
    event.getModelRegistry().putObject(mLoc, new FeedthroughModel());
}
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) IConveyorBelt(blusunrize.immersiveengineering.api.tool.ConveyorHandler.IConveyorBelt) 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) FeedthroughModel(blusunrize.immersiveengineering.client.models.smart.FeedthroughModel) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

IConveyorBelt (blusunrize.immersiveengineering.api.tool.ConveyorHandler.IConveyorBelt)1 ModelConveyor (blusunrize.immersiveengineering.client.models.ModelConveyor)1 ModelCoresample (blusunrize.immersiveengineering.client.models.ModelCoresample)1 FeedthroughModel (blusunrize.immersiveengineering.client.models.smart.FeedthroughModel)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