Search in sources :

Example 1 with EventHandlerVenus

use of micdoodle8.mods.galacticraft.planets.venus.event.EventHandlerVenus in project Galacticraft by micdoodle8.

the class VenusModule method preInit.

@Override
public void preInit(FMLPreInitializationEvent event) {
    MinecraftForge.EVENT_BUS.register(new EventHandlerVenus());
    if (!FluidRegistry.isFluidRegistered("sulphuricacid")) {
        ResourceLocation stillIcon = new ResourceLocation(GalacticraftPlanets.TEXTURE_PREFIX + "blocks/fluids/sulphuric_acid_still");
        ResourceLocation flowingIcon = new ResourceLocation(GalacticraftPlanets.TEXTURE_PREFIX + "blocks/fluids/sulphuric_acid_flow");
        sulphuricAcidGC = new Fluid("sulphuricacid", stillIcon, flowingIcon).setDensity(6229).setViscosity(1400);
        FluidRegistry.registerFluid(sulphuricAcidGC);
    } else {
        GCLog.info("Galacticraft sulphuric acid is not default, issues may occur.");
    }
    sulphuricAcid = FluidRegistry.getFluid("sulphuricacid");
    if (sulphuricAcid.getBlock() == null) {
        VenusBlocks.sulphuricAcid = new BlockSulphuricAcid("sulphuric_acid");
        ((BlockSulphuricAcid) VenusBlocks.sulphuricAcid).setQuantaPerBlock(5);
        VenusBlocks.registerBlock(VenusBlocks.sulphuricAcid, ItemBlockDesc.class);
        sulphuricAcid.setBlock(VenusBlocks.sulphuricAcid);
    } else {
        VenusBlocks.sulphuricAcid = sulphuricAcid.getBlock();
    }
    if (VenusBlocks.sulphuricAcid != null) {
        VenusItems.bucketSulphuricAcid = new ItemBucketGC(VenusBlocks.sulphuricAcid).setUnlocalizedName("bucket_sulphuric_acid");
        VenusItems.registerItem(VenusItems.bucketSulphuricAcid);
        FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("sulphuricacid", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(VenusItems.bucketSulphuricAcid), new ItemStack(Items.bucket));
    }
    EventHandlerGC.bucketList.put(VenusBlocks.sulphuricAcid, VenusItems.bucketSulphuricAcid);
    VenusBlocks.initBlocks();
    VenusItems.initItems();
}
Also used : ItemBucketGC(micdoodle8.mods.galacticraft.core.items.ItemBucketGC) ResourceLocation(net.minecraft.util.ResourceLocation) Fluid(net.minecraftforge.fluids.Fluid) ItemStack(net.minecraft.item.ItemStack) BlockSulphuricAcid(micdoodle8.mods.galacticraft.planets.venus.blocks.BlockSulphuricAcid) EventHandlerVenus(micdoodle8.mods.galacticraft.planets.venus.event.EventHandlerVenus)

Aggregations

ItemBucketGC (micdoodle8.mods.galacticraft.core.items.ItemBucketGC)1 BlockSulphuricAcid (micdoodle8.mods.galacticraft.planets.venus.blocks.BlockSulphuricAcid)1 EventHandlerVenus (micdoodle8.mods.galacticraft.planets.venus.event.EventHandlerVenus)1 ItemStack (net.minecraft.item.ItemStack)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 Fluid (net.minecraftforge.fluids.Fluid)1