Search in sources :

Example 6 with FluidDefinition

use of buildcraft.core.lib.fluids.FluidDefinition in project BuildCraft by BuildCraft.

the class BuildCraftEnergy method registerModels.

@SubscribeEvent
@SideOnly(Side.CLIENT)
public void registerModels(ModelBakeEvent event) {
    FluidDefinition[] arr = { oil, fuel, redPlasma };
    if (Loader.isModLoaded("BuildCraft|Factory")) {
        arr[0] = null;
        arr[1] = null;
    }
    if (!BuildCraftCore.DEVELOPER_MODE) {
        arr[2] = null;
    }
    for (FluidDefinition def : arr) {
        if (def == null)
            continue;
        IModel model = new ModelFluid(def.fluid);
        IBakedModel baked = model.bake(ModelRotation.X0_Y0, DefaultVertexFormats.BLOCK, ModelLoader.defaultTextureGetter());
        ModelResourceLocation loc = ModelHelper.getBlockResourceLocation(def.block);
        event.modelRegistry.putObject(loc, baked);
    }
}
Also used : FluidDefinition(buildcraft.core.lib.fluids.FluidDefinition) IModel(net.minecraftforge.client.model.IModel) ModelFluid(net.minecraftforge.client.model.ModelFluid) IBakedModel(net.minecraft.client.renderer.block.model.IBakedModel) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 7 with FluidDefinition

use of buildcraft.core.lib.fluids.FluidDefinition in project BuildCraft by BuildCraft.

the class ComplexRefiningManager method addBiDirectionalHeatExchange.

private static void addBiDirectionalHeatExchange(FluidDefinition[] coldToHot, int amount, int ticks) {
    IComplexRefineryRecipeManager manager = BuildcraftRecipeRegistry.complexRefinery;
    for (int h = 1; h < coldToHot.length; h++) {
        FluidDefinition cold = coldToHot[h - 1];
        FluidDefinition hot = coldToHot[h];
        manager.addHeatableRecipe(cold.createFluidStack(amount), hot.createFluidStack(amount), h - 1, h, ticks, false);
        manager.addCoolableRecipe(hot.createFluidStack(amount), cold.createFluidStack(amount), h, h - 1, ticks, false);
    }
}
Also used : FluidDefinition(buildcraft.core.lib.fluids.FluidDefinition) IComplexRefineryRecipeManager(buildcraft.api.recipes.IComplexRefineryRecipeManager)

Aggregations

FluidDefinition (buildcraft.core.lib.fluids.FluidDefinition)7 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)4 SpriteColourMapper (buildcraft.core.lib.client.sprite.SpriteColourMapper)2 IBakedModel (net.minecraft.client.renderer.block.model.IBakedModel)2 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)2 IModel (net.minecraftforge.client.model.IModel)2 ModelFluid (net.minecraftforge.client.model.ModelFluid)2 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)2 IComplexRefineryRecipeManager (buildcraft.api.recipes.IComplexRefineryRecipeManager)1