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


Java EntityPlayerSP.openGui方法代码示例

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


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

示例1: handleContentMessage

import net.minecraft.client.entity.EntityPlayerSP; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public static void handleContentMessage(ScriptyPacketContent content) {
    EntityPlayerSP player = Minecraft.getMinecraft().player;
    if (!(Minecraft.getMinecraft().currentScreen instanceof ScriptyBlockGUI)) {
        player.openGui(ScriptyMod.INSTANCE, 0x0, player.world, content.getPos().getX(), content.getPos().getY(), content.getPos().getZ());
    }
    if (Minecraft.getMinecraft().currentScreen instanceof ScriptyBlockGUI) {
        ((ScriptyBlockGUI) Minecraft.getMinecraft().currentScreen).setLanguage(content.getLanguage());
        ((ScriptyBlockGUI) Minecraft.getMinecraft().currentScreen).setContent(content.getContent());
        ((ScriptyBlockGUI) Minecraft.getMinecraft().currentScreen).setPos(content.getPos());
        ((ScriptyBlockGUI) Minecraft.getMinecraft().currentScreen).setParsing(content.isParsing());
    }
}
 
开发者ID:ScriptyMod,项目名称:Scripty,代码行数:14,代码来源:ScriptyNetworkHandler.java

示例2: checkWheelKey

import net.minecraft.client.entity.EntityPlayerSP; //导入方法依赖的package包/类
private void checkWheelKey() {
    if (KeyBindings.keyOpenWheel.isPressed()) {
        EntityPlayerSP player = MinecraftTools.getPlayer(Minecraft.getMinecraft());
        RayTraceResult mouseOver = Minecraft.getMinecraft().objectMouseOver;
        if (mouseOver != null && mouseOver.typeOfHit == RayTraceResult.Type.BLOCK) {
            BlockPos pos = mouseOver.getBlockPos();
            player.openGui(InteractionWheel.instance, GuiProxy.GUI_WHEEL, player.getEntityWorld(), pos.getX(), pos.getY(), pos.getZ());
        } else {
            player.openGui(InteractionWheel.instance, GuiProxy.GUI_WHEEL, player.getEntityWorld(), player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ());
        }
    }
}
 
开发者ID:McJty,项目名称:interactionwheel,代码行数:13,代码来源:InputHandler.java

示例3: mouseClicked

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

    List<String> actions = getActions();

    int cx = mouseX - guiLeft - WIDTH / 2;
    int cy = mouseY - guiTop - HEIGHT / 2;

    int q = getSelectedSection(actions, cx, cy);
    if (q == BUTTON_CONFIG) {
        EntityPlayerSP player = MinecraftTools.getPlayer(mc);
        player.openGui(InteractionWheel.instance, GuiProxy.GUI_CONFIG, player.getEntityWorld(), player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ());
        return;
    } else if (q == BUTTON_LEFT) {
        page--;
        if (page < 0) {
            page = pages - 1;
            if (page < 0) {
                page = 0;
            }
        }
        return;
    } else if (q == BUTTON_RIGHT) {
        page++;
        if (page > pages - 1) {
            page = 0;
        }
        return;
    } else if (q == -1) {
        closeThis();
    } else {
        if (q < getActionSize(actions)) {
            performAction(actions, q);
        }
    }
    closeThis();
}
 
开发者ID:McJty,项目名称:interactionwheel,代码行数:39,代码来源:GuiWheel.java


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