Skip to content

Commit

Permalink
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.izzel.arclight.common.mixin.core.network.protocol.game;

import com.mojang.brigadier.arguments.ArgumentType;
import io.izzel.arclight.common.mod.ArclightMod;
import io.netty.buffer.Unpooled;
import net.minecraft.commands.synchronization.ArgumentTypeInfo;
import net.minecraft.core.registries.BuiltInRegistries;
@@ -30,7 +31,11 @@ public class ClientboundCommandsPacket_ArgumentNodeStubMixin {
ci.cancel();
buf.writeVarInt(ARCLIGHT_WRAP_INDEX);
//noinspection deprecation
buf.writeVarInt(BuiltInRegistries.COMMAND_ARGUMENT_TYPE.getId(type));
var id = BuiltInRegistries.COMMAND_ARGUMENT_TYPE.getId(type);
if (id == -1) {
ArclightMod.LOGGER.debug("Command argument type {} is not registered", type);
}
buf.writeVarInt(id);
var payload = new FriendlyByteBuf(Unpooled.buffer());
type.serializeToNetwork((T) node, payload);
buf.writeVarInt(payload.readableBytes());

0 comments on commit 7683441

Please sign in to comment.