当前位置: 首页>>代码示例>>Java>>正文


Java GuiScreen.isShiftKeyDown方法代码示例

本文整理汇总了Java中net.minecraft.client.gui.GuiScreen.isShiftKeyDown方法的典型用法代码示例。如果您正苦于以下问题:Java GuiScreen.isShiftKeyDown方法的具体用法?Java GuiScreen.isShiftKeyDown怎么用?Java GuiScreen.isShiftKeyDown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.gui.GuiScreen的用法示例。


在下文中一共展示了GuiScreen.isShiftKeyDown方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: drawTooltip

import net.minecraft.client.gui.GuiScreen; //导入方法依赖的package包/类
private static void drawTooltip(GuiScreen gui, int mouseX, int mouseY)
{
    List<String> tooltip = new ArrayList<String>();
    if(Twitchy.isLive) {
        if (GuiScreen.isShiftKeyDown()) {
            tooltip.add("Stream Title:" + " " + "\u00A79" + Twitchy.streamTitle);
            tooltip.add("Current Game:" + " " + "\u00A72" + Twitchy.streamGame);
            tooltip.add("Current Viewers:" + " " + "\u00A74" + Twitchy.streamViewers);
        }else
            tooltip.add("Click to watch " + "\u00A76" + CHANNEL + " " + "\u00A7flive on Twitch!");
        if (!GuiScreen.isShiftKeyDown())
            tooltip.add(TextFormatting.AQUA + I18n.format("press.for.info.name", "SHIFT"));
    }else
        tooltip.add("\u00A76" + CHANNEL +"'s" + "\u00A7f offline. Click to go to their channel.");

    GuiUtils.drawHoveringText(tooltip, mouseX, mouseY + 20, gui.width, gui.height, -1, mc.fontRenderer);
}
 
开发者ID:OCDiary,项目名称:Twitchy,代码行数:18,代码来源:TCDrawScreen.java

示例3: addInformation

import net.minecraft.client.gui.GuiScreen; //导入方法依赖的package包/类
@Override
public void addInformation(ItemStack stack, World player, List<String> tooltip, ITooltipFlag advanced) {
	if(GuiScreen.isShiftKeyDown()){
		tooltip.add("Collects creosote oil produced by log/coal piles above");
		tooltip.add("Collection area is a 9x9 '+' shape");
		tooltip.add("Piles need to be connected to funnel");
		tooltip.add("Creosote oil only flows down between piles");
		tooltip.add("If redstone signal is applied:");
		tooltip.add("-Funnel will also collect from neighboring funnels");
		tooltip.add("-Funnel will auto output creosote oil");
		tooltip.add("Creosote oil can only be extracted from the bottom");
		tooltip.add("A line of funnels works best");
	}else{
		tooltip.add("<Hold Shift>");
	}
}
 
开发者ID:EnderiumSmith,项目名称:CharcoalPit,代码行数:17,代码来源:BlockCreosoteCollector.java

示例4: addInformation

import net.minecraft.client.gui.GuiScreen; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack is, @Nullable World worldIn, List<String> list, ITooltipFlag flag)
{
    NBTTagCompound tag = is.getTagCompound();
    if(tag != null)
    {
        Instrument instrument = InstrumentLibrary.getInstrumentByName(tag.getString("itemName"));
        if(instrument != null)
        {
            list.add(I18n.translateToLocal("item.clef.instrument." + instrument.info.itemName + ".desc"));
            list.add(I18n.translateToLocal(instrument.info.twoHanded && Clef.config.allowOneHandedTwoHandedInstrumentUse == 0 ? "clef.item.twoHanded" : "clef.item.oneHanded"));
            if(GuiScreen.isShiftKeyDown())
            {
                list.add("");
                list.add(I18n.translateToLocal("clef.item.packName") + ": " + instrument.packInfo.packName);
                list.add(I18n.translateToLocal("clef.item.itemName") + ": " + instrument.info.itemName);
            }
        }
    }
}
 
开发者ID:iChun,项目名称:Clef,代码行数:22,代码来源:ItemInstrument.java

示例5: 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

示例6: addInformation

import net.minecraft.client.gui.GuiScreen; //导入方法依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
    if(OinkConfig.pEffects) {
        tooltip.add("3rd step towards the Ultimate Pork Chop!");
        if (GuiScreen.isShiftKeyDown()) {
            tooltip.add("Strength");
            tooltip.add("Regeneration");
            tooltip.add("Resistance");
            tooltip.add("Fire Resistance");
            tooltip.add("Haste");
            tooltip.add("Speed");
            tooltip.add("Night Vision");
        }
        if (!GuiScreen.isShiftKeyDown())
            tooltip.add(TextFormatting.AQUA + I18n.format("press.for.info.name", "SHIFT"));
    }else if(!OinkConfig.pEffects) {
        tooltip.add("3rd step towards the Ultimate Pork Chop!");
    }
}
 
