Added annotations to a few places
This commit is contained in:
@@ -2,19 +2,24 @@ package refinedstorage.api.solderer;
|
|||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a recipe in the solderer.
|
* Represents a recipe in the solderer.
|
||||||
*/
|
*/
|
||||||
public interface ISoldererRecipe {
|
public interface ISoldererRecipe {
|
||||||
/**
|
/**
|
||||||
* @param row The solderer row (between 0 - 2)
|
* @param row The solderer row (between 0 - 2)
|
||||||
* @return A stack for the given row, can be null for an empty row
|
* @return A stack for the given row
|
||||||
*/
|
*/
|
||||||
|
@Nullable
|
||||||
ItemStack getRow(int row);
|
ItemStack getRow(int row);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The stack that this recipe gives back
|
* @return The stack that this recipe gives back
|
||||||
*/
|
*/
|
||||||
|
@Nonnull
|
||||||
ItemStack getResult();
|
ItemStack getResult();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.google.common.collect.ImmutableList;
|
|||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
import refinedstorage.RefinedStorageUtils;
|
import refinedstorage.RefinedStorageUtils;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -18,7 +19,7 @@ public class SoldererRegistry {
|
|||||||
*
|
*
|
||||||
* @param recipe
|
* @param recipe
|
||||||
*/
|
*/
|
||||||
public static void addRecipe(ISoldererRecipe recipe) {
|
public static void addRecipe(@Nonnull ISoldererRecipe recipe) {
|
||||||
recipes.add(recipe);
|
recipes.add(recipe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,7 +34,7 @@ public class SoldererRegistry {
|
|||||||
* @param items An item handler, where slots 0 - 2 are the row slots
|
* @param items An item handler, where slots 0 - 2 are the row slots
|
||||||
* @return The recipe
|
* @return The recipe
|
||||||
*/
|
*/
|
||||||
public static ISoldererRecipe getRecipe(IItemHandler items) {
|
public static ISoldererRecipe getRecipe(@Nonnull IItemHandler items) {
|
||||||
for (ISoldererRecipe recipe : recipes) {
|
for (ISoldererRecipe recipe : recipes) {
|
||||||
boolean found = true;
|
boolean found = true;
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package refinedstorage.api.storage;
|
|||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -23,9 +24,9 @@ public interface IStorage {
|
|||||||
* @param stack The stack prototype to push, do NOT modify
|
* @param stack The stack prototype to push, do NOT modify
|
||||||
* @param size The amount of that prototype that has to be pushed
|
* @param size The amount of that prototype that has to be pushed
|
||||||
* @param simulate If we are simulating
|
* @param simulate If we are simulating
|
||||||
* @return null if the push was successful, or an ItemStack with the remainder
|
* @return null if the push was successful, or a {@link ItemStack} with the remainder
|
||||||
*/
|
*/
|
||||||
ItemStack push(ItemStack stack, int size, boolean simulate);
|
ItemStack push(@Nonnull ItemStack stack, int size, boolean simulate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Takes an item from storage.
|
* Takes an item from storage.
|
||||||
@@ -35,9 +36,9 @@ public interface IStorage {
|
|||||||
* @param stack A prototype of the stack to take, do NOT modify
|
* @param stack A prototype of the stack to take, do NOT modify
|
||||||
* @param size The amount of that prototype that has to be taken
|
* @param size The amount of that prototype that has to be taken
|
||||||
* @param flags On what we are comparing to take the item, see {@link CompareFlags}
|
* @param flags On what we are comparing to take the item, see {@link CompareFlags}
|
||||||
* @return null if we didn't take anything, or an ItemStack with the take result
|
* @return null if we didn't take anything, or a {@link ItemStack} with the result
|
||||||
*/
|
*/
|
||||||
ItemStack take(ItemStack stack, int size, int flags);
|
ItemStack take(@Nonnull ItemStack stack, int size, int flags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The amount of items stored in this storage
|
* @return The amount of items stored in this storage
|
||||||
|
|||||||
Reference in New Issue
Block a user