mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-01 11:36:43 +01:00
Added recipes for all the gems and items
This commit is contained in:
parent
33534ecea5
commit
497b0f03b5
16 changed files with 234 additions and 5 deletions
|
@ -14,13 +14,16 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry.Impl;
|
||||
|
||||
public class SpellRecipe extends Impl<IRecipe> implements IRecipe {
|
||||
|
||||
private String spellId;
|
||||
private final ResourceLocation spellitem;
|
||||
|
||||
private final String spellId;
|
||||
|
||||
private final NonNullList<RecipeItem> ingredients;
|
||||
|
||||
|
@ -52,11 +55,17 @@ public class SpellRecipe extends Impl<IRecipe> implements IRecipe {
|
|||
|
||||
String spellId = json.get("spell").getAsString();
|
||||
|
||||
return new SpellRecipe(spellId, ingredients);
|
||||
Item spellitem = json.has("item") ? Item.getByNameOrId(json.get("item").getAsString()) : null;
|
||||
if (spellitem == null) {
|
||||
spellitem = UItems.spell;
|
||||
}
|
||||
|
||||
return new SpellRecipe(spellitem, spellId, ingredients);
|
||||
}
|
||||
|
||||
public SpellRecipe(String spellName, NonNullList<RecipeItem> ingredients) {
|
||||
spellId = spellName;
|
||||
public SpellRecipe(Item spellitem, String spellName, NonNullList<RecipeItem> ingredients) {
|
||||
this.spellitem = spellitem.getRegistryName();
|
||||
this.spellId = spellName;
|
||||
this.ingredients = ingredients;
|
||||
}
|
||||
|
||||
|
@ -64,7 +73,11 @@ public class SpellRecipe extends Impl<IRecipe> implements IRecipe {
|
|||
public boolean matches(InventoryCrafting inv, World worldIn) {
|
||||
ItemStack enchantedStack = ((InventorySpellBook)inv).getCraftResultMatrix().getStackInSlot(0);
|
||||
|
||||
if (enchantedStack.isEmpty()) {
|
||||
if (enchantedStack.isEmpty() || enchantedStack.getItem() == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!spellitem.equals(enchantedStack.getItem().getRegistryName())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
{ "item": "minecraft:redstone" }
|
||||
],
|
||||
"result": {
|
||||
"item": "unicopia:gem",
|
||||
"spell": "charge"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"type": "unicopia:crafting_spell",
|
||||
"ingredients": [
|
||||
{ "item": "unicopia:gem", "spell": "charge" },
|
||||
{ "item": "unicopia:corrupted_gem" },
|
||||
{ "item": "minecraft:red_flower", "data": 0 }
|
||||
],
|
||||
"result": {
|
||||
"item": "unicopia:gem",
|
||||
"spell": "drake"
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@
|
|||
{ "item": "minecraft:lava_bucket" }
|
||||
],
|
||||
"result": {
|
||||
"item": "unicopia:gem",
|
||||
"spell": "fire"
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@
|
|||
{ "item": "minecraft:water_bucket" }
|
||||
],
|
||||
"result": {
|
||||
"item": "unicopia:gem",
|
||||
"spell": "ice"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"type": "unicopia:crafting_spell",
|
||||
"ingredients": [
|
||||
{ "item": "unicopia:gem", "spell": "fire" },
|
||||
{ "item": "minecraft:redstone" },
|
||||
{ "item": "minecraft:lava_bucket" }
|
||||
],
|
||||
"result": {
|
||||
"item": "unicopia:corrupted_gem",
|
||||
"spell": "inferno"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"type": "unicopia:crafting_spell",
|
||||
"ingredients": [
|
||||
{ "item": "minecraft:glowstone_dust" },
|
||||
{ "item": "unicopia:gem", "spell": "fire" },
|
||||
{ "item": "unicopia:apple_green" }
|
||||
],
|
||||
"result": {
|
||||
"item": "unicopia:gem",
|
||||
"spell": "light"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"type": "unicopia:crafting_spell",
|
||||
"ingredients": [
|
||||
{ "item": "minecraft:dye", "data": 1 },
|
||||
{ "item": "minecraft:redstone" },
|
||||
{ "item": "minecraft:rotten_flesh" }
|
||||
],
|
||||
"result": {
|
||||
"item": "unicopia:corrupted_gem",
|
||||
"spell": "necromancy"
|
||||
}
|
||||
}
|
|
@ -7,6 +7,7 @@
|
|||
{ "item": "unicopia:gem", "spell": "fire" }
|
||||
],
|
||||
"result": {
|
||||
"item": "unicopia:gem",
|
||||
"spell": "portal"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"type": "unicopia:crafting_spell",
|
||||
"ingredients": [
|
||||
{ "item": "minecraft:firework_charge" },
|
||||
{ "item": "minecraft:fire_charge" },
|
||||
{ "item": "unicopia:gem", "spell": "shield" },
|
||||
{ "item": "minecraft:egg" }
|
||||
],
|
||||
"result": {
|
||||
"item": "unicopia:corrupted_gem",
|
||||
"spell": "shield"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"type": "unicopia:crafting_spell",
|
||||
"ingredients": [
|
||||
{ "item": "unicopia:gem", "spell": "light" },
|
||||
{ "item": "unicopia:gem", "spell": "charge" },
|
||||
{ "item": "unicopia:gem", "spell": "light" }
|
||||
],
|
||||
"result": {
|
||||
"item": "unicopia:gem",
|
||||
"spell": "reveal"
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@
|
|||
{ "item": "minecraft:blaze_powder" }
|
||||
],
|
||||
"result": {
|
||||
"item": "unicopia:gem",
|
||||
"spell": "shield"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"type": "unicopia:crafting_spell",
|
||||
"ingredients": [
|
||||
{ "item": "minecraft:fire_charge" },
|
||||
{ "item": "unicopia:gem", "spell": "fire" }
|
||||
],
|
||||
"result": {
|
||||
"item": "unicopia:corrupted_gem",
|
||||
"spell": "vortex"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"type": "unicopia:crafting_spell",
|
||||
"ingredients": [
|
||||
{ "item": "minecraft:egg" },
|
||||
{ "item": "unicopia:gem", "spell": "shield" },
|
||||
{ "item": "unicopia:gem", "spell": "portal" }
|
||||
],
|
||||
"result": {
|
||||
"item": "unicopia:gem",
|
||||
"spell": "vortex"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"*D~",
|
||||
"#$#",
|
||||
" # "
|
||||
],
|
||||
"key": {
|
||||
"#": [
|
||||
{ "item": "unicopia:corrupted_gem" }
|
||||
],
|
||||
"D": [
|
||||
{ "item": "minecraft:diamond" }
|
||||
],
|
||||
"*": [
|
||||
{ "item": "unicopia:corrupted_gem", "nbt": { "spell": "inferno" } }
|
||||
],
|
||||
"$": [
|
||||
{ "item": "unicopia:corrupted_gem", "nbt": { "spell": "darkness" } }
|
||||
],
|
||||
"~": [
|
||||
{ "item": "unicopia:corrupted_gem", "nbt": { "spell": "necromancy" } }
|
||||
]
|
||||
},
|
||||
"result": { "item": "unicopia:alicorn_amulet" }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
62
src/main/resources/assets/unicopia/recipes/gem_2.json
Normal file
62
src/main/resources/assets/unicopia/recipes/gem_2.json
Normal file
|
@ -0,0 +1,62 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"SCB",
|
||||
"CSC",
|
||||
"BCS"
|
||||
],
|
||||
"key": {
|
||||
"S": [
|
||||
{ "item": "minecraft:stone", "data": 3 }
|
||||
],
|
||||
"C": [
|
||||
{ "item": "minecraft:stained_hardenned_clay", "data": 0 },
|
||||
{ "item": "minecraft:stained_hardenned_clay", "data": 1 },
|
||||
{ "item": "minecraft:stained_hardenned_clay", "data": 2 },
|
||||
{ "item": "minecraft:stained_hardenned_clay", "data": 3 },
|
||||
{ "item": "minecraft:stained_hardenned_clay", "data": 4 },
|
||||
{ "item": "minecraft:stained_hardenned_clay", "data": 5 },
|
||||
{ "item": "minecraft:stained_hardenned_clay", "data": 6 },
|
||||
{ "item": "minecraft:stained_hardenned_clay", "data": 7 },
|
||||
{ "item": "minecraft:stained_hardenned_clay", "data": 8 },
|
||||
{ "item": "minecraft:stained_hardenned_clay", "data": 9 },
|
||||
{ "item": "minecraft:stained_hardenned_clay", "data": 10 },
|
||||
{ "item": "minecraft:stained_hardenned_clay", "data": 11 },
|
||||
{ "item": "minecraft:stained_hardenned_clay", "data": 12 },
|
||||
{ "item": "minecraft:stained_hardenned_clay", "data": 13 },
|
||||
{ "item": "minecraft:stained_hardenned_clay", "data": 14 },
|
||||
{ "item": "minecraft:stained_hardenned_clay", "data": 15 }
|
||||
],
|
||||
"S": [
|
||||
{ "item": "minecraft:dye", "data": 15 }
|
||||
]
|
||||
},
|
||||
"result": { "item": "unicopia:gem", "count": 4 }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in a new issue