允许取反卓越物品接口朝向
This commit is contained in:
parent
15b20eb86f
commit
07950ecf6f
1 changed files with 3 additions and 0 deletions
|
@ -84,6 +84,9 @@ public class SuperbItemInterfaceBlock extends BaseEntityBlock {
|
|||
protected @NotNull ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) {
|
||||
if (stack.is(ModItems.CROWBAR.get()) || stack.is(ModTags.Items.WRENCHES_TAG) || stack.is(ModTags.Items.WRENCH_TAG)) {
|
||||
var facing = hitResult.getDirection();
|
||||
if (state.getValue(FACING) == facing) {
|
||||
facing = facing.getOpposite();
|
||||
}
|
||||
level.setBlockAndUpdate(pos, state.setValue(FACING, facing));
|
||||
return ItemInteractionResult.SUCCESS;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue