Search in sources :

Example 1 with ClientOutputCommandPacket

use of net.silentchaos512.gear.network.ClientOutputCommandPacket in project Silent-Gear by SilentChaos512.

the class TraitsCommand method runDumpMd.

private static int runDumpMd(CommandContext<CommandSourceStack> context) throws CommandSyntaxException {
    ServerPlayer player = context.getSource().getPlayerOrException();
    SilentGear.LOGGER.info("Send traits wiki dump packet to client {}", player.getScoreboardName());
    ClientOutputCommandPacket message = new ClientOutputCommandPacket(ClientOutputCommandPacket.Type.TRAITS, true);
    Network.channel.sendTo(message, player.connection.connection, NetworkDirection.PLAY_TO_CLIENT);
    return 1;
}
Also used : ClientOutputCommandPacket(net.silentchaos512.gear.network.ClientOutputCommandPacket) ServerPlayer(net.minecraft.server.level.ServerPlayer)

Example 2 with ClientOutputCommandPacket

use of net.silentchaos512.gear.network.ClientOutputCommandPacket in project Silent-Gear by SilentChaos512.

the class MaterialsCommand method runDump.

private static int runDump(CommandContext<CommandSourceStack> context, boolean includeChildren) throws CommandSyntaxException {
    ServerPlayer player = context.getSource().getPlayerOrException();
    SilentGear.LOGGER.info("Send material dump packet to client {}", player.getScoreboardName());
    ClientOutputCommandPacket message = new ClientOutputCommandPacket(ClientOutputCommandPacket.Type.MATERIALS, includeChildren);
    Network.channel.sendTo(message, player.connection.connection, NetworkDirection.PLAY_TO_CLIENT);
    return 1;
}
Also used : ClientOutputCommandPacket(net.silentchaos512.gear.network.ClientOutputCommandPacket) ServerPlayer(net.minecraft.server.level.ServerPlayer)

Aggregations

ServerPlayer (net.minecraft.server.level.ServerPlayer)2 ClientOutputCommandPacket (net.silentchaos512.gear.network.ClientOutputCommandPacket)2