2012-11-05 20:29:04 +01:00
|
|
|
package mekanism.common;
|
2012-08-15 22:41:41 +02:00
|
|
|
|
2014-01-05 08:24:06 +01:00
|
|
|
import java.io.File;
|
2015-05-23 17:36:53 +02:00
|
|
|
import java.lang.ref.WeakReference;
|
2014-01-05 08:24:06 +01:00
|
|
|
|
2015-02-28 05:49:48 +01:00
|
|
|
import mekanism.api.Coord4D;
|
2014-01-13 22:37:15 +01:00
|
|
|
import mekanism.api.MekanismAPI;
|
2014-08-01 01:58:12 +02:00
|
|
|
import mekanism.api.MekanismConfig.general;
|
2015-03-05 19:48:01 +01:00
|
|
|
import mekanism.api.MekanismConfig.machines;
|
2014-08-01 01:58:12 +02:00
|
|
|
import mekanism.api.MekanismConfig.usage;
|
2014-09-14 06:20:16 +02:00
|
|
|
import mekanism.api.Pos3D;
|
2015-02-27 18:33:01 +01:00
|
|
|
import mekanism.api.util.UnitDisplayUtils.EnergyType;
|
|
|
|
import mekanism.api.util.UnitDisplayUtils.TempType;
|
2015-04-07 16:41:17 +02:00
|
|
|
import mekanism.client.SparkleAnimation.INodeChecker;
|
2016-01-25 06:13:42 +01:00
|
|
|
import mekanism.common.base.IGuiProvider;
|
2014-08-10 04:20:49 +02:00
|
|
|
import mekanism.common.base.IUpgradeTile;
|
2014-09-03 19:25:06 +02:00
|
|
|
import mekanism.common.block.BlockMachine.MachineType;
|
2014-01-08 02:55:50 +01:00
|
|
|
import mekanism.common.entity.EntityRobit;
|
2014-01-05 08:24:06 +01:00
|
|
|
import mekanism.common.inventory.container.ContainerAdvancedElectricMachine;
|
2014-01-13 06:06:13 +01:00
|
|
|
import mekanism.common.inventory.container.ContainerChanceMachine;
|
2014-04-12 03:51:02 +02:00
|
|
|
import mekanism.common.inventory.container.ContainerChemicalCrystallizer;
|
2014-01-31 20:59:12 +01:00
|
|
|
import mekanism.common.inventory.container.ContainerChemicalDissolutionChamber;
|
2014-01-05 08:24:06 +01:00
|
|
|
import mekanism.common.inventory.container.ContainerChemicalInfuser;
|
|
|
|
import mekanism.common.inventory.container.ContainerChemicalOxidizer;
|
2014-01-31 20:59:12 +01:00
|
|
|
import mekanism.common.inventory.container.ContainerChemicalWasher;
|
2014-01-05 08:24:06 +01:00
|
|
|
import mekanism.common.inventory.container.ContainerDictionary;
|
|
|
|
import mekanism.common.inventory.container.ContainerDigitalMiner;
|
|
|
|
import mekanism.common.inventory.container.ContainerDynamicTank;
|
|
|
|
import mekanism.common.inventory.container.ContainerElectricMachine;
|
|
|
|
import mekanism.common.inventory.container.ContainerElectricPump;
|
|
|
|
import mekanism.common.inventory.container.ContainerElectrolyticSeparator;
|
|
|
|
import mekanism.common.inventory.container.ContainerEnergyCube;
|
|
|
|
import mekanism.common.inventory.container.ContainerFactory;
|
|
|
|
import mekanism.common.inventory.container.ContainerFilter;
|
2016-02-27 01:51:37 +01:00
|
|
|
import mekanism.common.inventory.container.ContainerFluidTank;
|
2014-06-19 12:42:59 +02:00
|
|
|
import mekanism.common.inventory.container.ContainerFluidicPlenisher;
|
2014-01-05 08:24:06 +01:00
|
|
|
import mekanism.common.inventory.container.ContainerGasTank;
|
2015-03-03 19:16:58 +01:00
|
|
|
import mekanism.common.inventory.container.ContainerInductionMatrix;
|
2014-09-15 03:11:55 +02:00
|
|
|
import mekanism.common.inventory.container.ContainerLaserAmplifier;
|
|
|
|
import mekanism.common.inventory.container.ContainerLaserTractorBeam;
|
2014-01-05 08:24:06 +01:00
|
|
|
import mekanism.common.inventory.container.ContainerMetallurgicInfuser;
|
|
|
|
import mekanism.common.inventory.container.ContainerNull;
|
2015-03-13 15:14:57 +01:00
|
|
|
import mekanism.common.inventory.container.ContainerOredictionificator;
|
2014-04-06 02:16:09 +02:00
|
|
|
import mekanism.common.inventory.container.ContainerPRC;
|
2016-02-27 01:51:37 +01:00
|
|
|
import mekanism.common.inventory.container.ContainerResistiveHeater;
|
2014-01-05 08:24:06 +01:00
|
|
|
import mekanism.common.inventory.container.ContainerRobitCrafting;
|
|
|
|
import mekanism.common.inventory.container.ContainerRobitInventory;
|
|
|
|
import mekanism.common.inventory.container.ContainerRobitMain;
|
|
|
|
import mekanism.common.inventory.container.ContainerRobitRepair;
|
|
|
|
import mekanism.common.inventory.container.ContainerRobitSmelting;
|
|
|
|
import mekanism.common.inventory.container.ContainerRotaryCondensentrator;
|
2014-03-16 01:05:26 +01:00
|
|
|
import mekanism.common.inventory.container.ContainerSeismicVibrator;
|
2015-02-26 23:23:53 +01:00
|
|
|
import mekanism.common.inventory.container.ContainerSolarNeutronActivator;
|
2014-01-05 08:24:06 +01:00
|
|
|
import mekanism.common.inventory.container.ContainerTeleporter;
|
2016-02-24 23:01:43 +01:00
|
|
|
import mekanism.common.inventory.container.ContainerThermalEvaporationController;
|
2014-07-22 00:07:15 +02:00
|
|
|
import mekanism.common.inventory.container.ContainerUpgradeManagement;
|
2015-03-29 01:34:57 +01:00
|
|
|
import mekanism.common.item.ItemPortableTeleporter;
|
2015-03-12 22:52:04 +01:00
|
|
|
import mekanism.common.network.PacketPortableTeleporter.PortableTeleporterMessage;
|
2014-01-08 02:55:50 +01:00
|
|
|
import mekanism.common.tile.TileEntityAdvancedElectricMachine;
|
|
|
|
import mekanism.common.tile.TileEntityAdvancedFactory;
|
2014-09-03 02:51:00 +02:00
|
|
|
import mekanism.common.tile.TileEntityAmbientAccumulator;
|
2014-01-08 02:55:50 +01:00
|
|
|
import mekanism.common.tile.TileEntityBin;
|
2016-02-28 17:52:52 +01:00
|
|
|
import mekanism.common.tile.TileEntityBoilerCasing;
|
|
|
|
import mekanism.common.tile.TileEntityBoilerValve;
|
2014-01-13 06:06:13 +01:00
|
|
|
import mekanism.common.tile.TileEntityChanceMachine;
|
2014-01-08 02:55:50 +01:00
|
|
|
import mekanism.common.tile.TileEntityChargepad;
|
2014-04-12 03:51:02 +02:00
|
|
|
import mekanism.common.tile.TileEntityChemicalCrystallizer;
|
2014-01-26 23:12:03 +01:00
|
|
|
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.TileEntityContainerBlock;
|
|
|
|
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;
|
2016-02-24 23:01:43 +01:00
|
|
|
import mekanism.common.tile.TileEntityFluidTank;
|
2014-06-19 12:42:59 +02:00
|
|
|
import mekanism.common.tile.TileEntityFluidicPlenisher;
|
2014-01-08 02:55:50 +01:00
|
|
|
import mekanism.common.tile.TileEntityGasTank;
|
2015-03-03 05:05:54 +01:00
|
|
|
import mekanism.common.tile.TileEntityInductionCasing;
|
2015-02-28 20:08:17 +01:00
|
|
|
import mekanism.common.tile.TileEntityInductionCell;
|
2015-03-03 05:05:54 +01:00
|
|
|
import mekanism.common.tile.TileEntityInductionPort;
|
2015-02-28 20:08:17 +01:00
|
|
|
import mekanism.common.tile.TileEntityInductionProvider;
|
2014-07-15 01:13:20 +02:00
|
|
|
import mekanism.common.tile.TileEntityLaser;
|
2014-07-26 22:45:48 +02:00
|
|
|
import mekanism.common.tile.TileEntityLaserAmplifier;
|
2014-09-15 03:11:55 +02:00
|
|
|
import mekanism.common.tile.TileEntityLaserTractorBeam;
|
2014-01-08 02:55:50 +01:00
|
|
|
import mekanism.common.tile.TileEntityLogisticalSorter;
|
|
|
|
import mekanism.common.tile.TileEntityMetallurgicInfuser;
|
2014-08-22 22:17:16 +02:00
|
|
|
import mekanism.common.tile.TileEntityMultiblock;
|
2014-01-08 02:55:50 +01:00
|
|
|
import mekanism.common.tile.TileEntityObsidianTNT;
|
2015-03-13 15:14:57 +01:00
|
|
|
import mekanism.common.tile.TileEntityOredictionificator;
|
2014-01-08 02:55:50 +01:00
|
|
|
import mekanism.common.tile.TileEntityOsmiumCompressor;
|
2014-04-06 02:16:09 +02:00
|
|
|
import mekanism.common.tile.TileEntityPRC;
|
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;
|
2016-02-27 01:51:37 +01:00
|
|
|
import mekanism.common.tile.TileEntityResistiveHeater;
|
2014-01-08 02:55:50 +01:00
|
|
|
import mekanism.common.tile.TileEntityRotaryCondensentrator;
|
2014-03-16 01:05:26 +01:00
|
|
|
import mekanism.common.tile.TileEntitySeismicVibrator;
|
2015-02-25 17:11:30 +01:00
|
|
|
import mekanism.common.tile.TileEntitySolarNeutronActivator;
|
2016-01-22 21:41:34 +01:00
|
|
|
import mekanism.common.tile.TileEntityStructuralGlass;
|
2014-01-08 02:55:50 +01:00
|
|
|
import mekanism.common.tile.TileEntityTeleporter;
|
2016-02-24 23:01:43 +01:00
|
|
|
import mekanism.common.tile.TileEntityThermalEvaporationController;
|
2016-01-29 06:34:50 +01:00
|
|
|
import net.minecraft.block.Block;
|
2012-12-20 22:53:39 +01:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2013-11-18 21:33:14 +01:00
|
|
|
import net.minecraft.entity.player.EntityPlayerMP;
|
2014-05-29 18:55:47 +02:00
|
|
|
import net.minecraft.init.Blocks;
|
2012-12-20 22:53:39 +01:00
|
|
|
import net.minecraft.inventory.Container;
|
2015-03-29 01:34:57 +01:00
|
|
|
import net.minecraft.item.ItemStack;
|
2015-03-05 19:48:01 +01:00
|
|
|
import net.minecraft.item.crafting.CraftingManager;
|
2012-12-20 22:53:39 +01:00
|
|
|
import net.minecraft.tileentity.TileEntity;
|
2015-02-28 05:49:48 +01:00
|
|
|
import net.minecraft.util.MovingObjectPosition;
|
2012-12-20 22:53:39 +01:00
|
|
|
import net.minecraft.world.World;
|
2015-05-23 17:36:53 +02:00
|
|
|
import net.minecraft.world.WorldServer;
|
2014-04-20 05:34:19 +02:00
|
|
|
import net.minecraftforge.common.config.Configuration;
|
2015-05-23 17:36:53 +02:00
|
|
|
import net.minecraftforge.common.util.FakePlayerFactory;
|
2014-07-22 19:03:34 +02:00
|
|
|
import net.minecraftforge.common.util.ForgeDirection;
|
2015-03-18 22:39:01 +01:00
|
|
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
2014-06-03 20:57:59 +02:00
|
|
|
import cpw.mods.fml.common.FMLCommonHandler;
|
2014-06-27 04:25:47 +02:00
|
|
|
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
2014-01-05 08:24:06 +01:00
|
|
|
import cpw.mods.fml.common.registry.GameRegistry;
|
2014-01-12 17:46:25 +01:00
|
|
|
import cpw.mods.fml.relauncher.FMLInjectionData;
|
2012-08-15 22:41:41 +02:00
|
|
|
|
|
|
|
/**
|
2012-11-05 20:29:04 +01:00
|
|
|
* Common proxy for the Mekanism mod.
|
2012-08-15 22:41:41 +02:00
|
|
|
* @author AidanBrady
|
|
|
|
*
|
|
|
|
*/
|
2016-01-25 06:13:42 +01:00
|
|
|
public class CommonProxy implements IGuiProvider
|
2012-08-15 22:41:41 +02:00
|
|
|
{
|
2015-03-18 22:39:01 +01:00
|
|
|
public static int MACHINE_RENDER_ID = RenderingRegistry.getNextAvailableRenderId();
|
|
|
|
public static int BASIC_RENDER_ID = RenderingRegistry.getNextAvailableRenderId();
|
|
|
|
public static int PLASTIC_RENDER_ID = RenderingRegistry.getNextAvailableRenderId();
|
|
|
|
public static int CTM_RENDER_ID = RenderingRegistry.getNextAvailableRenderId();
|
|
|
|
|
2015-05-23 17:36:53 +02:00
|
|
|
protected static WeakReference<EntityPlayer> dummyPlayer = new WeakReference<EntityPlayer>(null);
|
2015-03-18 22:39:01 +01:00
|
|
|
|
2012-11-21 16:14:35 +01:00
|
|
|
/**
|
|
|
|
* Register tile entities that have special models. Overwritten in client to register TESRs.
|
|
|
|
*/
|
2014-03-08 02:00:25 +01:00
|
|
|
public void registerSpecialTileEntities()
|
2013-01-21 02:15:59 +01:00
|
|
|
{
|
2013-05-23 19:30:12 +02:00
|
|
|
GameRegistry.registerTileEntity(TileEntityEnrichmentChamber.class, "EnrichmentChamber");
|
|
|
|
GameRegistry.registerTileEntity(TileEntityOsmiumCompressor.class, "OsmiumCompressor");
|
|
|
|
GameRegistry.registerTileEntity(TileEntityCombiner.class, "Combiner");
|
|
|
|
GameRegistry.registerTileEntity(TileEntityCrusher.class, "Crusher");
|
|
|
|
GameRegistry.registerTileEntity(TileEntityFactory.class, "SmeltingFactory");
|
|
|
|
GameRegistry.registerTileEntity(TileEntityAdvancedFactory.class, "AdvancedSmeltingFactory");
|
|
|
|
GameRegistry.registerTileEntity(TileEntityEliteFactory.class, "UltimateSmeltingFactory");
|
|
|
|
GameRegistry.registerTileEntity(TileEntityPurificationChamber.class, "PurificationChamber");
|
|
|
|
GameRegistry.registerTileEntity(TileEntityEnergizedSmelter.class, "EnergizedSmelter");
|
2013-04-05 22:26:48 +02:00
|
|
|
GameRegistry.registerTileEntity(TileEntityMetallurgicInfuser.class, "MetallurgicInfuser");
|
2013-11-03 17:38:36 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntityGasTank.class, "GasTank");
|
2013-11-03 02:07:55 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntityEnergyCube.class, "EnergyCube");
|
2013-04-05 22:26:48 +02:00
|
|
|
GameRegistry.registerTileEntity(TileEntityElectricPump.class, "ElectricPump");
|
2013-04-13 02:25:21 +02:00
|
|
|
GameRegistry.registerTileEntity(TileEntityElectricChest.class, "ElectricChest");
|
2013-04-28 21:23:08 +02:00
|
|
|
GameRegistry.registerTileEntity(TileEntityDynamicTank.class, "DynamicTank");
|
|
|
|
GameRegistry.registerTileEntity(TileEntityDynamicValve.class, "DynamicValve");
|
2013-05-20 00:43:01 +02:00
|
|
|
GameRegistry.registerTileEntity(TileEntityChargepad.class, "Chargepad");
|
2013-11-02 03:36:06 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntityLogisticalSorter.class, "LogisticalSorter");
|
2013-11-12 01:27:36 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntityBin.class, "Bin");
|
2013-11-18 21:33:14 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntityDigitalMiner.class, "DigitalMiner");
|
2013-11-24 15:27:52 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntityObsidianTNT.class, "ObsidianTNT");
|
2013-11-28 00:17:44 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntityRotaryCondensentrator.class, "RotaryCondensentrator");
|
2013-12-08 18:39:26 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntityTeleporter.class, "MekanismTeleporter");
|
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
|
|
|
GameRegistry.registerTileEntity(TileEntityChemicalOxidizer.class, "ChemicalOxidizer");
|
2013-12-12 02:46:39 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntityChemicalInfuser.class, "ChemicalInfuser");
|
2013-12-24 06:23:30 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntityChemicalInjectionChamber.class, "ChemicalInjectionChamber");
|
2014-01-03 03:09:21 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntityElectrolyticSeparator.class, "ElectrolyticSeparator");
|
2016-02-19 00:37:38 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntityThermalEvaporationController.class, "SalinationController"); //TODO rename
|
2014-01-13 05:55:42 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntityPrecisionSawmill.class, "PrecisionSawmill");
|
2014-01-26 23:12:03 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntityChemicalDissolutionChamber.class, "ChemicalDissolutionChamber");
|
|
|
|
GameRegistry.registerTileEntity(TileEntityChemicalWasher.class, "ChemicalWasher");
|
2014-04-12 03:51:02 +02:00
|
|
|
GameRegistry.registerTileEntity(TileEntityChemicalCrystallizer.class, "ChemicalCrystallizer");
|
2014-06-16 01:50:40 +02:00
|
|
|
GameRegistry.registerTileEntity(TileEntitySeismicVibrator.class, "SeismicVibrator");
|
2014-04-10 04:05:28 +02:00
|
|
|
GameRegistry.registerTileEntity(TileEntityPRC.class, "PressurizedReactionChamber");
|
2016-02-24 23:01:43 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntityFluidTank.class, "PortableTank"); //TODO rename
|
2014-06-19 12:42:59 +02:00
|
|
|
GameRegistry.registerTileEntity(TileEntityFluidicPlenisher.class, "FluidicPlenisher");
|
2014-07-15 01:13:20 +02:00
|
|
|
GameRegistry.registerTileEntity(TileEntityLaser.class, "Laser");
|
2014-07-26 22:45:48 +02:00
|
|
|
GameRegistry.registerTileEntity(TileEntityLaserAmplifier.class, "LaserAmplifier");
|
2014-09-15 03:11:55 +02:00
|
|
|
GameRegistry.registerTileEntity(TileEntityLaserTractorBeam.class, "LaserTractorBeam");
|
2015-02-25 17:11:30 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntitySolarNeutronActivator.class, "SolarNeutronActivator");
|
2014-09-15 03:11:55 +02:00
|
|
|
GameRegistry.registerTileEntity(TileEntityAmbientAccumulator.class, "AmbientAccumulator");
|
2015-03-03 05:05:54 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntityInductionCasing.class, "InductionCasing");
|
|
|
|
GameRegistry.registerTileEntity(TileEntityInductionPort.class, "InductionPort");
|
2015-02-28 20:08:17 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntityInductionCell.class, "InductionCell");
|
|
|
|
GameRegistry.registerTileEntity(TileEntityInductionProvider.class, "InductionProvider");
|
2015-03-13 15:14:57 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntityOredictionificator.class, "Oredictionificator");
|
2016-01-22 21:41:34 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntityStructuralGlass.class, "StructuralGlass");
|
2016-02-27 01:51:37 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntityResistiveHeater.class, "ResistiveHeater");
|
2016-02-28 17:52:52 +01:00
|
|
|
GameRegistry.registerTileEntity(TileEntityBoilerCasing.class, "BoilerCasing");
|
|
|
|
GameRegistry.registerTileEntity(TileEntityBoilerValve.class, "BoilerValve");
|
2013-01-21 02:15:59 +01:00
|
|
|
}
|
2015-03-12 22:52:04 +01:00
|
|
|
|
|
|
|
public void handleTeleporterUpdate(PortableTeleporterMessage message) {}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2013-04-13 03:32:43 +02:00
|
|
|
/**
|
|
|
|
* Handles an ELECTRIC_CHEST_CLIENT_OPEN packet via the proxy, not handled on the server-side.
|
|
|
|
* @param entityplayer - player the packet was sent from
|
|
|
|
* @param id - the electric chest gui ID to open
|
|
|
|
* @param windowId - the container-specific window ID
|
|
|
|
* @param isBlock - if the chest is a block
|
|
|
|
* @param x - x coordinate
|
|
|
|
* @param y - y coordinate
|
|
|
|
* @param z - z coordinate
|
|
|
|
*/
|
|
|
|
public void openElectricChest(EntityPlayer entityplayer, int id, int windowId, boolean isBlock, int x, int y, int z) {}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2012-08-15 22:41:41 +02:00
|
|
|
/**
|
|
|
|
* Register and load client-only render information.
|
|
|
|
*/
|
2012-09-08 18:48:24 +02:00
|
|
|
public void registerRenderInformation() {}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2012-09-03 18:11:25 +02:00
|
|
|
/**
|
|
|
|
* Gets the armor index number from ClientProxy.
|
2012-12-30 22:34:45 +01:00
|
|
|
* @param string - armor indicator
|
2012-09-03 18:11:25 +02:00
|
|
|
* @return armor index number
|
|
|
|
*/
|
2014-03-08 02:00:25 +01:00
|
|
|
public int getArmorIndex(String string)
|
2012-08-31 01:27:35 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2012-08-15 22:41:41 +02:00
|
|
|
/**
|
2012-09-08 18:48:24 +02:00
|
|
|
* Set and load the mod's common configuration properties.
|
2012-08-15 22:41:41 +02:00
|
|
|
*/
|
2012-09-08 18:48:24 +02:00
|
|
|
public void loadConfiguration()
|
2012-08-21 02:34:12 +02:00
|
|
|
{
|
2015-04-01 17:06:27 +02:00
|
|
|
general.updateNotifications = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "UpdateNotifications", true).getBoolean();
|
|
|
|
general.controlCircuitOreDict = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ControlCircuitOreDict", true).getBoolean();
|
|
|
|
general.logPackets = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "LogPackets", false).getBoolean();
|
|
|
|
general.dynamicTankEasterEgg = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "DynamicTankEasterEgg", false).getBoolean();
|
|
|
|
general.voiceServerEnabled = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "VoiceServerEnabled", true).getBoolean();
|
|
|
|
general.cardboardSpawners = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "AllowSpawnerBoxPickup", true).getBoolean();
|
|
|
|
general.enableWorldRegeneration = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnableWorldRegeneration", false).getBoolean();
|
|
|
|
general.creativeOverrideElectricChest = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "CreativeOverrideElectricChest", true).getBoolean();
|
|
|
|
general.spawnBabySkeletons = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "SpawnBabySkeletons", true).getBoolean();
|
2014-08-01 01:58:12 +02:00
|
|
|
general.obsidianTNTDelay = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ObsidianTNTDelay", 100).getInt();
|
|
|
|
general.obsidianTNTBlastRadius = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ObsidianTNTBlastRadius", 12).getInt();
|
|
|
|
general.UPDATE_DELAY = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ClientUpdateDelay", 10).getInt();
|
|
|
|
general.osmiumPerChunk = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "OsmiumPerChunk", 12).getInt();
|
|
|
|
general.copperPerChunk = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "CopperPerChunk", 16).getInt();
|
|
|
|
general.tinPerChunk = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "TinPerChunk", 14).getInt();
|
|
|
|
general.saltPerChunk = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "SaltPerChunk", 2).getInt();
|
|
|
|
general.userWorldGenVersion = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "WorldRegenVersion", 0).getInt();
|
2015-04-01 17:06:27 +02:00
|
|
|
general.FROM_IC2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "JoulesToEU", 10D).getDouble();
|
|
|
|
general.TO_IC2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EUToJoules", .1D).getDouble();
|
|
|
|
general.FROM_TE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "JoulesToRF", 2.5D).getDouble();
|
|
|
|
general.TO_TE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "RFToJoules", 0.4D).getDouble();
|
|
|
|
general.FROM_H2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "HydrogenEnergyDensity", 200D, "Determines Electrolytic Separator usage").getDouble();
|
|
|
|
general.ETHENE_BURN_TIME = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EthyleneBurnTime", 40).getInt();
|
|
|
|
general.ENERGY_PER_REDSTONE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnergyPerRedstone", 10000D).getDouble();
|
|
|
|
general.DISASSEMBLER_USAGE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "DisassemblerEnergyUsage", 10).getInt();
|
2014-08-01 01:58:12 +02:00
|
|
|
general.VOICE_PORT = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "VoicePort", 36123, null, 1, 65535).getInt();
|
2013-12-27 02:12:46 +01:00
|
|
|
//If this is less than 1, upgrades make machines worse. If less than 0, I don't even know.
|
2014-08-01 01:58:12 +02:00
|
|
|
general.maxUpgradeMultiplier = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "UpgradeModifier", 10, null, 1, Integer.MAX_VALUE).getInt();
|
2014-09-27 21:07:55 +02:00
|
|
|
general.minerSilkMultiplier = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "MinerSilkMultiplier", 6).getDouble();
|
2015-04-01 17:06:27 +02:00
|
|
|
general.prefilledPortableTanks = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "PrefilledPortableTanks", true).getBoolean();
|
2015-05-06 14:34:04 +02:00
|
|
|
general.armoredJetpackDamageRatio = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ArmoredJetpackDamageRatio", 0.8).getDouble();
|
|
|
|
general.armoredJetpackDamageMax = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ArmoredJepackDamageMax", 115).getInt();
|
2015-05-11 01:33:28 +02:00
|
|
|
general.aestheticWorldDamage = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "AestheticWorldDamage", true).getBoolean();
|
2015-06-05 15:47:59 +02:00
|
|
|
general.opsBypassRestrictions = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "OpsBypassRestrictions", true).getBoolean();
|
2016-02-19 00:37:38 +01:00
|
|
|
general.thermalEvaporationSpeed = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ThermalEvaporationSpeed", 1.0D).getDouble();
|
2015-07-01 00:01:14 +02:00
|
|
|
general.maxJetpackGas = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "MaxJetpackGas", 24000).getInt();
|
|
|
|
general.maxScubaGas = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "MaxScubaGas", 24000).getInt();
|
|
|
|
general.maxFlamethrowerGas = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "MaxFlamethrowerGas", 24000).getInt();
|
2016-01-29 02:38:32 +01:00
|
|
|
general.maxPumpRange = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "MaxPumpRange", 80).getInt();
|
|
|
|
general.pumpWaterSources = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "PumpWaterSources", false).getBoolean();
|
|
|
|
general.maxPlenisherNodes = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "MaxPlenisherNodes", 4000).getInt();
|
2016-02-03 03:39:37 +01:00
|
|
|
general.evaporationHeatDissipation = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EvaporationHeatDissipation", 0.02D).getDouble();
|
|
|
|
general.evaporationTempMultiplier = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EvaporationTempMultiplier", 0.1D).getDouble();
|
|
|
|
general.evaporationSolarMultiplier = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EvaporationSolarMultiplier", 0.2D).getDouble();
|
|
|
|
general.evaporationMaxTemp = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EvaporationMaxTemp", 3000D).getDouble();
|
2016-02-27 07:27:26 +01:00
|
|
|
general.energyPerHeat = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnergyPerHeat", 1000D).getDouble();
|
2014-06-16 02:09:31 +02:00
|
|
|
|
2014-10-02 18:47:22 +02:00
|
|
|
general.blacklistIC2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BlacklistIC2Power", false).getBoolean();
|
|
|
|
general.blacklistRF = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BlacklistRFPower", false).getBoolean();
|
|
|
|
|
2014-07-07 22:17:15 +02:00
|
|
|
String s = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnergyType", "J", null, new String[]{"J", "RF", "MJ", "EU"}).getString();
|
2014-06-16 02:09:31 +02:00
|
|
|
|
|
|
|
if(s != null)
|
|
|
|
{
|
|
|
|
if(s.trim().equalsIgnoreCase("j") || s.trim().equalsIgnoreCase("joules"))
|
|
|
|
{
|
2016-02-27 19:32:48 +01:00
|
|
|
general.energyUnit = EnergyType.J;
|
2014-06-16 02:09:31 +02:00
|
|
|
}
|
|
|
|
else if(s.trim().equalsIgnoreCase("rf") || s.trim().equalsIgnoreCase("te") || s.trim().equalsIgnoreCase("thermal expansion"))
|
|
|
|
{
|
2016-02-27 19:32:48 +01:00
|
|
|
general.energyUnit = EnergyType.RF;
|
2014-06-16 02:09:31 +02:00
|
|
|
}
|
|
|
|
else if(s.trim().equalsIgnoreCase("eu") || s.trim().equalsIgnoreCase("ic2"))
|
|
|
|
{
|
2016-02-27 19:32:48 +01:00
|
|
|
general.energyUnit = EnergyType.EU;
|
2014-06-16 02:09:31 +02:00
|
|
|
}
|
|
|
|
else if(s.trim().equalsIgnoreCase("mj") || s.trim().equalsIgnoreCase("bc") || s.trim().equalsIgnoreCase("buildcraft"))
|
|
|
|
{
|
2016-02-27 19:32:48 +01:00
|
|
|
general.energyUnit = EnergyType.MJ;
|
2014-06-16 02:09:31 +02:00
|
|
|
}
|
|
|
|
}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2015-02-27 18:30:30 +01:00
|
|
|
s = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "Temperature Units", "K", null, new String[]{"K", "C", "R", "F"}).getString();
|
|
|
|
|
|
|
|
if(s != null)
|
|
|
|
{
|
|
|
|
if(s.trim().equalsIgnoreCase("k") || s.trim().equalsIgnoreCase("kelvin"))
|
|
|
|
{
|
|
|
|
general.tempUnit = TempType.K;
|
|
|
|
}
|
|
|
|
else if(s.trim().equalsIgnoreCase("c") || s.trim().equalsIgnoreCase("celsius") || s.trim().equalsIgnoreCase("centigrade"))
|
|
|
|
{
|
|
|
|
general.tempUnit = TempType.C;
|
|
|
|
}
|
|
|
|
else if(s.trim().equalsIgnoreCase("r") || s.trim().equalsIgnoreCase("rankine"))
|
|
|
|
{
|
|
|
|
general.tempUnit = TempType.R;
|
|
|
|
}
|
|
|
|
else if(s.trim().equalsIgnoreCase("f") || s.trim().equalsIgnoreCase("fahrenheit"))
|
|
|
|
{
|
|
|
|
general.tempUnit = TempType.F;
|
|
|
|
}
|
|
|
|
else if(s.trim().equalsIgnoreCase("a") || s.trim().equalsIgnoreCase("ambient") || s.trim().equalsIgnoreCase("stp"))
|
|
|
|
{
|
|
|
|
general.tempUnit = TempType.STP;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-01 17:06:27 +02:00
|
|
|
general.laserRange = Mekanism.configuration.get("general", "LaserRange", 64).getInt();
|
|
|
|
general.laserEnergyNeededPerHardness = Mekanism.configuration.get("general", "LaserDiggingEnergy", 100000).getInt();
|
|
|
|
general.destroyDisabledBlocks = Mekanism.configuration.get("general", "DestroyDisabledBlocks", true).getBoolean();
|
2016-02-03 03:39:37 +01:00
|
|
|
|
2015-03-05 19:48:01 +01:00
|
|
|
|
|
|
|
for(MachineType type : MachineType.getValidMachines())
|
|
|
|
{
|
2015-04-01 17:06:27 +02:00
|
|
|
machines.setEntry(type.name, Mekanism.configuration.get("machines", type.name + "Enabled", true).getBoolean());
|
2015-03-05 19:48:01 +01:00
|
|
|
}
|
|
|
|
|
2015-04-01 17:06:27 +02:00
|
|
|
usage.enrichmentChamberUsage = Mekanism.configuration.get("usage", "EnrichmentChamberUsage", 50D).getDouble();
|
|
|
|
usage.osmiumCompressorUsage = Mekanism.configuration.get("usage", "OsmiumCompressorUsage", 100D).getDouble();
|
|
|
|
usage.combinerUsage = Mekanism.configuration.get("usage", "CombinerUsage", 50D).getDouble();
|
|
|
|
usage.crusherUsage = Mekanism.configuration.get("usage", "CrusherUsage", 50D).getDouble();
|
|
|
|
usage.factoryUsage = Mekanism.configuration.get("usage", "FactoryUsage", 50D).getDouble();
|
|
|
|
usage.metallurgicInfuserUsage = Mekanism.configuration.get("usage", "MetallurgicInfuserUsage", 50D).getDouble();
|
|
|
|
usage.purificationChamberUsage = Mekanism.configuration.get("usage", "PurificationChamberUsage", 200D).getDouble();
|
|
|
|
usage.energizedSmelterUsage = Mekanism.configuration.get("usage", "EnergizedSmelterUsage", 50D).getDouble();
|
|
|
|
usage.digitalMinerUsage = Mekanism.configuration.get("usage", "DigitalMinerUsage", 100D).getDouble();
|
|
|
|
usage.electricPumpUsage = Mekanism.configuration.get("usage", "ElectricPumpUsage", 100D).getDouble();
|
|
|
|
usage.rotaryCondensentratorUsage = Mekanism.configuration.get("usage", "RotaryCondensentratorUsage", 50D).getDouble();
|
|
|
|
usage.oxidationChamberUsage = Mekanism.configuration.get("usage", "OxidationChamberUsage", 200D).getDouble();
|
|
|
|
usage.chemicalInfuserUsage = Mekanism.configuration.get("usage", "ChemicalInfuserUsage", 200D).getDouble();
|
|
|
|
usage.chemicalInjectionChamberUsage = Mekanism.configuration.get("usage", "ChemicalInjectionChamberUsage", 400D).getDouble();
|
|
|
|
usage.precisionSawmillUsage = Mekanism.configuration.get("usage", "PrecisionSawmillUsage", 50D).getDouble();
|
|
|
|
usage.chemicalDissolutionChamberUsage = Mekanism.configuration.get("usage", "ChemicalDissolutionChamberUsage", 400D).getDouble();
|
|
|
|
usage.chemicalWasherUsage = Mekanism.configuration.get("usage", "ChemicalWasherUsage", 200D).getDouble();
|
|
|
|
usage.chemicalCrystallizerUsage = Mekanism.configuration.get("usage", "ChemicalCrystallizerUsage", 400D).getDouble();
|
|
|
|
usage.seismicVibratorUsage = Mekanism.configuration.get("usage", "SeismicVibratorUsage", 50D).getDouble();
|
|
|
|
usage.pressurizedReactionBaseUsage = Mekanism.configuration.get("usage", "PressurizedReactionBaseUsage", 5D).getDouble();
|
|
|
|
usage.fluidicPlenisherUsage = Mekanism.configuration.get("usage", "FluidicPlenisherUsage", 100D).getDouble();
|
|
|
|
usage.laserUsage = Mekanism.configuration.get("usage", "LaserUsage", 5000D).getDouble();
|
|
|
|
usage.gasCentrifugeUsage = Mekanism.configuration.get("usage", "GasCentrifugeUsage", 100D).getDouble();
|
|
|
|
usage.heavyWaterElectrolysisUsage = Mekanism.configuration.get("usage", "HeavyWaterElectrolysisUsage", 800D).getDouble();
|
2014-07-07 22:17:15 +02:00
|
|
|
|
2015-04-01 17:06:27 +02:00
|
|
|
Tier.loadConfig();
|
|
|
|
|
2014-07-07 22:17:15 +02:00
|
|
|
if(Mekanism.configuration.hasChanged())
|
2014-07-10 04:06:36 +02:00
|
|
|
{
|
2014-07-07 22:17:15 +02:00
|
|
|
Mekanism.configuration.save();
|
2014-07-10 04:06:36 +02:00
|
|
|
}
|
2012-08-21 02:34:12 +02:00
|
|
|
}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2012-08-15 22:41:41 +02:00
|
|
|
/**
|
2013-04-13 16:33:37 +02:00
|
|
|
* Set up and load the utilities this mod uses.
|
2012-08-15 22:41:41 +02:00
|
|
|
*/
|
2014-06-03 20:57:59 +02:00
|
|
|
public void loadUtilities()
|
|
|
|
{
|
2014-07-10 04:06:36 +02:00
|
|
|
FMLCommonHandler.instance().bus().register(Mekanism.worldTickHandler);
|
2014-06-03 20:57:59 +02:00
|
|
|
}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether or not the game is paused.
|
2013-05-09 14:56:36 +02:00
|
|
|
*/
|
2014-03-08 02:00:25 +01:00
|
|
|
public boolean isPaused()
|
2013-04-28 21:23:08 +02:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2015-02-28 05:49:48 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds block hit effects on the client side.
|
|
|
|
*/
|
|
|
|
public void addHitEffects(Coord4D coord, MovingObjectPosition mop) {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Does a generic creation animation, starting from the rendering block.
|
|
|
|
*/
|
|
|
|
public void doGenericSparkle(TileEntity tileEntity, INodeChecker checker) {}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2013-05-14 17:34:26 +02:00
|
|
|
/**
|
2014-08-23 00:34:19 +02:00
|
|
|
* Does the multiblock creation animation, starting from the rendering block.
|
2013-05-14 17:34:26 +02:00
|
|
|
*/
|
2015-02-28 05:49:48 +01:00
|
|
|
public void doMultiblockSparkle(TileEntityMultiblock<?> tileEntity) {}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2016-01-25 06:13:42 +01:00
|
|
|
@Override
|
2014-03-08 02:00:25 +01:00
|
|
|
public Object getClientGui(int ID, EntityPlayer player, World world, int x, int y, int z)
|
2012-08-31 01:27:35 +02:00
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2016-01-25 06:13:42 +01:00
|
|
|
@Override
|
2014-03-08 02:00:25 +01:00
|
|
|
public Container getServerGui(int ID, EntityPlayer player, World world, int x, int y, int z)
|
2012-08-15 22:41:41 +02:00
|
|
|
{
|
2014-04-20 05:34:19 +02:00
|
|
|
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2012-08-15 22:41:41 +02:00
|
|
|
switch(ID)
|
|
|
|
{
|
2013-12-10 02:52:49 +01:00
|
|
|
case 0:
|
|
|
|
return new ContainerDictionary(player.inventory);
|
2013-11-18 21:33:14 +01:00
|
|
|
case 2:
|
2013-11-20 00:16:26 +01:00
|
|
|
return new ContainerDigitalMiner(player.inventory, (TileEntityDigitalMiner)tileEntity);
|
2012-09-25 21:15:47 +02:00
|
|
|
case 3:
|
2012-11-15 21:04:12 +01:00
|
|
|
return new ContainerElectricMachine(player.inventory, (TileEntityElectricMachine)tileEntity);
|
2012-09-25 21:15:47 +02:00
|
|
|
case 4:
|
2012-11-15 21:04:12 +01:00
|
|
|
return new ContainerAdvancedElectricMachine(player.inventory, (TileEntityAdvancedElectricMachine)tileEntity);
|
2012-09-25 21:15:47 +02:00
|
|
|
case 5:
|
2012-11-15 21:04:12 +01:00
|
|
|
return new ContainerAdvancedElectricMachine(player.inventory, (TileEntityAdvancedElectricMachine)tileEntity);
|
2012-09-25 21:15:47 +02:00
|
|
|
case 6:
|
2012-11-15 21:04:12 +01:00
|
|
|
return new ContainerElectricMachine(player.inventory, (TileEntityElectricMachine)tileEntity);
|
2012-09-25 21:15:47 +02:00
|
|
|
case 7:
|
2013-11-28 05:42:54 +01:00
|
|
|
return new ContainerRotaryCondensentrator(player.inventory, (TileEntityRotaryCondensentrator)tileEntity);
|
2012-10-02 20:39:40 +02:00
|
|
|
case 8:
|
2012-11-28 16:33:34 +01:00
|
|
|
return new ContainerEnergyCube(player.inventory, (TileEntityEnergyCube)tileEntity);
|
2013-10-30 20:22:43 +01:00
|
|
|
case 9:
|
|
|
|
return new ContainerNull(player, (TileEntityContainerBlock)tileEntity);
|
2012-11-15 21:04:12 +01:00
|
|
|
case 10:
|
2012-11-21 16:14:35 +01:00
|
|
|
return new ContainerGasTank(player.inventory, (TileEntityGasTank)tileEntity);
|
2012-12-19 21:23:55 +01:00
|
|
|
case 11:
|
2013-03-20 18:58:36 +01:00
|
|
|
return new ContainerFactory(player.inventory, (TileEntityFactory)tileEntity);
|
2012-12-20 22:53:39 +01:00
|
|
|
case 12:
|
|
|
|
return new ContainerMetallurgicInfuser(player.inventory, (TileEntityMetallurgicInfuser)tileEntity);
|
2013-01-21 02:15:59 +01:00
|
|
|
case 13:
|
|
|
|
return new ContainerTeleporter(player.inventory, (TileEntityTeleporter)tileEntity);
|
2015-03-29 01:34:57 +01:00
|
|
|
case 14:
|
|
|
|
ItemStack itemStack = player.getCurrentEquippedItem();
|
|
|
|
|
|
|
|
if(itemStack != null && itemStack.getItem() instanceof ItemPortableTeleporter)
|
|
|
|
{
|
|
|
|
return new ContainerNull();
|
|
|
|
}
|
2013-01-23 21:42:45 +01:00
|
|
|
case 15:
|
|
|
|
return new ContainerAdvancedElectricMachine(player.inventory, (TileEntityAdvancedElectricMachine)tileEntity);
|
2013-03-20 21:28:45 +01:00
|
|
|
case 16:
|
|
|
|
return new ContainerElectricMachine(player.inventory, (TileEntityElectricMachine)tileEntity);
|
2013-04-03 21:37:26 +02:00
|
|
|
case 17:
|
|
|
|
return new ContainerElectricPump(player.inventory, (TileEntityElectricPump)tileEntity);
|
2013-04-28 21:23:08 +02:00
|
|
|
case 18:
|
|
|
|
return new ContainerDynamicTank(player.inventory, (TileEntityDynamicTank)tileEntity);
|
2013-05-20 00:43:01 +02:00
|
|
|
case 21:
|
|
|
|
EntityRobit robit = (EntityRobit)world.getEntityByID(x);
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2013-05-20 00:43:01 +02:00
|
|
|
if(robit != null)
|
|
|
|
{
|
|
|
|
return new ContainerRobitMain(player.inventory, robit);
|
|
|
|
}
|
|
|
|
case 22:
|
|
|
|
return new ContainerRobitCrafting(player.inventory, world);
|
|
|
|
case 23:
|
|
|
|
EntityRobit robit1 = (EntityRobit)world.getEntityByID(x);
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2013-05-20 00:43:01 +02:00
|
|
|
if(robit1 != null)
|
|
|
|
{
|
|
|
|
return new ContainerRobitInventory(player.inventory, robit1);
|
|
|
|
}
|
2013-05-20 19:51:18 +02:00
|
|
|
case 24:
|
|
|
|
EntityRobit robit2 = (EntityRobit)world.getEntityByID(x);
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2013-05-20 19:51:18 +02:00
|
|
|
if(robit2 != null)
|
|
|
|
{
|
|
|
|
return new ContainerRobitSmelting(player.inventory, robit2);
|
|
|
|
}
|
2013-05-20 21:06:10 +02:00
|
|
|
case 25:
|
|
|
|
return new ContainerRobitRepair(player.inventory, world);
|
2013-10-25 06:23:38 +02:00
|
|
|
case 26:
|
2013-10-26 06:02:57 +02:00
|
|
|
return new ContainerNull(player, (TileEntityContainerBlock)tileEntity);
|
|
|
|
case 27:
|
2013-11-20 21:15:02 +01:00
|
|
|
return new ContainerFilter(player.inventory, (TileEntityContainerBlock)tileEntity);
|
2013-10-26 06:02:57 +02:00
|
|
|
case 28:
|
2013-11-20 21:15:02 +01:00
|
|
|
return new ContainerFilter(player.inventory, (TileEntityContainerBlock)tileEntity);
|
2013-12-12 02:24:37 +01:00
|
|
|
case 29:
|
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
|
|
|
return new ContainerChemicalOxidizer(player.inventory, (TileEntityChemicalOxidizer)tileEntity);
|
2013-12-12 02:24:37 +01:00
|
|
|
case 30:
|
|
|
|
return new ContainerChemicalInfuser(player.inventory, (TileEntityChemicalInfuser)tileEntity);
|
2013-12-24 06:23:30 +01:00
|
|
|
case 31:
|
|
|
|
return new ContainerAdvancedElectricMachine(player.inventory, (TileEntityAdvancedElectricMachine)tileEntity);
|
2014-01-03 03:09:21 +01:00
|
|
|
case 32:
|
|
|
|
return new ContainerElectrolyticSeparator(player.inventory, (TileEntityElectrolyticSeparator)tileEntity);
|
2014-01-12 00:35:39 +01:00
|
|
|
case 33:
|
2016-02-19 00:37:38 +01:00
|
|
|
return new ContainerThermalEvaporationController(player.inventory, (TileEntityThermalEvaporationController)tileEntity);
|
2014-01-13 06:06:13 +01:00
|
|
|
case 34:
|
|
|
|
return new ContainerChanceMachine(player.inventory, (TileEntityChanceMachine)tileEntity);
|
2014-01-31 20:59:12 +01:00
|
|
|
case 35:
|
|
|
|
return new ContainerChemicalDissolutionChamber(player.inventory, (TileEntityChemicalDissolutionChamber)tileEntity);
|
|
|
|
case 36:
|
|
|
|
return new ContainerChemicalWasher(player.inventory, (TileEntityChemicalWasher)tileEntity);
|
|
|
|
case 37:
|
2014-04-12 03:51:02 +02:00
|
|
|
return new ContainerChemicalCrystallizer(player.inventory, (TileEntityChemicalCrystallizer)tileEntity);
|
2014-03-16 01:05:26 +01:00
|
|
|
case 39:
|
|
|
|
return new ContainerSeismicVibrator(player.inventory, (TileEntitySeismicVibrator)tileEntity);
|
2014-04-06 02:16:09 +02:00
|
|
|
case 40:
|
|
|
|
return new ContainerPRC(player.inventory, (TileEntityPRC)tileEntity);
|
2014-06-18 21:05:32 +02:00
|
|
|
case 41:
|
2016-02-27 01:51:37 +01:00
|
|
|
return new ContainerFluidTank(player.inventory, (TileEntityFluidTank)tileEntity);
|
2014-06-19 12:42:59 +02:00
|
|
|
case 42:
|
|
|
|
return new ContainerFluidicPlenisher(player.inventory, (TileEntityFluidicPlenisher)tileEntity);
|
2014-07-22 00:07:15 +02:00
|
|
|
case 43:
|
|
|
|
return new ContainerUpgradeManagement(player.inventory, (IUpgradeTile)tileEntity);
|
2014-07-30 23:26:03 +02:00
|
|
|
case 44:
|
2014-09-15 03:11:55 +02:00
|
|
|
return new ContainerLaserAmplifier(player.inventory, (TileEntityLaserAmplifier)tileEntity);
|
2014-08-09 03:08:38 +02:00
|
|
|
case 45:
|
2014-09-15 03:11:55 +02:00
|
|
|
return new ContainerLaserTractorBeam(player.inventory, (TileEntityLaserTractorBeam)tileEntity);
|
2014-09-03 02:51:00 +02:00
|
|
|
case 46:
|
2015-02-26 23:23:53 +01:00
|
|
|
return new ContainerNull(player, (TileEntityContainerBlock)tileEntity);
|
2014-09-15 03:11:55 +02:00
|
|
|
case 47:
|
2015-02-26 23:23:53 +01:00
|
|
|
return new ContainerSolarNeutronActivator(player.inventory, (TileEntitySolarNeutronActivator)tileEntity);
|
|
|
|
case 48:
|
2014-08-10 03:16:35 +02:00
|
|
|
return new ContainerNull(player, (TileEntityContainerBlock)tileEntity);
|
2015-03-03 19:16:58 +01:00
|
|
|
case 49:
|
|
|
|
return new ContainerInductionMatrix(player.inventory, (TileEntityInductionCasing)tileEntity);
|
2015-03-04 06:11:09 +01:00
|
|
|
case 50:
|
|
|
|
return new ContainerNull(player, (TileEntityContainerBlock)tileEntity);
|
2015-03-08 03:08:28 +01:00
|
|
|
case 51:
|
|
|
|
return new ContainerNull(player, (TileEntityContainerBlock)tileEntity);
|
2015-03-13 15:14:57 +01:00
|
|
|
case 52:
|
|
|
|
return new ContainerOredictionificator(player.inventory, (TileEntityOredictionificator)tileEntity);
|
2016-02-27 01:51:37 +01:00
|
|
|
case 53:
|
|
|
|
return new ContainerResistiveHeater(player.inventory, (TileEntityResistiveHeater)tileEntity);
|
2012-08-15 22:41:41 +02:00
|
|
|
}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2012-08-15 22:41:41 +02:00
|
|
|
return null;
|
|
|
|
}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2013-11-24 19:12:42 +01:00
|
|
|
public void preInit() {}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2013-11-18 21:33:14 +01:00
|
|
|
public double getReach(EntityPlayer player)
|
|
|
|
{
|
|
|
|
if(player instanceof EntityPlayerMP)
|
|
|
|
{
|
|
|
|
return ((EntityPlayerMP)player).theItemInWorldManager.getBlockReachDistance();
|
|
|
|
}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2013-11-18 21:33:14 +01:00
|
|
|
return 0;
|
|
|
|
}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2013-07-20 18:10:14 +02:00
|
|
|
/**
|
|
|
|
* Gets the Minecraft base directory.
|
|
|
|
* @return base directory
|
|
|
|
*/
|
|
|
|
public File getMinecraftDir()
|
|
|
|
{
|
2014-01-12 17:46:25 +01:00
|
|
|
return (File)FMLInjectionData.data()[6];
|
2013-07-20 18:10:14 +02:00
|
|
|
}
|
2015-03-21 06:50:19 +01:00
|
|
|
|
|
|
|
public void updateConfigRecipes()
|
|
|
|
{
|
|
|
|
for(MachineType type : MachineType.getValidMachines())
|
|
|
|
{
|
2015-03-22 03:23:45 +01:00
|
|
|
if(machines.isEnabled(type.name))
|
2015-03-21 06:50:19 +01:00
|
|
|
{
|
|
|
|
CraftingManager.getInstance().getRecipeList().removeAll(type.getRecipes());
|
|
|
|
CraftingManager.getInstance().getRecipeList().addAll(type.getRecipes());
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
CraftingManager.getInstance().getRecipeList().removeAll(type.getRecipes());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2015-03-21 06:50:19 +01:00
|
|
|
public void onConfigSync(boolean fromPacket)
|
2013-12-22 22:49:04 +01:00
|
|
|
{
|
2014-08-01 01:58:12 +02:00
|
|
|
if(general.cardboardSpawners)
|
2014-01-13 22:37:15 +01:00
|
|
|
{
|
2014-05-29 18:55:47 +02:00
|
|
|
MekanismAPI.removeBoxBlacklist(Blocks.mob_spawner, 0);
|
2014-01-13 22:37:15 +01:00
|
|
|
}
|
|
|
|
else {
|
2014-05-29 18:55:47 +02:00
|
|
|
MekanismAPI.addBoxBlacklist(Blocks.mob_spawner, 0);
|
2014-01-13 22:37:15 +01:00
|
|
|
}
|
2015-03-05 19:48:01 +01:00
|
|
|
|
2014-09-03 19:25:06 +02:00
|
|
|
MachineType.updateAllUsages();
|
2015-03-05 19:48:01 +01:00
|
|
|
|
2015-03-21 06:50:19 +01:00
|
|
|
updateConfigRecipes();
|
|
|
|
|
|
|
|
if(fromPacket)
|
2015-03-05 19:48:01 +01:00
|
|
|
{
|
2015-03-21 06:50:19 +01:00
|
|
|
Mekanism.logger.info("Received config from server.");
|
2015-03-05 19:48:01 +01:00
|
|
|
}
|
2013-12-22 22:49:04 +01:00
|
|
|
}
|
2015-05-23 17:36:53 +02:00
|
|
|
|
|
|
|
private WeakReference<EntityPlayer> createNewPlayer(WorldServer world)
|
|
|
|
{
|
|
|
|
EntityPlayer player = FakePlayerFactory.get(world, Mekanism.gameProfile);
|
|
|
|
|
|
|
|
return new WeakReference<EntityPlayer>(player);
|
|
|
|
}
|
|
|
|
|
|
|
|
private WeakReference<EntityPlayer> createNewPlayer(WorldServer world, double x, double y, double z)
|
|
|
|
{
|
|
|
|
EntityPlayer player = FakePlayerFactory.get(world, Mekanism.gameProfile);
|
|
|
|
|
|
|
|
player.posX = x;
|
|
|
|
player.posY = y;
|
|
|
|
player.posZ = z;
|
|
|
|
|
|
|
|
return new WeakReference<EntityPlayer>(player);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final WeakReference<EntityPlayer> getDummyPlayer(WorldServer world)
|
|
|
|
{
|
|
|
|
if(dummyPlayer.get() == null)
|
|
|
|
{
|
|
|
|
dummyPlayer = createNewPlayer(world);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
dummyPlayer.get().worldObj = world;
|
|
|
|
}
|
|
|
|
|
|
|
|
return dummyPlayer;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final WeakReference<EntityPlayer> getDummyPlayer(WorldServer world, double x, double y, double z)
|
|
|
|
{
|
|
|
|
if(dummyPlayer.get() == null)
|
|
|
|
{
|
|
|
|
dummyPlayer = createNewPlayer(world, x, y, z);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
dummyPlayer.get().worldObj = world;
|
|
|
|
dummyPlayer.get().posX = x;
|
|
|
|
dummyPlayer.get().posY = y;
|
|
|
|
dummyPlayer.get().posZ = z;
|
|
|
|
}
|
|
|
|
|
|
|
|
return dummyPlayer;
|
|
|
|
}
|
2014-06-27 04:25:47 +02:00
|
|
|
|
|
|
|
public EntityPlayer getPlayer(MessageContext context)
|
|
|
|
{
|
|
|
|
return context.getServerHandler().playerEntity;
|
|
|
|
}
|
2016-01-29 06:34:50 +01:00
|
|
|
|
|
|
|
public int getGuiId(Block block, int metadata)
|
|
|
|
{
|
|
|
|
if(MachineType.get(block, metadata) != null)
|
|
|
|
{
|
|
|
|
return MachineType.get(block, metadata).guiId;
|
|
|
|
}
|
|
|
|
else if(block == MekanismBlocks.GasTank)
|
|
|
|
{
|
|
|
|
return 10;
|
|
|
|
}
|
|
|
|
else if(block == MekanismBlocks.EnergyCube)
|
|
|
|
{
|
|
|
|
return 8;
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
2014-07-22 19:03:34 +02:00
|
|
|
|
2014-09-14 06:20:16 +02:00
|
|
|
public void renderLaser(World world, Pos3D from, Pos3D to, ForgeDirection direction, double energy) {}
|
2016-02-03 06:37:39 +01:00
|
|
|
|
|
|
|
public Object getFontRenderer()
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
2012-08-15 22:41:41 +02:00
|
|
|
}
|