开发者ID:OCDiary,项目名称:TheOink,代码行数:21,代码来源:OinkDiamondPorkChop.java

示例7: addInformation

import net.minecraft.client.gui.GuiScreen; //导入方法依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
    if(OinkConfig.pEffects) {
        tooltip.add("1st step towards the Ultimate Pork Chop!");
        if (GuiScreen.isShiftKeyDown()) {
            tooltip.add("Haste");
            tooltip.add("Speed");
            tooltip.add("Night Vision");
        }
        if (!GuiScreen.isShiftKeyDown())
            tooltip.add(TextFormatting.AQUA + I18n.format("press.for.info.name", "SHIFT"));
    }else if(!OinkConfig.pEffects) {
        tooltip.add("1st step towards the Ultimate Pork Chop!");
    }

}
 
开发者ID:OCDiary,项目名称:TheOink,代码行数:18,代码来源:OinkIronPorkChop.java

示例8: addInformation

import net.minecraft.client.gui.GuiScreen; //导入方法依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
    if(OinkConfig.pEffects) {
        tooltip.add("2nd step towards the Ultimate Pork Chop!");
        if (GuiScreen.isShiftKeyDown()) {
            tooltip.add("Resistance");
            tooltip.add("Fire Resistance");
            tooltip.add("Haste");
            tooltip.add("Speed");
            tooltip.add("Night Vision");
        }
        if (!GuiScreen.isShiftKeyDown())
            tooltip.add(TextFormatting.AQUA + I18n.format("press.for.info.name", "SHIFT"));
    }else if(!OinkConfig.pEffects) {
        tooltip.add("2nd step towards the Ultimate Pork Chop!");
    }

}
 
开发者ID:OCDiary,项目名称:TheOink,代码行数:20,代码来源:OinkGoldPorkChop.java

示例9: onTooltip

import net.minecraft.client.gui.GuiScreen; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onTooltip(ItemTooltipEvent event) {
    if (Block.getBlockFromItem(event.getItemStack().getItem()) == Blocks.AIR) return;
    Block block = Block.getBlockFromItem(event.getItemStack().getItem());
    if (block instanceof IHasAdvancedTooltip && !((IHasAdvancedTooltip) block).getTooltip(event.getItemStack()).isEmpty()) {
        if (!GuiScreen.isShiftKeyDown()) {
            event.getToolTip().add(new TextComponentTranslation("text.industrialforegoing.tooltip.hold_shift").getFormattedText());
        } else {
            event.getToolTip().addAll(((IHasAdvancedTooltip) block).getTooltip(event.getItemStack()));
        }
    }
}
 
开发者ID:Buuz135,项目名称:Industrial-Foregoing,代码行数:14,代码来源:IFTooltipEvent.java

示例10: handleMinecraftKey

import net.minecraft.client.gui.GuiScreen; //导入方法依赖的package包/类
public boolean handleMinecraftKey(int key)
{
    Collection<KeyAction> actions = actionByMinecraftKey.get(key);
    for (KeyAction action : actions)
    {
        if (action.shift == GuiScreen.isShiftKeyDown() &&
                action.ctrl == GuiScreen.isCtrlKeyDown())
        {
            action.action.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_FIRST, ""));
            return true;
        }
    }

    return false;
}
 
开发者ID:ObsidianSuite,项目名称:ObsidianSuite,代码行数:16,代码来源:KeyMapping.java

示例11: addInformation

import net.minecraft.client.gui.GuiScreen; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {

    int damage = stack.getMaxDamage() - stack.getItemDamage() ;

    tooltip.add("Uses Left: \u00A7c" + damage);
    if (GuiScreen.isShiftKeyDown()) {
        tooltip.add(tooltipInfo);
    }
    if (!GuiScreen.isShiftKeyDown())
        tooltip.add(TextFormatting.AQUA + I18n.format("press.for.info.name", "SHIFT"));
}
 
开发者ID:OCDiary,项目名称:TheOink,代码行数:14,代码来源:OinkTools.java

示例12: keyTyped

