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

82 lines
3.3 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.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;
import cpw.mods.fml.common.registry.LanguageRegistry;
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();
registerContainerNames();
registerLiquidNames();
2013-05-25 02:33:57 +00:00
}
private static void registerFluids()
{
Liquids.liquidPoisonFluid = Optional.of(new LiquidPoisonFluid("Liquid Poison").setBlockID(BOPConfiguration.liquidPoisonStillID));
FluidRegistry.registerFluid(Liquids.liquidPoisonFluid.get());
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()
{
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)));
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)));
}
private static void initializeContainers()
{
Liquids.bopBucket = Optional.of((new ItemBOPBucket(BOPConfiguration.bopBucketID).setMaxStackSize(1).setUnlocalizedName("bopBucket").setContainerItem(Item.bucketEmpty)));
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
}
private static void registerBlocks()
2013-05-25 02:33:57 +00:00
{
GameRegistry.registerBlock(Liquids.springWater.get(), "springWater");
GameRegistry.registerBlock(Liquids.liquidPoison.get(), "liquidPoison");
2013-05-25 02:33:57 +00:00
}
private static void registerContainerNames()
{
LanguageRegistry.addName(new ItemStack(Liquids.bopBucket.get(), 1, 0), "Spring Water Bucket");
LanguageRegistry.addName(new ItemStack(Liquids.bopBucket.get(), 1, 1), "Liquid Poison Bucket");
}
private static void registerLiquidNames()
2013-05-25 02:33:57 +00:00
{
LanguageRegistry.addName(Liquids.springWater.get(), "Spring Water");
LanguageRegistry.addName(Liquids.liquidPoison.get(), "Liquid Poison");
2013-05-25 02:33:57 +00:00
}
}