Java 类net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent 实例源码

项目:CreeperHostGui    文件:EventHandler.java   
@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();
    }
}
项目:CreeperHostGui    文件:EventHandler.java   
@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();
    }
}
项目:amunra    文件:AbstractTab.java   
/**
 * 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));
            }
        }
    }
}
项目:Cauldron    文件:GuiScreen.java   
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));
            }
        }
    }
}
项目:Cauldron    文件:GuiScreen.java   
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));
            }
        }
    }
}
项目:ServerObserver    文件:GuiHandler.java   
@CoreEvent
public void action(final ActionPerformedEvent.Post e) {
    this.targetServerStatus = null;
    final GuiScreen screen = this.mc.currentScreen;
    final int id = this.compat.getButton(e).id;
    if (screen instanceof GuiMultiplayer&&id==BUTTON_ID) {
        final GuiMultiplayer mpgui = (GuiMultiplayer) screen;
        final ServerData server = getServerData(mpgui, this.compat.getSelected(mpgui));
        if (server!=null) {
            if (!StringUtils.equals(this.target.getIP(), server.serverIP)) {
                this.autologin.set(false);
                this.target.set(server);
            } else if (!this.autologin.is()) {
                this.autologin.set(true);
                this.target.set(server);
            } else {
                this.autologin.set(false);
                this.target.set(null);
            }
        } else
            selectTarget(mpgui, this.target.getIP());
    } else if (screen instanceof GuiDisconnected&&id==DISABLE_BACK_BUTTON_ID) {
        final GuiDisconnected dcgui = (GuiDisconnected) screen;
        this.autologin.set(false);
        this.target.set(null);
        this.mc.displayGuiScreen(this.compat.getParentScreen(dcgui));
    }
    this.displayTime = "";
    reset(Config.getConfig().durationPing);
    this.manual = false;
}
项目:blockbuster    文件:MainMenuHandler.java   
@SubscribeEvent
public void onActionPerformed(ActionPerformedEvent event)
{
    if (event.getGui() instanceof GuiMainMenu && event.getButton() == this.openModelEditor)
    {
        Minecraft.getMinecraft().displayGuiScreen(new GuiModelEditor(true));
    }
}
项目:In-Game-Account-Switcher    文件:ClientEvents.java   
@SubscribeEvent
public void onClick(ActionPerformedEvent event){
    if(event.getGui() instanceof GuiMainMenu && event.getButton().id == 20){
        if(Config.getInstance() == null){
            Config.load();
        }
        Minecraft.getMinecraft().displayGuiScreen(new GuiAccountSelector());
    }
}
项目:ShadyMod    文件:ShadyMod.java   
@SubscribeEvent
public void onActionPerformed(ActionPerformedEvent event)
{
    if(event.gui instanceof GuiOptions)
    {
        if(event.button.id == 0x42)
        {
            Minecraft.getMinecraft().displayGuiScreen(new GuiShadyOptions(event.gui));
        }
    }
}
项目:Elite-Armageddon    文件:Handler.java   
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void actionEvent(ActionPerformedEvent.Post event)
{
    if(!(event.gui instanceof GuiCreateWorld)) return;
    if(event.button.id == 11)
    {
        event.gui.mc.displayGuiScreen(new GuiApocSelect(event.gui));
    }
    else if(event.button.id == 3)
    {
        apocSelectBTN.visible = !apocSelectBTN.visible;
    }
}
项目:TFC2    文件:GuiAnvil.java   
@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));
            }
        }
    }
}
项目:TFC2    文件:GuiKnapping.java   
@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);
}
项目:Hard-Science    文件:ClientEventHandler.java   
@SubscribeEvent
public static void onActionPerformed(ActionPerformedEvent.Pre event)
{
    if(event.getGui() != null && event.getGui() instanceof GuiOptions )
    {
        SuperTileEntity.updateRenderDistance();
    }
}
项目:TFC2    文件:GuiAnvil.java   
@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));
            }
        }
    }
}
项目:TFC2    文件:GuiKnapping.java   
@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);
}
项目:IngameAccountSwitcher    文件:ForgeEvents.java   
@SubscribeEvent
public void onClick(ActionPerformedEvent event){
    if(event.gui instanceof GuiMainMenu && event.button.id == 20){
        if(Config.getInstance() == null){
            Config.load();
        }
        if(Minecraft.getMinecraft() == null){
            System.out.println("Error: Server call");
        }
        Minecraft.getMinecraft().displayGuiScreen(new GuiAccountSelector());
    }
}
项目:betterAnvil-forge    文件:EventHandlerBA.java   
@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;
        }
    }
}
项目:ServerObserver    文件:Compat.java   
@Override
public GuiButton getButton(final ActionPerformedEvent e) {
    return e.getButton();
}
项目:ServerObserver    文件:CoreHandler.java   
@SubscribeEvent
public void action(final ActionPerformedEvent.Pre e) {
    this.guiHandler.action(e);
}
项目:ServerObserver    文件:CoreHandler.java   
@SubscribeEvent
public void action(final ActionPerformedEvent.Post e) {
    this.guiHandler.action(e);
}
项目:ServerObserver    文件:Compat.java   
@Override
public GuiButton getButton(final ActionPerformedEvent e) {
    return e.getButton();
}
项目:ServerObserver    文件:CoreHandler.java   
@SubscribeEvent
public void action(final ActionPerformedEvent.Pre e) {
    this.guiHandler.action(e);
}
项目:ServerObserver    文件:CoreHandler.java   
@SubscribeEvent
public void action(final ActionPerformedEvent.Post e) {
    this.guiHandler.action(e);
}
项目:ServerObserver    文件:Compat.java   
@Override
public GuiButton getButton(final ActionPerformedEvent e) {
    return e.getButton();
}
项目:ServerObserver    文件:CoreHandler.java   
@SubscribeEvent
public void action(final ActionPerformedEvent.Pre e) {
    this.guiHandler.action(e);
}
项目:ServerObserver    文件:CoreHandler.java   
@SubscribeEvent
public void action(final ActionPerformedEvent.Post e) {
    this.guiHandler.action(e);
}
项目:ServerObserver    文件:Compat.java   
@Override
public GuiButton getButton(final ActionPerformedEvent e) {
    return e.button;
}
项目:ServerObserver    文件:CoreHandler.java   
@SubscribeEvent
public void action(final ActionPerformedEvent.Pre e) {
    this.guiHandler.action(e);
}
项目:ServerObserver    文件:CoreHandler.java   
@SubscribeEvent
public void action(final ActionPerformedEvent.Post e) {
    this.guiHandler.action(e);
}
项目:ServerObserver    文件:GuiHandler.java   
@CoreEvent
public void action(final ActionPerformedEvent.Pre e) {
    this.manual = true;
}
项目:ServerObserver    文件:Compat.java   
@Override
public GuiButton getButton(final ActionPerformedEvent e) {
    return e.getButton();
}
项目:ServerObserver    文件:CoreHandler.java   
@SubscribeEvent
public void action(final ActionPerformedEvent.Pre e) {
    this.guiHandler.action(e);
}
项目:ServerObserver    文件:CoreHandler.java   
@SubscribeEvent
public void action(final ActionPerformedEvent.Post e) {
    this.guiHandler.action(e);
}
项目:ServerObserver    文件:Compat.java   
@Override
public GuiButton getButton(final ActionPerformedEvent e) {
    return e.button;
}
项目:ServerObserver    文件:CoreHandler.java   
@SubscribeEvent
public void action(final ActionPerformedEvent.Pre e) {
    this.guiHandler.action(e);
}
项目:ServerObserver    文件:CoreHandler.java   
@SubscribeEvent
public void action(final ActionPerformedEvent.Post e) {
    this.guiHandler.action(e);
}
项目:ServerObserver    文件:ICompat.java   
GuiButton getButton(ActionPerformedEvent e);