Update storage drawers API
This commit is contained in:
		@@ -15,6 +15,7 @@
 | 
				
			|||||||
- Fixed items with colored name being uncolored in Grid (raoulvdberge)
 | 
					- Fixed items with colored name being uncolored in Grid (raoulvdberge)
 | 
				
			||||||
- Fixed fluid rendering bugging out side buttons (raoulvdberge)
 | 
					- Fixed fluid rendering bugging out side buttons (raoulvdberge)
 | 
				
			||||||
- Fixed item count going negative in some cases (raoulvdberge)
 | 
					- Fixed item count going negative in some cases (raoulvdberge)
 | 
				
			||||||
 | 
					- Updated Storage Drawers API (raoulvdberge)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### 1.1.3
 | 
					### 1.1.3
 | 
				
			||||||
- Fixed some clients not starting up due to too many Disk Drive model permutations (raoulvdberge)
 | 
					- Fixed some clients not starting up due to too many Disk Drive model permutations (raoulvdberge)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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 {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,9 +9,7 @@ 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();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
package com.jaquadro.minecraft.storagedrawers.api.pack;/*package com.jaquadro.minecraft.storagedrawers.api.pack;
 | 
					/*package com.jaquadro.minecraft.storagedrawers.api.pack;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import net.minecraft.block.Block;
 | 
					import net.minecraft.block.Block;
 | 
				
			||||||
import net.minecraft.creativetab.CreativeTabs;
 | 
					import net.minecraft.creativetab.CreativeTabs;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
package com.jaquadro.minecraft.storagedrawers.api.pack;/*package com.jaquadro.minecraft.storagedrawers.api.pack;
 | 
					/*package com.jaquadro.minecraft.storagedrawers.api.pack;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import net.minecraft.block.Block;
 | 
					import net.minecraft.block.Block;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
package com.jaquadro.minecraft.storagedrawers.api.pack;/*package com.jaquadro.minecraft.storagedrawers.api.pack;
 | 
					/*package com.jaquadro.minecraft.storagedrawers.api.pack;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public interface IPackBlock
 | 
					public interface IPackBlock
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
package com.jaquadro.minecraft.storagedrawers.api.pack;/*package com.jaquadro.minecraft.storagedrawers.api.pack;
 | 
					/*package com.jaquadro.minecraft.storagedrawers.api.pack;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import net.minecraft.block.Block;
 | 
					import net.minecraft.block.Block;
 | 
				
			||||||
import net.minecraft.item.ItemBlock;
 | 
					import net.minecraft.item.ItemBlock;
 | 
				
			||||||
@@ -23,11 +23,13 @@ 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);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Registers block metadata from an initialized DataResolver with Storage Drawers.
 | 
					 * 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).
 | 
					     * 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}.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,9 +21,20 @@ public interface IDrawer {
 | 
				
			|||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param itemPrototype An ItemStack representing the type, metadata, and tags of the item to store.
 | 
					     * @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
 | 
				
			||||||
    void setStoredItem(ItemStack itemPrototype, int amount);
 | 
					    void setStoredItem(ItemStack itemPrototype, int amount);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 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.
 | 
				
			||||||
 | 
					     * @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);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Gets the number of items stored in this drawer.
 | 
					     * Gets the number of items stored in this drawer.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
@@ -62,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.
 | 
				
			||||||
@@ -74,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.
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
@@ -98,7 +109,6 @@ 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.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,20 +1,20 @@
 | 
				
			|||||||
package com.jaquadro.minecraft.storagedrawers.api.storage.attribute;
 | 
					package com.jaquadro.minecraft.storagedrawers.api.storage.attribute;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public interface ILockable {
 | 
					public interface IItemLockable {
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Gets whether or not a drawer or group is locked for the given lock attribute.
 | 
					     * Gets whether or not a drawer or group is locked for the given lock attribute.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    boolean isLocked(LockAttribute attr);
 | 
					    boolean isItemLocked(LockAttribute attr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Gets whether or not the lock state can be changed for the given lock attribute.
 | 
					     * Gets whether or not the lock state can be changed for the given lock attribute.
 | 
				
			||||||
     * If this method returns false, isLocked may still return true.
 | 
					     * If this method returns false, isItemLocked may still return true.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    boolean canLock(LockAttribute attr);
 | 
					    boolean canItemLock(LockAttribute attr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Sets the lock state of a drawer or group for the given lock attribute.
 | 
					     * Sets the lock state of a drawer or group for the given lock attribute.
 | 
				
			||||||
     * If canLock returns false, this is a no-op.
 | 
					     * If canItemLock returns false, this is a no-op.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    void setLocked(LockAttribute attr, boolean isLocked);
 | 
					    void setItemLocked(LockAttribute attr, boolean isLocked);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -1,6 +1,7 @@
 | 
				
			|||||||
package com.jaquadro.minecraft.storagedrawers.api.storage.attribute;
 | 
					package com.jaquadro.minecraft.storagedrawers.api.storage.attribute;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.jaquadro.minecraft.storagedrawers.api.security.ISecurityProvider;
 | 
					import com.jaquadro.minecraft.storagedrawers.api.security.ISecurityProvider;
 | 
				
			||||||
 | 
					import net.minecraft.world.ILockableContainer;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.util.UUID;
 | 
					import java.util.UUID;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -12,21 +13,24 @@ 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.
 | 
				
			||||||
 | 
					     * @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.
 | 
					     * 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);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,7 +9,6 @@ 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);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,7 +9,6 @@ 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);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user