Added captive default kotlin extension

This commit is contained in:
Auxilor
2022-05-28 16:41:20 +01:00
parent 7adcdd572d
commit 2bcbf181a9

View File

@@ -32,6 +32,10 @@ fun SlotBuilder.onShiftRightClick(action: (InventoryClickEvent, Slot, Menu) -> U
fun SlotBuilder.onMiddleClick(action: (InventoryClickEvent, Slot, Menu) -> Unit): SlotBuilder =
this.onMiddleClick { a, b, c -> action(a, b, c) }
/** @see SlotBuilder.setCaptive */
fun SlotBuilder.setCaptive(default: (Player) -> TestableItem?): SlotBuilder =
this.setCaptive { a -> default(a) }
/**
* @see SlotBuilder.setModifier
* @deprecated Use SlotUpdater instead.