-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathElectriGuiHandler.java
57 lines (50 loc) · 1.74 KB
/
ElectriGuiHandler.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
/*******************************************************************************
* @author Reika Kalseki
*
* Copyright 2017
*
* All rights reserved.
* Distribution of the software in any form is only allowed with
* explicit, prior permission from the owner.
******************************************************************************/
package Reika.ElectriCraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import Reika.DragonAPI.Base.CoreContainer;
import Reika.ElectriCraft.GUIs.GuiElectriBook;
import Reika.ElectriCraft.GUIs.GuiRFCable;
import Reika.ElectriCraft.GUIs.GuiTransformer;
import Reika.ElectriCraft.TileEntities.TileEntityTransformer;
import Reika.ElectriCraft.TileEntities.ModInterface.TileEntityRFCable;
import cpw.mods.fml.common.network.IGuiHandler;
public class ElectriGuiHandler implements IGuiHandler {
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
TileEntity te = world.getTileEntity(x, y, z);
if (ID == 10) {
return null;
}
if (te instanceof TileEntityRFCable) {
return new CoreContainer(player, te);
}
if (te instanceof TileEntityTransformer) {
return new CoreContainer(player, te);
}
return null;
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
if (ID == 10) {
return new GuiElectriBook(player, world, 0, 0);
}
TileEntity te = world.getTileEntity(x, y, z);
if (te instanceof TileEntityRFCable) {
return new GuiRFCable(player, (TileEntityRFCable)te);
}
if (te instanceof TileEntityTransformer) {
return new GuiTransformer(player, (TileEntityTransformer)te);
}
return null;
}
}