File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/main/java/org/spongepowered/api/item/inventory/menu Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 2727import net .kyori .adventure .text .Component ;
2828import org .spongepowered .api .entity .living .player .server .ServerPlayer ;
2929import org .spongepowered .api .item .inventory .Container ;
30+ import org .spongepowered .api .item .inventory .Slot ;
3031import org .spongepowered .api .item .inventory .menu .handler .ClickHandler ;
3132import org .spongepowered .api .item .inventory .menu .handler .CloseHandler ;
3233import org .spongepowered .api .item .inventory .menu .handler .InventoryCallbackHandler ;
@@ -149,6 +150,18 @@ static InventoryMenu of(ViewableInventory inventory) {
149150 */
150151 InventoryMenu setReadOnly (boolean readOnly );
151152
153+ /**
154+ * Sets the {@link Slot} readonly mode for this menu.
155+ * By default, uses the menus current readonly mode.
156+ * This can be used to override per slot.
157+ *
158+ * @param slot the slot which readonly mode is changed
159+ * @param readOnly whether to make the slot readonly or not.
160+ * @return this menu
161+ * @throws IllegalArgumentException if the slot is not part of the menu
162+ */
163+ InventoryMenu setReadOnly (Slot slot , boolean readOnly );
164+
152165 /**
153166 * Opens this menu for given {@link ServerPlayer player}.
154167 *
You can’t perform that action at this time.
0 commit comments