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
128
129
130
131
132
|
package gregtech.api.interfaces.tileentity;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.fluids.IFluidHandler;
/**
* This is a bunch of Functions my TileEntities provide, to make life much easier, and to get rid of internal TileEntity stuff.
*
* This also makes access to adjacent TileEntities more Efficient.
*
* Note: It doesn't have to be a TileEntity in certain cases! And only certain cases, such as the Recipe checking of the findRecipe Function.
*/
public interface IHasWorldObjectAndCoords {
public World getWorld();
public int getXCoord();
public short getYCoord();
public int getZCoord();
public boolean isServerSide();
public boolean isClientSide();
public int getRandomNumber(int aRange);
public TileEntity getTileEntity(int aX, int aY, int aZ);
public TileEntity getTileEntityOffset(int aX, int aY, int aZ);
public TileEntity getTileEntityAtSide(byte aSide);
public TileEntity getTileEntityAtSideAndDistance(byte aSide, int aDistance);
public IInventory getIInventory(int aX, int aY, int aZ);
public IInventory getIInventoryOffset(int aX, int aY, int aZ);
public IInventory getIInventoryAtSide(byte aSide);
public IInventory getIInventoryAtSideAndDistance(byte aSide, int aDistance);
public IFluidHandler getITankContainer(int aX, int aY, int aZ);
public IFluidHandler getITankContainerOffset(int aX, int aY, int aZ);
public IFluidHandler getITankContainerAtSide(byte aSide);
public IFluidHandler getITankContainerAtSideAndDistance(byte aSide, int aDistance);
public IGregTechTileEntity getIGregTechTileEntity(int aX, int aY, int aZ);
public IGregTechTileEntity getIGregTechTileEntityOffset(int aX, int aY, int aZ);
public IGregTechTileEntity getIGregTechTileEntityAtSide(byte aSide);
public IGregTechTileEntity getIGregTechTileEntityAtSideAndDistance(byte aSide, int aDistance);
public Block getBlock(int aX, int aY, int aZ);
public Block getBlockOffset(int aX, int aY, int aZ);
public Block getBlockAtSide(byte aSide);
public Block getBlockAtSideAndDistance(byte aSide, int aDistance);
public byte getMetaID(int aX, int aY, int aZ);
public byte getMetaIDOffset(int aX, int aY, int aZ);
public byte getMetaIDAtSide(byte aSide);
public byte getMetaIDAtSideAndDistance(byte aSide, int aDistance);
public byte getLightLevel(int aX, int aY, int aZ);
public byte getLightLevelOffset(int aX, int aY, int aZ);
public byte getLightLevelAtSide(byte aSide);
public byte getLightLevelAtSideAndDistance(byte aSide, int aDistance);
public boolean getOpacity(int aX, int aY, int aZ);
public boolean getOpacityOffset(int aX, int aY, int aZ);
public boolean getOpacityAtSide(byte aSide);
public boolean getOpacityAtSideAndDistance(byte aSide, int aDistance);
public boolean getSky(int aX, int aY, int aZ);
public boolean getSkyOffset(int aX, int aY, int aZ);
public boolean getSkyAtSide(byte aSide);
public boolean getSkyAtSideAndDistance(byte aSide, int aDistance);
public boolean getAir(int aX, int aY, int aZ);
public boolean getAirOffset(int aX, int aY, int aZ);
public boolean getAirAtSide(byte aSide);
public boolean getAirAtSideAndDistance(byte aSide, int aDistance);
public BiomeGenBase getBiome();
public BiomeGenBase getBiome(int aX, int aZ);
public int getOffsetX(byte aSide, int aMultiplier);
public short getOffsetY(byte aSide, int aMultiplier);
public int getOffsetZ(byte aSide, int aMultiplier);
/**
* Checks if the TileEntity is Invalid or Unloaded. Stupid Minecraft cannot do that btw.
*/
public boolean isDead();
/**
* Sends a Block Event to the Client TileEntity, the byte Parameters are only for validation as Minecraft doesn't properly write Packet Data.
*/
public void sendBlockEvent(byte aID, byte aValue);
/**
* @return the Time this TileEntity has been loaded.
*/
public long getTimer();
/**
* Sets the Light Level of this Block on a Scale of 0 - 15
* It could be that it doesn't work. This is just for convenience.
*/
public void setLightValue(byte aLightValue);
/**
* Function of the regular TileEntity
*/
public void writeToNBT(NBTTagCompound aNBT);
/**
* Function of the regular TileEntity
*/
public void readFromNBT(NBTTagCompound aNBT);
/**
* Function of the regular TileEntity
*/
public boolean isInvalidTileEntity();
/**
* Opens the GUI with this ID of this MetaTileEntity
*/
public boolean openGUI(EntityPlayer aPlayer, int aID);
/**
* Opens the GUI with the ID = 0 of this TileEntity
*/
public boolean openGUI(EntityPlayer aPlayer);
}
|