Fixed Armbot API being errored

This commit is contained in:
Henry Mao 2013-02-02 16:02:07 +08:00
parent 37b57e31a4
commit cc12121975
4 changed files with 23 additions and 12 deletions

View file

@ -0,0 +1,11 @@
package assemblyline.api;
/**
* An interface applied to Armbots.
*
* @author Calclavia
*/
public interface IArmbot
{
}

View file

@ -1,11 +1,9 @@
package assemblyline.api;
import net.minecraft.entity.Entity;
import assemblyline.common.machine.armbot.TileEntityArmbot;
/**
* The IUseable inteface is used by the ArmBot so that it may interact with Tile Entities. onUse
* will be called on the block an ArmBot is touching whenver the USE command is run on it.
* The IUseable inteface is used by the ArmBot so that it may interact with Tile Entities. onUse will be called on the block an ArmBot is touching whenever the USE command is run on it.
*
* @author Briman0094
*
@ -14,13 +12,12 @@ public interface IArmbotUseable
{
/**
* Called when the ArmBot command "USE" is run. This is called on any IUseable the ArmBot is
* touching.
* Called when the ArmBot command "USE" is run. This is called on any IUseable the ArmBot is touching.
*
* @param tileEntity the TileEntityArmbot that is using this IUseable
* @param heldEntity the Entity being held by the ArmBot, or null if there is none
* @return whether or not the "use" did anything
*/
public boolean onUse(TileEntityArmbot tileEntity, Entity heldEntity);
public boolean onUse(IArmbot tileEntity, Entity heldEntity);
}

View file

@ -29,6 +29,7 @@ import universalelectricity.prefab.TranslationHelper;
import universalelectricity.prefab.multiblock.IMultiBlock;
import universalelectricity.prefab.network.IPacketReceiver;
import universalelectricity.prefab.network.PacketManager;
import assemblyline.api.IArmbot;
import assemblyline.api.IArmbotUseable;
import assemblyline.common.AssemblyLine;
import assemblyline.common.machine.TileEntityAssemblyNetwork;
@ -51,7 +52,7 @@ import cpw.mods.fml.relauncher.Side;
import dan200.computer.api.IComputerAccess;
import dan200.computer.api.IPeripheral;
public class TileEntityArmbot extends TileEntityAssemblyNetwork implements IMultiBlock, IInventory, IPacketReceiver, IJouleStorage, IPeripheral
public class TileEntityArmbot extends TileEntityAssemblyNetwork implements IMultiBlock, IInventory, IPacketReceiver, IJouleStorage, IArmbot, IPeripheral
{
private final CommandManager commandManager = new CommandManager();
private static final int PACKET_COMMANDS = 128;
@ -488,8 +489,7 @@ public class TileEntityArmbot extends TileEntityAssemblyNetwork implements IMult
}
}
/*
* NBTTagCompound cmdManager = nbt.getCompoundTag("cmdManager");
* this.commandManager.readFromNBT(this, cmdManager);
* NBTTagCompound cmdManager = nbt.getCompoundTag("cmdManager"); this.commandManager.readFromNBT(this, cmdManager);
*/
this.commandManager.setCurrentTask(nbt.getInteger("curTask"));
@ -526,8 +526,7 @@ public class TileEntityArmbot extends TileEntityAssemblyNetwork implements IMult
nbt.setFloat("pitch", this.rotationPitch);
/*
* NBTTagCompound cmdManager = new NBTTagCompound("cmdManager");
* this.commandManager.writeToNBT(cmdManager); nbt.setCompoundTag("cmdManager", cmdManager);
* NBTTagCompound cmdManager = new NBTTagCompound("cmdManager"); this.commandManager.writeToNBT(cmdManager); nbt.setCompoundTag("cmdManager", cmdManager);
*/
nbt.setString("cmdText", this.displayText);

View file

@ -19,6 +19,7 @@ import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import universalelectricity.prefab.TranslationHelper;
import universalelectricity.prefab.tile.TileEntityAdvanced;
import assemblyline.api.IArmbot;
import assemblyline.api.IArmbotUseable;
import assemblyline.common.AssemblyLine;
import assemblyline.common.Pair;
@ -442,13 +443,16 @@ public class TileEntityImprinter extends TileEntityAdvanced implements ISidedInv
/**
* Armbot
*
* @param tileEntity
* @param heldEntity
* @return
*/
@Override
public boolean onUse(TileEntityArmbot tileEntity, Entity heldEntity)
public boolean onUse(IArmbot iArmbot, Entity heldEntity)
{
TileEntityArmbot tileEntity = (TileEntityArmbot) iArmbot;
if (heldEntity != null)
{
if (heldEntity instanceof EntityItem)