Skip to content

Commit 4d247a2

Browse files
Add non-property setSlot methods to CrafterWindow
1 parent 61a9413 commit 4d247a2

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

invui/src/main/java/xyz/xenondevs/invui/window/CrafterWindow.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,18 @@ default Builder setResultGui(Gui.Builder<?, ?> builder) {
192192
*/
193193
Builder addSlotToggleHandler(BiConsumer<? super Integer, ? super Boolean> handler);
194194

195+
/**
196+
* Sets the slot disabled state of the given slot.
197+
*
198+
* @param slot The slot index
199+
* @param state The disabled state of the slot
200+
* @return This {@link Builder}
201+
* @throws IllegalArgumentException If the slot index is out of bounds (0-8)
202+
*/
203+
default Builder setSlot(int slot, boolean state) {
204+
return setSlot(slot, MutableProperty.of(state));
205+
}
206+
195207
/**
196208
* Sets the property that contains the disabled state of the slot at the given index.
197209
*
@@ -202,6 +214,19 @@ default Builder setResultGui(Gui.Builder<?, ?> builder) {
202214
*/
203215
Builder setSlot(int slot, MutableProperty<Boolean> state);
204216

217+
/**
218+
* Sets the disabled state of the slot at the given coordinates.
219+
*
220+
* @param x The x coordinate of the slot
221+
* @param y The y coordinate of the slot
222+
* @param state The disabled state of the slot
223+
* @return This {@link Builder}
224+
* @throws IllegalArgumentException If the slot coordinates are out of bounds (0-2, 0-2)
225+
*/
226+
default Builder setSlot(int x, int y, boolean state) {
227+
return setSlot(x, y, MutableProperty.of(state));
228+
}
229+
205230
/**
206231
* Sets the property that contains the disabled state of the slot at the given coordinates.
207232
*
@@ -215,6 +240,18 @@ default Builder setSlot(int x, int y, MutableProperty<Boolean> state) {
215240
return setSlot(x + y * 3, state);
216241
}
217242

243+
/**
244+
* Sets the disabled state of the slot at the given coordinates.
245+
*
246+
* @param slot The slot
247+
* @param state The disabled state of the slot
248+
* @return This {@link Builder}
249+
* @throws IllegalArgumentException If the slot coordinates are out of bounds (0-2, 0-2)
250+
*/
251+
default Builder setSlot(Slot slot, boolean state) {
252+
return setSlot(slot, MutableProperty.of(state));
253+
}
254+
218255
/**
219256
* Sets the property that contains the disabled state of the slot at the given coordinates.
220257
*

0 commit comments

Comments
 (0)