2016-01-29 17:38:31 +01:00
|
|
|
/*
|
2016-05-16 22:52:27 +02:00
|
|
|
* This file ("InitFluids.java") is part of the Actually Additions mod for Minecraft.
|
2016-01-29 17:38:31 +01:00
|
|
|
* It is created and owned by Ellpeck and distributed
|
|
|
|
* under the Actually Additions License to be found at
|
2016-05-16 22:52:27 +02:00
|
|
|
* http://ellpeck.de/actaddlicense
|
2016-01-29 17:38:31 +01:00
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
*
|
2016-05-16 22:54:42 +02:00
|
|
|
* © 2015-2016 Ellpeck
|
2016-01-29 17:38:31 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
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-06-17 23:50:38 +02:00
|
|
|
public final class InitFluids{
|
2016-01-29 17:38:31 +01:00
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|