本文整理匯總了Java中net.minecraft.client.Minecraft.displayGuiScreen方法的典型用法代碼示例。如果您正苦於以下問題:Java Minecraft.displayGuiScreen方法的具體用法?Java Minecraft.displayGuiScreen怎麽用?Java Minecraft.displayGuiScreen使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.Minecraft
的用法示例。
在下文中一共展示了Minecraft.displayGuiScreen方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: handleKeys
import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
@SubscribeEvent
public static void handleKeys(InputEvent ev) // Not a mistake, I want both kb & mouse events handled.
{
Minecraft mc = Minecraft.getMinecraft();
while (keyOpenToolMenu.isPressed())
{
if (mc.currentScreen == null)
{
ItemStack inHand = mc.player.getHeldItemMainhand();
if (Config.isItemStackAllowed(inHand))
{
BeltFinder.BeltGetter getter = BeltFinder.instance.findStack(mc.player);
if (getter == null)
return;
mc.displayGuiScreen(new GuiRadialMenu(getter));
}
}
}
}
示例2: keyListener
import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
@SubscribeEvent
public void keyListener(KeyInputEvent event) throws IOException {
if (EasyLogin.logingui.isPressed()) {
Minecraft mc = Minecraft.getMinecraft();
mc.displayGuiScreen(new MainGui(mc.currentScreen));
// 密碼讀取
InputStream in = new BufferedInputStream(new FileInputStream("config/easylogin.properties"));
prop.load(in);
// 解密密碼
byte[] passwordByte = prop.getProperty("PassWord").getBytes();
byte key = 124;
for (int i = 0; i < passwordByte.length; i++) {
passwordByte[i] ^= key;
}
MainGui.settext(new String(passwordByte));
System.out.println(new String(passwordByte));
}
}
示例3: handleClick
import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
public boolean handleClick(Minecraft minecraft, int mouseX, int mouseY, int mouseButton) {
if (button.mousePressed(minecraft, mouseX, mouseY)) {
button.playPressSound(minecraft.getSoundHandler());
minecraft.displayGuiScreen(new GUIBookPage(null, null, entry));
return true;
}
return false;
}
示例4: mousePressed
import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
@Override
public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) {
boolean pressed = super.mousePressed(mc, mouseX - this.parentGui.getGuiLeft(), mouseY);
if (pressed)
if(directionToInventory)
HarshenClientUtils.openInventory();
else
mc.displayGuiScreen(new GuiInventory(mc.player));
return pressed;
}
示例5: openFriendsGui
import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
@Override
public void openFriendsGui()
{
Minecraft mc = Minecraft.getMinecraft();
if (CreeperHost.instance.handledInvite == null)
{
mc.displayGuiScreen(new GuiFriendsList(mc.currentScreen));
}
else
{
mc.displayGuiScreen(new GuiInvited(CreeperHost.instance.handledInvite, mc.currentScreen));
CreeperHost.instance.handledInvite = null;
}
}
示例6: reconnectToLastServer
import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
public static void reconnectToLastServer(GuiScreen prevScreen)
{
if(lastServer == null)
return;
currentServerIP = lastServer.getServerData().serverIP;
if(!currentServerIP.contains(":"))
currentServerIP += ":25565";
Minecraft mc = Minecraft.getMinecraft();
mc.displayGuiScreen(
new GuiConnecting(prevScreen, mc, lastServer.getServerData()));
}
示例7: onKeyPress
import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
@SubscribeEvent
public static void onKeyPress(InputEvent.KeyInputEvent event) {
Minecraft mc = Minecraft.getMinecraft();
AbstractPlayerDamageModel damageModel = PlayerDataManager.getDamageModel(mc.player);
if (ClientProxy.showWounds.isPressed()) {
if (!damageModel.hasTutorial) {
damageModel.hasTutorial = true;
PlayerDataManager.tutorialDone.add(mc.player.getName());
Minecraft.getMinecraft().displayGuiScreen(new GuiTutorial());
}
else {
mc.displayGuiScreen(new GuiHealthScreen(damageModel));
}
}
}
示例8: actionPerformed
import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
@Override
public void actionPerformed(GuiButton button) {
Minecraft mc = FMLClientHandler.instance().getClient();
CoordTrackUpgradeHandler coordHandler = HUDHandler.instance().getSpecificRenderer(CoordTrackUpgradeHandler.class);
switch (button.id) {
case 10:
mc.displayGuiScreen(null);
mc.setIngameFocus();
coordHandler.isListeningToCoordTrackerSetting = true;
HUDHandler.instance().addMessage(new ArmorMessage("Changing Coordinate Tracker coordinate...", Arrays.asList("Right-click the desired coordinate"), 90, 0x7000AA00));
break;
case 11:
mc.displayGuiScreen(null);
mc.setIngameFocus();
switch (coordHandler.navigateToSurface(mc.player)) {
case EASY_PATH:
HUDHandler.instance().addMessage(new ArmorMessage(I18n.format("pneumaticHelmet.message.coordinateTracker.routeFound"), new ArrayList<String>(), 90, 0x7000AA00));
break;
case DRONE_PATH:
HUDHandler.instance().addMessage(new ArmorMessage(I18n.format("pneumaticHelmet.message.coordinateTracker.harderRouteFound"), new ArrayList<String>(), 90, 0x7044AA00));
break;
case NO_PATH:
HUDHandler.instance().addMessage(new ArmorMessage(I18n.format("pneumaticHelmet.message.coordinateTracker.noRouteFound"), new ArrayList<String>(), 90, 0x70FF0000));
break;
}
break;
case 12:
coordHandler.pathEnabled = !coordHandler.pathEnabled;
break;
case 13:
coordHandler.wirePath = !coordHandler.wirePath;
break;
case 14:
coordHandler.xRayEnabled = !coordHandler.xRayEnabled;
break;
case 15:
coordHandler.pathUpdateSetting++;
if (coordHandler.pathUpdateSetting > 2) {
coordHandler.pathUpdateSetting = 0;
}
break;
}
updateButtonTexts();
coordHandler.saveToConfig();
}
示例9: onClientTick
import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event) {
if (event.side == Side.CLIENT && event.phase == TickEvent.Phase.START) {
Minecraft mc = Minecraft.getMinecraft();
if (mc.player != null) {
if(mc.player.getHealth() <= 0f) {
if(!isKnockedOut && !acceptedDeath) {
// The player is now knocked out
deathTime = 0;
isKnockedOut = true;
mc.displayGuiScreen(new GuiChat());
// if(mc.currentScreen != null) {
// Re-initialize the GUI to fire button hooks
// ScaledResolution resolution = new ScaledResolution(mc);
// mc.currentScreen.setWorldAndResolution(mc, resolution.getScaledWidth(), resolution.getScaledHeight());
// }
}
// Prevent deathTime from removing the entity from the world
if(mc.player.deathTime == 19) {
mc.player.deathTime = 18;
}
// Instead, increase our own counter
deathTime++;
} else {
isKnockedOut = false;
acceptedDeath = false;
deathTime = 0;
// If right mouse is held down, send revival packet
if(Mouse.isButtonDown(1)) {
if(!isRescuing) {
NetworkHandler.instance.sendToServer(new MessageRevival(true));
isRescuing = true;
}
} else {
if(isRescuing) {
NetworkHandler.instance.sendToServer(new MessageRevival(false));
isRescuing = false;
}
}
}
}
}
}
示例10: func_152321_a
import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
public static void func_152321_a(GuiScreen p_152321_0_)
{
Minecraft minecraft = Minecraft.getMinecraft();
IStream istream = minecraft.getTwitchStream();
if (!OpenGlHelper.framebufferSupported)
{
List<ChatComponentTranslation> list = Lists.<ChatComponentTranslation>newArrayList();
list.add(new ChatComponentTranslation("stream.unavailable.no_fbo.version", new Object[] {GL11.glGetString(GL11.GL_VERSION)}));
list.add(new ChatComponentTranslation("stream.unavailable.no_fbo.blend", new Object[] {Boolean.valueOf(GLContext.getCapabilities().GL_EXT_blend_func_separate)}));
list.add(new ChatComponentTranslation("stream.unavailable.no_fbo.arb", new Object[] {Boolean.valueOf(GLContext.getCapabilities().GL_ARB_framebuffer_object)}));
list.add(new ChatComponentTranslation("stream.unavailable.no_fbo.ext", new Object[] {Boolean.valueOf(GLContext.getCapabilities().GL_EXT_framebuffer_object)}));
minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.NO_FBO, list));
}
else if (istream instanceof NullStream)
{
if (((NullStream)istream).func_152937_a().getMessage().contains("Can\'t load AMD 64-bit .dll on a IA 32-bit platform"))
{
minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.LIBRARY_ARCH_MISMATCH));
}
else
{
minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.LIBRARY_FAILURE));
}
}
else if (!istream.func_152928_D() && istream.func_152912_E() == ErrorCode.TTV_EC_OS_TOO_OLD)
{
switch (Util.getOSType())
{
case WINDOWS:
minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.UNSUPPORTED_OS_WINDOWS));
break;
case OSX:
minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.UNSUPPORTED_OS_MAC));
break;
default:
minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.UNSUPPORTED_OS_OTHER));
}
}
else if (!minecraft.getTwitchDetails().containsKey("twitch_access_token"))
{
if (minecraft.getSession().getSessionType() == Session.Type.LEGACY)
{
minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.ACCOUNT_NOT_MIGRATED));
}
else
{
minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.ACCOUNT_NOT_BOUND));
}
}
else if (!istream.func_152913_F())
{
switch (istream.func_152918_H())
{
case INVALID_TOKEN:
minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.FAILED_TWITCH_AUTH));
break;
case ERROR:
default:
minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.FAILED_TWITCH_AUTH_ERROR));
}
}
else if (istream.func_152912_E() != null)
{
List<ChatComponentTranslation> list1 = Arrays.<ChatComponentTranslation>asList(new ChatComponentTranslation[] {new ChatComponentTranslation("stream.unavailable.initialization_failure.extra", new Object[]{ErrorCode.getString(istream.func_152912_E())})});
minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.INITIALIZATION_FAILURE, list1));
}
else
{
minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.UNKNOWN));
}
}
示例11: showGuiApplyHealth
import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
@Override
public void showGuiApplyHealth(EnumHand activeHand) {
Minecraft mc = Minecraft.getMinecraft();
GuiHealthScreen.INSTANCE = new GuiHealthScreen(PlayerDataManager.getDamageModel(mc.player), activeHand);
mc.displayGuiScreen(GuiHealthScreen.INSTANCE);
}