本文整理汇总了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();
}