@@ -116,6 +116,38 @@ public void start() {
116
116
player .addPotionEffect (new PotionEffect (PotionEffectType .BLINDNESS , 30 , 1 , true , true , false ));
117
117
}
118
118
}, 1 , Ticks .in (Duration .ofSeconds (123 )) - 17 );
119
+
120
+ // spawn nextbot.
121
+ scheduler .scheduleSyncRepeatingTask (this .plugin , () -> {
122
+ for (final Player player : this .worldService .getWorld (Realm .BACKROOMS ).getPlayers ()) {
123
+ if (RANDOM .nextFloat () > 0.05F ) {
124
+ continue ;
125
+ }
126
+
127
+ for (int dist = 24 ; dist < 33 ; dist ++) {
128
+ final var locPX = player .getLocation ().add (new Vector (dist , 0 , 0 ));
129
+ if (locPX .getBlock ().getType () == Material .AIR ) {
130
+ this .nate .createNextbot (Nextbot .Type .OBUNGA , locPX );
131
+ return ;
132
+ }
133
+ final var locNX = player .getLocation ().add (new Vector (-dist , 0 , 0 ));
134
+ if (locNX .getBlock ().getType () == Material .AIR ) {
135
+ this .nate .createNextbot (Nextbot .Type .OBUNGA , locNX );
136
+ return ;
137
+ }
138
+ final var locPZ = player .getLocation ().add (new Vector (0 , 0 , dist ));
139
+ if (locPZ .getBlock ().getType () == Material .AIR ) {
140
+ this .nate .createNextbot (Nextbot .Type .OBUNGA , locPZ );
141
+ return ;
142
+ }
143
+ final var locNZ = player .getLocation ().add (new Vector (0 , 0 , -dist ));
144
+ if (locNZ .getBlock ().getType () == Material .AIR ) {
145
+ this .nate .createNextbot (Nextbot .Type .OBUNGA , locNZ );
146
+ return ;
147
+ }
148
+ }
149
+ }
150
+ }, 1 , Ticks .in (Duration .ofSeconds (497 )) - 5 );
119
151
}
120
152
121
153
}
0 commit comments