2013-05-25 02:33:57 +00:00
|
|
|
package biomesoplenty.configuration;
|
|
|
|
|
2013-05-28 11:22:54 +00:00
|
|
|
import net.minecraft.block.material.Material;
|
2013-05-25 02:33:57 +00:00
|
|
|
import net.minecraft.item.Item;
|
|
|
|
import net.minecraft.item.ItemStack;
|
2013-05-30 09:41:07 +00:00
|
|
|
import net.minecraftforge.fluids.FluidContainerRegistry;
|
|
|
|
import net.minecraftforge.fluids.FluidRegistry;
|
2013-05-31 11:42:41 +00:00
|
|
|
import net.minecraftforge.liquids.LiquidContainerData;
|
|
|
|
import net.minecraftforge.liquids.LiquidContainerRegistry;
|
2013-05-25 04:08:06 +00:00
|
|
|
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;
|
2013-05-25 04:08:06 +00:00
|
|
|
import biomesoplenty.items.ItemBOPBucket;
|
2013-05-28 11:22:54 +00:00
|
|
|
import biomesoplenty.liquids.BlockFluidLiquidPoison;
|
|
|
|
import biomesoplenty.liquids.BlockFluidSpringWater;
|
|
|
|
import biomesoplenty.liquids.LiquidPoisonFluid;
|
|
|
|
import biomesoplenty.liquids.SpringWaterFluid;
|
2013-05-25 13:22:37 +00:00
|
|
|
|
|
|
|
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()
|
|
|
|
{
|
2013-05-28 11:22:54 +00:00
|
|
|
registerFluids();
|
2013-05-25 02:33:57 +00:00
|
|
|
initializeLiquids();
|
2013-05-25 04:08:06 +00:00
|
|
|
initializeContainers();
|
2013-05-28 11:22:54 +00:00
|
|
|
registerBlocks();
|
2013-05-25 02:33:57 +00:00
|
|
|
}
|
2013-05-31 10:34:02 +00:00
|
|
|
|
2013-05-28 11:22:54 +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
|
|
|
|
2013-05-29 01:05:27 +00:00
|
|
|
Liquids.springWaterFluid = Optional.of(new SpringWaterFluid("Spring Water").setBlockID(BOPConfiguration.springWaterStillID));
|
|
|
|
FluidRegistry.registerFluid(Liquids.springWaterFluid.get());
|
2013-05-28 11:22:54 +00:00
|
|
|
}
|
2013-05-25 04:08:06 +00:00
|
|
|
|
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"));
|
2013-05-28 11:22:54 +00:00
|
|
|
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"));
|
2013-05-29 01:05:27 +00:00
|
|
|
Liquids.springWaterLiquidStack = Optional.of(LiquidDictionary.getOrCreateLiquid("Spring Water", new LiquidStack(Liquids.springWaterFluid.get().getBlockID(), 1)));
|
2013-05-25 04:08:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
2013-05-31 11:42:41 +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)));
|
2013-05-31 11:42:41 +00:00
|
|
|
|
2013-05-28 11:22:54 +00:00
|
|
|
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
|
|
|
}
|
2013-05-25 04:08:06 +00:00
|
|
|
|
2013-05-28 11:22:54 +00:00
|
|
|
private static void registerBlocks()
|
2013-05-25 02:33:57 +00:00
|
|
|
{
|
2013-05-28 11:22:54 +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
|
|
|
}
|
|
|
|
}
|