1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-11-04 15:43:00 +00:00

Rethink PlatformHelper.useOn

useOn is now only responsible for firing the actual mod loader events,
and just returns the result of firing that event. The actual calling of
Block.use/Item.useOn now live in TurtlePlaceCommand.

This isn't especially useful for 1.20.1, but is more relevant on 1.21.1
when we look at #2011, as the shared code is much larger.
This commit is contained in:
Jonathan Coates
2025-01-12 22:01:43 +00:00
parent 546577041b
commit 9a914e75c4
9 changed files with 229 additions and 49 deletions

View File

@@ -142,6 +142,22 @@ class Turtle_Test {
}
}
/**
* Checks that turtles cannot place items into non-adjacent blocks.
*
* See [ComputerCraftTags.Blocks.TURTLE_CAN_USE].
*/
@GameTest
fun Place_into_composter_non_adjacent(helper: GameTestHelper) = helper.sequence {
thenOnComputer {
turtle.place(ObjectArguments()).await()
.assertArrayEquals(false, "Cannot place item here", message = "Failed to place item")
}
thenExecute {
helper.assertBlockIs(BlockPos(2, 2, 3)) { it.block == Blocks.COMPOSTER && it.getValue(ComposterBlock.LEVEL) == 0 }
}
}
/**
* Checks that turtles can place bottles into beehives.
*