From be7bb5d31b207b4e32c55b226292caf60899fea3 Mon Sep 17 00:00:00 2001 From: SirSengir Date: Thu, 19 Jul 2012 14:18:43 +0200 Subject: [PATCH] More work on inventory interfaces. --- .../api/inventory/ISecuredInventory.java | 15 +++++++++++++++ .../api/inventory/ISelectiveInventory.java | 6 +++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/common/net/minecraft/src/buildcraft/api/inventory/ISecuredInventory.java b/common/net/minecraft/src/buildcraft/api/inventory/ISecuredInventory.java index 5d7d09d7..ed1de442 100644 --- a/common/net/minecraft/src/buildcraft/api/inventory/ISecuredInventory.java +++ b/common/net/minecraft/src/buildcraft/api/inventory/ISecuredInventory.java @@ -1,5 +1,20 @@ package net.minecraft.src.buildcraft.api.inventory; +import net.minecraft.src.buildcraft.api.Orientations; + public interface ISecuredInventory { + + /** + * @param name + * @return true if the user/player with the given name has access permissions on this machine. + */ boolean canAccess(String name); + + /** + * Informs the inventory with whose permissions the next item or liquid transaction will be performed. It is up to the inventory to determine the effect. + * @param orientation Orientation the transaction will be performed from. + * @param name Name of the user/player who owns the transaction. + */ + void prepareTransaction(Orientations orientation, String name); + } diff --git a/common/net/minecraft/src/buildcraft/api/inventory/ISelectiveInventory.java b/common/net/minecraft/src/buildcraft/api/inventory/ISelectiveInventory.java index e604db24..49c36d86 100644 --- a/common/net/minecraft/src/buildcraft/api/inventory/ISelectiveInventory.java +++ b/common/net/minecraft/src/buildcraft/api/inventory/ISelectiveInventory.java @@ -6,12 +6,12 @@ import net.minecraft.src.buildcraft.api.Orientations; public interface ISelectiveInventory extends ISpecialInventory { /** * Requests specified items to be extracted from the inventory - * @param desired Array which can contain ItemStacks, Items, or classes describing the type of item accepted. + * @param desired Array which can contain ItemStacks, Items, or classes describing the type of item accepted or excluded. + * @param exclusion If true desired items are not eligible for returning. * @param doRemove If false no actual extraction may occur. * @param from Orientation the ItemStack is requested from. * @param maxItemCount Maximum amount of items to extract (spread over all returned item stacks) * @return Array of item stacks extracted from the inventory */ - ItemStack[] extractItem(Object[] desired, boolean doRemove, Orientations from, int maxItemCount); - + ItemStack[] extractItem(Object[] desired, boolean exclusion, boolean doRemove, Orientations from, int maxItemCount); }