mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-27 23:45:44 +00:00
Made some more public fields either private or final.
This commit is contained in:
1 parent
756c58d5cb
commit
75032ebf9c
32 files changed
+355
-331
No files matched your search
@@ -5,9 +5,9 @@ import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public abstract class AbstractBrewingRecipe<T> implements IBrewingRecipe {
|
||||
|
||||
public final ItemStack input;
|
||||
public final T ingredient;
|
||||
public final ItemStack output;
|
||||
private final ItemStack input;
|
||||
private final T ingredient;
|
||||
private final ItemStack output;
|
||||
|
||||
protected AbstractBrewingRecipe(ItemStack input, T ingredient, ItemStack output)
|
||||
{
|
||||
@@ -15,12 +15,12 @@ public abstract class AbstractBrewingRecipe<T> implements IBrewingRecipe {
|
||||
this.ingredient = ingredient;
|
||||
this.output = output;
|
||||
|
||||
if (this.input == null || this.ingredient == null || this.output == null)
|
||||
if (this.getInput() == null || this.getIngredient() == null || this.getOutput() == null)
|
||||
{
|
||||
throw new IllegalArgumentException("A brewing recipe cannot have a null parameter.");
|
||||
}
|
||||
|
||||
if (this.input.getMaxStackSize() != 1)
|
||||
if (this.getInput().getMaxStackSize() != 1)
|
||||
{
|
||||
throw new IllegalArgumentException("Inputs must have a max size of 1 just like water bottles. Brewing Stands override the input with the output when the brewing is done, items that stack would end up getting lost.");
|
||||
}
|
||||
@@ -29,12 +29,27 @@ public abstract class AbstractBrewingRecipe<T> implements IBrewingRecipe {
|
||||
@Override
|
||||
public boolean isInput(ItemStack stack)
|
||||
{
|
||||
return OreDictionary.itemMatches(this.input, stack, false);
|
||||
return OreDictionary.itemMatches(this.getInput(), stack, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getOutput(ItemStack input, ItemStack ingredient)
|
||||
{
|
||||
return isInput(input) && isIngredient(ingredient) ? ItemStack.copyItemStack(output) : null;
|
||||
return isInput(input) && isIngredient(ingredient) ? ItemStack.copyItemStack(getOutput()) : null;
|
||||
}
|
||||
|
||||
public ItemStack getInput()
|
||||
{
|
||||
return input;
|
||||
}
|
||||
|
||||
public T getIngredient()
|
||||
{
|
||||
return ingredient;
|
||||
}
|
||||
|
||||
public ItemStack getOutput()
|
||||
{
|
||||
return output;
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ public class BrewingOreRecipe extends AbstractBrewingRecipe<List<ItemStack>> {
|
||||
@Override
|
||||
public boolean isIngredient(ItemStack stack)
|
||||
{
|
||||
for (ItemStack target : this.ingredient)
|
||||
for (ItemStack target : this.getIngredient())
|
||||
{
|
||||
if (OreDictionary.itemMatches(target, stack, false))
|
||||
{
|
||||
|
||||
@@ -13,6 +13,6 @@ public class BrewingRecipe extends AbstractBrewingRecipe<ItemStack> {
|
||||
@Override
|
||||
public boolean isIngredient(ItemStack stack)
|
||||
{
|
||||
return OreDictionary.itemMatches(this.ingredient, stack, false);
|
||||
return OreDictionary.itemMatches(this.getIngredient(), stack, false);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user