-
Notifications
You must be signed in to change notification settings - Fork 79
/
IBitAccess.java
126 lines (115 loc) · 3.1 KB
/
IBitAccess.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
package mod.chiselsandbits.api;
import mod.chiselsandbits.api.APIExceptions.SpaceOccupied;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
/**
* Do not implement, acquire from {@link IChiselAndBitsAPI}
*/
public interface IBitAccess
{
/**
* Request a summary of the contents of a range of bits, all range values
* are clamped to 0 - 15.
*
* @param a
* @param b
* @return summary of the contents of the range.
*/
BitQueryResults queryBitRange(
BlockPos a,
BlockPos b );
/**
* Process each bit in the {@link IBitAccess} and return a new bit in its
* place, can be used to optimize large changes, or iteration.
*
* @param visitor
*/
void visitBits(
IBitVisitor visitor );
/**
* Returns the bit at the specific location, this should always return a
* valid IBitBrush, never null.
*
* @param x
* @param y
* @param z
* @return
*/
IBitBrush getBitAt(
int x,
int y,
int z );
/**
* Sets the bit at the specific location, if you pass null it will use use
* air.
*
* @param x
* @param y
* @param z
* @param bit
* @throws SpaceOccupied
*/
void setBitAt(
int x,
int y,
int z,
IBitBrush bit ) throws SpaceOccupied;
/**
* Any time you modify a block you must commit your changes for them to take
* affect, optionally you can trigger updates or not.
*
* If the {@link IBitAccess} is not in the world this method does nothing.
*
* @param triggerUpdates
* normally true, only use false if your doing something special.
*/
void commitChanges(
boolean triggerUpdates );
/**
* Any time you modify a block you must commit your changes for them to take
* affect, please move to above method and specify true to prepare for
* future removal.
*
* If the {@link IBitAccess} is not in the world this method does nothing.
*/
@Deprecated
void commitChanges();
/**
* Returns an ItemStack for the {@link IBitAccess}
*
* Usable for any {@link IBitAccess}
*
* @param side
* angle the player is looking at, can be null.
* @param type
* what type of item to give.
* @param crossWorld
* determines if the NBT for the ItemStack is specific to this world
* or if it is portable, cross world NBT is larger and slower,
* you should only request cross world NBT if you specifically
* need it.
* @return an ItemStack for bits, which is empty if there are no bits.
*/
ItemStack getBitsAsItem(
EnumFacing side,
ItemType type,
boolean crossWorld );
/**
* Returns an ItemStack for the {@link IBitAccess}, this method all ways returns
* non-cross world NBT, please move to the above method and specify false to
* prepare for future removal.
*
* Usable for any {@link IBitAccess}
*
* @param side
* angle the player is looking at, can be null.
* @param type
* what type of item to give.
* @return an ItemStack for bits, which is empty if there are no bits.
*/
@Deprecated
ItemStack getBitsAsItem(
EnumFacing side,
ItemType type );
}