more cleanup

This commit is contained in:
DarkGuardsman 2013-12-04 12:52:12 -05:00
parent 784f8fa366
commit 1c6a60c0c5
16 changed files with 57 additions and 110 deletions

View file

@ -8,11 +8,11 @@ import universalelectricity.core.vector.Vector3;
* @author DarkGuardsman */
public interface IAimable
{
/** Vector which runs from the objects eyes(or gun) to what it is looking at. Should be right
* outside the objects bounds but no farther than that. Used for ray traces mainly */
/** Vector which runs from the objects eyes(or gun). Should be right outside the objects bounds
* but no farther than that. */
public Vector3 getLook();
/** X pitch, Y is yaw, z is roll but is not used for basic aiming */
/** X pitch, Y is yaw, z is roll. Roll is almost never used*/
public Vector3 getRotation();
/** This does not set the rotation but rather moves the current rotation by the given values */

View file

@ -1,8 +1,9 @@
package dark.api.access;
package dark.api;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import dark.api.access.ISpecialAccess;
import dark.core.interfaces.IScroll;
/** Basic methods to make it easier to construct or interact with a terminal based tile. Recommend to

View file

@ -1,7 +1,8 @@
package dark.api.access;
package dark.api;
import java.util.Set;
import net.minecraft.entity.player.EntityPlayer;
/** Prefab for creating commands that most terminal entities can use

View file

@ -1,23 +0,0 @@
package dark.api.access;
/** Container of access groups that can be used by anything. Only the core machine should load/save
* global access collections to prevent conflicts.
*
* @author DarkGuardsman */
public class AccessCollection
{
/** Was created from a save within a tile entity */
public final boolean isLocal;
ISpecialAccess machine;
public AccessCollection(ISpecialAccess machine)
{
this.isLocal = true;
this.machine = machine;
}
public AccessCollection()
{
this.isLocal = false;
}
}

View file

@ -27,10 +27,16 @@ public class AccessProfile implements ISpecialAccess, IVirtualObject
/** Only used by global profiles that have no defined container. Also LocalHost means it was
* created by a tileEntity */
protected String profileID = "LocalHost";
/** Is this profile global */
protected boolean global = false;
/** Save file by which this was loaded from. Mainly used to save it in the same location again. */
protected File saveFile;
static
{
SaveManager.registerClass("AccessProfile", AccessProfile.class);
}
public AccessProfile()
{
if (global)

View file

@ -5,6 +5,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import dark.api.ITerminal;
import dark.api.ITerminalCommand;
import net.minecraft.entity.player.EntityPlayer;
/** @author DarkGuardsman */

View file

@ -8,11 +8,11 @@ import net.minecraftforge.common.ForgeDirection;
public interface IEnergyProvider extends IEnergyDevice
{
/** Called to have the tile provide energy */
public EnergyPack provideEnergy(ForgeDirection from, EnergyPack request, boolean doProvide);
public EnergyPack requestEnergy(ForgeDirection from, EnergyPack request, boolean doProvide);
/** Gets the energy provided at the given time on the given side */
public EnergyPack getEnergyProduce(ForgeDirection direction, String type);
public EnergyPack getEnergyOutput(ForgeDirection direction, String type);
/** Can the device provide energy on the given side */
public boolean canProviderEnergy(ForgeDirection side, String type);
public boolean canOutputEnergy(ForgeDirection side, String type);
}

View file

@ -1,5 +1,9 @@
package dark.api.energy;
/** Applied to devices that have the option to run without power. Normally this option is only shown
* to creative mode players
*
* @author DarkGuardsman */
public interface IPowerLess
{
/** Should this run without power */

View file

@ -1,13 +0,0 @@
package dark.api.energy;
import dark.api.tilenetwork.ITileConnector;
/** A tileEntity that receives a pressure driven fluid. Suggested to use some of the class from
* net.minecraftforge.liquids too make your machine work with other fluid mods that don't use
* pressure */
public interface IPsiReciever extends ITileConnector
{
/** the load that this machine is handling, working, or moving */
public double getPressureLoad();
}

View file

@ -1,24 +0,0 @@
package dark.api.tilenetwork;
import java.util.List;
import net.minecraft.tileentity.TileEntity;
import dark.core.prefab.tilenetwork.NetworkTileEntities;
public interface INetworkHost extends ITileConnector
{
/** Array of connections this tile has to other tiles */
public List<TileEntity> getNetworkConnections();
/** Update the connection this tile has to other tiles */
public void refresh();
/** Gets all networks this machine is part of */
public List<NetworkTileEntities> getTileNetworks();
/** Adds a network to this machine */
public void addNetwork(NetworkTileEntities network);
/** Removes a network from this machine */
public void removeNetwork(NetworkTileEntities network);
}

View file

@ -21,7 +21,8 @@ public interface ITileConnector
/** Force mainly from rotating rods */
FORCE(),
/** Hydraulic pressure from DM pipe */
PRESSURE(),
FLUID_PRESSURE(),
AIR_PRESSURE(),
/** Item pipe */
ITEMS(),
/** Data line input */

View file

@ -9,11 +9,13 @@ import net.minecraft.tileentity.TileEntity;
import com.builtbroken.common.Pair;
import dark.core.ModObjectRegistry;
import dark.core.prefab.ItemBlockHolder;
import dark.core.prefab.machine.BlockMachine;
import dark.machines.common.DarkMain;
/** Actual block that is the sentry gun. Mainly a place holder as the sentry guns need something to
* exist threw that is not an entity.
* exist threw that is not an entity. Renders need to still be handled by the respective mod.
* Especial item renders as this just creates the block and reservers the meta slot
*
* @author DarkGuardsman */
public class BlockSentryGun extends BlockMachine
@ -91,12 +93,18 @@ public class BlockSentryGun extends BlockMachine
{
if (sentryBlockIds[b] == -1)
{
Block block = ModObjectRegistry.createNewBlock("DMSentryGun" + b, DarkMain.MOD_ID, BlockSentryGun.class);
Block block = new BlockSentryGun(b);
if (block != null)
{
ModObjectRegistry.registredBlocks.put(block, "DMSentryGun" + b);
ModObjectRegistry.proxy.registerBlock(block, ItemBlockHolder.class, "DMSentryGun" + b, DarkMain.MOD_ID);
ModObjectRegistry.finishCreation(block, null);
sentryBlockIds[b] = block.blockID;
}
}
}
}
}
@Override
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)

