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-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;
|
|
|
|
import cpw.mods.fml.common.registry.LanguageRegistry;
|
|
|
|
|
2013-05-25 04:08:06 +00:00
|
|
|
public class BOPLiquids
|
2013-05-28 11:22:54 +00:00
|
|
|
{
|
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 04:08:06 +00:00
|
|
|
registerContainerNames();
|
|
|
|
registerLiquidNames();
|
2013-05-25 02:33:57 +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-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-05-28 11:22:54 +00:00
|
|
|
Liquids.liquidPoison = Optional.of(new BlockFluidLiquidPoison(BOPConfiguration.liquidPoisonStillID, Liquids.liquidPoisonFluid.get(), Material.water).setUnlocalizedName("Liquid Poison"));
|
|
|
|
|
|
|
|
Liquids.liquidPoisonLiquidStack = Optional.of(LiquidDictionary.getOrCreateLiquid("Liquid Poison", new LiquidStack(Liquids.liquidPoisonFluid.get().getBlockID(), 1)));
|
2013-05-29 01:05:27 +00:00
|
|
|
|
|
|
|
Liquids.springWater = Optional.of(new BlockFluidSpringWater(BOPConfiguration.springWaterStillID, Liquids.springWaterFluid.get(), Material.water).setUnlocalizedName("Spring Water"));
|
|
|
|
|
|
|
|
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-05-25 13:22:37 +00:00
|
|
|
Liquids.bopBucket = Optional.of((new ItemBOPBucket(BOPConfiguration.bopBucketID).setMaxStackSize(1).setUnlocalizedName("bopBucket").setContainerItem(Item.bucketEmpty)));
|
2013-05-25 04:08:06 +00:00
|
|
|
|
2013-05-28 11:22:54 +00:00
|
|
|
FluidContainerRegistry.registerFluidContainer(Liquids.springWaterFluid.get(), 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-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.springWater.get(), "springWater");
|
|
|
|
GameRegistry.registerBlock(Liquids.liquidPoison.get(), "liquidPoison");
|
2013-05-25 02:33:57 +00:00
|
|
|
}
|
2013-05-25 04:08:06 +00:00
|
|
|
|
|
|
|
private static void registerContainerNames()
|
|
|
|
{
|
2013-05-25 13:22:37 +00:00
|
|
|
LanguageRegistry.addName(new ItemStack(Liquids.bopBucket.get(), 1, 0), "Spring Water Bucket");
|
|
|
|
LanguageRegistry.addName(new ItemStack(Liquids.bopBucket.get(), 1, 1), "Liquid Poison Bucket");
|
2013-05-25 04:08:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private static void registerLiquidNames()
|
2013-05-25 02:33:57 +00:00
|
|
|
{
|
2013-05-28 11:22:54 +00:00
|
|
|
LanguageRegistry.addName(Liquids.springWater.get(), "Spring Water");
|
|
|
|
LanguageRegistry.addName(Liquids.liquidPoison.get(), "Liquid Poison");
|
2013-05-25 02:33:57 +00:00
|
|
|
}
|
|
|
|
}
|