1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-11-07 08:52:59 +00:00

Move computer right click code to the block

Rather than handling right clicks within the block entity code, we now
handle it within the block. Turtles now handle the nametagging
behaviour themselves, rather than overriding canNameWithTag.
This commit is contained in:
Jonathan Coates
2024-04-17 15:00:43 +01:00
parent fabd77132d
commit 03bb279206
6 changed files with 41 additions and 46 deletions

View File

@@ -17,7 +17,6 @@ import net.minecraft.core.BlockPos
import net.minecraft.core.Direction
import net.minecraft.gametest.framework.GameTest
import net.minecraft.gametest.framework.GameTestHelper
import net.minecraft.world.InteractionHand
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.Items
import net.minecraft.world.level.block.Blocks
@@ -140,8 +139,7 @@ class Computer_Test {
// Teleport the player to the computer and then open it.
thenExecute {
context.positionAt(BlockPos(2, 2, 1))
val computer = context.getBlockEntity(BlockPos(2, 2, 2), ModRegistry.BlockEntities.COMPUTER_ADVANCED.get())
computer.use(context.level.randomPlayer!!, InteractionHand.MAIN_HAND)
context.useBlock(BlockPos(2, 2, 2), context.level.randomPlayer!!)
}
// Assert the terminal is synced to the client.
thenIdle(2)