-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix ancient horn crafting and fix chunk loading
- Loading branch information
1 parent
56b5746
commit f59ac40
Showing
6 changed files
with
69 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/main/java/net/frozenblock/wilderwild/misc/recipe/AncientHornRecipe.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package net.frozenblock.wilderwild.misc.recipe; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Optional; | ||
import net.frozenblock.wilderwild.registry.RegisterItems; | ||
import net.minecraft.core.Holder; | ||
import net.minecraft.core.NonNullList; | ||
import net.minecraft.core.RegistryAccess; | ||
import net.minecraft.core.registries.BuiltInRegistries; | ||
import net.minecraft.resources.ResourceKey; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.inventory.CraftingContainer; | ||
import net.minecraft.world.item.Instrument; | ||
import net.minecraft.world.item.InstrumentItem; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.item.Items; | ||
import net.minecraft.world.item.crafting.CraftingBookCategory; | ||
import net.minecraft.world.item.crafting.Ingredient; | ||
import net.minecraft.world.item.crafting.RecipeSerializer; | ||
import net.minecraft.world.item.crafting.ShapedRecipe; | ||
import net.minecraft.world.level.Level; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class AncientHornRecipe extends ShapedRecipe { | ||
|
||
public AncientHornRecipe(ResourceLocation location, CraftingBookCategory category) { | ||
super(location, "wilderwild_ancient_horn", category, 3, 3, | ||
NonNullList.of( | ||
Ingredient.of(RegisterItems.ANCIENT_HORN_FRAGMENT), Ingredient.of(Items.GOLD_INGOT), Ingredient.of(RegisterItems.ANCIENT_HORN_FRAGMENT), | ||
Ingredient.of(RegisterItems.ANCIENT_HORN_FRAGMENT), Ingredient.of(Items.ECHO_SHARD), Ingredient.of(RegisterItems.ANCIENT_HORN_FRAGMENT), | ||
Ingredient.of(Items.ECHO_SHARD), Ingredient.of(RegisterItems.ANCIENT_HORN_FRAGMENT), Ingredient.of(Items.ECHO_SHARD) | ||
), new ItemStack(RegisterItems.COPPER_HORN) | ||
); | ||
} | ||
|
||
@Override | ||
public ItemStack assemble(CraftingContainer container, RegistryAccess registryAccess) { | ||
return InstrumentItem.create(super.assemble(container, registryAccess).getItem(), BuiltInRegistries.INSTRUMENT.getHolderOrThrow(RegisterItems.ANCIENT_HORN_INSTRUMENT)); | ||
} | ||
|
||
@Override | ||
public boolean isSpecial() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public RecipeSerializer<?> getSerializer() { | ||
return RegisterItems.ANCIENT_HORN_CRAFTING; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 2 additions & 24 deletions
26
src/main/resources/data/wilderwild/recipes/ancient_horn.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,5 @@ | ||
{ | ||
"type": "minecraft:crafting_shaped", | ||
"type": "wilderwild:crafting_ancient_horn", | ||
"category": "equipment", | ||
"group": "ancient_horn", | ||
"key": { | ||
"#": { | ||
"item": "wilderwild:ancient_horn_fragment" | ||
}, | ||
"I": { | ||
"item": "minecraft:echo_shard" | ||
}, | ||
"G": { | ||
"item": "minecraft:gold_ingot" | ||
} | ||
}, | ||
"pattern": [ | ||
"#G#", | ||
"#I#", | ||
"I#I" | ||
], | ||
"result": { | ||
"item": "wilderwild:ancient_horn", | ||
"data": { | ||
"instrument": "wilderwild:ancient_horn" | ||
} | ||
} | ||
"group": "wilderwild_ancient_horn" | ||
} |