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


Java GuiScreen類代碼示例

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


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

示例1: isCorrectModeActive

import net.minecraft.client.gui.GuiScreen; //導入依賴的package包/類
private boolean isCorrectModeActive()
{
    switch (mode.toLowerCase())
    {
        case MODE_SHIFT:
            return GuiScreen.isShiftKeyDown();
        case MODE_CTRL:
            return GuiScreen.isCtrlKeyDown();
        case MODE_ALT:
            return GuiScreen.isAltKeyDown();
        case MODE_NO_SHIFT:
            return !GuiScreen.isShiftKeyDown();
        case MODE_NO_CTRL:
            return !GuiScreen.isCtrlKeyDown();
        case MODE_NO_ALT:
            return !GuiScreen.isAltKeyDown();
        default:
            return true;
    }
}
 
開發者ID:cubex2,項目名稱:customstuff4,代碼行數:21,代碼來源:ToolTip.java

示例2: mouseClicked

import net.minecraft.client.gui.GuiScreen; //導入依賴的package包/類
@Override
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
    ItemStack programmedItem = te.getIteminProgrammingSlot();
    if (nameField.isFocused() && !programmedItem.isEmpty()) {
        programmedItem.setStackDisplayName(nameField.getText());
        NetworkHandler.sendToServer(new PacketUpdateTextfield(te, 0));
    }
    super.mouseClicked(mouseX, mouseY, mouseButton);

    if (mouseButton == 1 && showingWidgetProgress == 0) {
        IProgWidget widget = programmerUnit.getHoveredWidget(mouseX, mouseY);
        if (widget != null) {
            GuiScreen screen = widget.getOptionWindow(this);
            if (screen != null) mc.displayGuiScreen(screen);
        }
    }
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:18,代碼來源:GuiProgrammer.java

示例3: getNotificationScreen

import net.minecraft.client.gui.GuiScreen; //導入依賴的package包/類
public GuiScreenRealmsProxy getNotificationScreen(GuiScreen p_getNotificationScreen_1_)
{
    try
    {
        this.previousScreen = p_getNotificationScreen_1_;
        Class<?> oclass = Class.forName("com.mojang.realmsclient.gui.screens.RealmsNotificationsScreen");
        Constructor<?> constructor = oclass.getDeclaredConstructor(new Class[] {RealmsScreen.class});
        constructor.setAccessible(true);
        Object object = constructor.newInstance(new Object[] {this});
        return ((RealmsScreen)object).getProxy();
    }
    catch (ClassNotFoundException var5)
    {
        LOGGER.error("Realms module missing");
    }
    catch (Exception exception)
    {
        LOGGER.error((String)"Failed to load Realms module", (Throwable)exception);
    }

    return null;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:23,代碼來源:RealmsBridge.java

示例4: onDrawScreen

import net.minecraft.client.gui.GuiScreen; //導入依賴的package包/類
@Inject(method = "drawScreen", at = @At("HEAD"), cancellable = true)
public void onDrawScreen(int mouseX, int mouseY, float partialTicks, CallbackInfo ci) {
    Minecraft mc = Minecraft.getMinecraft();

    GuiScreen thisScreen = (GuiScreen) (Object) this;

    RenderGuiScreen renderGuiScreen = new RenderGuiScreen(thisScreen);
    EventManager.post(renderGuiScreen);

    if (renderGuiScreen.isCancelled()) {
        if (mc.currentScreen != null && mc.currentScreen != thisScreen) {
            mc.currentScreen.drawScreen(mouseX, mouseY, partialTicks);
        }
        ci.cancel();
    }

}
 
開發者ID:SerenityEnterprises,項目名稱:SerenityCE,代碼行數:18,代碼來源:MixinGuiScreen.java

示例5: addInformation

import net.minecraft.client.gui.GuiScreen; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack stack, @Nullable World player, List<String> tooltip, ITooltipFlag advanced) {
	if (NBTHelper.hasTag(stack, BrewUtils.BREW_DESC)) {
		tooltip.add(TextFormatting.ITALIC + I18n.format(NBTHelper.getString(stack, BrewUtils.BREW_DESC)));
	}
	if (GuiScreen.isShiftKeyDown()) {
		tooltip.add(TextFormatting.DARK_GRAY + "" + TextFormatting.ITALIC + I18n.format("tooltip.brew.data"));
		BrewUtils.addBrewTooltip(stack, tooltip);

		tooltip.add(TextFormatting.DARK_GRAY + "" + TextFormatting.ITALIC + I18n.format("tooltip.potion.data"));
		BrewUtils.addPotionTooltip(stack, tooltip);
	} else {
		tooltip.add(TextFormatting.DARK_GRAY + "" + TextFormatting.ITALIC + I18n.format("tooltip.shift_for_info"));
	}
}
 
