diff --git a/src/main/java/com/simibubi/create/foundation/blockEntity/behaviour/ValueSettingsInputHandler.java b/src/main/java/com/simibubi/create/foundation/blockEntity/behaviour/ValueSettingsInputHandler.java index 5ab4fd684..0194347ce 100644 --- a/src/main/java/com/simibubi/create/foundation/blockEntity/behaviour/ValueSettingsInputHandler.java +++ b/src/main/java/com/simibubi/create/foundation/blockEntity/behaviour/ValueSettingsInputHandler.java @@ -92,7 +92,7 @@ public class ValueSettingsInputHandler { } public static boolean canInteract(Player player) { - return player != null && !player.isSpectator() && !player.isShiftKeyDown(); + return player != null && player.getAbilities().mayBuild && !player.isShiftKeyDown(); } } diff --git a/src/main/java/com/simibubi/create/foundation/networking/BlockEntityConfigurationPacket.java b/src/main/java/com/simibubi/create/foundation/networking/BlockEntityConfigurationPacket.java index 35d80758f..edd0083db 100644 --- a/src/main/java/com/simibubi/create/foundation/networking/BlockEntityConfigurationPacket.java +++ b/src/main/java/com/simibubi/create/foundation/networking/BlockEntityConfigurationPacket.java @@ -5,6 +5,8 @@ import com.simibubi.create.foundation.blockEntity.SyncedBlockEntity; import net.minecraft.core.BlockPos; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.server.level.ServerPlayer; +import net.minecraft.server.level.ServerPlayerGameMode; +import net.minecraft.world.level.GameType; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraftforge.network.NetworkEvent.Context; @@ -33,7 +35,7 @@ public abstract class BlockEntityConfigurationPacket { ServerPlayer player = context.getSender(); - if (player == null) + if (player == null || !player.getAbilities().mayBuild) return; Level world = player.level(); if (world == null || !world.isLoaded(pos)) @@ -63,7 +65,7 @@ public abstract class BlockEntityConfigurationPacket