View file

@ -1,30 +0,0 @@
package dark.core.prefab.sentry;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import dark.core.prefab.ItemBlockHolder;
/** Item block that is the unplaced sentry gun. All sentry gun data is held by NBT to allow the
* sentry gun to exist without metadata limits.
*
* @author DarkGuardsman */
public class ItemBlockSentry extends ItemBlockHolder
{
public ItemBlockSentry(int id)
{
super(id);
}
@Override
public int getMetadata(int damage)
{
return 0;
}
@Override
public String getUnlocalizedName(ItemStack itemStack)
{
return Block.blocksList[this.getBlockID()].getUnlocalizedName() + "." + itemStack.getItemDamage();
}
}

View file

@ -4,5 +4,18 @@ import dark.core.prefab.terminal.TileEntityTerminal;
public class TileEntityGunPlatform extends TileEntityTerminal
{
public TileEntityGunPlatform()
{
super(0, 0);
}
public TileEntityGunPlatform(float wattsPerTick)
{
super(wattsPerTick);
}
public TileEntityGunPlatform(float wattsPerTick, float maxEnergy)
{
super(wattsPerTick, maxEnergy);
}
}

View file

@ -4,9 +4,9 @@ import java.util.HashSet;
import java.util.Set;
import net.minecraft.entity.player.EntityPlayer;
import dark.api.ITerminal;
import dark.api.ITerminalCommand;
import dark.api.access.ISpecialAccess;
import dark.api.access.ITerminal;
import dark.api.access.ITerminalCommand;
public class CommandUser implements ITerminalCommand
{

View file

@ -12,8 +12,8 @@ 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.api.access.ITerminal;
import dark.core.network.PacketHandler;
import dark.core.prefab.machine.TileEntityEnergyMachine;
import dark.core.prefab.machine.TileEntityMachine.SimplePacketTypes;