2012-11-05 20:29:04 +01:00
|
|
|
package mekanism.client;
|
2012-08-15 22:41:41 +02:00
|
|
|
|
2014-01-05 08:24:06 +01:00
|
|
|
import java.io.File;
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
2014-01-31 22:32:13 +01:00
|
|
|
import mekanism.client.gui.GuiChemicalCrystalizer;
|
|
|
|
import mekanism.client.gui.GuiChemicalDissolutionChamber;
|
2014-01-05 08:24:06 +01:00
|
|
|
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;
|
2014-01-05 08:24:06 +01:00
|
|
|
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;
|
|
|
|
import mekanism.client.gui.GuiPasswordEnter;
|
|
|
|
import mekanism.client.gui.GuiPasswordModify;
|
|
|
|
import mekanism.client.gui.GuiPortableTeleporter;
|
2014-01-13 06:06:13 +01:00
|
|
|
import mekanism.client.gui.GuiPrecisionSawmill;
|
2014-01-05 08:24:06 +01:00
|
|
|
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;
|
2014-01-12 00:35:39 +01:00
|
|
|
import mekanism.client.gui.GuiSalinationController;
|
2014-01-05 08:24:06 +01:00
|
|
|
import mekanism.client.gui.GuiTeleporter;
|
2013-08-27 00:57:08 +02:00
|
|
|
import mekanism.client.render.MekanismRenderer;
|
2013-12-24 23:14:28 +01:00
|
|
|
import mekanism.client.render.RenderPartTransmitter;
|
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;
|
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;
|
2013-08-27 00:57:08 +02:00
|
|
|
import mekanism.client.render.entity.RenderRobit;
|
|
|
|
import mekanism.client.render.item.ItemRenderingHandler;
|
2014-01-05 08:24:06 +01:00
|
|
|
import mekanism.client.render.tileentity.RenderBin;
|
|
|
|
import mekanism.client.render.tileentity.RenderChargepad;
|
2014-01-26 23:12:03 +01:00
|
|
|
import mekanism.client.render.tileentity.RenderChemicalCrystalizer;
|
|
|
|
import mekanism.client.render.tileentity.RenderChemicalDissolutionChamber;
|
2014-01-05 08:24:06 +01:00
|
|
|
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;
|
2014-01-05 08:24:06 +01:00
|
|
|
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.RenderRotaryCondensentrator;
|
2014-01-17 03:55:29 +01:00
|
|
|
import mekanism.client.render.tileentity.RenderSalinationController;
|
2014-01-05 08:24:06 +01:00
|
|
|
import mekanism.client.render.tileentity.RenderTeleporter;
|
2013-08-27 00:57:08 +02:00
|
|
|
import mekanism.client.sound.Sound;
|
|
|
|
import mekanism.client.sound.SoundHandler;
|
2014-01-05 08:24:06 +01:00
|
|
|
import mekanism.common.CommonProxy;
|
2014-01-13 05:55:42 +01:00
|
|
|
import mekanism.common.EnergyDisplay.EnergyType;
|
2014-01-05 08:24:06 +01:00
|
|
|
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;
|
2014-01-08 02:55:50 +01:00
|
|
|
import mekanism.common.entity.EntityBalloon;
|
|
|
|
import mekanism.common.entity.EntityObsidianTNT;
|
|
|
|
import mekanism.common.entity.EntityRobit;
|
2013-08-27 00:49:32 +02:00
|
|
|
import mekanism.common.inventory.InventoryElectricChest;
|
|
|
|
import mekanism.common.item.ItemPortableTeleporter;
|
2014-01-08 02:55:50 +01:00
|
|
|
import mekanism.common.tile.TileEntityAdvancedElectricMachine;
|
|
|
|
import mekanism.common.tile.TileEntityAdvancedFactory;
|
|
|
|
import mekanism.common.tile.TileEntityBin;
|
|
|
|
import mekanism.common.tile.TileEntityChargepad;
|
2014-01-26 23:12:03 +01:00
|
|
|
import mekanism.common.tile.TileEntityChemicalCrystalizer;
|
|
|
|
import mekanism.common.tile.TileEntityChemicalDissolutionChamber;
|
2014-01-08 02:55:50 +01:00
|
|
|
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;
|
2014-01-08 02:55:50 +01:00
|
|
|
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-01-13 05:55:42 +01:00
|
|
|
import mekanism.common.tile.TileEntityPrecisionSawmill;
|
2014-01-08 02:55:50 +01:00
|
|
|
import mekanism.common.tile.TileEntityPurificationChamber;
|
|
|
|
import mekanism.common.tile.TileEntityRotaryCondensentrator;
|
2014-01-12 00:35:39 +01:00
|
|
|
import mekanism.common.tile.TileEntitySalinationController;
|
2014-01-14 06:17:15 +01:00
|
|
|
import mekanism.common.tile.TileEntitySalinationTank;
|
2014-01-12 00:35:39 +01:00
|
|
|
import mekanism.common.tile.TileEntitySalinationValve;
|
2014-01-08 02:55:50 +01:00
|
|
|
import mekanism.common.tile.TileEntityTeleporter;
|
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;
|
2014-01-05 08:24:06 +01:00
|
|
|
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;
|
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-12-24 19:25:31 +01:00
|
|
|
MekanismClient.holidays = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "Holidays", true).getBoolean(true);
|
2014-01-10 23:42:53 +01:00
|
|
|
MekanismClient.baseSoundVolume = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "SoundVolume", 1D).getDouble(1D);
|
2014-01-11 17:49:27 +01:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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-12-04 22:53:58 +01:00
|
|
|
public void registerSound(Object obj)
|
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-12-04 22:53:58 +01:00
|
|
|
MekanismClient.audioHandler.register(obj);
|
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-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
|
|
|
{
|
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();
|
2013-11-13 04:43:06 +01:00
|
|
|
|
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-13 04:43:06 +01:00
|
|
|
|
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));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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());
|
2013-11-18 21:33:14 +01:00
|
|
|
ClientRegistry.registerTileEntity(TileEntityCrusher.class, "Crusher", new RenderConfigurableMachine());
|
2013-05-23 19:30:12 +02:00
|
|
|
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());
|
2013-04-05 22:26:48 +02:00
|
|
|
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());
|
2013-11-03 02:07:55 +01:00
|
|
|
ClientRegistry.registerTileEntity(TileEntityEnergyCube.class, "EnergyCube", new RenderEnergyCube());
|
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-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-11-02 03:36:06 +01:00
|
|
|
ClientRegistry.registerTileEntity(TileEntityLogisticalSorter.class, "LogisticalSorter", new RenderLogisticalSorter());
|
2013-11-12 01:27:36 +01:00
|
|
|
ClientRegistry.registerTileEntity(TileEntityBin.class, "Bin", new RenderBin());
|
2013-11-21 02:28:06 +01:00
|
|
|
ClientRegistry.registerTileEntity(TileEntityDigitalMiner.class, "DigitalMiner", new RenderDigitalMiner());
|
2013-11-28 00:17:44 +01:00
|
|
|
ClientRegistry.registerTileEntity(TileEntityRotaryCondensentrator.class, "RotaryCondensentrator", new RenderRotaryCondensentrator());
|
2013-12-07 23:06:11 +01:00
|
|
|
ClientRegistry.registerTileEntity(TileEntityTeleporter.class, "MekanismTeleporter", new RenderTeleporter());
|
Rename Oxidation Chamber to Chemical Oxidizer and added model, will explain why below. This means a minor lang update @crafteverywhere, @VeryBigBro, @Vexatos
Notice that all Mekanism machines that perform similar tasks have a similar ending word; for example, the Metallurgic Infuser infuses alloys into ingots, and the Chemical Infuser infuses chemicals into other chemicals. Every ore processing machine has "Chamber" as the final word, and as this is not directly linked to ore processing, it would be best to move the "Oxidation" side of the machine to the end. Furthermore, for this chemical line, I am trying to keep "Chemical" as the first word in each machine title: Chemical Infuser, Chemical Oxidizer, Chemical Injection Chamber, etc. Hope that makes sense!
2013-12-31 21:07:09 +01:00
|
|
|
ClientRegistry.registerTileEntity(TileEntityChemicalOxidizer.class, "ChemicalOxidizer", new RenderChemicalOxidizer());
|
2014-01-01 04:54:39 +01:00
|
|
|
ClientRegistry.registerTileEntity(TileEntityChemicalInfuser.class, "ChemicalInfuser", new RenderChemicalInfuser());
|
2013-12-24 22:58:14 +01:00
|
|
|
ClientRegistry.registerTileEntity(TileEntityChemicalInjectionChamber.class, "ChemicalInjectionChamber", new RenderConfigurableMachine());
|
2014-01-03 03:09:21 +01:00
|
|
|
ClientRegistry.registerTileEntity(TileEntityElectrolyticSeparator.class, "ElectrolyticSeparator", new RenderElectrolyticSeparator());
|
2014-01-17 03:55:29 +01:00
|
|
|
ClientRegistry.registerTileEntity(TileEntitySalinationController.class, "SalinationController", new RenderSalinationController());
|
2014-01-12 00:35:39 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntitySalinationValve.class, "SalinationValve");
|
2014-01-14 06:17:15 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntitySalinationTank.class, "SalinationTank");
|
2014-01-13 05:55:42 +01:00
|
|
|
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(TileEntityChemicalCrystalizer.class, "ChemicalCrystalizer", new RenderChemicalCrystalizer());
|
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()
|
|
|
|
{
|
2013-12-24 23:14:28 +01:00
|
|
|
RenderPartTransmitter.init();
|
|
|
|
|
2012-08-15 22:41:41 +02:00
|
|
|
//Register entity rendering handlers
|
2013-11-03 17:38:36 +01:00
|
|
|
RenderingRegistry.registerEntityRenderingHandler(EntityObsidianTNT.class, new RenderObsidianTNTPrimed());
|
2013-05-20 00:43:01 +02:00
|
|
|
RenderingRegistry.registerEntityRenderingHandler(EntityRobit.class, new RenderRobit());
|
2013-12-24 22:06:57 +01:00
|
|
|
RenderingRegistry.registerEntityRenderingHandler(EntityBalloon.class, new RenderBalloon());
|
2012-11-21 16:14:35 +01:00
|
|
|
|
2012-11-28 16:33:34 +01:00
|
|
|
//Register item handler
|
2013-11-13 04:43:06 +01:00
|
|
|
ItemRenderingHandler handler = new ItemRenderingHandler();
|
|
|
|
|
2013-12-24 22:06:57 +01:00
|
|
|
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.PartTransmitter.itemID, handler);
|
|
|
|
MinecraftForgeClient.registerItemRenderer(Mekanism.GasMask.itemID, handler);
|
|
|
|
MinecraftForgeClient.registerItemRenderer(Mekanism.ScubaTank.itemID, handler);
|
|
|
|
MinecraftForgeClient.registerItemRenderer(Mekanism.Balloon.itemID, handler);
|
2014-02-01 22:33:27 +01:00
|
|
|
MinecraftForgeClient.registerItemRenderer(Mekanism.FrictionBoots.itemID, handler);
|
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-04-28 21:23:08 +02:00
|
|
|
RenderingRegistry.registerBlockHandler(new BasicRenderingHandler());
|
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)
|
|
|
|
{
|
2013-12-10 02:52:49 +01:00
|
|
|
case 0:
|
|
|
|
return new GuiDictionary(player.inventory);
|
2012-09-25 21:15:47 +02:00
|
|
|
case 1:
|
2012-08-15 22:41:41 +02:00
|
|
|
return new GuiCredits();
|
2013-11-18 21:33:14 +01:00
|
|
|
case 2:
|
2014-01-01 22:21:55 +01:00
|
|
|
return new GuiDigitalMiner(player.inventory, (TileEntityDigitalMiner)tileEntity);
|
2012-09-25 21:15:47 +02:00
|
|
|
case 3:
|
2014-01-01 22:21:55 +01:00
|
|
|
return new GuiEnrichmentChamber(player.inventory, (TileEntityElectricMachine)tileEntity);
|
2012-09-25 21:15:47 +02:00
|
|
|
case 4:
|
2014-01-01 22:21:55 +01:00
|
|
|
return new GuiOsmiumCompressor(player.inventory, (TileEntityAdvancedElectricMachine)tileEntity);
|
2012-09-25 21:15:47 +02:00
|
|
|
case 5:
|
2014-01-01 22:21:55 +01:00
|
|
|
return new GuiCombiner(player.inventory, (TileEntityAdvancedElectricMachine)tileEntity);
|
2012-09-25 21:15:47 +02:00
|
|
|
case 6:
|
2014-01-01 22:21:55 +01:00
|
|
|
return new GuiCrusher(player.inventory, (TileEntityElectricMachine)tileEntity);
|
2013-11-28 00:17:44 +01:00
|
|
|
case 7:
|
2014-01-01 22:21:55 +01:00
|
|
|
return new GuiRotaryCondensentrator(player.inventory, (TileEntityRotaryCondensentrator)tileEntity);
|
2012-10-02 20:39:40 +02:00
|
|
|
case 8:
|
2014-01-01 22:21:55 +01:00
|
|
|
return new GuiEnergyCube(player.inventory, (TileEntityEnergyCube)tileEntity);
|
2012-10-28 23:18:23 +01:00
|
|
|
case 9:
|
2014-01-01 22:21:55 +01:00
|
|
|
return new GuiConfiguration(player, (IInvConfiguration)tileEntity);
|
2012-11-25 16:45:00 +01:00
|
|
|
case 10:
|
2014-01-01 22:21:55 +01:00
|
|
|
return new GuiGasTank(player.inventory, (TileEntityGasTank)tileEntity);
|
2012-12-19 21:23:55 +01:00
|
|
|
case 11:
|
2014-01-01 22:21:55 +01:00
|
|
|
return new GuiFactory(player.inventory, (TileEntityFactory)tileEntity);
|
2012-12-20 22:53:39 +01:00
|
|
|
case 12:
|
2014-01-01 22:21:55 +01:00
|
|
|
return new GuiMetallurgicInfuser(player.inventory, (TileEntityMetallurgicInfuser)tileEntity);
|
2013-01-21 02:15:59 +01:00
|
|
|
case 13:
|
2014-01-01 22:21:55 +01:00
|
|
|
return new GuiTeleporter(player.inventory, (TileEntityTeleporter)tileEntity);
|
2013-01-21 02:15:59 +01:00
|
|
|
case 14:
|
|
|
|
ItemStack itemStack = player.getCurrentEquippedItem();
|
2013-12-24 22:06:57 +01:00
|
|
|
|
2014-01-01 22:21:55 +01:00
|
|
|
if(itemStack != null && itemStack.getItem() instanceof ItemPortableTeleporter)
|
2013-01-21 02:15:59 +01:00
|
|
|
{
|
|
|
|
return new GuiPortableTeleporter(player, itemStack);
|
|
|
|
}
|
2013-01-23 21:42:45 +01:00
|
|
|
case 15:
|
2014-01-01 22:21:55 +01:00
|
|
|
return new GuiPurificationChamber(player.inventory, (TileEntityAdvancedElectricMachine)tileEntity);
|
2013-03-20 21:28:45 +01:00
|
|
|
case 16:
|
2014-01-01 22:21:55 +01:00
|
|
|
return new GuiEnergizedSmelter(player.inventory, (TileEntityElectricMachine)tileEntity);
|
2013-04-03 21:37:26 +02:00
|
|
|
case 17:
|
2014-01-01 22:21:55 +01:00
|
|
|
return new GuiElectricPump(player.inventory, (TileEntityElectricPump)tileEntity);
|
2013-04-28 21:23:08 +02:00
|
|
|
case 18:
|
2014-01-01 22:21:55 +01:00
|
|
|
return new GuiDynamicTank(player.inventory, (TileEntityDynamicTank)tileEntity);
|
2013-04-13 02:25:21 +02:00
|
|
|
case 19:
|
2014-01-01 22:21:55 +01:00
|
|
|
return new GuiPasswordEnter((TileEntityElectricChest)tileEntity);
|
2013-04-13 02:25:21 +02:00
|
|
|
case 20:
|
2014-01-01 22:21:55 +01:00
|
|
|
return new GuiPasswordModify((TileEntityElectricChest)tileEntity);
|
2013-05-20 00:43:01 +02:00
|
|
|
case 21:
|
2014-01-01 22:21:55 +01:00
|
|
|
EntityRobit robit = (EntityRobit)world.getEntityByID(x);
|
2013-12-24 22:06:57 +01:00
|
|
|
|
2013-05-20 00:43:01 +02:00
|
|
|
if(robit != null)
|
|
|
|
{
|
|
|
|
return new GuiRobitMain(player.inventory, robit);
|
|
|
|
}
|
|
|
|
case 22:
|
|
|
|
return new GuiRobitCrafting(player.inventory, world, x);
|
|
|
|
case 23:
|
2014-01-01 22:21:55 +01:00
|
|
|
EntityRobit robit1 = (EntityRobit)world.getEntityByID(x);
|
2013-12-24 22:06:57 +01:00
|
|
|
|
2013-05-20 00:43:01 +02:00
|
|
|
if(robit1 != null)
|
|
|
|
{
|
|
|
|
return new GuiRobitInventory(player.inventory, robit1);
|
|
|
|
}
|
2013-05-20 19:51:18 +02:00
|
|
|
case 24:
|
2014-01-01 22:21:55 +01:00
|
|
|
EntityRobit robit2 = (EntityRobit)world.getEntityByID(x);
|
2013-12-24 22:06:57 +01:00
|
|
|
|
2013-05-20 19:51:18 +02:00
|
|
|
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);
|
2013-12-12 02:24:37 +01:00
|
|
|
case 29:
|
2014-01-01 22:21:55 +01:00
|
|
|
return new GuiChemicalOxidizer(player.inventory, (TileEntityChemicalOxidizer)tileEntity);
|
2013-12-24 22:06:57 +01:00
|
|
|
case 30:
|
2014-01-01 22:21:55 +01:00
|
|
|
return new GuiChemicalInfuser(player.inventory, (TileEntityChemicalInfuser)tileEntity);
|
2013-12-24 22:06:57 +01:00
|
|
|
case 31:
|
2014-01-01 22:21:55 +01:00
|
|
|
return new GuiChemicalInjectionChamber(player.inventory, (TileEntityAdvancedElectricMachine)tileEntity);
|
2014-01-03 03:09:21 +01:00
|
|
|
case 32:
|
|
|
|
return new GuiElectrolyticSeparator(player.inventory, (TileEntityElectrolyticSeparator)tileEntity);
|
2014-01-12 00:35:39 +01:00
|
|
|
case 33:
|
|
|
|
return new GuiSalinationController(player.inventory, (TileEntitySalinationController)tileEntity);
|
2014-01-13 06:06:13 +01:00
|
|
|
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 GuiChemicalCrystalizer(player.inventory, (TileEntityChemicalCrystalizer)tileEntity);
|
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-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());
|
2013-12-07 23:06:11 +01:00
|
|
|
|
|
|
|
GameRegistry.registerPlayerTracker(new ClientPlayerTracker());
|
2013-12-24 17:20:22 +01:00
|
|
|
|
|
|
|
HolidayManager.init();
|
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
|
|
|
{
|
2013-12-04 22:53:58 +01:00
|
|
|
HashMap<Object, Sound> sounds = new HashMap<Object, 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();
|
|
|
|
}
|
2013-12-04 22:53:58 +01:00
|
|
|
|
|
|
|
MekanismClient.audioHandler.sounds.clear();
|
2013-04-28 21:23:08 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-24 19:12:42 +01:00
|
|
|
@Override
|
|
|
|
public void preInit()
|
|
|
|
{
|
|
|
|
MekanismRenderer.init();
|
|
|
|
}
|
|
|
|
|
2013-11-18 21:33:14 +01:00
|
|
|
@Override
|
|
|
|
public double getReach(EntityPlayer player)
|
|
|
|
{
|
|
|
|
return Minecraft.getMinecraft().playerController.getBlockReachDistance();
|
|
|
|
}
|
|
|
|
|
2013-04-28 21:23:08 +02:00
|
|
|
@Override
|
|
|
|
public boolean isPaused()
|
|
|
|
{
|
|
|
|
if(FMLClientHandler.instance().getClient().isSingleplayer() && !FMLClientHandler.instance().getClient().getIntegratedServer().getPublic())
|
|
|
|
{
|
|
|
|
GuiScreen screen = FMLClientHandler.instance().getClient().currentScreen;
|
|
|
|
|
2013-11-29 03:43:53 +01:00
|
|
|
if(screen != null && screen.doesGuiPauseGame())
|
2013-04-28 21:23:08 +02:00
|
|
|
{
|
2013-11-29 03:43:53 +01:00
|
|
|
return true;
|
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;
|
|
|
|
}
|
2013-12-24 23:17:00 +01:00
|
|
|
|
2014-01-10 00:47:38 +01:00
|
|
|
@Override
|
|
|
|
public void onConfigSync()
|
|
|
|
{
|
|
|
|
super.onConfigSync();
|
|
|
|
|
|
|
|
if(Mekanism.voiceServerEnabled)
|
|
|
|
{
|
|
|
|
MekanismClient.voiceClient.start();
|
|
|
|
}
|
|
|
|
}
|
2012-08-15 22:41:41 +02:00
|
|
|
}
|