55import net .minestom .server .entity .Player ;
66import net .minestom .server .event .Event ;
77import net .minestom .server .event .EventFilter ;
8- import net .minestom .server .instance .IChunkLoader ;
8+ import net .minestom .server .instance .ChunkLoader ;
99import net .minestom .server .instance .Instance ;
1010import net .minestom .server .instance .block .Block ;
1111import net .minestom .server .network .player .GameProfile ;
1212import org .jetbrains .annotations .Contract ;
13- import org .jetbrains .annotations .NotNull ;
1413import org .jetbrains .annotations .Nullable ;
1514
1615import java .time .Duration ;
@@ -86,7 +85,7 @@ default TestConnection createConnection() {
8685 * @param <H> the handler type
8786 * @return the {@link Collector} instance to use
8887 */
89- <E extends Event , H > Collector <E > trackEvent (Class <E > eventType , EventFilter <? super E , H > filter , @ NotNull H actor );
88+ <E extends Event , H > Collector <E > trackEvent (Class <E > eventType , EventFilter <? super E , H > filter , H actor );
9089
9190 /**
9291 * Listen for a specific event type in the test environment.
@@ -111,7 +110,7 @@ default void tick() {
111110 * @param timeout the maximum duration to wait for the condition to be met, or null for no timeout
112111 * @return true if the condition was met, false if the timeout was reached
113112 */
114- default boolean tickWhile (@ NotNull BooleanSupplier condition , @ Nullable Duration timeout ) {
113+ default boolean tickWhile (BooleanSupplier condition , @ Nullable Duration timeout ) {
115114 var ticker = process ().ticker ();
116115 final long start = System .nanoTime ();
117116 while (condition .getAsBoolean ()) {
@@ -131,7 +130,7 @@ default boolean tickWhile(@NotNull BooleanSupplier condition, @Nullable Duration
131130 * @param pos the position to spawn the player at
132131 * @return the created player
133132 */
134- default @ NotNull Player createPlayer (@ NotNull Instance instance , @ NotNull Pos pos ) {
133+ default Player createPlayer (Instance instance , Pos pos ) {
135134 return createConnection ().connect (instance , pos );
136135 }
137136
@@ -141,7 +140,7 @@ default boolean tickWhile(@NotNull BooleanSupplier condition, @Nullable Duration
141140 * @param instance the instance to spawn the player in
142141 * @return the created player
143142 */
144- default @ NotNull Player createPlayer (@ NotNull Instance instance ) {
143+ default Player createPlayer (Instance instance ) {
145144 return createPlayer (instance , Pos .ZERO );
146145 }
147146
@@ -150,7 +149,7 @@ default boolean tickWhile(@NotNull BooleanSupplier condition, @Nullable Duration
150149 *
151150 * @return the created instance
152151 */
153- default @ NotNull Instance createFlatInstance () {
152+ default Instance createFlatInstance () {
154153 return createFlatInstance (null );
155154 }
156155
@@ -160,18 +159,27 @@ default boolean tickWhile(@NotNull BooleanSupplier condition, @Nullable Duration
160159 * @param chunkLoader the chunk loader to use for the instance
161160 * @return the created instance
162161 */
163- default @ NotNull Instance createFlatInstance (@ Nullable IChunkLoader chunkLoader ) {
162+ default Instance createFlatInstance (@ Nullable ChunkLoader chunkLoader ) {
164163 var instance = process ().instance ().createInstanceContainer (chunkLoader );
165164 instance .setGenerator (unit -> unit .modifier ().fillHeight (0 , 40 , Block .STONE ));
166165 return instance ;
167166 }
168167
168+ /**
169+ * Creates a new {@link Instance} which is empty and can be used in the test environment.
170+ * @param chunkLoader the chunk loader to use for the instance
171+ * @return the created instance
172+ */
173+ default Instance createEmptyInstance (ChunkLoader chunkLoader ) {
174+ return process ().instance ().createInstanceContainer (chunkLoader );
175+ }
176+
169177 /**
170178 * Creates a new {@link Instance} which is empty and can be used in the test environment.
171179 *
172180 * @return the created instance
173181 */
174- default @ NotNull Instance createEmptyInstance () {
182+ default Instance createEmptyInstance () {
175183 return process ().instance ().createInstanceContainer ();
176184 }
177185
@@ -181,7 +189,7 @@ default boolean tickWhile(@NotNull BooleanSupplier condition, @Nullable Duration
181189 *
182190 * @param instance the instance to destroy
183191 */
184- default void destroyInstance (@ NotNull Instance instance ) {
192+ default void destroyInstance (Instance instance ) {
185193 destroyInstance (instance , false );
186194 }
187195
@@ -191,7 +199,7 @@ default void destroyInstance(@NotNull Instance instance) {
191199 * @param instance the instance to destroy
192200 * @param cleanUpPlayers whether to remove players from the instance
193201 */
194- default void destroyInstance (@ NotNull Instance instance , boolean cleanUpPlayers ) {
202+ default void destroyInstance (Instance instance , boolean cleanUpPlayers ) {
195203 if (cleanUpPlayers && !instance .getPlayers ().isEmpty ()) {
196204 instance .getPlayers ().forEach (Player ::remove );
197205 }
0 commit comments