mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-25 06:04:32 +01:00
Added recipes for al of the current gems
This commit is contained in:
parent
e1e719f17f
commit
3f9029098e
5 changed files with 49 additions and 8 deletions
|
@ -31,13 +31,22 @@ public class SpellRecipe extends Impl<IRecipe> implements IRecipe {
|
||||||
for (JsonElement i : json.get("ingredients").getAsJsonArray()) {
|
for (JsonElement i : json.get("ingredients").getAsJsonArray()) {
|
||||||
JsonObject o = i.getAsJsonObject();
|
JsonObject o = i.getAsJsonObject();
|
||||||
|
|
||||||
Item item = Item.getByNameOrId(o.get("item").getAsString());
|
Item item = o.has("item") ? Item.getByNameOrId(o.get("item").getAsString()) : null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
int metadata = Math.max(0, o.has("data") ? o.get("data").getAsInt() : 0);
|
int metadata = Math.max(0, o.has("data") ? o.get("data").getAsInt() : 0);
|
||||||
int size = Math.max(1, o.has("count") ? o.get("count").getAsInt() : 1);
|
int size = Math.max(1, o.has("count") ? o.get("count").getAsInt() : 1);
|
||||||
|
String spell = o.has("spell") ? o.get("spell").getAsString() : null;
|
||||||
|
|
||||||
ingredients.add(new RecipeItem(new ItemStack(item, size, metadata), !o.has("data")));
|
ItemStack stack = new ItemStack(item, size, metadata);
|
||||||
|
|
||||||
|
if (spell != null) {
|
||||||
|
stack = SpellRegistry.instance().enchantStack(stack, spell);
|
||||||
|
}
|
||||||
|
|
||||||
|
ingredients.add(new RecipeItem(stack, !o.has("data")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,8 +140,8 @@ public class SpellRecipe extends Impl<IRecipe> implements IRecipe {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (contained.getItem() == other.getItem()
|
if (contained.getItem() == other.getItem()
|
||||||
&& (ignoreMeta || other.getMetadata() == contained.getMetadata())) {
|
&& (ignoreMeta || other.getMetadata() == contained.getMetadata())
|
||||||
|
&& ItemStack.areItemStackTagsEqual(contained, other)) {
|
||||||
return other.getCount() >= (materialMult * contained.getCount());
|
return other.getCount() >= (materialMult * contained.getCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"type": "unicopia:crafting_spell",
|
||||||
|
"ingredients": [
|
||||||
|
{ "item": "unicopia:zap_apple" },
|
||||||
|
{ "item": "unicopia:gem", "spell": "fire" },
|
||||||
|
{ "item": "minecraft:redstone" }
|
||||||
|
],
|
||||||
|
"result": {
|
||||||
|
"spell": "charge"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"type": "unicopia:crafting_spell",
|
||||||
|
"ingredients": [
|
||||||
|
{ "item": "minecraft:fire_charge" },
|
||||||
|
{ "item": "minecraft:fire_charge" },
|
||||||
|
{ "item": "minecraft:lava_bucket" }
|
||||||
|
],
|
||||||
|
"result": {
|
||||||
|
"spell": "fire"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"type": "unicopia:crafting_spell",
|
||||||
|
"ingredients": [
|
||||||
|
{ "item": "minecraft:snowball" },
|
||||||
|
{ "item": "minecraft:snowball" },
|
||||||
|
{ "item": "minecraft:water_bucket" }
|
||||||
|
],
|
||||||
|
"result": {
|
||||||
|
"spell": "ice"
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,10 +1,9 @@
|
||||||
{
|
{
|
||||||
"type": "unicopia:crafting_spell",
|
"type": "unicopia:crafting_spell",
|
||||||
"ingredients": [
|
"ingredients": [
|
||||||
{
|
{ "item": "minecraft:egg" },
|
||||||
"item": "minecraft:apple",
|
{ "item": "minecraft:coal" },
|
||||||
"data": 0
|
{ "item": "minecraft:blaze_powder" }
|
||||||
}
|
|
||||||
],
|
],
|
||||||
"result": {
|
"result": {
|
||||||
"spell": "shield"
|
"spell": "shield"
|
||||||
|
|
Loading…
Reference in a new issue