[Feature] AlloyingRecipe

This commit is contained in:
Frank 2022-07-28 18:29:33 +02:00
parent 24c3b8aed1
commit 3b3c0249d2
2 changed files with 323 additions and 0 deletions

View file

@ -0,0 +1,23 @@
package org.betterx.bclib.interfaces;
import net.minecraft.core.Registry;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import java.util.List;
public interface AlloyingRecipeWorkstation {
static List<Block> getWorkstations() {
return Registry.BLOCK
.stream()
.filter(b -> b instanceof AlloyingRecipeWorkstation)
.toList();
}
static ItemStack getWorkstationIcon() {
var workstations = AlloyingRecipeWorkstation.getWorkstations();
if (workstations.isEmpty()) return new ItemStack(Blocks.BARRIER);
return new ItemStack(workstations.get(0));
}
}