diff --git a/src/minecraft/assemblyline/api/IArmbot.java b/src/minecraft/assemblyline/api/IArmbot.java new file mode 100644 index 00000000..23cc4a9d --- /dev/null +++ b/src/minecraft/assemblyline/api/IArmbot.java @@ -0,0 +1,11 @@ +package assemblyline.api; + +/** + * An interface applied to Armbots. + * + * @author Calclavia + */ +public interface IArmbot +{ + +} diff --git a/src/minecraft/assemblyline/api/IArmbotUseable.java b/src/minecraft/assemblyline/api/IArmbotUseable.java index fb133e59..314b022a 100644 --- a/src/minecraft/assemblyline/api/IArmbotUseable.java +++ b/src/minecraft/assemblyline/api/IArmbotUseable.java @@ -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); } diff --git a/src/minecraft/assemblyline/common/machine/armbot/TileEntityArmbot.java b/src/minecraft/assemblyline/common/machine/armbot/TileEntityArmbot.java index ee7173bd..f22f8060 100644 --- a/src/minecraft/assemblyline/common/machine/armbot/TileEntityArmbot.java +++ b/src/minecraft/assemblyline/common/machine/armbot/TileEntityArmbot.java @@ -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); diff --git a/src/minecraft/assemblyline/common/machine/imprinter/TileEntityImprinter.java b/src/minecraft/assemblyline/common/machine/imprinter/TileEntityImprinter.java index 610878ea..7c642742 100644 --- a/src/minecraft/assemblyline/common/machine/imprinter/TileEntityImprinter.java +++ b/src/minecraft/assemblyline/common/machine/imprinter/TileEntityImprinter.java @@ -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)