Skip to content

Commit

Permalink
Fix up editing player inv in chest inventories
Browse files Browse the repository at this point in the history
  • Loading branch information
Aeltumn committed Jul 14, 2024
1 parent 4890149 commit 4f32191
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,16 @@ public class InterfacesListeners private constructor(private val plugin: Plugin)
view: AbstractInterfaceView<*, *, *>,
clickedPoint: GridPoint,
isPlayerInventory: Boolean
): Boolean = view.pane.getRaw(clickedPoint) == null && !(view.builder.preventClickingEmptySlots && !(view.builder.allowClickingOwnInventoryIfClickingEmptySlotsIsPrevented && isPlayerInventory))
): Boolean {
// If we don't allow clicking empty slots we never allow freely moving
if (view.builder.preventClickingEmptySlots && !(view.builder.allowClickingOwnInventoryIfClickingEmptySlotsIsPrevented && isPlayerInventory)) return false

// If this inventory has no player inventory then the player inventory is always allowed to be edited
if (!view.backing.includesPlayerInventory && isPlayerInventory) return true

// If there is no item here we allow editing
return view.pane.getRaw(clickedPoint) == null
}

/** Handles a [view] being clicked at [clickedPoint] through some [event]. */
private fun handleClick(
Expand Down

0 comments on commit 4f32191

Please sign in to comment.