Java 类net.minecraft.client.gui.GuiChat 实例源码

项目:EvenWurse    文件:MenuWalkMod.java   
public boolean shouldAllowWalking() {
    // check if mod is active
    if (!isActive()) return false;

    // check if there is a player to move
    Minecraft mc = Minecraft.getMinecraft();
    if (mc.thePlayer == null) return false;

    // check if player is viewing chat
    if ((mc.currentScreen instanceof GuiChat) || (mc.currentScreen instanceof GuiIngameMenu) ||
            (mc.currentScreen instanceof NavigatorScreen)) {
        return false;
    }

    // check if inventory key is pressed
    return !Keyboard.isKeyDown(mc.gameSettings.keyBindInventory.getKeyCode());
}
项目:4Space-5    文件:OxygenUtil.java   
@SideOnly(Side.CLIENT)
public static boolean shouldDisplayTankGui(GuiScreen gui)
{
    if (FMLClientHandler.instance().getClient().gameSettings.hideGUI)
    {
        return false;
    }

    if (gui == null)
    {
        return true;
    }

    if (gui instanceof GuiInventory)
    {
        return false;
    }

    return gui instanceof GuiChat;

}
项目:Lotr_Mod_Addons    文件:CustomKeyHandler.java   
@SubscribeEvent
public void onKeyInput(InputEvent.KeyInputEvent event) {
    // first check that the player is not using the chat menu
    // you can use this method from before:
    // if (FMLClientHandler.instance().getClient().inGameHasFocus) {
    // or you can use this new one that is available, doesn't really matter
    if (!FMLClientHandler.instance().isGUIOpen(GuiChat.class)) {
        // you can get the key code of the key pressed using the Keyboard class:
        int kb = Keyboard.getEventKey();
        // similarly, you can get the key state, but this will always be true when the event is fired:
        boolean isDown = Keyboard.getEventKeyState();

        // same as before, chain if-else if statements to find which of your custom keys
        // was pressed and act accordingly:
        if (kb == keys[CUSTOM_INV].getKeyCode()) {
            EntityPlayer player = FMLClientHandler.instance().getClient().thePlayer;
            // before you could close the screen from here, but that no longer seems to be
            // possible instead, you need to do so from within the GUI itself
            // so we will just send a packet to open the GUI:
            player.openGui(LOTRRings.instance, UIHandler.PLAYERINVENTORY_UI_1, player.getEntityWorld(), player.chunkCoordX, player.chunkCoordY, player.chunkCoordZ);
        }
    }
}
项目:TaleCraft    文件:InfoBar.java   
public boolean canDisplayInfoBar(Minecraft mc, ClientProxy clientProxy) {
    if(!clientProxy.isBuildMode())
        return false;

    if(mc.currentScreen == null)
        return true;

    if(mc.currentScreen instanceof GuiIngameMenu)
        return true;

    if(mc.currentScreen instanceof GuiChat)
        return true;

    return false;
}
项目:XRay-Mod    文件:KeyBindingHandler.java   
@SubscribeEvent
public void onKeyInput( KeyInputEvent event )
   {
    if( (!FMLClientHandler.instance().isGUIOpen( GuiChat.class )) && (mc.currentScreen == null) && (mc.world != null) )
       {
        if( XRay.keyBind_keys[ XRay.keyIndex_toggleXray ].isPressed() )
        {
            XRay.drawOres = !XRay.drawOres;
            XrayRenderer.ores.clear();
        }
        else if( XRay.keyBind_keys[ XRay.keyIndex_showXrayMenu ].isPressed() )
        {
            mc.displayGuiScreen( new GuiList() );
        }
    }
}
项目:TheDarkEra    文件:KeyHandler.java   
@SubscribeEvent
public void onMouseInput(InputEvent.MouseInputEvent event) {
    if (!FMLClientHandler.instance().isGUIOpen(GuiChat.class)) {
        Minecraft mc = Minecraft.getMinecraft();
        EntityPlayer thePlayer = mc.getMinecraft().thePlayer;
        ItemStack hand = thePlayer.getCurrentEquippedItem();
        ExtendedPlayer props = ExtendedPlayer.get((EntityPlayer) thePlayer);
        int x = mc.objectMouseOver.blockX;
        int y = mc.objectMouseOver.blockY;
        int z = mc.objectMouseOver.blockZ;
        if (Mouse.isButtonDown(1) && hand == null)
            props.useMana(10);
        // TheDarkEra.packetPipeline.sendToServer(new PacketUseShout(x, y,
        // z));
    }
}
项目:mcpvp-mod    文件:AllTick.java   
public static void onTick(TickEvent event) {

    if (System.currentTimeMillis() % 10 == 0) {
        Main.start("mcpvp", "vars");
        AllVars.putVars();
        Main.end(2);
    }

    if (event.type == TickEvent.Type.RENDER && event.phase == event.phase.END) {
        if (Main.mc.currentScreen == null || Main.mc.currentScreen instanceof GuiChat) {
            Main.start("mcpvp", "alerts");
            Alerts.alert.showAlerts();
            Medal.showAll();
            Main.end(2);
        }
    }

    for (BoardTracker tracker : BoardTracker.boardTrackers) {
        Main.start("mcpvp", "trackers");
        tracker.update();
        Main.end(2);
    }

}
项目:TapeMouse    文件:TapeMouse.java   
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void textRenderEvent(RenderGameOverlayEvent.Text event)
{
    if (keyBinding == null) return;
    if (Minecraft.getMinecraft().currentScreen instanceof GuiMainMenu)
    {
        event.getLeft().add(NAME + " paused. Main menu open. If you want to AFK, use ALT+TAB.");
    }
    else if (Minecraft.getMinecraft().currentScreen instanceof GuiChat)
    {
        event.getLeft().add(NAME + " paused. Chat GUI open. If you want to AFK, use ALT+TAB.");
    }
    else
    {
        event.getLeft().add(NAME + " active: " + keyBinding.getDisplayName() + " (" + keyBinding.getKeyDescription().replaceFirst("^key\\.", "") + ')');
        event.getLeft().add("Delay: " + i + " / " + delay);
    }
}
项目:HardcoreRevival    文件:TeamUpAddon.java   
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onOpenGui(GuiOpenEvent event) {
    Minecraft mc = Minecraft.getMinecraft();
    if (mc.player != null && mc.player.getHealth() <= 0f) {
        mc.player.setSneaking(false);
        if (event.getGui() instanceof GuiChat && mc.gameSettings.keyBindSneak.isKeyDown()) {
            event.setGui(new GuiChat("/team "));
        }
    }
}
项目:HardcoreRevival    文件:PingAddon.java   
@SubscribeEvent
public void onInitGui(GuiScreenEvent.InitGuiEvent.Post event) {
    GuiScreen gui = event.getGui();
    if(isEnabled && gui.mc.player != null && gui.mc.player.getHealth() <= 0f && gui instanceof GuiChat) {
        buttonPing = new GuiButton(-999, gui.width / 2 - 100, gui.height / 2 + 30, I18n.format("gui.hardcorerevival.send_ping"));
        event.getButtonList().add(buttonPing);
    }
}
项目:HardcoreRevival    文件:ClientProxy.java   
@SubscribeEvent
public void onInitGui(GuiScreenEvent.InitGuiEvent.Post event) {
    Minecraft mc = event.getGui().mc;
    if (mc.player != null && isKnockedOut && event.getGui() instanceof GuiChat) {
        GuiScreen gui = event.getGui();
        enableButtonTimer = 0;
        buttonDie = new GuiButton(-2, gui.width / 2 - 100, gui.height / 2 - 30, I18n.format("gui.hardcorerevival.die"));
        buttonDie.enabled = false;
        event.getButtonList().add(buttonDie);
    }
}
项目:HardcoreRevival    文件:ClientProxy.java   
@SubscribeEvent
public void onDrawScreen(GuiScreenEvent.DrawScreenEvent.Post event) {
    GuiScreen gui = event.getGui();
    Minecraft mc = gui.mc;
    if (mc.player != null && isKnockedOut && gui instanceof GuiChat) {
        enableButtonTimer += event.getRenderPartialTicks();
        if(buttonDie != null) {
            if (enableButtonTimer >= 40) {
                buttonDie.enabled = true;
                buttonDie.displayString = I18n.format("gui.hardcorerevival.die");
            } else if (enableButtonTimer >= 30) {
                buttonDie.displayString = "... " + I18n.format("gui.hardcorerevival.die") + " ...";
            } else if (enableButtonTimer >= 20) {
                buttonDie.displayString = ".. " + I18n.format("gui.hardcorerevival.die") + " ..";
            } else if (enableButtonTimer >= 10) {
                buttonDie.displayString = ". " + I18n.format("gui.hardcorerevival.die") + " .";
            }
        }

        GlStateManager.pushMatrix();
        GlStateManager.scale(2f, 2f, 2f);
        gui.drawCenteredString(mc.fontRenderer, I18n.format("gui.hardcorerevival.knocked_out"), gui.width / 2 / 2, 30, 16777215);
        GlStateManager.popMatrix();

        gui.drawCenteredString(mc.fontRenderer, I18n.format("gui.hardcorerevival.rescue_time_left", Math.max(0, (ModConfig.maxDeathTicks - deathTime) / 20)), gui.width / 2, gui.height / 2 + 10, 16777215);
    } else if(buttonDie != null) {
        buttonDie.visible = false;
    }
}
项目:DecompiledMinecraft    文件:NetHandlerPlayClient.java   
/**
 * Displays the available command-completion options the server knows of
 */
