Shell and folders
Some checks failed
build / build (push) Failing after 1m37s

This commit is contained in:
2026-10-07 19:13:25 +02:00
parent 7a115445ab
commit 5897870725
53 changed files with 6626 additions and 450 deletions

View File

@@ -0,0 +1,32 @@
package com.aranroig.payloads;
import com.aranroig.Codecraft;
import net.minecraft.network.RegistryFriendlyByteBuf;
import net.minecraft.network.codec.ByteBufCodecs;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
import net.minecraft.resources.Identifier;
/**
* Everything the shell printed, in order — stdout and stderr merged, line
* endings already normalised to {@code \n}. A message can hold any number of
* lines and can stop in the middle of one: the pane just appends it.
*/
public record ClientboundShellOutputPayload(String text) implements CustomPacketPayload {
public static final Identifier SHELL_OUTPUT_PAYLOAD_ID = Identifier.fromNamespaceAndPath(Codecraft.MOD_ID, "shell_output");
public static final CustomPacketPayload.Type<ClientboundShellOutputPayload> TYPE = new CustomPacketPayload.Type<>(SHELL_OUTPUT_PAYLOAD_ID);
public static final StreamCodec<RegistryFriendlyByteBuf, ClientboundShellOutputPayload> CODEC =
StreamCodec.composite(
ByteBufCodecs.STRING_UTF8,
ClientboundShellOutputPayload::text,
ClientboundShellOutputPayload::new
);
@Override
public Type<? extends CustomPacketPayload> type() {
return TYPE;
}
}