diff --git a/src/main/java/com/simibubi/create/content/kinetics/transmission/sequencer/ConfigureSequencedGearshiftPacket.java b/src/main/java/com/simibubi/create/content/kinetics/transmission/sequencer/ConfigureSequencedGearshiftPacket.java index d410bf3ed5..2b73d90171 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/transmission/sequencer/ConfigureSequencedGearshiftPacket.java +++ b/src/main/java/com/simibubi/create/content/kinetics/transmission/sequencer/ConfigureSequencedGearshiftPacket.java @@ -27,7 +27,7 @@ public ConfigureSequencedGearshiftPacket(BlockPos pos, Vector instr @Override protected void applySettings(ServerPlayer player, SequencedGearshiftBlockEntity be) { - if (be.computerBehaviour.hasAttachedComputer()) + if (be.computerBehaviour.hasAttachedComputer() || this.instructions.size() > 5) return; be.run(-1); diff --git a/src/main/java/com/simibubi/create/foundation/codec/CreateStreamCodecs.java b/src/main/java/com/simibubi/create/foundation/codec/CreateStreamCodecs.java index 866b26c729..a9f830d234 100644 --- a/src/main/java/com/simibubi/create/foundation/codec/CreateStreamCodecs.java +++ b/src/main/java/com/simibubi/create/foundation/codec/CreateStreamCodecs.java @@ -16,7 +16,7 @@ public interface CreateStreamCodecs { */ @Deprecated(forRemoval = true) static StreamCodec.CodecOperation> vector() { - return codec -> ByteBufCodecs.collection(Vector::new, codec); + return codec -> ByteBufCodecs.collection(Vector::new, codec, 256); } /** 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 518022ef1f..29bb581c9e 100644 --- a/src/main/java/com/simibubi/create/foundation/networking/BlockEntityConfigurationPacket.java +++ b/src/main/java/com/simibubi/create/foundation/networking/BlockEntityConfigurationPacket.java @@ -7,9 +7,17 @@ import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.InteractionHand; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.phys.BlockHitResult; + +import net.minecraft.world.phys.Vec3; + +import net.neoforged.neoforge.common.CommonHooks; +import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent; + public abstract class BlockEntityConfigurationPacket implements ServerboundPacketPayload { protected final BlockPos pos; @@ -30,6 +38,9 @@ public void handle(ServerPlayer player) { return; BlockEntity blockEntity = world.getBlockEntity(this.pos); if (blockEntity instanceof SyncedBlockEntity) { + PlayerInteractEvent.RightClickBlock result = CommonHooks.onRightClickBlock(player, InteractionHand.MAIN_HAND, this.pos, new BlockHitResult(Vec3.atCenterOf(this.pos), player.getDirection().getOpposite(), this.pos, true)); + if (result.isCanceled()) + return; applySettings(player, (BE) blockEntity); if (!causeUpdate()) return;