1616 * Backwards compatibility is maintained to the maximum extend possible.
1717 */
1818public abstract class StructureEvent extends Event {
19- private final World world ;
20- private final int x , y , z ;
2119 /*
2220 * In case the event is passed to another thread for processing.
2321 */
2422 private final Object identifier = StructureLibAPI .instrument .get ();
2523
26- StructureEvent (World world , int x , int y , int z ) {
27- this .world = world ;
28- this .x = x ;
29- this .y = y ;
30- this .z = z ;
31- }
32-
33- /**
34- * Location of this event.
35- */
36- public World getWorld () {
37- return world ;
38- }
39-
40- /**
41- * Location of this event. Absolute world coordinate.
42- */
43- public int getX () {
44- return x ;
45- }
46-
47- /**
48- * Location of this event. Absolute world coordinate.
49- */
50- public int getY () {
51- return y ;
52- }
53-
54- /**
55- * Location of this event. Absolute world coordinate.
56- */
57- public int getZ () {
58- return z ;
59- }
24+ StructureEvent () {}
6025
6126 /**
6227 * The instrument identifier. Subscribers should filter by these identifiers to prevent listening to a structure
@@ -70,6 +35,8 @@ public Object getInstrumentIdentifier() {
7035 * Fired <b>just before</b> any structure element is visited.
7136 */
7237 public static final class StructureElementVisitedEvent extends StructureEvent {
38+ private final World world ;
39+ private final int x , y , z ;
7340 private final int a , b , c ;
7441 private final IStructureElement <?> element ;
7542
@@ -93,7 +60,10 @@ public static void fireEvent(
9360
9461 StructureElementVisitedEvent (
9562 World world , int x , int y , int z , int a , int b , int c , IStructureElement <?> element ) {
96- super (world , x , y , z );
63+ this .world = world ;
64+ this .x = x ;
65+ this .y = y ;
66+ this .z = z ;
9767 this .a = a ;
9868 this .b = b ;
9969 this .c = c ;
@@ -146,5 +116,33 @@ public String toString() {
146116 + getY () + ", z="
147117 + getZ () + '}' ;
148118 }
119+
120+ /**
121+ * Location of this event.
122+ */
123+ public World getWorld () {
124+ return world ;
125+ }
126+
127+ /**
128+ * Location of this event. Absolute world coordinate.
129+ */
130+ public int getX () {
131+ return x ;
132+ }
133+
134+ /**
135+ * Location of this event. Absolute world coordinate.
136+ */
137+ public int getY () {
138+ return y ;
139+ }
140+
141+ /**
142+ * Location of this event. Absolute world coordinate.
143+ */
144+ public int getZ () {
145+ return z ;
146+ }
149147 }
150148}
0 commit comments