[Feature] Build for 1.19.4
This commit is contained in:
parent
8a8e73348c
commit
55930d73d5
55 changed files with 380 additions and 304 deletions
|
@ -201,10 +201,10 @@ public class AbstractAdvancementRecipe {
|
|||
*
|
||||
* @param recipe The generated recipe that need to be linked to the Advancement
|
||||
*/
|
||||
protected void registerAdvancement(Recipe<?> recipe) {
|
||||
protected void registerAdvancement(Recipe<?> recipe, ItemLike icon) {
|
||||
if (hasUnlockTrigger && generateAdvancement && advancement != null) {
|
||||
advancement
|
||||
.startDisplay(recipe.getResultItem().getItem())
|
||||
.startDisplay(icon)
|
||||
.hideFromChat()
|
||||
.hideToast()
|
||||
.endDisplay()
|
||||
|
|
|
@ -97,6 +97,6 @@ public abstract class AbstractSimpleRecipe<T extends AbstractSimpleRecipe, C ext
|
|||
|
||||
R recipe = buildRecipe();
|
||||
BCLRecipeManager.addRecipe(type, recipe);
|
||||
registerAdvancement(recipe);
|
||||
registerAdvancement(recipe, output);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import org.betterx.bclib.util.ItemUtil;
|
|||
import org.betterx.bclib.util.RecipeHelper;
|
||||
|
||||
import net.minecraft.core.NonNullList;
|
||||
import net.minecraft.core.RegistryAccess;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.tags.TagKey;
|
||||
|
@ -89,7 +90,7 @@ public class AlloyingRecipe implements Recipe<Container>, UnknownReceipBookCateg
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack assemble(Container inv) {
|
||||
public ItemStack assemble(Container inv, RegistryAccess registryAccess) {
|
||||
return this.output.copy();
|
||||
}
|
||||
|
||||
|
@ -99,7 +100,7 @@ public class AlloyingRecipe implements Recipe<Container>, UnknownReceipBookCateg
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getResultItem() {
|
||||
public ItemStack getResultItem(RegistryAccess acc) {
|
||||
return this.output;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,9 +9,11 @@ import org.betterx.worlds.together.tag.v3.CommonItemTags;
|
|||
import org.betterx.worlds.together.world.event.WorldBootstrap;
|
||||
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.core.NonNullList;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.core.RegistryAccess;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.TagParser;
|
||||
|
@ -100,7 +102,7 @@ public class AnvilRecipe implements Recipe<Container>, UnknownReceipBookCategory
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getResultItem() {
|
||||
public ItemStack getResultItem(RegistryAccess acc) {
|
||||
return this.output;
|
||||
}
|
||||
|
||||
|
@ -110,7 +112,7 @@ public class AnvilRecipe implements Recipe<Container>, UnknownReceipBookCategory
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack assemble(@NotNull Container craftingInventory) {
|
||||
public ItemStack assemble(@NotNull Container craftingInventory, RegistryAccess acc) {
|
||||
return this.output.copy();
|
||||
}
|
||||
|
||||
|
@ -155,7 +157,7 @@ public class AnvilRecipe implements Recipe<Container>, UnknownReceipBookCategory
|
|||
return ItemStack.EMPTY;
|
||||
}
|
||||
}
|
||||
return this.assemble(craftingInventory);
|
||||
return this.assemble(craftingInventory, Minecraft.getInstance().level.registryAccess());
|
||||
}
|
||||
|
||||
public boolean checkHammerDurability(Container craftingInventory, Player player) {
|
||||
|
|
|
@ -110,7 +110,7 @@ public class FurnaceRecipe extends AbstractAdvancementRecipe {
|
|||
time
|
||||
);
|
||||
BCLRecipeManager.addRecipe(RecipeType.SMELTING, recipe);
|
||||
registerAdvancement(recipe);
|
||||
registerAdvancement(recipe, output);
|
||||
|
||||
if (blasting) {
|
||||
BlastingRecipe recipe2 = new BlastingRecipe(
|
||||
|
|
|
@ -161,6 +161,6 @@ public class GridRecipe extends AbstractAdvancementRecipe {
|
|||
) : new ShapelessRecipe(id, group, bookCategory, result, materials);
|
||||
|
||||
BCLRecipeManager.addRecipe(type, recipe);
|
||||
registerAdvancement(recipe);
|
||||
registerAdvancement(recipe, output);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,10 +9,11 @@ import net.minecraft.world.item.Item;
|
|||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.item.crafting.RecipeType;
|
||||
import net.minecraft.world.item.crafting.UpgradeRecipe;
|
||||
import net.minecraft.world.item.crafting.SmithingRecipe;
|
||||
import net.minecraft.world.item.crafting.SmithingTransformRecipe;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
|
||||
public class SmithingTableRecipe extends AbstractSimpleRecipe<SmithingTableRecipe, Container, UpgradeRecipe> {
|
||||
public class SmithingTableRecipe extends AbstractSimpleRecipe<SmithingTableRecipe, Container, SmithingRecipe> {
|
||||
protected Ingredient addon;
|
||||
|
||||
protected SmithingTableRecipe(ResourceLocation id, ItemLike output) {
|
||||
|
@ -57,7 +58,7 @@ public class SmithingTableRecipe extends AbstractSimpleRecipe<SmithingTableRecip
|
|||
}
|
||||
|
||||
@Override
|
||||
protected UpgradeRecipe buildRecipe() {
|
||||
return new UpgradeRecipe(id, input, addon, new ItemStack(output, count));
|
||||
protected SmithingRecipe buildRecipe() {
|
||||
return new SmithingTransformRecipe(id, input, addon, null, new ItemStack(output, count));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue