[Feature] AlloyingRecipe
This commit is contained in:
parent
24c3b8aed1
commit
3b3c0249d2
2 changed files with 323 additions and 0 deletions
|
@ -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));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue