update storage drawers api

This commit is contained in:
way2muchnoise
2016-11-23 16:18:08 +01:00
parent cec8c250a9
commit 101ae365f8
11 changed files with 31 additions and 19 deletions

View File

@@ -13,9 +13,4 @@ public interface IUserConfig {
* Configuration options related to individual blocks. * Configuration options related to individual blocks.
*/ */
IBlockConfig blockConfig(); IBlockConfig blockConfig();
/**
* Configuration options related to third party mod integration.
*/
IIntegrationConfig integrationConfig();
} }

View File

@@ -6,7 +6,7 @@ import net.minecraftforge.fml.common.eventhandler.Event;
/** /**
* This event is called when a drawer has been bound to a new item. This is * This event is called when a drawer has been bound to a new item. This is
* and opportunity for mods to cache extended data with the drawer. * and opportunity for mods to cache extended data with the drawer.
* * <p>
* This event is also called when the drawer is changed to empty. * This event is also called when the drawer is changed to empty.
*/ */
public class DrawerPopulatedEvent extends Event { public class DrawerPopulatedEvent extends Event {

View File

@@ -9,7 +9,9 @@ public enum SlotType {
*/ */
INPUT, INPUT,
/** An inventory slot for output-only operations; stack sizes artificially held high. */ /**
* An inventory slot for output-only operations; stack sizes artificially held high.
*/
OUTPUT; OUTPUT;
public static final SlotType[] values = values(); public static final SlotType[] values = values();

View File

@@ -23,8 +23,6 @@ public interface IPackBlockFactory
/** /**
* Hides block from NEI if NEI is active. * Hides block from NEI if NEI is active.
* <p>
* Registers block metadata from an initialized DataResolver with Storage Drawers.
*/ */
//void hideBlock (String blockID); //void hideBlock (String blockID);

View File

@@ -13,7 +13,7 @@ public interface IRecipeHandler {
* Get the recipe ingredient list as an array of objects (usually used for shaped recipes). * Get the recipe ingredient list as an array of objects (usually used for shaped recipes).
* If your array does not contain ItemStack objects, you will need to register an {@link IIngredientHandler} to * If your array does not contain ItemStack objects, you will need to register an {@link IIngredientHandler} to
* get an ItemStack from them. * get an ItemStack from them.
* * <p>
* If you would prefer to return a List, return null in this method and implement {@link #getInputAsList}. * If you would prefer to return a List, return null in this method and implement {@link #getInputAsList}.
* *
* @param recipe An instance of a custom {@link IRecipe}. * @param recipe An instance of a custom {@link IRecipe}.
@@ -25,7 +25,7 @@ public interface IRecipeHandler {
* Get the recipe ingredient list as a list of objects (usually used for shapeless recipes). * Get the recipe ingredient list as a list of objects (usually used for shapeless recipes).
* If your list does not contain ItemStack objects, you will need to register an {@link IIngredientHandler} to * If your list does not contain ItemStack objects, you will need to register an {@link IIngredientHandler} to
* get an ItemStack from them. * get an ItemStack from them.
* * <p>
* If you would prefer to return an array, return null in this method and implement {@link #getInputAsArray}. * If you would prefer to return an array, return null in this method and implement {@link #getInputAsArray}.
* *
* @param recipe An instance of a custom {@link IRecipe}. * @param recipe An instance of a custom {@link IRecipe}.

View File

@@ -73,7 +73,7 @@ public interface IDrawer {
/** /**
* Gets whether or not an item of the given type and data can be stored in this drawer. * Gets whether or not an item of the given type and data can be stored in this drawer.
* * <p>
* Stack size and available capacity are not considered. For drawers that are not empty, this * Stack size and available capacity are not considered. For drawers that are not empty, this
* method can allow ore-dictionary compatible items to be accepted into the drawer, as defined by what * method can allow ore-dictionary compatible items to be accepted into the drawer, as defined by what
* the drawer considers to be an equivalent item. * the drawer considers to be an equivalent item.
@@ -85,7 +85,7 @@ public interface IDrawer {
/** /**
* Gets whether or not an item of the given type and data can be extracted from this drawer. * Gets whether or not an item of the given type and data can be extracted from this drawer.
* * <p>
* This is intended to allow outbound ore-dictionary conversions of compatible items, as defined by what * This is intended to allow outbound ore-dictionary conversions of compatible items, as defined by what
* the drawer considers to be an equivalent item. * the drawer considers to be an equivalent item.
* *
@@ -109,11 +109,17 @@ public interface IDrawer {
/** /**
* Stores auxiliary data with this drawer, mainly for use in integration. * Stores auxiliary data with this drawer, mainly for use in integration.
*
* @param key The key to identify the data with. * @param key The key to identify the data with.
* @param data The data to store. * @param data The data to store.
*/ */
void setExtendedData(String key, Object data); void setExtendedData(String key, Object data);
/**
* Called when a component attribute of a drawer (such as lock or void) changes state.
*/
void attributeChanged();
void writeToNBT(NBTTagCompound tag); void writeToNBT(NBTTagCompound tag);
void readFromNBT(NBTTagCompound tag); void readFromNBT(NBTTagCompound tag);

View File

@@ -13,6 +13,11 @@ public interface IDrawerGroup {
*/ */
IDrawer getDrawer(int slot); IDrawer getDrawer(int slot);
/**
* Gets the drawer at the given slot within this group only if it is enabled.
*/
IDrawer getDrawerIfEnabled(int slot);
/** /**
* Gets whether the drawer in the given slot is usable. * Gets whether the drawer in the given slot is usable.
*/ */

View File

@@ -7,7 +7,7 @@ package com.jaquadro.minecraft.storagedrawers.api.storage;
public interface IFractionalDrawer extends IDrawer { public interface IFractionalDrawer extends IDrawer {
/** /**
* Gets the storage ratio between the held item and the most compressed item within the drawer group. * Gets the storage ratio between the held item and the most compressed item within the drawer group.
* * <p>
* For example, most ingots have a conversion rate of 9 compared to metal blocks, and nuggets a rate of 81. * For example, most ingots have a conversion rate of 9 compared to metal blocks, and nuggets a rate of 81.
* Actual conversion rates are implementation-defined. * Actual conversion rates are implementation-defined.
*/ */

View File

@@ -13,24 +13,28 @@ public interface IProtectable {
/** /**
* Sets the owner of the drawer. Set to null to set no owner. * Sets the owner of the drawer. Set to null to set no owner.
*
* @return false if the operation is not supported, true otherwise. * @return false if the operation is not supported, true otherwise.
*/ */
boolean setOwner(UUID owner); boolean setOwner(UUID owner);
/** /**
* Gets the provider managing security for the target. * Gets the provider managing security for the target.
*
* @return null to use the default provider, which enforces strict owner access. * @return null to use the default provider, which enforces strict owner access.
*/ */
ISecurityProvider getSecurityProvider(); ISecurityProvider getSecurityProvider();
/** /**
* Gets the lockable interface if it exists on the protected drawer. * Gets the lockable interface if it exists on the protected drawer.
*
* @return A lockable interface, or null if lockable is not supported. * @return A lockable interface, or null if lockable is not supported.
*/ */
ILockableContainer getLockableContainer(); ILockableContainer getLockableContainer();
/** /**
* Sets the provider managing security for the target. Set to null for default provider. * Sets the provider managing security for the target. Set to null for default provider.
*
* @return false if the operation is not supported, true otherwise. * @return false if the operation is not supported, true otherwise.
*/ */
boolean setSecurityProvider(ISecurityProvider provder); boolean setSecurityProvider(ISecurityProvider provder);

View File

@@ -9,6 +9,7 @@ public interface ISealable {
/** /**
* Sets whether or not the drawer is currently sealed. * Sets whether or not the drawer is currently sealed.
*
* @return false if the operation is not supported, true otherwise. * @return false if the operation is not supported, true otherwise.
*/ */
boolean setIsSealed(boolean state); boolean setIsSealed(boolean state);

View File

@@ -9,6 +9,7 @@ public interface IShroudable {
/** /**
* Sets whether or not the drawer is currently shrouded. * Sets whether or not the drawer is currently shrouded.
*
* @return false if the operation is not supported, true otherwise. * @return false if the operation is not supported, true otherwise.
*/ */
boolean setIsShrouded(boolean state); boolean setIsShrouded(boolean state);