Mekanism-tilera-Edition/common/mekanism/client/ClientProxy.java

576 lines
24 KiB
Java
Raw Normal View History

package mekanism.client;
import java.io.File;
import java.util.HashMap;
2014-03-16 01:05:26 +01:00
import mekanism.api.Coord4D;
import mekanism.client.gui.GuiChemicalCrystallizer;
2014-01-31 22:32:13 +01:00
import mekanism.client.gui.GuiChemicalDissolutionChamber;
import mekanism.client.gui.GuiChemicalInfuser;
import mekanism.client.gui.GuiChemicalInjectionChamber;
import mekanism.client.gui.GuiChemicalOxidizer;
2014-01-31 22:32:13 +01:00
import mekanism.client.gui.GuiChemicalWasher;
import mekanism.client.gui.GuiCombiner;
import mekanism.client.gui.GuiConfiguration;
import mekanism.client.gui.GuiCredits;
import mekanism.client.gui.GuiCrusher;
import mekanism.client.gui.GuiDictionary;
import mekanism.client.gui.GuiDigitalMiner;
import mekanism.client.gui.GuiDynamicTank;
import mekanism.client.gui.GuiElectricChest;
import mekanism.client.gui.GuiElectricPump;
import mekanism.client.gui.GuiElectrolyticSeparator;
import mekanism.client.gui.GuiEnergizedSmelter;
import mekanism.client.gui.GuiEnergyCube;
import mekanism.client.gui.GuiEnrichmentChamber;
import mekanism.client.gui.GuiFactory;
import mekanism.client.gui.GuiGasTank;
import mekanism.client.gui.GuiMetallurgicInfuser;
import mekanism.client.gui.GuiOsmiumCompressor;
2014-04-06 02:16:09 +02:00
import mekanism.client.gui.GuiPRC;
import mekanism.client.gui.GuiPasswordEnter;
import mekanism.client.gui.GuiPasswordModify;
import mekanism.client.gui.GuiPortableTeleporter;
import mekanism.client.gui.GuiPrecisionSawmill;
import mekanism.client.gui.GuiPurificationChamber;
import mekanism.client.gui.GuiRobitCrafting;
import mekanism.client.gui.GuiRobitInventory;
import mekanism.client.gui.GuiRobitMain;
import mekanism.client.gui.GuiRobitRepair;
import mekanism.client.gui.GuiRobitSmelting;
import mekanism.client.gui.GuiRotaryCondensentrator;
import mekanism.client.gui.GuiSalinationController;
2014-03-16 01:05:26 +01:00
import mekanism.client.gui.GuiSeismicReader;
import mekanism.client.gui.GuiSeismicVibrator;
import mekanism.client.gui.GuiTeleporter;
import mekanism.client.render.MekanismRenderer;
2014-04-13 04:05:50 +02:00
import mekanism.client.render.RenderGlowPanel;
2013-12-24 23:14:28 +01:00
import mekanism.client.render.RenderPartTransmitter;
import mekanism.client.render.RenderTickHandler;
import mekanism.client.render.block.BasicRenderingHandler;
import mekanism.client.render.block.MachineRenderingHandler;
2013-12-24 22:06:57 +01:00
import mekanism.client.render.entity.RenderBalloon;
2013-11-03 17:38:36 +01:00
import mekanism.client.render.entity.RenderObsidianTNTPrimed;
import mekanism.client.render.entity.RenderRobit;
import mekanism.client.render.item.ItemRenderingHandler;
import mekanism.client.render.tileentity.RenderBin;
import mekanism.client.render.tileentity.RenderChargepad;
import mekanism.client.render.tileentity.RenderChemicalCrystallizer;
2014-01-26 23:12:03 +01:00
import mekanism.client.render.tileentity.RenderChemicalDissolutionChamber;
import mekanism.client.render.tileentity.RenderChemicalInfuser;
import mekanism.client.render.tileentity.RenderChemicalOxidizer;
2014-01-26 23:12:03 +01:00
import mekanism.client.render.tileentity.RenderChemicalWasher;
import mekanism.client.render.tileentity.RenderConfigurableMachine;
import mekanism.client.render.tileentity.RenderDigitalMiner;
import mekanism.client.render.tileentity.RenderDynamicTank;
import mekanism.client.render.tileentity.RenderElectricChest;
import mekanism.client.render.tileentity.RenderElectricPump;
import mekanism.client.render.tileentity.RenderElectrolyticSeparator;
import mekanism.client.render.tileentity.RenderEnergyCube;
import mekanism.client.render.tileentity.RenderGasTank;
import mekanism.client.render.tileentity.RenderLogisticalSorter;
import mekanism.client.render.tileentity.RenderMetallurgicInfuser;
import mekanism.client.render.tileentity.RenderObsidianTNT;
import mekanism.client.render.tileentity.RenderPlastic;
import mekanism.client.render.tileentity.RenderRotaryCondensentrator;
2014-01-17 03:55:29 +01:00
import mekanism.client.render.tileentity.RenderSalinationController;
import mekanism.client.render.tileentity.RenderTeleporter;
import mekanism.client.sound.Sound;
import mekanism.client.sound.SoundHandler;
import mekanism.common.CommonProxy;
import mekanism.common.EnergyDisplay.EnergyType;
import mekanism.common.IElectricChest;
import mekanism.common.IInvConfiguration;
import mekanism.common.Mekanism;
2013-11-27 22:17:10 +01:00
import mekanism.common.block.BlockMachine.MachineType;
import mekanism.common.entity.EntityBalloon;
import mekanism.common.entity.EntityObsidianTNT;
import mekanism.common.entity.EntityRobit;
import mekanism.common.inventory.InventoryElectricChest;
import mekanism.common.item.ItemPortableTeleporter;
2014-03-16 01:05:26 +01:00
import mekanism.common.item.ItemSeismicReader;
import mekanism.common.tile.TileEntityAdvancedElectricMachine;
import mekanism.common.tile.TileEntityAdvancedFactory;
import mekanism.common.tile.TileEntityBin;
import mekanism.common.tile.TileEntityChargepad;
import mekanism.common.tile.TileEntityChemicalCrystallizer;
2014-01-26 23:12:03 +01:00
import mekanism.common.tile.TileEntityChemicalDissolutionChamber;
import mekanism.common.tile.TileEntityChemicalInfuser;
import mekanism.common.tile.TileEntityChemicalInjectionChamber;
import mekanism.common.tile.TileEntityChemicalOxidizer;
2014-01-26 23:12:03 +01:00
import mekanism.common.tile.TileEntityChemicalWasher;
import mekanism.common.tile.TileEntityCombiner;
import mekanism.common.tile.TileEntityCrusher;
import mekanism.common.tile.TileEntityDigitalMiner;
import mekanism.common.tile.TileEntityDynamicTank;
import mekanism.common.tile.TileEntityDynamicValve;
import mekanism.common.tile.TileEntityElectricChest;
import mekanism.common.tile.TileEntityElectricMachine;
import mekanism.common.tile.TileEntityElectricPump;
import mekanism.common.tile.TileEntityElectrolyticSeparator;
import mekanism.common.tile.TileEntityEliteFactory;
import mekanism.common.tile.TileEntityEnergizedSmelter;
import mekanism.common.tile.TileEntityEnergyCube;
import mekanism.common.tile.TileEntityEnrichmentChamber;
import mekanism.common.tile.TileEntityFactory;
import mekanism.common.tile.TileEntityGasTank;
import mekanism.common.tile.TileEntityLogisticalSorter;
import mekanism.common.tile.TileEntityMetallurgicInfuser;
import mekanism.common.tile.TileEntityObsidianTNT;
import mekanism.common.tile.TileEntityOsmiumCompressor;
2014-04-06 02:16:09 +02:00
import mekanism.common.tile.TileEntityPRC;
import mekanism.common.tile.TileEntityPlasticBlock;
import mekanism.common.tile.TileEntityPrecisionSawmill;
import mekanism.common.tile.TileEntityPurificationChamber;
import mekanism.common.tile.TileEntityRotaryCondensentrator;
import mekanism.common.tile.TileEntitySalinationController;
2014-03-16 01:05:26 +01:00
import mekanism.common.tile.TileEntitySeismicVibrator;
import mekanism.common.tile.TileEntityTeleporter;
2013-07-20 18:10:14 +02:00
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.Configuration;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.KeyBindingRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/**
* Client proxy for the Mekanism mod.
* @author AidanBrady
*
*/
@SideOnly(Side.CLIENT)
public class ClientProxy extends CommonProxy
{
public static int MACHINE_RENDER_ID = RenderingRegistry.getNextAvailableRenderId();
public static int TRANSMITTER_RENDER_ID = RenderingRegistry.getNextAvailableRenderId();
public static int BASIC_RENDER_ID = RenderingRegistry.getNextAvailableRenderId();
public static int PLASTIC_RENDER_ID = RenderingRegistry.getNextAvailableRenderId();
@Override
public void loadConfiguration()
{
super.loadConfiguration();
Mekanism.configuration.load();
MekanismClient.enableSounds = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnableSounds", true).getBoolean(true);
MekanismClient.fancyUniversalCableRender = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "FancyUniversalCableRender", true).getBoolean(true);
2013-12-24 19:25:31 +01:00
MekanismClient.holidays = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "Holidays", true).getBoolean(true);
MekanismClient.baseSoundVolume = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "SoundVolume", 1D).getDouble(1D);
MekanismClient.machineEffects = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "MachineEffects", true).getBoolean(true);
String s = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnergyType", "J").getString();
if(s != null)
{
if(s.trim().equalsIgnoreCase("j") || s.trim().equalsIgnoreCase("joules"))
{
Mekanism.activeType = EnergyType.J;
}
else if(s.trim().equalsIgnoreCase("rf") || s.trim().equalsIgnoreCase("te") || s.trim().equalsIgnoreCase("thermal expansion"))
{
Mekanism.activeType = EnergyType.RF;
}
else if(s.trim().equalsIgnoreCase("eu") || s.trim().equalsIgnoreCase("ic2"))
{
Mekanism.activeType = EnergyType.EU;
}
else if(s.trim().equalsIgnoreCase("mj") || s.trim().equalsIgnoreCase("bc") || s.trim().equalsIgnoreCase("buildcraft"))
{
Mekanism.activeType = EnergyType.MJ;
}
}
Mekanism.configuration.save();
}
@Override
public int getArmorIndex(String string)
{
return RenderingRegistry.addNewArmourRendererPrefix(string);
}
@Override
public void registerSound(Object obj)
{
if(MekanismClient.enableSounds && Minecraft.getMinecraft().sndManager.sndSystem != null)
{
synchronized(MekanismClient.audioHandler.sounds)
{
MekanismClient.audioHandler.register(obj);
}
}
}
@Override
public void unregisterSound(TileEntity tileEntity)
{
if(MekanismClient.enableSounds && Minecraft.getMinecraft().sndManager.sndSystem != null)
{
synchronized(MekanismClient.audioHandler.sounds)
{
if(MekanismClient.audioHandler.getFrom(tileEntity) != null)
{
MekanismClient.audioHandler.getFrom(tileEntity).remove();
}
}
}
}
2013-04-13 03:32:43 +02:00
@Override
public void openElectricChest(EntityPlayer entityplayer, int id, int windowId, boolean isBlock, int x, int y, int z)
2013-04-13 03:32:43 +02:00
{
TileEntityElectricChest tileEntity = (TileEntityElectricChest)entityplayer.worldObj.getBlockTileEntity(x, y, z);
2013-04-13 03:32:43 +02:00
if(id == 0)
{
if(isBlock)
{
FMLClientHandler.instance().displayGuiScreen(entityplayer, new GuiElectricChest(entityplayer.inventory, tileEntity));
entityplayer.openContainer.windowId = windowId;
2013-04-13 03:32:43 +02:00
}
else {
FMLClientHandler.instance().getClient().sndManager.playSoundFX("random.chestopen", 1.0F, 1.0F);
ItemStack stack = entityplayer.getCurrentEquippedItem();
2013-11-27 22:17:10 +01:00
if(stack != null && stack.getItem() instanceof IElectricChest && MachineType.get(stack) == MachineType.ELECTRIC_CHEST)
2013-04-13 03:32:43 +02:00
{
InventoryElectricChest inventory = new InventoryElectricChest(entityplayer);
FMLClientHandler.instance().displayGuiScreen(entityplayer, new GuiElectricChest(entityplayer.inventory, inventory));
entityplayer.openContainer.windowId = windowId;
2013-04-13 03:32:43 +02:00
}
}
}
else if(id == 1)
{
if(isBlock)
{
FMLClientHandler.instance().displayGuiScreen(entityplayer, new GuiPasswordEnter(tileEntity));
}
else {
ItemStack stack = entityplayer.getCurrentEquippedItem();
2013-11-27 22:17:10 +01:00
if(stack != null && stack.getItem() instanceof IElectricChest && MachineType.get(stack) == MachineType.ELECTRIC_CHEST)
2013-04-13 03:32:43 +02:00
{
FMLClientHandler.instance().displayGuiScreen(entityplayer, new GuiPasswordEnter(stack));
}
}
}
else if(id == 2)
{
if(isBlock)
{
FMLClientHandler.instance().displayGuiScreen(entityplayer, new GuiPasswordModify(tileEntity));
}
else {
ItemStack stack = entityplayer.getCurrentEquippedItem();
2013-11-27 22:17:10 +01:00
if(stack != null && stack.getItem() instanceof IElectricChest && MachineType.get(stack) == MachineType.ELECTRIC_CHEST)
2013-04-13 03:32:43 +02:00
{
FMLClientHandler.instance().displayGuiScreen(entityplayer, new GuiPasswordModify(stack));
}
}
}
}
@Override
public void registerSpecialTileEntities()
{
ClientRegistry.registerTileEntity(TileEntityEnrichmentChamber.class, "EnrichmentChamber", new RenderConfigurableMachine());
ClientRegistry.registerTileEntity(TileEntityOsmiumCompressor.class, "OsmiumCompressor", new RenderConfigurableMachine());
ClientRegistry.registerTileEntity(TileEntityCombiner.class, "Combiner", new RenderConfigurableMachine());
ClientRegistry.registerTileEntity(TileEntityCrusher.class, "Crusher", new RenderConfigurableMachine());
ClientRegistry.registerTileEntity(TileEntityFactory.class, "SmeltingFactory", new RenderConfigurableMachine());
ClientRegistry.registerTileEntity(TileEntityAdvancedFactory.class, "AdvancedSmeltingFactory", new RenderConfigurableMachine());
ClientRegistry.registerTileEntity(TileEntityEliteFactory.class, "UltimateSmeltingFactory", new RenderConfigurableMachine());
ClientRegistry.registerTileEntity(TileEntityPurificationChamber.class, "PurificationChamber", new RenderConfigurableMachine());
ClientRegistry.registerTileEntity(TileEntityEnergizedSmelter.class, "EnergizedSmelter", new RenderConfigurableMachine());
ClientRegistry.registerTileEntity(TileEntityMetallurgicInfuser.class, "MetallurgicInfuser", new RenderMetallurgicInfuser());
2013-11-03 17:38:36 +01:00
ClientRegistry.registerTileEntity(TileEntityObsidianTNT.class, "ObsidianTNT", new RenderObsidianTNT());
ClientRegistry.registerTileEntity(TileEntityGasTank.class, "GasTank", new RenderGasTank());
ClientRegistry.registerTileEntity(TileEntityEnergyCube.class, "EnergyCube", new RenderEnergyCube());
ClientRegistry.registerTileEntity(TileEntityElectricPump.class, "ElectricPump", new RenderElectricPump());
ClientRegistry.registerTileEntity(TileEntityElectricChest.class, "ElectricChest", new RenderElectricChest());
ClientRegistry.registerTileEntity(TileEntityDynamicTank.class, "DynamicTank", new RenderDynamicTank());
ClientRegistry.registerTileEntity(TileEntityDynamicValve.class, "DynamicValve", new RenderDynamicTank());
ClientRegistry.registerTileEntity(TileEntityChargepad.class, "Chargepad", new RenderChargepad());
ClientRegistry.registerTileEntity(TileEntityLogisticalSorter.class, "LogisticalSorter", new RenderLogisticalSorter());
2013-11-12 01:27:36 +01:00
ClientRegistry.registerTileEntity(TileEntityBin.class, "Bin", new RenderBin());
ClientRegistry.registerTileEntity(TileEntityDigitalMiner.class, "DigitalMiner", new RenderDigitalMiner());
ClientRegistry.registerTileEntity(TileEntityRotaryCondensentrator.class, "RotaryCondensentrator", new RenderRotaryCondensentrator());
2013-12-07 23:06:11 +01:00
ClientRegistry.registerTileEntity(TileEntityTeleporter.class, "MekanismTeleporter", new RenderTeleporter());
ClientRegistry.registerTileEntity(TileEntityChemicalOxidizer.class, "ChemicalOxidizer", new RenderChemicalOxidizer());
ClientRegistry.registerTileEntity(TileEntityChemicalInfuser.class, "ChemicalInfuser", new RenderChemicalInfuser());
2013-12-24 22:58:14 +01:00
ClientRegistry.registerTileEntity(TileEntityChemicalInjectionChamber.class, "ChemicalInjectionChamber", new RenderConfigurableMachine());
ClientRegistry.registerTileEntity(TileEntityElectrolyticSeparator.class, "ElectrolyticSeparator", new RenderElectrolyticSeparator());
2014-01-17 03:55:29 +01:00
ClientRegistry.registerTileEntity(TileEntitySalinationController.class, "SalinationController", new RenderSalinationController());
ClientRegistry.registerTileEntity(TileEntityPrecisionSawmill.class, "PrecisionSawmill", new RenderConfigurableMachine());
2014-01-26 23:12:03 +01:00
ClientRegistry.registerTileEntity(TileEntityChemicalDissolutionChamber.class, "ChemicalDissolutionChamber", new RenderChemicalDissolutionChamber());
ClientRegistry.registerTileEntity(TileEntityChemicalWasher.class, "ChemicalWasher", new RenderChemicalWasher());
ClientRegistry.registerTileEntity(TileEntityChemicalCrystallizer.class, "ChemicalCrystallizer", new RenderChemicalCrystallizer());
ClientRegistry.registerTileEntity(TileEntityPRC.class, "PressurizedReactionChamber", new RenderConfigurableMachine());
}
@Override
public void registerRenderInformation()
{
RenderPartTransmitter.init();
2014-04-13 04:05:50 +02:00
RenderGlowPanel.init();
//Register entity rendering handlers
2013-11-03 17:38:36 +01:00
RenderingRegistry.registerEntityRenderingHandler(EntityObsidianTNT.class, new RenderObsidianTNTPrimed());
RenderingRegistry.registerEntityRenderingHandler(EntityRobit.class, new RenderRobit());
2013-12-24 22:06:57 +01:00
RenderingRegistry.registerEntityRenderingHandler(EntityBalloon.class, new RenderBalloon());
//Register item handler
2013-11-13 04:43:06 +01:00
ItemRenderingHandler handler = new ItemRenderingHandler();
MinecraftForgeClient.registerItemRenderer(Mekanism.energyCubeID, handler);
MinecraftForgeClient.registerItemRenderer(Mekanism.machineBlockID, handler);
MinecraftForgeClient.registerItemRenderer(Mekanism.machineBlock2ID, handler);
MinecraftForgeClient.registerItemRenderer(Mekanism.Robit.itemID, handler);
MinecraftForgeClient.registerItemRenderer(Mekanism.WalkieTalkie.itemID, handler);
MinecraftForgeClient.registerItemRenderer(Mekanism.gasTankID, handler);
MinecraftForgeClient.registerItemRenderer(Mekanism.obsidianTNTID, handler);
MinecraftForgeClient.registerItemRenderer(Mekanism.basicBlockID, handler);
MinecraftForgeClient.registerItemRenderer(Mekanism.Jetpack.itemID, handler);
MinecraftForgeClient.registerItemRenderer(Mekanism.ArmoredJetpack.itemID, handler);
MinecraftForgeClient.registerItemRenderer(Mekanism.PartTransmitter.itemID, handler);
MinecraftForgeClient.registerItemRenderer(Mekanism.GasMask.itemID, handler);
MinecraftForgeClient.registerItemRenderer(Mekanism.ScubaTank.itemID, handler);
MinecraftForgeClient.registerItemRenderer(Mekanism.Balloon.itemID, handler);
MinecraftForgeClient.registerItemRenderer(Mekanism.FreeRunners.itemID, handler);
MinecraftForgeClient.registerItemRenderer(Mekanism.AtomicDisassembler.itemID, handler);
MinecraftForgeClient.registerItemRenderer(Mekanism.plasticID, handler);
//Register block handlers
RenderingRegistry.registerBlockHandler(new MachineRenderingHandler());
RenderingRegistry.registerBlockHandler(new BasicRenderingHandler());
System.out.println("[Mekanism] Render registrations complete.");
}
@Override
public GuiScreen getClientGui(int ID, EntityPlayer player, World world, int x, int y, int z)
{
v5 Beta #9 *Bumped animation textures to 32x32. *Added default parameter to TabProxy.tabMekanism(). *Added additional info to Machine/GeneratorType for better handling of metadata. *Added Reinforced Iron, a stronger version of an Iron Block. *Updated onBlockActivated() code to function correctly. *Added feature for a generator or power unit to be placed facing up or down. *Cleaned up GUI access/handler code. *Fixed electric machine shift-click bug. *Added Diamond Dust. *Fixed Energized Bow continuing to fire after it's energy is depleted. *Added HP information to armor and tools. *Fixed slot parameters. *Overhauled packet system. *Cleaned up tile entity hierarchy. *Added BuildCraft liquid support to Heat Generator to allow energy generation with both BuildCraft's fuel buckets and liquid fuel. *Fixed texture preloads. *Added Electolytic Separator -- a machine that separates hydrogen and oxygen molecules from water. It accepts water from BuildCraft pipes. *Added Hydrogen Generator -- a generator that by default generates 128 u/t, but has boosts by the block's height of up to 512 u/t. *Added Solar Generator, a generator that produces 32 u/t when it can see the sun. *Added Gas API! Simple gas management that allows for both storage of gas in items, blocks, and transfer between themselves. So far implemented gasses are oxygen and hydrogen. *Added LiquidSlot for easy management of liquid in tile entities. *Added Hydrogen Tank and Oxygen Tank items. *Added BuildCraft hooks. *Fixed zombies and skeletons spawning with Obsidian Armor, and lowered chances of spawning with any armor. *More OreDictionary registrations to fix IC2's different dust names. *Fixed some javadocs. *Added 'Solar Panel' item as a crafting element for a Solar Generator. *Minor bugfixes.
2012-11-15 21:04:12 +01:00
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
switch(ID)
{
2013-12-10 02:52:49 +01:00
case 0:
return new GuiDictionary(player.inventory);
case 1:
return new GuiCredits();
case 2:
return new GuiDigitalMiner(player.inventory, (TileEntityDigitalMiner)tileEntity);
case 3:
return new GuiEnrichmentChamber(player.inventory, (TileEntityElectricMachine)tileEntity);
case 4:
return new GuiOsmiumCompressor(player.inventory, (TileEntityAdvancedElectricMachine)tileEntity);
case 5:
return new GuiCombiner(player.inventory, (TileEntityAdvancedElectricMachine)tileEntity);
case 6:
return new GuiCrusher(player.inventory, (TileEntityElectricMachine)tileEntity);
case 7:
return new GuiRotaryCondensentrator(player.inventory, (TileEntityRotaryCondensentrator)tileEntity);
case 8:
return new GuiEnergyCube(player.inventory, (TileEntityEnergyCube)tileEntity);
case 9:
return new GuiConfiguration(player, (IInvConfiguration)tileEntity);
case 10:
return new GuiGasTank(player.inventory, (TileEntityGasTank)tileEntity);
case 11:
return new GuiFactory(player.inventory, (TileEntityFactory)tileEntity);
case 12:
return new GuiMetallurgicInfuser(player.inventory, (TileEntityMetallurgicInfuser)tileEntity);
case 13:
return new GuiTeleporter(player.inventory, (TileEntityTeleporter)tileEntity);
case 14:
ItemStack itemStack = player.getCurrentEquippedItem();
2013-12-24 22:06:57 +01:00
if(itemStack != null && itemStack.getItem() instanceof ItemPortableTeleporter)
{
return new GuiPortableTeleporter(player, itemStack);
}
case 15:
return new GuiPurificationChamber(player.inventory, (TileEntityAdvancedElectricMachine)tileEntity);
case 16:
return new GuiEnergizedSmelter(player.inventory, (TileEntityElectricMachine)tileEntity);
case 17:
return new GuiElectricPump(player.inventory, (TileEntityElectricPump)tileEntity);
case 18:
return new GuiDynamicTank(player.inventory, (TileEntityDynamicTank)tileEntity);
case 19:
return new GuiPasswordEnter((TileEntityElectricChest)tileEntity);
case 20:
return new GuiPasswordModify((TileEntityElectricChest)tileEntity);
case 21:
EntityRobit robit = (EntityRobit)world.getEntityByID(x);
2013-12-24 22:06:57 +01:00
if(robit != null)
{
return new GuiRobitMain(player.inventory, robit);
}
case 22:
return new GuiRobitCrafting(player.inventory, world, x);
case 23:
EntityRobit robit1 = (EntityRobit)world.getEntityByID(x);
2013-12-24 22:06:57 +01:00
if(robit1 != null)
{
return new GuiRobitInventory(player.inventory, robit1);
}
case 24:
EntityRobit robit2 = (EntityRobit)world.getEntityByID(x);
2013-12-24 22:06:57 +01:00
if(robit2 != null)
{
return new GuiRobitSmelting(player.inventory, robit2);
}
case 25:
return new GuiRobitRepair(player.inventory, world, x);
2013-12-12 02:24:37 +01:00
case 29:
return new GuiChemicalOxidizer(player.inventory, (TileEntityChemicalOxidizer)tileEntity);
2013-12-24 22:06:57 +01:00
case 30:
return new GuiChemicalInfuser(player.inventory, (TileEntityChemicalInfuser)tileEntity);
2013-12-24 22:06:57 +01:00
case 31:
return new GuiChemicalInjectionChamber(player.inventory, (TileEntityAdvancedElectricMachine)tileEntity);
case 32:
return new GuiElectrolyticSeparator(player.inventory, (TileEntityElectrolyticSeparator)tileEntity);
case 33:
return new GuiSalinationController(player.inventory, (TileEntitySalinationController)tileEntity);
case 34:
return new GuiPrecisionSawmill(player.inventory, (TileEntityPrecisionSawmill)tileEntity);
2014-01-31 22:32:13 +01:00
case 35:
return new GuiChemicalDissolutionChamber(player.inventory, (TileEntityChemicalDissolutionChamber)tileEntity);
case 36:
return new GuiChemicalWasher(player.inventory, (TileEntityChemicalWasher)tileEntity);
case 37:
return new GuiChemicalCrystallizer(player.inventory, (TileEntityChemicalCrystallizer)tileEntity);
2014-03-16 01:05:26 +01:00
case 38:
ItemStack itemStack1 = player.getCurrentEquippedItem().copy();
if(itemStack1 != null && itemStack1.getItem() instanceof ItemSeismicReader)
{
return new GuiSeismicReader(new Coord4D(x, y, z, world.provider.dimensionId), itemStack1);
}
case 39:
return new GuiSeismicVibrator(player.inventory, (TileEntitySeismicVibrator)tileEntity);
2014-04-06 02:16:09 +02:00
case 40:
return new GuiPRC(player.inventory, (TileEntityPRC)tileEntity);
}
return null;
}
@Override
public void doTankAnimation(TileEntityDynamicTank tileEntity)
{
new ThreadTankSparkle(tileEntity).start();
}
@Override
public void loadUtilities()
{
super.loadUtilities();
TickRegistry.registerTickHandler(new ClientTickHandler(), Side.CLIENT);
TickRegistry.registerTickHandler(new RenderTickHandler(), Side.CLIENT);
NetworkRegistry.instance().registerConnectionHandler(new ClientConnectionHandler());
2013-10-14 18:44:07 +02:00
KeyBindingRegistry.registerKeyBinding(new MekanismKeyHandler());
2013-12-07 23:06:11 +01:00
GameRegistry.registerPlayerTracker(new ClientPlayerTracker());
2013-12-24 17:20:22 +01:00
HolidayManager.init();
}
@Override
public void loadSoundHandler()
{
if(MekanismClient.enableSounds)
{
MekanismClient.audioHandler = new SoundHandler();
}
}
@Override
public void unloadSoundHandler()
{
if(MekanismClient.enableSounds)
{
if(MekanismClient.audioHandler != null)
{
synchronized(MekanismClient.audioHandler.sounds)
{
HashMap<Object, Sound> sounds = new HashMap<Object, Sound>();
sounds.putAll(MekanismClient.audioHandler.sounds);
for(Sound sound : sounds.values())
{
sound.remove();
}
MekanismClient.audioHandler.sounds.clear();
}
}
}
}
@Override
public void preInit()
{
MekanismRenderer.init();
}
@Override
public double getReach(EntityPlayer player)
{
return Minecraft.getMinecraft().playerController.getBlockReachDistance();
}
@Override
public boolean isPaused()
{
if(FMLClientHandler.instance().getClient().isSingleplayer() && !FMLClientHandler.instance().getClient().getIntegratedServer().getPublic())
{
GuiScreen screen = FMLClientHandler.instance().getClient().currentScreen;
if(screen != null && screen.doesGuiPauseGame())
{
return true;
}
}
return false;
}
2013-07-20 18:10:14 +02:00
@Override
public File getMinecraftDir()
{
return Minecraft.getMinecraft().mcDataDir;
}
@Override
public void onConfigSync()
{
super.onConfigSync();
if(Mekanism.voiceServerEnabled)
{
MekanismClient.voiceClient.start();
}
}
}