public void handleTabComplete(S3APacketTabComplete packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    String[] astring = packetIn.func_149630_c();

    if (this.gameController.currentScreen instanceof GuiChat)
    {
        GuiChat guichat = (GuiChat)this.gameController.currentScreen;
        guichat.onAutocompleteResponse(astring);
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * Displays the available command-completion options the server knows of
 */
public void handleTabComplete(S3APacketTabComplete packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    String[] astring = packetIn.func_149630_c();

    if (this.gameController.currentScreen instanceof GuiChat)
    {
        GuiChat guichat = (GuiChat)this.gameController.currentScreen;
        guichat.onAutocompleteResponse(astring);
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * Displays the available command-completion options the server knows of
 */
public void handleTabComplete(S3APacketTabComplete packetIn) {
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    String[] astring = packetIn.func_149630_c();

    if (this.gameController.currentScreen instanceof GuiChat) {
        GuiChat guichat = (GuiChat) this.gameController.currentScreen;
        guichat.onAutocompleteResponse(astring);
    }
}
项目:EMC    文件:IMinecraft.java   
public static boolean isChatOpen() {
    if (Minecraft.getMinecraft().currentScreen != null) {
        if (Minecraft.getMinecraft().currentScreen instanceof GuiChat) {
            return true;
        }
    }
    return false;
}
项目:CustomWorldGen    文件:ClientCommandHandler.java   
public void autoComplete(String leftOfCursor)
{
    latestAutoComplete = null;

    if (leftOfCursor.charAt(0) == '/')
    {
        leftOfCursor = leftOfCursor.substring(1);

        Minecraft mc = FMLClientHandler.instance().getClient();
        if (mc.currentScreen instanceof GuiChat)
        {
            List<String> commands = getTabCompletionOptions(mc.thePlayer, leftOfCursor, mc.thePlayer.getPosition());
            if (commands != null && !commands.isEmpty())
            {
                if (leftOfCursor.indexOf(' ') == -1)
                {
                    for (int i = 0; i < commands.size(); i++)
                    {
                        commands.set(i, GRAY + "/" + commands.get(i) + RESET);
                    }
                }
                else
                {
                    for (int i = 0; i < commands.size(); i++)
                    {
                        commands.set(i, GRAY + commands.get(i) + RESET);
                    }
                }

                latestAutoComplete = commands.toArray(new String[commands.size()]);
            }
        }
    }
}
项目:TRHS_Club_Mod_2016    文件:ClientCommandHandler.java   
public void autoComplete(String leftOfCursor, String full)
{
    latestAutoComplete = null;

    if (leftOfCursor.charAt(0) == '/')
    {
        leftOfCursor = leftOfCursor.substring(1);

        Minecraft mc = FMLClientHandler.instance().getClient();
        if (mc.field_71462_r instanceof GuiChat)
        {
            @SuppressWarnings("unchecked")
            List<String> commands = func_71558_b(mc.field_71439_g, leftOfCursor);
            if (commands != null && !commands.isEmpty())
            {
                if (leftOfCursor.indexOf(' ') == -1)
                {
                    for (int i = 0; i < commands.size(); i++)
                    {
                        commands.set(i, GRAY + "/" + commands.get(i) + RESET);
                    }
                }
                else
                {
                    for (int i = 0; i < commands.size(); i++)
                    {
                        commands.set(i, GRAY + commands.get(i) + RESET);
                    }
                }

                latestAutoComplete = commands.toArray(new String[commands.size()]);
            }
        }
    }
}
项目:Alchemy    文件:SingleProjection.java   
@SideOnly(Side.CLIENT)
@Hook("net.minecraft.client.Minecraft#func_184117_aA")
public static Hook.Result processKeyBinds(Minecraft mc) {
    if (projectionState) {
        for (; mc.gameSettings.keyBindTogglePerspective.isPressed(); mc.renderGlobal.setDisplayListEntitiesDirty()) {
            ++mc.gameSettings.thirdPersonView;

            if (mc.gameSettings.thirdPersonView > 2)
                mc.gameSettings.thirdPersonView = 0;

            if (mc.gameSettings.thirdPersonView == 0)
                mc.entityRenderer.loadEntityShader(mc.getRenderViewEntity());
            else if (mc.gameSettings.thirdPersonView == 1)
                mc.entityRenderer.loadEntityShader(null);
        }

        while (mc.gameSettings.keyBindSmoothCamera.isPressed())
            mc.gameSettings.smoothCamera = !mc.gameSettings.smoothCamera;

        boolean flag = mc.gameSettings.chatVisibility != EntityPlayer.EnumChatVisibility.HIDDEN;

        if (flag) {
            while (mc.gameSettings.keyBindChat.isPressed())
                mc.displayGuiScreen(new GuiChat());

            if (mc.currentScreen == null && mc.gameSettings.keyBindCommand.isPressed())
                mc.displayGuiScreen(new GuiChat("/"));
        }
        return Hook.Result.NULL;
    }
    return Hook.Result.VOID;
}
项目:DiscordCE    文件:MinecraftEventHandler.java   
@SubscribeEvent
public void sendTyping(TickEvent e)
{
    if (e.type != TickEvent.Type.CLIENT
            || DiscordCE.client == null
            || DiscordCE.client.getTextChannelById(Preferences.i.usingChannel) == null
            || lastTyping > System.currentTimeMillis() - 9000
            || Minecraft.getMinecraft().thePlayer == null
            || Minecraft.getMinecraft().currentScreen == null
            || !(Minecraft.getMinecraft().currentScreen instanceof GuiChat))
        return;

    GuiChat gui = (GuiChat) Minecraft.getMinecraft().currentScreen;
    GuiTextField field = ReflectionHelper.getPrivateValue(GuiChat.class, gui, 4);

    // Players is typing in command and not sending message
    if (field.getText().isEmpty() || !field.getText().startsWith("//"))
        return;

    field.setMaxStringLength(2000);

    // Setting the last time the typing packet was sent
    lastTyping = System.currentTimeMillis();

    // Sending typing packet in new thread so it doesn't lag
    ConcurrentUtil.executor.execute(() ->
            DiscordCE.client.getTextChannelById(Preferences.i.usingChannel).sendTyping());
}
项目:DurabilityViewer    文件:LiteModDurabilityViewer.java   
@Override
public void onPostRenderHUD(int screenWidth, int screenHeight)
{
    ArmourSlotsHandler AR = new ArmourSlotsHandler(mc.thePlayer.inventory.armorInventory, this.mc, instance.RADurBar);
    ScaledResolution sc = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);

    if ((this.mc.inGameHasFocus || mc.currentScreen == null || mc.currentScreen instanceof GuiChat) && instance.RADur && !(instance.ArmourLoc == 0 && this.mc.gameSettings.keyBindPlayerList.isKeyDown() && this.mc.thePlayer.sendQueue.func_175106_d().size() > 1))
    {
        AR.Render(sc.getScaledWidth(), sc.getScaledHeight(), this.ArmourRh);
    }
}
项目:CauldronGit    文件:ClientCommandHandler.java   
public void autoComplete(String leftOfCursor, String full)
{
    latestAutoComplete = null;

    if (leftOfCursor.charAt(0) == '/')
    {
        leftOfCursor = leftOfCursor.substring(1);

        Minecraft mc = FMLClientHandler.instance().getClient();
        if (mc.currentScreen instanceof GuiChat)
        {
            @SuppressWarnings("unchecked")
            List<String> commands = getPossibleCommands(mc.thePlayer, leftOfCursor);
            if (commands != null && !commands.isEmpty())
            {
                if (leftOfCursor.indexOf(' ') == -1)
                {
                    for (int i = 0; i < commands.size(); i++)
                    {
                        commands.set(i, GRAY + "/" + commands.get(i) + RESET);
                    }
                }
                else
                {
                    for (int i = 0; i < commands.size(); i++)
                    {
                        commands.set(i, GRAY + commands.get(i) + RESET);
                    }
                }

                latestAutoComplete = commands.toArray(new String[commands.size()]);
            }
        }
    }
}
项目:BaublesHud    文件:HudBaubles.java   
@SideOnly(Side.CLIENT)
@SubscribeEvent(priority = EventPriority.LOW)
public void onRenderExperienceBar(RenderGameOverlayEvent event) 
{       
    if (event.isCancelable() || event.type != ElementType.ALL)
        return;

    LocX = ConfigBaublesHud.hudPositionX;
    LocY = ConfigBaublesHud.hudPositionY;
    isVertical = ConfigBaublesHud.isVertical;
    scale = ConfigBaublesHud.hudScale;
    if(isVertical == 0)
    {
        LocOffsetY = 15;
        LocOffsetX = 0;
    }
    if(isVertical == 1)
    {
        LocOffsetY = 0;
        LocOffsetX = 15;
    }

    if (mc.inGameHasFocus || mc.currentScreen == null || (mc.currentScreen instanceof GuiChat) || (mc.currentScreen instanceof GuiHud) && !mc.gameSettings.showDebugInfo)
    { 
        if(ConfigBaublesHud.enable == 0)
            drawBaublesHudIcons(event.resolution);
    }
}
项目:Resilience-Client-Source    文件:NetHandlerPlayClient.java   
/**
 * Displays the available command-completion options the server knows of
 */
public void handleTabComplete(S3APacketTabComplete p_147274_1_)
{
    String[] var2 = p_147274_1_.func_149630_c();

    if (this.gameController.currentScreen instanceof GuiChat)
    {
        GuiChat var3 = (GuiChat)this.gameController.currentScreen;
        var3.func_146406_a(var2);
    }
}
项目:Real-Life-Mod-1.8    文件:KeyHandler.java   
@SubscribeEvent
public void onKeyInput(KeyboardInputEvent event)
{
    if(FMLClientHandler.instance().isGUIOpen(GuiChat.class) || mc.currentScreen != null)
        return;

    EntityPlayer player = mc.thePlayer;
    Entity ridingEntity = player.ridingEntity;

    if(ridingEntity instanceof IControllable){
        IControllable riding =(IControllable)ridingEntity;

        if(mc.gameSettings.keyBindForward.isKeyDown())
            riding.pressKey(0, player);

        if(mc.gameSettings.keyBindBack.isKeyDown())
            riding.pressKey(1, player);

        if(mc.gameSettings.keyBindLeft.isKeyDown())
            riding.pressKey(2, player);

        if(mc.gameSettings.keyBindRight.isKeyDown())
            riding.pressKey(3, player);

        if(mc.gameSettings.keyBindJump.isKeyDown())
            riding.pressKey(4, player);

        if(downKey.isPressed())
            riding.pressKey(5, player);

        if(mc.gameSettings.keyBindSneak.isKeyDown())
            riding.pressKey(6, player);


    }
}
项目:TheDarkEra    文件:KeyHandler.java   
@SubscribeEvent
public void onKeyInput(InputEvent.KeyInputEvent event) {
    if (!FMLClientHandler.instance().isGUIOpen(GuiChat.class)) {
        int key = Keyboard.getEventKey();
        boolean isDown = Keyboard.getEventKeyState();

        if (isDown) {
            switch (key) {
            case Keyboard.KEY_Y:
                Minecraft mc = Minecraft.getMinecraft();
                int x = mc.objectMouseOver.blockX;
                int y = mc.objectMouseOver.blockY;
                int z = mc.objectMouseOver.blockZ;
                ExtendedPlayer props = ExtendedPlayer.get((EntityPlayer) Minecraft.getMinecraft().thePlayer);
                int a = props.getMaxMana();
                TheDarkEra.packetPipeline.sendToServer(new PacketGetMana(a + 10));
                break;
            case Keyboard.KEY_O:
                ShoutList.PreviousShout();
                break;
            case Keyboard.KEY_P:
                ShoutList.NextShout();
                break;
            default:
                break;
            }

        }
    }
}
项目:UniversalInputFixTest    文件:KeyHandler.java   
@SubscribeEvent
public void onKeyInput(InputEvent.KeyInputEvent event) {
    Minecraft mc = FMLClientHandler.instance().getClient();
    if (mc.thePlayer != null && !InputWindow.isFrameDisplayable()) {
        if (inputKey.isPressed()) {
            InputWindow.showGUI("");
            FMLClientHandler.instance().displayGuiScreen(FMLClientHandler.instance().getClient().thePlayer, new GuiChat());
        }
        if (commandKey.isPressed()) {
            InputWindow.showGUI("/");
            FMLClientHandler.instance().displayGuiScreen(FMLClientHandler.instance().getClient().thePlayer, new GuiChat());
        }
    }
}
项目:MobTotems    文件:KeyBindings.java   
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onKeyInput(InputEvent.KeyInputEvent event) {
    if (!FMLClientHandler.instance().isGUIOpen(GuiChat.class)) {
        if (keys[ACTIVATE_BAUBLE_KEY].isKeyDown() && !ACTIVATE_BAUBLE_KEY_PRESSED) {
            Network.sendToServer(new ActivateBaubleMessage());
            ACTIVATE_BAUBLE_KEY_PRESSED = true;
        } else if (!keys[ACTIVATE_BAUBLE_KEY].isKeyDown() && ACTIVATE_BAUBLE_KEY_PRESSED) {
            ACTIVATE_BAUBLE_KEY_PRESSED = false;
        }
    }
}
项目:enderutilities    文件:RenderEventHandler.java   
@SubscribeEvent
public void onRenderGameOverlay(RenderGameOverlayEvent.Post event)
{
    if (event.getType() != ElementType.ALL)
    {
        return;
    }

    if ((this.mc.currentScreen instanceof GuiChat) == false && this.mc.player != null)
    {
        this.buildersWandRenderer.renderHud(this.mc.player);
        this.rulerRenderer.renderHud();
        this.renderPlacementPropertiesHud(this.mc.player);
    }
}
项目:TapeMouse    文件:TapeMouse.java   
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void tickEvent(TickEvent.ClientTickEvent event)
{
    if (event.phase != TickEvent.Phase.START) return;
    if (Minecraft.getMinecraft().currentScreen instanceof GuiMainMenu) return;
    if (Minecraft.getMinecraft().currentScreen instanceof GuiChat) return;
    if (keyBinding == null) return;
    if (i++ < delay) return;
    i = 0;
    if (delay == 0) KeyBinding.setKeyBindState(keyBinding.getKeyCode(), true);
    KeyBinding.onTick(keyBinding.getKeyCode());
}
项目:Cauldron    文件:ClientCommandHandler.java   
public void autoComplete(String leftOfCursor, String full)
{
    latestAutoComplete = null;

    if (leftOfCursor.charAt(0) == '/')
    {
        leftOfCursor = leftOfCursor.substring(1);

        Minecraft mc = FMLClientHandler.instance().getClient();
        if (mc.currentScreen instanceof GuiChat)
        {
            @SuppressWarnings("unchecked")
            List<String> commands = getPossibleCommands(mc.thePlayer, leftOfCursor);
            if (commands != null && !commands.isEmpty())
            {
                if (leftOfCursor.indexOf(' ') == -1)
                {
                    for (int i = 0; i < commands.size(); i++)
                    {
                        commands.set(i, GRAY + "/" + commands.get(i) + RESET);
                    }
                }
                else
                {
                    for (int i = 0; i < commands.size(); i++)
                    {
                        commands.set(i, GRAY + commands.get(i) + RESET);
                    }
                }

                latestAutoComplete = commands.toArray(new String[commands.size()]);
            }
        }
    }
}
项目:Cauldron    文件:ClientCommandHandler.java   
public void autoComplete(String leftOfCursor, String full)
{
    latestAutoComplete = null;

    if (leftOfCursor.charAt(0) == '/')
    {
        leftOfCursor = leftOfCursor.substring(1);

        Minecraft mc = FMLClientHandler.instance().getClient();
        if (mc.currentScreen instanceof GuiChat)
        {
            @SuppressWarnings("unchecked")
            List<String> commands = getPossibleCommands(mc.thePlayer, leftOfCursor);
            if (commands != null && !commands.isEmpty())
            {
                if (leftOfCursor.indexOf(' ') == -1)
                {
                    for (int i = 0; i < commands.size(); i++)
                    {
                        commands.set(i, GRAY + "/" + commands.get(i) + RESET);
                    }
                }
                else
                {
                    for (int i = 0; i < commands.size(); i++)
                    {
                        commands.set(i, GRAY + commands.get(i) + RESET);
                    }
                }

                latestAutoComplete = commands.toArray(new String[commands.size()]);
            }
        }
    }
}
项目:Cauldron    文件:NetHandlerPlayClient.java   
public void handleTabComplete(S3APacketTabComplete p_147274_1_)
{
    String[] astring = p_147274_1_.func_149630_c();

    if (this.gameController.currentScreen instanceof GuiChat)
    {
        GuiChat guichat = (GuiChat)this.gameController.currentScreen;
        guichat.func_146406_a(astring);
    }
}
项目:Cauldron    文件:ClientCommandHandler.java   
public void autoComplete(String leftOfCursor, String full)
{
    latestAutoComplete = null;

    if (leftOfCursor.charAt(0) == '/')
    {
        leftOfCursor = leftOfCursor.substring(1);

        Minecraft mc = FMLClientHandler.instance().getClient();
        if (mc.currentScreen instanceof GuiChat)
        {
            @SuppressWarnings("unchecked")
            List<String> commands = getPossibleCommands(mc.thePlayer, leftOfCursor);
            if (commands != null && !commands.isEmpty())
            {
                if (leftOfCursor.indexOf(' ') == -1)
                {
                    for (int i = 0; i < commands.size(); i++)
                    {
                        commands.set(i, GRAY + "/" + commands.get(i) + RESET);
                    }
                }
                else
                {
                    for (int i = 0; i < commands.size(); i++)
                    {
                        commands.set(i, GRAY + commands.get(i) + RESET);
                    }
                }

                latestAutoComplete = commands.toArray(new String[commands.size()]);
            }
        }
    }
}
项目:Cauldron    文件:NetHandlerPlayClient.java   
public void handleTabComplete(S3APacketTabComplete p_147274_1_)
{
    String[] astring = p_147274_1_.func_149630_c();

    if (this.gameController.currentScreen instanceof GuiChat)
    {
        GuiChat guichat = (GuiChat)this.gameController.currentScreen;
        guichat.func_146406_a(astring);
    }
}
项目:SimplyJetpacks    文件:HUDTickHandler.java   
private static void tickEnd() {
    if (mc.thePlayer != null) {
        if ((mc.currentScreen == null || Config.showHUDWhileChatting && mc.currentScreen instanceof GuiChat) && !mc.gameSettings.hideGUI && !mc.gameSettings.showDebugInfo) {
            ItemStack chestplate = mc.thePlayer.getCurrentArmor(2);
            if (chestplate != null && chestplate.getItem() instanceof IHUDInfoProvider) {
                IHUDInfoProvider provider = (IHUDInfoProvider) chestplate.getItem();

                List<String> info = new ArrayList<String>();
                provider.addHUDInfo(info, chestplate, Config.enableFuelHUD, Config.enableStateHUD);
                if (info.isEmpty()) {
                    return;
                }

                GL11.glPushMatrix();
                mc.entityRenderer.setupOverlayRendering();
                GL11.glScaled(Config.HUDScale, Config.HUDScale, 1.0D);

                int i = 0;
                for (String s : info) {
                    RenderUtils.drawStringAtHUDPosition(s, HUDPositions.values()[Config.HUDPosition], mc.fontRenderer, Config.HUDOffsetX, Config.HUDOffsetY, Config.HUDScale, 0xeeeeee, true, i);
                    i++;
                }

                GL11.glPopMatrix();
            }
        }
    }
}
项目:Fluxed-Trinkets    文件:HudHandler.java   
private static void tickEnd() {
    if (mc.thePlayer != null) {
        mc.entityRenderer.setupOverlayRendering();

        long time = mc.theWorld.getWorldTime();
        mc.fontRenderer.drawString(String.valueOf(time), 5, 5, 0);
        if ((mc.currentScreen == null || mc.currentScreen instanceof GuiChat) && !mc.gameSettings.hideGUI && !mc.gameSettings.showDebugInfo) {
            // if (stopWatch != null && stopWatch.getItem() instanceof
            // ItemPocketWatch) {

            // }
        }
    }
}
项目:RuneCraftery    文件:NetClientHandler.java   
public void func_72461_a(Packet203AutoComplete p_72461_1_) {
   String[] var2 = p_72461_1_.func_73473_d().split("\u0000");
   if(this.field_72563_h.field_71462_r instanceof GuiChat) {
      GuiChat var3 = (GuiChat)this.field_72563_h.field_71462_r;
      var3.func_73894_a(var2);
   }

}
项目:RuneCraftery    文件:ClientCommandHandler.java   
public void autoComplete(String leftOfCursor, String full)
{
    latestAutoComplete = null;

    if (leftOfCursor.charAt(0) == '/')
    {
        leftOfCursor = leftOfCursor.substring(1);

        Minecraft mc = FMLClientHandler.instance().getClient();
        if (mc.currentScreen instanceof GuiChat)
        {
            List<String> commands = getPossibleCommands(mc.thePlayer, leftOfCursor);
            if (commands != null && !commands.isEmpty())
            {
                if (leftOfCursor.indexOf(' ') == -1)
                {
                    for (int i = 0; i < commands.size(); i++)
                    {
                        commands.set(i, GRAY + "/" + commands.get(i) + RESET);
                    }
                }
                else
                {
                    for (int i = 0; i < commands.size(); i++)
                    {
                        commands.set(i, GRAY + commands.get(i) + RESET);
                    }
                }

                latestAutoComplete = commands.toArray(new String[commands.size()]);
            }
        }
    }
}
项目:RuneCraftery    文件:NetClientHandler.java   
public void handleAutoComplete(Packet203AutoComplete par1Packet203AutoComplete)
{
    String[] astring = par1Packet203AutoComplete.getText().split("\u0000");

    if (this.mc.currentScreen instanceof GuiChat)
    {
        GuiChat guichat = (GuiChat)this.mc.currentScreen;
        guichat.func_73894_a(astring);
    }
}