mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-07-04 11:02:54 +00:00
Test for moving into a rotated container
Similar to the test in #1277. The duplication here is a little irritating, but don't think we can avoid that.
This commit is contained in:
parent
bcdfa7c5ff
commit
a1d5c76d00
@ -130,6 +130,22 @@ public interface ContainerTransferContract {
|
|||||||
assertNoOverlap(source, destination);
|
assertNoOverlap(source, destination);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
default void testMoveRotateWraps() {
|
||||||
|
var source = new SimpleContainer(1);
|
||||||
|
source.setItem(0, new ItemStack(Items.COBBLESTONE, 32));
|
||||||
|
|
||||||
|
var destination = new SimpleContainer(9);
|
||||||
|
destination.setItem(0, new ItemStack(Items.DIRT));
|
||||||
|
for (var slot = 4; slot < 9; slot++) destination.setItem(slot, new ItemStack(Items.DIRT));
|
||||||
|
|
||||||
|
var move = wrap(source).moveTo(wrap(destination).rotate(4), 64);
|
||||||
|
assertEquals(32, move);
|
||||||
|
|
||||||
|
assertThat("Source is empty", source.getItem(0), isStack(ItemStack.EMPTY));
|
||||||
|
assertThat("Was inserted into slot", destination.getItem(1), isStack(new ItemStack(Items.COBBLESTONE, 32)));
|
||||||
|
}
|
||||||
|
|
||||||
static void assertNoOverlap(Container... containers) {
|
static void assertNoOverlap(Container... containers) {
|
||||||
Set<ItemStack> stacks = Collections.newSetFromMap(new IdentityHashMap<>());
|
Set<ItemStack> stacks = Collections.newSetFromMap(new IdentityHashMap<>());
|
||||||
for (var container : containers) {
|
for (var container : containers) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user