2013-07-26 21:18:53 -07:00
|
|
|
package tconstruct.common;
|
|
|
|
|
|
2013-10-08 21:08:46 +11:00
|
|
|
import cpw.mods.fml.common.network.IGuiHandler;
|
|
|
|
|
import cpw.mods.fml.common.registry.LanguageRegistry;
|
2013-11-07 22:23:20 -06:00
|
|
|
import cpw.mods.fml.common.registry.TickRegistry;
|
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
2013-08-05 13:36:19 -07:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
|
import net.minecraft.world.World;
|
2013-07-26 21:18:53 -07:00
|
|
|
import tconstruct.TConstruct;
|
2013-09-05 12:39:18 -07:00
|
|
|
import tconstruct.blocks.logic.TileEntityLandmine;
|
2013-10-08 21:08:46 +11:00
|
|
|
import tconstruct.inventory.*;
|
2013-07-26 21:18:53 -07:00
|
|
|
import tconstruct.library.blocks.InventoryLogic;
|
|
|
|
|
import tconstruct.util.player.TPlayerStats;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Common proxy class for InfiTools
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public class TProxyCommon implements IGuiHandler
|
|
|
|
|
{
|
2013-08-16 13:51:33 -07:00
|
|
|
public static int toolStationID = 0;
|
|
|
|
|
public static int partBuilderID = 1;
|
|
|
|
|
public static int patternChestID = 2;
|
|
|
|
|
public static int stencilTableID = 3;
|
2013-07-26 21:18:53 -07:00
|
|
|
public static int frypanGuiID = 4;
|
2013-08-16 13:51:33 -07:00
|
|
|
public static int toolForgeID = 5;
|
2013-11-10 13:57:35 -08:00
|
|
|
|
2013-11-09 14:28:48 -08:00
|
|
|
public static int smelteryGuiID = 7;
|
|
|
|
|
public static int furnaceID = 8;
|
2013-11-13 22:42:53 -06:00
|
|
|
// public static int drawbridgeID = 9; // Moved to TMechworks
|
2013-08-16 09:30:56 -07:00
|
|
|
public static int landmineID = 10;
|
2013-08-07 19:06:26 -07:00
|
|
|
public static int craftingStationID = 11;
|
2013-11-13 22:42:53 -06:00
|
|
|
// public static int advDrawbridgeID = 12; // Moved to TMechworks
|
2013-07-26 21:18:53 -07:00
|
|
|
public static int inventoryGui = 100;
|
|
|
|
|
public static int armorGuiID = 101;
|
|
|
|
|
public static int knapsackGuiID = 102;
|
2013-08-31 05:13:31 -07:00
|
|
|
|
2013-07-26 21:18:53 -07:00
|
|
|
public static int manualGuiID = -1;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Object getServerGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
|
2013-08-31 05:13:31 -07:00
|
|
|
{
|
2013-07-26 21:18:53 -07:00
|
|
|
if (ID < 0)
|
|
|
|
|
return null;
|
2013-08-31 05:13:31 -07:00
|
|
|
|
|
|
|
|
if (ID == landmineID)
|
|
|
|
|
{
|
|
|
|
|
return new ContainerLandmine(player, (TileEntityLandmine) world.getBlockTileEntity(x, y, z));
|
2013-07-27 20:08:11 -07:00
|
|
|
}
|
2013-07-26 21:18:53 -07:00
|
|
|
|
|
|
|
|
else if (ID < 100)
|
|
|
|
|
{
|
|
|
|
|
TileEntity tile = world.getBlockTileEntity(x, y, z);
|
|
|
|
|
if (tile != null && tile instanceof InventoryLogic)
|
|
|
|
|
{
|
|
|
|
|
return ((InventoryLogic) tile).getGuiContainer(player.inventory, world, x, y, z);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (ID == inventoryGui)
|
|
|
|
|
{
|
|
|
|
|
//GuiInventory inv = new GuiInventory(player);
|
|
|
|
|
return player.inventoryContainer;
|
|
|
|
|
}
|
|
|
|
|
if (ID == armorGuiID)
|
|
|
|
|
{
|
|
|
|
|
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username);
|
|
|
|
|
return new ArmorExtendedContainer(player.inventory, stats.armor);
|
|
|
|
|
}
|
|
|
|
|
if (ID == knapsackGuiID)
|
|
|
|
|
{
|
|
|
|
|
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username);
|
|
|
|
|
return new KnapsackContainer(player.inventory, stats.knapsack);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Object getClientGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void registerTickHandler ()
|
|
|
|
|
{
|
|
|
|
|
//TickRegistry.registerTickHandler(new TimeTicker(), Side.SERVER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Registers any rendering code. Does nothing server-side */
|
|
|
|
|
public void registerRenderer ()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Ties an internal name to a visible one. */
|
|
|
|
|
public void addNames ()
|
|
|
|
|
{
|
2013-10-09 11:29:10 +01:00
|
|
|
// As of 1.6.x, this is now handled by Minecraft itself for the most part.
|
2013-07-26 21:18:53 -07:00
|
|
|
|
|
|
|
|
LanguageRegistry.addName(TContent.potionLauncher, "Potion Launcher");
|
|
|
|
|
LanguageRegistry.addName(TContent.knapsack, "Knapsack");
|
2013-08-31 05:13:31 -07:00
|
|
|
|
2013-08-16 09:30:56 -07:00
|
|
|
LanguageRegistry.addName(TContent.meatBlock, "Hambone");
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void readManuals ()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void registerKeys ()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void spawnParticle (String slimeParticle, double xPos, double yPos, double zPos, double velX, double velY, double velZ)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static final String[] patterns = new String[] { "ingot", "rod", "pickaxe", "shovel", "axe", "swordblade", "largeguard", "mediumguard", "crossbar", "binding", "frypan", "sign",
|
|
|
|
|
"knifeblade", "chisel", "largerod", "toughbinding", "largeplate", "broadaxe", "scythe", "excavator", "largeblade", "hammerhead", "fullguard", "bowstring", "fletching", "arrowhead" };
|
2013-11-10 13:57:35 -08:00
|
|
|
|
|
|
|
|
public void postInit ()
|
|
|
|
|
{
|
|
|
|
|
|
2013-10-08 21:08:46 +11:00
|
|
|
}
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|