Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ public ConfigureSequencedGearshiftPacket(BlockPos pos, Vector<Instruction> 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);
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ public interface CreateStreamCodecs {
*/
@Deprecated(forRemoval = true)
static <B extends ByteBuf, V> StreamCodec.CodecOperation<B, V, Vector<V>> vector() {
return codec -> ByteBufCodecs.collection(Vector::new, codec);
return codec -> ByteBufCodecs.collection(Vector::new, codec, 256);
}

/**
Original file line number Diff line number Diff line change
@@ -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<BE extends SyncedBlockEntity> 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;