-
-
Save anonymous/224f5012f3c50c85595779ad6ffc8d77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.koopamillion.handler; | |
import com.koopamillion.Main.MainRegistry; | |
import com.koopamillion.gui.GUICharger; | |
import com.koopamillion.gui.GUICharger2; | |
import com.koopamillion.gui.GUICharger3; | |
import com.koopamillion.gui.GUICoalGenerator; | |
import com.koopamillion.gui.GUICreativeStorage; | |
import com.koopamillion.gui.GUIEnergyMeter; | |
import com.koopamillion.gui.GUIEnergyMeterCreative; | |
import com.koopamillion.gui.GUIEnergyStorage; | |
import com.koopamillion.gui.GUIEnergyStorage2; | |
import com.koopamillion.gui.GUIEnergyStorage3; | |
import com.koopamillion.gui.GUIEpounder; | |
import com.koopamillion.gui.GUIMT; | |
import com.koopamillion.gui.GUIMatter; | |
import com.koopamillion.gui.GUIPMachine; | |
import com.koopamillion.gui.GUIReactor; | |
import com.koopamillion.gui.GUISolar; | |
import com.koopamillion.gui.GUISolar2; | |
import com.koopamillion.gui.GuiElectricFurnace; | |
import com.koopamillion.inventory.ContainerCharger; | |
import com.koopamillion.inventory.ContainerCharger2; | |
import com.koopamillion.inventory.ContainerCharger3; | |
import com.koopamillion.inventory.ContainerCreativeEStorage; | |
import com.koopamillion.inventory.ContainerElectricFurnace; | |
import com.koopamillion.inventory.ContainerElectricPounder; | |
import com.koopamillion.inventory.ContainerEnergyGenerator; | |
import com.koopamillion.inventory.ContainerEnergyMeter; | |
import com.koopamillion.inventory.ContainerEnergyStorage; | |
import com.koopamillion.inventory.ContainerEnergyStorage2; | |
import com.koopamillion.inventory.ContainerEnergyStorage3; | |
import com.koopamillion.inventory.ContainerMT; | |
import com.koopamillion.inventory.ContainerMatter; | |
import com.koopamillion.inventory.ContainerPMachine; | |
import com.koopamillion.inventory.ContainerReactor; | |
import com.koopamillion.inventory.ContainerSolar; | |
import com.koopamillion.inventory.ContainerSolar2; | |
import com.koopamillion.tile_entity.TileEntityPoundingMachine; | |
import cpw.mods.fml.common.network.IGuiHandler; | |
import cpw.mods.fml.common.network.NetworkRegistry; | |
import net.minecraft.entity.player.EntityPlayer; | |
import net.minecraft.world.World; | |
public class MGuiHandler implements IGuiHandler { | |
@Override | |
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { | |
if(ID == 0){ | |
TileEntityPoundingMachine tileEntityPMachine = (TileEntityPoundingMachine) world.getTileEntity(x, y, z); | |
return new ContainerPMachine(player.inventory, tileEntityPMachine); | |
} | |
if(ID == 1){ | |
return new ContainerEnergyGenerator(player, world, x, y, z); | |
} | |
if(ID == 2){ | |
return new ContainerElectricFurnace(player, world, x, y, z); | |
} | |
if(ID == 3){ | |
return new ContainerEnergyStorage(player, world, x, y, z); | |
} | |
if(ID == 4){ | |
return new ContainerCharger(player, world, x, y, z); | |
} | |
if(ID == 5){ | |
return new ContainerCreativeEStorage(player, world, x, y, z); | |
} | |
if(ID == 6){ | |
return new ContainerEnergyStorage2(player, world, x, y, z); | |
} | |
if(ID == 7){ | |
return new ContainerCharger2(player, world, x, y, z); | |
} | |
if(ID == 8){ | |
return new ContainerSolar(player, world, x, y, z); | |
} | |
if(ID == 9){ | |
return new ContainerSolar2(player, world, x, y, z); | |
} | |
if(ID == 10){ | |
return new ContainerEnergyMeter(player, world, x, y, z); | |
} | |
if(ID == 11){ | |
return new ContainerEnergyMeter(player, world, x, y, z); | |
} | |
if(ID == 12){ | |
return new ContainerElectricPounder(player, world, x, y, z); | |
} | |
if(ID == 13){ | |
return new ContainerEnergyStorage3(player, world, x, y, z); | |
} | |
if(ID == 14){ | |
return new ContainerCharger3(player, world, x, y, z); | |
} | |
if(ID == 15){ | |
return new ContainerReactor(player, world, x, y, z); | |
} | |
if(ID == 16){ | |
return new ContainerMatter(player, world, x, y, z); | |
} | |
if(ID == 17){ | |
return new ContainerMT(player, world, x, y, z); | |
} | |
return null; | |
} | |
@Override | |
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { | |
if(ID == 0){ | |
TileEntityPoundingMachine tileEntityPMachine = (TileEntityPoundingMachine) world.getTileEntity(x, y, z); | |
return new GUIPMachine(player.inventory, tileEntityPMachine); | |
} | |
if(ID == 1){ | |
return new GUICoalGenerator(player, world, x, y, z); | |
} | |
if(ID == 2){ | |
return new GuiElectricFurnace(player, world, x, y, z); | |
} | |
if(ID == 3){ | |
return new GUIEnergyStorage(player, world, x, y, z); | |
} | |
if(ID == 4){ | |
return new GUICharger(player, world, x, y, z); | |
} | |
if(ID == 5){ | |
return new GUICreativeStorage(player, world, x, y, z); | |
} | |
if(ID == 6){ | |
return new GUIEnergyStorage2(player, world, x, y, z); | |
} | |
if(ID == 7){ | |
return new GUICharger2(player, world, x, y, z); | |
} | |
if(ID == 8){ | |
return new GUISolar(player, world, x, y, z); | |
} | |
if(ID == 9){ | |
return new GUISolar2(player, world, x, y, z); | |
} | |
if(ID == 10){ | |
return new GUIEnergyMeter(player, world, x, y, z); | |
} | |
if(ID == 11){ | |
return new GUIEnergyMeterCreative(player, world, x, y, z); | |
} | |
if(ID == 12){ | |
return new GUIEpounder(player, world, x, y, z); | |
} | |
if(ID == 13){ | |
return new GUIEnergyStorage3(player, world, x, y, z); | |
} | |
if(ID == 14){ | |
return new GUICharger3(player, world, x, y, z); | |
} | |
if(ID == 15){ | |
return new GUIReactor(player, world, x, y, z); | |
} | |
if(ID == 16){ | |
return new GUIMatter(player, world, x, y, z); | |
} | |
if(ID == 17){ | |
return new GUIMT(player, world, x, y, z); | |
} | |
return null; | |
} | |
public static void register(){ | |
NetworkRegistry.INSTANCE.registerGuiHandler(MainRegistry.modInstance, new MGuiHandler()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment