Fix Smeltery null crash, remove crystalline content

This commit is contained in:
mDiyo committed 2013-11-10 17:05:50 -08:00
1 parent fdcb651ef4
commit 2553eb2377
179 files changed
+4578 -5290

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 540 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 756 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 937 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 699 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 819 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 680 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 690 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 682 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 682 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 735 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 735 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 737 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

@@ -1,19 +0,0 @@
{
"animation": {
"frametime": 2,
"frames": [
0,
1,
2,
3,
4,
5,
6,
5,
4,
3,
2,
1
]
}
}
@@ -1,12 +0,0 @@
0*2
1*2
2*2
3*2
4*2
5*2
6*2
5*2
4*2
3*2
2*2
1*2
+40 -41
View File
@@ -9,16 +9,16 @@ import net.minecraft.item.ItemStack;
public class Blocks
{
// World Gen
// World Gen
public static ItemStack blkQuartzOre;
public static ItemStack blkQuartz;
// Tech 1 ( non-ME )
public static ItemStack blkGrinder;
// Tech 4? ( ME Storage )
public static ItemStack blkCable_Colored[];
public static ItemStack blkAssembler;
public static ItemStack blkController;
public static ItemStack blkDrive;
@@ -28,47 +28,46 @@ public class Blocks
public static ItemStack blkChest;
public static ItemStack blkInterface;
public static ItemStack blkPartitioner;
public static ItemStack blkCraftingTerminal;
public static ItemStack blkStorageBus;
public static ItemStack blkAssemblerFieldWall;
public static ItemStack blkHeatVent;
public static ItemStack blkCraftingAccelerator;
public static ItemStack blkCraftingTerminal;
public static ItemStack blkStorageBus;
public static ItemStack blkAssemblerFieldWall;
public static ItemStack blkHeatVent;
public static ItemStack blkCraftingAccelerator;
public static ItemStack blkInputCablePrecision;
public static ItemStack blkInputCableFuzzy;
public static ItemStack blkInputCableBasic;
public static ItemStack blkOutputCablePrecision;
public static ItemStack blkOutputCableFuzzy;
public static ItemStack blkOutputCableBasic;
public static ItemStack blkStorageBusFuzzy;
public static ItemStack blkLevelEmitter;
public static ItemStack blkDarkCable;
public static ItemStack blkIOPort;
public static ItemStack blkCraftingMonitor;
public static ItemStack blkStorageMonitor;
public static ItemStack blkColorlessCable;
public static ItemStack blkColorlessCableCovered;
public static ItemStack blkTransitionPlane;
public static ItemStack blkCondenser;
public static ItemStack blkEnergyCell;
public static ItemStack blkPowerRelay;
public static ItemStack blkQuantumRing;
public static ItemStack blkQuantumLink;
public static ItemStack blkSpatialPylon;
public static ItemStack blkP2PTunnel;
public static ItemStack blkSpatialIOPort;
public static ItemStack blkQuartzGlass;
public static ItemStack blkQuartzLamp;
public static ItemStack blkMatrixFrame;
public static ItemStack blkQuartzPiller;
public static ItemStack blkQuartzChiseled;
public static ItemStack blkOutputCableFuzzy;
public static ItemStack blkOutputCableBasic;
public static ItemStack blkStorageBusFuzzy;
public static ItemStack blkLevelEmitter;
public static ItemStack blkDarkCable;
public static ItemStack blkIOPort;
public static ItemStack blkCraftingMonitor;
public static ItemStack blkStorageMonitor;
public static ItemStack blkColorlessCable;
public static ItemStack blkColorlessCableCovered;
public static ItemStack blkTransitionPlane;
public static ItemStack blkCondenser;
public static ItemStack blkEnergyCell;
public static ItemStack blkPowerRelay;
public static ItemStack blkQuantumRing;
public static ItemStack blkQuantumLink;
public static ItemStack blkSpatialPylon;
public static ItemStack blkP2PTunnel;
public static ItemStack blkSpatialIOPort;
public static ItemStack blkQuartzGlass;
public static ItemStack blkQuartzLamp;
public static ItemStack blkMatrixFrame;
public static ItemStack blkQuartzPiller;
public static ItemStack blkQuartzChiseled;
// Used internally, best not to mess with this one...
public static ItemStack blkPhantom;
+49 -49
View File
@@ -4,55 +4,55 @@ import net.minecraft.world.World;
public class DimentionalCoord extends WorldCoord
{
private World w;
private int dimId;
public DimentionalCoord( DimentionalCoord s )
{
super( s.x, s.y, s.z );
w = s.w;
dimId = s.dimId;
}
public DimentionalCoord( World _w, int _x, int _y, int _z )
{
super(_x, _y, _z);
w = _w;
dimId = _w.provider.dimensionId;
}
@Override
public DimentionalCoord copy()
{
return new DimentionalCoord( this );
}
private World w;
private int dimId;
public boolean isEqual( DimentionalCoord c )
{
return x == c.x && y == c.y && z == c.z && c.w == this.w;
}
@Override
public boolean equals(Object obj)
{
if ( obj instanceof DimentionalCoord )
return isEqual( (DimentionalCoord)obj );
return false;
}
@Override
public int hashCode()
{
return super.hashCode() ^ dimId;
}
public boolean isInWorld(World world)
{
return w == world;
}
public DimentionalCoord(DimentionalCoord s)
{
super(s.x, s.y, s.z);
w = s.w;
dimId = s.dimId;
}
public World getWorld()
{
return w;
}
public DimentionalCoord(World _w, int _x, int _y, int _z)
{
super(_x, _y, _z);
w = _w;
dimId = _w.provider.dimensionId;
}
@Override
public DimentionalCoord copy ()
{
return new DimentionalCoord(this);
}
public boolean isEqual (DimentionalCoord c)
{
return x == c.x && y == c.y && z == c.z && c.w == this.w;
}
@Override
public boolean equals (Object obj)
{
if (obj instanceof DimentionalCoord)
return isEqual((DimentionalCoord) obj);
return false;
}
@Override
public int hashCode ()
{
return super.hashCode() ^ dimId;
}
public boolean isInWorld (World world)
{
return w == world;
}
public World getWorld ()
{
return w;
}
}
+150 -150
View File
@@ -20,156 +20,156 @@ import net.minecraft.nbt.NBTTagCompound;
*/
public interface IAEItemStack
{
/**
* seriously?
* @return the item id of the requested item.
*/
public int getItemID();
/**
* the item's damage.
* @return
*/
public int getItemDamage();
/**
* obtain the NBT Data for the item.
* @return
*/
public IAETagCompound getTagCompound();
/**
* creates a standard MC ItemStack for the item.
* @return new itemstack
*/
public ItemStack getItemStack();
/**
* create a AE Item clone.
* @return the copy.
*/
public IAEItemStack copy();
/**
* number of items in the stack.
* @return basically ItemStack.stackSize
*/
public long getStackSize();
/**
* changes the number of items in the stack.
* @param basically, ItemStack.stackSize = N
*/
public void setStackSize( long stackSize );
/**
* Same as getStackSize, but for requestable items. ( LP )
* @return basically itemStack.stackSize but for requestable items.
*/
long getCountRequestable();
/**
* seriously?
* @return the item id of the requested item.
*/
public int getItemID ();
/**
* Same as setStackSize, but for requestable items. ( LP )
* @return basically itemStack.stackSize = N but for setStackSize items.
*/
void 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
*/
void setCraftable(boolean isCraftable);
/**
* basically itemid and damage in one number..
* @return
*/
int getDef();
/**
* clears, requsetable, craftable, and stack sizes.
*/
public void reset();
/**
* returns true, if the item can be crafted, requested, or extracted.
* @return isThisRecordMeaningful
*/
boolean isMeaninful();
/**
* is there NBT Data for this item?
* @return if there is.
*/
boolean hasTagCompound();
/**
* Combines two IAEItemStacks via addition.
* @param option, to add to the current one.
*/
void add(IAEItemStack option);
/**
* Adds more to the stack size...
* @param i
*/
void incStackSize(long i);
/**
* removes some from the stack size.
*/
void decStackSize(long i);
/**
* adds items to the requestable
* @param i
*/
void incCountRequestable(long i);
/**
* removes items from the requsetable
* @param i
*/
void decCountRequestable(long i);
/**
* quick way to get access to the MC Item Definition.
* @return
*/
Item getItem();
/**
* write to a NBTTagCompound.
* @param i
*/
void writeToNBT(NBTTagCompound i);
/**
* Compare a IAEItemStack to another AEItemStack or a ItemStack.
* @param obj
* @return true if they are the same.
*/
@Override
public boolean equals(Object obj);
/**
* the item's damage.
* @return
*/
public int getItemDamage ();
/**
* obtain the NBT Data for the item.
* @return
*/
public IAETagCompound getTagCompound ();
/**
* creates a standard MC ItemStack for the item.
* @return new itemstack
*/
public ItemStack getItemStack ();
/**
* create a AE Item clone.
* @return the copy.
*/
public IAEItemStack copy ();
/**
* number of items in the stack.
* @return basically ItemStack.stackSize
*/
public long getStackSize ();
/**
* changes the number of items in the stack.
* @param basically, ItemStack.stackSize = N
*/
public void 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.
*/
void 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
*/
void setCraftable (boolean isCraftable);
/**
* basically itemid and damage in one number..
* @return
*/
int getDef ();
/**
* clears, requsetable, craftable, and stack sizes.
*/
public void reset ();
/**
* returns true, if the item can be crafted, requested, or extracted.
* @return isThisRecordMeaningful
*/
boolean isMeaninful ();
/**
* is there NBT Data for this item?
* @return if there is.
*/
boolean hasTagCompound ();
/**
* Combines two IAEItemStacks via addition.
* @param option, to add to the current one.
*/
void add (IAEItemStack option);
/**
* Adds more to the stack size...
* @param i
*/
void incStackSize (long i);
/**
* removes some from the stack size.
*/
void decStackSize (long i);
/**
* adds items to the requestable
* @param i
*/
void incCountRequestable (long i);
/**
* removes items from the requsetable
* @param i
*/
void decCountRequestable (long i);
/**
* quick way to get access to the MC Item Definition.
* @return
*/
Item getItem ();
/**
* write to a NBTTagCompound.
* @param i
*/
void writeToNBT (NBTTagCompound i);
/**
* Compare a IAEItemStack to another AEItemStack or a ItemStack.
* @param obj
* @return true if they are the same.
*/
@Override
public boolean equals (Object obj);
/**
* Compare the Ore Dictionary ID for this to another item.
* @param oreID
* @return
*/
public boolean sameOre (Object oreID);
/**
* Slower for disk saving, but smaller/more efficient for packets.
* @param data
* @throws IOException
*/
public void writeToPacket (DataOutputStream data) throws IOException;
/**
* Compare the Ore Dictionary ID for this to another item.
* @param oreID
* @return
*/
public boolean sameOre( Object oreID );
/**
* Slower for disk saving, but smaller/more efficient for packets.
* @param data
* @throws IOException
*/
public void writeToPacket(DataOutputStream data) throws IOException;
}
+22 -21
View File
@@ -8,25 +8,26 @@ import net.minecraft.nbt.NBTTagCompound;
*
* Don't Implement.
*/
public interface IAETagCompound {
/**
* Create a copy ( the copy will not be a IAETagCompount, it will be a NBTTagCompound. )
* @return
*/
public NBTTagCompound getNBTTagCompoundCopy();
/**
* compare to other NBTTagCompounds or IAETagCompounds
* @param a
* @return true, if they are the same.
*/
boolean equals( Object a );
/**
* returns the special comparison for this tag.
* @return
*/
IItemComparison getSpecialComparison();
public interface IAETagCompound
{
/**
* Create a copy ( the copy will not be a IAETagCompount, it will be a NBTTagCompound. )
* @return
*/
public NBTTagCompound getNBTTagCompoundCopy ();
/**
* compare to other NBTTagCompounds or IAETagCompounds
* @param a
* @return true, if they are the same.
*/
boolean equals (Object a);
/**
* returns the special comparison for this tag.
* @return
*/
IItemComparison getSpecialComparison ();
}
+144 -143
View File
@@ -14,165 +14,166 @@ import net.minecraft.item.crafting.IRecipe;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public interface IAppEngApi {
public interface IAppEngApi
{
/**
* Attempts to paint the block at the specified coords, the specified color, colors are based off of IColoredMETile.Colors
* @param world
* @param x
* @param y
* @param z
* @param color
* @return if the block was painted, or not you can use this to damage your item if you want.
*/
boolean paintBlock(World world, int x, int y, int z, int color);
/**
* Use the movable registry to white list your tiles.
* @param c
*/
IMovableRegistry getMovableRegistry();
/**
* Add new Grid Caches for use during run time, only use during loading phase.
* @return
*/
IGridCacheRegistry getGridCacheRegistry();
/**
* Add additional storage bus handlers to improve interplay with mod blocks that contains special inventories that function unlike vanilla chests.
* AE uses this internally for barrels, dsu's, quantum chests, AE Networks and more. *
* @return IExternalStorageRegistry
*/
IExternalStorageRegistry getExternalStorageRegistry();
/**
* Attempts to paint the block at the specified coords, the specified color, colors are based off of IColoredMETile.Colors
* @param world
* @param x
* @param y
* @param z
* @param color
* @return if the block was painted, or not you can use this to damage your item if you want.
*/
boolean paintBlock (World world, int x, int y, int z, int color);
/**
* Add additional special comparison functionality, AE Uses this internally for Bees.
* @return ISpecialComparisonRegistry
*/
ISpecialComparisonRegistry getSpecialComparsonRegistry();
/**
* gives you access to extractItemsByRecipe, other then this theres not much use for this.
* @param mei
* @return
*/
IMEInventoryUtil getIMEInventoryUtil(IMEInventory mei);
/**
* Use the movable registry to white list your tiles.
* @param c
*/
IMovableRegistry getMovableRegistry ();
/**
* Lets you register your items as wireless terminals
* @return
*/
IWirelessTermRegistery getWirelessRegistry();
/**
* Add new Grid Caches for use during run time, only use during loading phase.
* @return
*/
IGridCacheRegistry getGridCacheRegistry ();
/**
* return an locateable object by its serial
* used internally by AE for QNBs / Network Controllers
* @param serial
* @return
*/
Object getLocateableBySerial(Long serial);
/**
* creates a new instance of IAEItemStack from a MC ItemStack
* @param is
* @return
*/
IAEItemStack createItemStack(ItemStack is);
/**
* Add additional storage bus handlers to improve interplay with mod blocks that contains special inventories that function unlike vanilla chests.
* AE uses this internally for barrels, dsu's, quantum chests, AE Networks and more. *
* @return IExternalStorageRegistry
*/
IExternalStorageRegistry getExternalStorageRegistry ();
/**
* Creates a new instance of IItemList
* @return
*/
IItemList createItemList();
/**
* Add additional special comparison functionality, AE Uses this internally for Bees.
* @return ISpecialComparisonRegistry
*/
ISpecialComparisonRegistry getSpecialComparsonRegistry ();
/**
* Allows you to register new cell types, these will function in drives
* @return
*/
ICellRegistry getCellRegistry();
/**
* gives you access to extractItemsByRecipe, other then this theres not much use for this.
* @param mei
* @return
*/
IMEInventoryUtil getIMEInventoryUtil (IMEInventory mei);
/**
* Manage grinder recipes via API
* @return
*/
IGrinderRecipeManager getGrinderRecipeManage();
/**
* Lets you register your items as wireless terminals
* @return
*/
IWirelessTermRegistery getWirelessRegistry ();
/**
* get access to the locatable registry
* @return
*/
ILocateableRegistry getLocateableRegistry();
/**
* return an locateable object by its serial
* used internally by AE for QNBs / Network Controllers
* @param serial
* @return
*/
Object getLocateableBySerial (Long serial);
/**
* a simple wrapper around the AEItemStack version on IMEInventory
* @param inv
* @param is
* @return
*/
ItemStack addItemsToInv(IMEInventory inv, ItemStack is);
/**
* creates a new instance of IAEItemStack from a MC ItemStack
* @param is
* @return
*/
IAEItemStack createItemStack (ItemStack is);
/**
* a simple wrapper around the AEItemStack version on IMEInventory
* @param inv
* @param is
* @return
*/
ItemStack extractItems(IMEInventory inv, ItemStack is);
/**
* Creates a new instance of IItemList
* @return
*/
IItemList createItemList ();
/**
* Blacklist this item from vanilla AE Terminals / IStorageCell
* @param itemID
* @param meta - if you use OreDictionary.WILDCARD_VALUE it will blacklist the entire itemID.
*/
void addBasicBlackList(int itemID, int meta);
/**
* Allows you to register new cell types, these will function in drives
* @return
*/
ICellRegistry getCellRegistry ();
/**
* Acquire the inventory for a IStorageCell
* @param i
* @return
*/
IMEInventory getBasicCell(ItemStack i);
/**
* Manage grinder recipes via API
* @return
*/
IGrinderRecipeManager getGrinderRecipeManage ();
/**
* checks if the item is a basic storage cell.
* @param i
* @return
*/
Boolean isBasicCell(ItemStack i);
/**
* get access to the locatable registry
* @return
*/
ILocateableRegistry getLocateableRegistry ();
/**
* gives you access to assembler pattern inventories.
* @param i
* @return
*/
ICraftingPatternMAC getAssemblerPattern(ItemStack i);
/**
* a simple wrapper around the AEItemStack version on IMEInventory
* @param inv
* @param is
* @return
*/
ItemStack addItemsToInv (IMEInventory inv, ItemStack is);
/**
* allows you to check if an item is an assembler pattern.
* @param i
* @return
*/
Boolean isAssemblerPattern(ItemStack i);
/**
* a simple wrapper around the AEItemStack version on IMEInventory
* @param inv
* @param is
* @return
*/
ItemStack extractItems (IMEInventory inv, ItemStack is);
/**
* allows you to check if a pattern is blank.
* @param i
* @return
*/
Boolean isBlankPattern(ItemStack i);
/**
* Blacklist this item from vanilla AE Terminals / IStorageCell
* @param itemID
* @param meta - if you use OreDictionary.WILDCARD_VALUE it will blacklist the entire itemID.
*/
void addBasicBlackList (int itemID, int meta);
/**
* gives you the ability to interface with AE Memory Cards.
* @return
*/
IMemoryCard getMemoryCardHandler();
/**
* Acquire the inventory for a IStorageCell
* @param i
* @return
*/
IMEInventory getBasicCell (ItemStack i);
/**
* checks if the item is a basic storage cell.
* @param i
* @return
*/
Boolean isBasicCell (ItemStack i);
/**
* gives you access to assembler pattern inventories.
* @param i
* @return
*/
ICraftingPatternMAC getAssemblerPattern (ItemStack i);
/**
* allows you to check if an item is an assembler pattern.
* @param i
* @return
*/
Boolean isAssemblerPattern (ItemStack i);
/**
* allows you to check if a pattern is blank.
* @param i
* @return
*/
Boolean isBlankPattern (ItemStack i);
/**
* gives you the ability to interface with AE Memory Cards.
* @return
*/
IMemoryCard getMemoryCardHandler ();
/**
* returns the ISpatialStorage for the ItemStack, if it can get from form its item ( or from AE )
* @param is
* @return
*/
ISpatialStorage getSpatialStorageForItem (ItemStack is);
/**
* returns the ISpatialStorage for the ItemStack, if it can get from form its item ( or from AE )
* @param is
* @return
*/
ISpatialStorage getSpatialStorageForItem( ItemStack is );
}
+38 -37
View File
@@ -5,41 +5,42 @@ import net.minecraft.item.ItemStack;
/**
* Lets you manipulate existing recipes.
*/
public interface IAppEngGrinderRecipe {
/**
* the current input
* @return input that the grinder will accept.
*/
public ItemStack getInput();
/**
* lets you change the grinder recipe by changing its input.
* @param input
*/
public void setInput( ItemStack input );
/**
* gets the current output
* @return output that the grinder will produce
*/
public ItemStack getOutput();
/**
* allows you to change the output.
* @param output
*/
public void setOutput( ItemStack output );
/**
* Energy cost, in turns.
* @return number of turns it takes to produce the output from the input.
*/
public int getEnergyCost();
/**
* Allows you to adjust the number of turns
* @param new number of turns to produce output.
*/
public void setEnergyCost(int c);
public interface IAppEngGrinderRecipe
{
/**
* the current input
* @return input that the grinder will accept.
*/
public ItemStack getInput ();
/**
* lets you change the grinder recipe by changing its input.
* @param input
*/
public void setInput (ItemStack input);
/**
* gets the current output
* @return output that the grinder will produce
*/
public ItemStack getOutput ();
/**
* allows you to change the output.
* @param output
*/
public void setOutput (ItemStack output);
/**
* Energy cost, in turns.
* @return number of turns it takes to produce the output from the input.
*/
public int getEnergyCost ();
/**
* Allows you to adjust the number of turns
* @param new number of turns to produce output.
*/
public void setEnergyCost (int c);
}
+17 -16
View File
@@ -6,20 +6,21 @@ import appeng.api.me.util.IMEInventoryHandler;
/**
* Registratio record for a Custom Cell handler.
*/
public interface ICellHandler {
/**
* return true if the provided item is handled by your cell handler. ( AE May choose to skip this method, and just request a handler )
* @param is
* @return return true, if getCellHandler will not return null.
*/
boolean isCell( ItemStack is );
/**
* return a new IMEHandler for the provided item.
* @param is
* @return if you cannot handle the provided item, return null.
*/
IMEInventoryHandler getCellHandler( ItemStack is );
public interface ICellHandler
{
/**
* return true if the provided item is handled by your cell handler. ( AE May choose to skip this method, and just request a handler )
* @param is
* @return return true, if getCellHandler will not return null.
*/
boolean isCell (ItemStack is);
/**
* return a new IMEHandler for the provided item.
* @param is
* @return if you cannot handle the provided item, return null.
*/
IMEInventoryHandler getCellHandler (ItemStack is);
}
+23 -22
View File
@@ -6,26 +6,27 @@ import appeng.api.me.util.IMEInventoryHandler;
/**
* Storage Cell Registry, used for specially implemented cells, if you just want to make a item act like a cell, or new cell with diffrent bytes, then you should probobly consider IStorageCell instead its consideriablly simpler.
*/
public interface ICellRegistry {
/**
* Register a new handler.
* @param h
*/
void addCellHandler( ICellHandler h );
/**
* returns true if the provided item, can be handled by a handler in AE, ( AE May choose to skip this and just get the handler instead. )
* @param is
* @return returns true, if you can get a InventoryHandler for the item passed.
*/
boolean isCellHandled( ItemStack is );
/**
* returns an IMEInventoryHandler for the provided item.
* @param is
* @return new IMEInventoryHandler, or null if there isn't one.
*/
IMEInventoryHandler getHandlerForCell( ItemStack is );
public interface ICellRegistry
{
/**
* Register a new handler.
* @param h
*/
void addCellHandler (ICellHandler h);
/**
* returns true if the provided item, can be handled by a handler in AE, ( AE May choose to skip this and just get the handler instead. )
* @param is
* @return returns true, if you can get a InventoryHandler for the item passed.
*/
boolean isCellHandled (ItemStack is);
/**
* returns an IMEInventoryHandler for the provided item.
* @param is
* @return new IMEInventoryHandler, or null if there isn't one.
*/
IMEInventoryHandler getHandlerForCell (ItemStack is);
}
+17 -16
View File
@@ -8,20 +8,21 @@ import appeng.api.me.util.IMEInventory;
* A Registration for a special storage handler.
*
*/
public interface IExternalStorageHandler {
/**
* if this can handle the provided inventory, return true. ( Generally skipped by AE, and it just calls getInventory )
* @param te
* @return true, if it can get a handler via getInventory
*/
boolean canHandle( TileEntity te, ForgeDirection d );
/**
* if this can handle the given inventory, return the a IMEInventory implemnting class for it, if not return null
* @param te
* @return HandlerFor Inventory.
*/
IMEInventory getInventory( TileEntity te, ForgeDirection d );
public interface IExternalStorageHandler
{
/**
* if this can handle the provided inventory, return true. ( Generally skipped by AE, and it just calls getInventory )
* @param te
* @return true, if it can get a handler via getInventory
*/
boolean canHandle (TileEntity te, ForgeDirection d);
/**
* if this can handle the given inventory, return the a IMEInventory implemnting class for it, if not return null
* @param te
* @return HandlerFor Inventory.
*/
IMEInventory getInventory (TileEntity te, ForgeDirection d);
}
+17 -16
View File
@@ -3,20 +3,21 @@ package appeng.api;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
public interface IExternalStorageRegistry {
/**
* A registry for StorageBus interactions
* @param ei
*/
void addExternalStorageInterface( IExternalStorageHandler ei );
/**
* returns the handler for a given tile / forge direction.
* @param te
* @param opposite
* @return
*/
IExternalStorageHandler getHandler(TileEntity te, ForgeDirection opposite);
public interface IExternalStorageRegistry
{
/**
* A registry for StorageBus interactions
* @param ei
*/
void addExternalStorageInterface (IExternalStorageHandler ei);
/**
* returns the handler for a given tile / forge direction.
* @param te
* @param opposite
* @return
*/
IExternalStorageHandler getHandler (TileEntity te, ForgeDirection opposite);
}
+17 -16
View File
@@ -5,20 +5,21 @@ import appeng.api.me.util.IGridCache;
/**
* 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 cl
* @return cache id ( can be used later to ask the grid for you cache. )
*/
int registerGridCache( Class<? extends IGridCache> cl );
/**
* requests a new instance of a grid cache for use, used internally
* @param id
* @return
*/
IGridCache[] createCacheInstance();
public interface IGridCacheRegistry
{
/**
* Register a new grid cache for use during operation, must be called during the loading phase.
* @param cl
* @return cache id ( can be used later to ask the grid for you cache. )
*/
int registerGridCache (Class<? extends IGridCache> cl);
/**
* requests a new instance of a grid cache for use, used internally
* @param id
* @return
*/
IGridCache[] createCacheInstance ();
}
+23 -22
View File
@@ -7,26 +7,27 @@ import net.minecraft.item.ItemStack;
/**
* Lets you manipulate Grinder Recipes, by adding or editing existing ones.
*/
public interface IGrinderRecipeManager {
/**
* Current list of registered recipes, you can modify this if you want too.
* @return currentlyRegistredRecipes
*/
public List<IAppEngGrinderRecipe> getRecipes();
/**
* add a new recipe the easy way, in -> out, how many turns.
* @param in
* @param out
* @param cost
*/
public void addRecipe( ItemStack in, ItemStack out, int cost );
/**
* Searches for a recipe for a given input, and returns it.
* @param input
* @return identified recipe, or null
*/
public IAppEngGrinderRecipe getRecipeForInput(ItemStack input);
public interface IGrinderRecipeManager
{
/**
* Current list of registered recipes, you can modify this if you want too.
* @return currentlyRegistredRecipes
*/
public List<IAppEngGrinderRecipe> getRecipes ();
/**
* add a new recipe the easy way, in -> out, how many turns.
* @param in
* @param out
* @param cost
*/
public void addRecipe (ItemStack in, ItemStack out, int cost);
/**
* Searches for a recipe for a given input, and returns it.
* @param input
* @return identified recipe, or null
*/
public IAppEngGrinderRecipe getRecipeForInput (ItemStack input);
}
+17 -16
View File
@@ -6,20 +6,21 @@ import net.minecraft.item.ItemStack;
* Provider for special comparisons.
* when an item is encountered AE Will request if the comparison function handles the item, by trying to request a IItemComparison class.
*/
public interface IItemComparisionProvider {
/**
* should return a new IItemComparison, or return null if it dosn't handle the supplied item.
* @param is
* @return IItemComparison, or null
*/
IItemComparison getComparison( ItemStack is );
/**
* Simple test for support ( AE generally skips this and calls the above function. )
* @param stack
* @return true, if getComparison will return a valid IItemComparison Object.
*/
public boolean canHandle( ItemStack stack);
public interface IItemComparisionProvider
{
/**
* should return a new IItemComparison, or return null if it dosn't handle the supplied item.
* @param is
* @return IItemComparison, or null
*/
IItemComparison getComparison (ItemStack is);
/**
* Simple test for support ( AE generally skips this and calls the above function. )
* @param stack
* @return true, if getComparison will return a valid IItemComparison Object.
*/
public boolean canHandle (ItemStack stack);
}
+5 -5
View File
@@ -1,10 +1,10 @@
package appeng.api;
public interface IItemComparison
{
public interface IItemComparison {
public boolean sameAsPrecise( IItemComparison comp);
public boolean sameAsPrecise (IItemComparison comp);
public boolean sameAsFuzzy (IItemComparison comp);
public boolean sameAsFuzzy(IItemComparison comp);
}
+20 -14
View File
@@ -15,18 +15,24 @@ import net.minecraft.item.ItemStack;
*/
public interface IItemList extends Iterable<IAEItemStack>
{
public void addStorage( IAEItemStack option ); // adds a stack as stored.
public void addCrafting( IAEItemStack option ); // adds a stack as craftable.
public void addRequestable( IAEItemStack option ); // adds a stack as requestable.
public void add( IAEItemStack option ); // adds stack as is.
IAEItemStack getFirstItem();
public List<ItemStack> getItems();
IAEItemStack findItem(IAEItemStack i);
int size();
@Override
public Iterator<IAEItemStack> iterator();
public void setCurrentPriority(int priority);
public void addStorage (IAEItemStack option); // adds a stack as stored.
public void addCrafting (IAEItemStack option); // adds a stack as craftable.
public void addRequestable (IAEItemStack option); // adds a stack as requestable.
public void add (IAEItemStack option); // adds stack as is.
IAEItemStack getFirstItem ();
public List<ItemStack> getItems ();
IAEItemStack findItem (IAEItemStack i);
int size ();
@Override
public Iterator<IAEItemStack> iterator ();
public void setCurrentPriority (int priority);
}
+8 -7
View File
@@ -3,13 +3,14 @@ package appeng.api;
/**
* A Registry for locatable items, works based on serial numbers.
*/
public interface ILocateableRegistry {
public interface ILocateableRegistry
{
/**
* Attempts to find the object with the serial specifed, if it can it returns the object.
* @param ser
* @return requestedObject, or null
*/
public abstract Object findLocateableBySerial(long ser);
/**
* Attempts to find the object with the serial specifed, if it can it returns the object.
* @param ser
* @return requestedObject, or null
*/
public abstract Object findLocateableBySerial (long ser);
}
+16 -15
View File
@@ -6,19 +6,20 @@ import net.minecraft.item.ItemStack;
* A Registry of any special comparison handlers for AE To use.
*
*/
public interface ISpecialComparisonRegistry {
/**
* returns a handler it found for a specific item.
* @param stack
* @return TheHandler or null
*/
IItemComparison getSpecialComparion( ItemStack stack );
/**
* Register a new cpecial comparison function with AE.
* @param prov
*/
public void addComparisonProvider( IItemComparisionProvider prov );
public interface ISpecialComparisonRegistry
{
/**
* returns a handler it found for a specific item.
* @param stack
* @return TheHandler or null
*/
IItemComparison getSpecialComparion (ItemStack stack);
/**
* Register a new cpecial comparison function with AE.
* @param prov
*/
public void addComparisonProvider (IItemComparisionProvider prov);
}
+40 -39
View File
@@ -7,43 +7,44 @@ import cpw.mods.fml.common.network.Player;
/**
* A handler for a wireless terminal.
*/
public interface IWirelessTermHandler {
/**
* return true, if usePower, hasPower, ect... can be called for the provided item.
* @param is
* @return
*/
boolean canHandle( ItemStack is );
/**
* use an amount of power, in AE units
* @param amount is in AE units ( 5 per MJ ), if you return false, the item should be dead and return false for hasPower
* @param is
* @return
*/
boolean usePower( Player player, float amount, ItemStack is );
/**
* gets the power status of the item.
* @param is
* @return returns true if there is any power left.
*/
boolean hasPower( Player player, ItemStack is );
/**
* Used to get the current key from the item.
* @param player
* @param item
* @return
*/
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 );
public interface IWirelessTermHandler
{
/**
* return true, if usePower, hasPower, ect... can be called for the provided item.
* @param is
* @return
*/
boolean canHandle (ItemStack is);
/**
* use an amount of power, in AE units
* @param amount is in AE units ( 5 per MJ ), if you return false, the item should be dead and return false for hasPower
* @param is
* @return
*/
boolean usePower (Player player, float amount, ItemStack is);
/**
* gets the power status of the item.
* @param is
* @return returns true if there is any power left.
*/
boolean hasPower (Player player, ItemStack is);
/**
* Used to get the current key from the item.
* @param player
* @param item
* @return
*/
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);
}
+27 -26
View File
@@ -8,31 +8,32 @@ import appeng.api.me.util.IMEInventoryHandler;
/**
* Registratio record for a Custom Cell handler.
*/
public interface IWirelessTermRegistery {
/**
* add thsi handler to the list of other wireless handler.
* @param handler
*/
void registerWirelessHandler( IWirelessTermHandler handler );
public interface IWirelessTermRegistery
{
/**
* add thsi handler to the list of other wireless handler.
* @param handler
*/
void registerWirelessHandler (IWirelessTermHandler handler);
/**
* returns true if theres a handler for this item.
* @param is
* @return
*/
boolean isWirelessTerminal (ItemStack is);
/**
* returns a register handler for the item in question, or null if there isn't one.
* @param is
* @return
*/
IWirelessTermHandler getWirelessTerminalHandler (ItemStack is);
/**
* opens the wireless terminal gui, the wireless terminal item, must be in the active slot on the tool bar.
*/
void OpenWirelessTermainlGui (ItemStack item, World w, EntityPlayer player);
/**
* returns true if theres a handler for this item.
* @param is
* @return
*/
boolean isWirelessTerminal( ItemStack is );
/**
* returns a register handler for the item in question, or null if there isn't one.
* @param is
* @return
*/
IWirelessTermHandler getWirelessTerminalHandler( ItemStack is );
/**
* opens the wireless terminal gui, the wireless terminal item, must be in the active slot on the tool bar.
*/
void OpenWirelessTermainlGui( ItemStack item, World w, EntityPlayer player );
}
+20 -20
View File
@@ -8,33 +8,33 @@ import net.minecraft.item.ItemStack;
*/
public class Items
{
public static ItemStack toolQuartzAxe;
public static ItemStack toolQuartzHoe;
public static ItemStack toolQuartzShovel;
public static ItemStack toolQuartzPick;
public static ItemStack toolQuartzSword;
public static ItemStack toolQuartzWrench;
public static ItemStack toolQuartzAxe;
public static ItemStack toolQuartzHoe;
public static ItemStack toolQuartzShovel;
public static ItemStack toolQuartzPick;
public static ItemStack toolQuartzSword;
public static ItemStack toolQuartzWrench;
public static ItemStack toolEntropyAccelerator;
public static ItemStack toolVibrationCatalyst;
public static ItemStack toolMassCannon;
public static ItemStack toolQuartzKnife;
public static ItemStack toolMassCannon;
public static ItemStack toolQuartzKnife;
public static ItemStack itemMemoryCard;
public static ItemStack itemMemoryCard;
public static ItemStack itemCell1k;
public static ItemStack itemCell4k;
public static ItemStack itemCell16k;
public static ItemStack itemCell64k;
public static ItemStack itemCell64k;
public static ItemStack itemSpatialCell2;
public static ItemStack itemSpatialCell16;
public static ItemStack itemSpatialCell128;
public static ItemStack itemSpatialCell2;
public static ItemStack itemSpatialCell16;
public static ItemStack itemSpatialCell128;
public static ItemStack itemEncodedAsemblerPattern;
public static ItemStack toolWirelessTerminal;
@Deprecated
public static ItemStack toolWirelessTerminal;
@Deprecated
public static ItemStack itemWirelessTerminal;
}
+23 -23
View File
@@ -10,26 +10,26 @@ import net.minecraft.item.ItemStack;
*/
public class Materials
{
// Tech 1
// Tech 1
public static ItemStack matWoodenGear;
public static ItemStack matIronNugget;
public static ItemStack matIronNugget;
public static ItemStack matCrank;
// Grinder...
public static ItemStack matQuartzDustNether;
public static ItemStack matQuartzDustNether;
public static ItemStack matQuartzDust;
public static ItemStack matIronDust;
public static ItemStack matGoldDust;
public static ItemStack matFlour;
// Tech 3
public static ItemStack matSilicon;
public static ItemStack matProcessorBasicUncooked;
public static ItemStack matProcessorAdvancedUncooked;
public static ItemStack matProcessorBasic;
public static ItemStack matProcessorAdvanced;
// ME Construction...
public static ItemStack matProcessorBasicUncooked;
public static ItemStack matProcessorAdvancedUncooked;
public static ItemStack matProcessorBasic;
public static ItemStack matProcessorAdvanced;
// ME Construction...
public static ItemStack matConversionMatrix;
public static ItemStack matStorageCell;
public static ItemStack matStorageBlock;
@@ -38,25 +38,25 @@ public class Materials
public static ItemStack matStorageCellHouseing;
public static ItemStack matStorageCellHouseingFuzzy;
public static ItemStack matBlankPattern;
public static ItemStack matStorageSegment;
public static ItemStack matStorageSegment;
public static ItemStack matFluxDust;
public static ItemStack matFluxCrystal;
public static ItemStack matFluxPearl;
public static ItemStack matFluxPearl;
public static ItemStack matSpatialStorageCell;
public static ItemStack matSpatialStorageBlock;
public static ItemStack matSpatialStorageCluster;
public static ItemStack matSpatialStorageCell;
public static ItemStack matSpatialStorageBlock;
public static ItemStack matSpatialStorageCluster;
// World gen...
public static ItemStack matQuartz;
// Other items, such as upgrades.
public static ItemStack matWirelessBooster;
public static ItemStack matMatterBall;
public static ItemStack matSingularity;
public static ItemStack matEnderPearlDust;
public static ItemStack matQuantumEntangledSingularity;
public static ItemStack matMatterBall;
public static ItemStack matSingularity;
public static ItemStack matEnderPearlDust;
public static ItemStack matQuantumEntangledSingularity;
// TEST ITEMS!
public static ItemStack testItem;
public static ItemStack testItem;
}
+61 -57
View File
@@ -8,62 +8,66 @@ import appeng.api.events.GridTileUnloadEvent;
import appeng.api.exceptions.AppEngTileMissingException;
import appeng.api.me.tiles.IGridTileEntity;
public class TileRef<T> extends WorldCoord {
//private int dimension;
private World w;
private Class myType;
boolean wasGrid;
public TileRef( TileEntity gte ) {
super( gte.xCoord, gte.yCoord, gte.zCoord );
TileEntity te = gte;
myType = gte.getClass();
wasGrid = te instanceof IGridTileEntity;
w = te.worldObj;
if ( te.worldObj == null )
throw new RuntimeException("Tile has no world.");
}
@SuppressWarnings("unchecked")
public T getTile() throws AppEngTileMissingException
{
// there might be a possible tick where we have TileRefs for unloaded tiles?
if ( w.getChunkProvider().chunkExists(x >> 4, z >> 4) )
{
TileEntity te = w.getBlockTileEntity( x, y, z );
if ( te != null && myType.isInstance( te ) )
return (T)te;
}
/**
* was this a grid tile? if so inform the grid enum that something has derped.
*/
if ( wasGrid )
{
wasGrid = false; // no need to keep this up..
MinecraftForge.EVENT_BUS.post( new GridTileUnloadEvent( null, w, this ) );
}
throw new AppEngTileMissingException( w, x,y,z);
}
public class TileRef<T> extends WorldCoord
{
//private int dimension;
private World w;
private Class myType;
boolean wasGrid;
public TileRef(TileEntity gte)
{
super(gte.xCoord, gte.yCoord, gte.zCoord);
TileEntity te = gte;
myType = gte.getClass();
wasGrid = te instanceof IGridTileEntity;
w = te.worldObj;
if (te.worldObj == null)
throw new RuntimeException("Tile has no world.");
}
@SuppressWarnings("unchecked")
public T getTile () throws AppEngTileMissingException
{
// there might be a possible tick where we have TileRefs for unloaded tiles?
if (w.getChunkProvider().chunkExists(x >> 4, z >> 4))
{
TileEntity te = w.getBlockTileEntity(x, y, z);
if (te != null && myType.isInstance(te))
return (T) te;
}
/**
* was this a grid tile? if so inform the grid enum that something has derped.
*/
if (wasGrid)
{
wasGrid = false; // no need to keep this up..
MinecraftForge.EVENT_BUS.post(new GridTileUnloadEvent(null, w, this));
}
throw new AppEngTileMissingException(w, x, y, z);
}
public DimentionalCoord getCoord ()
{
return new DimentionalCoord(w, x, y, z);
}
@Override
public boolean equals (Object obj)
{
// is it the same?
if (obj instanceof TileEntity)
{
TileEntity te = (TileEntity) obj;
return w == te.worldObj && te.xCoord == x && te.yCoord == y && te.zCoord == z;
}
return super.equals(obj);
}
public DimentionalCoord getCoord() {
return new DimentionalCoord( w, x, y, z );
}
@Override
public boolean equals(Object obj) {
// is it the same?
if ( obj instanceof TileEntity )
{
TileEntity te = (TileEntity) obj;
return w == te.worldObj && te.xCoord == x && te.yCoord == y && te.zCoord == z;
}
return super.equals( obj );
}
};
+114 -92
View File
@@ -22,210 +22,232 @@ import appeng.api.me.util.IMEInventoryUtil;
*/
public class Util
{
static private IAppEngApi api = null;
/**
* All future API calls should be made via this method.
* @return
*/
public static IAppEngApi getAppEngApi()
{
try {
Class c = ReflectionHelper.getClass( Util.class.getClassLoader(), "appeng.common.AppEngApi" );
api = (IAppEngApi) c.getMethod( "getInstance" ).invoke( c );
} catch ( Throwable e) {
return null;
}
return api;
}
static private IAppEngApi api = null;
/**
* All future API calls should be made via this method.
* @return
*/
public static IAppEngApi getAppEngApi ()
{
try
{
Class c = ReflectionHelper.getClass(Util.class.getClassLoader(), "appeng.common.AppEngApi");
api = (IAppEngApi) c.getMethod("getInstance").invoke(c);
}
catch (Throwable e)
{
return null;
}
return api;
}
/**
* returns the wireless terminal registry.
* @return
*/
public static IWirelessTermRegistery getWirelessTermRegistery()
public static IWirelessTermRegistery getWirelessTermRegistery ()
{
if ( api == null ) return null;
return api.getWirelessRegistry();
if (api == null)
return null;
return api.getWirelessRegistry();
}
/**
* Find an object by its serial.
* @param ser
* @return LocatedObject or null
*/
public static Object getLocateableBySerial( long ser )
public static Object getLocateableBySerial (long ser)
{
if ( api == null ) return null;
return api.getLocateableBySerial( ser );
if (api == null)
return null;
return api.getLocateableBySerial(ser);
}
/**
* Creates a new AEItemstack.
* @param is
* @return newly generated AE Itemstack
*/
public static IAEItemStack createItemStack( ItemStack is )
public static IAEItemStack createItemStack (ItemStack is)
{
if ( api == null ) return null;
return api.createItemStack( is );
if (api == null)
return null;
return api.createItemStack(is);
}
/**
* Simple Wrapper of the insertion process..
* @param inv
* @param is
* @return ItemsNotInserted or null
*/
public static ItemStack addItemsToInv( IMEInventory inv, ItemStack is )
public static ItemStack addItemsToInv (IMEInventory inv, ItemStack is)
{
if ( api == null ) return null;
return api.addItemsToInv( inv, is );
if (api == null)
return null;
return api.addItemsToInv(inv, is);
}
/**
* Simple Wrapper of the extraction process
* @param inv
* @param is
* @return ItemsExtracted or null
*/
public static ItemStack extractItemsFromInv( IMEInventory inv, ItemStack is )
public static ItemStack extractItemsFromInv (IMEInventory inv, ItemStack is)
{
if ( api == null ) return null;
return api.extractItems( inv, is );
if (api == null)
return null;
return api.extractItems(inv, is);
}
/**
* Create a new Blank ItemList
* @return new itemlist.
*/
public static IItemList createItemList()
public static IItemList createItemList ()
{
if ( api == null ) return null;
return api.createItemList();
if (api == null)
return null;
return api.createItemList();
}
/**
* creates a new IMEInventoryUtil, only useful if you want to use the fancy get items by recipe functionaility.
* @param ime
* @return created InvUtil
*/
public static IMEInventoryUtil getIMEInventoryUtil( IMEInventory ime )
public static IMEInventoryUtil getIMEInventoryUtil (IMEInventory ime)
{
if ( api == null ) return null;
return api.getIMEInventoryUtil( ime );
if (api == null)
return null;
return api.getIMEInventoryUtil(ime);
}
/**
* Gets the instance of the special comparison registry ( Bees / Trees ) that sort of stuff
* @return specialComparisonRegistry
*/
public static ISpecialComparisonRegistry getSpecialComparisonRegistry()
public static ISpecialComparisonRegistry getSpecialComparisonRegistry ()
{
if ( api == null ) return null;
return api.getSpecialComparsonRegistry();
if (api == null)
return null;
return api.getSpecialComparsonRegistry();
}
/**
* Gets the instance of the external storage registry - Storage Bus
* @return externStorgeRegitry
*/
public static IExternalStorageRegistry getExternalStorageRegistry()
public static IExternalStorageRegistry getExternalStorageRegistry ()
{
if ( api == null ) return null;
return api.getExternalStorageRegistry();
if (api == null)
return null;
return api.getExternalStorageRegistry();
}
/**
* Gets the instance of the Cell Registry
* @return returns the cell registry
*/
public static ICellRegistry getCellRegistry()
public static ICellRegistry getCellRegistry ()
{
if ( api == null ) return null;
return api.getCellRegistry();
if (api == null)
return null;
return api.getCellRegistry();
}
/**
* Gets instance for the grinder recipe manager.
* @return the grinder manager instance.
*/
public static IGrinderRecipeManager getGrinderRecipeManage()
public static IGrinderRecipeManager getGrinderRecipeManage ()
{
if ( api == null ) return null;
return api.getGrinderRecipeManage();
if (api == null)
return null;
return api.getGrinderRecipeManage();
}
/** Is it a Blank Pattern? */
public static Boolean isBlankPattern(ItemStack i)
public static Boolean isBlankPattern (ItemStack i)
{
if ( api == null ) return null;
return api.isBlankPattern( i );
if (api == null)
return null;
return api.isBlankPattern(i);
}
/** Is it an IAssemblerPattern? */
public static Boolean isAssemblerPattern(ItemStack i)
public static Boolean isAssemblerPattern (ItemStack i)
{
if ( api == null ) return null;
return api.isAssemblerPattern( i );
if (api == null)
return null;
return api.isAssemblerPattern(i);
}
/** Gets the IAssemblerPattern of the Assembly Pattern. */
public static ICraftingPatternMAC getAssemblerPattern(ItemStack i)
public static ICraftingPatternMAC getAssemblerPattern (ItemStack i)
{
if ( api == null ) return null;
return api.getAssemblerPattern( i );
if (api == null)
return null;
return api.getAssemblerPattern(i);
}
/** Is it a IStorageCell, this will only return true for IStoreCells and not custom cells, you should probobly not use it unless you have a specific case. */
public static Boolean isBasicCell(ItemStack i)
public static Boolean isBasicCell (ItemStack i)
{
if ( api == null ) return null;
return api.isBasicCell( i );
if (api == null)
return null;
return api.isBasicCell(i);
}
/**
* if the item is a ME Compatible Storage Cell of any type.
* @param i
* @return true, if it is a storage call.
*/
public static Boolean isCell(ItemStack i)
public static Boolean isCell (ItemStack i)
{
if ( api == null ) return null;
return getCellRegistry().isCellHandled( i );
if (api == null)
return null;
return getCellRegistry().isCellHandled(i);
}
/**
* Gets the Interface to insert/extract from the Storage Cell for the item.
* @param i
* @return newly procured cell handler.
*/
public static IMEInventoryHandler getCell(ItemStack i)
public static IMEInventoryHandler getCell (ItemStack i)
{
if ( api == null ) return null;
return getCellRegistry().getHandlerForCell( i );
if (api == null)
return null;
return getCellRegistry().getHandlerForCell(i);
}
/**
* Lets you access internal storage of IStorageCell's
* @param i
* @return only works with Basic Cells, not custom ones, suggested not to use.
*/
public static IMEInventory getBasicCell(ItemStack i)
public static IMEInventory getBasicCell (ItemStack i)
{
if ( api == null ) return null;
return api.getBasicCell( i );
if (api == null)
return null;
return api.getBasicCell(i);
}
/**
* Lets you blast list a specific item from being stored in basic cells, this works on any mod cells that use IStorageCell as well.
* @param ItemID
* @param Meta
*/
public static void addBasicBlackList( int ItemID, int Meta )
public static void addBasicBlackList (int ItemID, int Meta)
{
if ( api == null ) return;
api.addBasicBlackList( ItemID, Meta );
if (api == null)
return;
api.addBasicBlackList(ItemID, Meta);
}
}
+68 -68
View File
@@ -10,8 +10,8 @@ public class WorldCoord
public int x;
public int y;
public int z;
public WorldCoord add(ForgeDirection direction, int length)
public WorldCoord add (ForgeDirection direction, int length)
{
x += direction.offsetX * length;
y += direction.offsetY * length;
@@ -19,114 +19,114 @@ public class WorldCoord
return this;
}
public WorldCoord subtract(ForgeDirection direction, int length)
public WorldCoord subtract (ForgeDirection direction, int length)
{
x -= direction.offsetX * length;
y -= direction.offsetY * length;
z -= direction.offsetZ * length;
return this;
}
public WorldCoord add(int _x, int _y, int _z)
public WorldCoord add (int _x, int _y, int _z)
{
x += _x;
y += _y;
z += _z;
return this;
}
public WorldCoord subtract(int _x, int _y, int _z)
public WorldCoord subtract (int _x, int _y, int _z)
{
x -= _x;
y -= _y;
z -= _z;
return this;
}
public WorldCoord multiple(int _x, int _y, int _z)
public WorldCoord multiple (int _x, int _y, int _z)
{
x *= _x;
y *= _y;
z *= _z;
return this;
}
public WorldCoord divide(int _x, int _y, int _z)
public WorldCoord divide (int _x, int _y, int _z)
{
x /= _x;
y /= _y;
z /= _z;
return this;
}
public WorldCoord(int _x, int _y, int _z)
{
x = _x;
y = _y;
z = _z;
}
/**
* Will Return NULL if it's at some diagonal!
*/
public ForgeDirection DirectionTo(WorldCoord loc)
{
int ox = x - loc.x;
int oy = y - loc.y;
int oz = z - loc.z;
int xlen = Math.abs( ox );
int ylen = Math.abs( oy );
int zlen = Math.abs( oz );
if ( loc.isEqual( this.copy().add( ForgeDirection.EAST, xlen ) ) )
return ForgeDirection.EAST;
if ( loc.isEqual( this.copy().add( ForgeDirection.WEST, xlen ) ) )
return ForgeDirection.WEST;
if ( loc.isEqual( this.copy().add( ForgeDirection.NORTH, zlen ) ) )
return ForgeDirection.NORTH;
if ( loc.isEqual( this.copy().add( ForgeDirection.SOUTH, zlen ) ) )
return ForgeDirection.SOUTH;
if ( loc.isEqual( this.copy().add( ForgeDirection.UP, ylen ) ) )
return ForgeDirection.UP;
if ( loc.isEqual( this.copy().add( ForgeDirection.DOWN, ylen ) ) )
return ForgeDirection.DOWN;
return null;
}
public boolean isEqual( WorldCoord c )
{
return x == c.x && y == c.y && z == c.z;
}
public WorldCoord copy()
{
return new WorldCoord( x, y, z );
}
@Override
public boolean equals(Object obj)
{
if ( obj instanceof WorldCoord )
return isEqual( (WorldCoord)obj );
return false;
}
public ForgeDirection DirectionTo (WorldCoord loc)
{
int ox = x - loc.x;
int oy = y - loc.y;
int oz = z - loc.z;
int xlen = Math.abs(ox);
int ylen = Math.abs(oy);
int zlen = Math.abs(oz);
if (loc.isEqual(this.copy().add(ForgeDirection.EAST, xlen)))
return ForgeDirection.EAST;
if (loc.isEqual(this.copy().add(ForgeDirection.WEST, xlen)))
return ForgeDirection.WEST;
if (loc.isEqual(this.copy().add(ForgeDirection.NORTH, zlen)))
return ForgeDirection.NORTH;
if (loc.isEqual(this.copy().add(ForgeDirection.SOUTH, zlen)))
return ForgeDirection.SOUTH;
if (loc.isEqual(this.copy().add(ForgeDirection.UP, ylen)))
return ForgeDirection.UP;
if (loc.isEqual(this.copy().add(ForgeDirection.DOWN, ylen)))
return ForgeDirection.DOWN;
return null;
}
public boolean isEqual (WorldCoord c)
{
return x == c.x && y == c.y && z == c.z;
}
public WorldCoord copy ()
{
return new WorldCoord(x, y, z);
}
@Override
public String toString()
public boolean equals (Object obj)
{
if (obj instanceof WorldCoord)
return isEqual((WorldCoord) obj);
return false;
}
@Override
public String toString ()
{
return "" + x + "," + y + "," + z;
}
@Override
public int hashCode()
{
return (y << 24) ^ x ^ z;
}
@Override
public int hashCode ()
{
return (y << 24) ^ x ^ z;
}
}
+13 -12
View File
@@ -1,17 +1,18 @@
package appeng.api.config;
public enum ActionItems implements IConfigEnum<ActionItems>
{
Wrench, Close;
public enum ActionItems implements IConfigEnum<ActionItems> {
Wrench,
Close;
@Override
public IConfigEnum[] getValues ()
{
return values();
}
@Override
public IConfigEnum[] getValues() {
return values();
}
@Override
public String getName() {
return "FuzzyMode";
}
@Override
public String getName ()
{
return "FuzzyMode";
}
}
+14 -14
View File
@@ -1,19 +1,19 @@
package appeng.api.config;
public enum CondenserOuput implements IConfigEnum
{
Trash, MatterBalls, Singularity;
public enum CondenserOuput implements IConfigEnum {
Trash,
MatterBalls,
Singularity;
@Override
public IConfigEnum[] getValues() {
return values();
}
@Override
public IConfigEnum[] getValues ()
{
return values();
}
@Override
public String getName ()
{
return "CondenserOutput";
}
@Override
public String getName() {
return "CondenserOutput";
}
}
+14 -13
View File
@@ -1,18 +1,19 @@
package appeng.api.config;
public enum EnableDisable implements IConfigEnum
{
Enabled, Disabled;
public enum EnableDisable implements IConfigEnum {
Enabled,
Disabled;
@Override
public IConfigEnum[] getValues() {
return values();
}
@Override
public IConfigEnum[] getValues ()
{
return values();
}
@Override
public String getName ()
{
return "CondenserOutput";
}
@Override
public String getName() {
return "CondenserOutput";
}
}
+15 -15
View File
@@ -1,19 +1,19 @@
package appeng.api.config;
// do not change names..
public enum FullnessMode implements IConfigEnum {
Empty,
Half,
Full;
@Override
public IConfigEnum[] getValues() {
return values();
}
@Override
public String getName() {
return "FullnessMode";
}
public enum FullnessMode implements IConfigEnum
{
Empty, Half, Full;
@Override
public IConfigEnum[] getValues ()
{
return values();
}
@Override
public String getName ()
{
return "FullnessMode";
}
}
+19 -21
View File
@@ -1,27 +1,25 @@
package appeng.api.config;
public enum FuzzyMode implements IConfigEnum<FuzzyMode>
{
IgnoreAll(-1.0F), Percent_99(1.0F), Percent_75(0.75F), Percent_50(0.5F), Percent_25(0.25F);
public enum FuzzyMode implements IConfigEnum<FuzzyMode> {
IgnoreAll(-1.0F),
Percent_99(1.0F),
Percent_75(0.75F),
Percent_50(0.5F),
Percent_25(0.25F);
public float breakPoint;
private FuzzyMode( float p )
{
breakPoint = p;
}
public float breakPoint;
@Override
public IConfigEnum[] getValues() {
return values();
}
private FuzzyMode(float p)
{
breakPoint = p;
}
@Override
public String getName() {
return "FuzzyMode";
}
@Override
public IConfigEnum[] getValues ()
{
return values();
}
@Override
public String getName ()
{
return "FuzzyMode";
}
}
+8 -7
View File
@@ -1,11 +1,12 @@
package appeng.api.config;
public interface IConfigEnum <E> {
IConfigEnum[] getValues();
int ordinal();
public interface IConfigEnum<E>
{
IConfigEnum[] getValues ();
int ordinal ();
String getName ();
String getName();
}
@@ -1,17 +1,19 @@
package appeng.api.config;
public enum InterfaceBlockingMode implements IConfigEnum {
NonBlocking,
Blocking;
@Override
public IConfigEnum[] getValues() {
return values();
}
public enum InterfaceBlockingMode implements IConfigEnum
{
NonBlocking, Blocking;
@Override
public IConfigEnum[] getValues ()
{
return values();
}
@Override
public String getName ()
{
return "InterfaceBlockingMode";
}
@Override
public String getName() {
return "InterfaceBlockingMode";
}
}
@@ -1,17 +1,19 @@
package appeng.api.config;
public enum InterfaceCraftingMode implements IConfigEnum {
Craft,
DontCraft;
@Override
public IConfigEnum[] getValues() {
return values();
}
public enum InterfaceCraftingMode implements IConfigEnum
{
Craft, DontCraft;
@Override
public IConfigEnum[] getValues ()
{
return values();
}
@Override
public String getName ()
{
return "InterfaceCraftingMode";
}
@Override
public String getName() {
return "InterfaceCraftingMode";
}
}
+15 -13
View File
@@ -1,18 +1,20 @@
package appeng.api.config;
public enum ItemFlow implements IConfigEnum<ItemFlow>
{
public enum ItemFlow implements IConfigEnum<ItemFlow> {
READ, WRITE, READ_WRITE;
@Override
public IConfigEnum[] getValues() {
return values();
}
READ, WRITE, READ_WRITE;
@Override
public IConfigEnum[] getValues ()
{
return values();
}
@Override
public String getName ()
{
return "ItemFlow";
}
@Override
public String getName() {
return "ItemFlow";
}
}
+15 -13
View File
@@ -1,18 +1,20 @@
package appeng.api.config;
public enum ListMode implements IConfigEnum<ListMode>
{
public enum ListMode implements IConfigEnum<ListMode> {
WHITELIST, BLACKLIST;
@Override
public IConfigEnum[] getValues() {
return values();
}
WHITELIST, BLACKLIST;
@Override
public IConfigEnum[] getValues ()
{
return values();
}
@Override
public String getName ()
{
return "ListMode";
}
@Override
public String getName() {
return "ListMode";
}
}
+13 -12
View File
@@ -1,17 +1,18 @@
package appeng.api.config;
public enum MatchingMode implements IConfigEnum<MatchingMode>
{
Fuzzy, Precision;
public enum MatchingMode implements IConfigEnum<MatchingMode> {
Fuzzy,
Precision;
@Override
public IConfigEnum[] getValues() {
return MatchingMode.values();
}
@Override
public IConfigEnum[] getValues ()
{
return MatchingMode.values();
}
@Override
public String getName() {
return "MatchingMode";
}
@Override
public String getName ()
{
return "MatchingMode";
}
}
+15 -14
View File
@@ -1,18 +1,19 @@
package appeng.api.config;
// do not change names..
public enum OperationMode implements IConfigEnum {
Fill,
Empty;
@Override
public IConfigEnum[] getValues() {
return values();
}
@Override
public String getName() {
return "OperationMode";
}
public enum OperationMode implements IConfigEnum
{
Fill, Empty;
@Override
public IConfigEnum[] getValues ()
{
return values();
}
@Override
public String getName ()
{
return "OperationMode";
}
}
+13 -15
View File
@@ -1,20 +1,18 @@
package appeng.api.config;
public enum PowerUnits implements IConfigEnum<PowerUnits>
{
AE, MJ, EU, UE, WA;
public enum PowerUnits implements IConfigEnum<PowerUnits> {
AE,
MJ,
EU,
UE,
WA;
@Override
public IConfigEnum[] getValues ()
{
return values();
}
@Override
public IConfigEnum[] getValues() {
return values();
}
@Override
public String getName() {
return "PowerUnits";
}
@Override
public String getName ()
{
return "PowerUnits";
}
}
+14 -15
View File
@@ -1,20 +1,19 @@
package appeng.api.config;
// do not change names..
public enum RedstoneModeInput implements IConfigEnum {
Ignore,
WhenOff,
WhenOn,
OnPulse;
@Override
public IConfigEnum[] getValues() {
return values();
}
public enum RedstoneModeInput implements IConfigEnum
{
Ignore, WhenOff, WhenOn, OnPulse;
@Override
public String getName() {
return "RedstoneMode";
}
@Override
public IConfigEnum[] getValues ()
{
return values();
}
@Override
public String getName ()
{
return "RedstoneMode";
}
}
@@ -1,19 +1,19 @@
package appeng.api.config;
// do not change names..
public enum RedstoneModeInputOnOff implements IConfigEnum {
Ignore,
WhenOff,
WhenOn;
@Override
public IConfigEnum[] getValues() {
return values();
}
public enum RedstoneModeInputOnOff implements IConfigEnum
{
Ignore, WhenOff, WhenOn;
@Override
public String getName() {
return "RedstoneMode";
}
@Override
public IConfigEnum[] getValues ()
{
return values();
}
@Override
public String getName ()
{
return "RedstoneMode";
}
}
+14 -13
View File
@@ -1,18 +1,19 @@
package appeng.api.config;
// do not change names..
public enum RedstoneModeOutput implements IConfigEnum {
WhenOff,
WhenOn;
@Override
public IConfigEnum[] getValues() {
return values();
}
public enum RedstoneModeOutput implements IConfigEnum
{
WhenOff, WhenOn;
@Override
public String getName() {
return "RedstoneMode";
}
@Override
public IConfigEnum[] getValues ()
{
return values();
}
@Override
public String getName ()
{
return "RedstoneMode";
}
}
+15 -15
View File
@@ -2,21 +2,21 @@ package appeng.api.config;
import net.minecraft.src.ModLoader;
public enum SearchBoxMode implements IConfigEnum<ActionItems> {
Autosearch,
Standard,
NEIAutoSearch,
NEIStandard;
public enum SearchBoxMode implements IConfigEnum<ActionItems>
{
Autosearch, Standard, NEIAutoSearch, NEIStandard;
@Override
public IConfigEnum[] getValues() {
if ( ModLoader.isModLoaded( "NotEnoughItems" ) )
return values();
return new SearchBoxMode[]{ Autosearch, Standard };
}
@Override
public IConfigEnum[] getValues ()
{
if (ModLoader.isModLoaded("NotEnoughItems"))
return values();
return new SearchBoxMode[] { Autosearch, Standard };
}
@Override
public String getName() {
return "SearchBoxMode";
}
@Override
public String getName ()
{
return "SearchBoxMode";
}
}
+12 -12
View File
@@ -1,18 +1,18 @@
package appeng.api.config;
public enum SortDir implements IConfigEnum
{
ASC,
DESC;
@Override
public IConfigEnum[] getValues() {
return values();
}
ASC, DESC;
@Override
public String getName() {
return "SortDir";
}
@Override
public IConfigEnum[] getValues ()
{
return values();
}
@Override
public String getName ()
{
return "SortDir";
}
}
+12 -14
View File
@@ -1,20 +1,18 @@
package appeng.api.config;
public enum SortOrder implements IConfigEnum
{
Name,
Size,
Priority,
ItemID;
@Override
public IConfigEnum[] getValues() {
return values();
}
Name, Size, Priority, ItemID;
@Override
public String getName() {
return "SortOrder";
}
@Override
public IConfigEnum[] getValues ()
{
return values();
}
@Override
public String getName ()
{
return "SortOrder";
}
}
+14 -13
View File
@@ -1,18 +1,19 @@
package appeng.api.config;
// do not change names..
public enum StackModeInput implements IConfigEnum {
Single,
Stack;
@Override
public IConfigEnum[] getValues() {
return values();
}
public enum StackModeInput implements IConfigEnum
{
Single, Stack;
@Override
public String getName() {
return "StackMode";
}
@Override
public IConfigEnum[] getValues ()
{
return values();
}
@Override
public String getName ()
{
return "StackMode";
}
}
+14 -15
View File
@@ -1,20 +1,19 @@
package appeng.api.config;
// do not change names..
public enum StackModeOutput implements IConfigEnum {
Single,
Stack,
Craft,
CraftOnly;
@Override
public IConfigEnum[] getValues() {
return values();
}
public enum StackModeOutput implements IConfigEnum
{
Single, Stack, Craft, CraftOnly;
@Override
public String getName() {
return "StackMode";
}
@Override
public IConfigEnum[] getValues ()
{
return values();
}
@Override
public String getName ()
{
return "StackMode";
}
}
+12 -12
View File
@@ -1,18 +1,18 @@
package appeng.api.config;
public enum TransferDir implements IConfigEnum
{
LEFT,
RIGHT;
@Override
public IConfigEnum[] getValues() {
return values();
}
LEFT, RIGHT;
@Override
public String getName() {
return "TransferDir";
}
@Override
public IConfigEnum[] getValues ()
{
return values();
}
@Override
public String getName ()
{
return "TransferDir";
}
}
+12 -13
View File
@@ -1,19 +1,18 @@
package appeng.api.config;
public enum ViewItems implements IConfigEnum
{
ALL,
STORED,
CRAFTABLE;
@Override
public IConfigEnum[] getValues() {
return values();
}
ALL, STORED, CRAFTABLE;
@Override
public String getName() {
return "ViewItems";
}
@Override
public IConfigEnum[] getValues ()
{
return values();
}
@Override
public String getName ()
{
return "ViewItems";
}
}
+6 -6
View File
@@ -8,10 +8,10 @@ import net.minecraftforge.event.Event;
*/
public class AEWorldEvent extends Event
{
final public World world;
public AEWorldEvent( World w )
{
world = w;
}
final public World world;
public AEWorldEvent(World w)
{
world = w;
}
}
+11 -8
View File
@@ -7,12 +7,15 @@ import appeng.api.WorldCoord;
/**
* an error, basically just causes an update, use it if there is really an error, other wise just ignore it.
*/
public class GridErrorEvent extends AEWorldEvent {
public WorldCoord coord;
public GridErrorEvent(World world, WorldCoord wc ) {
super(world);
coord = wc;
}
public class GridErrorEvent extends AEWorldEvent
{
public WorldCoord coord;
public GridErrorEvent(World world, WorldCoord wc)
{
super(world);
coord = wc;
}
}
@@ -8,15 +8,17 @@ import appeng.api.me.util.IGridInterface;
/**
* Posted when crafting options in a AE Network update, you can watch for them if you want to.
*/
public class GridPatternUpdateEvent extends AEWorldEvent {
final public WorldCoord coord;
final public IGridInterface grid;
public GridPatternUpdateEvent(World world, WorldCoord wc, IGridInterface gi ) {
super(world);
grid = gi;
coord = wc;
}
public class GridPatternUpdateEvent extends AEWorldEvent
{
final public WorldCoord coord;
final public IGridInterface grid;
public GridPatternUpdateEvent(World world, WorldCoord wc, IGridInterface gi)
{
super(world);
grid = gi;
coord = wc;
}
}
@@ -8,15 +8,17 @@ import appeng.api.me.util.IGridInterface;
/**
* Posted when storage options in a AE Network update, such as a new Storage Bus or Cell is added, or removed.
*/
public class GridStorageUpdateEvent extends AEWorldEvent {
final public WorldCoord coord;
final public IGridInterface grid;
public GridStorageUpdateEvent(World world, WorldCoord wc, IGridInterface gi ) {
super(world);
grid = gi;
coord = wc;
}
public class GridStorageUpdateEvent extends AEWorldEvent
{
final public WorldCoord coord;
final public IGridInterface grid;
public GridStorageUpdateEvent(World world, WorldCoord wc, IGridInterface gi)
{
super(world);
grid = gi;
coord = wc;
}
}
@@ -8,15 +8,17 @@ import appeng.api.me.tiles.IGridTileEntity;
/**
* The network has changed, and must be updated.
*/
public class GridTileConnectivityEvent extends AEWorldEvent {
public WorldCoord coord;
public IGridTileEntity te;
public GridTileConnectivityEvent( IGridTileEntity _te, World world, WorldCoord wc ) {
super(world);
te = _te;
coord = wc;
}
public class GridTileConnectivityEvent extends AEWorldEvent
{
public WorldCoord coord;
public IGridTileEntity te;
public GridTileConnectivityEvent(IGridTileEntity _te, World world, WorldCoord wc)
{
super(world);
te = _te;
coord = wc;
}
}
+13 -11
View File
@@ -8,15 +8,17 @@ import appeng.api.me.tiles.IGridTileEntity;
/**
* A Tile has been added to the world, and should be evaluated for Network Connectivity.
*/
public class GridTileLoadEvent extends AEWorldEvent {
public WorldCoord coord;
public IGridTileEntity te;
public GridTileLoadEvent(IGridTileEntity _te, World world, WorldCoord wc ) {
super(world);
te = _te;
coord = wc;
}
public class GridTileLoadEvent extends AEWorldEvent
{
public WorldCoord coord;
public IGridTileEntity te;
public GridTileLoadEvent(IGridTileEntity _te, World world, WorldCoord wc)
{
super(world);
te = _te;
coord = wc;
}
}
+13 -11
View File
@@ -8,15 +8,17 @@ import appeng.api.me.tiles.IGridTileEntity;
/**
* A Tile has been removed from the world, and should no longer be considered for connectivity.
*/
public class GridTileUnloadEvent extends AEWorldEvent {
public WorldCoord coord;
public IGridTileEntity te;
public GridTileUnloadEvent(IGridTileEntity _te,World world, WorldCoord wc ) {
super(world);
te = _te;
coord = wc;
}
public class GridTileUnloadEvent extends AEWorldEvent
{
public WorldCoord coord;
public IGridTileEntity te;
public GridTileUnloadEvent(IGridTileEntity _te, World world, WorldCoord wc)
{
super(world);
te = _te;
coord = wc;
}
}
@@ -6,20 +6,22 @@ import appeng.api.me.tiles.ILocateable;
/**
* Used to Notify the Location Registry of objects, and their availability.
*/
public class LocateableEventAnnounce extends Event {
public enum LocateableEvent {
Register, // Adds the locateable to the registry
Unregister // Removes the Locatable from the registry
};
final public ILocateable target;
final public LocateableEvent change;
public LocateableEventAnnounce( ILocateable o, LocateableEvent ev )
{
target = o;
change = ev;
}
public class LocateableEventAnnounce extends Event
{
public enum LocateableEvent
{
Register, // Adds the locateable to the registry
Unregister // Removes the Locatable from the registry
};
final public ILocateable target;
final public LocateableEvent change;
public LocateableEventAnnounce(ILocateable o, LocateableEvent ev)
{
target = o;
change = ev;
}
}
@@ -8,15 +8,17 @@ import appeng.api.me.tiles.IGridTileEntity;
/**
* Used by the MAC to trigger updates in its structure.
*/
public class MultiBlockUpdateEvent extends AEWorldEvent {
public WorldCoord coord;
public IGridTileEntity te;
public MultiBlockUpdateEvent( IGridTileEntity _te, World world, WorldCoord wc ) {
super(world);
coord = wc;
te = _te;
}
public class MultiBlockUpdateEvent extends AEWorldEvent
{
public WorldCoord coord;
public IGridTileEntity te;
public MultiBlockUpdateEvent(IGridTileEntity _te, World world, WorldCoord wc)
{
super(world);
coord = wc;
te = _te;
}
}
@@ -2,10 +2,10 @@ package appeng.api.exceptions;
public class AppEngException extends Exception
{
private static final long serialVersionUID = -9051434206368465494L;
public AppEngException(String t)
private static final long serialVersionUID = -9051434206368465494L;
public AppEngException(String t)
{
super(t);
}
@@ -4,27 +4,29 @@ import cpw.mods.fml.common.FMLLog;
import net.minecraft.world.World;
import appeng.api.DimentionalCoord;
public class AppEngTileMissingException extends Exception {
public class AppEngTileMissingException extends Exception
{
private static final long serialVersionUID = -3502227742711078681L;
public DimentionalCoord dc;
@Override
public void printStackTrace ()
{
try
{
FMLLog.info("[AppEng] Missing Tile at " + dc.x + ", " + dc.y + ", " + dc.z + " in +" + dc.getWorld().getWorldInfo().getVanillaDimension());
}
catch (Throwable _)
{
FMLLog.info("[AppEng] Missing Tile at " + dc.x + ", " + dc.y + ", " + dc.z);
}
super.printStackTrace();
}
public AppEngTileMissingException(World w, int x, int y, int z)
{
dc = new DimentionalCoord(w, x, y, z);
}
private static final long serialVersionUID = -3502227742711078681L;
public DimentionalCoord dc;
@Override
public void printStackTrace() {
try
{
FMLLog.info( "[AppEng] Missing Tile at "+dc.x+", "+dc.y+", "+dc.z+" in +"+dc.getWorld().getWorldInfo().getVanillaDimension() );
}
catch( Throwable _ )
{
FMLLog.info( "[AppEng] Missing Tile at "+dc.x+", "+dc.y+", "+dc.z );
}
super.printStackTrace();
}
public AppEngTileMissingException(World w, int x, int y, int z)
{
dc = new DimentionalCoord( w, x, y, z );
}
}
+12 -12
View File
@@ -1,4 +1,3 @@
package appeng.api.me.items;
import net.minecraft.item.Item;
@@ -7,19 +6,20 @@ import net.minecraft.item.ItemStack;
/*
* A simple AE interface used internally for PowerRelay charging.
*/
public interface IAEChargeableItem {
/*
* Return the amount of energy not used.
*
* if you return the same amount out, as was passed in, then it will consider charging done.
*
*/
public float addEnergy( ItemStack target, float energy );
public interface IAEChargeableItem
{
/*
* Return the amount of energy not used.
*
* if you return the same amount out, as was passed in, then it will consider charging done.
*
*/
public float addEnergy (ItemStack target, float energy);
/*
* Must return true for the target item for it to be considered a charageable item.
*/
public boolean isChargeable( ItemStack it );
public boolean isChargeable (ItemStack it);
}
+3 -2
View File
@@ -2,8 +2,9 @@ package appeng.api.me.items;
import net.minecraft.entity.player.EntityPlayer;
public interface IAEWrench {
public interface IAEWrench
{
boolean canWrench(EntityPlayer player, int x, int y, int z);
boolean canWrench (EntityPlayer player, int x, int y, int z);
}
+33 -32
View File
@@ -6,36 +6,37 @@ import net.minecraft.nbt.NBTTagCompound;
/**
* used to interact with memory card items.
*/
public interface IMemoryCard {
/**
* returns true if the item is in fact a memory card.
* @param is
* @return
*/
boolean isMemoryCard( ItemStack is );
/**
* Configures the data stored on the memory card, the SettingsName, will be localized when displayed.
* @param is
* @param SettingsName
* @param data
* - tooltip - is a unlocalized string displayed after the settings name.
*/
void setMemoryCardContents( ItemStack is, String SettingsName, NBTTagCompound data );
/**
* returns the settings name provided previously by setMemoryCardContents, or "AppEng.GuiITooltip.Blank" if there is no settings.
* @param is
* @return
*/
String getSettingsName( ItemStack is );
/**
* returns the NBT Data previously saved by setMemoryCardContents, or an empty NBTCompound
* @param is
* @return
*/
NBTTagCompound getData( ItemStack is );
public interface IMemoryCard
{
/**
* returns true if the item is in fact a memory card.
* @param is
* @return
*/
boolean isMemoryCard (ItemStack is);
/**
* Configures the data stored on the memory card, the SettingsName, will be localized when displayed.
* @param is
* @param SettingsName
* @param data
* - tooltip - is a unlocalized string displayed after the settings name.
*/
void setMemoryCardContents (ItemStack is, String SettingsName, NBTTagCompound data);
/**
* returns the settings name provided previously by setMemoryCardContents, or "AppEng.GuiITooltip.Blank" if there is no settings.
* @param is
* @return
*/
String getSettingsName (ItemStack is);
/**
* returns the NBT Data previously saved by setMemoryCardContents, or an empty NBTCompound
* @param is
* @return
*/
NBTTagCompound getData (ItemStack is);
}
+18 -17
View File
@@ -5,22 +5,23 @@ import appeng.api.me.util.TransitionResult;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public interface ISpatialStorage {
boolean isSpatialStorage( ItemStack is );
int getMaxStoredDim( ItemStack is );
World getWorld( ItemStack is );
WorldCoord getStoredSize( ItemStack is );
WorldCoord getMin( ItemStack is );
WorldCoord getMax( ItemStack is );
TransitionResult doSpatialTransition( ItemStack is, World w, WorldCoord min, WorldCoord max, boolean doTransition );
public interface ISpatialStorage
{
boolean isSpatialStorage (ItemStack is);
int getMaxStoredDim (ItemStack is);
World getWorld (ItemStack is);
WorldCoord getStoredSize (ItemStack is);
WorldCoord getMin (ItemStack is);
WorldCoord getMax (ItemStack is);
TransitionResult doSpatialTransition (ItemStack is, World w, WorldCoord min, WorldCoord max, boolean doTransition);
World createNewWorld (ItemStack is);
World createNewWorld(ItemStack is);
}
+32 -32
View File
@@ -14,42 +14,42 @@ public interface IStorageCell
* @param cellItem
* @return numberofBytes
*/
int getBytes( ItemStack cellItem );
int getBytes (ItemStack cellItem);
/**
* rv0 - Determines the number of bytes used for any type included on the cell.
* @param cellItem
* @return numberOfBytes
*/
int BytePerType( ItemStack iscellItem );
/**
* rv11 - Must be between 1 and 63, indicates how many types you want to store on the item.
* @param cellItem
* @return numberOfTypes
*/
int getTotalTypes( ItemStack cellItem );
/**
* rv11 - allows you to fine tune which items are allowed on a given cell,
* if you don't care, just return false;
* As the handler for this type of cell is still the default cells, the normal AE black list is also applied.
* @param cellItem
* @param requsetedAddition
* @return preventAdditionOfItem
*/
boolean isBlackListed( ItemStack cellItem, IAEItemStack requsetedAddition );
/**
* rv11 - allows you to specify if this storage cell can be stored inside other storage cells, only set this for special items like the matter cannon that are not general purpose storage.
* @return
*/
boolean storableInStorageCell();
int BytePerType (ItemStack iscellItem);
/**
* rv14 - allows an item to selectivly enable or disable its status as a storage cell.
* @param i
* @return
*/
boolean isStorageCell( ItemStack i );
/**
* rv11 - Must be between 1 and 63, indicates how many types you want to store on the item.
* @param cellItem
* @return numberOfTypes
*/
int getTotalTypes (ItemStack cellItem);
/**
* rv11 - allows you to fine tune which items are allowed on a given cell,
* if you don't care, just return false;
* As the handler for this type of cell is still the default cells, the normal AE black list is also applied.
* @param cellItem
* @param requsetedAddition
* @return preventAdditionOfItem
*/
boolean isBlackListed (ItemStack cellItem, IAEItemStack requsetedAddition);
/**
* rv11 - allows you to specify if this storage cell can be stored inside other storage cells, only set this for special items like the matter cannon that are not general purpose storage.
* @return
*/
boolean storableInStorageCell ();
/**
* rv14 - allows an item to selectivly enable or disable its status as a storage cell.
* @param i
* @return
*/
boolean isStorageCell (ItemStack i);
}
@@ -2,20 +2,21 @@ package appeng.api.me.items;
import net.minecraft.item.ItemStack;
public interface IStorageComponent {
public interface IStorageComponent
{
/**
* rv11 - This isn't necessarily the same as if you make a storage cell out of it, but all of AE's default cells do it that way, its currently only used for the condenser.
* @param cellItem
* @return numberofBytes
*/
int getBytes( ItemStack is );
int getBytes (ItemStack is);
/**
* rv11 - just true or false for the item stack.
* @param is
* @return
*/
boolean isStorageComponent( ItemStack is );
boolean isStorageComponent (ItemStack is);
}
+14 -9
View File
@@ -3,18 +3,23 @@ package appeng.api.me.tiles;
import appeng.api.WorldCoord;
import appeng.api.me.util.IAssemblerCluster;
public interface IAssemblerMB {
public interface IAssemblerMB
{
/**
* Do this:
* return new WorldCoord( TileEntity.xCoord, TileEntity.yCoord, TileEntity.zCoord );
*/
public WorldCoord getLocation();
public IAssemblerCluster getCluster();
public void updateStatus( IAssemblerCluster ac );
public boolean isComplete();
void calculateMultiblock( long instanceCalc );
public long markViewed(long inst);
public WorldCoord getLocation ();
public IAssemblerCluster getCluster ();
public void updateStatus (IAssemblerCluster ac);
public boolean isComplete ();
void calculateMultiblock (long instanceCalc);
public long markViewed (long inst);
}
@@ -7,5 +7,5 @@ import appeng.api.me.util.ICraftingPattern;
*/
public interface IAssemblerPatternProvider
{
public ICraftingPattern provideAssemblerPattern();
public ICraftingPattern provideAssemblerPattern ();
}
+13 -12
View File
@@ -9,16 +9,17 @@ import appeng.api.me.util.IMEInventoryHandler;
*
* Remember to trigger the appropriate storage update vents, when your getCellArray Changes. *
*/
public interface ICellContainer {
/**
* Inventory of the tile for use with ME, should always return an valid list, never NULL.
*/
List<IMEInventoryHandler> getCellArray();
/**
* the storage's priority.
*/
int getPriority();
public interface ICellContainer
{
/**
* Inventory of the tile for use with ME, should always return an valid list, never NULL.
*/
List<IMEInventoryHandler> getCellArray ();
/**
* the storage's priority.
*/
int getPriority ();
}
+13 -13
View File
@@ -7,17 +7,17 @@ import appeng.api.me.util.IMEInventoryHandler;
*/
public interface ICellProvider
{
/**
* consume power to add an item to the storage system.
* @param items
* @param multiplier
* @return
*/
public int usePowerForAddition( int items, int multiplier );
/**
* returns a ME Inventory for interaction.
*/
public IMEInventoryHandler provideCell();
/**
* consume power to add an item to the storage system.
* @param items
* @param multiplier
* @return
*/
public int usePowerForAddition (int items, int multiplier);
/**
* returns a ME Inventory for interaction.
*/
public IMEInventoryHandler provideCell ();
}
+32 -56
View File
@@ -7,62 +7,38 @@ import net.minecraftforge.common.ForgeDirection;
*/
public interface IColoredMETile
{
/**
* Named Colors by int
*/
public static String[] Colors = {
"Blue",
"Black",
"White",
"Brown",
"Red",
"Yellow",
"Green"
};
/**
* Named Colors by int
*/
public static String[] Colors = { "Blue", "Black", "White", "Brown", "Red", "Yellow", "Green" };
public static int[] ColorValues = {
0x514AFF,
0x666666,
0xDBDBDB,
0x724E35,
0xFF003C,
0xFFC651,
0x7CFF4A
};
public static int[] ColorValues = { 0x514AFF, 0x666666, 0xDBDBDB, 0x724E35, 0xFF003C, 0xFFC651, 0x7CFF4A };
public static int[] ColorValuesBright = {
0xCAEAFC,
0xE7E7E7,
0xFCFCFC,
0xD5AD91,
0xFCECF0,
0xFCF2C7,
0xDBFCCF
};
/**
* Fluix Colored, color for isColored() == false
*/
public static String ClearName = "Clear";
public static int ClearColor = 0x895CA8;
public static int ClearColorBright = 0xBFADD8;
/**
* return true, if your block has a color, or false, if it dosn't.
* this allows you to have a colored block that can pretend to be colorless.
* @return true, if colored, false if not.
*/
boolean isColored( ForgeDirection dir );
/**
* Change the color, AE dosn't call this except for its own blocks, its simply included for completeness.
* @param offset
*/
void setColor( int offset );
/**
* which color is this tile?
* @return index into the above ColorsList.
*/
int getColor();
public static int[] ColorValuesBright = { 0xCAEAFC, 0xE7E7E7, 0xFCFCFC, 0xD5AD91, 0xFCECF0, 0xFCF2C7, 0xDBFCCF };
/**
* Fluix Colored, color for isColored() == false
*/
public static String ClearName = "Clear";
public static int ClearColor = 0x895CA8;
public static int ClearColorBright = 0xBFADD8;
/**
* return true, if your block has a color, or false, if it dosn't.
* this allows you to have a colored block that can pretend to be colorless.
* @return true, if colored, false if not.
*/
boolean isColored (ForgeDirection dir);
/**
* Change the color, AE dosn't call this except for its own blocks, its simply included for completeness.
* @param offset
*/
void setColor (int offset);
/**
* which color is this tile?
* @return index into the above ColorsList.
*/
int getColor ();
}
+21 -20
View File
@@ -5,24 +5,25 @@ import java.util.List;
/**
* Some ME Tiles can be configured, generally via interface, but these let you do this programatically.
*/
public interface IConfigureableTile {
/** Switches configuration to next option... ( returns new configuration. ) */
String prevConfiguration(String name);
/** Switches configuration to next option... ( returns new configuration. ) */
String nextConfiguration(String name);
/** Gets a list off all the configurations... */
List<String> getConfigurations();
/** Gets the options of a particular configuration. */
List<String> getConfiguationOptions( String name );
/** Set a configuration to a specific option... ( returns the old one. ) */
String setConfiguration(String name, String value);
/** The the current value for a configuration. */
String getConfiguration(String name);
public interface IConfigureableTile
{
/** Switches configuration to next option... ( returns new configuration. ) */
String prevConfiguration (String name);
/** Switches configuration to next option... ( returns new configuration. ) */
String nextConfiguration (String name);
/** Gets a list off all the configurations... */
List<String> getConfigurations ();
/** Gets the options of a particular configuration. */
List<String> getConfiguationOptions (String name);
/** Set a configuration to a specific option... ( returns the old one. ) */
String setConfiguration (String name, String value);
/** The the current value for a configuration. */
String getConfiguration (String name);
}
@@ -4,8 +4,9 @@ import java.util.Set;
import net.minecraftforge.common.ForgeDirection;
public interface IConnectionSensitive {
void onMEConnectionsChanged( Set<ForgeDirection> connections, Set<ForgeDirection> visualConnections );
public interface IConnectionSensitive
{
void onMEConnectionsChanged (Set<ForgeDirection> connections, Set<ForgeDirection> visualConnections);
}
@@ -3,8 +3,9 @@ package appeng.api.me.tiles;
import appeng.api.me.util.ICraftingPattern;
import appeng.api.me.util.ITileCraftingProvider;
public interface ICraftingTracker {
public interface ICraftingTracker
{
void addCraftingOption (ITileCraftingProvider provider, ICraftingPattern api);
void addCraftingOption( ITileCraftingProvider provider, ICraftingPattern api );
}
@@ -10,11 +10,11 @@ import net.minecraftforge.common.ForgeDirection;
*/
public interface IDirectionalMETile
{
/**
* return true if this tile can connect in a specific direction.
* @param dir
* @return true, if it can connect.
*/
boolean canConnect( ForgeDirection dir );
/**
* return true if this tile can connect in a specific direction.
* @param dir
* @return true, if it can connect.
*/
boolean canConnect (ForgeDirection dir);
}
@@ -7,7 +7,7 @@ import appeng.api.me.util.IMEInventoryHandler;
*/
public interface IExtendedCellProvider extends ICellProvider
{
public IMEInventoryHandler provideCell( String Filter );
public IMEInventoryHandler provideCell (String Filter);
}
@@ -4,8 +4,9 @@ package appeng.api.me.tiles;
* Cables will disconnect if its not enabled,
* this means that they will fail to appear connected, example - MAC
*/
public interface IFulllyOptionalMETile extends IOptionalMETile {
public interface IFulllyOptionalMETile extends IOptionalMETile
{
boolean isSeperated ();
boolean isSeperated();
}
+5 -5
View File
@@ -8,18 +8,18 @@ public abstract interface IGridMachine extends IGridTileEntity
/**
* how much power this entity drains to run constantly.
*/
public float getPowerDrainPerTick();
public float getPowerDrainPerTick ();
/**
* when a network is reset, this is trigger false, until booting is complete, please respect this and disable
* network related activity during that time.
* @param isReady
*/
public void setNetworkReady( boolean isReady );
public void setNetworkReady (boolean isReady);
/**
* return true, when the machine is properly powered, the network is ready, and any other conditions required for running are met.
* @return
*/
public boolean isMachineActive();
public boolean isMachineActive ();
}
+1 -1
View File
@@ -7,5 +7,5 @@ import appeng.api.DimentionalCoord;
*/
public interface IGridTeleport
{
DimentionalCoord[] findRemoteSide();
DimentionalCoord[] findRemoteSide ();
}
+13 -13
View File
@@ -13,37 +13,37 @@ public abstract interface IGridTileEntity
* Do this:
* return new WorldCoord( TileEntity.xCoord, TileEntity.yCoord, TileEntity.zCoord );
*/
public abstract WorldCoord getLocation();
public abstract WorldCoord getLocation ();
/**
* If your tile entity is valid return true.
*/
public boolean isValid();
public boolean isValid ();
/**
* Informs you of either true or false.
* if the power feed has stopped, or been continued, only called when changes happens, or when grid updates happen.
*/
public abstract void setPowerStatus(boolean hasPower);
public abstract void setPowerStatus (boolean hasPower);
/**
* Yes if the device has a powered status.
*/
public abstract boolean isPowered();
public abstract boolean isPowered ();
/**
* Return your last grid you got via setGrid.
*/
public IGridInterface getGrid();
public IGridInterface getGrid ();
/**
* Informs you of your new grid, YOU MUST return this via getGrid.
* Store for later.
*/
public void setGrid(IGridInterface gi);
public void setGrid (IGridInterface gi);
/**
* Return worldObj
*/
public World getWorld();
public World getWorld ();
}
+5 -5
View File
@@ -2,9 +2,9 @@ package appeng.api.me.tiles;
public interface ILocateable
{
/**
* returns the serial for a locateable object.
* @return
*/
long getLocatableSerial();
/**
* returns the serial for a locateable object.
* @return
*/
long getLocatableSerial ();
}
+47 -46
View File
@@ -6,50 +6,51 @@ import appeng.api.config.ItemFlow;
* Used to access information about AE's various power accepting blocks for monitoring purposes.
*
*/
public interface IMEPowerStorage {
/**
* ME power storage asset, pass the amount you want to use, and what you want to use it for.
* @param use
* @param for_what
* @return if you can use it.
*/
boolean useMEEnergy( float use, String for_what );
/**
* Add energy to an ME Power storage.
* @param amt that was not added to storage myEnergy = addMEPower( myEnergy ); // pushes your power into the network.
* @return
*/
public double addMEPower( double amt );
/**
* returns the current maximum power ( this can change :P )
*/
public double getMEMaxPower();
/**
* returns the current AE Power Level, this may exceed getMEMaxPower()
*/
public double getMECurrentPower();
/**
* Checked on network reset to see if your block can be used as a public power storage ( use getPowerFlow to control the behavior )
* @return
*/
public boolean isPublicPowerStorage();
/**
* Control the power flow by telling what the controller can do, either add? or subtract? or both!
* @return
*/
public ItemFlow getPowerFlow();
/**
* Drains power from this storage, it returns the power it was able to obtain.
* @param amt - amount of power to drain.
* @return amount of power obtained.
*/
double drainMEPower(double amt);
public interface IMEPowerStorage
{
/**
* ME power storage asset, pass the amount you want to use, and what you want to use it for.
* @param use
* @param for_what
* @return if you can use it.
*/
boolean useMEEnergy (float use, String for_what);
/**
* Add energy to an ME Power storage.
* @param amt that was not added to storage myEnergy = addMEPower( myEnergy ); // pushes your power into the network.
* @return
*/
public double addMEPower (double amt);
/**
* returns the current maximum power ( this can change :P )
*/
public double getMEMaxPower ();
/**
* returns the current AE Power Level, this may exceed getMEMaxPower()
*/
public double getMECurrentPower ();
/**
* Checked on network reset to see if your block can be used as a public power storage ( use getPowerFlow to control the behavior )
* @return
*/
public boolean isPublicPowerStorage ();
/**
* Control the power flow by telling what the controller can do, either add? or subtract? or both!
* @return
*/
public ItemFlow getPowerFlow ();
/**
* Drains power from this storage, it returns the power it was able to obtain.
* @param amt - amount of power to drain.
* @return amount of power obtained.
*/
double drainMEPower (double amt);
}
+3 -2
View File
@@ -4,6 +4,7 @@ package appeng.api.me.tiles;
* By simply implenting this, the networks can be become aware of a block they touch, but they don't propogate signal or really belong to a network.
* Not sure what it would be used for to be honest beyond the power relay.
*/
public interface INonSignalBlock {
public interface INonSignalBlock
{
}
+9 -8
View File
@@ -3,12 +3,13 @@ package appeng.api.me.tiles;
/**
* Cables will connect, but signal will not propagate. ( IFulllyOptionalMETile disconnects )
*/
public interface IOptionalMETile {
/**
* if false, the signal will not propigate via this tile, remember to use connectivity events.
* @return
*/
public boolean isEnabled();
public interface IOptionalMETile
{
/**
* if false, the signal will not propigate via this tile, remember to use connectivity events.
* @return
*/
public boolean isEnabled ();
}
+18 -17
View File
@@ -6,21 +6,22 @@ import net.minecraftforge.common.ForgeDirection;
* Please note that none of these methods will cause a block update,
* if you use set ori/spin/cycle, must mark the block for update if it was already sent to the client.
*/
public interface IOrientableTile {
// returns the main direction for rotation.
ForgeDirection getPrimaryOrientation();
// used for up or down orientation to spin the tile around, 0 - 3 clockwise ( probobly )
int getSpin();
// returns the main direction for rotation.
void setPrimaryOrientation( ForgeDirection s );
// used for up or down orientation.
void setSpin( int spin );
// acts like a wrench was used on it, if a wrench does nothing, this does nothing.
void cycleOrientation();
public interface IOrientableTile
{
// returns the main direction for rotation.
ForgeDirection getPrimaryOrientation ();
// used for up or down orientation to spin the tile around, 0 - 3 clockwise ( probobly )
int getSpin ();
// returns the main direction for rotation.
void setPrimaryOrientation (ForgeDirection s);
// used for up or down orientation.
void setSpin (int spin);
// acts like a wrench was used on it, if a wrench does nothing, this does nothing.
void cycleOrientation ();
}
+12 -12
View File
@@ -2,16 +2,16 @@ package appeng.api.me.tiles;
public interface IPriorityTile
{
/**
* gets the current priroity, can be negitive or positive.
* implemented by storage systems, and is used for sorting.
* @return
*/
int getPriority();
/**
* change the priority.
* @param p
*/
void setPriority( int p );
/**
* gets the current priroity, can be negitive or positive.
* implemented by storage systems, and is used for sorting.
* @return
*/
int getPriority ();
/**
* change the priority.
* @param p
*/
void setPriority (int p);
}
Loaded 100 of 179 files, more files were not shown because too many files have changed in this diff. Show more