2016-01-05 04:47:35 +01:00
|
|
|
/*
|
2016-05-16 22:52:27 +02:00
|
|
|
* This file ("CoffeeIngredient.java") is part of the Actually Additions mod for Minecraft.
|
2016-01-05 04:47:35 +01:00
|
|
|
* It is created and owned by Ellpeck and distributed
|
|
|
|
* under the Actually Additions License to be found at
|
2016-05-16 22:52:27 +02:00
|
|
|
* http://ellpeck.de/actaddlicense
|
2016-01-05 04:47:35 +01:00
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
*
|
2017-01-01 16:23:26 +01:00
|
|
|
* © 2015-2017 Ellpeck
|
2016-01-05 04:47:35 +01:00
|
|
|
*/
|
|
|
|
|
2016-05-14 13:51:18 +02:00
|
|
|
package de.ellpeck.actuallyadditions.api.recipe;
|
2016-01-05 04:47:35 +01:00
|
|
|
|
2016-05-14 13:51:18 +02:00
|
|
|
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
2016-01-05 04:47:35 +01:00
|
|
|
import net.minecraft.item.ItemStack;
|
2018-06-24 02:44:47 +02:00
|
|
|
import net.minecraft.item.crafting.Ingredient;
|
2016-01-05 04:47:35 +01:00
|
|
|
import net.minecraft.potion.PotionEffect;
|
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
public class CoffeeIngredient {
|
2016-01-05 04:47:35 +01:00
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
protected final Ingredient input;
|
|
|
|
protected final int maxAmplifier;
|
2016-01-05 04:47:35 +01:00
|
|
|
protected PotionEffect[] effects;
|
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
@Deprecated
|
|
|
|
public CoffeeIngredient(ItemStack input, PotionEffect[] effects, int maxAmplifier) {
|
|
|
|
this(Ingredient.fromStacks(input), maxAmplifier, effects);
|
|
|
|
}
|
|
|
|
|
|
|
|
public CoffeeIngredient(Ingredient input, int maxAmplifier, PotionEffect... effects) {
|
|
|
|
this.input = input;
|
2016-01-05 04:47:35 +01:00
|
|
|
this.effects = effects;
|
|
|
|
this.maxAmplifier = maxAmplifier;
|
|
|
|
}
|
2018-06-24 02:44:47 +02:00
|
|
|
|
|
|
|
public boolean matches(ItemStack stack) {
|
|
|
|
return input.apply(stack);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Ingredient getInput() {
|
|
|
|
return input;
|
|
|
|
}
|
2016-01-05 04:47:35 +01:00
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
public PotionEffect[] getEffects() {
|
2016-01-05 04:47:35 +01:00
|
|
|
return this.effects;
|
|
|
|
}
|
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
public boolean effect(ItemStack stack) {
|
2016-05-14 13:51:18 +02:00
|
|
|
return ActuallyAdditionsAPI.methodHandler.addEffectToStack(stack, this);
|
2016-01-05 04:47:35 +01:00
|
|
|
}
|
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
public String getExtraText() {
|
2017-11-02 22:49:53 +01:00
|
|
|
return "";
|
2016-01-05 04:47:35 +01:00
|
|
|
}
|
2018-06-24 02:44:47 +02:00
|
|
|
|
|
|
|
public int getMaxAmplifier() {
|
|
|
|
return maxAmplifier;
|
|
|
|
}
|
2016-01-05 04:47:35 +01:00
|
|
|
}
|