Moved some stuff around
This commit is contained in:
parent
1c6a60c0c5
commit
12bc882ec9
17 changed files with 116 additions and 62 deletions
|
@ -20,8 +20,8 @@ import net.minecraftforge.common.MinecraftForge;
|
|||
import net.minecraftforge.event.Cancelable;
|
||||
import net.minecraftforge.event.Event;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import dark.core.basics.EnumTool;
|
||||
import dark.core.helpers.ItemWorldHelper;
|
||||
import dark.machines.common.items.EnumTool;
|
||||
|
||||
/** An event triggered by entities or tiles that create lasers
|
||||
*
|
||||
|
|
|
@ -16,11 +16,11 @@ import com.builtbroken.common.Pair;
|
|||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import dark.api.ColorCode;
|
||||
import dark.core.basics.EnumMaterial;
|
||||
import dark.core.basics.EnumOrePart;
|
||||
import dark.core.basics.ItemOreDirv;
|
||||
import dark.core.helpers.AutoCraftingManager;
|
||||
import dark.machines.common.CoreRecipeLoader;
|
||||
import dark.machines.common.items.EnumMaterial;
|
||||
import dark.machines.common.items.EnumOrePart;
|
||||
import dark.machines.common.items.ItemOreDirv;
|
||||
|
||||
/** Recipes for ore processor machines
|
||||
*
|
||||
|
|
75
src/dark/core/CoreMachine.java
Normal file
75
src/dark/core/CoreMachine.java
Normal file
|
@ -0,0 +1,75 @@
|
|||
package dark.core;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import universalelectricity.compatibility.Compatibility;
|
||||
import universalelectricity.core.UniversalElectricity;
|
||||
import cpw.mods.fml.common.registry.TickRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import dark.api.save.SaveManager;
|
||||
import dark.core.prefab.LaserEntityDamageSource;
|
||||
import dark.core.prefab.fluids.FluidHelper;
|
||||
import dark.core.prefab.tilenetwork.NetworkUpdateHandler;
|
||||
import dark.machines.common.ExternalModHandler;
|
||||
import dark.machines.common.PlayerKeyHandler;
|
||||
|
||||
public class CoreMachine
|
||||
{
|
||||
private static CoreMachine instance;
|
||||
private boolean pre, load, post;
|
||||
private boolean loadOres, loadItems, loadItemRecipes;
|
||||
|
||||
public static CoreMachine instance()
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = new CoreMachine();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void requestItems(boolean recipes)
|
||||
{
|
||||
this.loadItems = true;
|
||||
if (recipes)
|
||||
this.loadItemRecipes = recipes;
|
||||
}
|
||||
|
||||
public void requestOres()
|
||||
{
|
||||
this.loadOres = true;
|
||||
}
|
||||
|
||||
public void preLoad()
|
||||
{
|
||||
if (!pre)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.register(new FluidHelper());
|
||||
MinecraftForge.EVENT_BUS.register(SaveManager.instance());
|
||||
MinecraftForge.EVENT_BUS.register(new LaserEntityDamageSource(null));
|
||||
TickRegistry.registerTickHandler(NetworkUpdateHandler.instance(), Side.SERVER);
|
||||
TickRegistry.registerScheduledTickHandler(new PlayerKeyHandler(), Side.CLIENT);
|
||||
UniversalElectricity.initiate();
|
||||
Compatibility.initiate();
|
||||
pre = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void Load()
|
||||
{
|
||||
if (!load)
|
||||
{
|
||||
ExternalModHandler.init();
|
||||
ModObjectRegistry.masterBlockConfig.load();
|
||||
load = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void postLoad()
|
||||
{
|
||||
if (!post)
|
||||
{
|
||||
ModObjectRegistry.masterBlockConfig.save();
|
||||
post = true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package dark.machines.common.blocks;
|
||||
package dark.core.basics;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.List;
|
|
@ -1,4 +1,4 @@
|
|||
package dark.machines.common.blocks;
|
||||
package dark.core.basics;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
@ -24,7 +24,6 @@ import dark.core.interfaces.IExtraInfo.IExtraBlockInfo;
|
|||
import dark.core.prefab.ModPrefab;
|
||||
import dark.machines.common.CoreRecipeLoader;
|
||||
import dark.machines.common.DarkMain;
|
||||
import dark.machines.common.items.EnumMaterial;
|
||||
|
||||
public class BlockOre extends Block implements IExtraBlockInfo
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
package dark.machines.common.items;
|
||||
package dark.core.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
|
@ -1,4 +1,4 @@
|
|||
package dark.machines.common.items;
|
||||
package dark.core.basics;
|
||||
|
||||
public enum EnumOrePart
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
package dark.machines.common.items;
|
||||
package dark.core.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
|
@ -1,4 +1,4 @@
|
|||
package dark.machines.common.blocks;
|
||||
package dark.core.basics;
|
||||
|
||||
import java.util.Random;
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package dark.machines.common.blocks;
|
||||
package dark.core.basics;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import dark.core.basics.BlockOre.OreData;
|
||||
import dark.machines.common.DarkMain;
|
||||
import dark.machines.common.blocks.BlockOre.OreData;
|
||||
|
||||
public class ItemBlockOre extends ItemBlock
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
package dark.machines.common.items;
|
||||
package dark.core.basics;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
|
@ -1,4 +1,4 @@
|
|||
package dark.machines.common.items;
|
||||
package dark.core.basics;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package dark.machines.common.items;
|
||||
package dark.core.basics;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -23,6 +23,7 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
|||
import cpw.mods.fml.common.registry.TickRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import dark.api.save.SaveManager;
|
||||
import dark.core.CoreMachine;
|
||||
import dark.core.ModObjectRegistry;
|
||||
import dark.core.prefab.fluids.FluidHelper;
|
||||
import dark.core.prefab.tilenetwork.NetworkUpdateHandler;
|
||||
|
@ -98,43 +99,22 @@ public abstract class ModPrefab
|
|||
public void preInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
this.loadModMeta();
|
||||
|
||||
Modstats.instance().getReporter().registerMod(this);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
if (!preInit)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.register(new FluidHelper());
|
||||
MinecraftForge.EVENT_BUS.register(SaveManager.instance());
|
||||
MinecraftForge.EVENT_BUS.register(new LaserEntityDamageSource(null));
|
||||
TickRegistry.registerTickHandler(NetworkUpdateHandler.instance(), Side.SERVER);
|
||||
TickRegistry.registerScheduledTickHandler(new PlayerKeyHandler(), Side.CLIENT);
|
||||
UniversalElectricity.initiate();
|
||||
Compatibility.initiate();
|
||||
preInit = true;
|
||||
}
|
||||
CoreMachine.instance().preLoad();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void init(FMLInitializationEvent event)
|
||||
{
|
||||
if (!init)
|
||||
{
|
||||
ExternalModHandler.init();
|
||||
ModObjectRegistry.masterBlockConfig.load();
|
||||
init = true;
|
||||
}
|
||||
CoreMachine.instance().Load();
|
||||
this.registerObjects();
|
||||
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event)
|
||||
{
|
||||
if (!postInit)
|
||||
{
|
||||
ModObjectRegistry.masterBlockConfig.save();
|
||||
postInit = true;
|
||||
}
|
||||
CoreMachine.instance().postLoad();
|
||||
this.loadRecipes();
|
||||
}
|
||||
|
||||
|
@ -156,7 +136,7 @@ public abstract class ModPrefab
|
|||
}
|
||||
return date;
|
||||
}
|
||||
|
||||
|
||||
public static boolean isOp(String username)
|
||||
{
|
||||
MinecraftServer theServer = FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||
|
|
|
@ -10,16 +10,16 @@ import dark.api.ColorCode;
|
|||
import dark.api.IToolReadOut.EnumTools;
|
||||
import dark.api.reciepes.MachineRecipeHandler;
|
||||
import dark.api.reciepes.ProcessorType;
|
||||
import dark.core.basics.BlockOre;
|
||||
import dark.core.basics.EnumMaterial;
|
||||
import dark.core.basics.EnumOrePart;
|
||||
import dark.core.basics.EnumTool;
|
||||
import dark.core.basics.ItemCommonTool;
|
||||
import dark.core.basics.ItemOreDirv;
|
||||
import dark.core.basics.ItemParts;
|
||||
import dark.core.basics.BlockOre.OreData;
|
||||
import dark.core.basics.ItemParts.Parts;
|
||||
import dark.machines.common.blocks.BlockBasalt;
|
||||
import dark.machines.common.blocks.BlockOre;
|
||||
import dark.machines.common.blocks.BlockOre.OreData;
|
||||
import dark.machines.common.items.EnumMaterial;
|
||||
import dark.machines.common.items.EnumOrePart;
|
||||
import dark.machines.common.items.EnumTool;
|
||||
import dark.machines.common.items.ItemCommonTool;
|
||||
import dark.machines.common.items.ItemOreDirv;
|
||||
import dark.machines.common.items.ItemParts;
|
||||
import dark.machines.common.items.ItemParts.Parts;
|
||||
import dark.machines.common.items.ItemReadoutTools;
|
||||
import dark.machines.common.items.ItemWrench;
|
||||
import dark.machines.common.machines.BlockSolarPanel;
|
||||
|
|
|
@ -35,6 +35,17 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import dark.api.reciepes.MachineRecipeHandler;
|
||||
import dark.core.ModObjectRegistry;
|
||||
import dark.core.basics.BlockGasOre;
|
||||
import dark.core.basics.BlockOre;
|
||||
import dark.core.basics.EnumMaterial;
|
||||
import dark.core.basics.EnumOrePart;
|
||||
import dark.core.basics.GasOreGenerator;
|
||||
import dark.core.basics.ItemBlockOre;
|
||||
import dark.core.basics.ItemCommonTool;
|
||||
import dark.core.basics.ItemOreDirv;
|
||||
import dark.core.basics.ItemParts;
|
||||
import dark.core.basics.BlockOre.OreData;
|
||||
import dark.core.basics.ItemParts.Parts;
|
||||
import dark.core.helpers.PacketDataWatcher;
|
||||
import dark.core.network.PacketHandler;
|
||||
import dark.core.prefab.ItemBlockHolder;
|
||||
|
@ -48,21 +59,10 @@ import dark.machines.common.blocks.BlockBasalt;
|
|||
import dark.machines.common.blocks.BlockColorGlass;
|
||||
import dark.machines.common.blocks.BlockColorGlowGlass;
|
||||
import dark.machines.common.blocks.BlockColorSand;
|
||||
import dark.machines.common.blocks.BlockGasOre;
|
||||
import dark.machines.common.blocks.BlockOre;
|
||||
import dark.machines.common.blocks.BlockOre.OreData;
|
||||
import dark.machines.common.blocks.GasOreGenerator;
|
||||
import dark.machines.common.blocks.ItemBlockColored;
|
||||
import dark.machines.common.blocks.ItemBlockOre;
|
||||
import dark.machines.common.items.EnumMaterial;
|
||||
import dark.machines.common.items.EnumOrePart;
|
||||
import dark.machines.common.items.ItemBattery;
|
||||
import dark.machines.common.items.ItemColoredDust;
|
||||
import dark.machines.common.items.ItemCommonTool;
|
||||
import dark.machines.common.items.ItemFluidCan;
|
||||
import dark.machines.common.items.ItemOreDirv;
|
||||
import dark.machines.common.items.ItemParts;
|
||||
import dark.machines.common.items.ItemParts.Parts;
|
||||
import dark.machines.common.items.ItemReadoutTools;
|
||||
import dark.machines.common.items.ItemWrench;
|
||||
import dark.machines.common.machines.BlockDebug;
|
||||
|
|
|
@ -10,7 +10,7 @@ import net.minecraft.world.WorldServer;
|
|||
import net.minecraftforge.common.DimensionManager;
|
||||
import cpw.mods.fml.common.ITickHandler;
|
||||
import cpw.mods.fml.common.TickType;
|
||||
import dark.machines.common.blocks.BlockGasOre;
|
||||
import dark.core.basics.BlockGasOre;
|
||||
|
||||
/** Tick handler that takes care of things like decreasing air supply while in gas block
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue