-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCommonProxy.java
More file actions
106 lines (91 loc) · 3.49 KB
/
Copy pathCommonProxy.java
File metadata and controls
106 lines (91 loc) · 3.49 KB
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
package wa;
import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.stats.Achievement;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import wa.block.*;
import wa.client.GuiBrewingBarrelII;
import wa.client.GuiSqueezer;
import wa.client.GuiStill;
public class CommonProxy implements IGuiHandler {
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world,
int x, int y, int z) {
if(ID == Config.醸造樽GUIID) {
TileEntity e = world.getTileEntity(x, y, z);
if(e instanceof TileEntityBrewingBarrelII) {
return new ContainerBrewingBarrelII(player, (TileEntityBrewingBarrelII) e);
}
}
if(ID == Config.圧搾機GUIID) {
TileEntity e = world.getTileEntity(x, y, z);
if(e instanceof TileEntitySqueezer) {
return new ContainerSqueezer(player, (TileEntitySqueezer) e);
}
}
if(ID == Config.蒸留器GUIID) {
if(world.getBlockMetadata(x, y, z) > 0) {
TileEntity e = world.getTileEntity(x, y, z);
if (e instanceof TileEntityStill) {
return new ContainerStill(player, (TileEntityStill) e);
}
}
}
return null;
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world,
int x, int y, int z) {
if(ID == Config.醸造樽GUIID) {
TileEntity e = world.getTileEntity(x, y, z);
if(e instanceof TileEntityBrewingBarrelII) {
return new GuiBrewingBarrelII(player, (TileEntityBrewingBarrelII) e);
}
}
if(ID == Config.圧搾機GUIID) {
TileEntity e = world.getTileEntity(x, y, z);
if(e instanceof TileEntitySqueezer) {
return new GuiSqueezer(player, (TileEntitySqueezer) e);
}
}
if(ID == Config.蒸留器GUIID) {
if(world.getBlockMetadata(x, y, z) > 0) {
TileEntity e = world.getTileEntity(x, y, z);
if (e instanceof TileEntityStill) {
TileEntityStill still = (TileEntityStill) e;
ForgeDirection dir = still.getPairDir();
TileEntityStill connected = dir == ForgeDirection.UNKNOWN ? null : (TileEntityStill) world.getTileEntity(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
return new GuiStill(player, still, connected);
}
}
}
return null;
}
public void init() {
// TODO 自動生成されたメソッド・スタブ
// defeatedcrow追加物
GameRegistry.registerTileEntity(TileEntityZabuton.class, "wa.tileentityZabuton");
GameRegistry.registerTileEntity(TileEntityKoto.class, "wa.tileentityKoto");
/**
* @author deteatedcrow
* Renderを登録するTileEntityはプロキシを通す
*/
GameRegistry.registerTileEntity(TileEntitySpiritLamp.class, "wa.spiritLamp");
}
public World getClientWorld() {
// TODO 自動生成されたメソッド・スタブ
return null;
}
public void addStat(Achievement ach, int i) {
// TODO 自動生成されたメソッド・スタブ
}
public void preInit() {
// TODO 自動生成されたメソッド・スタブ
}
/* defeatedcrow追加 */
public void registerFluidTex() {
}
}