update storage drawers api
This commit is contained in:
@@ -13,9 +13,4 @@ public interface IUserConfig {
|
||||
* Configuration options related to individual blocks.
|
||||
*/
|
||||
IBlockConfig blockConfig();
|
||||
|
||||
/**
|
||||
* Configuration options related to third party mod integration.
|
||||
*/
|
||||
IIntegrationConfig integrationConfig();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
* and opportunity for mods to cache extended data with the drawer.
|
||||
*
|
||||
* <p>
|
||||
* This event is also called when the drawer is changed to empty.
|
||||
*/
|
||||
public class DrawerPopulatedEvent extends Event {
|
||||
|
||||
@@ -9,7 +9,9 @@ public enum SlotType {
|
||||
*/
|
||||
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;
|
||||
|
||||
public static final SlotType[] values = values();
|
||||
|
||||
@@ -23,13 +23,11 @@ public interface IPackBlockFactory
|
||||
|
||||
/**
|
||||
* Hides block from NEI if NEI is active.
|
||||
* <p>
|
||||
* Registers block metadata from an initialized DataResolver with Storage Drawers.
|
||||
*/
|
||||
//void hideBlock (String blockID);
|
||||
|
||||
/**
|
||||
* Registers block metadata from an initialized DataResolver with Storage Drawers.
|
||||
*/
|
||||
//void registerResolver (IExtendedDataResolver resolver);
|
||||
*/
|
||||
//void registerResolver (IExtendedDataResolver resolver);
|
||||
//}
|
||||
|
||||
@@ -13,7 +13,7 @@ public interface IRecipeHandler {
|
||||
* 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
|
||||
* get an ItemStack from them.
|
||||
*
|
||||
* <p>
|
||||
* 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}.
|
||||
@@ -25,7 +25,7 @@ public interface IRecipeHandler {
|
||||
* 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
|
||||
* get an ItemStack from them.
|
||||
*
|
||||
* <p>
|
||||
* 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}.
|
||||
|
||||
@@ -20,7 +20,7 @@ public interface IDrawer {
|
||||
* Sets the type of the stored item and initializes it to the given amount. Any existing item will be replaced.
|
||||
*
|
||||
* @param itemPrototype An ItemStack representing the type, metadata, and tags of the item to store.
|
||||
* @param amount The amount to initialize the stored item count to.
|
||||
* @param amount The amount to initialize the stored item count to.
|
||||
* @deprecated setStoredItem may redirect its set to another IDrawer, so use setStoredItemRedir instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@@ -30,7 +30,7 @@ public interface IDrawer {
|
||||
* Sets the type of the stored item and initializes it to the given amount. Any existing item will be replaced.
|
||||
*
|
||||
* @param itemPrototype An ItemStack representing the type, metadata, and tags of the item to store.
|
||||
* @param amount The amount to initialize the stored item count to.
|
||||
* @param amount The amount to initialize the stored item count to.
|
||||
* @return The IDrawer actually set with the prototype. Some drawer groups can redirect a set operation to another member.
|
||||
*/
|
||||
IDrawer setStoredItemRedir(ItemStack itemPrototype, int amount);
|
||||
@@ -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.
|
||||
*
|
||||
* <p>
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* <p>
|
||||
* This is intended to allow outbound ore-dictionary conversions of compatible items, as defined by what
|
||||
* 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.
|
||||
* @param key The key to identify the data with.
|
||||
*
|
||||
* @param key The key to identify the data with.
|
||||
* @param data The data to store.
|
||||
*/
|
||||
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 readFromNBT(NBTTagCompound tag);
|
||||
|
||||
@@ -13,6 +13,11 @@ public interface IDrawerGroup {
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ package com.jaquadro.minecraft.storagedrawers.api.storage;
|
||||
public interface IFractionalDrawer extends IDrawer {
|
||||
/**
|
||||
* 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.
|
||||
* Actual conversion rates are implementation-defined.
|
||||
*/
|
||||
|
||||
@@ -13,24 +13,28 @@ public interface IProtectable {
|
||||
|
||||
/**
|
||||
* Sets the owner of the drawer. Set to null to set no owner.
|
||||
*
|
||||
* @return false if the operation is not supported, true otherwise.
|
||||
*/
|
||||
boolean setOwner(UUID owner);
|
||||
|
||||
/**
|
||||
* Gets the provider managing security for the target.
|
||||
*
|
||||
* @return null to use the default provider, which enforces strict owner access.
|
||||
*/
|
||||
ISecurityProvider getSecurityProvider();
|
||||
|
||||
/**
|
||||
* Gets the lockable interface if it exists on the protected drawer.
|
||||
*
|
||||
* @return A lockable interface, or null if lockable is not supported.
|
||||
*/
|
||||
ILockableContainer getLockableContainer();
|
||||
|
||||
/**
|
||||
* Sets the provider managing security for the target. Set to null for default provider.
|
||||
*
|
||||
* @return false if the operation is not supported, true otherwise.
|
||||
*/
|
||||
boolean setSecurityProvider(ISecurityProvider provder);
|
||||
|
||||
@@ -9,6 +9,7 @@ public interface ISealable {
|
||||
|
||||
/**
|
||||
* Sets whether or not the drawer is currently sealed.
|
||||
*
|
||||
* @return false if the operation is not supported, true otherwise.
|
||||
*/
|
||||
boolean setIsSealed(boolean state);
|
||||
|
||||
@@ -9,6 +9,7 @@ public interface IShroudable {
|
||||
|
||||
/**
|
||||
* Sets whether or not the drawer is currently shrouded.
|
||||
*
|
||||
* @return false if the operation is not supported, true otherwise.
|
||||
*/
|
||||
boolean setIsShrouded(boolean state);
|
||||
|
||||
Reference in New Issue
Block a user