Add a debug output when argument type is not registered
This commit is contained in:
parent
ed03da36dd
commit
7683441492
|
@ -1,6 +1,7 @@
|
||||||
package io.izzel.arclight.common.mixin.core.network.protocol.game;
|
package io.izzel.arclight.common.mixin.core.network.protocol.game;
|
||||||
|
|
||||||
import com.mojang.brigadier.arguments.ArgumentType;
|
import com.mojang.brigadier.arguments.ArgumentType;
|
||||||
|
import io.izzel.arclight.common.mod.ArclightMod;
|
||||||
import io.netty.buffer.Unpooled;
|
import io.netty.buffer.Unpooled;
|
||||||
import net.minecraft.commands.synchronization.ArgumentTypeInfo;
|
import net.minecraft.commands.synchronization.ArgumentTypeInfo;
|
||||||
import net.minecraft.core.registries.BuiltInRegistries;
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
@ -30,7 +31,11 @@ public class ClientboundCommandsPacket_ArgumentNodeStubMixin {
|
||||||
ci.cancel();
|
ci.cancel();
|
||||||
buf.writeVarInt(ARCLIGHT_WRAP_INDEX);
|
buf.writeVarInt(ARCLIGHT_WRAP_INDEX);
|
||||||
//noinspection deprecation
|
//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());
|
var payload = new FriendlyByteBuf(Unpooled.buffer());
|
||||||
type.serializeToNetwork((T) node, payload);
|
type.serializeToNetwork((T) node, payload);
|
||||||
buf.writeVarInt(payload.readableBytes());
|
buf.writeVarInt(payload.readableBytes());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user