|
@@ -22,24 +22,21 @@ import java.util.List;
|
|
@Mixin(BrewingRecipeRegistry.class)
|
|
@Mixin(BrewingRecipeRegistry.class)
|
|
public class MixinBrewingRecipeRegistry {
|
|
public class MixinBrewingRecipeRegistry {
|
|
|
|
|
|
- private static final List<BrewingRecipe> ITEM_RECIPES = Lists.newArrayList();
|
|
|
|
|
|
+ private static final List<BrewingRecipe> SELF_ITEM_RECIPES = Lists.newArrayList();
|
|
private static final List<Potion> REGISTERED_POTION_TYPES = Lists.newArrayList();
|
|
private static final List<Potion> REGISTERED_POTION_TYPES = Lists.newArrayList();
|
|
- private static final List<Ingredient> POTION_TYPES = Lists.newArrayList();
|
|
|
|
|
|
+ private static final List<Ingredient> SELF_POTION_TYPES = Lists.newArrayList();
|
|
|
|
|
|
@Inject(method = "method_8080", at = @At("RETURN"))
|
|
@Inject(method = "method_8080", at = @At("RETURN"))
|
|
private static void method_8080(Item item_1, CallbackInfo ci) {
|
|
private static void method_8080(Item item_1, CallbackInfo ci) {
|
|
- if (!(item_1 instanceof PotionItem)) {
|
|
|
|
- } else {
|
|
|
|
- POTION_TYPES.add(Ingredient.ofItems(new ItemProvider[]{item_1}));
|
|
|
|
|
|
+ if (item_1 instanceof PotionItem) {
|
|
|
|
+ SELF_POTION_TYPES.add(Ingredient.ofItems(new ItemProvider[]{item_1}));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@Inject(method = "method_8071", at = @At("RETURN"))
|
|
@Inject(method = "method_8071", at = @At("RETURN"))
|
|
private static void method_8071(Item item_1, Item item_2, Item item_3, CallbackInfo ci) {
|
|
private static void method_8071(Item item_1, Item item_2, Item item_3, CallbackInfo ci) {
|
|
- if (!(item_1 instanceof PotionItem)) {
|
|
|
|
- } else if (!(item_3 instanceof PotionItem)) {
|
|
|
|
- } else {
|
|
|
|
- ITEM_RECIPES.add(new BrewingRecipe(item_1, Ingredient.ofItems(new ItemProvider[]{item_2}), item_3));
|
|
|
|
|
|
+ if (item_1 instanceof PotionItem && item_3 instanceof PotionItem) {
|
|
|
|
+ SELF_ITEM_RECIPES.add(new BrewingRecipe(item_1, Ingredient.ofItems(new ItemProvider[]{item_2}), item_3));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -49,7 +46,7 @@ public class MixinBrewingRecipeRegistry {
|
|
registerPotionType(potion_1);
|
|
registerPotionType(potion_1);
|
|
if (!REGISTERED_POTION_TYPES.contains(potion_2))
|
|
if (!REGISTERED_POTION_TYPES.contains(potion_2))
|
|
registerPotionType(potion_2);
|
|
registerPotionType(potion_2);
|
|
- POTION_TYPES.forEach(ingredient -> {
|
|
|
|
|
|
+ SELF_POTION_TYPES.forEach(ingredient -> {
|
|
for(ItemStack stack : ingredient.getStackArray()) {
|
|
for(ItemStack stack : ingredient.getStackArray()) {
|
|
DefaultPlugin.registerBrewingDisplay(new DefaultBrewingDisplay(PotionUtil.setPotion(stack.copy(), potion_1), Ingredient.ofItems(new ItemProvider[]{item_1}),
|
|
DefaultPlugin.registerBrewingDisplay(new DefaultBrewingDisplay(PotionUtil.setPotion(stack.copy(), potion_1), Ingredient.ofItems(new ItemProvider[]{item_1}),
|
|
PotionUtil.setPotion(stack.copy(), potion_2)));
|
|
PotionUtil.setPotion(stack.copy(), potion_2)));
|
|
@@ -59,7 +56,7 @@ public class MixinBrewingRecipeRegistry {
|
|
|
|
|
|
private static void registerPotionType(Potion potion) {
|
|
private static void registerPotionType(Potion potion) {
|
|
REGISTERED_POTION_TYPES.add(potion);
|
|
REGISTERED_POTION_TYPES.add(potion);
|
|
- ITEM_RECIPES.forEach(recipe -> {
|
|
|
|
|
|
+ SELF_ITEM_RECIPES.forEach(recipe -> {
|
|
DefaultPlugin.registerBrewingDisplay(new DefaultBrewingDisplay(PotionUtil.setPotion(recipe.input.getDefaultStack(), potion), recipe.ingredient,
|
|
DefaultPlugin.registerBrewingDisplay(new DefaultBrewingDisplay(PotionUtil.setPotion(recipe.input.getDefaultStack(), potion), recipe.ingredient,
|
|
PotionUtil.setPotion(recipe.output.getDefaultStack(), potion)));
|
|
PotionUtil.setPotion(recipe.output.getDefaultStack(), potion)));
|
|
});
|
|
});
|