Skip to content

Commit

Permalink
Commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
mak326428 committed Aug 28, 2013
1 parent 443bafb commit a7ffe1a
Show file tree
Hide file tree
Showing 224 changed files with 8,102 additions and 1,952 deletions.
67 changes: 67 additions & 0 deletions appeng/api/Blocks.java
@@ -0,0 +1,67 @@
package appeng.api;

import net.minecraft.item.ItemStack;

/**
* Blocks, all of the Blocks in AE.
* DO NOT USE THESE WITHOUT COPYING THEM : ItemStack.copy() - is your friend.
*/

public class Blocks
{
// 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;
public static ItemStack blkPatternEncoder;
public static ItemStack blkWireless;
public static ItemStack blkTerminal;
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 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 blkQuartzGlass;
public static ItemStack blkQuartzLamp;

// Used internally, best not to mess with this one...
public static ItemStack blkPhantom;

}
58 changes: 58 additions & 0 deletions appeng/api/DimentionalCoord.java
@@ -0,0 +1,58 @@
package appeng.api;

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 );
}

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;
}
}
175 changes: 175 additions & 0 deletions appeng/api/IAEItemStack.java
@@ -0,0 +1,175 @@
package appeng.api;

import java.io.DataOutputStream;
import java.io.IOException;

import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;

/**
* An alternate version of ItemStack for AE to keep tabs on things easier, and to support larger storage.
* stackSizes of getItemStack will be capped.
*
* You may hold on to these if you want, just make sure you let go of them when your not using them.
*
* Don't Implement.
*
* Construct with Util.createItemStack( ItemStack )
*
*/
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();

/**
* 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;

}
33 changes: 33 additions & 0 deletions appeng/api/IAETagCompound.java
@@ -0,0 +1,33 @@
package appeng.api;

import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;

/**
* Don't cast this... either compare with it, or copy it.
*
* Don't Implement.
*/
public interface IAETagCompound {

/**
* Create a copy ( the copy will not be a IAETagCompount, it will be a NBTTagCompound. )
* @return
*/
NBTTagCompound clone();

/**
* compare to other NBTTagCompounds or IAETagCompounds
* @param a
* @return true, if they are the same.
*/
@Override
boolean equals( Object a );

/**
* returns the special comparison for this tag.
* @return
*/
IItemComparison getSpecialComparison();

}

0 comments on commit a7ffe1a

Please sign in to comment.