aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/bloodasp/galacticgreg/api/StructureInformation.java
blob: a053a9cbf627a645a88eeae2fbd5fd1850f58183 (plain)
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
package bloodasp.galacticgreg.api;

import bloodasp.galacticgreg.api.Enums.TargetBlockPosition;
import net.minecraft.util.Vec3;

/**
 * Structural information container. Holds X/Y/Z and block/meta information
 */
public class StructureInformation {
	private Vec3 _mCoordinates;
	private TargetBlockPosition _mBlockPosition;
	private BlockMetaComb _mBlockMetaComb;
	
	public TargetBlockPosition getBlockPosition()
	{
		return _mBlockPosition;
	}
	
	public int getX()
	{
		return (int) Math.round(_mCoordinates.xCoord);
	}
	
	public int getY()
	{
		return (int) Math.round(_mCoordinates.yCoord);
	}
	
	public int getZ()
	{
		return (int) Math.round(_mCoordinates.zCoord);
	}
	
	public BlockMetaComb getBlock()
	{
		return _mBlockMetaComb;
	}

	/**
	 * Init StructureInfo only with Coords and block position
	 * @param pCoordinates The coords in question
	 * @param pPosition The position-enum value
	 */
	public StructureInformation(Vec3 pCoordinates, TargetBlockPosition pPosition) {
		this(pCoordinates, pPosition, null);
	}
	
	/**
	 * Init StructureInfo with Coords, block position and a populated block/meta info
	 * @param pCoordinates The coords in question
	 * @param pPosition The position-enum value
	 * @param pTargetBlock The target block in question
	 */
	public StructureInformation(Vec3 pCoordinates, TargetBlockPosition pPosition, BlockMetaComb pTargetBlock) {
		_mCoordinates = pCoordinates;
		_mBlockPosition = pPosition;
		_mBlockMetaComb = pTargetBlock;
	}

}