mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
Add Storage Drawer maven
This commit is contained in:
1 parent
10550f656a
commit
40aa8b2f77
44 files changed
+12
-805
No files matched your search
@@ -61,6 +61,14 @@ repositories {
|
||||
name 'buildcraft'
|
||||
url 'https://mod-buildcraft.com/maven/'
|
||||
}
|
||||
maven {
|
||||
name 'thiakil.io'
|
||||
url 'https://thiakil.github.io/maven/'
|
||||
}
|
||||
maven {
|
||||
name 'thiakil mirror' //in case GitHub doesn't like maven being hosted in GH Pages
|
||||
url 'http://maven.thiakil.com'
|
||||
}
|
||||
}
|
||||
|
||||
// Define properties file
|
||||
@@ -95,6 +103,9 @@ dependencies {
|
||||
compile "li.cil.oc:OpenComputers:MC${config.minecraft_version}-${config.opencomputers_version}:api"
|
||||
deobfCompile "mcp.mobius.waila:Hwyla:${config.hwyla_version}"
|
||||
deobfCompile "com.mod-buildcraft:buildcraft-api:${config.buildcraft_version}"
|
||||
compile ("com.jaquadro.minecraft.storagedrawers:StorageDrawers:${config.minecraft_version}-${config.storagedrawers_version}:api") {
|
||||
exclude module: "Chameleon" // we only use the API, which doesn't need Chameleon
|
||||
}
|
||||
}
|
||||
|
||||
processResources
|
||||
|
||||
@@ -9,3 +9,4 @@ invtweak_version=1.62+beta.89
|
||||
opencomputers_version=1.7.0.24
|
||||
hwyla_version=1.8.13-B26_1.11
|
||||
buildcraft_version=7.99.6
|
||||
storagedrawers_version=4.2.10
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.config.IUserConfig;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.registry.IRecipeHandlerRegistry;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.registry.IRenderRegistry;
|
||||
import com.jaquadro.minecraft.storagedrawers.api.registry.IWailaRegistry;
|
||||
|
||||
public interface IStorageDrawersApi
|
||||
{
|
||||
/**
|
||||
* Recipe handlers are used to make custom recipes compatible with compacting drawers.
|
||||
*/
|
||||
IRecipeHandlerRegistry recipeHandlerRegistry ();
|
||||
|
||||
IRenderRegistry renderRegistry ();
|
||||
|
||||
IWailaRegistry wailaRegistry ();
|
||||
|
||||
/**
|
||||
* User-managed configuration for the Storage Drawers mod.
|
||||
*/
|
||||
IUserConfig userConfig ();
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api;
|
||||
|
||||
/**
|
||||
* Entry point for the public API.
|
||||
*/
|
||||
public class StorageDrawersApi
|
||||
{
|
||||
private static IStorageDrawersApi instance;
|
||||
|
||||
public static final String VERSION = "1.10.2-1.3.0";
|
||||
|
||||
/**
|
||||
* API entry point.
|
||||
*
|
||||
* @return The {@link IStorageDrawersApi} instance or null if the API or Storage Drawers is unavailable.
|
||||
*/
|
||||
public static IStorageDrawersApi instance () {
|
||||
if (instance == null) {
|
||||
try {
|
||||
Class classApi = Class.forName( "com.jaquadro.minecraft.storagedrawers.core.Api" );
|
||||
instance = (IStorageDrawersApi) classApi.getField("instance").get(null);
|
||||
}
|
||||
catch (Throwable t) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.config;
|
||||
|
||||
public interface IAddonConfig
|
||||
{
|
||||
/**
|
||||
* Gets whether the user has configured a preference for addon packs to hide their blocks and items from Vanilla
|
||||
* creative tabs.
|
||||
*/
|
||||
boolean showAddonItemsNEI ();
|
||||
|
||||
/**
|
||||
* Gets whether the user has configured a preference for addon packs to hide their blocks and items from NEI.
|
||||
*/
|
||||
boolean showAddonItemsVanilla ();
|
||||
|
||||
/**
|
||||
* Gets whether the user has configured a preference for addon packs to provide their blocks and items through
|
||||
* their own vanilla tab.
|
||||
*/
|
||||
boolean addonItemsUseSeparateTab ();
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.config;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.pack.BlockConfiguration;
|
||||
|
||||
public interface IBlockConfig
|
||||
{
|
||||
String getBlockConfigName (BlockConfiguration blockConfig);
|
||||
|
||||
boolean isBlockEnabled (String blockConfigName);
|
||||
|
||||
int getBlockRecipeOutput (String blockConfigName);
|
||||
|
||||
int getBaseCapacity (String blockConfigName);
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.config;
|
||||
|
||||
public interface IIntegrationConfig
|
||||
{
|
||||
boolean isRefinedRelocationEnabled ();
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.config;
|
||||
|
||||
/**
|
||||
* The main hub for user-managed mod configuration.
|
||||
*/
|
||||
public interface IUserConfig
|
||||
{
|
||||
/**
|
||||
* Configuration options related to third party addon packs for Storage Drawers.
|
||||
*/
|
||||
@Deprecated
|
||||
IAddonConfig addonConfig ();
|
||||
|
||||
/**
|
||||
* Configuration options related to individual blocks.
|
||||
*/
|
||||
IBlockConfig blockConfig ();
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
@API(owner = "StorageDrawersAPI", provides = "StorageDrawersAPI|config", apiVersion = StorageDrawersApi.VERSION)
|
||||
package com.jaquadro.minecraft.storagedrawers.api.config;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.StorageDrawersApi;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.event;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawer;
|
||||
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.
|
||||
*
|
||||
* This event is also called when the drawer is changed to empty.
|
||||
*/
|
||||
public class DrawerPopulatedEvent extends Event
|
||||
{
|
||||
public final IDrawer drawer;
|
||||
|
||||
public DrawerPopulatedEvent (IDrawer drawer) {
|
||||
this.drawer = drawer;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
@API(owner = "StorageDrawersAPI", provides = "StorageDrawersAPI|event", apiVersion = StorageDrawersApi.VERSION)
|
||||
package com.jaquadro.minecraft.storagedrawers.api.event;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.StorageDrawersApi;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.pack;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.storage.EnumBasicDrawer;
|
||||
|
||||
public enum BlockConfiguration
|
||||
{
|
||||
BasicFull1(BlockType.Drawers, EnumBasicDrawer.FULL1),
|
||||
BasicFull2(BlockType.Drawers, EnumBasicDrawer.FULL2),
|
||||
BasicFull4(BlockType.Drawers, EnumBasicDrawer.FULL4),
|
||||
BasicHalf2(BlockType.Drawers, EnumBasicDrawer.HALF2),
|
||||
BasicHalf4(BlockType.Drawers, EnumBasicDrawer.HALF4),
|
||||
Trim(BlockType.Trim, null);
|
||||
|
||||
private final BlockType type;
|
||||
private final EnumBasicDrawer drawer;
|
||||
|
||||
BlockConfiguration (BlockType type, EnumBasicDrawer drawer) {
|
||||
this.type = type;
|
||||
this.drawer = drawer;
|
||||
}
|
||||
|
||||
public BlockType getBlockType () {
|
||||
return type;
|
||||
}
|
||||
|
||||
public int getDrawerCount () {
|
||||
return (drawer != null) ? drawer.getDrawerCount() : 0;
|
||||
}
|
||||
|
||||
public boolean isHalfDepth () {
|
||||
return (drawer != null) && drawer.isHalfDepth();
|
||||
}
|
||||
|
||||
public static BlockConfiguration by (BlockType type, EnumBasicDrawer drawer) {
|
||||
for (BlockConfiguration config : values()) {
|
||||
if (config.type == type && config.drawer == drawer)
|
||||
return config;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.pack;
|
||||
|
||||
public enum BlockType
|
||||
{
|
||||
Drawers,
|
||||
Trim
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.pack;
|
||||
|
||||
public enum TextureType
|
||||
{
|
||||
Front1,
|
||||
Front2,
|
||||
Front4,
|
||||
Side,
|
||||
SideVSplit,
|
||||
SideHSplit,
|
||||
TrimBorder,
|
||||
TrimBlock
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
@API(owner = "StorageDrawersAPI", provides = "StorageDrawersAPI|pack", apiVersion = StorageDrawersApi.VERSION)
|
||||
package com.jaquadro.minecraft.storagedrawers.api.pack;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.StorageDrawersApi;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
@@ -1,4 +0,0 @@
|
||||
@API(owner = "StorageDrawers", provides = "StorageDrawersAPI", apiVersion = StorageDrawersApi.VERSION)
|
||||
package com.jaquadro.minecraft.storagedrawers.api;
|
||||
|
||||
import net.minecraftforge.fml.common.API;
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.registry;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* Ingredient handlers are used to get ItemStacks from ingredients in custom IRecipe implementations. If you have
|
||||
* registered an IRecipeHandler that returns lists of objects that aren't ItemStacks, then you will need to
|
||||
* implement an ingredient handler for those objects.
|
||||
*/
|
||||
public interface IIngredientHandler
|
||||
{
|
||||
/**
|
||||
* Gets an ItemStack from an object that represents an ingredient in an IRecipe.
|
||||
*
|
||||
* @param object An ingredient object.
|
||||
* @return An ItemStack for the given ingredient.
|
||||
*/
|
||||
@Nonnull
|
||||
ItemStack getItemStack (Object object);
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.registry;
|
||||
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Recipe handlers are used by compacting drawers to find more-compressed forms of blocks and items. If your recipe
|
||||
* to craft compressed items is a custom IRecipe implementation, you will need to register a handler for it.
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* 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}.
|
||||
* @return An array of ItemStacks or objects with a registered {@link IIngredientHandler}.
|
||||
*/
|
||||
Object[] getInputAsArray (IRecipe recipe);
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* 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}.
|
||||
* @return A list of ItemStacks or objects with a registered {@link IIngredientHandler}.
|
||||
*/
|
||||
List getInputAsList (IRecipe recipe);
|
||||
}
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.registry;
|
||||
|
||||
public interface IRecipeHandlerRegistry
|
||||
{
|
||||
void registerRecipeHandler (Class clazz, IRecipeHandler handler);
|
||||
|
||||
void registerIngredientHandler (Class clazz, IIngredientHandler handler);
|
||||
|
||||
IRecipeHandler getRecipeHandler (Class clazz);
|
||||
|
||||
IIngredientHandler getIngredientHandler (Class clazz);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.registry;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.render.IRenderLabel;
|
||||
|
||||
public interface IRenderRegistry
|
||||
{
|
||||
void registerPreLabelRenderHandler (IRenderLabel renderHandler);
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.registry;
|
||||
|
||||
public interface IWailaRegistry
|
||||
{
|
||||
void registerTooltipHandler (IWailaTooltipHandler handler);
|
||||
}
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.registry;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawer;
|
||||
|
||||
public interface IWailaTooltipHandler
|
||||
{
|
||||
String transformItemName (IDrawer drawer, String defaultName);
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
@API(owner = "StorageDrawersAPI", provides = "StorageDrawersAPI|registry", apiVersion = StorageDrawersApi.VERSION)
|
||||
package com.jaquadro.minecraft.storagedrawers.api.registry;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.StorageDrawersApi;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.render;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawerGroup;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public interface IRenderLabel
|
||||
{
|
||||
void render (TileEntity tileEntity, IDrawerGroup drawerGroup, int slot, float brightness, float partialTickTime);
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
@API(owner = "StorageDrawersAPI", provides = "StorageDrawersAPI|render", apiVersion = StorageDrawersApi.VERSION)
|
||||
package com.jaquadro.minecraft.storagedrawers.api.render;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.StorageDrawersApi;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.security;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.storage.attribute.IProtectable;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
public interface ISecurityProvider
|
||||
{
|
||||
String getProviderID ();
|
||||
|
||||
boolean hasOwnership (GameProfile profile, IProtectable target);
|
||||
|
||||
boolean hasAccess (GameProfile profile, IProtectable target);
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.storage;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public enum EnumBasicDrawer implements IDrawerGeometry, IStringSerializable
|
||||
{
|
||||
FULL1(0, 1, false, "full1", "fulldrawers1"),
|
||||
FULL2(1, 2, false, "full2", "fulldrawers2"),
|
||||
FULL4(2, 4, false, "full4", "fulldrawers4"),
|
||||
HALF2(3, 2, true, "half2", "halfdrawers2"),
|
||||
HALF4(4, 4, true, "half4", "halfdrawers4");
|
||||
|
||||
private static final EnumBasicDrawer[] META_LOOKUP;
|
||||
|
||||
private final int meta;
|
||||
private final int drawerCount;
|
||||
private final boolean halfDepth;
|
||||
private final String name;
|
||||
private final String unlocalizedName;
|
||||
|
||||
EnumBasicDrawer (int meta, int drawerCount, boolean halfDepth, String name, String unlocalizedName) {
|
||||
this.meta = meta;
|
||||
this.name = name;
|
||||
this.drawerCount = drawerCount;
|
||||
this.halfDepth = halfDepth;
|
||||
this.unlocalizedName = unlocalizedName;
|
||||
}
|
||||
|
||||
public int getMetadata () {
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDrawerCount () {
|
||||
return drawerCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHalfDepth () {
|
||||
return halfDepth;
|
||||
}
|
||||
|
||||
public String getUnlocalizedName () {
|
||||
return unlocalizedName;
|
||||
}
|
||||
|
||||
public static EnumBasicDrawer byMetadata (int meta) {
|
||||
if (meta < 0 || meta >= META_LOOKUP.length)
|
||||
meta = 0;
|
||||
return META_LOOKUP[meta];
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString () {
|
||||
return getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public String getName () {
|
||||
return name;
|
||||
}
|
||||
|
||||
static {
|
||||
META_LOOKUP = new EnumBasicDrawer[values().length];
|
||||
for (EnumBasicDrawer upgrade : values()) {
|
||||
META_LOOKUP[upgrade.getMetadata()] = upgrade;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.storage;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public interface IDrawer
|
||||
{
|
||||
/**
|
||||
* Gets an ItemStack of size 1 representing the type, metadata, and tags of the stored items.
|
||||
* The returned ItemStack should not be modified for any reason. Make a copy if you need to store or modify it.
|
||||
*/
|
||||
@Nonnull
|
||||
ItemStack getStoredItemPrototype ();
|
||||
|
||||
/**
|
||||
* 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 setStoredItem (@Nonnull ItemStack itemPrototype, int amount);
|
||||
|
||||
/**
|
||||
* Gets the number of items stored in this drawer.
|
||||
*/
|
||||
int getStoredItemCount ();
|
||||
|
||||
/**
|
||||
* Sets the number of items stored in this drawer. Triggers syncing of inventories and client data.
|
||||
* Setting a drawer's count to 0 may also result in the item type being cleared, depending in implementation.
|
||||
*
|
||||
* @param amount The new amount of items stored in this drawer.
|
||||
*/
|
||||
void setStoredItemCount (int amount);
|
||||
|
||||
/**
|
||||
* Gets the maximum number of items that can be stored in this drawer.
|
||||
* This value will vary depending on the max stack size of the stored item type.
|
||||
*/
|
||||
int getMaxCapacity ();
|
||||
|
||||
/**
|
||||
* Gets the maximum number of items that could be stored in this drawer if it held the given item.
|
||||
*
|
||||
* @param itemPrototype The item type to query.
|
||||
*/
|
||||
int getMaxCapacity (@Nonnull ItemStack itemPrototype);
|
||||
|
||||
/**
|
||||
* Gets the maxmimum number of items that could be stored in this drawer for a standard item stack size
|
||||
* of 64.
|
||||
*/
|
||||
int getDefaultMaxCapacity ();
|
||||
|
||||
/**
|
||||
* Gets the number of items that could still be added to this drawer before it is full.
|
||||
*/
|
||||
int getRemainingCapacity ();
|
||||
|
||||
/**
|
||||
* Gets the max stack size of the item type stored in this drawer. Convenience method.
|
||||
*/
|
||||
int getStoredItemStackSize ();
|
||||
|
||||
/**
|
||||
* Gets whether or not an item of the given type and data can be stored in this drawer.
|
||||
*
|
||||
* 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.
|
||||
* For drawers that are empty, locking status is considered.
|
||||
*
|
||||
* @param itemPrototype An ItemStack representing the type, metadata, and tags of an item.
|
||||
*/
|
||||
boolean canItemBeStored (@Nonnull ItemStack itemPrototype);
|
||||
|
||||
/**
|
||||
* Gets whether or not an item of the given type and data can be extracted from this drawer.
|
||||
*
|
||||
* This is intended to allow outbound ore-dictionary conversions of compatible items, as defined by what
|
||||
* the drawer considers to be an equivalent item.
|
||||
*
|
||||
* @param itemPrototype An ItemStack representing the type, metadata, and tags of an item.
|
||||
*/
|
||||
boolean canItemBeExtracted (@Nonnull ItemStack itemPrototype);
|
||||
|
||||
/**
|
||||
* Gets whether or not the drawer has items.
|
||||
* A drawer set with an item type and 0 count is not considered empty.
|
||||
*/
|
||||
boolean isEmpty ();
|
||||
|
||||
/**
|
||||
* Gets auxiliary data that has been associated with this drawer.
|
||||
*
|
||||
* @param key The key used to identify the data.
|
||||
* @return An opaque object that was previously stored.
|
||||
*/
|
||||
Object getExtendedData (String key);
|
||||
|
||||
/**
|
||||
* Stores auxiliary data with this drawer, mainly for use in integration.
|
||||
* @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);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.storage;
|
||||
|
||||
public interface IDrawerGeometry
|
||||
{
|
||||
boolean isHalfDepth ();
|
||||
|
||||
int getDrawerCount ();
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.storage;
|
||||
|
||||
public interface IDrawerGroup
|
||||
{
|
||||
/**
|
||||
* Gets the number of drawers contained within this group.
|
||||
*/
|
||||
int getDrawerCount ();
|
||||
|
||||
/**
|
||||
* Gets the drawer at the given slot within this group.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
boolean isDrawerEnabled (int slot);
|
||||
|
||||
boolean markDirtyIfNeeded ();
|
||||
}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.storage;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public interface IDrawerGroupInteractive extends IDrawerGroup
|
||||
{
|
||||
@Nonnull
|
||||
ItemStack takeItemsFromSlot (int slot, int count);
|
||||
|
||||
int putItemsIntoSlot (int slot, @Nonnull ItemStack stack, int count);
|
||||
|
||||
int interactPutCurrentItemIntoSlot (int slot, EntityPlayer player);
|
||||
|
||||
int interactPutCurrentInventoryIntoSlot (int slot, EntityPlayer player);
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.storage;
|
||||
|
||||
/**
|
||||
* Represents a drawer with items that are a fractional component of another item within the drawer group. Compacting
|
||||
* Drawers are a primary example of this drawer type.
|
||||
*/
|
||||
public interface IFractionalDrawer extends IDrawer
|
||||
{
|
||||
/**
|
||||
* Gets the storage ratio between the held item and the most compressed item within the drawer group.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
int getConversionRate ();
|
||||
|
||||
/**
|
||||
* Gets the number of items left in the drawer if the maximum number of equivalent compressed items had been removed.
|
||||
* The equivalency is determined by the next compression tier, and not necessarily the conversion rate.
|
||||
*/
|
||||
int getStoredItemRemainder ();
|
||||
|
||||
/**
|
||||
* Gets whether or not the stored item represents the smallest granularity of material that can be stored within
|
||||
* the drawer group.
|
||||
*/
|
||||
boolean isSmallestUnit ();
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.storage;
|
||||
|
||||
public interface INetworked
|
||||
{
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.storage;
|
||||
|
||||
|
||||
public interface IPriorityGroup
|
||||
{
|
||||
/**
|
||||
* Gets the list of available drawer slots in priority order.
|
||||
*/
|
||||
int[] getAccessibleDrawerSlots ();
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.storage;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public interface ISmartGroup
|
||||
{
|
||||
/**
|
||||
* Gets a lazy enumeration of all slots that will accept at least one item of the given stack, ordered by
|
||||
* insertion preference.
|
||||
*/
|
||||
Iterable<Integer> enumerateDrawersForInsertion (@Nonnull ItemStack stack, boolean strict);
|
||||
|
||||
/**
|
||||
* Gets a lazy enumeration of all slots that will provide at least one item of the given stack, ordered by
|
||||
* extraction preference.
|
||||
*/
|
||||
Iterable<Integer> enumerateDrawersForExtraction (@Nonnull ItemStack stack, boolean strict);
|
||||
}
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.storage.attribute;
|
||||
|
||||
public interface IItemLockable
|
||||
{
|
||||
/**
|
||||
* Gets whether or not a drawer or group is locked for the given lock attribute.
|
||||
*/
|
||||
boolean isItemLocked (LockAttribute attr);
|
||||
|
||||
/**
|
||||
* Gets whether or not the lock state can be changed for the given lock attribute.
|
||||
* If this method returns false, isItemLocked may still return true.
|
||||
*/
|
||||
boolean canItemLock (LockAttribute attr);
|
||||
|
||||
/**
|
||||
* Sets the lock state of a drawer or group for the given lock attribute.
|
||||
* If canItemLock returns false, this is a no-op.
|
||||
*/
|
||||
void setItemLocked (LockAttribute attr, boolean isLocked);
|
||||
}
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.storage.attribute;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.security.ISecurityProvider;
|
||||
import net.minecraft.world.ILockableContainer;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public interface IProtectable
|
||||
{
|
||||
/**
|
||||
* Gets the owner of the drawer, or null if there is no owner.
|
||||
*/
|
||||
UUID getOwner ();
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.storage.attribute;
|
||||
|
||||
public interface IQuantifiable
|
||||
{
|
||||
/**
|
||||
* Gets whether or not the drawer has the quantified attribute.
|
||||
* The quantified attribute instructs the drawer to render its numerical quantity.
|
||||
*/
|
||||
boolean isShowingQuantity ();
|
||||
|
||||
/**
|
||||
* Sets whether or not the drawer is currently quantified.
|
||||
* @return false if the operation is not supported, true otherwise.
|
||||
*/
|
||||
boolean setIsShowingQuantity (boolean state);
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.storage.attribute;
|
||||
|
||||
public interface ISealable
|
||||
{
|
||||
/**
|
||||
* Gets whether or not the drawer has the sealed attribute.
|
||||
* A sealed drawer cannot be interacted with, and when broken will retain all of its items and upgrades.
|
||||
*/
|
||||
boolean isSealed ();
|
||||
|
||||
/**
|
||||
* Sets whether or not the drawer is currently sealed.
|
||||
* @return false if the operation is not supported, true otherwise.
|
||||
*/
|
||||
boolean setIsSealed (boolean state);
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.storage.attribute;
|
||||
|
||||
public interface IShroudable
|
||||
{
|
||||
/**
|
||||
* Gets whether or not the drawer has the shrouded attribute.
|
||||
* The shrouded attribute instructs the drawer to not render its item label.
|
||||
*/
|
||||
boolean isShrouded ();
|
||||
|
||||
/**
|
||||
* Sets whether or not the drawer is currently shrouded.
|
||||
* @return false if the operation is not supported, true otherwise.
|
||||
*/
|
||||
boolean setIsShrouded (boolean state);
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.storage.attribute;
|
||||
|
||||
public interface IVoidable
|
||||
{
|
||||
/**
|
||||
* Gets whether or not the drawer has a voiding attribute.
|
||||
*/
|
||||
boolean isVoid ();
|
||||
}
|
||||
-37
@@ -1,37 +0,0 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.storage.attribute;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
public enum LockAttribute
|
||||
{
|
||||
LOCK_POPULATED,
|
||||
LOCK_EMPTY;
|
||||
|
||||
public int getFlagValue () {
|
||||
return 1 << ordinal();
|
||||
}
|
||||
|
||||
public static int getBitfield (EnumSet<LockAttribute> attributes) {
|
||||
int value = 0;
|
||||
if (attributes == null)
|
||||
return value;
|
||||
|
||||
for (LockAttribute attr : attributes)
|
||||
value |= attr.getFlagValue();
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public static EnumSet<LockAttribute> getEnumSet (int bitfield) {
|
||||
if (bitfield == 0)
|
||||
return null;
|
||||
|
||||
EnumSet<LockAttribute> set = EnumSet.noneOf(LockAttribute.class);
|
||||
for (LockAttribute attr : values()) {
|
||||
if ((bitfield & attr.getFlagValue()) != 0)
|
||||
set.add(attr);
|
||||
}
|
||||
|
||||
return set;
|
||||
}
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
@API(owner = "StorageDrawersAPI", provides = "StorageDrawersAPI|storage-attribute", apiVersion = StorageDrawersApi.VERSION)
|
||||
package com.jaquadro.minecraft.storagedrawers.api.storage.attribute;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.StorageDrawersApi;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
@@ -1,5 +0,0 @@
|
||||
@API(owner = "StorageDrawersAPI", provides = "StorageDrawersAPI|storage", apiVersion = StorageDrawersApi.VERSION)
|
||||
package com.jaquadro.minecraft.storagedrawers.api.storage;
|
||||
|
||||
import com.jaquadro.minecraft.storagedrawers.api.StorageDrawersApi;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
Reference in new issue
Block a user