BiomesOPlenty/src/minecraft/biomesoplenty/configuration/BOPLiquids.java

69 lines
3.4 KiB
Java
Raw Normal View History

2013-05-25 02:33:57 +00:00
package biomesoplenty.configuration;
import net.minecraft.block.material.Material;
2013-05-25 02:33:57 +00:00
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.liquids.LiquidContainerData;
import net.minecraftforge.liquids.LiquidContainerRegistry;
import net.minecraftforge.liquids.LiquidDictionary;
2013-05-25 02:33:57 +00:00
import net.minecraftforge.liquids.LiquidStack;
2013-05-25 09:25:46 +00:00
import biomesoplenty.api.Liquids;
import biomesoplenty.items.ItemBOPBucket;
import biomesoplenty.liquids.BlockFluidLiquidPoison;
import biomesoplenty.liquids.BlockFluidSpringWater;
import biomesoplenty.liquids.LiquidPoisonFluid;
import biomesoplenty.liquids.SpringWaterFluid;
import com.google.common.base.Optional;
2013-05-25 02:33:57 +00:00
import cpw.mods.fml.common.registry.GameRegistry;
2013-05-31 10:34:02 +00:00
public class BOPLiquids
{
2013-05-25 02:33:57 +00:00
public static void init()
{
registerFluids();
2013-05-25 02:33:57 +00:00
initializeLiquids();
initializeContainers();
registerBlocks();
2013-05-25 02:33:57 +00:00
}
2013-05-31 10:34:02 +00:00
private static void registerFluids()
{
Liquids.liquidPoisonFluid = Optional.of(new LiquidPoisonFluid("Liquid Poison").setBlockID(BOPConfiguration.liquidPoisonStillID));
FluidRegistry.registerFluid(Liquids.liquidPoisonFluid.get());
2013-05-31 10:34:02 +00:00
Liquids.springWaterFluid = Optional.of(new SpringWaterFluid("Spring Water").setBlockID(BOPConfiguration.springWaterStillID));
FluidRegistry.registerFluid(Liquids.springWaterFluid.get());
}
2013-05-25 02:33:57 +00:00
private static void initializeLiquids()
{
2013-06-09 08:15:39 +00:00
Liquids.liquidPoison = Optional.of(new BlockFluidLiquidPoison(BOPConfiguration.liquidPoisonStillID, Liquids.liquidPoisonFluid.get(), Material.water).setUnlocalizedName("bop.liquidPoison"));
Liquids.liquidPoisonLiquidStack = Optional.of(LiquidDictionary.getOrCreateLiquid("Liquid Poison", new LiquidStack(Liquids.liquidPoisonFluid.get().getBlockID(), 1)));
2013-05-31 10:34:02 +00:00
2013-06-09 08:15:39 +00:00
Liquids.springWater = Optional.of(new BlockFluidSpringWater(BOPConfiguration.springWaterStillID, Liquids.springWaterFluid.get(), Material.water).setUnlocalizedName("bop.springWater"));
Liquids.springWaterLiquidStack = Optional.of(LiquidDictionary.getOrCreateLiquid("Spring Water", new LiquidStack(Liquids.springWaterFluid.get().getBlockID(), 1)));
}
private static void initializeContainers()
{
2013-06-09 20:47:19 +00:00
Liquids.bopBucket = Optional.of((new ItemBOPBucket(BOPConfiguration.bopBucketID).setMaxStackSize(1).setUnlocalizedName("bop.bopBucket").setContainerItem(Item.bucketEmpty)));
2013-05-31 10:34:02 +00:00
//TODO: Remove upon Fluid API being integrated into Forge
LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getLiquid("Liquid Poison", LiquidContainerRegistry.BUCKET_VOLUME), new ItemStack(Liquids.bopBucket.get(), 1, 1), new ItemStack(Item.bucketEmpty)));
2013-06-09 08:15:39 +00:00
LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getLiquid("Spring Water", LiquidContainerRegistry.BUCKET_VOLUME), new ItemStack(Liquids.bopBucket.get(), 1, 0), new ItemStack(Item.bucketEmpty)));
FluidContainerRegistry.registerFluidContainer(Liquids.liquidPoisonFluid.get(), new ItemStack(Liquids.bopBucket.get(), 1, 1), new ItemStack(Item.bucketEmpty));
2013-06-09 08:15:39 +00:00
FluidContainerRegistry.registerFluidContainer(Liquids.springWaterFluid.get(), new ItemStack(Liquids.bopBucket.get(), 1, 0), new ItemStack(Item.bucketEmpty));
2013-05-25 02:33:57 +00:00
}
private static void registerBlocks()
2013-05-25 02:33:57 +00:00
{
GameRegistry.registerBlock(Liquids.liquidPoison.get(), "liquidPoison");
2013-06-09 08:15:39 +00:00
GameRegistry.registerBlock(Liquids.springWater.get(), "springWater");
2013-05-25 02:33:57 +00:00
}
}