Fix formatting in rv2 API

??? idk
This commit is contained in:
tterrag1098 committed 2014-12-30 15:21:07 -05:00
1 parent d993cd4cbf
commit c49a2f133a
49 files changed
+2113 -2113

No files matched your search

@@ -1,6 +1,6 @@
package appeng.api.config;
public enum ModSettings
{
}
package appeng.api.config;
public enum ModSettings
{
}
+46 -46
View File
@@ -1,46 +1,46 @@
package appeng.api.config;
import java.util.EnumSet;
public enum Settings
{
LEVEL_EMITTER_MODE(EnumSet.allOf( LevelEmitterMode.class )),
REDSTONE_EMITTER(EnumSet.of( RedstoneMode.HIGH_SIGNAL, RedstoneMode.LOW_SIGNAL )), REDSTONE_CONTROLLED(EnumSet.allOf( RedstoneMode.class )),
CONDENSER_OUTPUT(EnumSet.allOf( CondenserOutput.class )),
POWER_UNITS(EnumSet.allOf( PowerUnits.class )), ACCESS(EnumSet.of( AccessRestriction.READ_WRITE, AccessRestriction.READ, AccessRestriction.WRITE )),
SORT_DIRECTION(EnumSet.allOf( SortDir.class )), SORT_BY(EnumSet.allOf( SortOrder.class )),
SEARCH_TOOLTIPS(EnumSet.of( YesNo.YES, YesNo.NO )), VIEW_MODE(EnumSet.allOf( ViewItems.class )), SEARCH_MODE(EnumSet.allOf( SearchBoxMode.class )),
ACTIONS(EnumSet.allOf( ActionItems.class )), IO_DIRECTION(EnumSet.of( RelativeDirection.LEFT, RelativeDirection.RIGHT )),
BLOCK(EnumSet.of( YesNo.YES, YesNo.NO )), OPERATION_MODE(EnumSet.allOf( OperationMode.class )),
FULLNESS_MODE(EnumSet.allOf( FullnessMode.class )), CRAFT_ONLY(EnumSet.of( YesNo.YES, YesNo.NO )),
FUZZY_MODE(EnumSet.allOf( FuzzyMode.class )), LEVEL_TYPE(EnumSet.allOf( LevelType.class )),
TERMINAL_STYLE(EnumSet.of( TerminalStyle.TALL, TerminalStyle.SMALL )), COPY_MODE(EnumSet.allOf( CopyMode.class )),
INTERFACE_TERMINAL(EnumSet.of( YesNo.YES, YesNo.NO )), CRAFT_VIA_REDSTONE(EnumSet.of( YesNo.YES, YesNo.NO )),
STORAGE_FILTER(EnumSet.allOf( StorageFilter.class ));
private EnumSet values;
public EnumSet getPossibleValues()
{
return values;
}
private Settings(EnumSet set) {
if ( set == null || set.isEmpty() )
throw new RuntimeException( "Invalid configuration." );
values = set;
}
}
package appeng.api.config;
import java.util.EnumSet;
public enum Settings
{
LEVEL_EMITTER_MODE(EnumSet.allOf( LevelEmitterMode.class )),
REDSTONE_EMITTER(EnumSet.of( RedstoneMode.HIGH_SIGNAL, RedstoneMode.LOW_SIGNAL )), REDSTONE_CONTROLLED(EnumSet.allOf( RedstoneMode.class )),
CONDENSER_OUTPUT(EnumSet.allOf( CondenserOutput.class )),
POWER_UNITS(EnumSet.allOf( PowerUnits.class )), ACCESS(EnumSet.of( AccessRestriction.READ_WRITE, AccessRestriction.READ, AccessRestriction.WRITE )),
SORT_DIRECTION(EnumSet.allOf( SortDir.class )), SORT_BY(EnumSet.allOf( SortOrder.class )),
SEARCH_TOOLTIPS(EnumSet.of( YesNo.YES, YesNo.NO )), VIEW_MODE(EnumSet.allOf( ViewItems.class )), SEARCH_MODE(EnumSet.allOf( SearchBoxMode.class )),
ACTIONS(EnumSet.allOf( ActionItems.class )), IO_DIRECTION(EnumSet.of( RelativeDirection.LEFT, RelativeDirection.RIGHT )),
BLOCK(EnumSet.of( YesNo.YES, YesNo.NO )), OPERATION_MODE(EnumSet.allOf( OperationMode.class )),
FULLNESS_MODE(EnumSet.allOf( FullnessMode.class )), CRAFT_ONLY(EnumSet.of( YesNo.YES, YesNo.NO )),
FUZZY_MODE(EnumSet.allOf( FuzzyMode.class )), LEVEL_TYPE(EnumSet.allOf( LevelType.class )),
TERMINAL_STYLE(EnumSet.of( TerminalStyle.TALL, TerminalStyle.SMALL )), COPY_MODE(EnumSet.allOf( CopyMode.class )),
INTERFACE_TERMINAL(EnumSet.of( YesNo.YES, YesNo.NO )), CRAFT_VIA_REDSTONE(EnumSet.of( YesNo.YES, YesNo.NO )),
STORAGE_FILTER(EnumSet.allOf( StorageFilter.class ));
private EnumSet values;
public EnumSet getPossibleValues()
{
return values;
}
private Settings(EnumSet set) {
if ( set == null || set.isEmpty() )
throw new RuntimeException( "Invalid configuration." );
values = set;
}
}
+15 -15
View File
@@ -1,15 +1,15 @@
package appeng.api.config;
public enum TunnelType
{
ME, // Network Tunnel
BC_POWER, // MJ Tunnel
IC2_POWER, // EU Tunnel
RF_POWER, // RF Tunnel
REDSTONE, // Redstone Tunnel
FLUID, // Fluid Tunnel
ITEM, // Item Tunnel
LIGHT, // Light Tunnel
BUNDLED_REDSTONE, // Bundled Redstone Tunnel
COMPUTER_MESSAGE // Computer Message Tunnel
}
package appeng.api.config;
public enum TunnelType
{
ME, // Network Tunnel
BC_POWER, // MJ Tunnel
IC2_POWER, // EU Tunnel
RF_POWER, // RF Tunnel
REDSTONE, // Redstone Tunnel
FLUID, // Fluid Tunnel
ITEM, // Item Tunnel
LIGHT, // Light Tunnel
BUNDLED_REDSTONE, // Bundled Redstone Tunnel
COMPUTER_MESSAGE // Computer Message Tunnel
}
@@ -1,11 +1,11 @@
package appeng.api.exceptions;
public class MissingIngredientError extends Exception {
private static final long serialVersionUID = -998858343831371697L;
public MissingIngredientError(String n) {
super( n );
}
}
package appeng.api.exceptions;
public class MissingIngredientError extends Exception {
private static final long serialVersionUID = -998858343831371697L;
public MissingIngredientError(String n) {
super( n );
}
}
@@ -1,12 +1,12 @@
package appeng.api.exceptions;
public class ModNotInstalled extends Exception
{
private static final long serialVersionUID = -9052435206368425494L;
public ModNotInstalled(String t) {
super( t );
}
}
package appeng.api.exceptions;
public class ModNotInstalled extends Exception
{
private static final long serialVersionUID = -9052435206368425494L;
public ModNotInstalled(String t) {
super( t );
}
}
@@ -1,12 +1,12 @@
package appeng.api.exceptions;
public class RecipeError extends Exception
{
private static final long serialVersionUID = -6602870588617670262L;
public RecipeError(String n) {
super( n );
}
}
package appeng.api.exceptions;
public class RecipeError extends Exception
{
private static final long serialVersionUID = -6602870588617670262L;
public RecipeError(String n) {
super( n );
}
}
@@ -1,27 +1,27 @@
package appeng.api.features;
import net.minecraft.item.ItemStack;
public interface INetworkEncodable {
/**
* Used to get the current key from the item.
*
* @param item item
* @return string key of item
*/
String getEncryptionKey(ItemStack item);
/**
* Encode the wireless frequency via the Controller.
*
* @param item
* the wireless terminal.
* @param encKey
* the wireless encryption key.
* @param name
* null for now.
*/
void setEncryptionKey(ItemStack item, String encKey, String name);
}
package appeng.api.features;
import net.minecraft.item.ItemStack;
public interface INetworkEncodable {
/**
* Used to get the current key from the item.
*
* @param item item
* @return string key of item
*/
String getEncryptionKey(ItemStack item);
/**
* Encode the wireless frequency via the Controller.
*
* @param item
* the wireless terminal.
* @param encKey
* the wireless encryption key.
* @param name
* null for now.
*/
void setEncryptionKey(ItemStack item, String encKey, String name);
}
@@ -1,49 +1,49 @@
package appeng.api.features;
import appeng.api.recipes.ICraftHandler;
import appeng.api.recipes.IRecipeHandler;
import appeng.api.recipes.ISubItemResolver;
public interface IRecipeHandlerRegistry
{
/**
* Add a new Recipe Handler to the parser.
*
* MUST BE CALLED IN PRE-INIT
*
* @param name name of crafthandler
* @param handler class of crafthandler
*/
void addNewCraftHandler(String name, Class<? extends ICraftHandler> handler);
/**
* Add a new resolver to the parser.
*
* MUST BE CALLED IN PRE-INIT
*
* @param sir sub item resolver
*/
void addNewSubItemResolver(ISubItemResolver sir);
/**
* @param name name of crafting handler
* @return A recipe handler by name, returns null on failure.
*/
ICraftHandler getCraftHandlerFor(String name);
/**
* @return a new recipe handler, which can be used to parse, and read recipe files.
*/
public IRecipeHandler createNewRecipehandler();
/**
* resolve sub items by name.
*
* @param nameSpace namespace of item
* @param itemName full name of item
* @return ResolverResult or ResolverResultSet
*/
Object resolveItem(String nameSpace, String itemName);
}
package appeng.api.features;
import appeng.api.recipes.ICraftHandler;
import appeng.api.recipes.IRecipeHandler;
import appeng.api.recipes.ISubItemResolver;
public interface IRecipeHandlerRegistry
{
/**
* Add a new Recipe Handler to the parser.
*
* MUST BE CALLED IN PRE-INIT
*
* @param name name of crafthandler
* @param handler class of crafthandler
*/
void addNewCraftHandler(String name, Class<? extends ICraftHandler> handler);
/**
* Add a new resolver to the parser.
*
* MUST BE CALLED IN PRE-INIT
*
* @param sir sub item resolver
*/
void addNewSubItemResolver(ISubItemResolver sir);
/**
* @param name name of crafting handler
* @return A recipe handler by name, returns null on failure.
*/
ICraftHandler getCraftHandlerFor(String name);
/**
* @return a new recipe handler, which can be used to parse, and read recipe files.
*/
public IRecipeHandler createNewRecipehandler();
/**
* resolve sub items by name.
*
* @param nameSpace namespace of item
* @param itemName full name of item
* @return ResolverResult or ResolverResultSet
*/
Object resolveItem(String nameSpace, String itemName);
}
@@ -1,15 +1,15 @@
package appeng.api.implementations.guiobjects;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
/**
* Implemented on Item objects, to return objects used to manage, and interact
* with the contents.
*/
public interface IGuiItem
{
IGuiItemObject getGuiObject(ItemStack is, World world, int x, int y, int z);
}
package appeng.api.implementations.guiobjects;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
/**
* Implemented on Item objects, to return objects used to manage, and interact
* with the contents.
*/
public interface IGuiItem
{
IGuiItemObject getGuiObject(ItemStack is, World world, int x, int y, int z);
}
@@ -1,9 +1,9 @@
package appeng.api.implementations.guiobjects;
import net.minecraft.item.ItemStack;
public interface IGuiItemObject
{
public ItemStack getItemStack();
}
package appeng.api.implementations.guiobjects;
import net.minecraft.item.ItemStack;
public interface IGuiItemObject
{
public ItemStack getItemStack();
}
@@ -1,14 +1,14 @@
package appeng.api.implementations.guiobjects;
import net.minecraft.inventory.IInventory;
import appeng.api.networking.IGridHost;
/**
* Obtained via {@link IGuiItem} getGuiObject
*/
public interface INetworkTool extends IInventory, IGuiItemObject
{
IGridHost getGridHost(); // null for most purposes.
}
package appeng.api.implementations.guiobjects;
import net.minecraft.inventory.IInventory;
import appeng.api.networking.IGridHost;
/**
* Obtained via {@link IGuiItem} getGuiObject
*/
public interface INetworkTool extends IInventory, IGuiItemObject
{
IGridHost getGridHost(); // null for most purposes.
}
@@ -1,14 +1,14 @@
package appeng.api.implementations.guiobjects;
import appeng.api.networking.energy.IEnergySource;
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.ITerminalHost;
import appeng.api.storage.data.IAEItemStack;
/**
* Obtained via {@link IGuiItem} getGuiObject
*/
public interface IPortableCell extends ITerminalHost, IMEMonitor<IAEItemStack>, IEnergySource, IGuiItemObject
{
}
package appeng.api.implementations.guiobjects;
import appeng.api.networking.energy.IEnergySource;
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.ITerminalHost;
import appeng.api.storage.data.IAEItemStack;
/**
* Obtained via {@link IGuiItem} getGuiObject
*/
public interface IPortableCell extends ITerminalHost, IMEMonitor<IAEItemStack>, IEnergySource, IGuiItemObject
{
}
@@ -1,15 +1,15 @@
package appeng.api.implementations.tiles;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.storage.IStorageMonitorable;
/**
* Implemented on inventories that can share their inventories with other networks, best example, ME Interface.
*/
public interface ITileStorageMonitorable
{
IStorageMonitorable getMonitorable(ForgeDirection side, BaseActionSource src);
}
package appeng.api.implementations.tiles;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.storage.IStorageMonitorable;
/**
* Implemented on inventories that can share their inventories with other networks, best example, ME Interface.
*/
public interface ITileStorageMonitorable
{
IStorageMonitorable getMonitorable(ForgeDirection side, BaseActionSource src);
}
@@ -1,30 +1,30 @@
package appeng.api.implementations.tiles;
import appeng.api.networking.IGrid;
import appeng.api.networking.security.IActionHost;
import appeng.api.util.DimensionalCoord;
public interface IWirelessAccessPoint extends IActionHost
{
/**
* @return location of WAP
*/
DimensionalCoord getLocation();
/**
* @return max range for this WAP
*/
double getRange();
/**
* @return can you use this WAP?
*/
boolean isActive();
/**
* @return grid of linked WAP
*/
IGrid getGrid();
}
package appeng.api.implementations.tiles;
import appeng.api.networking.IGrid;
import appeng.api.networking.security.IActionHost;
import appeng.api.util.DimensionalCoord;
public interface IWirelessAccessPoint extends IActionHost
{
/**
* @return location of WAP
*/
DimensionalCoord getLocation();
/**
* @return max range for this WAP
*/
double getRange();
/**
* @return can you use this WAP?
*/
boolean isActive();
/**
* @return grid of linked WAP
*/
IGrid getGrid();
}
@@ -1,20 +1,20 @@
package appeng.api.integration;
/**
* An interface to get access to the individual settings for AE's Internal Bee
* Comparison handler.
*
* Assessable via: ( IBeeComparison )
* IAEItemStack.getTagCompound().getSpecialComparison()
*
* If you don't have the forestry API, just delete this file when using the API.
*/
public interface IBeeComparison
{
/**
* @return the Forestry IIndividual for this comparison object - cast this to a IIndividual if you want to use it.
*/
Object getIndividual();
/**
* An interface to get access to the individual settings for AE's Internal Bee
* Comparison handler.
*
* Assessable via: ( IBeeComparison )
* IAEItemStack.getTagCompound().getSpecialComparison()
*
* If you don't have the forestry API, just delete this file when using the API.
*/
public interface IBeeComparison
{
/**
* @return the Forestry IIndividual for this comparison object - cast this to a IIndividual if you want to use it.
*/
Object getIndividual();
}
@@ -1,45 +1,45 @@
package appeng.api.networking;
/**
* Various flags to determine network node behavior.
*/
public enum GridFlags
{
/**
* import/export buses, terminals, and other devices that use network features, will use this setting.
*/
REQUIRE_CHANNEL,
/**
* P2P ME tunnels use this setting.
*/
COMPRESSED_CHANNEL,
/**
* cannot carry channels over this node.
*/
CANNOT_CARRY,
/**
* Used by P2P Tunnels to prevent tunnels from tunneling recursively.
*/
CANNOT_CARRY_COMPRESSED,
/**
* This node can transmit 32 signals, this should only apply to Tier2 Cable, P2P Tunnels, and Quantum Network
* Bridges.
*/
DENSE_CAPACITY,
/**
* This block is part of a multiblock, used in conjunction with REQUIRE_CHANNEL, and {@link IGridMultiblock} see this
* interface for details.
*/
MULTIBLOCK,
/**
* Indicates which path might be preferred, this only matters if two routes of equal length exist, ad only changes
* the order they are processed in.
*/
PREFERRED
}
package appeng.api.networking;
/**
* Various flags to determine network node behavior.
*/
public enum GridFlags
{
/**
* import/export buses, terminals, and other devices that use network features, will use this setting.
*/
REQUIRE_CHANNEL,
/**
* P2P ME tunnels use this setting.
*/
COMPRESSED_CHANNEL,
/**
* cannot carry channels over this node.
*/
CANNOT_CARRY,
/**
* Used by P2P Tunnels to prevent tunnels from tunneling recursively.
*/
CANNOT_CARRY_COMPRESSED,
/**
* This node can transmit 32 signals, this should only apply to Tier2 Cable, P2P Tunnels, and Quantum Network
* Bridges.
*/
DENSE_CAPACITY,
/**
* This block is part of a multiblock, used in conjunction with REQUIRE_CHANNEL, and {@link IGridMultiblock} see this
* interface for details.
*/
MULTIBLOCK,
/**
* Indicates which path might be preferred, this only matters if two routes of equal length exist, ad only changes
* the order they are processed in.
*/
PREFERRED
}
@@ -1,9 +1,9 @@
package appeng.api.networking;
public enum GridNotification
{
/**
* the visible connections for this node have changed, useful for cable.
*/
ConnectionsChanged,
}
package appeng.api.networking;
public enum GridNotification
{
/**
* the visible connections for this node have changed, useful for cable.
*/
ConnectionsChanged,
}
+71 -71
View File
@@ -1,71 +1,71 @@
package appeng.api.networking;
import appeng.api.networking.events.MENetworkEvent;
import appeng.api.util.IReadOnlyCollection;
/**
* Gives you access to Grid based information.
*
* Don't Implement.
*/
public interface IGrid
{
/**
* Get Access to various grid modules
*
* @param iface face
* @return the IGridCache you requested.
*/
public <C extends IGridCache> C getCache(Class<? extends IGridCache> iface);
/**
* Post an event into the network event bus.
*
* @param ev
* - event to post
* @return returns ev back to original poster
*/
public MENetworkEvent postEvent(MENetworkEvent ev);
/**
* Post an event into the network event bus, but direct it at a single node.
*
* @param ev
* event to post
* @return returns ev back to original poster
*/
public MENetworkEvent postEventTo(IGridNode node, MENetworkEvent ev);
/**
* get a list of the diversity of classes, you can use this to better detect which machines your interested in,
* rather then iterating the entire grid to test them.
*
* @return IReadOnlyCollection of all available host types (Of Type IGridHost).
*/
public IReadOnlyCollection<Class<? extends IGridHost>> getMachinesClasses();
/**
* Get machines on the network.
*
* @param gridHostClass class of the grid host
* @return IMachineSet of all nodes belonging to hosts of specified class.
*/
public IMachineSet getMachines(Class<? extends IGridHost> gridHostClass);
/**
* @return IReadOnlyCollection for all nodes on the network, node visitors are preferred.
*/
IReadOnlyCollection<IGridNode> getNodes();
/**
* @return true if the last node has been removed from the grid.
*/
public boolean isEmpty();
/**
* @return the node considered the pivot point of the grid.
*/
public IGridNode getPivot();
}
package appeng.api.networking;
import appeng.api.networking.events.MENetworkEvent;
import appeng.api.util.IReadOnlyCollection;
/**
* Gives you access to Grid based information.
*
* Don't Implement.
*/
public interface IGrid
{
/**
* Get Access to various grid modules
*
* @param iface face
* @return the IGridCache you requested.
*/
public <C extends IGridCache> C getCache(Class<? extends IGridCache> iface);
/**
* Post an event into the network event bus.
*
* @param ev
* - event to post
* @return returns ev back to original poster
*/
public MENetworkEvent postEvent(MENetworkEvent ev);
/**
* Post an event into the network event bus, but direct it at a single node.
*
* @param ev
* event to post
* @return returns ev back to original poster
*/
public MENetworkEvent postEventTo(IGridNode node, MENetworkEvent ev);
/**
* get a list of the diversity of classes, you can use this to better detect which machines your interested in,
* rather then iterating the entire grid to test them.
*
* @return IReadOnlyCollection of all available host types (Of Type IGridHost).
*/
public IReadOnlyCollection<Class<? extends IGridHost>> getMachinesClasses();
/**
* Get machines on the network.
*
* @param gridHostClass class of the grid host
* @return IMachineSet of all nodes belonging to hosts of specified class.
*/
public IMachineSet getMachines(Class<? extends IGridHost> gridHostClass);
/**
* @return IReadOnlyCollection for all nodes on the network, node visitors are preferred.
*/
IReadOnlyCollection<IGridNode> getNodes();
/**
* @return true if the last node has been removed from the grid.
*/
public boolean isEmpty();
/**
* @return the node considered the pivot point of the grid.
*/
public IGridNode getPivot();
}
@@ -1,89 +1,89 @@
package appeng.api.networking;
import appeng.api.parts.IPart;
import appeng.api.util.AEColor;
import appeng.api.util.DimensionalCoord;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import java.util.EnumSet;
/**
* An Implementation is required to create your node for IGridHost
*
* Implement for use with IGridHost
*/
public interface IGridBlock
{
/**
* how much power to drain per tick as part of idle network usage.
*
* if the value of this changes, you must post a MENetworkPowerIdleChange
*
* @return ae/t to use.
*/
double getIdlePowerUsage();
/**
* Various flags that AE uses to modify basic behavior for various parts of the network.
*
* @return Set of flags for this IGridBlock
*/
EnumSet<GridFlags> getFlags();
/**
* generally speaking you will return true for this, the one exception is buses, or worm holes where the node
* represents something that isn't a real connection in the world, but rather one represented internally to the
* block.
*
* @return if the world can connect to this node, and the node can connect to the world.
*/
boolean isWorldAccessible();
/**
* @return current location of this node
*/
DimensionalCoord getLocation();
/**
* @return Transparent, or a valid color, NULL IS NOT A VALID RETURN
*/
AEColor getGridColor();
/**
* Notifies your IGridBlock that changes were made to your connections
*/
void onGridNotification(GridNotification notification);
/**
* Update Blocks network/connection/booting status. grid,
*
* @param grid grid
* @param channelsInUse used channels
*/
public void setNetworkStatus(IGrid grid, int channelsInUse);
/**
* Determine which sides of the block can be connected too, only used when isWorldAccessible returns true, not used
* for {@link IPart} implementations.
*/
EnumSet<ForgeDirection> getConnectableSides();
/**
* @return the IGridHost for the node, this will be an IGridPart or a TileEntity generally speaking.
*/
IGridHost getMachine();
/**
* called when the grid for the node has changed, the general grid state should not be trusted at this point.
*/
void gridChanged();
/**
* Determines what item stack is used to render this node in the GUI.
*
* @return the render item stack to use to render this node, null is valid, and will not show this node.
*/
public ItemStack getMachineRepresentation();
}
package appeng.api.networking;
import appeng.api.parts.IPart;
import appeng.api.util.AEColor;
import appeng.api.util.DimensionalCoord;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import java.util.EnumSet;
/**
* An Implementation is required to create your node for IGridHost
*
* Implement for use with IGridHost
*/
public interface IGridBlock
{
/**
* how much power to drain per tick as part of idle network usage.
*
* if the value of this changes, you must post a MENetworkPowerIdleChange
*
* @return ae/t to use.
*/
double getIdlePowerUsage();
/**
* Various flags that AE uses to modify basic behavior for various parts of the network.
*
* @return Set of flags for this IGridBlock
*/
EnumSet<GridFlags> getFlags();
/**
* generally speaking you will return true for this, the one exception is buses, or worm holes where the node
* represents something that isn't a real connection in the world, but rather one represented internally to the
* block.
*
* @return if the world can connect to this node, and the node can connect to the world.
*/
boolean isWorldAccessible();
/**
* @return current location of this node
*/
DimensionalCoord getLocation();
/**
* @return Transparent, or a valid color, NULL IS NOT A VALID RETURN
*/
AEColor getGridColor();
/**
* Notifies your IGridBlock that changes were made to your connections
*/
void onGridNotification(GridNotification notification);
/**
* Update Blocks network/connection/booting status. grid,
*
* @param grid grid
* @param channelsInUse used channels
*/
public void setNetworkStatus(IGrid grid, int channelsInUse);
/**
* Determine which sides of the block can be connected too, only used when isWorldAccessible returns true, not used
* for {@link IPart} implementations.
*/
EnumSet<ForgeDirection> getConnectableSides();
/**
* @return the IGridHost for the node, this will be an IGridPart or a TileEntity generally speaking.
*/
IGridHost getMachine();
/**
* called when the grid for the node has changed, the general grid state should not be trusted at this point.
*/
void gridChanged();
/**
* Determines what item stack is used to render this node in the GUI.
*
* @return the render item stack to use to render this node, null is valid, and will not show this node.
*/
public ItemStack getMachineRepresentation();
}
@@ -1,71 +1,71 @@
package appeng.api.networking;
/**
*
* Allows you to create a network wise service, AE2 uses these for providing
* item, spatial, and tunnel services.
*
* Any Class that implements this, should have a public default constructor that
* takes a single argument of type IGrid.
*
*/
public interface IGridCache
{
/**
* Called each tick for the network, allows you to have active network wide
* behaviors.
*
*/
void onUpdateTick();
/**
* inform your cache, that a machine was removed from the grid.
*
* Important: Do not trust the grids state in this method, interact only
* with the node you are passed, if you need to manage other grid
* information, do it on the next updateTick.
*
* @param gridNode removed from that grid
* @param machine to be removed machine
*/
void removeNode(IGridNode gridNode, IGridHost machine);
/**
* informs you cache that a machine was added to the grid.
*
* Important: Do not trust the grids state in this method, interact only
* with the node you are passed, if you need to manage other grid
* information, do it on the next updateTick.
*
* @param gridNode added to grid node
* @param machine to be added machine
*/
void addNode(IGridNode gridNode, IGridHost machine);
/**
* Called when a grid splits into two grids, AE will call a split as it
* Iteratively processes changes. The destination should receive half, and
* the current cache should receive half.
*
* @param destinationStorage storage which receives half of old grid
*/
void onSplit(IGridStorage destinationStorage);
/**
* Called when two grids merge into one, AE will call a join as it
* Iteratively processes changes. Use this method to incorporate all the
* data from the source into your cache.
*
* @param sourceStorage old storage
*/
void onJoin(IGridStorage sourceStorage);
/**
* Called when saving changes,
*
* @param destinationStorage storage
*/
void populateGridStorage(IGridStorage destinationStorage);
}
package appeng.api.networking;
/**
*
* Allows you to create a network wise service, AE2 uses these for providing
* item, spatial, and tunnel services.
*
* Any Class that implements this, should have a public default constructor that
* takes a single argument of type IGrid.
*
*/
public interface IGridCache
{
/**
* Called each tick for the network, allows you to have active network wide
* behaviors.
*
*/
void onUpdateTick();
/**
* inform your cache, that a machine was removed from the grid.
*
* Important: Do not trust the grids state in this method, interact only
* with the node you are passed, if you need to manage other grid
* information, do it on the next updateTick.
*
* @param gridNode removed from that grid
* @param machine to be removed machine
*/
void removeNode(IGridNode gridNode, IGridHost machine);
/**
* informs you cache that a machine was added to the grid.
*
* Important: Do not trust the grids state in this method, interact only
* with the node you are passed, if you need to manage other grid
* information, do it on the next updateTick.
*
* @param gridNode added to grid node
* @param machine to be added machine
*/
void addNode(IGridNode gridNode, IGridHost machine);
/**
* Called when a grid splits into two grids, AE will call a split as it
* Iteratively processes changes. The destination should receive half, and
* the current cache should receive half.
*
* @param destinationStorage storage which receives half of old grid
*/
void onSplit(IGridStorage destinationStorage);
/**
* Called when two grids merge into one, AE will call a join as it
* Iteratively processes changes. Use this method to incorporate all the
* data from the source into your cache.
*
* @param sourceStorage old storage
*/
void onJoin(IGridStorage sourceStorage);
/**
* Called when saving changes,
*
* @param destinationStorage storage
*/
void populateGridStorage(IGridStorage destinationStorage);
}
@@ -1,27 +1,27 @@
package appeng.api.networking;
import java.util.HashMap;
/**
* A registry of grid caches to extend grid functionality.
*/
public interface IGridCacheRegistry
{
/**
* Register a new grid cache for use during operation, must be called during the loading phase.
*
* @param iface grid cache class
*/
void registerGridCache(Class<? extends IGridCache> iface, Class<? extends IGridCache> implementation);
/**
* requests a new instance of a grid cache for use, used internally
*
* @param grid grid
*
* @return a new HashMap of IGridCaches from the registry, called from IGrid when constructing a new grid.
*/
HashMap<Class<? extends IGridCache>, IGridCache> createCacheInstance(IGrid grid);
}
package appeng.api.networking;
import java.util.HashMap;
/**
* A registry of grid caches to extend grid functionality.
*/
public interface IGridCacheRegistry
{
/**
* Register a new grid cache for use during operation, must be called during the loading phase.
*
* @param iface grid cache class
*/
void registerGridCache(Class<? extends IGridCache> iface, Class<? extends IGridCache> implementation);
/**
* requests a new instance of a grid cache for use, used internally
*
* @param grid grid
*
* @return a new HashMap of IGridCaches from the registry, called from IGrid when constructing a new grid.
*/
HashMap<Class<? extends IGridCache>, IGridCache> createCacheInstance(IGrid grid);
}
@@ -1,58 +1,58 @@
package appeng.api.networking;
import net.minecraftforge.common.util.ForgeDirection;
/**
* Access to AE's internal grid connections.
*
* Messing with connection is generally completely unnecessary, you should be able to just use IGridNode.updateState()
* to have AE manage them for you.
*
* Don't Implement.
*/
public interface IGridConnection
{
/**
* lets you get the opposing node of the connection by passing your own node.
*
* @param gridNode current grid node
* @return the IGridNode which represents the opposite side of the connection.
*/
IGridNode getOtherSide(IGridNode gridNode);
/**
* determine the direction of the connection based on your node.
*
* @param gridNode current grid node
* @return the direction of the connection, only valid for in world connections.
*/
ForgeDirection getDirection(IGridNode gridNode);
/**
* by destroying a connection you may create new grids, and trigger un-expected behavior, you should only destroy
* connections if you created them.
*/
void destroy();
/**
* @return node A
*/
IGridNode a();
/**
* @return node B
*/
IGridNode b();
/**
* @return if the connection is invisible this returns false
*/
boolean hasDirection();
/**
* @return how many channels pass over this connections.
*/
int getUsedChannels();
package appeng.api.networking;
import net.minecraftforge.common.util.ForgeDirection;
/**
* Access to AE's internal grid connections.
*
* Messing with connection is generally completely unnecessary, you should be able to just use IGridNode.updateState()
* to have AE manage them for you.
*
* Don't Implement.
*/
public interface IGridConnection
{
/**
* lets you get the opposing node of the connection by passing your own node.
*
* @param gridNode current grid node
* @return the IGridNode which represents the opposite side of the connection.
*/
IGridNode getOtherSide(IGridNode gridNode);
/**
* determine the direction of the connection based on your node.
*
* @param gridNode current grid node
* @return the direction of the connection, only valid for in world connections.
*/
ForgeDirection getDirection(IGridNode gridNode);
/**
* by destroying a connection you may create new grids, and trigger un-expected behavior, you should only destroy
* connections if you created them.
*/
void destroy();
/**
* @return node A
*/
IGridNode a();
/**
* @return node B
*/
IGridNode b();
/**
* @return if the connection is invisible this returns false
*/
boolean hasDirection();
/**
* @return how many channels pass over this connections.
*/
int getUsedChannels();
}
@@ -1,43 +1,43 @@
package appeng.api.networking;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.parts.IPart;
import appeng.api.util.AECableType;
/**
*
* Implement to create a networked {@link TileEntity} or {@link IPart} must
* be implemented for a part, or tile entity to become part of a grid.
*
*/
public interface IGridHost
{
/**
* get the grid node for a particular side of a block, you can return null,
* by returning a valid node later and calling updateState, you can join the
* Grid when your block is ready.
*
* @param dir
* feel free to ignore this, most blocks will use the same node
* for every side.
* @return a new IGridNode, create these with
* AEApi.instance().createGridNode( MyIGridBlock )
*/
public IGridNode getGridNode(ForgeDirection dir);
/**
* Determines how cables render when they connect to this block. Priority is
* Smart &gt; Covered &gt; Glass
*
* @param dir direction
*/
public AECableType getCableConnectionType(ForgeDirection dir);
/**
* break this host, its violating security rules, just break your block, or part.
*/
public void securityBreak();
}
package appeng.api.networking;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.parts.IPart;
import appeng.api.util.AECableType;
/**
*
* Implement to create a networked {@link TileEntity} or {@link IPart} must
* be implemented for a part, or tile entity to become part of a grid.
*
*/
public interface IGridHost
{
/**
* get the grid node for a particular side of a block, you can return null,
* by returning a valid node later and calling updateState, you can join the
* Grid when your block is ready.
*
* @param dir
* feel free to ignore this, most blocks will use the same node
* for every side.
* @return a new IGridNode, create these with
* AEApi.instance().createGridNode( MyIGridBlock )
*/
public IGridNode getGridNode(ForgeDirection dir);
/**
* Determines how cables render when they connect to this block. Priority is
* Smart &gt; Covered &gt; Glass
*
* @param dir direction
*/
public AECableType getCableConnectionType(ForgeDirection dir);
/**
* break this host, its violating security rules, just break your block, or part.
*/
public void securityBreak();
}
+140 -140
View File
@@ -1,141 +1,141 @@
package appeng.api.networking;
import appeng.api.IAppEngApi;
import appeng.api.util.IReadOnlyCollection;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import java.util.EnumSet;
/**
*
* Gives you a view into your Nodes connections and information.
*
* updateState, getGrid, destroy are required to implement a proper IGridHost.
*
* Don't Implement; Acquire from {@link IAppEngApi}.createGridNode
*
*/
public interface IGridNode
{
/**
* lets you walk the grid stating at the current node using a IGridVisitor, generally not needed, please use only if
* required.
*
* @param visitor visitor
*/
void beginVisit(IGridVisitor visitor);
/**
* inform the node that your IGridBlock has changed its internal state, and force the node to update.
*
* ALWAYS make sure that your tile entity is in the world, and has its node properly saved to be returned from the
* host before updating state,
*
* If your entity is not in the world, or if you IGridHost returns a different node for the same side you will
* likely crash the game.
*
*/
void updateState();
/**
* get the machine represented by the node.
*
* @return grid host
*/
IGridHost getMachine();
/**
* get the grid for the node, this can change at a moments notice.
*
* @return grid
*/
IGrid getGrid();
/**
* By destroying your node, you destroy any connections, and its existence in the grid, use in invalidate, or
* onChunkUnload
*/
void destroy();
/**
* @return the world the node is located in
*/
World getWorld();
/**
*
* @return a set of the connected sides, UNKNOWN represents an invisible connection
*/
EnumSet<ForgeDirection> getConnectedSides();
/**
* lets you iterate a nodes connections
*
* @return grid connections
*/
IReadOnlyCollection<IGridConnection> getConnections();
/**
* @return the IGridBlock for this node
*/
IGridBlock getGridBlock();
/**
* Reflects the networks status, returns true only if the network is powered, and the network is not booting, this
* also takes into account channels.
*
* @return true if is Network node active, and participating.
*/
boolean isActive();
/**
* this should be called for each node you create, if you have a nodeData compound to load from, you can store all
* your nods on a single compound using name.
*
* Important: You must call this before updateState.
*
* @param name nbt name
* @param nodeData to be loaded data
*/
void loadFromNBT(String name, NBTTagCompound nodeData);
/**
* this should be called for each node you maintain, you can save all your nodes to the same tag with different
* names, if you fail to complete the load / save procedure, network state may be lost between game load/saves.
*
* @param name nbt name
* @param nodeData to be saved data
*/
void saveToNBT(String name, NBTTagCompound nodeData);
/**
* @return if the node's channel requirements are currently met, use this for display purposes, use isActive for
* status.
*/
boolean meetsChannelRequirements();
/**
* see if this node has a certain flag
*
* @param flag flags
* @return true if has flag
*/
boolean hasFlag(GridFlags flag);
/**
* tell the node who was responsible for placing it, failure to do this may result in in-compatibility with the
* security system. Called instead of loadFromNBT when initially placed, once set never required again, the value is saved with the Node NBT.
*
* @param playerID new player id
*/
void setPlayerID(int playerID);
/**
* @return the ownerID this represents the person who placed the node.
*/
int getPlayerID();
package appeng.api.networking;
import appeng.api.IAppEngApi;
import appeng.api.util.IReadOnlyCollection;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import java.util.EnumSet;
/**
*
* Gives you a view into your Nodes connections and information.
*
* updateState, getGrid, destroy are required to implement a proper IGridHost.
*
* Don't Implement; Acquire from {@link IAppEngApi}.createGridNode
*
*/
public interface IGridNode
{
/**
* lets you walk the grid stating at the current node using a IGridVisitor, generally not needed, please use only if
* required.
*
* @param visitor visitor
*/
void beginVisit(IGridVisitor visitor);
/**
* inform the node that your IGridBlock has changed its internal state, and force the node to update.
*
* ALWAYS make sure that your tile entity is in the world, and has its node properly saved to be returned from the
* host before updating state,
*
* If your entity is not in the world, or if you IGridHost returns a different node for the same side you will
* likely crash the game.
*
*/
void updateState();
/**
* get the machine represented by the node.
*
* @return grid host
*/
IGridHost getMachine();
/**
* get the grid for the node, this can change at a moments notice.
*
* @return grid
*/
IGrid getGrid();
/**
* By destroying your node, you destroy any connections, and its existence in the grid, use in invalidate, or
* onChunkUnload
*/
void destroy();
/**
* @return the world the node is located in
*/
World getWorld();
/**
*
* @return a set of the connected sides, UNKNOWN represents an invisible connection
*/
EnumSet<ForgeDirection> getConnectedSides();
/**
* lets you iterate a nodes connections
*
* @return grid connections
*/
IReadOnlyCollection<IGridConnection> getConnections();
/**
* @return the IGridBlock for this node
*/
IGridBlock getGridBlock();
/**
* Reflects the networks status, returns true only if the network is powered, and the network is not booting, this
* also takes into account channels.
*
* @return true if is Network node active, and participating.
*/
boolean isActive();
/**
* this should be called for each node you create, if you have a nodeData compound to load from, you can store all
* your nods on a single compound using name.
*
* Important: You must call this before updateState.
*
* @param name nbt name
* @param nodeData to be loaded data
*/
void loadFromNBT(String name, NBTTagCompound nodeData);
/**
* this should be called for each node you maintain, you can save all your nodes to the same tag with different
* names, if you fail to complete the load / save procedure, network state may be lost between game load/saves.
*
* @param name nbt name
* @param nodeData to be saved data
*/
void saveToNBT(String name, NBTTagCompound nodeData);
/**
* @return if the node's channel requirements are currently met, use this for display purposes, use isActive for
* status.
*/
boolean meetsChannelRequirements();
/**
* see if this node has a certain flag
*
* @param flag flags
* @return true if has flag
*/
boolean hasFlag(GridFlags flag);
/**
* tell the node who was responsible for placing it, failure to do this may result in in-compatibility with the
* security system. Called instead of loadFromNBT when initially placed, once set never required again, the value is saved with the Node NBT.
*
* @param playerID new player id
*/
void setPlayerID(int playerID);
/**
* @return the ownerID this represents the person who placed the node.
*/
int getPlayerID();
}
@@ -1,21 +1,21 @@
package appeng.api.networking;
/**
* Simple Visitor pattern access to network nodes.
*/
public interface IGridVisitor
{
/**
* Called for each node on the network.
*
* By returning false your informing the host to stop visiting nodes beyond the current node.
*
* @param n
* the current node.
*
* @return true to continue visiting nodes beyond this node.
*/
public boolean visitNode(IGridNode n);
}
package appeng.api.networking;
/**
* Simple Visitor pattern access to network nodes.
*/
public interface IGridVisitor
{
/**
* Called for each node on the network.
*
* By returning false your informing the host to stop visiting nodes beyond the current node.
*
* @param n
* the current node.
*
* @return true to continue visiting nodes beyond this node.
*/
public boolean visitNode(IGridNode n);
}
@@ -1,82 +1,82 @@
package appeng.api.networking.energy;
import appeng.api.config.Actionable;
import appeng.api.networking.IGridCache;
import appeng.api.networking.events.MENetworkPowerStatusChange;
/**
* AE's Power system.
*/
public interface IEnergyGrid extends IGridCache, IEnergySource, IEnergyGridProvider
{
/**
* @return the current calculated idle energy drain each tick, is used internally to drain power for each tick.
*/
public double getIdlePowerUsage();
/**
* @return the average power drain over the past 10 ticks, includes idle usage during this time, and all use of
* extractPower.
*/
public double getAvgPowerUsage();
/**
* @return the average energy injected into the system per tick, for the last 10 ticks.
*/
public double getAvgPowerInjection();
/**
* AE maintains an idle draw of power separate from active power draw, it condenses this into a single operation
* that determines the networks "powered state" if the network is considered off-line, your machines should not
* function.
*
* {@link MENetworkPowerStatusChange} events are posted when this value changes if you need to be notified of the
* change, most machines can simply test the value when they operate.
*
* @return if the network is powered or not.
*/
public boolean isNetworkPowered();
/**
* AE will accept any power, and store it, to maintain sanity please don't send more then 10,000 at a time.
*
* IMPORTANT: Network power knows no bounds, for less spamy power flow, networks can store more then their allotted
* storage, however, it should be kept to a minimum, to help with this, this method returns the networks current
* OVERFLOW, this is not energy you can store some where else, its already stored in the network, you can extract it
* if you want, however it it owned by the network, this is different then IAEEnergyStore
*
* Another important note, is that if a network that had overflow is deleted, its power is gone, this is one of the
* reasons why keeping overflow to a minimum is important.
*
* @param amt
* power to inject into the network
* @param mode
* should the action be simulated or performed?
* @return the amount of power that the network has OVER the limit.
*/
public double injectPower(double amt, Actionable mode);
/**
* this is should be considered an estimate, and not relied upon for real calculations.
*
* @return estimated available power.
*/
public double getStoredPower();
/**
* this is should be considered an estimate, and not relied upon for real calculations.
*
* @return estimated available power.
*/
double getMaxStoredPower();
/**
* Calculation will be capped at maxRequired, this improves performance by limiting the number of nodes needed to
* calculate the demand.
*
* @return Amount of power required to charge the grid, in AE.
*/
public double getEnergyDemand(double maxRequired);
}
package appeng.api.networking.energy;
import appeng.api.config.Actionable;
import appeng.api.networking.IGridCache;
import appeng.api.networking.events.MENetworkPowerStatusChange;
/**
* AE's Power system.
*/
public interface IEnergyGrid extends IGridCache, IEnergySource, IEnergyGridProvider
{
/**
* @return the current calculated idle energy drain each tick, is used internally to drain power for each tick.
*/
public double getIdlePowerUsage();
/**
* @return the average power drain over the past 10 ticks, includes idle usage during this time, and all use of
* extractPower.
*/
public double getAvgPowerUsage();
/**
* @return the average energy injected into the system per tick, for the last 10 ticks.
*/
public double getAvgPowerInjection();
/**
* AE maintains an idle draw of power separate from active power draw, it condenses this into a single operation
* that determines the networks "powered state" if the network is considered off-line, your machines should not
* function.
*
* {@link MENetworkPowerStatusChange} events are posted when this value changes if you need to be notified of the
* change, most machines can simply test the value when they operate.
*
* @return if the network is powered or not.
*/
public boolean isNetworkPowered();
/**
* AE will accept any power, and store it, to maintain sanity please don't send more then 10,000 at a time.
*
* IMPORTANT: Network power knows no bounds, for less spamy power flow, networks can store more then their allotted
* storage, however, it should be kept to a minimum, to help with this, this method returns the networks current
* OVERFLOW, this is not energy you can store some where else, its already stored in the network, you can extract it
* if you want, however it it owned by the network, this is different then IAEEnergyStore
*
* Another important note, is that if a network that had overflow is deleted, its power is gone, this is one of the
* reasons why keeping overflow to a minimum is important.
*
* @param amt
* power to inject into the network
* @param mode
* should the action be simulated or performed?
* @return the amount of power that the network has OVER the limit.
*/
public double injectPower(double amt, Actionable mode);
/**
* this is should be considered an estimate, and not relied upon for real calculations.
*
* @return estimated available power.
*/
public double getStoredPower();
/**
* this is should be considered an estimate, and not relied upon for real calculations.
*
* @return estimated available power.
*/
double getMaxStoredPower();
/**
* Calculation will be capped at maxRequired, this improves performance by limiting the number of nodes needed to
* calculate the demand.
*
* @return Amount of power required to charge the grid, in AE.
*/
public double getEnergyDemand(double maxRequired);
}
@@ -1,28 +1,28 @@
package appeng.api.networking.energy;
import java.util.Set;
import appeng.api.config.Actionable;
/**
* internal use only.
*/
public interface IEnergyGridProvider
{
/**
* internal use only
*/
public double extractAEPower(double amt, Actionable mode, Set<IEnergyGrid> seen);
/**
* internal use only
*/
public double injectAEPower(double amt, Actionable mode, Set<IEnergyGrid> seen);
/**
* internal use only
*/
public double getEnergyDemand(double d, Set<IEnergyGrid> seen);
}
package appeng.api.networking.energy;
import java.util.Set;
import appeng.api.config.Actionable;
/**
* internal use only.
*/
public interface IEnergyGridProvider
{
/**
* internal use only
*/
public double extractAEPower(double amt, Actionable mode, Set<IEnergyGrid> seen);
/**
* internal use only
*/
public double injectAEPower(double amt, Actionable mode, Set<IEnergyGrid> seen);
/**
* internal use only
*/
public double getEnergyDemand(double d, Set<IEnergyGrid> seen);
}
@@ -1,10 +1,10 @@
package appeng.api.networking.events;
/**
* Posted after all the caches are available, but before the grid is fully
* constructed, can be used to perform cross cache construction processes.
*/
public class MENetworkPostCacheConstruction extends MENetworkEvent
{
}
package appeng.api.networking.events;
/**
* Posted after all the caches are available, but before the grid is fully
* constructed, can be used to perform cross cache construction processes.
*/
public class MENetworkPostCacheConstruction extends MENetworkEvent
{
}
@@ -1,24 +1,24 @@
package appeng.api.networking.pathing;
import appeng.api.networking.IGridCache;
public interface IPathingGrid extends IGridCache
{
/**
* @return true if the network is in its booting stage
*/
boolean isNetworkBooting();
/**
* @return the controller state of the network, useful if you want to
* require a controller for a feature.
*/
ControllerState getControllerState();
/**
* trigger a network reset, booting, pathfinding and all.
*/
void repath();
package appeng.api.networking.pathing;
import appeng.api.networking.IGridCache;
public interface IPathingGrid extends IGridCache
{
/**
* @return true if the network is in its booting stage
*/
boolean isNetworkBooting();
/**
* @return the controller state of the network, useful if you want to
* require a controller for a feature.
*/
ControllerState getControllerState();
/**
* trigger a network reset, booting, pathfinding and all.
*/
void repath();
}
@@ -1,45 +1,45 @@
package appeng.api.networking.storage;
import appeng.api.networking.IGridCache;
import appeng.api.networking.IGridHost;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.storage.ICellContainer;
import appeng.api.storage.ICellProvider;
import appeng.api.storage.IStorageMonitorable;
import appeng.api.storage.StorageChannel;
import appeng.api.storage.data.IAEStack;
/**
* Common base class for item / fluid storage caches.
*/
public interface IStorageGrid extends IGridCache, IStorageMonitorable
{
/**
* Used to inform the network of alterations to the storage system that fall outside of the standard Network
* operations, Examples, ME Chest inputs from the world, or a Storage Bus detecting modifications made to the chest
* by an outside force.
*
* Expects the input to have either a negative or a positive stack size to correspond to the injection, or
* extraction operation.
*
* @param input injected items
*/
void postAlterationOfStoredItems(StorageChannel chan, Iterable<? extends IAEStack> input, BaseActionSource src);
/**
* Used to add a cell provider to the storage system
*
* THIS IT NOT FOR USE {@link IGridHost} THAT PROVIDE {@link ICellContainer} - those are automatically handled by
* the storage system.
*
* @param cc to be added cell provider
*/
void registerCellProvider(ICellProvider cc);
/**
* remove a provider added with addCellContainer
*/
void unregisterCellProvider(ICellProvider cc);
}
package appeng.api.networking.storage;
import appeng.api.networking.IGridCache;
import appeng.api.networking.IGridHost;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.storage.ICellContainer;
import appeng.api.storage.ICellProvider;
import appeng.api.storage.IStorageMonitorable;
import appeng.api.storage.StorageChannel;
import appeng.api.storage.data.IAEStack;
/**
* Common base class for item / fluid storage caches.
*/
public interface IStorageGrid extends IGridCache, IStorageMonitorable
{
/**
* Used to inform the network of alterations to the storage system that fall outside of the standard Network
* operations, Examples, ME Chest inputs from the world, or a Storage Bus detecting modifications made to the chest
* by an outside force.
*
* Expects the input to have either a negative or a positive stack size to correspond to the injection, or
* extraction operation.
*
* @param input injected items
*/
void postAlterationOfStoredItems(StorageChannel chan, Iterable<? extends IAEStack> input, BaseActionSource src);
/**
* Used to add a cell provider to the storage system
*
* THIS IT NOT FOR USE {@link IGridHost} THAT PROVIDE {@link ICellContainer} - those are automatically handled by
* the storage system.
*
* @param cc to be added cell provider
*/
void registerCellProvider(ICellProvider cc);
/**
* remove a provider added with addCellContainer
*/
void unregisterCellProvider(ICellProvider cc);
}
@@ -1,56 +1,56 @@
package appeng.api.networking.ticking;
import appeng.api.networking.IGridNode;
/**
* Implement on IGridHosts which want to use AE's Network Ticking Feature.
*/
public interface IGridTickable
{
/**
* Important note regarding IGridTickables with more then one one node,
*
* If your IGridHost hosts multiple nodes, it may be on multiple grids, or
* its node may be present on the same grid multiple times, this is as
* designed, however if you choose to use the grid to tick these Hosts you
* must be aware that they they should probably pick a single node to tick
* for, and not tick for each node.
*
*/
/**
* You can return null, if you wish to tick using MC's ticking mechanism, or
* you can return a valid TickingRequest to tell AE a guide for which type
* of responsiveness your device wants.
*
* this will be called for your tile any time your tile changes grids, this
* can happen at any time, so if your using the sleep feature you may wish
* to preserve your sleep, in the result of this method. or you can simply
* reset it.
*
* @return null or a valid new TickingRequest
*
*/
TickingRequest getTickingRequest(IGridNode node);
/**
* AE lets you adjust your tick rate based on the results of your tick, if
* your block as accomplished work you may wish to increase the ticking
* speed, if your block is idle you may wish to slow it down.
*
* Its up to you.
*
* Note: this is never called if you return null from getTickingRequest.
*
* @param TicksSinceLastCall
* the number of world ticks that were skipped since your last
* tick, you can use this to adjust speed of processing or adjust
* your tick rate.
*
* @return tick rate adjustment.
*
*/
TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall);
}
package appeng.api.networking.ticking;
import appeng.api.networking.IGridNode;
/**
* Implement on IGridHosts which want to use AE's Network Ticking Feature.
*/
public interface IGridTickable
{
/**
* Important note regarding IGridTickables with more then one one node,
*
* If your IGridHost hosts multiple nodes, it may be on multiple grids, or
* its node may be present on the same grid multiple times, this is as
* designed, however if you choose to use the grid to tick these Hosts you
* must be aware that they they should probably pick a single node to tick
* for, and not tick for each node.
*
*/
/**
* You can return null, if you wish to tick using MC's ticking mechanism, or
* you can return a valid TickingRequest to tell AE a guide for which type
* of responsiveness your device wants.
*
* this will be called for your tile any time your tile changes grids, this
* can happen at any time, so if your using the sleep feature you may wish
* to preserve your sleep, in the result of this method. or you can simply
* reset it.
*
* @return null or a valid new TickingRequest
*
*/
TickingRequest getTickingRequest(IGridNode node);
/**
* AE lets you adjust your tick rate based on the results of your tick, if
* your block as accomplished work you may wish to increase the ticking
* speed, if your block is idle you may wish to slow it down.
*
* Its up to you.
*
* Note: this is never called if you return null from getTickingRequest.
*
* @param TicksSinceLastCall
* the number of world ticks that were skipped since your last
* tick, you can use this to adjust speed of processing or adjust
* your tick rate.
*
* @return tick rate adjustment.
*
*/
TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall);
}
@@ -1,44 +1,44 @@
package appeng.api.networking.ticking;
import appeng.api.networking.IGridCache;
import appeng.api.networking.IGridNode;
/**
*
* The network tick manager.
*
*/
public interface ITickManager extends IGridCache
{
/**
* immediately sets the node to tick, only valid if your node is marked as "Alertable" in its TickingRequest
*
* Sleeping Devices Still Alertable, when your tile is alerted its new status is determined by the result of its
* tick.
*
* @param node gridnode
*/
boolean alertDevice(IGridNode node);
/**
*
* disables ticking for your device.
*
* @param node gridnode
*
* @return if the call was successful.
*/
boolean sleepDevice(IGridNode node);
/**
*
* enables ticking for your device, undoes a sleepDevice call.
*
* @param node gridnode
*
* @return if the call was successful.
*/
boolean wakeDevice(IGridNode node);
}
package appeng.api.networking.ticking;
import appeng.api.networking.IGridCache;
import appeng.api.networking.IGridNode;
/**
*
* The network tick manager.
*
*/
public interface ITickManager extends IGridCache
{
/**
* immediately sets the node to tick, only valid if your node is marked as "Alertable" in its TickingRequest
*
* Sleeping Devices Still Alertable, when your tile is alerted its new status is determined by the result of its
* tick.
*
* @param node gridnode
*/
boolean alertDevice(IGridNode node);
/**
*
* disables ticking for your device.
*
* @param node gridnode
*
* @return if the call was successful.
*/
boolean sleepDevice(IGridNode node);
/**
*
* enables ticking for your device, undoes a sleepDevice call.
*
* @param node gridnode
*
* @return if the call was successful.
*/
boolean wakeDevice(IGridNode node);
}
@@ -1,34 +1,34 @@
package appeng.api.networking.ticking;
public enum TickRateModulation
{
/**
* same as idle, but also puts the node to sleep.
*/
SLEEP,
/**
* set tick rate to maximum.
*/
IDLE,
/**
* decrease the tick rate marginally.
*/
SLOWER,
/**
* continue at current rate.
*/
SAME,
/**
* increase the tick rate marginally.
*/
FASTER,
/**
* changes the tick rate to the minimum tick rate.
*/
URGENT
}
package appeng.api.networking.ticking;
public enum TickRateModulation
{
/**
* same as idle, but also puts the node to sleep.
*/
SLEEP,
/**
* set tick rate to maximum.
*/
IDLE,
/**
* decrease the tick rate marginally.
*/
SLOWER,
/**
* continue at current rate.
*/
SAME,
/**
* increase the tick rate marginally.
*/
FASTER,
/**
* changes the tick rate to the minimum tick rate.
*/
URGENT
}
@@ -1,54 +1,54 @@
package appeng.api.networking.ticking;
/**
*
* Describes how your tiles ticking is executed.
*
*/
public class TickingRequest
{
/**
* the minimum number of ticks that must pass between ticks.
*
* Valid Values are : 1+
*
* Suggested is 5-20
*
*/
public final int minTickRate;
/**
* the maximum number of ticks that can pass between ticks, if this value is
* exceeded the tile must tick.
*
* Valid Values are 1+
*
* Suggested is 20-40
*
*/
public final int maxTickRate;
/**
*
* Determines the current expected state of your node, if your node expects
* to be sleeping, then return true.
*
*/
public final boolean isSleeping;
/**
*
* True only if you call {@link ITickManager}.alertDevice( IGridNode );
*
*/
public final boolean canBeAlerted;
public TickingRequest(int min, int max, boolean sleep, boolean alertable) {
minTickRate = min;
maxTickRate = max;
isSleeping = sleep;
canBeAlerted = alertable;
}
}
package appeng.api.networking.ticking;
/**
*
* Describes how your tiles ticking is executed.
*
*/
public class TickingRequest
{
/**
* the minimum number of ticks that must pass between ticks.
*
* Valid Values are : 1+
*
* Suggested is 5-20
*
*/
public final int minTickRate;
/**
* the maximum number of ticks that can pass between ticks, if this value is
* exceeded the tile must tick.
*
* Valid Values are 1+
*
* Suggested is 20-40
*
*/
public final int maxTickRate;
/**
*
* Determines the current expected state of your node, if your node expects
* to be sleeping, then return true.
*
*/
public final boolean isSleeping;
/**
*
* True only if you call {@link ITickManager}.alertDevice( IGridNode );
*
*/
public final boolean canBeAlerted;
public TickingRequest(int min, int max, boolean sleep, boolean alertable) {
minTickRate = min;
maxTickRate = max;
isSleeping = sleep;
canBeAlerted = alertable;
}
}
+5 -5
View File
@@ -1,5 +1,5 @@
@API(apiVersion = "rv2", owner = "appliedenergistics2", provides = "appliedenergistics2|API")
package appeng.api;
import cpw.mods.fml.common.API;
@API(apiVersion = "rv2", owner = "appliedenergistics2", provides = "appliedenergistics2|API")
package appeng.api;
import cpw.mods.fml.common.API;
+10 -10
View File
@@ -1,10 +1,10 @@
package appeng.api.parts;
public enum BusSupport
{
CABLE,
DENSE_CABLE,
NO_PARTS
}
package appeng.api.parts;
public enum BusSupport
{
CABLE,
DENSE_CABLE,
NO_PARTS
}
@@ -1,75 +1,75 @@
package appeng.api.parts;
import io.netty.buffer.ByteBuf;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
import java.io.IOException;
/**
* Used Internally.
*
* not intended for implementation.
*/
public interface IFacadeContainer
{
/**
* Attempts to add the {@link IFacadePart} to the given side.
*
* @return true if the facade as successfully added.
*/
boolean addFacade(IFacadePart a);
/**
* Removed the facade on the given side, or does nothing.
*/
void removeFacade(IPartHost host, ForgeDirection side);
/**
* @return the {@link IFacadePart} for a given side, or null.
*/
IFacadePart getFacade(ForgeDirection s);
/**
* rotate the facades left.
*/
void rotateLeft();
/**
* write nbt data
*
* @param data to be written data
*/
void writeToNBT(NBTTagCompound data);
/**
* read from stream
*
* @param data to be read data
* @return true if it was readable
* @throws IOException
*/
boolean readFromStream(ByteBuf data) throws IOException;
/**
* read from NBT
*
* @param data to be read data
*/
void readFromNBT(NBTTagCompound data);
/**
* write to stream
*
* @param data to be written data
* @throws IOException
*/
void writeToStream(ByteBuf data) throws IOException;
/**
* @return true if there are no facades.
*/
boolean isEmpty();
}
package appeng.api.parts;
import io.netty.buffer.ByteBuf;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
import java.io.IOException;
/**
* Used Internally.
*
* not intended for implementation.
*/
public interface IFacadeContainer
{
/**
* Attempts to add the {@link IFacadePart} to the given side.
*
* @return true if the facade as successfully added.
*/
boolean addFacade(IFacadePart a);
/**
* Removed the facade on the given side, or does nothing.
*/
void removeFacade(IPartHost host, ForgeDirection side);
/**
* @return the {@link IFacadePart} for a given side, or null.
*/
IFacadePart getFacade(ForgeDirection s);
/**
* rotate the facades left.
*/
void rotateLeft();
/**
* write nbt data
*
* @param data to be written data
*/
void writeToNBT(NBTTagCompound data);
/**
* read from stream
*
* @param data to be read data
* @return true if it was readable
* @throws IOException
*/
boolean readFromStream(ByteBuf data) throws IOException;
/**
* read from NBT
*
* @param data to be read data
*/
void readFromNBT(NBTTagCompound data);
/**
* write to stream
*
* @param data to be written data
* @throws IOException
*/
void writeToStream(ByteBuf data) throws IOException;
/**
* @return true if there are no facades.
*/
boolean isEmpty();
}
+76 -76
View File
@@ -1,77 +1,77 @@
package appeng.api.parts;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/**
* Used Internally.
*
* not intended for implementation.
*/
public interface IFacadePart
{
/**
* used to save the part.
*/
ItemStack getItemStack();
/**
* used to collide, and pick the part
*
* @param ch collision helper
* @param e colliding entity
*/
void getBoxes(IPartCollisionHelper ch, Entity e);
/**
* render the part.
*
* @param x x pos of part
* @param y y pos of part
* @param z z pos of part
* @param instance render helper
* @param renderer renderer
* @param fc face container
* @param busBounds bounding box
* @param renderStilt if to render stilt
*/
@SideOnly(Side.CLIENT)
void renderStatic(int x, int y, int z, IPartRenderHelper instance, RenderBlocks renderer, IFacadeContainer fc, AxisAlignedBB busBounds, boolean renderStilt);
/**
* render the part in inventory.
*
* @param instance render helper
* @param renderer renderer
*/
@SideOnly(Side.CLIENT)
void renderInventory(IPartRenderHelper instance, RenderBlocks renderer);
/**
* @return side the facade is in
*/
ForgeDirection getSide();
/**
* @return the box for the face of the facade
*/
AxisAlignedBB getPrimaryBox();
Item getItem();
int getItemDamage();
boolean isBC();
void setThinFacades(boolean useThinFacades);
boolean isTransparent();
package appeng.api.parts;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/**
* Used Internally.
*
* not intended for implementation.
*/
public interface IFacadePart
{
/**
* used to save the part.
*/
ItemStack getItemStack();
/**
* used to collide, and pick the part
*
* @param ch collision helper
* @param e colliding entity
*/
void getBoxes(IPartCollisionHelper ch, Entity e);
/**
* render the part.
*
* @param x x pos of part
* @param y y pos of part
* @param z z pos of part
* @param instance render helper
* @param renderer renderer
* @param fc face container
* @param busBounds bounding box
* @param renderStilt if to render stilt
*/
@SideOnly(Side.CLIENT)
void renderStatic(int x, int y, int z, IPartRenderHelper instance, RenderBlocks renderer, IFacadeContainer fc, AxisAlignedBB busBounds, boolean renderStilt);
/**
* render the part in inventory.
*
* @param instance render helper
* @param renderer renderer
*/
@SideOnly(Side.CLIENT)
void renderInventory(IPartRenderHelper instance, RenderBlocks renderer);
/**
* @return side the facade is in
*/
ForgeDirection getSide();
/**
* @return the box for the face of the facade
*/
AxisAlignedBB getPrimaryBox();
Item getItem();
int getItemDamage();
boolean isBC();
void setThinFacades(boolean useThinFacades);
boolean isTransparent();
}
+151 -151
View File
@@ -1,152 +1,152 @@
package appeng.api.parts;
import appeng.api.util.AEColor;
import appeng.api.util.DimensionalCoord;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Vec3;
import net.minecraftforge.common.util.ForgeDirection;
import java.util.Set;
/**
* Implemented on AE's TileEntity or AE's FMP Part.
*
* Do Not Implement
*/
public interface IPartHost
{
/**
* @return the facade container
*/
IFacadeContainer getFacadeContainer();
/**
* Test if you can add a part to the specified side of the Part Host, {@link ForgeDirection}.UNKNOWN is used to
* represent the cable in the middle.
*
* @param part to be added part
* @param side part placed onto side
* @return returns false if the part cannot be added.
*/
boolean canAddPart(ItemStack part, ForgeDirection side);
/**
* try to add a new part to the specified side, returns false if it failed to be added.
*
* @param is new part
* @param side onto side
* @param owner with owning player
* @return null if the item failed to add, the side it was placed on other wise ( may different for cables,
* {@link ForgeDirection}.UNKNOWN )
*/
ForgeDirection addPart(ItemStack is, ForgeDirection side, EntityPlayer owner);
/**
* Get part by side ( center is {@link ForgeDirection}.UNKNOWN )
*
* @param side side of part
* @return the part located on the specified side, or null if there is no part.
*/
IPart getPart(ForgeDirection side);
/**
* removes the part on the side, this doesn't drop it or anything, if you don't do something with it, its just
* "gone" and its never coming back; think about it.
*
* if you want to drop the part you must request it prior to removing it.
*
* @param side side of part
* @param suppressUpdate
* - used if you need to replace a part's instance, without really removing it first.
*/
void removePart(ForgeDirection side, boolean suppressUpdate);
/**
* something changed, might want to send a packet to clients to update state.
*/
void markForUpdate();
/**
* @return the physical location of the part host in the universe.
*/
DimensionalCoord getLocation();
/**
* @return the tile entity for the host, this can either be an FMP tile, or a AE tile
*/
TileEntity getTile();
/**
* @return the color of the host type ( this is determined by the middle cable. ) if no cable is present, it returns
* {@link AEColor} .Transparent other wise it returns the color of the cable in the center.
*/
AEColor getColor();
/**
* destroys the part container, for internal use.
*/
void clearContainer();
/**
* Used to test for FMP microblock blocking internally.
*
* @return returns if microblocks are blocking this cable path.
*/
boolean isBlocked(ForgeDirection side);
/**
* finds the part located at the position ( pos must be relative, not global )
*
* @param pos part position
* @return a new SelectedPart, this is never null.
*/
SelectedPart selectPart(Vec3 pos);
/**
* can be used by parts to trigger the tile or part to save.
*/
void markForSave();
/**
* part of the {@link LayerBase}
*/
void partChanged();
/**
* get the redstone state of host on this side, this value is cached internally.
*
* @param side side of part
* @return true of the part host is receiving redstone from an external source.
*/
boolean hasRedstone(ForgeDirection side);
/**
* returns false if this block contains any parts or facades, true other wise.
*/
boolean isEmpty();
/**
* @return a mutable list of flags you can adjust to track state.
*/
Set<LayerFlags> getLayerFlags();
/**
* remove host from world...
*/
void cleanup();
/**
* notify neighbors uf updated status.
*/
void notifyNeighbors();
/**
* true if the tile is in the world, other wise false.
*
* @return true if tile is in world
*/
boolean isInWorld();
package appeng.api.parts;
import appeng.api.util.AEColor;
import appeng.api.util.DimensionalCoord;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Vec3;
import net.minecraftforge.common.util.ForgeDirection;
import java.util.Set;
/**
* Implemented on AE's TileEntity or AE's FMP Part.
*
* Do Not Implement
*/
public interface IPartHost
{
/**
* @return the facade container
*/
IFacadeContainer getFacadeContainer();
/**
* Test if you can add a part to the specified side of the Part Host, {@link ForgeDirection}.UNKNOWN is used to
* represent the cable in the middle.
*
* @param part to be added part
* @param side part placed onto side
* @return returns false if the part cannot be added.
*/
boolean canAddPart(ItemStack part, ForgeDirection side);
/**
* try to add a new part to the specified side, returns false if it failed to be added.
*
* @param is new part
* @param side onto side
* @param owner with owning player
* @return null if the item failed to add, the side it was placed on other wise ( may different for cables,
* {@link ForgeDirection}.UNKNOWN )
*/
ForgeDirection addPart(ItemStack is, ForgeDirection side, EntityPlayer owner);
/**
* Get part by side ( center is {@link ForgeDirection}.UNKNOWN )
*
* @param side side of part
* @return the part located on the specified side, or null if there is no part.
*/
IPart getPart(ForgeDirection side);
/**
* removes the part on the side, this doesn't drop it or anything, if you don't do something with it, its just
* "gone" and its never coming back; think about it.
*
* if you want to drop the part you must request it prior to removing it.
*
* @param side side of part
* @param suppressUpdate
* - used if you need to replace a part's instance, without really removing it first.
*/
void removePart(ForgeDirection side, boolean suppressUpdate);
/**
* something changed, might want to send a packet to clients to update state.
*/
void markForUpdate();
/**
* @return the physical location of the part host in the universe.
*/
DimensionalCoord getLocation();
/**
* @return the tile entity for the host, this can either be an FMP tile, or a AE tile
*/
TileEntity getTile();
/**
* @return the color of the host type ( this is determined by the middle cable. ) if no cable is present, it returns
* {@link AEColor} .Transparent other wise it returns the color of the cable in the center.
*/
AEColor getColor();
/**
* destroys the part container, for internal use.
*/
void clearContainer();
/**
* Used to test for FMP microblock blocking internally.
*
* @return returns if microblocks are blocking this cable path.
*/
boolean isBlocked(ForgeDirection side);
/**
* finds the part located at the position ( pos must be relative, not global )
*
* @param pos part position
* @return a new SelectedPart, this is never null.
*/
SelectedPart selectPart(Vec3 pos);
/**
* can be used by parts to trigger the tile or part to save.
*/
void markForSave();
/**
* part of the {@link LayerBase}
*/
void partChanged();
/**
* get the redstone state of host on this side, this value is cached internally.
*
* @param side side of part
* @return true of the part host is receiving redstone from an external source.
*/
boolean hasRedstone(ForgeDirection side);
/**
* returns false if this block contains any parts or facades, true other wise.
*/
boolean isEmpty();
/**
* @return a mutable list of flags you can adjust to track state.
*/
Set<LayerFlags> getLayerFlags();
/**
* remove host from world...
*/
void cleanup();
/**
* notify neighbors uf updated status.
*/
void notifyNeighbors();
/**
* true if the tile is in the world, other wise false.
*
* @return true if tile is in world
*/
boolean isInWorld();
}
@@ -1,14 +1,14 @@
package appeng.api.parts;
public enum PartItemStack
{
Pick,
Break,
Wrench,
Network,
World
}
package appeng.api.parts;
public enum PartItemStack
{
Pick,
Break,
Wrench,
Network,
World
}
@@ -1,64 +1,64 @@
package appeng.api.recipes;
import net.minecraft.item.ItemStack;
import appeng.api.exceptions.MissingIngredientError;
import appeng.api.exceptions.RegistrationError;
public interface IIngredient {
/**
* Acquire a single input stack for the current recipe, if more then one ItemStack is possible a
* RegistrationError exception will be thrown, ignore these and let the system handle the error.
*
* @return a single ItemStack for the recipe handler.
*
* @throws RegistrationError
* @throws MissingIngredientError
*/
ItemStack getItemStack() throws RegistrationError, MissingIngredientError;
/**
* Acquire a list of all the input stacks for the current recipe, this is for handlers that support
* multiple inputs per slot.
*
* @return an array of ItemStacks for the recipe handler.
* @throws RegistrationError
* @throws MissingIngredientError
*/
ItemStack[] getItemStackSet() throws RegistrationError, MissingIngredientError;
/**
* If you wish to support air, you must test before getting the ItemStack, or ItemStackSet
*
* @return true if this slot contains no ItemStack, this is passed as "_"
*/
public boolean isAir();
/**
* @return The Name Space of the item. Prefer getItemStack or getItemStackSet
*/
public String getNameSpace();
/**
* @return The Name of the item. Prefer getItemStack or getItemStackSet
*/
public String getItemName();
/**
* @return The Damage Value of the item. Prefer getItemStack or getItemStackSet
*/
public int getDamageValue();
/**
* @return The Damage Value of the item. Prefer getItemStack or getItemStackSet
*/
public int getQty();
/**
* Bakes the lists in for faster runtime lookups.
* @throws MissingIngredientError
* @throws RegistrationError
*/
void bake() throws RegistrationError, MissingIngredientError;
}
package appeng.api.recipes;
import net.minecraft.item.ItemStack;
import appeng.api.exceptions.MissingIngredientError;
import appeng.api.exceptions.RegistrationError;
public interface IIngredient {
/**
* Acquire a single input stack for the current recipe, if more then one ItemStack is possible a
* RegistrationError exception will be thrown, ignore these and let the system handle the error.
*
* @return a single ItemStack for the recipe handler.
*
* @throws RegistrationError
* @throws MissingIngredientError
*/
ItemStack getItemStack() throws RegistrationError, MissingIngredientError;
/**
* Acquire a list of all the input stacks for the current recipe, this is for handlers that support
* multiple inputs per slot.
*
* @return an array of ItemStacks for the recipe handler.
* @throws RegistrationError
* @throws MissingIngredientError
*/
ItemStack[] getItemStackSet() throws RegistrationError, MissingIngredientError;
/**
* If you wish to support air, you must test before getting the ItemStack, or ItemStackSet
*
* @return true if this slot contains no ItemStack, this is passed as "_"
*/
public boolean isAir();
/**
* @return The Name Space of the item. Prefer getItemStack or getItemStackSet
*/
public String getNameSpace();
/**
* @return The Name of the item. Prefer getItemStack or getItemStackSet
*/
public String getItemName();
/**
* @return The Damage Value of the item. Prefer getItemStack or getItemStackSet
*/
public int getDamageValue();
/**
* @return The Damage Value of the item. Prefer getItemStack or getItemStackSet
*/
public int getQty();
/**
* Bakes the lists in for faster runtime lookups.
* @throws MissingIngredientError
* @throws RegistrationError
*/
void bake() throws RegistrationError, MissingIngredientError;
}
@@ -1,33 +1,33 @@
package appeng.api.storage;
import appeng.api.AEApi;
import appeng.api.storage.data.IAEFluidStack;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IAEStack;
import appeng.api.storage.data.IItemList;
public enum StorageChannel
{
/**
* AE2's Default Storage.
*/
ITEMS( IAEItemStack.class ),
/**
* AE2's Fluid Based Storage ( mainly added to better support ExtraCells )
*/
FLUIDS( IAEFluidStack.class );
public final Class<? extends IAEStack> type;
private StorageChannel( Class<? extends IAEStack> t ) {
type = t;
}
public IItemList createList() {
if ( this == ITEMS )
return AEApi.instance().storage().createItemList();
else
return AEApi.instance().storage().createFluidList();
}
}
package appeng.api.storage;
import appeng.api.AEApi;
import appeng.api.storage.data.IAEFluidStack;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IAEStack;
import appeng.api.storage.data.IItemList;
public enum StorageChannel
{
/**
* AE2's Default Storage.
*/
ITEMS( IAEItemStack.class ),
/**
* AE2's Fluid Based Storage ( mainly added to better support ExtraCells )
*/
FLUIDS( IAEFluidStack.class );
public final Class<? extends IAEStack> type;
private StorageChannel( Class<? extends IAEStack> t ) {
type = t;
}
public IItemList createList() {
if ( this == ITEMS )
return AEApi.instance().storage().createItemList();
else
return AEApi.instance().storage().createFluidList();
}
}
+178 -178
View File
@@ -1,178 +1,178 @@
package appeng.api.storage.data;
import appeng.api.config.FuzzyMode;
import appeng.api.storage.StorageChannel;
import io.netty.buffer.ByteBuf;
import net.minecraft.nbt.NBTTagCompound;
import java.io.IOException;
public interface IAEStack<StackType extends IAEStack>
{
/**
* add two stacks together
*
* @param is added item
*/
void add(StackType is);
/**
* number of items in the stack.
*
* @return basically ItemStack.stackSize
*/
long getStackSize();
/**
* changes the number of items in the stack.
*
* @param stackSize
* , ItemStack.stackSize = N
*/
StackType setStackSize(long stackSize);
/**
* Same as getStackSize, but for requestable items. ( LP )
*
* @return basically itemStack.stackSize but for requestable items.
*/
long getCountRequestable();
/**
* Same as setStackSize, but for requestable items. ( LP )
*
* @return basically itemStack.stackSize = N but for setStackSize items.
*/
StackType setCountRequestable(long countRequestable);
/**
* true, if the item can be crafted.
*
* @return true, if it can be crafted.
*/
boolean isCraftable();
/**
* change weather the item can be crafted.
*
* @param isCraftable can item be crafted
*/
StackType setCraftable(boolean isCraftable);
/**
* clears, requestable, craftable, and stack sizes.
*/
StackType reset();
/**
* returns true, if the item can be crafted, requested, or extracted.
*
* @return isThisRecordMeaningful
*/
boolean isMeaningful();
/**
* Adds more to the stack size...
*
* @param i additional stack size
*/
void incStackSize(long i);
/**
* removes some from the stack size.
*/
void decStackSize(long i);
/**
* adds items to the requestable
*
* @param i increased amount of requested items
*/
void incCountRequestable(long i);
/**
* removes items from the requestable
*
* @param i decreased amount of requested items
*/
void decCountRequestable(long i);
/**
* write to a NBTTagCompound.
*
* @param i to be written data
*/
void writeToNBT(NBTTagCompound i);
/**
* Compare stacks using precise logic.
*
* a IAEItemStack to another AEItemStack or a ItemStack.
*
* or
*
* IAEFluidStack, FluidStack
*
* @param obj compared object
* @return true if they are the same.
*/
@Override
boolean equals(Object obj);
/**
* compare stacks using fuzzy logic
*
* a IAEItemStack to another AEItemStack or a ItemStack.
*
* @param st stacks
* @param mode used fuzzy mode
* @return true if two stacks are equal based on AE Fuzzy Comparison.
*/
boolean fuzzyComparison(Object st, FuzzyMode mode);
/**
* Slower for disk saving, but smaller/more efficient for packets.
*
* @param data to be written data
* @throws IOException
*/
void writeToPacket(ByteBuf data) throws IOException;
/**
* Clone the Item / Fluid Stack
*
* @return a new Stack, which is copied from the original.
*/
StackType copy();
/**
* create an empty stack.
*
* @return a new stack, which represents an empty copy of the original.
*/
StackType empty();
/**
* obtain the NBT Data for the item.
*
* @return nbt data
*/
IAETagCompound getTagCompound();
/**
* @return true if the stack is a {@link IAEItemStack}
*/
boolean isItem();
/**
* @return true if the stack is a {@link IAEFluidStack}
*/
boolean isFluid();
/**
* @return ITEM or FLUID
*/
StorageChannel getChannel();
}
package appeng.api.storage.data;
import appeng.api.config.FuzzyMode;
import appeng.api.storage.StorageChannel;
import io.netty.buffer.ByteBuf;
import net.minecraft.nbt.NBTTagCompound;
import java.io.IOException;
public interface IAEStack<StackType extends IAEStack>
{
/**
* add two stacks together
*
* @param is added item
*/
void add(StackType is);
/**
* number of items in the stack.
*
* @return basically ItemStack.stackSize
*/
long getStackSize();
/**
* changes the number of items in the stack.
*
* @param stackSize
* , ItemStack.stackSize = N
*/
StackType setStackSize(long stackSize);
/**
* Same as getStackSize, but for requestable items. ( LP )
*
* @return basically itemStack.stackSize but for requestable items.
*/
long getCountRequestable();
/**
* Same as setStackSize, but for requestable items. ( LP )
*
* @return basically itemStack.stackSize = N but for setStackSize items.
*/
StackType setCountRequestable(long countRequestable);
/**
* true, if the item can be crafted.
*
* @return true, if it can be crafted.
*/
boolean isCraftable();
/**
* change weather the item can be crafted.
*
* @param isCraftable can item be crafted
*/
StackType setCraftable(boolean isCraftable);
/**
* clears, requestable, craftable, and stack sizes.
*/
StackType reset();
/**
* returns true, if the item can be crafted, requested, or extracted.
*
* @return isThisRecordMeaningful
*/
boolean isMeaningful();
/**
* Adds more to the stack size...
*
* @param i additional stack size
*/
void incStackSize(long i);
/**
* removes some from the stack size.
*/
void decStackSize(long i);
/**
* adds items to the requestable
*
* @param i increased amount of requested items
*/
void incCountRequestable(long i);
/**
* removes items from the requestable
*
* @param i decreased amount of requested items
*/
void decCountRequestable(long i);
/**
* write to a NBTTagCompound.
*
* @param i to be written data
*/
void writeToNBT(NBTTagCompound i);
/**
* Compare stacks using precise logic.
*
* a IAEItemStack to another AEItemStack or a ItemStack.
*
* or
*
* IAEFluidStack, FluidStack
*
* @param obj compared object
* @return true if they are the same.
*/
@Override
boolean equals(Object obj);
/**
* compare stacks using fuzzy logic
*
* a IAEItemStack to another AEItemStack or a ItemStack.
*
* @param st stacks
* @param mode used fuzzy mode
* @return true if two stacks are equal based on AE Fuzzy Comparison.
*/
boolean fuzzyComparison(Object st, FuzzyMode mode);
/**
* Slower for disk saving, but smaller/more efficient for packets.
*
* @param data to be written data
* @throws IOException
*/
void writeToPacket(ByteBuf data) throws IOException;
/**
* Clone the Item / Fluid Stack
*
* @return a new Stack, which is copied from the original.
*/
StackType copy();
/**
* create an empty stack.
*
* @return a new stack, which represents an empty copy of the original.
*/
StackType empty();
/**
* obtain the NBT Data for the item.
*
* @return nbt data
*/
IAETagCompound getTagCompound();
/**
* @return true if the stack is a {@link IAEItemStack}
*/
boolean isItem();
/**
* @return true if the stack is a {@link IAEFluidStack}
*/
boolean isFluid();
/**
* @return ITEM or FLUID
*/
StorageChannel getChannel();
}
+30 -30
View File
@@ -1,30 +1,30 @@
package appeng.api.util;
public enum AECableType
{
/**
* No Cable present.
*/
NONE,
/**
* Connections to this block should render as glass.
*/
GLASS,
/**
* Connections to this block should render as covered.
*/
COVERED,
/**
* Connections to this block should render as smart.
*/
SMART,
/**
* Dense Cable, represents a tier 2 block that can carry 32 channels.
*/
DENSE,
}
package appeng.api.util;
public enum AECableType
{
/**
* No Cable present.
*/
NONE,
/**
* Connections to this block should render as glass.
*/
GLASS,
/**
* Connections to this block should render as covered.
*/
COVERED,
/**
* Connections to this block should render as smart.
*/
SMART,
/**
* Dense Cable, represents a tier 2 block that can carry 32 channels.
*/
DENSE,
}
+88 -88
View File
@@ -1,88 +1,88 @@
package appeng.api.util;
import net.minecraft.util.StatCollector;
/**
* List of all colors supported by AE, their names, and various colors for display.
*
* Should be the same order as Dyes, excluding Transparent.
*/
public enum AEColor
{
White("gui.appliedenergistics2.White", 0xBEBEBE, 0xDBDBDB, 0xFAFAFA),
Orange("gui.appliedenergistics2.Orange", 0xF99739, 0xFAAE44, 0xF4DEC3),
Magenta("gui.appliedenergistics2.Magenta", 0x821E82, 0xB82AB8, 0xC598C8),
LightBlue("gui.appliedenergistics2.LightBlue", 0x628DCB, 0x82ACE7, 0xD8F6FF),
Yellow("gui.appliedenergistics2.Yellow", 0xFFF7AA, 0xF8FF4A, 0xFFFFE8),
Lime("gui.appliedenergistics2.Lime", 0x7CFF4A, 0xBBFF51, 0xE7F7D7),
Pink("gui.appliedenergistics2.Pink", 0xDC8DB5, 0xF8B5D7, 0xF7DEEB),
Gray("gui.appliedenergistics2.Gray", 0x7C7C7C, 0xA0A0A0, 0xC9C9C9),
LightGray("gui.appliedenergistics2.LightGray", 0x9D9D9D, 0xCDCDCD, 0xEFEFEF),
Cyan("gui.appliedenergistics2.Cyan", 0x2F9BA5, 0x51AAC6, 0xAEDDF4),
Purple("gui.appliedenergistics2.Purple", 0x8230B2, 0xA453CE, 0xC7A3CC),
Blue("gui.appliedenergistics2.Blue", 0x2D29A0, 0x514AFF, 0xDDE6FF),
Brown("gui.appliedenergistics2.Brown", 0x724E35, 0xB7967F, 0xE0D2C8),
Green("gui.appliedenergistics2.Green", 0x45A021, 0x60E32E, 0xE3F2E3),
Red("gui.appliedenergistics2.Red", 0xA50029, 0xFF003C, 0xFFE6ED),
Black("gui.appliedenergistics2.Black", 0x2B2B2B, 0x565656, 0x848484),
Transparent("gui.appliedenergistics2.Fluix", 0x1B2344, 0x895CA8, 0xD7BBEC);
/**
* Unlocalized name for color.
*/
final public String unlocalizedName;
/**
* Darkest Variant of the color, nearly black; as a RGB HEX Integer
*/
final public int blackVariant;
/**
* The Variant of the color that is used to represent the color normally; as a RGB HEX Integer
*/
final public int mediumVariant;
/**
* Lightest Variant of the color, nearly white; as a RGB HEX Integer
*/
final public int whiteVariant;
AEColor(String unlocalizedName, int blackHex, int medHex, int whiteHex) {
this.unlocalizedName = unlocalizedName;
blackVariant = blackHex;
mediumVariant = medHex;
whiteVariant = whiteHex;
}
/**
* Logic to see which colors match each other.. special handle for Transparent
*/
public boolean matches(AEColor color)
{
return equals(Transparent) || color.equals(Transparent) || equals(color);
}
@Override
public String toString()
{
return StatCollector.translateToLocal( unlocalizedName );
}
}
package appeng.api.util;
import net.minecraft.util.StatCollector;
/**
* List of all colors supported by AE, their names, and various colors for display.
*
* Should be the same order as Dyes, excluding Transparent.
*/
public enum AEColor
{
White("gui.appliedenergistics2.White", 0xBEBEBE, 0xDBDBDB, 0xFAFAFA),
Orange("gui.appliedenergistics2.Orange", 0xF99739, 0xFAAE44, 0xF4DEC3),
Magenta("gui.appliedenergistics2.Magenta", 0x821E82, 0xB82AB8, 0xC598C8),
LightBlue("gui.appliedenergistics2.LightBlue", 0x628DCB, 0x82ACE7, 0xD8F6FF),
Yellow("gui.appliedenergistics2.Yellow", 0xFFF7AA, 0xF8FF4A, 0xFFFFE8),
Lime("gui.appliedenergistics2.Lime", 0x7CFF4A, 0xBBFF51, 0xE7F7D7),
Pink("gui.appliedenergistics2.Pink", 0xDC8DB5, 0xF8B5D7, 0xF7DEEB),
Gray("gui.appliedenergistics2.Gray", 0x7C7C7C, 0xA0A0A0, 0xC9C9C9),
LightGray("gui.appliedenergistics2.LightGray", 0x9D9D9D, 0xCDCDCD, 0xEFEFEF),
Cyan("gui.appliedenergistics2.Cyan", 0x2F9BA5, 0x51AAC6, 0xAEDDF4),
Purple("gui.appliedenergistics2.Purple", 0x8230B2, 0xA453CE, 0xC7A3CC),
Blue("gui.appliedenergistics2.Blue", 0x2D29A0, 0x514AFF, 0xDDE6FF),
Brown("gui.appliedenergistics2.Brown", 0x724E35, 0xB7967F, 0xE0D2C8),
Green("gui.appliedenergistics2.Green", 0x45A021, 0x60E32E, 0xE3F2E3),
Red("gui.appliedenergistics2.Red", 0xA50029, 0xFF003C, 0xFFE6ED),
Black("gui.appliedenergistics2.Black", 0x2B2B2B, 0x565656, 0x848484),
Transparent("gui.appliedenergistics2.Fluix", 0x1B2344, 0x895CA8, 0xD7BBEC);
/**
* Unlocalized name for color.
*/
final public String unlocalizedName;
/**
* Darkest Variant of the color, nearly black; as a RGB HEX Integer
*/
final public int blackVariant;
/**
* The Variant of the color that is used to represent the color normally; as a RGB HEX Integer
*/
final public int mediumVariant;
/**
* Lightest Variant of the color, nearly white; as a RGB HEX Integer
*/
final public int whiteVariant;
AEColor(String unlocalizedName, int blackHex, int medHex, int whiteHex) {
this.unlocalizedName = unlocalizedName;
blackVariant = blackHex;
mediumVariant = medHex;
whiteVariant = whiteHex;
}
/**
* Logic to see which colors match each other.. special handle for Transparent
*/
public boolean matches(AEColor color)
{
return equals(Transparent) || color.equals(Transparent) || equals(color);
}
@Override
public String toString()
{
return StatCollector.translateToLocal( unlocalizedName );
}
}
@@ -1,47 +1,47 @@
package appeng.api.util;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
public interface AEColoredItemDefinition
{
/**
* @return the {@link Block} Implementation if applicable
*/
Block block(AEColor color);
/**
* @return the {@link Item} Implementation if applicable
*/
Item item(AEColor color);
/**
* @return the {@link TileEntity} Class if applicable.
*/
Class<? extends TileEntity> entity(AEColor color);
/**
* @return an {@link ItemStack} with specified quantity of this item.
*/
ItemStack stack(AEColor color, int stackSize);
/**
* @param stackSize
* - stack size of the result.
* @return an array of all colors.
*/
ItemStack[] allStacks(int stackSize);
/**
* Compare {@link ItemStack} with this {@link AEItemDefinition}
*
* @param color compared color of item
* @param comparableItem compared item
* @return true if the item stack is a matching item.
*/
boolean sameAs(AEColor color, ItemStack comparableItem);
}
package appeng.api.util;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
public interface AEColoredItemDefinition
{
/**
* @return the {@link Block} Implementation if applicable
*/
Block block(AEColor color);
/**
* @return the {@link Item} Implementation if applicable
*/
Item item(AEColor color);
/**
* @return the {@link TileEntity} Class if applicable.
*/
Class<? extends TileEntity> entity(AEColor color);
/**
* @return an {@link ItemStack} with specified quantity of this item.
*/
ItemStack stack(AEColor color, int stackSize);
/**
* @param stackSize
* - stack size of the result.
* @return an array of all colors.
*/
ItemStack[] allStacks(int stackSize);
/**
* Compare {@link ItemStack} with this {@link AEItemDefinition}
*
* @param color compared color of item
* @param comparableItem compared item
* @return true if the item stack is a matching item.
*/
boolean sameAs(AEColor color, ItemStack comparableItem);
}
@@ -1,54 +1,54 @@
package appeng.api.util;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess;
/**
* Gives easy access to different part of the various, items/blocks/materials in AE.
*/
public interface AEItemDefinition
{
/**
* @return the {@link Block} Implementation if applicable
*/
Block block();
/**
* @return the {@link Item} Implementation if applicable
*/
Item item();
/**
* @return the {@link TileEntity} Class if applicable.
*/
Class<? extends TileEntity> entity();
/**
* @return an {@link ItemStack} with specified quantity of this item.
*/
ItemStack stack(int stackSize);
/**
* Compare {@link ItemStack} with this {@link AEItemDefinition}
*
* @param comparableItem compared item
* @return true if the item stack is a matching item.
*/
boolean sameAsStack(ItemStack comparableItem);
/**
* Compare Block with world.
*
* @param world world of block
* @param x x pos of block
* @param y y pos of block
* @param z z pos of block
*
* @return if the block is placed in the world at the specific location.
*/
boolean sameAsBlock(IBlockAccess world, int x, int y, int z);
}
package appeng.api.util;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess;
/**
* Gives easy access to different part of the various, items/blocks/materials in AE.
*/
public interface AEItemDefinition
{
/**
* @return the {@link Block} Implementation if applicable
*/
Block block();
/**
* @return the {@link Item} Implementation if applicable
*/
Item item();
/**
* @return the {@link TileEntity} Class if applicable.
*/
Class<? extends TileEntity> entity();
/**
* @return an {@link ItemStack} with specified quantity of this item.
*/
ItemStack stack(int stackSize);
/**
* Compare {@link ItemStack} with this {@link AEItemDefinition}
*
* @param comparableItem compared item
* @return true if the item stack is a matching item.
*/
boolean sameAsStack(ItemStack comparableItem);
/**
* Compare Block with world.
*
* @param world world of block
* @param x x pos of block
* @param y y pos of block
* @param z z pos of block
*
* @return if the block is placed in the world at the specific location.
*/
boolean sameAsBlock(IBlockAccess world, int x, int y, int z);
}
+22 -22
View File
@@ -1,23 +1,23 @@
package appeng.api.util;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import java.util.ArrayList;
public interface ICommonTile
{
/**
* implemented on AE's Tile Entities, Gets a list of drops that the entity will normally drop, this doesn't include
* the block itself.
*
* @param world world of tile entity
* @param x x pos of tile entity
* @param y y pos of tile entity
* @param z z pos of tile entity
* @param drops drops of tile entity
*/
void getDrops(World world, int x, int y, int z, ArrayList<ItemStack> drops);
package appeng.api.util;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import java.util.ArrayList;
public interface ICommonTile
{
/**
* implemented on AE's Tile Entities, Gets a list of drops that the entity will normally drop, this doesn't include
* the block itself.
*
* @param world world of tile entity
* @param x x pos of tile entity
* @param y y pos of tile entity
* @param z z pos of tile entity
* @param drops drops of tile entity
*/
void getDrops(World world, int x, int y, int z, ArrayList<ItemStack> drops);
}
@@ -1,25 +1,25 @@
package appeng.api.util;
import net.minecraft.world.IBlockAccess;
/**
* Implemented on many of AE's non Tile Entity Blocks as a way to get a IOrientable.
*/
public interface IOrientableBlock
{
/**
* @return if this block uses metadata to store its rotation.
*/
boolean usesMetadata();
/**
* @param world world of block
* @param x x pos of block
* @param y y pos of block
* @param z z pos of block
* @return a IOrientable if applicable
*/
IOrientable getOrientable(IBlockAccess world, int x, int y, int z);
package appeng.api.util;
import net.minecraft.world.IBlockAccess;
/**
* Implemented on many of AE's non Tile Entity Blocks as a way to get a IOrientable.
*/
public interface IOrientableBlock
{
/**
* @return if this block uses metadata to store its rotation.
*/
boolean usesMetadata();
/**
* @param world world of block
* @param x x pos of block
* @param y y pos of block
* @param z z pos of block
* @return a IOrientable if applicable
*/
IOrientable getOrientable(IBlockAccess world, int x, int y, int z);
}