本文整理了Java中net.minecraft.client.Minecraft.setIngameFocus()
方法的一些代码示例,展示了Minecraft.setIngameFocus()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Minecraft.setIngameFocus()
方法的具体详情如下:
包路径:net.minecraft.client.Minecraft
类名称:Minecraft
方法名:setIngameFocus
暂无
代码示例来源:origin: Vazkii/Botania
@Override
protected void keyTyped(char par1, int par2) {
handleNoteKey(par1, par2);
LexiconPage page = entry.pages.get(this.page);
page.onKeyPressed(par1, par2);
if(par2 == 1) {
mc.displayGuiScreen(null);
mc.setIngameFocus();
} else if(par2 == 203 || par2 == 200 || par2 == 201) // Left, Up, Page Up
prevPage();
else if(par2 == 205 || par2 == 208 || par2 == 209) // Right, Down Page Down
nextPage();
if(par2 == 14 && !notesEnabled) // Backspace
back();
else if(par2 == 199) { // Home
mc.displayGuiScreen(new GuiLexicon());
ClientTickHandler.notifyPageChange();
}
}
代码示例来源:origin: Vazkii/Botania
@Override
protected void keyTyped(char par1, int par2) throws IOException {
handleNoteKey(par1, par2);
if(!notesEnabled && closeScreenOnInvKey() && mc.gameSettings.keyBindInventory.getKeyCode() == par2) {
mc.displayGuiScreen(null);
mc.setIngameFocus();
}
if(konamiTime == 0 && par2 == KONAMI_CODE[konamiIndex]) {
konamiIndex++;
if(konamiIndex >= KONAMI_CODE.length) {
mc.getSoundHandler().playSound(PositionedSoundRecord.getMasterRecord(ModSounds.way, 1.0F));
konamiIndex = 0;
konamiTime = 240;
}
} else konamiIndex = 0;
super.keyTyped(par1, par2);
}
代码示例来源:origin: Vazkii/Quark
void returnToParent() {
mc.displayGuiScreen(parent);
if(mc.currentScreen == null)
mc.setIngameFocus();
}
代码示例来源:origin: ldtteam/minecolonies
/**
* Close the Window.
*/
public void close()
{
this.mc.player.closeScreen();
this.mc.setIngameFocus();
}
代码示例来源:origin: MrCrayfish/MrCrayfishFurnitureMod
private void closeGui()
{
this.mc.displayGuiScreen(null);
if(this.mc.currentScreen == null)
{
this.mc.setIngameFocus();
}
}
}
代码示例来源:origin: Mine-and-blade-admin/Battlegear2
@Override
protected void keyTyped(char par1, int par2)
{
if(!isDownloading){
if (par2 == 1)
{
this.mc.displayGuiScreen(parent);
this.mc.setIngameFocus();
}
}
}
代码示例来源:origin: Vazkii/Quark
void returnToParent() {
mc.displayGuiScreen(parent);
if(mc.currentScreen == null)
mc.setIngameFocus();
}
代码示例来源:origin: MrCrayfish/MrCrayfishFurnitureMod
@Override
protected void actionPerformed(GuiButton button) throws IOException
{
if(button.id == 0)
{
this.mc.displayGuiScreen(null);
if(this.mc.currentScreen == null)
{
this.mc.setIngameFocus();
}
}
}
代码示例来源:origin: AntiqueAtlasTeam/AntiqueAtlas
@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
if (keyCode == 1 && mc.currentScreen != null)
{
this.mc.displayGuiScreen((GuiScreen)null);
if (this.mc.currentScreen == null)
{
this.mc.setIngameFocus();
}
}
}
代码示例来源:origin: WesCook/Nutrition
@Override
protected void actionPerformed(GuiButton button) {
if (button == buttonClose) {
// Close GUI
mc.player.closeScreen();
if (mc.currentScreen == null)
mc.setIngameFocus();
}
}
代码示例来源:origin: TehNut/HWYLA
@Override
public void keyTyped(char keyChar, int keyID) {
if (keyID == 1)
if (this.parent == null) {
this.mc.displayGuiScreen((GuiScreen) null);
this.mc.setIngameFocus();
} else
this.mc.displayGuiScreen(this.parent);
}
代码示例来源:origin: Funwayguy/BetterQuesting
@Override
public void confirmClicked(boolean confirmed, int id)
{
if(confirmed && id == 0)
{
this.mc.displayGuiScreen(null);
this.mc.setIngameFocus();
} else
{
this.mc.displayGuiScreen(this);
}
}
}
代码示例来源:origin: Funwayguy/BetterQuesting
@Override
public void confirmClicked(boolean confirmed, int id)
{
if(confirmed && id == 0)
{
this.mc.displayGuiScreen(null);
this.mc.setIngameFocus();
} else
{
this.mc.displayGuiScreen(this);
}
}
}
代码示例来源:origin: MrCrayfish/MrCrayfishFurnitureMod
@Override
protected void actionPerformed(GuiButton button) throws IOException
{
if(!button.enabled) return;
if(button.id == btnSeal.id)
{
PacketHandler.INSTANCE.sendToServer(new MessageSealCrate(x, y, z));
this.mc.displayGuiScreen(null);
if(this.mc.currentScreen == null)
{
this.mc.setIngameFocus();
}
}
}
}
代码示例来源:origin: TeamLapen/Vampirism
@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
if (ModKeys.getKeyBinding(ModKeys.KEY.SKILL).getKeyCode() == keyCode) {
this.mc.displayGuiScreen(null);
this.mc.setIngameFocus();
} else {
super.keyTyped(typedChar, keyCode);
}
}
代码示例来源:origin: ForestryMC/ForestryMC
@Override
protected void keyTyped(char typedChar, int keyCode) {
if (keyCode == 1) {
this.mc.displayGuiScreen(null);
if (this.mc.currentScreen == null) {
this.mc.setIngameFocus();
}
}
IGuiElement origin = (window.getFocusedElement() == null) ? this.window : this.window.getFocusedElement();
window.postEvent(new GuiEvent.KeyEvent(origin, typedChar, keyCode), GuiEventDestination.ALL);
}
代码示例来源:origin: WesCook/Nutrition
@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
super.keyTyped(typedChar, keyCode);
// If escape key (1), or player inventory key (E), or Nutrition GUI key (N) is pressed
if (keyCode == 1 || keyCode == Minecraft.getMinecraft().gameSettings.keyBindInventory.getKeyCode() || keyCode == ClientProxy.keyNutritionGui.getKeyCode()) {
// Close GUI
mc.player.closeScreen();
if (mc.currentScreen == null)
mc.setIngameFocus();
}
}
代码示例来源:origin: Funwayguy/BetterQuesting
@Override
public void keyTyped(char c, int keyCode) throws IOException
{
if (keyCode == 1)
{
if(this instanceof IVolatileScreen)
{
this.mc.displayGuiScreen(new GuiYesNoLocked(this, QuestTranslation.translate("betterquesting.gui.closing_warning"), QuestTranslation.translate("betterquesting.gui.closing_confirm"), 0));
} else
{
this.mc.displayGuiScreen(null);
if(this.mc.currentScreen == null)
{
this.mc.setIngameFocus();
}
}
return;
}
this.onKeyTyped(c, keyCode);
}
代码示例来源:origin: Funwayguy/BetterQuesting
@Override
public void keyTyped(char c, int keyCode) throws IOException
{
if (keyCode == 1)
{
if(this instanceof IVolatileScreen)
{
this.mc.displayGuiScreen(new GuiYesNoLocked(this, QuestTranslation.translate("betterquesting.gui.closing_warning"), QuestTranslation.translate("betterquesting.gui.closing_confirm"), 0));
} else
{
this.mc.displayGuiScreen(null);
if(this.mc.currentScreen == null)
{
this.mc.setIngameFocus();
}
}
return;
}
this.onKeyTyped(c, keyCode);
}
代码示例来源:origin: TeamLapen/Vampirism
@Override
public void updateScreen() {
super.updateScreen();
IBlockState blockState = this.world.getBlockState(pos);
if (blockState.getBlock() instanceof BlockWeaponTable) {
lava = blockState.getValue(BlockWeaponTable.LAVA);
if (world.getTotalWorldTime() % 10 == 4) {
isMissingLava = ((HunterWeaponTableContainer) this.inventorySlots).isMissingLava();
}
} else {
this.mc.displayGuiScreen(null);
this.mc.setIngameFocus();
}
}
内容来源于网络,如有侵权,请联系作者删除!