2012-11-05 20:29:04 +01:00
|
|
|
package mekanism.client;
|
2012-08-15 22:41:41 +02:00
|
|
|
|
|
|
|
|
2013-07-20 18:10:14 +02:00
|
|
|
import java.io.File;
|
2013-04-14 17:55:51 +02:00
|
|
|
import java.util.HashMap;
|
2013-04-13 16:33:37 +02:00
|
|
|
|
2013-10-30 20:22:43 +01:00
|
|
|
import mekanism.api.IConfigurable;
|
2013-08-27 00:49:32 +02:00
|
|
|
import mekanism.api.gas.EnumGas;
|
|
|
|
import mekanism.client.gui.GuiCombiner;
|
2013-10-30 20:22:43 +01:00
|
|
|
import mekanism.client.gui.GuiConfiguration;
|
2013-08-27 00:49:32 +02:00
|
|
|
import mekanism.client.gui.GuiCredits;
|
|
|
|
import mekanism.client.gui.GuiCrusher;
|
|
|
|
import mekanism.client.gui.GuiDynamicTank;
|
|
|
|
import mekanism.client.gui.GuiElectricChest;
|
|
|
|
import mekanism.client.gui.GuiElectricPump;
|
|
|
|
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;
|
|
|
|
import mekanism.client.gui.GuiPasswordEnter;
|
|
|
|
import mekanism.client.gui.GuiPasswordModify;
|
|
|
|
import mekanism.client.gui.GuiPortableTeleporter;
|
|
|
|
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.GuiStopwatch;
|
|
|
|
import mekanism.client.gui.GuiTeleporter;
|
|
|
|
import mekanism.client.gui.GuiTheoreticalElementizer;
|
|
|
|
import mekanism.client.gui.GuiWeatherOrb;
|
2013-08-27 00:57:08 +02:00
|
|
|
import mekanism.client.render.MekanismRenderer;
|
2013-08-27 00:49:32 +02:00
|
|
|
import mekanism.client.render.RenderTickHandler;
|
2013-08-27 00:57:08 +02:00
|
|
|
import mekanism.client.render.block.BasicRenderingHandler;
|
|
|
|
import mekanism.client.render.block.MachineRenderingHandler;
|
|
|
|
import mekanism.client.render.block.TransmitterRenderingHandler;
|
|
|
|
import mekanism.client.render.entity.RenderObsidianTNT;
|
|
|
|
import mekanism.client.render.entity.RenderRobit;
|
|
|
|
import mekanism.client.render.item.ItemRenderingHandler;
|
|
|
|
import mekanism.client.render.tileentity.RenderChargepad;
|
|
|
|
import mekanism.client.render.tileentity.RenderConfigurableMachine;
|
|
|
|
import mekanism.client.render.tileentity.RenderDynamicTank;
|
|
|
|
import mekanism.client.render.tileentity.RenderElectricChest;
|
|
|
|
import mekanism.client.render.tileentity.RenderElectricPump;
|
|
|
|
import mekanism.client.render.tileentity.RenderLogisticalTransporter;
|
|
|
|
import mekanism.client.render.tileentity.RenderMechanicalPipe;
|
|
|
|
import mekanism.client.render.tileentity.RenderMetallurgicInfuser;
|
|
|
|
import mekanism.client.render.tileentity.RenderPressurizedTube;
|
|
|
|
import mekanism.client.render.tileentity.RenderTheoreticalElementizer;
|
|
|
|
import mekanism.client.render.tileentity.RenderUniversalCable;
|
|
|
|
import mekanism.client.sound.Sound;
|
|
|
|
import mekanism.client.sound.SoundHandler;
|
2012-11-05 20:29:04 +01:00
|
|
|
import mekanism.common.CommonProxy;
|
|
|
|
import mekanism.common.EntityObsidianTNT;
|
2013-05-20 00:43:01 +02:00
|
|
|
import mekanism.common.EntityRobit;
|
2013-04-13 03:32:43 +02:00
|
|
|
import mekanism.common.IElectricChest;
|
2012-11-05 20:29:04 +01:00
|
|
|
import mekanism.common.Mekanism;
|
2013-08-27 00:49:32 +02:00
|
|
|
import mekanism.common.inventory.InventoryElectricChest;
|
|
|
|
import mekanism.common.item.ItemPortableTeleporter;
|
|
|
|
import mekanism.common.tileentity.TileEntityAdvancedElectricMachine;
|
|
|
|
import mekanism.common.tileentity.TileEntityAdvancedFactory;
|
|
|
|
import mekanism.common.tileentity.TileEntityChargepad;
|
|
|
|
import mekanism.common.tileentity.TileEntityCombiner;
|
|
|
|
import mekanism.common.tileentity.TileEntityCrusher;
|
|
|
|
import mekanism.common.tileentity.TileEntityDynamicTank;
|
|
|
|
import mekanism.common.tileentity.TileEntityDynamicValve;
|
|
|
|
import mekanism.common.tileentity.TileEntityElectricChest;
|
|
|
|
import mekanism.common.tileentity.TileEntityElectricMachine;
|
|
|
|
import mekanism.common.tileentity.TileEntityElectricPump;
|
|
|
|
import mekanism.common.tileentity.TileEntityEliteFactory;
|
|
|
|
import mekanism.common.tileentity.TileEntityEnergizedSmelter;
|
|
|
|
import mekanism.common.tileentity.TileEntityEnergyCube;
|
|
|
|
import mekanism.common.tileentity.TileEntityEnrichmentChamber;
|
|
|
|
import mekanism.common.tileentity.TileEntityFactory;
|
|
|
|
import mekanism.common.tileentity.TileEntityGasTank;
|
|
|
|
import mekanism.common.tileentity.TileEntityLogisticalTransporter;
|
|
|
|
import mekanism.common.tileentity.TileEntityMechanicalPipe;
|
|
|
|
import mekanism.common.tileentity.TileEntityMetallurgicInfuser;
|
|
|
|
import mekanism.common.tileentity.TileEntityOsmiumCompressor;
|
|
|
|
import mekanism.common.tileentity.TileEntityPressurizedTube;
|
|
|
|
import mekanism.common.tileentity.TileEntityPurificationChamber;
|
|
|
|
import mekanism.common.tileentity.TileEntityTeleporter;
|
|
|
|
import mekanism.common.tileentity.TileEntityTheoreticalElementizer;
|
|
|
|
import mekanism.common.tileentity.TileEntityUniversalCable;
|
2013-08-27 00:57:08 +02:00
|
|
|
import mekanism.common.util.MekanismUtils;
|
|
|
|
import mekanism.common.util.MekanismUtils.ResourceType;
|
2013-07-20 18:10:14 +02:00
|
|
|
import net.minecraft.client.Minecraft;
|
2012-12-20 22:53:39 +01:00
|
|
|
import net.minecraft.client.gui.GuiScreen;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2013-01-21 02:15:59 +01:00
|
|
|
import net.minecraft.item.ItemStack;
|
2012-12-20 22:53:39 +01:00
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
import net.minecraft.world.World;
|
2012-08-15 22:41:41 +02:00
|
|
|
import net.minecraftforge.client.MinecraftForgeClient;
|
2013-02-14 19:26:13 +01:00
|
|
|
import net.minecraftforge.common.Configuration;
|
2012-12-20 22:53:39 +01:00
|
|
|
import cpw.mods.fml.client.FMLClientHandler;
|
2012-12-23 20:46:11 +01:00
|
|
|
import cpw.mods.fml.client.registry.ClientRegistry;
|
2013-10-14 18:44:07 +02:00
|
|
|
import cpw.mods.fml.client.registry.KeyBindingRegistry;
|
2012-12-20 22:53:39 +01:00
|
|
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
2013-04-13 16:33:37 +02:00
|
|
|
import cpw.mods.fml.common.network.NetworkRegistry;
|
2012-12-20 22:53:39 +01:00
|
|
|
import cpw.mods.fml.common.registry.TickRegistry;
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
2013-04-13 16:33:37 +02:00
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
2012-08-15 22:41:41 +02:00
|
|
|
|
|
|
|
/**
|
2012-11-05 20:29:04 +01:00
|
|
|
* Client proxy for the Mekanism mod.
|
2012-08-15 22:41:41 +02:00
|
|
|
* @author AidanBrady
|
|
|
|
*
|
|
|
|
*/
|
2013-04-13 16:33:37 +02:00
|
|
|
@SideOnly(Side.CLIENT)
|
2012-08-15 22:41:41 +02:00
|
|
|
public class ClientProxy extends CommonProxy
|
|
|
|
{
|
2013-04-28 21:23:08 +02:00
|
|
|
public static int MACHINE_RENDER_ID = RenderingRegistry.getNextAvailableRenderId();
|
2013-03-25 17:00:45 +01:00
|
|
|
public static int TRANSMITTER_RENDER_ID = RenderingRegistry.getNextAvailableRenderId();
|
2013-04-28 21:23:08 +02:00
|
|
|
public static int BASIC_RENDER_ID = RenderingRegistry.getNextAvailableRenderId();
|
2012-11-28 16:33:34 +01:00
|
|
|
|
2013-02-14 19:26:13 +01:00
|
|
|
@Override
|
|
|
|
public void loadConfiguration()
|
|
|
|
{
|
|
|
|
super.loadConfiguration();
|
|
|
|
|
|
|
|
Mekanism.configuration.load();
|
2013-10-15 05:36:07 +02:00
|
|
|
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-04-13 16:33:37 +02:00
|
|
|
Mekanism.configuration.save();
|
2013-02-14 19:26:13 +01:00
|
|
|
}
|
|
|
|
|
2012-11-06 16:44:14 +01:00
|
|
|
@Override
|
2012-08-31 01:27:35 +02:00
|
|
|
public int getArmorIndex(String string)
|
|
|
|
{
|
|
|
|
return RenderingRegistry.addNewArmourRendererPrefix(string);
|
|
|
|
}
|
|
|
|
|
2013-04-13 16:33:37 +02:00
|
|
|
@Override
|
2013-04-14 17:55:51 +02:00
|
|
|
public void registerSound(TileEntity tileEntity)
|
2013-04-13 16:33:37 +02:00
|
|
|
{
|
2013-10-15 05:36:07 +02:00
|
|
|
if(MekanismClient.enableSounds && Minecraft.getMinecraft().sndManager.sndSystem != null)
|
2013-04-13 16:33:37 +02:00
|
|
|
{
|
2013-10-15 05:36:07 +02:00
|
|
|
synchronized(MekanismClient.audioHandler.sounds)
|
2013-04-28 21:23:08 +02:00
|
|
|
{
|
2013-10-15 05:36:07 +02:00
|
|
|
MekanismClient.audioHandler.register(tileEntity);
|
2013-04-28 21:23:08 +02:00
|
|
|
}
|
2013-04-13 16:33:37 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void unregisterSound(TileEntity tileEntity)
|
|
|
|
{
|
2013-10-15 05:36:07 +02:00
|
|
|
if(MekanismClient.enableSounds && Minecraft.getMinecraft().sndManager.sndSystem != null)
|
2013-04-13 16:33:37 +02:00
|
|
|
{
|
2013-10-15 05:36:07 +02:00
|
|
|
synchronized(MekanismClient.audioHandler.sounds)
|
2013-04-13 16:33:37 +02:00
|
|
|
{
|
2013-10-15 05:36:07 +02:00
|
|
|
if(MekanismClient.audioHandler.getFrom(tileEntity) != null)
|
2013-04-28 21:23:08 +02:00
|
|
|
{
|
2013-10-15 05:36:07 +02:00
|
|
|
MekanismClient.audioHandler.getFrom(tileEntity).remove();
|
2013-04-28 21:23:08 +02:00
|
|
|
}
|
2013-04-13 16:33:37 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
TileEntityElectricChest tileEntity = (TileEntityElectricChest)entityplayer.worldObj.getBlockTileEntity(x, y, z);
|
|
|
|
|
|
|
|
if(id == 0)
|
|
|
|
{
|
|
|
|
if(isBlock)
|
|
|
|
{
|
|
|
|
FMLClientHandler.instance().displayGuiScreen(entityplayer, new GuiElectricChest(entityplayer.inventory, tileEntity));
|
|
|
|
entityplayer.openContainer.windowId = windowId;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FMLClientHandler.instance().getClient().sndManager.playSoundFX("random.chestopen", 1.0F, 1.0F);
|
|
|
|
ItemStack stack = entityplayer.getCurrentEquippedItem();
|
2013-04-19 21:43:00 +02:00
|
|
|
|
2013-04-13 03:32:43 +02:00
|
|
|
if(stack != null && stack.getItem() instanceof IElectricChest && ((IElectricChest)stack.getItem()).isElectricChest(stack))
|
|
|
|
{
|
2013-04-19 21:43:00 +02:00
|
|
|
InventoryElectricChest inventory = new InventoryElectricChest(entityplayer);
|
2013-04-13 03:32:43 +02:00
|
|
|
FMLClientHandler.instance().displayGuiScreen(entityplayer, new GuiElectricChest(entityplayer.inventory, inventory));
|
|
|
|
entityplayer.openContainer.windowId = windowId;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(id == 1)
|
|
|
|
{
|
|
|
|
if(isBlock)
|
|
|
|
{
|
|
|
|
FMLClientHandler.instance().displayGuiScreen(entityplayer, new GuiPasswordEnter(tileEntity));
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
ItemStack stack = entityplayer.getCurrentEquippedItem();
|
|
|
|
if(stack != null && stack.getItem() instanceof IElectricChest && ((IElectricChest)stack.getItem()).isElectricChest(stack))
|
|
|
|
{
|
|
|
|
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();
|
|
|
|
if(stack != null && stack.getItem() instanceof IElectricChest && ((IElectricChest)stack.getItem()).isElectricChest(stack))
|
|
|
|
{
|
|
|
|
FMLClientHandler.instance().displayGuiScreen(entityplayer, new GuiPasswordModify(stack));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-12-23 20:46:11 +01:00
|
|
|
@Override
|
|
|
|
public void registerSpecialTileEntities()
|
|
|
|
{
|
2013-05-23 19:30:12 +02:00
|
|
|
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());
|
2012-12-23 20:46:11 +01:00
|
|
|
ClientRegistry.registerTileEntity(TileEntityTheoreticalElementizer.class, "TheoreticalElementizer", new RenderTheoreticalElementizer());
|
2013-04-05 22:26:48 +02:00
|
|
|
ClientRegistry.registerTileEntity(TileEntityMetallurgicInfuser.class, "MetallurgicInfuser", new RenderMetallurgicInfuser());
|
2013-02-22 04:03:54 +01:00
|
|
|
ClientRegistry.registerTileEntity(TileEntityPressurizedTube.class, "PressurizedTube", new RenderPressurizedTube());
|
2013-03-25 17:00:45 +01:00
|
|
|
ClientRegistry.registerTileEntity(TileEntityUniversalCable.class, "UniversalCable", new RenderUniversalCable());
|
2013-04-05 22:26:48 +02:00
|
|
|
ClientRegistry.registerTileEntity(TileEntityElectricPump.class, "ElectricPump", new RenderElectricPump());
|
2013-04-13 02:25:21 +02:00
|
|
|
ClientRegistry.registerTileEntity(TileEntityElectricChest.class, "ElectricChest", new RenderElectricChest());
|
2013-04-18 04:40:11 +02:00
|
|
|
ClientRegistry.registerTileEntity(TileEntityMechanicalPipe.class, "MechanicalPipe", new RenderMechanicalPipe());
|
2013-04-28 21:23:08 +02:00
|
|
|
ClientRegistry.registerTileEntity(TileEntityDynamicTank.class, "DynamicTank", new RenderDynamicTank());
|
|
|
|
ClientRegistry.registerTileEntity(TileEntityDynamicValve.class, "DynamicValve", new RenderDynamicTank());
|
2013-05-20 00:43:01 +02:00
|
|
|
ClientRegistry.registerTileEntity(TileEntityChargepad.class, "Chargepad", new RenderChargepad());
|
2013-08-06 05:58:44 +02:00
|
|
|
ClientRegistry.registerTileEntity(TileEntityLogisticalTransporter.class, "LogisticalTransporter", new RenderLogisticalTransporter());
|
2012-12-23 20:46:11 +01:00
|
|
|
}
|
|
|
|
|
2012-11-06 16:44:14 +01:00
|
|
|
@Override
|
2012-08-15 22:41:41 +02:00
|
|
|
public void registerRenderInformation()
|
|
|
|
{
|
|
|
|
//Register entity rendering handlers
|
|
|
|
RenderingRegistry.registerEntityRenderingHandler(EntityObsidianTNT.class, new RenderObsidianTNT());
|
2013-05-20 00:43:01 +02:00
|
|
|
RenderingRegistry.registerEntityRenderingHandler(EntityRobit.class, new RenderRobit());
|
2012-11-21 16:14:35 +01:00
|
|
|
|
2012-11-28 16:33:34 +01:00
|
|
|
//Register item handler
|
|
|
|
MinecraftForgeClient.registerItemRenderer(Mekanism.energyCubeID, new ItemRenderingHandler());
|
2013-04-20 00:03:59 +02:00
|
|
|
MinecraftForgeClient.registerItemRenderer(Mekanism.machineBlockID, new ItemRenderingHandler());
|
2013-05-20 00:43:01 +02:00
|
|
|
MinecraftForgeClient.registerItemRenderer(Mekanism.Robit.itemID, new ItemRenderingHandler());
|
2013-10-13 18:31:26 +02:00
|
|
|
MinecraftForgeClient.registerItemRenderer(Mekanism.WalkieTalkie.itemID, new ItemRenderingHandler());
|
2012-12-23 20:46:11 +01:00
|
|
|
|
2013-02-22 04:03:54 +01:00
|
|
|
//Register block handlers
|
2013-05-20 00:43:01 +02:00
|
|
|
RenderingRegistry.registerBlockHandler(new MachineRenderingHandler());
|
2013-08-27 00:49:32 +02:00
|
|
|
RenderingRegistry.registerBlockHandler(new TransmitterRenderingHandler());
|
2013-04-28 21:23:08 +02:00
|
|
|
RenderingRegistry.registerBlockHandler(new BasicRenderingHandler());
|
2012-11-28 16:33:34 +01:00
|
|
|
|
2013-05-14 17:34:26 +02:00
|
|
|
if(!EnumGas.HYDROGEN.hasTexture())
|
|
|
|
{
|
2013-07-20 18:10:14 +02:00
|
|
|
EnumGas.HYDROGEN.gasIcon = MekanismRenderer.getTextureMap(1).registerIcon("mekanism:LiquidHydrogen");
|
|
|
|
EnumGas.HYDROGEN.texturePath = MekanismUtils.getResource(ResourceType.TEXTURE_ITEMS, "LiquidHydrogen.png");
|
2013-05-14 17:34:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if(!EnumGas.OXYGEN.hasTexture())
|
|
|
|
{
|
2013-07-20 18:10:14 +02:00
|
|
|
EnumGas.OXYGEN.gasIcon = MekanismRenderer.getTextureMap(1).registerIcon("mekanism:LiquidOxygen");
|
|
|
|
EnumGas.OXYGEN.texturePath = MekanismUtils.getResource(ResourceType.TEXTURE_ITEMS, "LiquidOxygen.png");
|
2013-05-14 17:34:26 +02:00
|
|
|
}
|
|
|
|
|
2012-11-28 16:33:34 +01:00
|
|
|
System.out.println("[Mekanism] Render registrations complete.");
|
2012-08-15 22:41:41 +02:00
|
|
|
}
|
|
|
|
|
2012-11-06 16:44:14 +01:00
|
|
|
@Override
|
2012-08-15 22:41:41 +02:00
|
|
|
public GuiScreen getClientGui(int ID, EntityPlayer player, World world, int x, int y, int z)
|
|
|
|
{
|
2012-11-15 21:04:12 +01:00
|
|
|
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
|
|
|
|
|
2012-08-15 22:41:41 +02:00
|
|
|
switch(ID)
|
|
|
|
{
|
2012-09-25 21:15:47 +02:00
|
|
|
case 0:
|
2012-08-15 22:41:41 +02:00
|
|
|
return new GuiStopwatch(player);
|
2012-09-25 21:15:47 +02:00
|
|
|
case 1:
|
2012-08-15 22:41:41 +02:00
|
|
|
return new GuiCredits();
|
2012-09-25 21:15:47 +02:00
|
|
|
case 2:
|
2012-08-15 22:41:41 +02:00
|
|
|
return new GuiWeatherOrb(player);
|
2012-09-25 21:15:47 +02:00
|
|
|
case 3:
|
2013-01-23 21:42:45 +01:00
|
|
|
return new GuiEnrichmentChamber(player.inventory, (TileEntityElectricMachine)tileEntity);
|
2012-09-25 21:15:47 +02:00
|
|
|
case 4:
|
2013-02-27 02:21:30 +01:00
|
|
|
return new GuiOsmiumCompressor(player.inventory, (TileEntityAdvancedElectricMachine)tileEntity);
|
2012-09-25 21:15:47 +02:00
|
|
|
case 5:
|
2013-01-23 21:42:45 +01:00
|
|
|
return new GuiCombiner(player.inventory, (TileEntityAdvancedElectricMachine)tileEntity);
|
2012-09-25 21:15:47 +02:00
|
|
|
case 6:
|
2013-01-23 21:42:45 +01:00
|
|
|
return new GuiCrusher(player.inventory, (TileEntityElectricMachine)tileEntity);
|
2012-09-25 21:15:47 +02:00
|
|
|
case 7:
|
2012-11-15 21:04:12 +01:00
|
|
|
return new GuiTheoreticalElementizer(player.inventory, (TileEntityTheoreticalElementizer)tileEntity);
|
2012-10-02 20:39:40 +02:00
|
|
|
case 8:
|
2012-11-28 16:33:34 +01:00
|
|
|
return new GuiEnergyCube(player.inventory, (TileEntityEnergyCube)tileEntity);
|
2012-10-28 23:18:23 +01:00
|
|
|
case 9:
|
2013-10-30 20:22:43 +01:00
|
|
|
return new GuiConfiguration((IConfigurable)tileEntity);
|
2012-11-25 16:45:00 +01:00
|
|
|
case 10:
|
2012-11-21 16:14:35 +01:00
|
|
|
return new GuiGasTank(player.inventory, (TileEntityGasTank)tileEntity);
|
2012-12-19 21:23:55 +01:00
|
|
|
case 11:
|
2013-03-20 16:14:26 +01:00
|
|
|
return new GuiFactory(player.inventory, (TileEntityFactory)tileEntity);
|
2012-12-20 22:53:39 +01:00
|
|
|
case 12:
|
|
|
|
return new GuiMetallurgicInfuser(player.inventory, (TileEntityMetallurgicInfuser)tileEntity);
|
2013-01-21 02:15:59 +01:00
|
|
|
case 13:
|
|
|
|
return new GuiTeleporter(player.inventory, (TileEntityTeleporter)tileEntity);
|
|
|
|
case 14:
|
|
|
|
ItemStack itemStack = player.getCurrentEquippedItem();
|
|
|
|
if(itemStack != null && itemStack.getItem() instanceof ItemPortableTeleporter)
|
|
|
|
{
|
|
|
|
return new GuiPortableTeleporter(player, itemStack);
|
|
|
|
}
|
2013-01-23 21:42:45 +01:00
|
|
|
case 15:
|
|
|
|
return new GuiPurificationChamber(player.inventory, (TileEntityAdvancedElectricMachine)tileEntity);
|
2013-03-20 21:28:45 +01:00
|
|
|
case 16:
|
|
|
|
return new GuiEnergizedSmelter(player.inventory, (TileEntityElectricMachine)tileEntity);
|
2013-04-03 21:37:26 +02:00
|
|
|
case 17:
|
|
|
|
return new GuiElectricPump(player.inventory, (TileEntityElectricPump)tileEntity);
|
2013-04-28 21:23:08 +02:00
|
|
|
case 18:
|
|
|
|
return new GuiDynamicTank(player.inventory, (TileEntityDynamicTank)tileEntity);
|
2013-04-13 02:25:21 +02:00
|
|
|
case 19:
|
|
|
|
return new GuiPasswordEnter((TileEntityElectricChest)tileEntity);
|
|
|
|
case 20:
|
|
|
|
return new GuiPasswordModify((TileEntityElectricChest)tileEntity);
|
2013-05-20 00:43:01 +02:00
|
|
|
case 21:
|
|
|
|
EntityRobit robit = (EntityRobit)world.getEntityByID(x);
|
|
|
|
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);
|
|
|
|
if(robit1 != null)
|
|
|
|
{
|
|
|
|
return new GuiRobitInventory(player.inventory, robit1);
|
|
|
|
}
|
2013-05-20 19:51:18 +02:00
|
|
|
case 24:
|
|
|
|
EntityRobit robit2 = (EntityRobit)world.getEntityByID(x);
|
|
|
|
if(robit2 != null)
|
|
|
|
{
|
|
|
|
return new GuiRobitSmelting(player.inventory, robit2);
|
|
|
|
}
|
2013-05-20 21:06:10 +02:00
|
|
|
case 25:
|
|
|
|
return new GuiRobitRepair(player.inventory, world, x);
|
2012-08-15 22:41:41 +02:00
|
|
|
}
|
2013-05-20 00:43:01 +02:00
|
|
|
|
2012-08-15 22:41:41 +02:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2013-05-14 17:34:26 +02:00
|
|
|
@Override
|
|
|
|
public void doTankAnimation(TileEntityDynamicTank tileEntity)
|
|
|
|
{
|
|
|
|
new ThreadTankSparkle(tileEntity).start();
|
|
|
|
}
|
|
|
|
|
2012-11-06 16:44:14 +01:00
|
|
|
@Override
|
2013-04-13 16:33:37 +02:00
|
|
|
public void loadUtilities()
|
2012-08-15 22:41:41 +02:00
|
|
|
{
|
2013-04-13 16:33:37 +02:00
|
|
|
super.loadUtilities();
|
2013-01-21 02:15:59 +01:00
|
|
|
|
2012-08-15 22:41:41 +02:00
|
|
|
TickRegistry.registerTickHandler(new ClientTickHandler(), Side.CLIENT);
|
2013-03-31 00:13:59 +01:00
|
|
|
TickRegistry.registerTickHandler(new ClientPlayerTickHandler(), Side.CLIENT);
|
2013-05-14 17:34:26 +02:00
|
|
|
TickRegistry.registerTickHandler(new RenderTickHandler(), Side.CLIENT);
|
2013-04-13 16:33:37 +02:00
|
|
|
|
|
|
|
NetworkRegistry.instance().registerConnectionHandler(new ClientConnectionHandler());
|
2013-10-14 18:44:07 +02:00
|
|
|
|
|
|
|
KeyBindingRegistry.registerKeyBinding(new MekanismKeyHandler());
|
2012-08-15 22:41:41 +02:00
|
|
|
}
|
2012-11-05 16:52:56 +01:00
|
|
|
|
2012-11-06 16:44:14 +01:00
|
|
|
@Override
|
2012-11-05 16:52:56 +01:00
|
|
|
public void loadSoundHandler()
|
|
|
|
{
|
2013-10-15 05:36:07 +02:00
|
|
|
if(MekanismClient.enableSounds)
|
2013-02-14 19:26:13 +01:00
|
|
|
{
|
2013-10-15 05:36:07 +02:00
|
|
|
MekanismClient.audioHandler = new SoundHandler();
|
2013-02-14 19:26:13 +01:00
|
|
|
}
|
2012-11-05 16:52:56 +01:00
|
|
|
}
|
2012-12-30 22:34:45 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void unloadSoundHandler()
|
|
|
|
{
|
2013-10-15 05:36:07 +02:00
|
|
|
if(MekanismClient.enableSounds)
|
2012-12-30 22:34:45 +01:00
|
|
|
{
|
2013-10-15 05:36:07 +02:00
|
|
|
if(MekanismClient.audioHandler != null)
|
2012-12-30 22:34:45 +01:00
|
|
|
{
|
2013-10-15 05:36:07 +02:00
|
|
|
synchronized(MekanismClient.audioHandler.sounds)
|
2013-04-28 21:23:08 +02:00
|
|
|
{
|
|
|
|
HashMap<TileEntity, Sound> sounds = new HashMap<TileEntity, Sound>();
|
2013-10-15 05:36:07 +02:00
|
|
|
sounds.putAll(MekanismClient.audioHandler.sounds);
|
2013-04-28 21:23:08 +02:00
|
|
|
|
|
|
|
for(Sound sound : sounds.values())
|
|
|
|
{
|
|
|
|
sound.remove();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isPaused()
|
|
|
|
{
|
|
|
|
if(FMLClientHandler.instance().getClient().isSingleplayer() && !FMLClientHandler.instance().getClient().getIntegratedServer().getPublic())
|
|
|
|
{
|
|
|
|
GuiScreen screen = FMLClientHandler.instance().getClient().currentScreen;
|
|
|
|
|
|
|
|
if(screen != null)
|
|
|
|
{
|
|
|
|
if(screen.doesGuiPauseGame())
|
2013-02-14 19:26:13 +01:00
|
|
|
{
|
2013-04-28 21:23:08 +02:00
|
|
|
return true;
|
2013-02-14 19:26:13 +01:00
|
|
|
}
|
2012-12-30 22:34:45 +01:00
|
|
|
}
|
|
|
|
}
|
2013-04-28 21:23:08 +02:00
|
|
|
|
|
|
|
return false;
|
2012-12-30 22:34:45 +01:00
|
|
|
}
|
2013-07-20 18:10:14 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public File getMinecraftDir()
|
|
|
|
{
|
|
|
|
return Minecraft.getMinecraft().mcDataDir;
|
|
|
|
}
|
2012-08-15 22:41:41 +02:00
|
|
|
}
|