當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。