Search in sources :

Example 1 with BlockSludge

use of micdoodle8.mods.galacticraft.planets.mars.blocks.BlockSludge in project Galacticraft by micdoodle8.

the class MarsModule method preInit.

@Override
public void preInit(FMLPreInitializationEvent event) {
    MinecraftForge.EVENT_BUS.register(new EventHandlerMars());
    if (!FluidRegistry.isFluidRegistered("bacterialsludge")) {
        ResourceLocation stillIcon = new ResourceLocation(GalacticraftPlanets.TEXTURE_PREFIX + "blocks/fluids/sludge_still");
        ResourceLocation flowingIcon = new ResourceLocation(GalacticraftPlanets.TEXTURE_PREFIX + "blocks/fluids/sludge_flow");
        sludgeGC = new Fluid("bacterialsludge", stillIcon, flowingIcon).setDensity(800).setViscosity(1500);
        FluidRegistry.registerFluid(sludgeGC);
    } else {
        GCLog.info("Galacticraft sludge is not default, issues may occur.");
    }
    sludge = FluidRegistry.getFluid("bacterialsludge");
    if (sludge.getBlock() == null) {
        MarsBlocks.blockSludge = new BlockSludge("sludge");
        ((BlockSludge) MarsBlocks.blockSludge).setQuantaPerBlock(3);
        MarsBlocks.registerBlock(MarsBlocks.blockSludge, ItemBlockDesc.class);
        sludge.setBlock(MarsBlocks.blockSludge);
    } else {
        MarsBlocks.blockSludge = sludge.getBlock();
    }
    if (MarsBlocks.blockSludge != null) {
        MarsItems.bucketSludge = new ItemBucketGC(MarsBlocks.blockSludge).setUnlocalizedName("bucket_sludge");
        MarsItems.registerItem(MarsItems.bucketSludge);
        FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("bacterialsludge", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(MarsItems.bucketSludge), new ItemStack(Items.bucket));
    }
    EventHandlerGC.bucketList.put(MarsBlocks.blockSludge, MarsItems.bucketSludge);
    MarsBlocks.initBlocks();
    MarsItems.initItems();
}
Also used : BlockSludge(micdoodle8.mods.galacticraft.planets.mars.blocks.BlockSludge) ItemBucketGC(micdoodle8.mods.galacticraft.core.items.ItemBucketGC) ResourceLocation(net.minecraft.util.ResourceLocation) Fluid(net.minecraftforge.fluids.Fluid) ItemStack(net.minecraft.item.ItemStack)

Aggregations

ItemBucketGC (micdoodle8.mods.galacticraft.core.items.ItemBucketGC)1 BlockSludge (micdoodle8.mods.galacticraft.planets.mars.blocks.BlockSludge)1 ItemStack (net.minecraft.item.ItemStack)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 Fluid (net.minecraftforge.fluids.Fluid)1