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;
|
2016-09-01 22:11:51 +02:00
|
|
|
public static Fluid fluidCrystalOil;
|
|
|
|
public static Fluid fluidEmpoweredOil;
|
2016-01-29 17:38:31 +01:00
|
|
|
|
|
|
|
public static Block blockCanolaOil;
|
|
|
|
public static Block blockOil;
|
2016-09-01 22:11:51 +02:00
|
|
|
public static Block blockCrystalOil;
|
|
|
|
public static Block blockEmpoweredOil;
|
2016-01-29 17:38:31 +01:00
|
|
|
|
|
|
|
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-09-01 22:11:51 +02:00
|
|
|
fluidCrystalOil = registerFluid("crystaloil", "blockCrystalOil", EnumRarity.RARE);
|
|
|
|
fluidEmpoweredOil = registerFluid("empoweredoil", "blockEmpoweredOil", EnumRarity.EPIC);
|
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-09-01 22:11:51 +02:00
|
|
|
blockCrystalOil = registerFluidBlock(fluidCrystalOil, Material.WATER, "blockCrystalOil");
|
|
|
|
blockEmpoweredOil = registerFluidBlock(fluidEmpoweredOil, Material.WATER, "blockEmpoweredOil");
|
2016-05-06 22:23:41 +02:00
|
|
|
}
|
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){
|
2016-11-16 21:56:47 +01:00
|
|
|
Fluid fluid = new FluidAA(fluidName.toLowerCase(Locale.ROOT), fluidTextureName.toLowerCase(Locale.ROOT)).setRarity(rarity);
|
2016-05-06 22:23:41 +02:00
|
|
|
FluidRegistry.registerFluid(fluid);
|
|
|
|
FluidRegistry.addBucketForFluid(fluid);
|
2016-01-29 17:38:31 +01:00
|
|
|
|
2016-09-11 14:51:52 +02:00
|
|
|
return FluidRegistry.getFluid(fluid.getName());
|
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
|
|
|
}
|
|
|
|
}
|