2013-12-27 23:59:59 +01:00
|
|
|
package appeng.core;
|
|
|
|
|
|
|
|
import java.lang.reflect.Constructor;
|
|
|
|
import java.lang.reflect.Field;
|
|
|
|
|
2014-03-15 21:35:00 +01:00
|
|
|
import net.minecraft.item.crafting.CraftingManager;
|
2013-12-27 23:59:59 +01:00
|
|
|
import net.minecraft.util.WeightedRandomChestContent;
|
|
|
|
import net.minecraft.world.biome.BiomeGenBase;
|
|
|
|
import net.minecraftforge.common.ChestGenHooks;
|
2014-03-05 08:27:42 +01:00
|
|
|
import net.minecraftforge.common.DimensionManager;
|
2013-12-27 23:59:59 +01:00
|
|
|
import net.minecraftforge.common.MinecraftForge;
|
2014-02-11 06:51:25 +01:00
|
|
|
import net.minecraftforge.oredict.RecipeSorter;
|
|
|
|
import net.minecraftforge.oredict.RecipeSorter.Category;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.api.AEApi;
|
2014-01-20 17:41:37 +01:00
|
|
|
import appeng.api.config.Upgrades;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.api.definitions.Blocks;
|
|
|
|
import appeng.api.definitions.Items;
|
|
|
|
import appeng.api.definitions.Materials;
|
|
|
|
import appeng.api.definitions.Parts;
|
2014-02-20 00:33:36 +01:00
|
|
|
import appeng.api.features.IRecipeHandlerRegistry;
|
2014-02-02 08:32:10 +01:00
|
|
|
import appeng.api.features.IWirelessTermHandler;
|
2014-03-05 08:27:42 +01:00
|
|
|
import appeng.api.movable.IMovableRegistry;
|
2014-02-05 01:49:33 +01:00
|
|
|
import appeng.api.networking.IGridCacheRegistry;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.api.networking.energy.IEnergyGrid;
|
|
|
|
import appeng.api.networking.pathing.IPathingGrid;
|
2014-01-27 05:00:36 +01:00
|
|
|
import appeng.api.networking.security.ISecurityGrid;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.api.networking.spatial.ISpatialCache;
|
|
|
|
import appeng.api.networking.storage.IStorageGrid;
|
|
|
|
import appeng.api.networking.ticking.ITickManager;
|
2014-02-05 01:49:33 +01:00
|
|
|
import appeng.api.parts.IPartHelper;
|
2014-01-24 17:30:57 +01:00
|
|
|
import appeng.api.util.AEColor;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.api.util.AEItemDefinition;
|
2014-05-18 05:19:23 +02:00
|
|
|
import appeng.block.crafting.BlockCraftingMonitor;
|
|
|
|
import appeng.block.crafting.BlockCraftingStorage;
|
2014-03-26 04:06:54 +01:00
|
|
|
import appeng.block.crafting.BlockCraftingUnit;
|
|
|
|
import appeng.block.crafting.BlockMolecularAssembler;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.block.grindstone.BlockCrank;
|
|
|
|
import appeng.block.grindstone.BlockGrinder;
|
2014-01-20 17:41:37 +01:00
|
|
|
import appeng.block.misc.BlockCellWorkbench;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.block.misc.BlockCharger;
|
|
|
|
import appeng.block.misc.BlockCondenser;
|
2014-03-07 07:15:54 +01:00
|
|
|
import appeng.block.misc.BlockInscriber;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.block.misc.BlockInterface;
|
2014-02-22 23:14:43 +01:00
|
|
|
import appeng.block.misc.BlockQuartzGrowthAccelerator;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.block.misc.BlockQuartzTorch;
|
2014-01-27 05:00:36 +01:00
|
|
|
import appeng.block.misc.BlockSecurity;
|
2014-03-02 09:35:11 +01:00
|
|
|
import appeng.block.misc.BlockSkyCompass;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.block.misc.BlockTinyTNT;
|
|
|
|
import appeng.block.misc.BlockVibrationChamber;
|
|
|
|
import appeng.block.networking.BlockCableBus;
|
|
|
|
import appeng.block.networking.BlockController;
|
|
|
|
import appeng.block.networking.BlockCreativeEnergyCell;
|
|
|
|
import appeng.block.networking.BlockDenseEnergyCell;
|
|
|
|
import appeng.block.networking.BlockEnergyAcceptor;
|
|
|
|
import appeng.block.networking.BlockEnergyCell;
|
2014-02-02 08:32:10 +01:00
|
|
|
import appeng.block.networking.BlockWireless;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.block.qnb.BlockQuantumLinkChamber;
|
|
|
|
import appeng.block.qnb.BlockQuantumRing;
|
2014-01-20 17:41:37 +01:00
|
|
|
import appeng.block.solids.BlockFluix;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.block.solids.BlockQuartz;
|
|
|
|
import appeng.block.solids.BlockQuartzChiseled;
|
|
|
|
import appeng.block.solids.BlockQuartzGlass;
|
|
|
|
import appeng.block.solids.BlockQuartzLamp;
|
|
|
|
import appeng.block.solids.BlockQuartzPillar;
|
2014-02-28 16:27:04 +01:00
|
|
|
import appeng.block.solids.BlockSkyStone;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.block.solids.OreQuartz;
|
|
|
|
import appeng.block.solids.OreQuartzCharged;
|
2014-03-07 05:30:59 +01:00
|
|
|
import appeng.block.spatial.BlockMatrixFrame;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.block.spatial.BlockSpatialIOPort;
|
|
|
|
import appeng.block.spatial.BlockSpatialPylon;
|
|
|
|
import appeng.block.storage.BlockChest;
|
|
|
|
import appeng.block.storage.BlockDrive;
|
|
|
|
import appeng.block.storage.BlockIOPort;
|
2014-02-28 09:12:00 +01:00
|
|
|
import appeng.block.storage.BlockSkyChest;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.core.features.AEFeature;
|
2014-01-01 10:01:38 +01:00
|
|
|
import appeng.core.features.AEFeatureHandler;
|
2014-01-24 17:30:57 +01:00
|
|
|
import appeng.core.features.ColoredItemDefinition;
|
2014-01-01 10:01:38 +01:00
|
|
|
import appeng.core.features.DamagedItemDefinition;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.core.features.IAEFeature;
|
2014-02-09 08:55:44 +01:00
|
|
|
import appeng.core.features.ItemStackSrc;
|
2014-01-28 21:20:19 +01:00
|
|
|
import appeng.core.features.NullItemDefinition;
|
2014-05-10 07:00:02 +02:00
|
|
|
import appeng.core.features.WrappedDamageItemDefinition;
|
2014-01-24 17:30:57 +01:00
|
|
|
import appeng.core.features.registries.P2PTunnelRegistry;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.core.features.registries.entries.BasicCellHandler;
|
|
|
|
import appeng.core.features.registries.entries.CreativeCellHandler;
|
|
|
|
import appeng.core.localization.GuiText;
|
|
|
|
import appeng.core.localization.PlayerMessages;
|
2014-01-20 17:41:37 +01:00
|
|
|
import appeng.debug.BlockChunkloader;
|
|
|
|
import appeng.debug.BlockItemGen;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.debug.ToolDebugCard;
|
2014-03-03 00:18:15 +01:00
|
|
|
import appeng.debug.ToolEraser;
|
2014-03-02 09:35:11 +01:00
|
|
|
import appeng.debug.ToolMeteoritePlacer;
|
2014-01-01 10:01:38 +01:00
|
|
|
import appeng.debug.ToolReplicatorCard;
|
2014-03-02 09:35:11 +01:00
|
|
|
import appeng.hooks.AETrading;
|
2014-03-03 00:18:15 +01:00
|
|
|
import appeng.hooks.MeteoriteWorldGen;
|
2014-03-02 09:35:11 +01:00
|
|
|
import appeng.hooks.QuartzWorldGen;
|
|
|
|
import appeng.hooks.TickHandler;
|
2014-05-06 07:16:29 +02:00
|
|
|
import appeng.items.materials.ItemMultiMaterial;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.items.materials.MaterialType;
|
2014-02-23 07:55:46 +01:00
|
|
|
import appeng.items.misc.ItemCrystalSeed;
|
2014-04-17 08:15:56 +02:00
|
|
|
import appeng.items.misc.ItemEncodedPattern;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.items.parts.ItemFacade;
|
2014-05-06 07:16:29 +02:00
|
|
|
import appeng.items.parts.ItemMultiPart;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.items.parts.PartType;
|
|
|
|
import appeng.items.storage.ItemBasicStorageCell;
|
|
|
|
import appeng.items.storage.ItemCreativeStorageCell;
|
|
|
|
import appeng.items.storage.ItemSpatialStorageCell;
|
2014-03-04 08:52:07 +01:00
|
|
|
import appeng.items.storage.ItemViewCell;
|
2014-01-29 06:16:10 +01:00
|
|
|
import appeng.items.tools.ToolBiometricCard;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.items.tools.ToolMemoryCard;
|
2014-01-23 17:28:12 +01:00
|
|
|
import appeng.items.tools.ToolNetworkTool;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.items.tools.powered.ToolChargedStaff;
|
|
|
|
import appeng.items.tools.powered.ToolEntropyManipulator;
|
|
|
|
import appeng.items.tools.powered.ToolMassCannon;
|
2014-01-20 17:41:37 +01:00
|
|
|
import appeng.items.tools.powered.ToolPortableCell;
|
2014-02-02 08:32:10 +01:00
|
|
|
import appeng.items.tools.powered.ToolWirelessTerminal;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.items.tools.quartz.ToolQuartzAxe;
|
|
|
|
import appeng.items.tools.quartz.ToolQuartzCuttingKnife;
|
|
|
|
import appeng.items.tools.quartz.ToolQuartzHoe;
|
|
|
|
import appeng.items.tools.quartz.ToolQuartzPickaxe;
|
|
|
|
import appeng.items.tools.quartz.ToolQuartzSpade;
|
|
|
|
import appeng.items.tools.quartz.ToolQuartzSword;
|
|
|
|
import appeng.items.tools.quartz.ToolQuartzWrench;
|
2014-05-20 06:13:12 +02:00
|
|
|
import appeng.me.cache.CraftingCache;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.me.cache.EnergyGridCache;
|
|
|
|
import appeng.me.cache.GridStorageCache;
|
|
|
|
import appeng.me.cache.P2PCache;
|
|
|
|
import appeng.me.cache.PathGridCache;
|
2014-01-27 05:00:36 +01:00
|
|
|
import appeng.me.cache.SecurityCache;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.me.cache.SpatialPylonCache;
|
|
|
|
import appeng.me.cache.TickManagerCache;
|
|
|
|
import appeng.me.storage.AEExternalHandler;
|
2014-03-02 09:35:11 +01:00
|
|
|
import appeng.parts.PartPlacement;
|
2014-02-25 06:33:31 +01:00
|
|
|
import appeng.recipes.AEItemResolver;
|
2014-02-10 04:16:36 +01:00
|
|
|
import appeng.recipes.RecipeHandler;
|
2014-03-15 21:35:00 +01:00
|
|
|
import appeng.recipes.game.FacadeRecipe;
|
2014-03-06 06:52:25 +01:00
|
|
|
import appeng.recipes.game.ShapedRecipe;
|
|
|
|
import appeng.recipes.game.ShapelessRecipe;
|
2014-05-02 04:49:19 +02:00
|
|
|
import appeng.recipes.handlers.Crusher;
|
2014-02-20 00:33:36 +01:00
|
|
|
import appeng.recipes.handlers.Grind;
|
2014-03-18 18:54:57 +01:00
|
|
|
import appeng.recipes.handlers.GrindFZ;
|
2014-03-09 04:35:53 +01:00
|
|
|
import appeng.recipes.handlers.Inscribe;
|
2014-02-23 07:55:46 +01:00
|
|
|
import appeng.recipes.handlers.Macerator;
|
2014-03-12 04:26:50 +01:00
|
|
|
import appeng.recipes.handlers.Press;
|
2014-02-23 07:55:46 +01:00
|
|
|
import appeng.recipes.handlers.Pulverizer;
|
2014-02-20 00:33:36 +01:00
|
|
|
import appeng.recipes.handlers.Shaped;
|
|
|
|
import appeng.recipes.handlers.Shapeless;
|
|
|
|
import appeng.recipes.handlers.Smelt;
|
2014-02-11 06:51:25 +01:00
|
|
|
import appeng.recipes.loader.ConfigLoader;
|
|
|
|
import appeng.recipes.loader.JarLoader;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.recipes.ores.OreDictionaryHandler;
|
2014-03-05 08:27:42 +01:00
|
|
|
import appeng.spatial.BiomeGenStorage;
|
|
|
|
import appeng.spatial.StorageWorldProvider;
|
|
|
|
import appeng.tile.AEBaseTile;
|
|
|
|
import appeng.util.Platform;
|
2013-12-27 23:59:59 +01:00
|
|
|
|
|
|
|
import com.google.common.collect.ArrayListMultimap;
|
|
|
|
import com.google.common.collect.Multimap;
|
|
|
|
|
2014-02-09 02:34:52 +01:00
|
|
|
import cpw.mods.fml.common.FMLCommonHandler;
|
2013-12-27 23:59:59 +01:00
|
|
|
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
|
|
|
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
|
|
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
|
|
|
import cpw.mods.fml.common.registry.GameRegistry;
|
|
|
|
import cpw.mods.fml.common.registry.VillagerRegistry;
|
|
|
|
|
|
|
|
public class Registration
|
|
|
|
{
|
|
|
|
|
|
|
|
final public static Registration instance = new Registration();
|
|
|
|
|
2014-02-10 04:16:36 +01:00
|
|
|
public RecipeHandler recipeHandler;
|
2013-12-27 23:59:59 +01:00
|
|
|
public BiomeGenBase storageBiome;
|
|
|
|
|
|
|
|
private Registration() {
|
2014-02-10 04:16:36 +01:00
|
|
|
recipeHandler = new RecipeHandler();
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
final private Multimap<AEFeature, Class> featuresToEntities = ArrayListMultimap.create();
|
|
|
|
|
|
|
|
public void PreInit(FMLPreInitializationEvent event)
|
|
|
|
{
|
2014-03-05 08:27:42 +01:00
|
|
|
registerSpatial( false );
|
|
|
|
|
2014-02-20 00:33:36 +01:00
|
|
|
IRecipeHandlerRegistry recipeRegistery = AEApi.instance().registries().recipes();
|
2014-02-25 06:33:31 +01:00
|
|
|
recipeRegistery.addNewSubItemResolver( new AEItemResolver() );
|
2014-02-23 07:55:46 +01:00
|
|
|
|
2014-02-22 23:14:43 +01:00
|
|
|
recipeRegistery.addNewCraftHandler( "grind", Grind.class );
|
2014-05-02 04:49:19 +02:00
|
|
|
recipeRegistery.addNewCraftHandler( "crusher", Crusher.class );
|
2014-03-18 18:54:57 +01:00
|
|
|
recipeRegistery.addNewCraftHandler( "grindfz", GrindFZ.class );
|
2014-02-23 07:55:46 +01:00
|
|
|
recipeRegistery.addNewCraftHandler( "pulverizer", Pulverizer.class );
|
|
|
|
recipeRegistery.addNewCraftHandler( "macerator", Macerator.class );
|
|
|
|
|
|
|
|
recipeRegistery.addNewCraftHandler( "smelt", Smelt.class );
|
2014-03-09 04:35:53 +01:00
|
|
|
recipeRegistery.addNewCraftHandler( "inscribe", Inscribe.class );
|
2014-03-12 04:26:50 +01:00
|
|
|
recipeRegistery.addNewCraftHandler( "press", Press.class );
|
2014-02-23 07:55:46 +01:00
|
|
|
|
2014-02-22 23:14:43 +01:00
|
|
|
recipeRegistery.addNewCraftHandler( "shaped", Shaped.class );
|
|
|
|
recipeRegistery.addNewCraftHandler( "shapeless", Shapeless.class );
|
2014-02-20 00:33:36 +01:00
|
|
|
|
2014-03-15 21:35:00 +01:00
|
|
|
RecipeSorter.register( "AE2-Facade", FacadeRecipe.class, Category.SHAPED, "" );
|
2014-02-11 06:51:25 +01:00
|
|
|
RecipeSorter.register( "AE2-Shaped", ShapedRecipe.class, Category.SHAPED, "" );
|
|
|
|
RecipeSorter.register( "AE2-Shapeless", ShapelessRecipe.class, Category.SHAPELESS, "" );
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
MinecraftForge.EVENT_BUS.register( OreDictionaryHandler.instance );
|
|
|
|
|
2014-01-20 17:41:37 +01:00
|
|
|
Items items = appeng.core.Api.instance.items();
|
|
|
|
Materials materials = appeng.core.Api.instance.materials();
|
|
|
|
Parts parts = appeng.core.Api.instance.parts();
|
|
|
|
Blocks blocks = appeng.core.Api.instance.blocks();
|
2013-12-27 23:59:59 +01:00
|
|
|
|
2014-05-06 07:16:29 +02:00
|
|
|
AEItemDefinition materialItem = (AEFeatureHandler) addFeature( ItemMultiMaterial.class );
|
2014-01-01 10:01:38 +01:00
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
Class materialClass = materials.getClass();
|
|
|
|
for (MaterialType mat : MaterialType.values())
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
Field f = materialClass.getField( "material" + mat.name() );
|
2014-05-06 07:16:29 +02:00
|
|
|
ItemStackSrc is = ((ItemMultiMaterial) materialItem.item()).createMaterial( mat );
|
2014-01-28 21:20:19 +01:00
|
|
|
if ( is != null )
|
|
|
|
f.set( materials, new DamagedItemDefinition( is ) );
|
|
|
|
else
|
2014-01-28 21:38:06 +01:00
|
|
|
f.set( materials, new NullItemDefinition() );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
catch (Throwable err)
|
|
|
|
{
|
|
|
|
AELog.severe( "Error creating material: " + mat.name() );
|
|
|
|
throw new RuntimeException( err );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-06 07:16:29 +02:00
|
|
|
AEItemDefinition partItem = (AEFeatureHandler) addFeature( ItemMultiPart.class );
|
2014-01-03 19:30:08 +01:00
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
Class partClass = parts.getClass();
|
2014-01-03 19:30:08 +01:00
|
|
|
for (PartType type : PartType.values())
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2014-01-03 19:30:08 +01:00
|
|
|
Field f = partClass.getField( "part" + type.name() );
|
|
|
|
Enum varients[] = type.getVarients();
|
|
|
|
if ( varients == null )
|
|
|
|
{
|
2014-05-06 07:16:29 +02:00
|
|
|
ItemStackSrc is = ((ItemMultiPart) partItem.item()).createPart( type, null );
|
2014-01-28 21:08:51 +01:00
|
|
|
if ( is != null )
|
|
|
|
f.set( parts, new DamagedItemDefinition( is ) );
|
2014-01-28 21:20:19 +01:00
|
|
|
else
|
|
|
|
f.set( parts, new NullItemDefinition() );
|
2014-01-03 19:30:08 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-01-24 17:30:57 +01:00
|
|
|
if ( varients[0] instanceof AEColor )
|
2014-01-03 19:30:08 +01:00
|
|
|
{
|
2014-01-24 17:30:57 +01:00
|
|
|
ColoredItemDefinition def = new ColoredItemDefinition();
|
|
|
|
|
|
|
|
for (Enum v : varients)
|
|
|
|
{
|
2014-05-06 07:16:29 +02:00
|
|
|
ItemStackSrc is = ((ItemMultiPart) partItem.item()).createPart( type, v );
|
2014-01-28 21:08:51 +01:00
|
|
|
if ( is != null )
|
|
|
|
def.add( (AEColor) v, is );
|
2014-01-24 17:30:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
f.set( parts, def );
|
2014-01-03 19:30:08 +01:00
|
|
|
}
|
|
|
|
}
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
catch (Throwable err)
|
|
|
|
{
|
2014-01-03 19:30:08 +01:00
|
|
|
AELog.severe( "Error creating part: " + type.name() );
|
2013-12-27 23:59:59 +01:00
|
|
|
throw new RuntimeException( err );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// very important block!
|
|
|
|
blocks.blockMultiPart = addFeature( BlockCableBus.class );
|
|
|
|
|
2014-05-10 07:00:02 +02:00
|
|
|
blocks.blockCraftingUnit = addFeature( BlockCraftingUnit.class );
|
2014-05-18 05:19:23 +02:00
|
|
|
blocks.blockCraftingAccelerator = new WrappedDamageItemDefinition( blocks.blockCraftingUnit, 1 );
|
|
|
|
blocks.blockCraftingMonitor = addFeature( BlockCraftingMonitor.class );
|
|
|
|
blocks.blockCraftingStorage1k = addFeature( BlockCraftingStorage.class );
|
|
|
|
blocks.blockCraftingStorage4k = new WrappedDamageItemDefinition( blocks.blockCraftingStorage1k, 1 );
|
|
|
|
blocks.blockCraftingStorage16k = new WrappedDamageItemDefinition( blocks.blockCraftingStorage1k, 2 );
|
|
|
|
blocks.blockCraftingStorage64k = new WrappedDamageItemDefinition( blocks.blockCraftingStorage1k, 3 );
|
2014-05-10 07:00:02 +02:00
|
|
|
blocks.blockMolecularAssembler = addFeature( BlockMolecularAssembler.class );
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
blocks.blockQuartzOre = addFeature( OreQuartz.class );
|
|
|
|
blocks.blockQuartzOreCharged = addFeature( OreQuartzCharged.class );
|
|
|
|
blocks.blockMatrixFrame = addFeature( BlockMatrixFrame.class );
|
|
|
|
blocks.blockQuartz = addFeature( BlockQuartz.class );
|
2014-01-20 17:41:37 +01:00
|
|
|
blocks.blockFluix = addFeature( BlockFluix.class );
|
2014-02-28 16:27:04 +01:00
|
|
|
blocks.blockSkyStone = addFeature( BlockSkyStone.class );
|
2014-02-28 09:12:00 +01:00
|
|
|
blocks.blockSkyChest = addFeature( BlockSkyChest.class );
|
2014-03-02 09:35:11 +01:00
|
|
|
blocks.blockSkyCompass = addFeature( BlockSkyCompass.class );
|
2014-01-20 17:41:37 +01:00
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
blocks.blockQuartzGlass = addFeature( BlockQuartzGlass.class );
|
|
|
|
blocks.blockQuartzVibrantGlass = addFeature( BlockQuartzLamp.class );
|
|
|
|
blocks.blockQuartzPiller = addFeature( BlockQuartzPillar.class );
|
|
|
|
blocks.blockQuartzChiseled = addFeature( BlockQuartzChiseled.class );
|
|
|
|
blocks.blockQuartzTorch = addFeature( BlockQuartzTorch.class );
|
|
|
|
blocks.blockCharger = addFeature( BlockCharger.class );
|
2014-02-22 23:14:43 +01:00
|
|
|
blocks.blockQuartzGrowthAccelerator = addFeature( BlockQuartzGrowthAccelerator.class );
|
2013-12-27 23:59:59 +01:00
|
|
|
|
|
|
|
blocks.blockGrindStone = addFeature( BlockGrinder.class );
|
|
|
|
blocks.blockCrankHandle = addFeature( BlockCrank.class );
|
2014-03-07 07:15:54 +01:00
|
|
|
blocks.blockInscriber = addFeature( BlockInscriber.class );
|
2014-02-02 08:32:10 +01:00
|
|
|
blocks.blockWireless = addFeature( BlockWireless.class );
|
2013-12-27 23:59:59 +01:00
|
|
|
blocks.blockTinyTNT = addFeature( BlockTinyTNT.class );
|
|
|
|
|
|
|
|
blocks.blockQuantumRing = addFeature( BlockQuantumRing.class );
|
|
|
|
blocks.blockQuantumLink = addFeature( BlockQuantumLinkChamber.class );
|
|
|
|
|
|
|
|
blocks.blockSpatialPylon = addFeature( BlockSpatialPylon.class );
|
|
|
|
blocks.blockSpatialIOPort = addFeature( BlockSpatialIOPort.class );
|
|
|
|
|
|
|
|
blocks.blockController = addFeature( BlockController.class );
|
|
|
|
blocks.blockDrive = addFeature( BlockDrive.class );
|
|
|
|
blocks.blockChest = addFeature( BlockChest.class );
|
|
|
|
blocks.blockInterface = addFeature( BlockInterface.class );
|
2014-01-20 17:41:37 +01:00
|
|
|
blocks.blockCellWorkbench = addFeature( BlockCellWorkbench.class );
|
2013-12-27 23:59:59 +01:00
|
|
|
blocks.blockIOPort = addFeature( BlockIOPort.class );
|
|
|
|
blocks.blockCondenser = addFeature( BlockCondenser.class );
|
|
|
|
blocks.blockEnergyAcceptor = addFeature( BlockEnergyAcceptor.class );
|
|
|
|
blocks.blockVibrationChamber = addFeature( BlockVibrationChamber.class );
|
|
|
|
|
|
|
|
blocks.blockEnergyCell = addFeature( BlockEnergyCell.class );
|
|
|
|
blocks.blockEnergyCellDense = addFeature( BlockDenseEnergyCell.class );
|
|
|
|
blocks.blockEnergyCellCreative = addFeature( BlockCreativeEnergyCell.class );
|
|
|
|
|
2014-01-27 05:00:36 +01:00
|
|
|
blocks.blockSecurity = addFeature( BlockSecurity.class );
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
items.itemCellCreative = addFeature( ItemCreativeStorageCell.class );
|
2014-03-04 08:52:07 +01:00
|
|
|
items.itemViewCell = addFeature( ItemViewCell.class );
|
2014-03-26 04:06:54 +01:00
|
|
|
items.itemEncodedPattern = addFeature( ItemEncodedPattern.class );
|
2013-12-27 23:59:59 +01:00
|
|
|
|
|
|
|
items.itemCell1k = addFeature( ItemBasicStorageCell.class, MaterialType.Cell1kPart, 1 );
|
|
|
|
items.itemCell4k = addFeature( ItemBasicStorageCell.class, MaterialType.Cell4kPart, 4 );
|
|
|
|
items.itemCell16k = addFeature( ItemBasicStorageCell.class, MaterialType.Cell16kPart, 16 );
|
|
|
|
items.itemCell64k = addFeature( ItemBasicStorageCell.class, MaterialType.Cell64kPart, 64 );
|
|
|
|
|
|
|
|
items.itemSpatialCell2 = addFeature( ItemSpatialStorageCell.class, MaterialType.Cell2SpatialPart, 2 );
|
|
|
|
items.itemSpatialCell16 = addFeature( ItemSpatialStorageCell.class, MaterialType.Cell16SpatialPart, 16 );
|
|
|
|
items.itemSpatialCell128 = addFeature( ItemSpatialStorageCell.class, MaterialType.Cell128SpatialPart, 128 );
|
|
|
|
|
|
|
|
items.itemCertusQuartzKnife = addFeature( ToolQuartzCuttingKnife.class, AEFeature.CertusQuartzTools );
|
|
|
|
items.itemCertusQuartzWrench = addFeature( ToolQuartzWrench.class, AEFeature.CertusQuartzTools );
|
|
|
|
items.itemCertusQuartzAxe = addFeature( ToolQuartzAxe.class, AEFeature.CertusQuartzTools );
|
|
|
|
items.itemCertusQuartzHoe = addFeature( ToolQuartzHoe.class, AEFeature.CertusQuartzTools );
|
|
|
|
items.itemCertusQuartzPick = addFeature( ToolQuartzPickaxe.class, AEFeature.CertusQuartzTools );
|
|
|
|
items.itemCertusQuartzShovel = addFeature( ToolQuartzSpade.class, AEFeature.CertusQuartzTools );
|
|
|
|
items.itemCertusQuartzSword = addFeature( ToolQuartzSword.class, AEFeature.CertusQuartzTools );
|
|
|
|
|
|
|
|
items.itemNetherQuartzKnife = addFeature( ToolQuartzCuttingKnife.class, AEFeature.NetherQuartzTools );
|
|
|
|
items.itemNetherQuartzWrench = addFeature( ToolQuartzWrench.class, AEFeature.NetherQuartzTools );
|
|
|
|
items.itemNetherQuartzAxe = addFeature( ToolQuartzAxe.class, AEFeature.NetherQuartzTools );
|
|
|
|
items.itemNetherQuartzHoe = addFeature( ToolQuartzHoe.class, AEFeature.NetherQuartzTools );
|
|
|
|
items.itemNetherQuartzPick = addFeature( ToolQuartzPickaxe.class, AEFeature.NetherQuartzTools );
|
|
|
|
items.itemNetherQuartzShovel = addFeature( ToolQuartzSpade.class, AEFeature.NetherQuartzTools );
|
|
|
|
items.itemNetherQuartzSword = addFeature( ToolQuartzSword.class, AEFeature.NetherQuartzTools );
|
|
|
|
|
|
|
|
items.itemMassCannon = addFeature( ToolMassCannon.class );
|
|
|
|
items.itemMemoryCard = addFeature( ToolMemoryCard.class );
|
|
|
|
items.itemChargedStaff = addFeature( ToolChargedStaff.class );
|
|
|
|
items.itemEntropyManipulator = addFeature( ToolEntropyManipulator.class );
|
2014-02-02 08:32:10 +01:00
|
|
|
items.itemWirelessTerminal = addFeature( ToolWirelessTerminal.class );
|
2014-01-20 17:41:37 +01:00
|
|
|
items.itemNetworkTool = addFeature( ToolNetworkTool.class );
|
|
|
|
items.itemPortableCell = addFeature( ToolPortableCell.class );
|
2014-01-29 06:16:10 +01:00
|
|
|
items.itemBiometricCard = addFeature( ToolBiometricCard.class );
|
2013-12-27 23:59:59 +01:00
|
|
|
|
|
|
|
items.itemFacade = addFeature( ItemFacade.class );
|
2014-02-23 07:55:46 +01:00
|
|
|
items.itemCrystalSeed = addFeature( ItemCrystalSeed.class );
|
2013-12-27 23:59:59 +01:00
|
|
|
|
2014-03-03 00:18:15 +01:00
|
|
|
addFeature( ToolEraser.class );
|
2014-03-02 09:35:11 +01:00
|
|
|
addFeature( ToolMeteoritePlacer.class );
|
2013-12-27 23:59:59 +01:00
|
|
|
addFeature( ToolDebugCard.class );
|
2014-01-01 10:01:38 +01:00
|
|
|
addFeature( ToolReplicatorCard.class );
|
2014-01-20 17:41:37 +01:00
|
|
|
addFeature( BlockItemGen.class );
|
|
|
|
addFeature( BlockChunkloader.class );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private AEItemDefinition addFeature(Class c, Object... Args)
|
|
|
|
{
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
java.lang.reflect.Constructor[] con = c.getConstructors();
|
|
|
|
Object obj = null;
|
|
|
|
|
|
|
|
for (Constructor conItem : con)
|
|
|
|
{
|
2014-01-01 10:01:38 +01:00
|
|
|
Class paramTypes[] = conItem.getParameterTypes();
|
|
|
|
if ( paramTypes.length == Args.length )
|
|
|
|
{
|
|
|
|
boolean valid = true;
|
|
|
|
|
|
|
|
for (int idx = 0; idx < paramTypes.length; idx++)
|
|
|
|
{
|
|
|
|
Class cz = Args[idx].getClass();
|
|
|
|
if ( !isClassMatch( paramTypes[idx], cz, Args[idx] ) )
|
|
|
|
valid = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( valid )
|
|
|
|
{
|
|
|
|
obj = conItem.newInstance( Args );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( obj instanceof IAEFeature )
|
|
|
|
{
|
|
|
|
IAEFeature feature = (IAEFeature) obj;
|
|
|
|
|
|
|
|
for (AEFeature f : feature.feature().getFeatures())
|
|
|
|
featuresToEntities.put( f, c );
|
|
|
|
|
|
|
|
feature.feature().register();
|
|
|
|
|
2014-01-30 03:47:55 +01:00
|
|
|
feature.postInit();
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
return feature.feature();
|
|
|
|
}
|
|
|
|
else if ( obj == null )
|
|
|
|
throw new RuntimeException( "No valid constructor found." );
|
|
|
|
else
|
|
|
|
throw new RuntimeException( "Non AE Feature Registered" );
|
|
|
|
|
|
|
|
}
|
|
|
|
catch (Throwable e)
|
|
|
|
{
|
2014-05-10 20:27:48 +02:00
|
|
|
throw new RuntimeException( "Error with Feature: " + c.getName(), e );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-01-01 10:01:38 +01:00
|
|
|
private boolean isClassMatch(Class expected, Class got, Object value)
|
|
|
|
{
|
|
|
|
if ( value == null && !expected.isPrimitive() )
|
|
|
|
return true;
|
|
|
|
|
|
|
|
expected = condense( expected, Boolean.class, Character.class, Byte.class, Short.class, Integer.class, Long.class, Float.class, Double.class );
|
|
|
|
got = condense( got, Boolean.class, Character.class, Byte.class, Short.class, Integer.class, Long.class, Float.class, Double.class );
|
|
|
|
|
|
|
|
if ( expected == got || expected.isAssignableFrom( got ) )
|
|
|
|
return true;
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
private Class condense(Class expected, Class... wrappers)
|
|
|
|
{
|
|
|
|
if ( expected.isPrimitive() )
|
|
|
|
{
|
|
|
|
for (Class clz : wrappers)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
if ( expected == clz.getField( "TYPE" ).get( null ) )
|
|
|
|
return clz;
|
|
|
|
}
|
|
|
|
catch (Throwable t)
|
|
|
|
{
|
2014-02-07 21:37:22 +01:00
|
|
|
AELog.error( t );
|
2014-01-01 10:01:38 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return expected;
|
|
|
|
}
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
public void Init(FMLInitializationEvent event)
|
|
|
|
{
|
2014-02-11 06:51:25 +01:00
|
|
|
if ( AEConfig.instance.isFeatureEnabled( AEFeature.CustomRecipes ) )
|
|
|
|
recipeHandler.parseRecipes( new ConfigLoader( AppEng.instance.getConfigPath() ), "index.recipe" );
|
|
|
|
else
|
|
|
|
recipeHandler.parseRecipes( new JarLoader( "/assets/appliedenergistics2/recipes/" ), "index.recipe" );
|
2014-02-10 04:16:36 +01:00
|
|
|
|
2014-02-05 01:49:33 +01:00
|
|
|
IPartHelper ph = AEApi.instance().partHelper();
|
|
|
|
ph.registerNewLayer( "appeng.api.parts.layers.LayerISidedInventory", "net.minecraft.inventory.ISidedInventory" );
|
|
|
|
ph.registerNewLayer( "appeng.api.parts.layers.LayerIFluidHandler", "net.minecraftforge.fluids.IFluidHandler" );
|
|
|
|
ph.registerNewLayer( "appeng.api.parts.layers.LayerITileStorageMonitorable", "appeng.api.implementations.tiles.ITileStorageMonitorable" );
|
2013-12-27 23:59:59 +01:00
|
|
|
|
2014-05-09 16:42:52 +02:00
|
|
|
if ( AppEng.instance.isIntegrationEnabled( "IC2" ) )
|
|
|
|
{
|
|
|
|
ph.registerNewLayer( "appeng.api.parts.layers.LayerIEnergySink", "ic2.api.energy.tile.IEnergySink" );
|
|
|
|
ph.registerNewLayer( "appeng.api.parts.layers.LayerIEnergySource", "ic2.api.energy.tile.IEnergySource" );
|
|
|
|
}
|
|
|
|
|
2014-05-10 04:08:56 +02:00
|
|
|
if ( AppEng.instance.isIntegrationEnabled( "MJ5" ) )
|
2014-05-09 16:42:52 +02:00
|
|
|
{
|
|
|
|
ph.registerNewLayer( "appeng.api.parts.layers.LayerIPowerEmitter", "buildcraft.api.power.IPowerEmitter" );
|
|
|
|
ph.registerNewLayer( "appeng.api.parts.layers.LayerIPowerReceptor", "buildcraft.api.power.IPowerReceptor" );
|
|
|
|
}
|
|
|
|
|
2014-05-10 04:08:56 +02:00
|
|
|
if ( AppEng.instance.isIntegrationEnabled( "MJ6" ) )
|
|
|
|
{
|
|
|
|
ph.registerNewLayer( "appeng.api.parts.layers.LayerIBatteryProvider", "buildcraft.api.mj.IBatteryProvider" );
|
|
|
|
}
|
|
|
|
|
2014-05-09 16:42:52 +02:00
|
|
|
if ( AppEng.instance.isIntegrationEnabled( "RF" ) )
|
|
|
|
ph.registerNewLayer( "appeng.api.parts.layers.LayerIEnergyHandler", "cofh.api.energy.IEnergyHandler" );
|
|
|
|
|
2014-02-09 02:34:52 +01:00
|
|
|
FMLCommonHandler.instance().bus().register( TickHandler.instance );
|
2014-05-13 04:15:45 +02:00
|
|
|
MinecraftForge.EVENT_BUS.register( TickHandler.instance );
|
2013-12-27 23:59:59 +01:00
|
|
|
MinecraftForge.EVENT_BUS.register( new PartPlacement() );
|
|
|
|
|
2014-02-05 01:49:33 +01:00
|
|
|
IGridCacheRegistry gcr = AEApi.instance().registries().gridCache();
|
|
|
|
gcr.registerGridCache( ITickManager.class, TickManagerCache.class );
|
|
|
|
gcr.registerGridCache( IEnergyGrid.class, EnergyGridCache.class );
|
|
|
|
gcr.registerGridCache( IPathingGrid.class, PathGridCache.class );
|
|
|
|
gcr.registerGridCache( IStorageGrid.class, GridStorageCache.class );
|
|
|
|
gcr.registerGridCache( P2PCache.class, P2PCache.class );
|
|
|
|
gcr.registerGridCache( ISpatialCache.class, SpatialPylonCache.class );
|
|
|
|
gcr.registerGridCache( ISecurityGrid.class, SecurityCache.class );
|
2014-05-20 06:13:12 +02:00
|
|
|
gcr.registerGridCache( CraftingCache.class, CraftingCache.class );
|
2013-12-27 23:59:59 +01:00
|
|
|
|
|
|
|
AEApi.instance().registries().externalStorage().addExternalStorageInterface( new AEExternalHandler() );
|
|
|
|
|
|
|
|
AEApi.instance().registries().cell().addCellHandler( new BasicCellHandler() );
|
|
|
|
AEApi.instance().registries().cell().addCellHandler( new CreativeCellHandler() );
|
|
|
|
|
2014-01-20 17:41:37 +01:00
|
|
|
AEApi.instance().registries().matterCannon().registerAmmo( AEApi.instance().materials().materialMatterBall.stack( 1 ), 32.0 );
|
2013-12-27 23:59:59 +01:00
|
|
|
|
2014-01-24 17:30:57 +01:00
|
|
|
// default settings..
|
|
|
|
((P2PTunnelRegistry) AEApi.instance().registries().p2pTunnel()).configure();
|
|
|
|
|
2014-02-09 02:34:52 +01:00
|
|
|
// NetworkRegistry.instance().registerGuiHandler( AppEng.instance, GuiBridge.GUI_Handler );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void PostInit(FMLPostInitializationEvent event)
|
|
|
|
{
|
2014-03-05 08:27:42 +01:00
|
|
|
registerSpatial( true );
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
// add to localizaiton..
|
|
|
|
PlayerMessages.values();
|
|
|
|
GuiText.values();
|
|
|
|
|
|
|
|
Api.instance.partHelper.initFMPSupport();
|
|
|
|
((BlockCableBus) AEApi.instance().blocks().blockMultiPart.block()).setupTile();
|
|
|
|
|
2014-01-20 17:41:37 +01:00
|
|
|
// IO PORT!
|
|
|
|
Upgrades.SPEED.registerItem( AEApi.instance().blocks().blockIOPort.stack( 1 ), 3 );
|
|
|
|
Upgrades.REDSTONE.registerItem( AEApi.instance().blocks().blockIOPort.stack( 1 ), 1 );
|
|
|
|
|
|
|
|
// partLevelEmitter
|
|
|
|
Upgrades.FUZZY.registerItem( AEApi.instance().parts().partLevelEmitter.stack( 1 ), 1 );
|
|
|
|
|
|
|
|
// partImportBus
|
|
|
|
Upgrades.FUZZY.registerItem( AEApi.instance().parts().partImportBus.stack( 1 ), 1 );
|
|
|
|
Upgrades.REDSTONE.registerItem( AEApi.instance().parts().partImportBus.stack( 1 ), 1 );
|
|
|
|
Upgrades.CAPACITY.registerItem( AEApi.instance().parts().partImportBus.stack( 1 ), 2 );
|
|
|
|
Upgrades.SPEED.registerItem( AEApi.instance().parts().partImportBus.stack( 1 ), 4 );
|
|
|
|
|
|
|
|
// partExportBus
|
|
|
|
Upgrades.FUZZY.registerItem( AEApi.instance().parts().partExportBus.stack( 1 ), 1 );
|
|
|
|
Upgrades.REDSTONE.registerItem( AEApi.instance().parts().partExportBus.stack( 1 ), 1 );
|
|
|
|
Upgrades.CAPACITY.registerItem( AEApi.instance().parts().partExportBus.stack( 1 ), 2 );
|
|
|
|
Upgrades.SPEED.registerItem( AEApi.instance().parts().partExportBus.stack( 1 ), 4 );
|
|
|
|
|
|
|
|
// blockCellWorkbench
|
|
|
|
Upgrades.FUZZY.registerItem( AEApi.instance().items().itemCell1k.stack( 1 ), 1 );
|
|
|
|
Upgrades.INVERTER.registerItem( AEApi.instance().items().itemCell1k.stack( 1 ), 1 );
|
|
|
|
|
|
|
|
Upgrades.FUZZY.registerItem( AEApi.instance().items().itemCell4k.stack( 1 ), 1 );
|
|
|
|
Upgrades.INVERTER.registerItem( AEApi.instance().items().itemCell4k.stack( 1 ), 1 );
|
|
|
|
|
|
|
|
Upgrades.FUZZY.registerItem( AEApi.instance().items().itemCell16k.stack( 1 ), 1 );
|
|
|
|
Upgrades.INVERTER.registerItem( AEApi.instance().items().itemCell16k.stack( 1 ), 1 );
|
|
|
|
|
|
|
|
Upgrades.FUZZY.registerItem( AEApi.instance().items().itemCell64k.stack( 1 ), 1 );
|
|
|
|
Upgrades.INVERTER.registerItem( AEApi.instance().items().itemCell64k.stack( 1 ), 1 );
|
|
|
|
|
2014-02-09 21:57:00 +01:00
|
|
|
Upgrades.FUZZY.registerItem( AEApi.instance().items().itemPortableCell.stack( 1 ), 1 );
|
|
|
|
Upgrades.INVERTER.registerItem( AEApi.instance().items().itemPortableCell.stack( 1 ), 1 );
|
2014-03-04 08:52:07 +01:00
|
|
|
|
|
|
|
Upgrades.FUZZY.registerItem( AEApi.instance().items().itemViewCell.stack( 1 ), 1 );
|
|
|
|
Upgrades.INVERTER.registerItem( AEApi.instance().items().itemViewCell.stack( 1 ), 1 );
|
2014-02-09 21:57:00 +01:00
|
|
|
|
2014-01-20 17:41:37 +01:00
|
|
|
// partStorageBus
|
|
|
|
Upgrades.FUZZY.registerItem( AEApi.instance().parts().partStorageBus.stack( 1 ), 1 );
|
|
|
|
Upgrades.INVERTER.registerItem( AEApi.instance().parts().partStorageBus.stack( 1 ), 1 );
|
2014-01-24 17:30:57 +01:00
|
|
|
Upgrades.CAPACITY.registerItem( AEApi.instance().parts().partStorageBus.stack( 1 ), 5 );
|
2014-01-20 17:41:37 +01:00
|
|
|
|
2014-02-18 18:43:57 +01:00
|
|
|
// partFormationPlane
|
|
|
|
Upgrades.FUZZY.registerItem( AEApi.instance().parts().partFormationPlane.stack( 1 ), 1 );
|
|
|
|
Upgrades.INVERTER.registerItem( AEApi.instance().parts().partFormationPlane.stack( 1 ), 1 );
|
|
|
|
Upgrades.CAPACITY.registerItem( AEApi.instance().parts().partFormationPlane.stack( 1 ), 5 );
|
|
|
|
|
2014-01-20 17:41:37 +01:00
|
|
|
// matter cannon
|
|
|
|
Upgrades.FUZZY.registerItem( AEApi.instance().items().itemMassCannon.stack( 1 ), 1 );
|
|
|
|
Upgrades.INVERTER.registerItem( AEApi.instance().items().itemMassCannon.stack( 1 ), 1 );
|
|
|
|
Upgrades.SPEED.registerItem( AEApi.instance().items().itemMassCannon.stack( 1 ), 4 );
|
|
|
|
|
2014-05-07 07:22:42 +02:00
|
|
|
// molecular assembler
|
|
|
|
Upgrades.REDSTONE.registerItem( AEApi.instance().blocks().blockMolecularAssembler.stack( 1 ), 1 );
|
|
|
|
Upgrades.SPEED.registerItem( AEApi.instance().blocks().blockMolecularAssembler.stack( 1 ), 5 );
|
|
|
|
|
2014-02-02 08:32:10 +01:00
|
|
|
AEApi.instance().registries().wireless().registerWirelessHandler( (IWirelessTermHandler) AEApi.instance().items().itemWirelessTerminal.item() );
|
|
|
|
|
2014-02-09 06:08:27 +01:00
|
|
|
if ( AEConfig.instance.isFeatureEnabled( AEFeature.ChestLoot ) )
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
ChestGenHooks d = ChestGenHooks.getInfo( ChestGenHooks.MINESHAFT_CORRIDOR );
|
|
|
|
d.addItem( new WeightedRandomChestContent( AEApi.instance().materials().materialCertusQuartzCrystal.stack( 1 ), 1, 4, 2 ) );
|
|
|
|
d.addItem( new WeightedRandomChestContent( AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ), 1, 4, 2 ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
// add villager trading to black smiths for a few basic materials
|
2014-02-09 06:08:27 +01:00
|
|
|
if ( AEConfig.instance.isFeatureEnabled( AEFeature.VillagerTrading ) )
|
2013-12-27 23:59:59 +01:00
|
|
|
VillagerRegistry.instance().registerVillageTradeHandler( 3, new AETrading() );
|
|
|
|
|
2014-02-09 06:08:27 +01:00
|
|
|
if ( AEConfig.instance.isFeatureEnabled( AEFeature.CertusQuartzWorldGen ) )
|
2014-02-09 02:34:52 +01:00
|
|
|
GameRegistry.registerWorldGenerator( new QuartzWorldGen(), 0 );
|
2013-12-27 23:59:59 +01:00
|
|
|
|
2014-03-03 00:18:15 +01:00
|
|
|
if ( AEConfig.instance.isFeatureEnabled( AEFeature.MeteoriteWorldGen ) )
|
|
|
|
GameRegistry.registerWorldGenerator( new MeteoriteWorldGen(), 0 );
|
|
|
|
|
2014-03-05 08:27:42 +01:00
|
|
|
IMovableRegistry mr = AEApi.instance().registries().moveable();
|
|
|
|
|
|
|
|
/*
|
|
|
|
* White List Vanilla...
|
|
|
|
*/
|
|
|
|
mr.whiteListTileEntity( net.minecraft.tileentity.TileEntityBeacon.class );
|
|
|
|
mr.whiteListTileEntity( net.minecraft.tileentity.TileEntityBrewingStand.class );
|
|
|
|
mr.whiteListTileEntity( net.minecraft.tileentity.TileEntityChest.class );
|
|
|
|
mr.whiteListTileEntity( net.minecraft.tileentity.TileEntityCommandBlock.class );
|
|
|
|
mr.whiteListTileEntity( net.minecraft.tileentity.TileEntityComparator.class );
|
|
|
|
mr.whiteListTileEntity( net.minecraft.tileentity.TileEntityDaylightDetector.class );
|
|
|
|
mr.whiteListTileEntity( net.minecraft.tileentity.TileEntityDispenser.class );
|
|
|
|
mr.whiteListTileEntity( net.minecraft.tileentity.TileEntityDropper.class );
|
|
|
|
mr.whiteListTileEntity( net.minecraft.tileentity.TileEntityEnchantmentTable.class );
|
|
|
|
mr.whiteListTileEntity( net.minecraft.tileentity.TileEntityEnderChest.class );
|
|
|
|
mr.whiteListTileEntity( net.minecraft.tileentity.TileEntityEndPortal.class );
|
|
|
|
mr.whiteListTileEntity( net.minecraft.tileentity.TileEntitySkull.class );
|
|
|
|
mr.whiteListTileEntity( net.minecraft.tileentity.TileEntityFurnace.class );
|
|
|
|
mr.whiteListTileEntity( net.minecraft.tileentity.TileEntityMobSpawner.class );
|
|
|
|
mr.whiteListTileEntity( net.minecraft.tileentity.TileEntitySign.class );
|
|
|
|
mr.whiteListTileEntity( net.minecraft.tileentity.TileEntityPiston.class );
|
|
|
|
mr.whiteListTileEntity( net.minecraft.tileentity.TileEntityFlowerPot.class );
|
|
|
|
mr.whiteListTileEntity( net.minecraft.tileentity.TileEntityNote.class );
|
|
|
|
mr.whiteListTileEntity( net.minecraft.tileentity.TileEntityHopper.class );
|
|
|
|
|
|
|
|
/**
|
2014-05-02 07:00:14 +02:00
|
|
|
* Whitelist AE2
|
2014-03-05 08:27:42 +01:00
|
|
|
*/
|
|
|
|
mr.whiteListTileEntity( AEBaseTile.class );
|
|
|
|
|
2014-02-10 04:16:36 +01:00
|
|
|
recipeHandler.registerHandlers();
|
2014-03-15 21:35:00 +01:00
|
|
|
|
|
|
|
if ( AEConfig.instance.isFeatureEnabled( AEFeature.enableFacadeCrafting ) )
|
|
|
|
CraftingManager.getInstance().getRecipeList().add( new FacadeRecipe() );
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
2014-03-05 08:27:42 +01:00
|
|
|
|
|
|
|
private void registerSpatial(boolean force)
|
|
|
|
{
|
|
|
|
AEConfig config = AEConfig.instance;
|
|
|
|
|
|
|
|
if ( storageBiome == null )
|
|
|
|
{
|
|
|
|
if ( force && config.storageBiomeID == -1 )
|
|
|
|
{
|
|
|
|
storageBiome = new BiomeGenStorage( config.storageBiomeID = Platform.findEmpty( BiomeGenBase.getBiomeGenArray() ) );
|
|
|
|
config.save();
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( !force && config.storageBiomeID != -1 )
|
|
|
|
storageBiome = new BiomeGenStorage( config.storageBiomeID );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( config.storageProviderID != -1 )
|
|
|
|
{
|
|
|
|
DimensionManager.registerProviderType( config.storageProviderID, StorageWorldProvider.class, false );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( config.storageProviderID == -1 && force )
|
|
|
|
{
|
|
|
|
config.storageProviderID = -11;
|
|
|
|
|
|
|
|
while (!DimensionManager.registerProviderType( config.storageProviderID, StorageWorldProvider.class, false ))
|
|
|
|
config.storageProviderID--;
|
|
|
|
|
|
|
|
config.save();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|