2012-11-05 20:29:04 +01:00
|
|
|
package mekanism.common;
|
2012-08-15 22:41:41 +02:00
|
|
|
|
2012-08-21 02:34:12 +02:00
|
|
|
import java.io.File;
|
|
|
|
import java.io.FileInputStream;
|
|
|
|
import java.io.FileOutputStream;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.util.Properties;
|
|
|
|
|
|
|
|
import net.minecraft.client.Minecraft;
|
2012-11-15 21:04:12 +01:00
|
|
|
import net.minecraft.src.*;
|
2012-09-08 18:48:24 +02:00
|
|
|
import net.minecraftforge.common.Configuration;
|
2012-08-15 22:41:41 +02:00
|
|
|
import cpw.mods.fml.common.network.IGuiHandler;
|
2012-11-05 20:29:04 +01:00
|
|
|
import cpw.mods.fml.common.registry.GameRegistry;
|
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
|
|
|
|
*
|
|
|
|
*/
|
2012-08-31 01:27:35 +02:00
|
|
|
public class CommonProxy
|
2012-08-15 22:41:41 +02:00
|
|
|
{
|
2012-11-21 16:14:35 +01:00
|
|
|
/**
|
|
|
|
* Register tile entities that have special models. Overwritten in client to register TESRs.
|
|
|
|
*/
|
2012-11-25 16:45:00 +01:00
|
|
|
public void registerSpecialTileEntities() {}
|
2012-11-21 16:14:35 +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() {}
|
2012-08-31 01:27:35 +02:00
|
|
|
|
2012-09-03 18:11:25 +02:00
|
|
|
/**
|
|
|
|
* Gets the world the client is using from ClientProxy.
|
|
|
|
* @return client world
|
|
|
|
*/
|
2012-09-20 15:59:30 +02:00
|
|
|
public World getClientWorld()
|
2012-09-03 18:11:25 +02:00
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the armor index number from ClientProxy.
|
|
|
|
* @param armor indicator
|
|
|
|
* @return armor index number
|
|
|
|
*/
|
2012-09-20 15:59:30 +02:00
|
|
|
public int getArmorIndex(String string)
|
2012-08-31 01:27:35 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
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
|
|
|
{
|
2012-11-05 20:29:04 +01:00
|
|
|
Mekanism.configuration.load();
|
2012-11-21 16:14:35 +01:00
|
|
|
Mekanism.basicBlockID = Mekanism.configuration.getBlock("BasicBlock", 3000).getInt();
|
2012-11-05 20:29:04 +01:00
|
|
|
Mekanism.machineBlockID = Mekanism.configuration.getBlock("MachineBlock", 3001).getInt();
|
|
|
|
Mekanism.oreBlockID = Mekanism.configuration.getBlock("OreBlock", 3002).getInt();
|
|
|
|
Mekanism.obsidianTNTID = Mekanism.configuration.getBlock("ObsidianTNT", 3003).getInt();
|
2012-11-28 16:33:34 +01:00
|
|
|
Mekanism.energyCubeID = Mekanism.configuration.getBlock("EnergyCube", 3004).getInt();
|
2012-11-21 16:14:35 +01:00
|
|
|
Mekanism.nullRenderID = Mekanism.configuration.getBlock("NullRender", 3007).getInt();
|
|
|
|
Mekanism.gasTankID = Mekanism.configuration.getBlock("GasTank", 3009).getInt();
|
2012-11-05 20:29:04 +01:00
|
|
|
Mekanism.extrasEnabled = Mekanism.configuration.get("ExtrasEnabled", Configuration.CATEGORY_GENERAL, true).getBoolean(true);
|
|
|
|
Mekanism.oreGenerationEnabled = Mekanism.configuration.get("OreGenerationEnabled", Configuration.CATEGORY_GENERAL, true).getBoolean(true);
|
|
|
|
Mekanism.configuration.save();
|
2012-08-21 02:34:12 +02:00
|
|
|
}
|
2012-08-15 22:41:41 +02:00
|
|
|
|
|
|
|
/**
|
2012-09-08 18:48:24 +02:00
|
|
|
* Load and initiate utilities for the mod's proxy.
|
2012-08-15 22:41:41 +02:00
|
|
|
*/
|
2012-09-08 18:48:24 +02:00
|
|
|
public void loadUtilities() {}
|
2012-08-15 22:41:41 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set up and load the client-only tick handler.
|
|
|
|
*/
|
2012-09-08 18:48:24 +02:00
|
|
|
public void loadTickHandler() {}
|
2012-08-15 22:41:41 +02:00
|
|
|
|
2012-11-05 16:52:56 +01:00
|
|
|
/**
|
|
|
|
* Set up and load the sound handler.
|
|
|
|
*/
|
|
|
|
public void loadSoundHandler() {}
|
|
|
|
|
2012-08-15 22:41:41 +02:00
|
|
|
/**
|
2012-11-15 21:04:12 +01:00
|
|
|
* Get the actual interface for a GUI. Client-only.
|
2012-08-15 22:41:41 +02:00
|
|
|
* @param ID - gui ID
|
|
|
|
* @param player - player that opened the GUI
|
|
|
|
* @param world - world the GUI was opened in
|
|
|
|
* @param x - gui's x position
|
|
|
|
* @param y - gui's y position
|
|
|
|
* @param z - gui's z position
|
2012-11-15 21:04:12 +01:00
|
|
|
* @return the GuiScreen of the GUI
|
2012-08-15 22:41:41 +02:00
|
|
|
*/
|
2012-09-20 15:59:30 +02: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;
|
|
|
|
}
|
2012-08-15 22:41:41 +02:00
|
|
|
|
|
|
|
/**
|
2012-11-15 21:04:12 +01:00
|
|
|
* Get the container for a GUI. Common.
|
2012-08-15 22:41:41 +02:00
|
|
|
* @param ID - gui ID
|
|
|
|
* @param player - player that opened the GUI
|
|
|
|
* @param world - world the GUI was opened in
|
|
|
|
* @param x - gui's x position
|
|
|
|
* @param y - gui's y position
|
|
|
|
* @param z - gui's z position
|
2012-11-15 21:04:12 +01:00
|
|
|
* @return the Container of the GUI
|
2012-08-15 22:41:41 +02:00
|
|
|
*/
|
|
|
|
public Container getServerGui(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 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:
|
2012-11-15 21:04:12 +01:00
|
|
|
return new ContainerAdvancedElectricMachine(player.inventory, (TileEntityAdvancedElectricMachine)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);
|
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-08-15 22:41:41 +02:00
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|