Implement double click quickmove fix using isSameInventory

This commit is contained in:
DBotThePony 2022-10-19 23:08:56 +07:00
parent e1be8dcfdb
commit c6fae3348b
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -128,6 +128,13 @@ abstract class MatteryMenu @JvmOverloads protected constructor(
override fun mayPickup(player: Player): Boolean { override fun mayPickup(player: Player): Boolean {
return super.mayPickup(player) && !isInventorySlotLocked(index) return super.mayPickup(player) && !isInventorySlotLocked(index)
} }
override fun isSameInventory(other: Slot): Boolean {
if (container === inventory || container === ply.matteryPlayer?.exoSuitContainer)
return other.container === inventory || other.container === ply.matteryPlayer?.exoSuitContainer
return super.isSameInventory(other)
}
} }
open inner class EquipmentSlot(container: Container, index: Int, val type: net.minecraft.world.entity.EquipmentSlot, x: Int = 0, y: Int = 0) : InventorySlot(container, index, x, y) { open inner class EquipmentSlot(container: Container, index: Int, val type: net.minecraft.world.entity.EquipmentSlot, x: Int = 0, y: Int = 0) : InventorySlot(container, index, x, y) {