package protocolsupport.protocol.packet.middleimpl;

import io.netty.buffer.ByteBuf;
import protocolsupport.protocol.packet.PacketType;

public interface RunnableTransformOperation extends Runnable, IPacketData {

	@Override
	default PacketType getPacketType() {
		return PacketType.NONE;
	}

	@Override
	default void writeData(ByteBuf to) {
		run();
	}

	@Override
	default void recycle() {
	}

}

package protocolsupport.protocol.packet.middleimpl;

import io.netty.buffer.ByteBuf;
import protocolsupport.protocol.packet.PacketType;

public class RunnableTransformOperation implements IPacketData {

	protected final Runnable runnable;
	public RunnableTransformOperation(Runnable runnable) {
		this.runnable = runnable;
	}

	@Override
	public void writeData(ByteBuf to) {
		runnable.run();
	}

	@Override
	public int getDataLength() {
		return 0;
	}

	@Override
	public PacketType getPacketType() {
		return PacketType.NONE;
	}

	@Override
	public void recycle() {
	}

}

Make runnabletransformoperation into a class instead
Make runnabletransformoperation into a class instead