Peach blocks and Peach forest
Elka, Glimmer, Deer Toned down alpha mantis spawns Increased uranium and titanium spawn by 25% Overhauled red ant nest and pale nyxite texture Fixed Ant Nests not spawning on Fabric Fixed armor trims not working on antarchy armors Fixed antarchy materials not working as armor trims Adding missing hanging sign gui texture files HFCS Root beer Elythia frog Roseate and Lumen froglight
This commit is contained in:
1 parent
89d9aff0b9
commit
79cbc454e6
561 files changed
+22472
-3149
No files matched your search
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (c) Forge Development LLC and contributors
|
||||
* SPDX-License-Identifier: LGPL-2.1-only
|
||||
*/
|
||||
|
||||
package net.neoforged.neoforge.common.brewing;
|
||||
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
|
||||
public class BrewingRecipe implements IBrewingRecipe {
|
||||
private final Ingredient input;
|
||||
private final Ingredient ingredient;
|
||||
private final ItemStack output;
|
||||
|
||||
public BrewingRecipe(Ingredient input, Ingredient ingredient, ItemStack output) {
|
||||
this.input = input;
|
||||
this.ingredient = ingredient;
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInput(ItemStack stack) {
|
||||
return this.input.test(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getOutput(ItemStack input, ItemStack ingredient) {
|
||||
return isInput(input) && isIngredient(ingredient) ? getOutput().copy() : ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
public Ingredient getInput() {
|
||||
return input;
|
||||
}
|
||||
|
||||
public Ingredient getIngredient() {
|
||||
return ingredient;
|
||||
}
|
||||
|
||||
public ItemStack getOutput() {
|
||||
return output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isIngredient(ItemStack ingredient) {
|
||||
return this.ingredient.test(ingredient);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) Forge Development LLC and contributors
|
||||
* SPDX-License-Identifier: LGPL-2.1-only
|
||||
*/
|
||||
|
||||
package net.neoforged.neoforge.common.brewing;
|
||||
|
||||
import static net.minecraft.world.item.alchemy.PotionBrewing.Builder;
|
||||
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.neoforged.neoforge.event.brewing.RegisterBrewingRecipesEvent;
|
||||
|
||||
/**
|
||||
* Interface for more flexible brewing recipes.
|
||||
*
|
||||
* <p>Register using {@link RegisterBrewingRecipesEvent} and {@link Builder#addRecipe(IBrewingRecipe)}.
|
||||
*/
|
||||
public interface IBrewingRecipe {
|
||||
/**
|
||||
* Returns true is the passed ItemStack is an input for this recipe. "Input"
|
||||
* being the item that goes in one of the three bottom slots of the brewing
|
||||
* stand (e.g: water bottle)
|
||||
*/
|
||||
boolean isInput(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)
|
||||
*/
|
||||
boolean isIngredient(ItemStack ingredient);
|
||||
|
||||
/**
|
||||
* Returns the output when the passed input is brewed with the passed
|
||||
* ingredient. Empty if invalid input or ingredient.
|
||||
*/
|
||||
ItemStack getOutput(ItemStack input, ItemStack ingredient);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) NeoForged and contributors
|
||||
* SPDX-License-Identifier: LGPL-2.1-only
|
||||
*/
|
||||
|
||||
package net.neoforged.neoforge.event.brewing;
|
||||
|
||||
import net.minecraft.core.RegistryAccess;
|
||||
import net.minecraft.world.item.alchemy.PotionBrewing;
|
||||
import net.neoforged.bus.api.Event;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
/**
|
||||
* Event to register new brewing recipes.
|
||||
*
|
||||
* <p>Fired on both client and server side, on the main event bus.
|
||||
*/
|
||||
public class RegisterBrewingRecipesEvent extends Event {
|
||||
private final PotionBrewing.Builder builder;
|
||||
private final RegistryAccess registryAccess;
|
||||
|
||||
@ApiStatus.Internal
|
||||
public RegisterBrewingRecipesEvent(PotionBrewing.Builder builder, RegistryAccess registryAccess) {
|
||||
this.builder = builder;
|
||||
this.registryAccess = registryAccess;
|
||||
}
|
||||
|
||||
public PotionBrewing.Builder getBuilder() {
|
||||
return builder;
|
||||
}
|
||||
|
||||
public RegistryAccess getRegistryAccess() {
|
||||
return registryAccess;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user