本文整理匯總了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());
}
}
示例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());
}
}
}
示例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();
}