mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Render the duplicating recipe to the ingredient tree
This commit is contained in:
parent
53775ce34b
commit
8f7fa1ae7e
2 changed files with 9 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
package com.minelittlepony.unicopia.ability.magic.spell.crafting;
|
package com.minelittlepony.unicopia.ability.magic.spell.crafting;
|
||||||
|
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
|
import com.minelittlepony.unicopia.ability.magic.spell.effect.SpellType;
|
||||||
import com.minelittlepony.unicopia.container.SpellbookScreenHandler.SpellbookInventory;
|
import com.minelittlepony.unicopia.container.SpellbookScreenHandler.SpellbookInventory;
|
||||||
import com.minelittlepony.unicopia.item.*;
|
import com.minelittlepony.unicopia.item.*;
|
||||||
import com.minelittlepony.unicopia.util.InventoryUtil;
|
import com.minelittlepony.unicopia.util.InventoryUtil;
|
||||||
|
@ -26,7 +27,13 @@ public class SpellDuplicatingRecipe implements SpellbookRecipe {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void buildCraftingTree(CraftingTreeBuilder builder) {
|
public void buildCraftingTree(CraftingTreeBuilder builder) {
|
||||||
|
ItemStack[] spells = SpellType.REGISTRY.stream()
|
||||||
|
.filter(SpellType::isObtainable)
|
||||||
|
.map(type -> GemstoneItem.enchant(UItems.GEMSTONE.getDefaultStack(), type))
|
||||||
|
.toArray(ItemStack[]::new);
|
||||||
|
builder.input(UItems.BOTCHED_GEM.getDefaultStack());
|
||||||
|
builder.input(spells);
|
||||||
|
builder.result(spells);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -173,7 +173,7 @@ class IngredientTree implements SpellbookRecipe.CraftingTreeBuilder {
|
||||||
public void render(MatrixStack matrices, int x, int y, float tickDelta) {
|
public void render(MatrixStack matrices, int x, int y, float tickDelta) {
|
||||||
y -= 2;
|
y -= 2;
|
||||||
|
|
||||||
if (ticker++ % 500 == 0) {
|
if (ticker++ % 30 == 0) {
|
||||||
index = (index + 1) % stacks.length;
|
index = (index + 1) % stacks.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue