ActuallyAdditions/src/main/java/ellpeck/actuallyadditions/blocks/InitBlocks.java

270 lines
12 KiB
Java
Raw Normal View History

2015-03-07 12:51:28 +01:00
package ellpeck.actuallyadditions.blocks;
2015-01-05 22:14:01 +01:00
2015-06-18 13:14:57 +02:00
import ellpeck.actuallyadditions.config.values.ConfigBoolValues;
2015-03-29 15:29:05 +02:00
import ellpeck.actuallyadditions.util.BlockUtil;
2015-06-28 03:12:32 +02:00
import ellpeck.actuallyadditions.util.CompatUtil;
import ellpeck.actuallyadditions.util.ModUtil;
2015-03-07 12:51:28 +01:00
import ellpeck.actuallyadditions.util.Util;
import net.minecraft.block.Block;
2015-05-20 22:39:43 +02:00
import net.minecraft.block.material.Material;
import net.minecraft.item.EnumRarity;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import org.apache.logging.log4j.Level;
2015-01-05 22:14:01 +01:00
public class InitBlocks{
public static Block blockCompost;
public static Block blockMisc;
2015-06-28 03:12:32 +02:00
public static Block blockWildPlant;
public static Block blockFeeder;
public static Block blockGiantChest;
public static Block blockGrinder;
public static Block blockGrinderDouble;
public static Block blockFurnaceDouble;
2015-03-19 21:27:56 +01:00
public static Block blockInputter;
public static Block blockInputterAdvanced;
2015-03-30 15:08:19 +02:00
public static Block blockFishingNet;
public static Block blockFurnaceSolar;
2015-03-31 20:37:55 +02:00
public static Block blockHeatCollector;
2015-04-02 12:06:42 +02:00
public static Block blockItemRepairer;
2015-04-19 01:50:02 +02:00
public static Block blockGreenhouseGlass;
2015-05-04 17:26:50 +02:00
2015-04-19 01:50:02 +02:00
public static Block blockBreaker;
public static Block blockPlacer;
2015-05-04 17:26:50 +02:00
public static Block blockDropper;
2015-04-26 20:07:57 +02:00
2015-05-20 22:39:43 +02:00
public static Block blockRice;
public static Block blockCanola;
2015-06-06 01:25:53 +02:00
public static Block blockFlax;
public static Block blockCoffee;
2015-05-20 22:39:43 +02:00
public static Fluid fluidCanolaOil;
public static Block blockCanolaOil;
public static Fluid fluidOil;
public static Block blockOil;
public static Block blockCanolaPress;
public static Block blockFermentingBarrel;
public static Block blockCoalGenerator;
public static Block blockOilGenerator;
public static Block blockPhantomface;
2015-05-27 21:57:53 +02:00
public static Block blockPhantomPlacer;
public static Block blockPhantomBreaker;
public static Block blockPhantomLiquiface;
public static Block blockPhantomEnergyface;
2015-05-20 22:39:43 +02:00
2015-05-30 17:47:57 +02:00
public static Block blockFluidPlacer;
public static Block blockFluidCollector;
2015-06-06 01:25:53 +02:00
public static Block blockLavaFactoryController;
public static Block blockCoffeeMachine;
public static Block blockPhantomBooster;
2015-06-06 01:25:53 +02:00
2015-06-21 02:28:49 +02:00
public static Block blockEnergizer;
public static Block blockEnervator;
2015-06-28 03:12:32 +02:00
public static Block blockTestifiBucksGreenWall;
public static Block blockTestifiBucksWhiteWall;
public static Block blockTestifiBucksGreenStairs;
public static Block blockTestifiBucksWhiteStairs;
public static Block blockTestifiBucksGreenSlab;
2015-06-28 21:28:58 +02:00
public static Block blockTestifiBucksWhiteSlab;
public static Block blockColoredLamp;
public static Block blockColoredLampOn;
2015-06-28 03:12:32 +02:00
2015-01-05 22:14:01 +01:00
public static void init(){
Util.logInfo("Initializing Blocks...");
2015-06-28 03:12:32 +02:00
blockTestifiBucksGreenWall = new BlockGeneric("blockTestifiBucksGreenWall");
BlockUtil.register(blockTestifiBucksGreenWall, BlockGeneric.TheItemBlock.class);
blockTestifiBucksWhiteWall = new BlockGeneric("blockTestifiBucksWhiteWall");
BlockUtil.register(blockTestifiBucksWhiteWall, BlockGeneric.TheItemBlock.class);
blockTestifiBucksGreenStairs = new BlockStair(blockTestifiBucksGreenWall, "blockTestifiBucksGreenStairs");
BlockUtil.register(blockTestifiBucksGreenStairs, BlockStair.TheItemBlock.class);
blockTestifiBucksWhiteStairs = new BlockStair(blockTestifiBucksWhiteWall, "blockTestifiBucksWhiteStairs");
BlockUtil.register(blockTestifiBucksWhiteStairs, BlockStair.TheItemBlock.class);
blockTestifiBucksGreenSlab = new BlockSlabs("blockTestifiBucksGreenSlab", blockTestifiBucksGreenWall);
BlockUtil.register(blockTestifiBucksGreenSlab, BlockSlabs.TheItemBlock.class);
2015-06-28 21:28:58 +02:00
blockTestifiBucksWhiteSlab = new BlockSlabs("blockTestifiBucksWhiteSlab", blockTestifiBucksWhiteWall);
BlockUtil.register(blockTestifiBucksWhiteSlab, BlockSlabs.TheItemBlock.class);
blockColoredLamp = new BlockColoredLamp(false);
BlockUtil.register(blockColoredLamp, BlockColoredLamp.TheItemBlock.class, BlockColoredLamp.allLampTypes);
blockColoredLampOn = new BlockColoredLamp(true);
BlockUtil.register(blockColoredLampOn, BlockColoredLamp.TheItemBlock.class, false, BlockColoredLamp.allLampTypes);
2015-06-28 03:12:32 +02:00
2015-06-21 02:28:49 +02:00
blockEnergizer = new BlockEnergizer(true);
BlockUtil.register(blockEnergizer, BlockEnergizer.TheItemBlock.class);
blockEnervator = new BlockEnergizer(false);
BlockUtil.register(blockEnervator, BlockEnergizer.TheItemBlock.class);
2015-06-06 01:25:53 +02:00
blockLavaFactoryController = new BlockLavaFactoryController();
BlockUtil.register(blockLavaFactoryController, BlockLavaFactoryController.TheItemBlock.class);
2015-05-20 22:39:43 +02:00
blockCanolaPress = new BlockCanolaPress();
BlockUtil.register(blockCanolaPress, BlockCanolaPress.TheItemBlock.class);
2015-05-25 17:00:54 +02:00
blockPhantomface = new BlockPhantomface(BlockPhantomface.FACE);
2015-05-20 22:39:43 +02:00
BlockUtil.register(blockPhantomface, BlockPhantomface.TheItemBlock.class);
2015-05-27 21:57:53 +02:00
blockPhantomPlacer = new BlockPhantomface(BlockPhantomface.PLACER);
BlockUtil.register(blockPhantomPlacer, BlockPhantomface.TheItemBlock.class);
2015-05-25 17:00:54 +02:00
2015-05-27 21:57:53 +02:00
blockPhantomLiquiface = new BlockPhantomface(BlockPhantomface.LIQUIFACE);
BlockUtil.register(blockPhantomLiquiface, BlockPhantomface.TheItemBlock.class);
blockPhantomEnergyface = new BlockPhantomface(BlockPhantomface.ENERGYFACE);
BlockUtil.register(blockPhantomEnergyface, BlockPhantomface.TheItemBlock.class);
2015-05-27 21:57:53 +02:00
blockPhantomBreaker = new BlockPhantomface(BlockPhantomface.BREAKER);
BlockUtil.register(blockPhantomBreaker, BlockPhantomface.TheItemBlock.class);
2015-05-25 17:00:54 +02:00
2015-05-20 22:39:43 +02:00
blockCoalGenerator = new BlockCoalGenerator();
BlockUtil.register(blockCoalGenerator, BlockCoalGenerator.TheItemBlock.class);
blockOilGenerator = new BlockOilGenerator();
BlockUtil.register(blockOilGenerator, BlockOilGenerator.TheItemBlock.class);
blockFermentingBarrel = new BlockFermentingBarrel();
BlockUtil.register(blockFermentingBarrel, BlockFermentingBarrel.TheItemBlock.class);
2015-06-06 01:25:53 +02:00
blockRice = new BlockPlant("blockRice", 6, 1, 2);
2015-05-20 22:39:43 +02:00
BlockUtil.register(blockRice, BlockPlant.TheItemBlock.class, false);
2015-06-28 03:12:32 +02:00
CompatUtil.registerMFRPlant(blockRice);
2015-05-20 22:39:43 +02:00
2015-06-06 01:25:53 +02:00
blockCanola = new BlockPlant("blockCanola", 4, 3, 3);
2015-05-20 22:39:43 +02:00
BlockUtil.register(blockCanola, BlockPlant.TheItemBlock.class, false);
2015-06-28 03:12:32 +02:00
CompatUtil.registerMFRPlant(blockCanola);
2015-05-20 22:39:43 +02:00
2015-06-06 01:25:53 +02:00
blockFlax = new BlockPlant("blockFlax", 6, 2, 4);
BlockUtil.register(blockFlax, BlockPlant.TheItemBlock.class, false);
2015-06-28 03:12:32 +02:00
CompatUtil.registerMFRPlant(blockFlax);
2015-06-06 01:25:53 +02:00
blockCoffee = new BlockPlant("blockCoffee", 6, 2, 2);
BlockUtil.register(blockCoffee, BlockPlant.TheItemBlock.class, false);
2015-06-28 03:12:32 +02:00
CompatUtil.registerMFRPlant(blockCoffee);
blockCompost = new BlockCompost();
2015-03-29 15:29:05 +02:00
BlockUtil.register(blockCompost, BlockCompost.TheItemBlock.class);
2015-01-05 22:14:01 +01:00
blockMisc = new BlockMisc();
BlockUtil.register(blockMisc, BlockMisc.TheItemBlock.class, BlockMisc.allMiscBlocks);
blockFeeder = new BlockFeeder();
2015-03-29 15:29:05 +02:00
BlockUtil.register(blockFeeder, BlockFeeder.TheItemBlock.class);
2015-01-05 22:14:01 +01:00
blockGiantChest = new BlockGiantChest();
2015-03-29 15:29:05 +02:00
BlockUtil.register(blockGiantChest, BlockGiantChest.TheItemBlock.class);
blockGrinder = new BlockGrinder(false);
2015-03-29 15:29:05 +02:00
BlockUtil.register(blockGrinder, BlockGrinder.TheItemBlock.class);
blockGrinderDouble = new BlockGrinder(true);
2015-03-29 15:29:05 +02:00
BlockUtil.register(blockGrinderDouble, BlockGrinder.TheItemBlock.class);
blockFurnaceDouble = new BlockFurnaceDouble();
2015-03-29 15:29:05 +02:00
BlockUtil.register(blockFurnaceDouble, BlockFurnaceDouble.TheItemBlock.class);
2015-03-19 21:27:56 +01:00
blockInputter = new BlockInputter(false);
2015-03-29 15:29:05 +02:00
BlockUtil.register(blockInputter, BlockInputter.TheItemBlock.class);
2015-03-30 15:08:19 +02:00
blockInputterAdvanced = new BlockInputter(true);
BlockUtil.register(blockInputterAdvanced, BlockInputter.TheItemBlock.class);
2015-03-30 15:08:19 +02:00
blockFishingNet = new BlockFishingNet();
BlockUtil.register(blockFishingNet, BlockFishingNet.TheItemBlock.class);
blockFurnaceSolar = new BlockFurnaceSolar();
BlockUtil.register(blockFurnaceSolar, BlockFurnaceSolar.TheItemBlock.class);
2015-03-31 20:37:55 +02:00
blockHeatCollector = new BlockHeatCollector();
BlockUtil.register(blockHeatCollector, BlockHeatCollector.TheItemBlock.class);
2015-04-02 12:06:42 +02:00
blockItemRepairer = new BlockItemRepairer();
BlockUtil.register(blockItemRepairer, BlockItemRepairer.TheItemBlock.class);
2015-04-19 01:50:02 +02:00
blockGreenhouseGlass = new BlockGreenhouseGlass();
BlockUtil.register(blockGreenhouseGlass, BlockGreenhouseGlass.TheItemBlock.class);
blockBreaker = new BlockBreaker(false);
BlockUtil.register(blockBreaker, BlockBreaker.TheItemBlock.class);
blockPlacer = new BlockBreaker(true);
BlockUtil.register(blockPlacer, BlockBreaker.TheItemBlock.class);
2015-04-26 20:07:57 +02:00
2015-05-04 17:26:50 +02:00
blockDropper = new BlockDropper();
BlockUtil.register(blockDropper, BlockDropper.TheItemBlock.class);
2015-05-30 17:47:57 +02:00
blockFluidPlacer = new BlockFluidCollector(true);
BlockUtil.register(blockFluidPlacer, BlockFluidCollector.TheItemBlock.class);
blockFluidCollector = new BlockFluidCollector(false);
BlockUtil.register(blockFluidCollector, BlockFluidCollector.TheItemBlock.class);
blockCoffeeMachine = new BlockCoffeeMachine();
BlockUtil.register(blockCoffeeMachine, BlockCoffeeMachine.TheItemBlock.class);
blockPhantomBooster = new BlockPhantomBooster();
BlockUtil.register(blockPhantomBooster, BlockPhantomBooster.TheItemBlock.class);
2015-06-28 03:12:32 +02:00
blockWildPlant = new BlockWildPlant();
BlockUtil.register(blockWildPlant, BlockWildPlant.TheItemBlock.class, false, BlockWildPlant.allWildPlants);
registerFluids();
}
public static void registerFluids(){
2015-06-28 03:12:32 +02:00
//Canola Fluid
String canolaOil = "canolaoil";
2015-06-18 13:14:57 +02:00
if(!FluidRegistry.isFluidRegistered(canolaOil) || ConfigBoolValues.PREVENT_CANOLA_OVERRIDE.isEnabled()){
fluidCanolaOil = new FluidAA(canolaOil).setDensity(1200).setViscosity(1500).setTemperature(300).setRarity(EnumRarity.uncommon);
FluidRegistry.registerFluid(fluidCanolaOil);
}
else{
errorAlreadyRegistered("Canola Oil Fluid");
}
fluidCanolaOil = FluidRegistry.getFluid(canolaOil);
2015-06-28 03:12:32 +02:00
//Canola Block
2015-06-18 13:14:57 +02:00
if(fluidCanolaOil.getBlock() == null || ConfigBoolValues.PREVENT_CANOLA_BLOCK_OVERRIDE.isEnabled()){
blockCanolaOil = new BlockFluidFlowing(fluidCanolaOil, Material.water, "blockCanolaOil");
BlockUtil.register(blockCanolaOil, BlockFluidFlowing.TheItemBlock.class, false);
}
else{
errorAlreadyRegistered("Canola Oil Block");
}
blockCanolaOil = fluidCanolaOil.getBlock();
2015-06-28 03:12:32 +02:00
//Oil Fluid
String oil = "oil";
2015-06-18 13:14:57 +02:00
if(!FluidRegistry.isFluidRegistered(oil) || ConfigBoolValues.PREVENT_OIL_OVERRIDE.isEnabled()){
fluidOil = new FluidAA(oil).setDensity(1200).setViscosity(1500).setTemperature(300).setRarity(EnumRarity.uncommon);
FluidRegistry.registerFluid(fluidOil);
}
else{
errorAlreadyRegistered("Oil Fluid");
2015-06-22 18:09:00 +02:00
}
fluidOil = FluidRegistry.getFluid(oil);
2015-06-28 03:12:32 +02:00
//Oil Block
2015-06-18 13:14:57 +02:00
if(fluidOil.getBlock() == null || ConfigBoolValues.PREVENT_OIL_BLOCK_OVERRIDE.isEnabled()){
blockOil = new BlockFluidFlowing(fluidOil, Material.water, "blockOil");
BlockUtil.register(blockOil, BlockFluidFlowing.TheItemBlock.class, false);
}
else{
errorAlreadyRegistered("Oil Block");
}
blockOil = fluidOil.getBlock();
}
public static void errorAlreadyRegistered(String str){
2015-06-18 13:14:57 +02:00
ModUtil.LOGGER.log(Level.WARN, str + " from Actually Additions is not getting used as it has already been registered by another Mod! If this causes Issues (which it shouldn't!), you can turn this off in the Config File!");
}
}