use of net.minecraft.client.gui.GuiChat in project MinecraftForge by MinecraftForge.
the class ClientCommandHandler method autoComplete.
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 = getTabCompletions(mc.player, leftOfCursor, mc.player.getPosition());
if (!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()]);
}
}
}
}
use of net.minecraft.client.gui.GuiChat in project Railcraft by Railcraft.
the class AuraKeyHandler method tick.
@SubscribeEvent
public void tick(TickEvent.ClientTickEvent event) {
if (Minecraft.getMinecraft().currentScreen instanceof GuiChat)
return;
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
for (Map.Entry<GoggleAura, KeyBinding> keyBinding : keyBindings.entrySet()) {
if (keyBinding.getValue().isPressed()) {
GoggleAura aura = keyBinding.getKey();
if (isAuraEnabled(aura)) {
activeAuras.remove(aura);
ChatPlugin.sendLocalizedChat(player, "gui.railcraft.aura.disable", "§5" + aura + "§7");
} else {
activeAuras.add(aura);
ChatPlugin.sendLocalizedChat(player, "gui.railcraft.aura.enable", "§5" + aura + "§7");
}
}
}
}
use of net.minecraft.client.gui.GuiChat in project SimplyJetpacks by Tonius.
the class HUDTickHandler method tickEnd.
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();
}
}
}
}
Aggregations