diff options
Diffstat (limited to 'src/main/kotlin/repo/recipes/RecipeLayouter.kt')
| -rw-r--r-- | src/main/kotlin/repo/recipes/RecipeLayouter.kt | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/src/main/kotlin/repo/recipes/RecipeLayouter.kt b/src/main/kotlin/repo/recipes/RecipeLayouter.kt index 2c013b7..b211d9c 100644 --- a/src/main/kotlin/repo/recipes/RecipeLayouter.kt +++ b/src/main/kotlin/repo/recipes/RecipeLayouter.kt @@ -4,6 +4,9 @@ import io.github.notenoughupdates.moulconfig.gui.GuiComponent import me.shedaniel.math.Point import me.shedaniel.math.Rectangle import net.minecraft.network.chat.Component +import net.minecraft.world.entity.Entity +import net.minecraft.world.entity.LivingEntity +import net.minecraft.world.entity.npc.Villager import moe.nea.firmament.repo.SBItemStack interface RecipeLayouter { @@ -15,24 +18,48 @@ interface RecipeLayouter { * Create a bigger background and mark the slot as output. The coordinates should still refer the upper left corner of the item stack, not of the bigger background. */ BIG_OUTPUT, + DISPLAY, } + + fun createCyclingItemSlot( + x: Int, y: Int, + content: List<SBItemStack>, + slotKind: SlotKind + ): CyclingItemSlot + fun createItemSlot( x: Int, y: Int, content: SBItemStack?, slotKind: SlotKind, - ) + ): ItemSlot + + interface CyclingItemSlot : ItemSlot { + fun onUpdate(action: () -> Unit) + } + + interface ItemSlot : Updater<SBItemStack> { + fun current(): SBItemStack + } + + interface Updater<T> { + fun update(newValue: T) + } + + fun createTooltip(rectangle: Rectangle, label: List<Component>) + fun createTooltip(rectangle: Rectangle, vararg label: Component) = + createTooltip(rectangle, label.toList()) - fun createTooltip(rectangle: Rectangle, label: Component) fun createLabel( x: Int, y: Int, text: Component - ) + ): Updater<Component> fun createArrow(x: Int, y: Int): Rectangle fun createMoulConfig(x: Int, y: Int, w: Int, h: Int, component: GuiComponent) fun createFire(ingredientsCenter: Point, animationTicks: Int) + fun createEntity(rectangle: Rectangle, entity: LivingEntity) } |
