-
Notifications
You must be signed in to change notification settings - Fork 754
/
TProxyCommon.java
127 lines (107 loc) · 4.04 KB
/
TProxyCommon.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
package tconstruct.common;
import mantle.blocks.abstracts.InventoryLogic;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import tconstruct.TConstruct;
import tconstruct.blocks.logic.TileEntityLandmine;
import tconstruct.inventory.ArmorExtendedContainer;
import tconstruct.inventory.ContainerLandmine;
import tconstruct.inventory.KnapsackContainer;
import tconstruct.util.player.TPlayerStats;
import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.common.registry.LanguageRegistry;
/**
* Common proxy class for InfiTools
*/
public class TProxyCommon implements IGuiHandler
{
public static int toolStationID = 0;
public static int partBuilderID = 1;
public static int patternChestID = 2;
public static int stencilTableID = 3;
public static int frypanGuiID = 4;
public static int toolForgeID = 5;
public static int smelteryGuiID = 7;
public static int furnaceID = 8;
// public static int drawbridgeID = 9; // Moved to TMechworks
public static int landmineID = 10;
public static int craftingStationID = 11;
// public static int advDrawbridgeID = 12; // Moved to TMechworks
public static int inventoryGui = 100;
public static int armorGuiID = 101;
public static int knapsackGuiID = 102;
// public static int manualGuiID = -1;// moved to Mantle
@Override
public Object getServerGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
{
if (ID < 0)
return null;
if (ID == landmineID)
{
return new ContainerLandmine(player, (TileEntityLandmine) world.getTileEntity(x, y, z));
}
else if (ID < 100)
{
TileEntity tile = world.getTileEntity(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.getDisplayName());
return new ArmorExtendedContainer(player.inventory, stats.armor);
}
if (ID == knapsackGuiID)
{
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.getDisplayName());
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 ()
{
// As of 1.6.x, this is now handled by Minecraft itself for the most
// part.
//LanguageRegistry.addName(TRepo.potionLauncher, "Potion Launcher");
//LanguageRegistry.addName(TRepo.knapsack, "Knapsack");
}
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" };
public void postInit ()
{
}
}