1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-25 22:53:22 +00:00

Don't allow modems to be used in adventure mode

This (along with computer locking) should be Good Enough for BlanketCon.
This commit is contained in:
Jonathan Coates 2022-05-28 09:23:23 +01:00
parent ab22726883
commit 3b6cd783cb
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06
2 changed files with 2 additions and 1 deletions

View File

@ -262,7 +262,7 @@ private void refreshPeripheral()
@Override
public ActionResultType onActivate( PlayerEntity player, Hand hand, BlockRayTraceResult hit )
{
if( player.isCrouching() ) return ActionResultType.PASS;
if( player.isCrouching() || !player.mayBuild() ) return ActionResultType.PASS;
if( !canAttachPeripheral() ) return ActionResultType.FAIL;
if( getLevel().isClientSide ) return ActionResultType.SUCCESS;

View File

@ -199,6 +199,7 @@ private void refreshPeripheral( @Nonnull Direction facing )
@Override
public ActionResultType onActivate( PlayerEntity player, Hand hand, BlockRayTraceResult hit )
{
if( player.isCrouching() || !player.mayBuild() ) return ActionResultType.PASS;
if( getLevel().isClientSide ) return ActionResultType.SUCCESS;
// On server, we interacted if a peripheral was found