開發者ID:Um-Mitternacht,項目名稱:Bewitchment,代碼行數:17,代碼來源:ItemBrew.java

示例6: setDimensionAndSpawnPlayer

import net.minecraft.client.gui.GuiScreen; //導入依賴的package包/類
public void setDimensionAndSpawnPlayer(int dimension)
{
    this.world.setInitialSpawnLocation();
    this.world.removeAllEntities();
    int i = 0;
    String s = null;

    if (this.player != null)
    {
        i = this.player.getEntityId();
        this.world.removeEntity(this.player);
        s = this.player.getServerBrand();
    }

    this.renderViewEntity = null;
    EntityPlayerSP entityplayersp = this.player;
    this.player = this.playerController.createClientPlayer(this.world, this.player == null ? new StatisticsManager() : this.player.getStatFileWriter());
    this.player.getDataManager().setEntryValues(entityplayersp.getDataManager().getAll());
    this.player.dimension = dimension;
    this.renderViewEntity = this.player;
    this.player.preparePlayerToSpawn();
    this.player.setServerBrand(s);
    this.world.spawnEntityInWorld(this.player);
    this.playerController.flipPlayer(this.player);
    this.player.movementInput = new MovementInputFromOptions(this.gameSettings);
    this.player.setEntityId(i);
    this.playerController.setPlayerCapabilities(this.player);
    this.player.setReducedDebug(entityplayersp.hasReducedDebug());

    if (this.currentScreen instanceof GuiGameOver)
    {
        this.displayGuiScreen((GuiScreen)null);
    }
}
 
開發者ID:NSExceptional,項目名稱:Zombe-Modpack,代碼行數:35,代碼來源:Minecraft.java

示例7: NetHandlerPlayClient

import net.minecraft.client.gui.GuiScreen; //導入依賴的package包/類
public NetHandlerPlayClient(Minecraft mcIn, GuiScreen p_i46300_2_, NetworkManager networkManagerIn, GameProfile profileIn)
{
    this.gameController = mcIn;
    this.guiScreenServer = p_i46300_2_;
    this.netManager = networkManagerIn;
    this.profile = profileIn;
}
 
開發者ID:NSExceptional,項目名稱:Zombe-Modpack,代碼行數:8,代碼來源:NetHandlerPlayClient.java

示例8: keyTyped

import net.minecraft.client.gui.GuiScreen; //導入依賴的package包/類
/**
 * Fired when a key is typed (except F11 which toggles full screen). This is the equivalent of
 * KeyListener.keyTyped(KeyEvent e). Args : character (character on the key), keyCode (lwjgl Keyboard key code)
 */
