ActuallyAdditions/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java

50 lines
1.7 KiB
Java
Raw Normal View History

2016-01-29 17:38:31 +01:00
/*
* This file ("InitFluids.java") is part of the Actually Additions Mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense/
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
* © 2016 Ellpeck
*/
package de.ellpeck.actuallyadditions.mod.fluids;
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockFluidFlowing;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.EnumRarity;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
2016-05-06 22:23:41 +02:00
import java.util.Locale;
2016-01-29 17:38:31 +01:00
public class InitFluids{
public static Fluid fluidCanolaOil;
public static Fluid fluidOil;
public static Block blockCanolaOil;
public static Block blockOil;
public static void init(){
2016-05-06 22:23:41 +02:00
fluidCanolaOil = registerFluid("canolaoil", "blockCanolaOil", EnumRarity.UNCOMMON);
fluidOil = registerFluid("oil", "blockOil", EnumRarity.UNCOMMON);
2016-01-29 17:38:31 +01:00
2016-05-06 22:23:41 +02:00
blockCanolaOil = registerFluidBlock(fluidCanolaOil, Material.WATER, "blockCanolaOil");
blockOil = registerFluidBlock(fluidOil, Material.WATER, "blockOil");
}
2016-01-29 17:38:31 +01:00
2016-05-06 22:23:41 +02:00
private static Fluid registerFluid(String fluidName, String fluidTextureName, EnumRarity rarity){
Fluid fluid = new FluidAA(fluidName.toLowerCase(Locale.ROOT), fluidTextureName).setRarity(rarity);
FluidRegistry.registerFluid(fluid);
FluidRegistry.addBucketForFluid(fluid);
2016-01-29 17:38:31 +01:00
2016-05-06 22:23:41 +02:00
return fluid;
2016-01-29 17:38:31 +01:00
}
2016-05-06 22:23:41 +02:00
private static Block registerFluidBlock(Fluid fluid, Material material, String name){
return new BlockFluidFlowing(fluid, material, name);
2016-01-29 17:38:31 +01:00
}
}