Update docs

This commit is contained in:
Raoul Van den Berge
2016-10-09 18:56:44 +02:00
parent 3cfeb3a39b
commit 1e6312fd17
12 changed files with 36 additions and 32 deletions

View File

@@ -18,20 +18,24 @@ public interface IProcessable {
ItemStack getStackToInsert(); ItemStack getStackToInsert();
/** /**
* Goes to the next stack to insert. * Moves to the next stack to insert.
*/ */
void nextStack(); void nextStack();
/** /**
* @return whether this processable item has received its items * @return true if we received all outputs, false otherwise
*/ */
boolean hasReceivedOutputs(); boolean hasReceivedOutputs();
/**
* @param i the output to check
* @return true if we received the given output, false otherwise
*/
boolean hasReceivedOutput(int i); boolean hasReceivedOutput(int i);
/** /**
* @param stack the stack that was inserted in the storage system * @param stack the stack that was inserted in the storage system
* @return whether this item belonged to the processable item * @return true if this item belonged to the processable item, false otherwise
*/ */
boolean onReceiveOutput(ItemStack stack); boolean onReceiveOutput(ItemStack stack);
} }

View File

@@ -106,7 +106,7 @@ public interface INetworkMaster {
* Returns crafting patterns from an item stack. * Returns crafting patterns from an item stack.
* *
* @param pattern the stack to get a pattern for * @param pattern the stack to get a pattern for
* @param flags the flags to compare on, see {@link CompareUtils} * @param flags the flags to compare on, see {@link IComparer}
* @return a list of crafting patterns where the given pattern is one of the outputs * @return a list of crafting patterns where the given pattern is one of the outputs
*/ */
List<ICraftingPattern> getPatterns(ItemStack pattern, int flags); List<ICraftingPattern> getPatterns(ItemStack pattern, int flags);
@@ -118,7 +118,7 @@ public interface INetworkMaster {
* It makes this selection based on the item count of the pattern outputs in the system. * It makes this selection based on the item count of the pattern outputs in the system.
* *
* @param pattern the stack to get a pattern for * @param pattern the stack to get a pattern for
* @param flags the flags to compare on, see {@link CompareUtils} * @param flags the flags to compare on, see {@link IComparer}
* @return the pattern, or null if the pattern is not found * @return the pattern, or null if the pattern is not found
*/ */
@Nullable @Nullable
@@ -238,7 +238,7 @@ public interface INetworkMaster {
* *
* @param stack the prototype of the stack to extract, do NOT modify * @param stack the prototype of the stack to extract, do NOT modify
* @param size the amount of that prototype that has to be extracted * @param size the amount of that prototype that has to be extracted
* @param flags the flags to compare on, see {@link CompareUtils} * @param flags the flags to compare on, see {@link IComparer}
* @return null if we didn't extract anything, or a stack with the result * @return null if we didn't extract anything, or a stack with the result
*/ */
@Nullable @Nullable
@@ -271,7 +271,7 @@ public interface INetworkMaster {
* *
* @param stack the prototype of the stack to extract, do NOT modify * @param stack the prototype of the stack to extract, do NOT modify
* @param size the amount of that prototype that has to be extracted * @param size the amount of that prototype that has to be extracted
* @param flags the flags to compare on, see {@link CompareUtils} * @param flags the flags to compare on, see {@link IComparer}
* @return null if we didn't extract anything, or a stack with the result * @return null if we didn't extract anything, or a stack with the result
*/ */
@Nullable @Nullable

View File

@@ -2,6 +2,7 @@ package refinedstorage.api.network.grid;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@@ -12,7 +13,7 @@ public interface IFluidGridHandler {
/** /**
* Called when a player tries to extract a fluid from the grid. * Called when a player tries to extract a fluid from the grid.
* *
* @param hash the hash of the fluid we're trying to extract, see {@link refinedstorage.api.network.NetworkUtils#getFluidStackHashCode(net.minecraftforge.fluids.FluidStack)} * @param hash the hash of the fluid we're trying to extract, see {@link refinedstorage.api.IRSAPI#getFluidStackHashCode(FluidStack)}
* @param shift true if shift click was used, false otherwise * @param shift true if shift click was used, false otherwise
* @param player the player that is attempting the extraction * @param player the player that is attempting the extraction
*/ */

View File

@@ -16,7 +16,7 @@ public interface IItemGridHandler {
/** /**
* Called when a player tries to extract an item from the grid. * Called when a player tries to extract an item from the grid.
* *
* @param hash the hash of the item we're trying to extract, see {@link refinedstorage.api.network.NetworkUtils#getItemStackHashCode(ItemStack)} * @param hash the hash of the item we're trying to extract, see {@link refinedstorage.api.IRSAPI#getItemStackHashCode(ItemStack)}
* @param flags how we are extracting * @param flags how we are extracting
* @param player the player that is attempting the extraction * @param player the player that is attempting the extraction
*/ */
@@ -43,7 +43,7 @@ public interface IItemGridHandler {
/** /**
* Called when a player requests the crafting preview window to be opened. * Called when a player requests the crafting preview window to be opened.
* *
* @param hash the hash of the item we want a preview for, see {@link refinedstorage.api.network.NetworkUtils#getItemStackHashCode(ItemStack)} * @param hash the hash of the item we want a preview for, see {@link refinedstorage.api.IRSAPI#getItemStackHashCode(ItemStack)}
* @param quantity the amount of that item that we need a preview for * @param quantity the amount of that item that we need a preview for
*/ */
void onCraftingPreviewRequested(EntityPlayerMP player, int hash, int quantity); void onCraftingPreviewRequested(EntityPlayerMP player, int hash, int quantity);
@@ -51,7 +51,7 @@ public interface IItemGridHandler {
/** /**
* Called when a player requested crafting for an item. * Called when a player requested crafting for an item.
* *
* @param hash the hash of the item we're requesting crafting for, see {@link refinedstorage.api.network.NetworkUtils#getItemStackHashCode(ItemStack)} * @param hash the hash of the item we're requesting crafting for, see {@link refinedstorage.api.IRSAPI#getItemStackHashCode(ItemStack)}
* @param quantity the amount of that item that has to be crafted * @param quantity the amount of that item that has to be crafted
*/ */
void onCraftingRequested(int hash, int quantity); void onCraftingRequested(int hash, int quantity);

View File

@@ -34,7 +34,7 @@ public interface IFluidStorage {
* *
* @param stack a prototype of the fluid to extract, do NOT modify * @param stack a prototype of the fluid to extract, do NOT modify
* @param size the amount of that fluid that has to be extracted * @param size the amount of that fluid that has to be extracted
* @param flags the flags to compare on, see {@link CompareUtils} * @param flags the flags to compare on, see {@link refinedstorage.api.util.IComparer}
* @return null if we didn't extract anything, or a stack with the result * @return null if we didn't extract anything, or a stack with the result
*/ */
@Nullable @Nullable

View File

@@ -9,7 +9,7 @@ public interface IFluidStorageProvider {
/** /**
* Adds the fluid storages that this storage provider provides. * Adds the fluid storages that this storage provider provides.
* *
* @param storages the previously added fluid storages * @param storages the list to insert new storages to
*/ */
void addFluidStorages(List<IFluidStorage> storages); void addFluidStorages(List<IFluidStorage> storages);
} }

View File

@@ -34,7 +34,7 @@ public interface IItemStorage {
* *
* @param stack a prototype of the stack to extract, do NOT modify * @param stack a prototype of the stack to extract, do NOT modify
* @param size the amount of that prototype that has to be extracted * @param size the amount of that prototype that has to be extracted
* @param flags the flags to compare on, see {@link CompareUtils} * @param flags the flags to compare on, see {@link refinedstorage.api.util.IComparer}
* @return null if we didn't extract anything, or a stack with the result * @return null if we didn't extract anything, or a stack with the result
*/ */
@Nullable @Nullable

View File

@@ -9,7 +9,7 @@ public interface IItemStorageProvider {
/** /**
* Adds the item storages that this storage provider provides. * Adds the item storages that this storage provider provides.
* *
* @param storages the previously added item storages * @param storages the list to insert new storages to
*/ */
void addItemStorages(List<IItemStorage> storages); void addItemStorages(List<IItemStorage> storages);
} }

View File

@@ -11,6 +11,16 @@ public interface IComparer {
int COMPARE_NBT = 2; int COMPARE_NBT = 2;
int COMPARE_QUANTITY = 4; int COMPARE_QUANTITY = 4;
/**
* Compares two stacks by the given flags.
*
* @param left the left stack
* @param right the right stack
* @param flags the flags to compare with
* @return true if the left and right stack are the same, false otherwise
*/
boolean isEqual(ItemStack left, ItemStack right, int flags);
/** /**
* Compares two stacks by NBT, damage and quantity. * Compares two stacks by NBT, damage and quantity.
* *
@@ -32,17 +42,7 @@ public interface IComparer {
default boolean isEqualNoQuantity(ItemStack left, ItemStack right) { default boolean isEqualNoQuantity(ItemStack left, ItemStack right) {
return isEqual(left, right, COMPARE_NBT | COMPARE_DAMAGE); return isEqual(left, right, COMPARE_NBT | COMPARE_DAMAGE);
} }
/**
* Compares two stacks by the given flags.
*
* @param left the left stack
* @param right the right stack
* @param flags the flags to compare with
* @return true if the left and right stack are the same, false otherwise
*/
boolean isEqual(ItemStack left, ItemStack right, int flags);
/** /**
* Compares two stacks by the given flags. * Compares two stacks by the given flags.
* *

View File

@@ -1,6 +1,5 @@
package refinedstorage.api.util; package refinedstorage.api.util;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidStack;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
@@ -54,7 +53,7 @@ public interface IFluidStackList {
* Returns a stack. * Returns a stack.
* *
* @param stack the stack to search for * @param stack the stack to search for
* @param flags the flags to compare on, see {@link refinedstorage.api.storage.CompareUtils} * @param flags the flags to compare on, see {@link IComparer}
* @return the stack, or null if no stack was found * @return the stack, or null if no stack was found
*/ */
@Nullable @Nullable
@@ -63,7 +62,7 @@ public interface IFluidStackList {
/** /**
* Returns a stack. * Returns a stack.
* *
* @param hash the hash of the stack to search for, see {@link refinedstorage.api.network.NetworkUtils#getItemStackHashCode(ItemStack)} * @param hash the hash of the stack to search for, see {@link refinedstorage.api.IRSAPI#getFluidStackHashCode(FluidStack)}
* @return the stack, or null if no stack was found * @return the stack, or null if no stack was found
*/ */
@Nullable @Nullable

View File

@@ -53,7 +53,7 @@ public interface IItemStackList {
* Returns a stack. * Returns a stack.
* *
* @param stack the stack to search for * @param stack the stack to search for
* @param flags the flags to compare on, see {@link refinedstorage.api.storage.CompareUtils} * @param flags the flags to compare on, see {@link IComparer}
* @return the stack, or null if no stack was found * @return the stack, or null if no stack was found
*/ */
@Nullable @Nullable
@@ -62,7 +62,7 @@ public interface IItemStackList {
/** /**
* Returns a stack. * Returns a stack.
* *
* @param hash the hash of the stack to search for, see {@link refinedstorage.api.network.NetworkUtils#getItemStackHashCode(ItemStack)} * @param hash the hash of the stack to search for, see {@link refinedstorage.api.IRSAPI#getItemStackHashCode(ItemStack)}
* @return the stack, or null if no stack was found * @return the stack, or null if no stack was found
*/ */
@Nullable @Nullable

View File

@@ -84,7 +84,7 @@ public class TileDiskDrive extends TileNode implements IItemStorageProvider, IFl
FluidStack result = super.insertFluid(stack, size, simulate); FluidStack result = super.insertFluid(stack, size, simulate);
if (voidExcess && result != null) { if (voidExcess && result != null) {
// Simulate should not matter as the items are voided anyway // Simulate should not matter as the fluids are voided anyway
result.amount = -result.amount; result.amount = -result.amount;
} }