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


Java GameSettings.isKeyDown方法代码示例

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


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

示例1: onUpdate

import net.minecraft.client.settings.GameSettings; //导入方法依赖的package包/类
@Override
public void onUpdate()
{
	// update timer
	updateMS();
	
	// check if clicking
	if(!GameSettings.isKeyDown(mc.gameSettings.keyBindAttack))
		return;
	
	// check timer / cooldown
	if(useCooldown != null && useCooldown.isChecked()
		? WPlayer.getCooldown() < 1 : !hasTimePassedS(speed.getValueF()))
		return;
	
	attack();
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:18,代码来源:ClickAuraMod.java

示例2: onDisable

import net.minecraft.client.settings.GameSettings; //导入方法依赖的package包/类
@Override
public void onDisable()
{
	wurst.events.remove(UpdateListener.class, this);
	wurst.events.remove(PostUpdateListener.class, this);
	
	switch(mode.getSelected())
	{
		case 0:
		WConnection.sendPacket(new CPacketEntityAction(
			WMinecraft.getPlayer(), Action.STOP_SNEAKING));
		break;
		
		case 1:
		mc.gameSettings.keyBindSneak.pressed =
			GameSettings.isKeyDown(mc.gameSettings.keyBindSneak);
		break;
	}
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:20,代码来源:SneakMod.java

示例3: updateScreen

import net.minecraft.client.settings.GameSettings; //导入方法依赖的package包/类
@Override
public void updateScreen() {
    super.updateScreen();
    if (!GameSettings.isKeyDown(ModKeybind.keybindChalk))
    {
        Minecraft.getMinecraft().displayGuiScreen(null);
    }
}
 
开发者ID:Drazuam,项目名称:RunicArcana,代码行数:9,代码来源:GuiChalk.java

示例4: keyTyped

import net.minecraft.client.settings.GameSettings; //导入方法依赖的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 (selectedTabIndex != CreativeTabs.tabAllSearch.getTabIndex())
    {
        if (GameSettings.isKeyDown(this.mc.gameSettings.keyBindChat))
        {
            this.setCurrentCreativeTab(CreativeTabs.tabAllSearch);
        }
        else
        {
            super.keyTyped(typedChar, keyCode);
        }
    }
    else
    {
        if (this.field_147057_D)
        {
            this.field_147057_D = false;
            this.searchField.setText("");
        }

        if (!this.checkHotbarKeys(keyCode))
        {
            if (this.searchField.textboxKeyTyped(typedChar, keyCode))
            {
                this.updateCreativeSearch();
            }
            else
            {
                super.keyTyped(typedChar, keyCode);
            }
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:39,代码来源:GuiContainerCreative.java

示例5: onDisable

import net.minecraft.client.settings.GameSettings; //导入方法依赖的package包/类
@Override
public void onDisable()
{
	wurst.events.remove(UpdateListener.class, this);
	wurst.events.remove(RenderListener.class, this);
	
	mc.gameSettings.keyBindForward.pressed =
		GameSettings.isKeyDown(mc.gameSettings.keyBindForward);
	mc.gameSettings.keyBindJump.pressed =
		GameSettings.isKeyDown(mc.gameSettings.keyBindJump);
	
	pathFinder = null;
	processor = null;
	PathProcessor.releaseControls();
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:16,代码来源:AntiAfkMod.java

示例6: onDisable

import net.minecraft.client.settings.GameSettings; //导入方法依赖的package包/类
@Override
public void onDisable()
{
	wurst.events.remove(UpdateListener.class, this);
	
	// reset forward key
	mc.gameSettings.keyBindForward.pressed =
		GameSettings.isKeyDown(mc.gameSettings.keyBindForward);
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:10,代码来源:AutoWalkMod.java

示例7: onDisable

import net.minecraft.client.settings.GameSettings; //导入方法依赖的package包/类
@Override
public void onDisable()
{
	wurst.events.remove(UpdateListener.class, this);
	mc.gameSettings.keyBindSneak.pressed =
		GameSettings.isKeyDown(mc.gameSettings.keyBindSneak);
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:8,代码来源:MileyCyrusMod.java

示例8: keyTyped

import net.minecraft.client.settings.GameSettings; //导入方法依赖的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 (selectedTabIndex != CreativeTabs.SEARCH.getTabIndex())
    {
        if (GameSettings.isKeyDown(this.mc.gameSettings.keyBindChat))
        {
            this.setCurrentCreativeTab(CreativeTabs.SEARCH);
        }
        else
        {
            super.keyTyped(typedChar, keyCode);
        }
    }
    else
    {
        if (this.clearSearch)
        {
            this.clearSearch = false;
            this.searchField.setText("");
        }

        if (!this.checkHotbarKeys(keyCode))
        {
            if (this.searchField.textboxKeyTyped(typedChar, keyCode))
            {
                this.updateCreativeSearch();
            }
            else
            {
                super.keyTyped(typedChar, keyCode);
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:39,代码来源:GuiContainerCreative.java

示例9: keyTyped

import net.minecraft.client.settings.GameSettings; //导入方法依赖的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 (!CreativeTabs.CREATIVE_TAB_ARRAY[selectedTabIndex].hasSearchBar())
    {
        if (GameSettings.isKeyDown(this.mc.gameSettings.keyBindChat))
        {
            this.setCurrentCreativeTab(CreativeTabs.SEARCH);
        }
        else
        {
            super.keyTyped(typedChar, keyCode);
        }
    }
    else
    {
        if (this.clearSearch)
        {
            this.clearSearch = false;
            this.searchField.setText("");
        }

        if (!this.checkHotbarKeys(keyCode))
        {
            if (this.searchField.textboxKeyTyped(typedChar, keyCode))
            {
                this.updateCreativeSearch();
            }
            else
            {
                super.keyTyped(typedChar, keyCode);
            }
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:39,代码来源:GuiContainerCreative.java

示例10: mouseClicked

import net.minecraft.client.settings.GameSettings; //导入方法依赖的package包/类
@Override
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
    super.mouseClicked(mouseX, mouseY, mouseButton);

    if(mouseButton == 0) {
        if(!renderContext.doesRenderIn3D()) {
            if(mouseX >= this.guiLeft + 132 && mouseX <= this.guiLeft + 132 + 16 &&
                    mouseY >= this.guiTop + 106 && mouseY <= this.guiTop + 106 + 16) {
                renderContext.setTo3D();
            }
            if(renderContext.hasSliceUp() && mouseX >= this.guiLeft + 150 && mouseX <= this.guiLeft + 150 + 16 &&
                    mouseY >= this.guiTop + 102 && mouseY <= this.guiTop + 102 + 16) {
                renderContext.sliceUp();
            }
            if(renderContext.hasSliceDown() && mouseX >= this.guiLeft + 150 && mouseX <= this.guiLeft + 150 + 16 &&
                    mouseY >= this.guiTop + 124 && mouseY <= this.guiTop + 124 + 16) {
                renderContext.sliceDown();
            }
        } else {
            if(mouseX >= this.guiLeft + 132 && mouseX <= this.guiLeft + 132 + 16 &&
                    mouseY >= this.guiTop + 122 && mouseY <= this.guiTop + 122 + 16) {
                renderContext.setTo2D();
            }
        }
        if(GameSettings.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindSneak) &&
                mouseX >= this.guiLeft + 116 && mouseX <= this.guiLeft + 116 + 16 &&
                mouseY >= this.guiTop + 106 && mouseY < this.guiTop + 106 + 16) {
            if(ClientProxy.renderHelper.startPreview(this.renderContext)) {
                Minecraft.getMinecraft().displayGuiScreen(null);
            }
        }
    } else if(mouseButton == 1) {
        Minecraft.getMinecraft().displayGuiScreen(null);
    }
}
 
开发者ID:HellFirePvP,项目名称:ModularMachinery,代码行数:36,代码来源:GuiScreenBlueprint.java

示例11: handleClick

import net.minecraft.client.settings.GameSettings; //导入方法依赖的package包/类
@Override
public boolean handleClick(Minecraft minecraft, int mouseX, int mouseY, int mouseButton) {
    if(mouseButton == 0) {
        if(!context.doesRenderIn3D()) {
            if(mouseX >= 132 && mouseX <= 132 + 16 &&
                    mouseY >= 106 && mouseY <= 106 + 16) {
                context.setTo3D();
            }
            if(context.hasSliceUp() && mouseX >= 150 && mouseX <= 150 + 16 &&
                    mouseY >= 102 && mouseY <= 102 + 16) {
                context.sliceUp();
            }
            if(context.hasSliceDown() && mouseX >= 150 && mouseX <= 150 + 16 &&
                    mouseY >= 124 && mouseY <= 124 + 16) {
                context.sliceDown();
            }
        } else {
            if(mouseX >= 132 && mouseX <= 132 + 16 &&
                    mouseY >= 122 && mouseY <= 122 + 16) {
                context.setTo2D();
            }
        }
        if(GameSettings.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindSneak) &&
                mouseX >= 116 && mouseX <= 116 + 16 &&
                mouseY >= 106 && mouseY < 106 + 16) {
            if(ClientProxy.renderHelper.startPreview(context)) {
                Minecraft.getMinecraft().displayGuiScreen(null);
            }
        }
    }
    return false;
}
 
开发者ID:HellFirePvP,项目名称:ModularMachinery,代码行数:33,代码来源:StructurePreviewWrapper.java

示例12: isSneakingInGui

import net.minecraft.client.settings.GameSettings; //导入方法依赖的package包/类
@Override
public boolean isSneakingInGui() {
    return GameSettings.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindSneak);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:5,代码来源:ClientProxy.java

示例13: updateScreen

import net.minecraft.client.settings.GameSettings; //导入方法依赖的package包/类
@Override
public void updateScreen()
{
    super.updateScreen();

    if (closing)
    {
        if (doneClosing || inventory == null)
        {
            Minecraft.getMinecraft().displayGuiScreen(null);

            ClientProxy.wipeOpen();
        }

        return;
    }

    ItemStack inHand = mc.player.getHeldItemMainhand();
    if (!Config.isItemStackAllowed(inHand))
    {
        inventory = null;
    }
    else
    {
        ItemStack stack = getter.getBelt();
        if (stack.getCount() <= 0)
        {
            inventory = null;
            stackEquipped = null;
        }
        // Reference comparison intended
        else if (stackEquipped != stack)
        {
            stackEquipped = stack;
            inventory = ItemToolBelt.getItems(stack);
            cachedStacks = null;
        }
    }

    if (inventory == null)
    {
        Minecraft.getMinecraft().displayGuiScreen(null);
    }
    else if (!GameSettings.isKeyDown(ClientProxy.keyOpenToolMenu))
    {
        if (Config.releaseToSwap)
        {
            int x = Mouse.getEventX() * this.width / this.mc.displayWidth;
            int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;
            mouseReleased(x, y, -1);
        }
        else
        {
            animateClose();
        }
    }
}
 
开发者ID:gigaherz,项目名称:ToolBelt,代码行数:58,代码来源:GuiRadialMenu.java

示例14: releaseControls

import net.minecraft.client.settings.GameSettings; //导入方法依赖的package包/类
public static final void releaseControls()
{
	// reset keys
	for(KeyBinding key : CONTROLS)
		key.pressed = GameSettings.isKeyDown(key);
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:7,代码来源:PathProcessor.java

示例15: getFOVModifier

import net.minecraft.client.settings.GameSettings; //导入方法依赖的package包/类
/**
 * Changes the field of view of the player depending on if they are underwater or not
 */
private float getFOVModifier(float partialTicks, boolean p_78481_2_)
{
    if (this.debugView)
    {
        return 90.0F;
    }
    else
    {
        Entity entity = this.mc.getRenderViewEntity();
        float f = 70.0F;

        if (p_78481_2_)
        {
            f = this.mc.gameSettings.fovSetting;

            if (Config.isDynamicFov())
            {
                f *= this.fovModifierHandPrev + (this.fovModifierHand - this.fovModifierHandPrev) * partialTicks;
            }
        }

        boolean flag = false;

        if (this.mc.currentScreen == null)
        {
            GameSettings gamesettings = this.mc.gameSettings;
            flag = GameSettings.isKeyDown(this.mc.gameSettings.ofKeyBindZoom);
        }

        if (flag)
        {
            if (!Config.zoomMode)
            {
                Config.zoomMode = true;
                this.mc.gameSettings.smoothCamera = true;
            }

            if (Config.zoomMode)
            {
                f /= 4.0F;
            }
        }
        else if (Config.zoomMode)
        {
            Config.zoomMode = false;
            this.mc.gameSettings.smoothCamera = false;
            this.mouseFilterXAxis = new MouseFilter();
            this.mouseFilterYAxis = new MouseFilter();
            this.mc.renderGlobal.displayListEntitiesDirty = true;
        }

        if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).getHealth() <= 0.0F)
        {
            float f1 = (float)((EntityLivingBase)entity).deathTime + partialTicks;
            f /= (1.0F - 500.0F / (f1 + 500.0F)) * 2.0F + 1.0F;
        }

        Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, entity, partialTicks);

        if (block.getMaterial() == Material.water)
        {
            f = f * 60.0F / 70.0F;
        }

        return f;
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:71,代码来源:EntityRenderer.java


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