Moved a few things to the api file

This commit is contained in:
Robert 2013-11-28 12:19:15 -05:00
parent c4d59a027b
commit 1e36c674a3
7 changed files with 18 additions and 17 deletions

View file

@ -10,10 +10,14 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import dark.api.IVirtualObject;
import dark.core.prefab.terminal.TerminalCommandRegistry;
import dark.core.save.NBTFileHelper;
import dark.core.save.SaveManager;
import dark.api.save.NBTFileHelper;
import dark.api.save.SaveManager;
/** Designed to be used as a container for AccessGroups and AccessUser. If you plan to use this make
* sure to use it correctly. This is designed to be saved separate from the world save if marked for
* global access. Which means it can save/load at will from the world file.
*
* @author DarkGuardsman */
public class AccessProfile implements ISpecialAccess, IVirtualObject
{
/** A list of user access data. */
@ -59,7 +63,7 @@ public class AccessProfile implements ISpecialAccess, IVirtualObject
public AccessProfile generateNew(String name, Object object)
{
TerminalCommandRegistry.loadNewGroupSet(this);
GroupRegistry.loadNewGroupSet(this);
this.profileName = name;
name.replaceAll(" ", "");
String id = null;
@ -215,7 +219,7 @@ public class AccessProfile implements ISpecialAccess, IVirtualObject
{
if (this.groups == null || this.groups.isEmpty())
{
TerminalCommandRegistry.loadNewGroupSet(this);
GroupRegistry.loadNewGroupSet(this);
}
return this.groups;
}

View file

@ -1,4 +1,4 @@
package dark.core.prefab.terminal;
package dark.api.access;
import java.util.ArrayList;
import java.util.HashMap;
@ -7,13 +7,9 @@ import java.util.Map.Entry;
import net.minecraft.entity.player.EntityPlayer;
import dark.api.ITerminal;
import dark.api.access.AccessGroup;
import dark.api.access.ISpecialAccess;
import dark.api.access.ITerminalCommand;
import dark.api.access.Nodes;
/** @author DarkGuardsman */
public class TerminalCommandRegistry
public class GroupRegistry
{
public static final List<ITerminalCommand> COMMANDS = new ArrayList<ITerminalCommand>();
public static final List<String> nodes = new ArrayList<String>();

View file

@ -1,4 +1,4 @@
package dark.core.save;
package dark.api.save;
import java.io.File;
import java.io.FileInputStream;

View file

@ -1,4 +1,4 @@
package dark.core.save;
package dark.api.save;
import java.io.File;
import java.util.ArrayList;

View file

@ -22,12 +22,12 @@ import cpw.mods.fml.common.event.FMLPostInitializationEvent;
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.common.ExternalModHandler;
import dark.core.common.PlayerKeyHandler;
import dark.core.prefab.fluids.FluidHelper;
import dark.core.prefab.tilenetwork.NetworkUpdateHandler;
import dark.core.registration.ModObjectRegistry;
import dark.core.save.SaveManager;
public abstract class ModPrefab
{

View file

@ -16,10 +16,10 @@ import dark.api.access.AccessGroup;
import dark.api.access.AccessUser;
import dark.api.access.ISpecialAccess;
import dark.api.access.Nodes;
import dark.api.access.GroupRegistry;
import dark.core.interfaces.IExternalInv;
import dark.core.interfaces.IInvBox;
import dark.core.prefab.invgui.InvChest;
import dark.core.prefab.terminal.TerminalCommandRegistry;
import dark.core.prefab.tilenetwork.NetworkTileEntities;
/** Prefab for simple object who only need basic inv support and nothing more
@ -299,7 +299,7 @@ public class TileEntityInv extends TileEntityAdvanced implements IExternalInv, I
{
if (this.groups == null || this.groups.isEmpty())
{
TerminalCommandRegistry.loadNewGroupSet(this);
GroupRegistry.loadNewGroupSet(this);
}
return this.groups;
}

View file

@ -13,6 +13,7 @@ import com.google.common.io.ByteArrayDataInput;
import cpw.mods.fml.common.network.PacketDispatcher;
import cpw.mods.fml.common.network.Player;
import dark.api.ITerminal;
import dark.api.access.GroupRegistry;
import dark.core.network.PacketHandler;
import dark.core.prefab.machine.TileEntityEnergyMachine;
@ -123,7 +124,7 @@ public abstract class TileEntityTerminal extends TileEntityEnergyMachine impleme
{
if (id.equalsIgnoreCase(SimplePacketTypes.GUI_COMMAND.name))
{
TerminalCommandRegistry.onCommand(this.worldObj.getPlayerEntityByName(dis.readUTF()), this, dis.readUTF());
GroupRegistry.onCommand(this.worldObj.getPlayerEntityByName(dis.readUTF()), this, dis.readUTF());
this.sendTerminalOutputToClients();
return true;
}