/** * Finds the plugin list, the callback is called * when the request times out or the list has been * found. * * @param callback Plugin Response callback * @param timeout Timeout in MS */ public final void find(Consumer<PResponse> callback, long timeout) { packetTimer.reset(); this.timeout = timeout; ClientAPI.EVENT_BUS.subscribe(this); this.callback = callback; mc.player.connection.sendPacket(new CPacketTabComplete("/", null, false)); }
/** * Retrieves possible tab completions for the requested command string and sends them to the client */ public void processTabComplete(CPacketTabComplete packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerWorld()); List<String> list = Lists.<String>newArrayList(); for (String s : this.serverController.getTabCompletions(this.playerEntity, packetIn.getMessage(), packetIn.getTargetBlock(), packetIn.hasTargetBlock())) { list.add(s); } this.playerEntity.connection.sendPacket(new SPacketTabComplete((String[])list.toArray(new String[list.size()]))); }
private void requestCompletions(String prefix) { if (prefix.length() >= 1) { Minecraft.getMinecraft().player.connection.sendPacket(new CPacketTabComplete(prefix, this.getTargetBlockPos(), this.hasTargetBlock)); this.requestedCompletions = true; } }
private void requestCompletions(String prefix) { if (prefix.length() >= 1) { net.minecraftforge.client.ClientCommandHandler.instance.autoComplete(prefix); Minecraft.getMinecraft().thePlayer.connection.sendPacket(new CPacketTabComplete(prefix, this.getTargetBlockPos(), this.hasTargetBlock)); this.requestedCompletions = true; } }
@Override public void processTabComplete(CPacketTabComplete p_147341_1_) { }
@Override public void processTabComplete(@Nonnull CPacketTabComplete p_147341_1_) { }
@Override public void processTabComplete(CPacketTabComplete packetIn) { }
/** * Retrieves possible tab completions for the requested command string and sends them to the client */ void processTabComplete(CPacketTabComplete packetIn);