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;
|
2020-09-07 16:24:04 +02:00
|
|
|
import net.minecraft.potion.EffectInstance;
|
2016-01-05 04:47:35 +01:00
|
|
|
|
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;
|
2020-09-07 16:24:04 +02:00
|
|
|
protected EffectInstance[] effects;
|
2016-01-05 04:47:35 +01:00
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
@Deprecated
|
2020-09-07 16:24:04 +02:00
|
|
|
public CoffeeIngredient(ItemStack input, EffectInstance[] effects, int maxAmplifier) {
|
2018-06-24 02:44:47 +02:00
|
|
|
this(Ingredient.fromStacks(input), maxAmplifier, effects);
|
|
|
|
}
|
2019-02-27 19:53:05 +01:00
|
|
|
|
2020-09-07 16:24:04 +02:00
|
|
|
public CoffeeIngredient(Ingredient input, int maxAmplifier, EffectInstance... effects) {
|
2018-06-24 02:44:47 +02:00
|
|
|
this.input = input;
|
2016-01-05 04:47:35 +01:00
|
|
|
this.effects = effects;
|
|
|
|
this.maxAmplifier = maxAmplifier;
|
|
|
|
}
|
2019-02-27 19:53:05 +01:00
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
public boolean matches(ItemStack stack) {
|
2020-09-07 16:24:04 +02:00
|
|
|
return this.input.test(stack);
|
2018-06-24 02:44:47 +02:00
|
|
|
}
|
2019-02-27 19:53:05 +01:00
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
public Ingredient getInput() {
|
2019-02-27 19:53:05 +01:00
|
|
|
return this.input;
|
2018-06-24 02:44:47 +02:00
|
|
|
}
|
2016-01-05 04:47:35 +01:00
|
|
|
|
2020-09-07 16:24:04 +02:00
|
|
|
public EffectInstance[] 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
|
|
|
}
|
2019-02-27 19:53:05 +01:00
|
|
|
|
2018-06-24 02:44:47 +02:00
|
|
|
public int getMaxAmplifier() {
|
2019-02-27 19:53:05 +01:00
|
|
|
return this.maxAmplifier;
|
2018-06-24 02:44:47 +02:00
|
|
|
}
|
2016-01-05 04:47:35 +01:00
|
|
|
}
|