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

317 lines
12 KiB
Java
Raw Normal View History

2015-08-29 14:33:25 +02:00
/*
* This file ("InitBlocks.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://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
* <EFBFBD> 2015 Ellpeck
*/
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;
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;
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;
public static Block blockLampPowerer;
2015-06-28 03:12:32 +02:00
2015-07-10 13:08:20 +02:00
public static Block blockTreasureChest;
2015-07-15 01:53:04 +02:00
public static Block blockXPSolidifier;
public static Block blockOreMagnet;
2015-07-13 23:44:33 +02:00
public static Block blockSmileyCloud;
2015-09-30 21:03:43 +02:00
public static Block blockLeafGenerator;
2015-10-05 16:53:28 +02:00
public static Block blockDirectionalBreaker;
2015-10-10 02:51:06 +02:00
public static Block blockRangedCollector;
2015-09-30 21:03:43 +02:00
public static Block blockLaserRelay;
2015-10-18 19:21:32 +02:00
2015-01-05 22:14:01 +01:00
public static void init(){
2015-07-01 21:32:48 +02:00
ModUtil.LOGGER.info("Initializing Blocks...");
blockLaserRelay = new BlockLaserRelay();
BlockUtil.register(blockLaserRelay);
2015-10-18 19:21:32 +02:00
2015-10-10 02:51:06 +02:00
blockRangedCollector = new BlockRangedCollector();
BlockUtil.register(blockRangedCollector);
2015-10-05 16:53:28 +02:00
blockDirectionalBreaker = new BlockDirectionalBreaker();
BlockUtil.register(blockDirectionalBreaker);
2015-09-30 21:03:43 +02:00
blockLeafGenerator = new BlockLeafGenerator();
BlockUtil.register(blockLeafGenerator);
blockSmileyCloud = new BlockSmileyCloud();
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockSmileyCloud);
blockOreMagnet = new BlockOreMagnet();
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockOreMagnet);
2015-07-15 01:53:04 +02:00
blockXPSolidifier = new BlockXPSolidifier();
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockXPSolidifier);
2015-07-13 23:44:33 +02:00
2015-06-28 03:12:32 +02:00
blockTestifiBucksGreenWall = new BlockGeneric("blockTestifiBucksGreenWall");
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockTestifiBucksGreenWall);
2015-06-28 03:12:32 +02:00
blockTestifiBucksWhiteWall = new BlockGeneric("blockTestifiBucksWhiteWall");
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockTestifiBucksWhiteWall);
2015-06-28 03:12:32 +02:00
blockTestifiBucksGreenStairs = new BlockStair(blockTestifiBucksGreenWall, "blockTestifiBucksGreenStairs");
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockTestifiBucksGreenStairs);
2015-06-28 03:12:32 +02:00
blockTestifiBucksWhiteStairs = new BlockStair(blockTestifiBucksWhiteWall, "blockTestifiBucksWhiteStairs");
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockTestifiBucksWhiteStairs);
2015-06-28 03:12:32 +02:00
blockTestifiBucksGreenSlab = new BlockSlabs("blockTestifiBucksGreenSlab", blockTestifiBucksGreenWall);
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockTestifiBucksGreenSlab);
2015-06-28 21:28:58 +02:00
blockTestifiBucksWhiteSlab = new BlockSlabs("blockTestifiBucksWhiteSlab", blockTestifiBucksWhiteWall);
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockTestifiBucksWhiteSlab);
2015-06-28 21:28:58 +02:00
blockColoredLamp = new BlockColoredLamp(false);
BlockUtil.register(blockColoredLamp, BlockColoredLamp.TheItemBlock.class);
2015-06-28 21:28:58 +02:00
blockColoredLampOn = new BlockColoredLamp(true);
BlockUtil.register(blockColoredLampOn, BlockColoredLamp.TheItemBlock.class);
blockLampPowerer = new BlockLampPowerer();
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockLampPowerer);
2015-06-28 03:12:32 +02:00
2015-07-10 13:08:20 +02:00
blockTreasureChest = new BlockTreasureChest();
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockTreasureChest);
2015-07-10 13:08:20 +02:00
2015-06-21 02:28:49 +02:00
blockEnergizer = new BlockEnergizer(true);
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockEnergizer);
2015-06-21 02:28:49 +02:00
blockEnervator = new BlockEnergizer(false);
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockEnervator);
2015-06-21 02:28:49 +02:00
2015-06-06 01:25:53 +02:00
blockLavaFactoryController = new BlockLavaFactoryController();
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockLavaFactoryController);
2015-06-06 01:25:53 +02:00
2015-05-20 22:39:43 +02:00
blockCanolaPress = new BlockCanolaPress();
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockCanolaPress);
2015-05-20 22:39:43 +02:00
blockPhantomface = new BlockPhantom(BlockPhantom.Type.FACE);
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockPhantomface);
2015-05-20 22:39:43 +02:00
blockPhantomPlacer = new BlockPhantom(BlockPhantom.Type.PLACER);
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockPhantomPlacer);
2015-05-25 17:00:54 +02:00
blockPhantomLiquiface = new BlockPhantom(BlockPhantom.Type.LIQUIFACE);
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockPhantomLiquiface);
2015-05-27 21:57:53 +02:00
blockPhantomEnergyface = new BlockPhantom(BlockPhantom.Type.ENERGYFACE);
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockPhantomEnergyface);
blockPhantomBreaker = new BlockPhantom(BlockPhantom.Type.BREAKER);
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockPhantomBreaker);
2015-05-25 17:00:54 +02:00
2015-05-20 22:39:43 +02:00
blockCoalGenerator = new BlockCoalGenerator();
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockCoalGenerator);
2015-05-20 22:39:43 +02:00
blockOilGenerator = new BlockOilGenerator();
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockOilGenerator);
2015-05-20 22:39:43 +02:00
blockFermentingBarrel = new BlockFermentingBarrel();
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockFermentingBarrel);
2015-05-20 22:39:43 +02:00
2015-06-06 01:25:53 +02:00
blockRice = new BlockPlant("blockRice", 6, 1, 2);
2015-10-25 14:30:59 +01:00
BlockUtil.register(blockRice);
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-10-25 14:30:59 +01:00
BlockUtil.register(blockCanola);
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);
2015-10-25 14:30:59 +01:00
BlockUtil.register(blockFlax);
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);
2015-10-25 14:30:59 +01:00
BlockUtil.register(blockCoffee);
2015-06-28 03:12:32 +02:00
CompatUtil.registerMFRPlant(blockCoffee);
blockCompost = new BlockCompost();
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockCompost);
2015-01-05 22:14:01 +01:00
blockMisc = new BlockMisc();
BlockUtil.register(blockMisc, BlockMisc.TheItemBlock.class);
blockFeeder = new BlockFeeder();
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockFeeder);
2015-01-05 22:14:01 +01:00
blockGiantChest = new BlockGiantChest();
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockGiantChest);
blockGrinder = new BlockGrinder(false);
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockGrinder);
blockGrinderDouble = new BlockGrinder(true);
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockGrinderDouble);
blockFurnaceDouble = new BlockFurnaceDouble();
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockFurnaceDouble);
2015-03-19 21:27:56 +01:00
blockInputter = new BlockInputter(false);
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();
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockFishingNet);
2015-03-30 15:08:19 +02:00
blockFurnaceSolar = new BlockFurnaceSolar();
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockFurnaceSolar);
2015-03-31 20:37:55 +02:00
blockHeatCollector = new BlockHeatCollector();
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockHeatCollector);
2015-04-02 12:06:42 +02:00
blockItemRepairer = new BlockItemRepairer();
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockItemRepairer);
2015-04-19 01:50:02 +02:00
blockGreenhouseGlass = new BlockGreenhouseGlass();
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockGreenhouseGlass);
2015-04-19 01:50:02 +02:00
blockBreaker = new BlockBreaker(false);
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockBreaker);
2015-04-19 01:50:02 +02:00
blockPlacer = new BlockBreaker(true);
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockPlacer);
2015-04-26 20:07:57 +02:00
2015-05-04 17:26:50 +02:00
blockDropper = new BlockDropper();
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockDropper);
2015-05-30 17:47:57 +02:00
blockFluidPlacer = new BlockFluidCollector(true);
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockFluidPlacer);
2015-05-30 17:47:57 +02:00
blockFluidCollector = new BlockFluidCollector(false);
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockFluidCollector);
blockCoffeeMachine = new BlockCoffeeMachine();
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockCoffeeMachine);
blockPhantomBooster = new BlockPhantomBooster();
2015-09-12 21:26:51 +02:00
BlockUtil.register(blockPhantomBooster);
2015-06-28 03:12:32 +02:00
blockWildPlant = new BlockWildPlant();
2015-10-25 14:30:59 +01:00
BlockUtil.register(blockWildPlant, BlockWildPlant.TheItemBlock.class);
2015-06-28 03:12:32 +02:00
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).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");
2015-10-25 14:30:59 +01:00
BlockUtil.register(blockCanolaOil);
}
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).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");
2015-10-25 14:30:59 +01:00
BlockUtil.register(blockOil);
}
else{
errorAlreadyRegistered("Oil Block");
}
blockOil = fluidOil.getBlock();
}
public static void errorAlreadyRegistered(String str){
2015-09-21 23:49:49 +02:00
ModUtil.LOGGER.warn(str+" from "+ModUtil.NAME+" 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!");
}
}