mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 03:15:35 -04:00
fix some container actions/tests
This commit is contained in:
parent
893a400405
commit
5a13e181bb
@ -85,7 +85,7 @@ class CloneContainerActionTest {
|
||||
container.invokeAction(CloneContainerAction(8))
|
||||
assertEquals(container.floatingItem, ItemStack(EggTestO.item, count = 16))
|
||||
// TODO: Not sending any packet in 1.18.2?
|
||||
connection.assertOnlyPacket(ContainerClickC2SP(9, container.serverRevision, 8, 3, 0, 0, slotsOf(), ItemStack(EggTestO.item, count = 64)))
|
||||
connection.assertOnlyPacket(ContainerClickC2SP(9, container.serverRevision, 8, 3, 0, 0, slotsOf(), ItemStack(EggTestO.item, count = 16)))
|
||||
}
|
||||
|
||||
fun testRevert() {
|
||||
|
@ -57,8 +57,7 @@ class FastMoveContainerActionTest {
|
||||
container[0] = ItemStack(AppleTestO.item, 9)
|
||||
container.invokeAction(FastMoveContainerAction(0))
|
||||
assertNull(container.floatingItem)
|
||||
assertNull(container[0])
|
||||
assertEquals(container[62], ItemStack(AppleTestO.item, 9))
|
||||
assertEquals(container.slots, slotsOf(62 to ItemStack(AppleTestO.item, 9)))
|
||||
connection.assertOnlyPacket(ContainerClickC2SP(9, container.serverRevision, 0, 1, 0, 0, slotsOf(62 to null, 0 to ItemStack(AppleTestO.item, count = 9)), null))
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ class PickAllContainerActionTest {
|
||||
container[0] = ItemStack(AppleTestO.item, 64)
|
||||
container[5] = ItemStack(AppleTestO.item, 2)
|
||||
container.invokeAction(PickAllContainerAction(5))
|
||||
assertEquals(container[0], ItemStack(AppleTestO.item, count = 62))
|
||||
assertEquals(container[0], ItemStack(AppleTestO.item, count = 2))
|
||||
assertNull(container[5])
|
||||
assertEquals(container.floatingItem, ItemStack(AppleTestO.item, count = 64))
|
||||
connection.assertOnlyPacket(ContainerClickC2SP(9, container.serverRevision, 5, 6, 0, 0, slotsOf(0 to ItemStack(AppleTestO.item, count = 2), 5 to null), ItemStack(AppleTestO.item, count = 64)))
|
||||
@ -116,7 +116,7 @@ class PickAllContainerActionTest {
|
||||
val connection = createConnection()
|
||||
val container = createContainer(connection)
|
||||
container[0] = ItemStack(AppleTestO.item, 7)
|
||||
val action = PickAllContainerAction(5)
|
||||
val action = PickAllContainerAction(0)
|
||||
container.invokeAction(action)
|
||||
assertNull(container[0])
|
||||
assertEquals(container.floatingItem, ItemStack(AppleTestO.item, count = 7))
|
||||
@ -130,7 +130,7 @@ class PickAllContainerActionTest {
|
||||
val container = createContainer(connection)
|
||||
container[0] = ItemStack(AppleTestO.item, 7)
|
||||
container[1] = ItemStack(AppleTestO.item, 8)
|
||||
val action = PickAllContainerAction(5)
|
||||
val action = PickAllContainerAction(0)
|
||||
container.invokeAction(action)
|
||||
assertNull(container[0])
|
||||
assertNull(container[1])
|
||||
|
@ -62,6 +62,9 @@ class PickAllContainerAction(
|
||||
}
|
||||
container._validate()
|
||||
container.floatingItem = clicked
|
||||
if (previous == clicked) {
|
||||
return
|
||||
}
|
||||
connection.sendPacket(ContainerClickC2SP(containerId, container.serverRevision, this.slot, 6, 0, container.createAction(this), changes, previous))
|
||||
} finally {
|
||||
container.commit()
|
||||
|
Loading…
x
Reference in New Issue
Block a user