mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-21 12:42:26 +00:00
Clean up null issues, add more annotations (#3590)
This commit is contained in:
1 parent
43efa3cfc4
commit
c545b8ecd4
130 files changed
+629
-262
No files matched your search
@@ -24,8 +24,9 @@ import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public abstract class AbstractBrewingRecipe<T> implements IBrewingRecipe {
|
||||
|
||||
public abstract class AbstractBrewingRecipe<T> implements IBrewingRecipe
|
||||
{
|
||||
@Nonnull
|
||||
private final ItemStack input;
|
||||
private final T ingredient;
|
||||
private final ItemStack output;
|
||||
|
||||
@@ -30,18 +30,19 @@ public interface IBrewingRecipe {
|
||||
* being the item that goes in one of the three bottom slots of the brewing
|
||||
* stand (e.g: water bottle)
|
||||
*/
|
||||
public boolean isInput(@Nonnull ItemStack input);
|
||||
boolean isInput(@Nonnull ItemStack input);
|
||||
|
||||
/**
|
||||
* Returns true if the passed ItemStack is an ingredient for this recipe.
|
||||
* "Ingredient" being the item that goes in the top slot of the brewing
|
||||
* stand (e.g: nether wart)
|
||||
*/
|
||||
public boolean isIngredient(@Nonnull ItemStack ingredient);
|
||||
boolean isIngredient(@Nonnull ItemStack ingredient);
|
||||
|
||||
/**
|
||||
* Returns the output when the passed input is brewed with the passed
|
||||
* ingredient. Null if invalid input or ingredient.
|
||||
* ingredient. Empty if invalid input or ingredient.
|
||||
*/
|
||||
public ItemStack getOutput(@Nonnull ItemStack input, @Nonnull ItemStack ingredient);
|
||||
@Nonnull
|
||||
ItemStack getOutput(@Nonnull ItemStack input, @Nonnull ItemStack ingredient);
|
||||
}
|
||||
@@ -58,6 +58,7 @@ public class VanillaBrewingRecipe implements IBrewingRecipe {
|
||||
* or if the new potion is a splash potion when the old one wasn't.
|
||||
*/
|
||||
@Override
|
||||
@Nonnull
|
||||
public ItemStack getOutput(@Nonnull ItemStack input, @Nonnull ItemStack ingredient)
|
||||
{
|
||||
if (!input.isEmpty() && !ingredient.isEmpty() && isIngredient(ingredient))
|
||||
|
||||
Reference in new issue
Block a user