protected void keyTyped(char typedChar, int keyCode) throws IOException
{
    if (keyCode == this.mc.gameSettings.keyBindInventory.getKeyCode())
    {
        this.mc.displayGuiScreen((GuiScreen)null);
        this.mc.setIngameFocus();
    }
    else
    {
        super.keyTyped(typedChar, keyCode);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:17,代碼來源:GuiAchievements.java

示例9: GuiAchievements

import net.minecraft.client.gui.GuiScreen; //導入依賴的package包/類
public GuiAchievements(GuiScreen parentScreenIn, StatFileWriter statFileWriterIn)
{
    this.parentScreen = parentScreenIn;
    this.statFileWriter = statFileWriterIn;
    int i = 141;
    int j = 141;
    this.field_146569_s = this.field_146567_u = this.field_146565_w = (double)(AchievementList.openInventory.displayColumn * 24 - i / 2 - 12);
    this.field_146568_t = this.field_146566_v = this.field_146573_x = (double)(AchievementList.openInventory.displayRow * 24 - j / 2);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:10,代碼來源:GuiAchievements.java

示例10: DrawScreenEvent

import net.minecraft.client.gui.GuiScreen; //導入依賴的package包/類
public DrawScreenEvent(GuiScreen gui, int mouseX, int mouseY, float renderPartialTicks)
{
    super(gui);
    this.mouseX = mouseX;
    this.mouseY = mouseY;
    this.renderPartialTicks = renderPartialTicks;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:8,代碼來源:GuiScreenEvent.java

示例11: GuiStreamUnavailable

import net.minecraft.client.gui.GuiScreen; //導入依賴的package包/類
public GuiStreamUnavailable(GuiScreen parentScreenIn, GuiStreamUnavailable.Reason p_i46311_2_, List<ChatComponentTranslation> p_i46311_3_)
{
    this.field_152324_f = new ChatComponentTranslation("stream.unavailable.title", new Object[0]);
    this.field_152323_r = Lists.<String>newArrayList();
    this.parentScreen = parentScreenIn;
    this.field_152326_h = p_i46311_2_;
    this.field_152327_i = p_i46311_3_;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:9,代碼來源:GuiStreamUnavailable.java

示例12: modifyButton

import net.minecraft.client.gui.GuiScreen; //導入依賴的package包/類
private void modifyButton(GuiScreen gui, GuiButton button)
{
    if (text != null)
    {
        button.displayString = text;
    }

    if (width != Length.ZERO)
    {
        button.width = width.getLength(gui.width);
    }

    if (height != Length.ZERO)
    {
        button.height = height.getLength(gui.height);
    }

    if (offsetX != Length.ZERO)
    {
        button.x = getLeft(gui, button.width);
    }

    if (offsetY != Length.ZERO)
    {
        button.y = getTop(gui, button.height);
    }
}
 
開發者ID:cubex2,項目名稱:customstuff4,代碼行數:28,代碼來源:GuiModifier.java

示例13: GuiConnecting

import net.minecraft.client.gui.GuiScreen; //導入依賴的package包/類
public GuiConnecting(GuiScreen p_i1181_1_, Minecraft mcIn, ServerData p_i1181_3_)
{
    this.mc = mcIn;
    this.previousGuiScreen = p_i1181_1_;
    ServerAddress serveraddress = ServerAddress.func_78860_a(p_i1181_3_.serverIP);
    mcIn.loadWorld((WorldClient)null);
    mcIn.setServerData(p_i1181_3_);
    this.connect(serveraddress.getIP(), serveraddress.getPort());
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:10,代碼來源:GuiConnecting.java

示例14: actionPerformed

import net.minecraft.client.gui.GuiScreen; //導入依賴的package包/類
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button) throws IOException
{
    if (button.enabled)
    {
        if (button.id == 0)
        {
            this.tileSign.markDirty();
            this.mc.displayGuiScreen((GuiScreen)null);
        }
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:15,代碼來源:GuiEditSign.java

示例15: setDimensionAndSpawnPlayer

import net.minecraft.client.gui.GuiScreen; //導入依賴的package包/類
public void setDimensionAndSpawnPlayer(int dimension)
{
    this.theWorld.setInitialSpawnLocation();
    this.theWorld.removeAllEntities();
    int i = 0;
    String s = null;

    if (this.thePlayer != null)
    {
        i = this.thePlayer.getEntityId();
        this.theWorld.removeEntity(this.thePlayer);
        s = this.thePlayer.getClientBrand();
    }

    this.renderViewEntity = null;
    EntityPlayerSP entityplayersp = this.thePlayer;
    this.thePlayer = this.playerController.func_178892_a(this.theWorld, this.thePlayer == null ? new StatFileWriter() : this.thePlayer.getStatFileWriter());
    this.thePlayer.getDataWatcher().updateWatchedObjectsFromList(entityplayersp.getDataWatcher().getAllWatched());
    this.thePlayer.dimension = dimension;
    this.renderViewEntity = this.thePlayer;
    this.thePlayer.preparePlayerToSpawn();
    this.thePlayer.setClientBrand(s);
    this.theWorld.spawnEntityInWorld(this.thePlayer);
    this.playerController.flipPlayer(this.thePlayer);
    this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings);
    this.thePlayer.setEntityId(i);
    this.playerController.setPlayerCapabilities(this.thePlayer);
    this.thePlayer.setReducedDebug(entityplayersp.hasReducedDebug());

    if (this.currentScreen instanceof GuiGameOver)
    {
        this.displayGuiScreen((GuiScreen)null);
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:35,代碼來源:Minecraft.java


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