import net.minecraft.client.gui.GuiScreen; //导入方法依赖的package包/类
@Override
protected void keyTyped(char par1, int par2) throws IOException {
    if (par2 == Keyboard.KEY_ESCAPE) {
        NetworkHandler.sendToServer(new PacketAphorismTileUpdate(tile));
    } else if (par2 == Keyboard.KEY_LEFT || par2 == Keyboard.KEY_UP) {
        cursorY--;
        if (cursorY < 0) cursorY = textLines.length - 1;
    } else if (par2 == Keyboard.KEY_DOWN || par2 == Keyboard.KEY_NUMPADENTER) {
        cursorY++;
        if (cursorY >= textLines.length) cursorY = 0;
    } else if (par2 == Keyboard.KEY_RETURN) {
        cursorY++;
        textLines = ArrayUtils.add(textLines, cursorY, "");
    } else if (par2 == Keyboard.KEY_BACK) {
        if (textLines[cursorY].length() > 0) {
            textLines[cursorY] = textLines[cursorY].substring(0, textLines[cursorY].length() - 1);
            if (textLines[cursorY].endsWith("\u00a7")) {
                textLines[cursorY] = textLines[cursorY].substring(0, textLines[cursorY].length() - 1);
            }
        } else if (textLines.length > 1) {
            textLines = ArrayUtils.remove(textLines, cursorY);
            cursorY--;
            if (cursorY < 0) cursorY = 0;
        }
    } else if (par2 == Keyboard.KEY_DELETE) {
        if (GuiScreen.isShiftKeyDown()) {
            textLines = new String[1];
            textLines[0] = "";
            cursorY = 0;
        } else {
            if (textLines.length > 1) {
                textLines = ArrayUtils.remove(textLines, cursorY);
                if (cursorY > textLines.length - 1)
                    cursorY = textLines.length - 1;
            }
        }
    } else if (ChatAllowedCharacters.isAllowedCharacter(par1)) {
        if (GuiScreen.isAltKeyDown()) {
            if (par1 >= 'a' && par1 <= 'f' || par1 >= 'l' && par1 <= 'o' || par1 == 'r' || par1 >= '0' && par1 <= '9') {
                textLines[cursorY] = textLines[cursorY] + "\u00a7" + par1;
            }
        } else {
            textLines[cursorY] = textLines[cursorY] + par1;
        }
    }
    tile.setTextLines(textLines);
    super.keyTyped(par1, par2);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:49,代码来源:GuiAphorismTile.java

示例13: addInformation

import net.minecraft.client.gui.GuiScreen; //导入方法依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {

    if(OinkConfig.pEffects && OinkConfig.oFly) {
        tooltip.add("This is the ultimate porkchop, effects, flight, it does it all!");
        if (GuiScreen.isShiftKeyDown()) {
            tooltip.add("\u00A7k Enjoy" + "\u00A7k Enjoy" + "\u00A7k Enjoy");
            tooltip.add("Oink Flight");
            tooltip.add("Strength");
            tooltip.add("Regeneration");
            tooltip.add("Resistance");
            tooltip.add("Fire Resistance");
            tooltip.add("Haste");
            tooltip.add("Speed");
            tooltip.add("Night Vision");
            tooltip.add("Oh... It also gives you XP for good measure :P");
        }
    }else if(OinkConfig.oFly && !OinkConfig.pEffects) {
        tooltip.add("This is the ultimate porkchop, so it gives the ultimate reward... FLIGHT!");
        if (GuiScreen.isShiftKeyDown()) {
            tooltip.add("\u00A7k Enjoy" + "\u00A7k Enjoy" + "\u00A7k Enjoy");
            tooltip.add("Oink Flight");
            tooltip.add("Oh... It also gives you XP for good measure :P");
        } else if (!OinkConfig.oFly && OinkConfig.pEffects) {
            tooltip.add("This is the ultimate porkchop, effects it does them all!");
            if (GuiScreen.isShiftKeyDown()) {
                tooltip.add("\u00A7k Enjoy" + "\u00A7k Enjoy" + "\u00A7k Enjoy");
                tooltip.add("Strength");
                tooltip.add("Regeneration");
                tooltip.add("Resistance");
                tooltip.add("Fire Resistance");
                tooltip.add("Haste ");
                tooltip.add("Speed");
                tooltip.add("Night Vision");
                tooltip.add("Oh... It also gives you XP for good measure :P");
            }
        } else if (!OinkConfig.oFly && !OinkConfig.pEffects)
            tooltip.add("This is the ultimate porkchop!");

        if (!GuiScreen.isShiftKeyDown())
            tooltip.add(TextFormatting.AQUA + I18n.format("press.for.info.name", "SHIFT"));
    }
}
 
开发者ID:OCDiary,项目名称:TheOink,代码行数:45,代码来源:OinkUltimatePorkChop.java


注:本文中的net.minecraft.client.gui.GuiScreen.isShiftKeyDown方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。