當前位置: 首頁>>代碼示例>>Java>>正文


Java GuiChat類代碼示例

本文整理匯總了Java中net.minecraft.client.gui.GuiChat的典型用法代碼示例。如果您正苦於以下問題:Java GuiChat類的具體用法?Java GuiChat怎麽用?Java GuiChat使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GuiChat類屬於net.minecraft.client.gui包,在下文中一共展示了GuiChat類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: shouldAllowWalking

import net.minecraft.client.gui.GuiChat; //導入依賴的package包/類
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());
}
 
開發者ID:null-dev,項目名稱:EvenWurse,代碼行數:18,代碼來源:MenuWalkMod.java

示例2: shouldDisplayTankGui

import net.minecraft.client.gui.GuiChat; //導入依賴的package包/類
@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;

}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:22,代碼來源:OxygenUtil.java

示例3: onKeyInput

import net.minecraft.client.gui.GuiChat; //導入依賴的package包/類
@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);
        }
    }
}
 
開發者ID:TimVerhaegen,項目名稱:Lotr_Mod_Addons,代碼行數:24,代碼來源:CustomKeyHandler.java

示例4: canDisplayInfoBar

import net.minecraft.client.gui.GuiChat; //導入依賴的package包/類
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;
}
 
開發者ID:tiffit,項目名稱:TaleCraft,代碼行數:16,代碼來源:InfoBar.java

示例5: onKeyInput

import net.minecraft.client.gui.GuiChat; //導入依賴的package包/類
@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() );
		}
	}
}
 
開發者ID:MichaelHillcox,項目名稱:XRay-Mod,代碼行數:17,代碼來源:KeyBindingHandler.java

示例6: onMouseInput

import net.minecraft.client.gui.GuiChat; //導入依賴的package包/類
@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));
	}
}
 
開發者ID:TheDarkEra,項目名稱:TheDarkEra,代碼行數:17,代碼來源:KeyHandler.java

示例7: onTick

import net.minecraft.client.gui.GuiChat; //導入依賴的package包/類
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);
	}
	
}
 
開發者ID:NomNuggetNom,項目名稱:mcpvp-mod,代碼行數:25,代碼來源:AllTick.java

示例8: textRenderEvent

import net.minecraft.client.gui.GuiChat; //導入依賴的package包/類
@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);
    }
}
 
開發者ID:dries007,項目名稱:TapeMouse,代碼行數:19,代碼來源:TapeMouse.java

示例9: onOpenGui

import net.minecraft.client.gui.GuiChat; //導入依賴的package包/類
@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 "));
		}
	}
}
 
開發者ID:blay09,項目名稱:HardcoreRevival,代碼行數:11,代碼來源:TeamUpAddon.java

示例10: onInitGui

import net.minecraft.client.gui.GuiChat; //導入依賴的package包/類
@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);
	}
}
 
開發者ID:blay09,項目名稱:HardcoreRevival,代碼行數:9,代碼來源:PingAddon.java

示例11: onInitGui

import net.minecraft.client.gui.GuiChat; //導入依賴的package包/類
@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);
	}
}
 
開發者ID:blay09,項目名稱:HardcoreRevival,代碼行數:12,代碼來源:ClientProxy.java

示例12: onDrawScreen

import net.minecraft.client.gui.GuiChat; //導入依賴的package包/類
@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;
	}
}
 
開發者ID:blay09,項目名稱:HardcoreRevival,代碼行數:30,代碼來源:ClientProxy.java

示例13: handleTabComplete

import net.minecraft.client.gui.GuiChat; //導入依賴的package包/類
/**
 * 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);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:15,代碼來源:NetHandlerPlayClient.java

示例14: handleTabComplete

import net.minecraft.client.gui.GuiChat; //導入依賴的package包/類
/**
 * 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);
	}
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:13,代碼來源:NetHandlerPlayClient.java

示例15: isChatOpen

import net.minecraft.client.gui.GuiChat; //導入依賴的package包/類
public static boolean isChatOpen() {
	if (Minecraft.getMinecraft().currentScreen != null) {
		if (Minecraft.getMinecraft().currentScreen instanceof GuiChat) {
			return true;
		}
	}
	return false;
}
 
開發者ID:Moudoux,項目名稱:EMC,代碼行數:9,代碼來源:IMinecraft.java


注:本文中的net.minecraft.client.gui.GuiChat類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。