Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fr.titanium.proxy;
- import cpw.mods.fml.client.FMLClientHandler;
- import cpw.mods.fml.common.eventhandler.SubscribeEvent;
- import cpw.mods.fml.relauncher.Side;
- import cpw.mods.fml.relauncher.SideOnly;
- import net.minecraft.client.gui.GuiButton;
- import net.minecraft.client.gui.GuiMainMenu;
- import net.minecraft.client.gui.GuiScreen;
- import net.minecraft.client.gui.GuiYesNoCallback;
- import net.minecraft.client.renderer.texture.DynamicTexture;
- import net.minecraft.util.ResourceLocation;
- import net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent;
- import net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent;
- import net.minecraftforge.common.MinecraftForge;
- public class ClientProxy extends CommonProxy {
- @Override
- public void registerRenders() {
- }
- public ClientProxy( ) {
- MinecraftForge.EVENT_BUS.register(this);
- }
- @SubscribeEvent
- public void onInitGuiEvent(InitGuiEvent.Post event) {
- if (event.gui instanceof GuiMainMenu) {
- for (Object b : event.buttonList) {
- if (((GuiButton) b).id == 14) {
- ((GuiButton) b).enabled = false ;
- ((GuiButton) b).visible = false ;
- }
- }
- for (Object b : event.buttonList) {
- if (((GuiButton) b).id == 0) {
- ((GuiButton) b).enabled = false ;
- ((GuiButton) b).visible = false ;
- }
- }
- for (Object b : event.buttonList) {
- if (((GuiButton) b).id == 4) {
- ((GuiButton) b).enabled = true ;
- ((GuiButton) b).visible = true ;
- }
- }
- for (Object b : event.buttonList) {
- if (((GuiButton) b).id == 5) {
- ((GuiButton) b).enabled = false ;
- ((GuiButton) b).visible = false ;
- }
- }
- for (Object b : event.buttonList) {
- if (((GuiButton) b).id == 1) {
- ((GuiButton) b).enabled = false ;
- ((GuiButton) b).visible = false ;
- }
- }
- for (Object b : event.buttonList) {
- if (((GuiButton) b).id == 2) {
- ((GuiButton) b).enabled = false ;
- ((GuiButton) b).visible = false ;
- }
- }
- for (Object b : event.buttonList) {
- if (((GuiButton) b).id == 6) {
- ((GuiButton) b).enabled = false ;
- ((GuiButton) b).visible = false ;
- }
- }
- int i = event.gui.height / 4 + 30;
- event.buttonList.add(new GuiButton(30, event.gui.width / 2 - 100, i + 24 * 2, "Titanium") {
- @Override
- public void mouseReleased(int x, int y) {
- }
- });}
- }
- @SubscribeEvent
- public void onActionPerformed(ActionPerformedEvent.Pre event)
- {
- if (event.gui instanceof GuiMainMenu)
- {
- if(event.button.id == 30)
- {
- FMLClientHandler.instance().setupServerList();
- FMLClientHandler.instance().connectToServerAtStartup("g6.hmserv.eu",25568);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement