本文整理汇总了Java中net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent.Pre方法的典型用法代码示例。如果您正苦于以下问题:Java ActionPerformedEvent.Pre方法的具体用法?Java ActionPerformedEvent.Pre怎么用?Java ActionPerformedEvent.Pre使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent
的用法示例。
在下文中一共展示了ActionPerformedEvent.Pre方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onActionPerformed
import net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onActionPerformed(ActionPerformedEvent.Pre event)
{
GuiScreen gui = Util.getGuiFromEvent(event);
GuiButton button = Util.getButton(event);
if (gui instanceof GuiMainMenu)
{
if (button != null && button.id == MAIN_BUTTON_ID)
{
Minecraft.getMinecraft().displayGuiScreen(GuiGetServer.getByStep(0, new Order()));
}
}
else if (gui instanceof GuiMultiplayer)
{
if (button != null && button.id == MP_BUTTON_ID)
{
Minecraft.getMinecraft().displayGuiScreen(new GuiMultiplayerPublic(gui));
}
}
else if (gui instanceof GuiIngameMenu && button.id == FRIEND_BUTTON_ID)
{
CreeperHost.proxy.openFriendsGui();
}
}
示例2: onActionPerformed
import net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onActionPerformed(ActionPerformedEvent.Pre event)
{
GuiScreen gui = event.getGui();
GuiButton button = event.getButton();
if (gui instanceof GuiMainMenu)
{
if (button != null && button.id == MAIN_BUTTON_ID)
{
Minecraft.getMinecraft().displayGuiScreen(GuiGetServer.getByStep(0, new Order()));
}
}
else if (gui instanceof GuiMultiplayer)
{
if (button != null && button.id == MP_BUTTON_ID)
{
Minecraft.getMinecraft().displayGuiScreen(new GuiMultiplayerPublic(gui));
}
}
else if (gui instanceof GuiIngameMenu && button.id == FRIEND_BUTTON_ID)
{
CreeperHost.proxy.openFriendsGui();
}
}
示例3: mouseClicked
import net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent; //导入方法依赖的package包/类
/**
* Called when the mouse is clicked.
*/
protected void mouseClicked(int p_73864_1_, int p_73864_2_, int p_73864_3_)
{
if (p_73864_3_ == 0)
{
for (int l = 0; l < this.buttonList.size(); ++l)
{
GuiButton guibutton = (GuiButton)this.buttonList.get(l);
if (guibutton.mousePressed(this.mc, p_73864_1_, p_73864_2_))
{
ActionPerformedEvent.Pre event = new ActionPerformedEvent.Pre((GuiScreen) this.parent, guibutton, this.buttonList);
if (MinecraftForge.EVENT_BUS.post(event))
break;
this.selectedButton = event.button;
event.button.func_146113_a(this.mc.getSoundHandler());
this.actionPerformed(event.button);
if (this.equals(this.mc.currentScreen))
MinecraftForge.EVENT_BUS.post(new ActionPerformedEvent.Post((GuiScreen) this.parent, event.button, this.buttonList));
}
}
}
}
示例4: mouseClicked
import net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent; //导入方法依赖的package包/类
protected void mouseClicked(int p_73864_1_, int p_73864_2_, int p_73864_3_)
{
if (p_73864_3_ == 0)
{
for (int l = 0; l < this.buttonList.size(); ++l)
{
GuiButton guibutton = (GuiButton)this.buttonList.get(l);
if (guibutton.mousePressed(this.mc, p_73864_1_, p_73864_2_))
{
ActionPerformedEvent.Pre event = new ActionPerformedEvent.Pre(this, guibutton, this.buttonList);
if (MinecraftForge.EVENT_BUS.post(event))
break;
this.selectedButton = event.button;
event.button.func_146113_a(this.mc.getSoundHandler());
this.actionPerformed(event.button);
if (this.equals(this.mc.currentScreen))
MinecraftForge.EVENT_BUS.post(new ActionPerformedEvent.Post(this, event.button, this.buttonList));
}
}
}
}
示例5: mouseClickMove
import net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent; //导入方法依赖的package包/类
@Override
protected void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick)
{
if (clickedMouseButton == 0)
{
for (int l = 0; l < this.buttonList.size(); ++l)
{
GuiButton guibutton = (GuiButton)this.buttonList.get(l);
if (guibutton.mousePressed(this.mc, mouseX, mouseY))
{
ActionPerformedEvent.Pre event = new ActionPerformedEvent.Pre(this, guibutton, this.buttonList);
if (MinecraftForge.EVENT_BUS.post(event))
break;
if(selectedButton == event.getButton())
continue;
else
{
this.mouseReleased(mouseX, mouseY, 0);
}
this.selectedButton = event.getButton();
event.getButton().playPressSound(this.mc.getSoundHandler());
this.actionPerformed(event.getButton());
if (this.equals(this.mc.currentScreen))
MinecraftForge.EVENT_BUS.post(new ActionPerformedEvent.Post(this, event.getButton(), this.buttonList));
}
}
}
}
示例6: mouseClickMove
import net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent; //导入方法依赖的package包/类
@Override
protected void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick)
{
// 1-st Check if the click falls inside the Knapping Grid boundaries.
// (Doing so reduces the lag & allows for super methods to run when inventory slots are clicked.)
if (mouseY > 88+guiTop || mouseX > 88+guiLeft || mouseY < 16+guiTop || mouseX < 16+guiLeft)
{
super.mouseClickMove(mouseX, mouseY, clickedMouseButton, timeSinceLastClick);
return;
}
if (clickedMouseButton == 0)
{
for (int l = 0; l < this.buttonList.size(); ++l)
{
GuiButton guibutton = (GuiButton)this.buttonList.get(l);
if (guibutton.mousePressed(this.mc, mouseX, mouseY))
{
ActionPerformedEvent.Pre event = new ActionPerformedEvent.Pre(this, guibutton, this.buttonList);
if (MinecraftForge.EVENT_BUS.post(event))
break;
if(selectedButton == event.getButton())
continue;
else
{
this.mouseReleased(mouseX, mouseY, 0);
}
this.selectedButton = event.getButton();
event.getButton().playPressSound(this.mc.getSoundHandler());
this.actionPerformed(event.getButton());
if (this.equals(this.mc.currentScreen))
MinecraftForge.EVENT_BUS.post(new ActionPerformedEvent.Post(this, event.getButton(), this.buttonList));
}
}
}
else
super.mouseClickMove(mouseX, mouseY, clickedMouseButton, timeSinceLastClick);
}
示例7: onActionPerformed
import net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent; //导入方法依赖的package包/类
@SubscribeEvent
public static void onActionPerformed(ActionPerformedEvent.Pre event)
{
if(event.getGui() != null && event.getGui() instanceof GuiOptions )
{
SuperTileEntity.updateRenderDistance();
}
}
示例8: onButtonPress
import net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onButtonPress(ActionPerformedEvent.Pre e) {
if (e.gui instanceof GuiRepair) {
final GuiRepair repair = (GuiRepair)e.gui;
switch(e.button.id) {
//TODO
//
default:
break;
}
}
}
示例9: action
import net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void action(final ActionPerformedEvent.Pre e) {
this.guiHandler.action(e);
}
示例10: action
import net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent; //导入方法依赖的package包/类
@CoreEvent
public void action(final ActionPerformedEvent.Pre e) {
this.manual = true;
}