21
21
import arc .math .Mathf ;
22
22
import arc .util .Interval ;
23
23
import arc .util .Time ;
24
- import com .xpdustry .distributor .api .DistributorProvider ;
24
+ import com .xpdustry .distributor .api .Distributor ;
25
25
import com .xpdustry .distributor .api .annotation .EventHandler ;
26
26
import com .xpdustry .distributor .api .collection .MindustryCollections ;
27
27
import com .xpdustry .distributor .api .plugin .PluginListener ;
@@ -64,7 +64,7 @@ public void onPluginInit() {
64
64
65
65
@ EventHandler
66
66
public void onPlayerJoin (final EventType .PlayerJoin event ) {
67
- DistributorProvider .get ().getEventBus ().post (new HexPlayerJoinEvent (event .player , true ));
67
+ Distributor .get ().getEventBus ().post (new HexPlayerJoinEvent (event .player , true ));
68
68
}
69
69
70
70
@ EventHandler
@@ -99,7 +99,7 @@ public void onPlayerJoin(final HexPlayerJoinEvent event) {
99
99
100
100
@ EventHandler
101
101
public void onPlayerLeave (final EventType .PlayerLeave event ) {
102
- DistributorProvider .get ().getEventBus ().post (new HexPlayerQuitEvent (event .player , event .player .team (), false ));
102
+ Distributor .get ().getEventBus ().post (new HexPlayerQuitEvent (event .player , event .player .team (), false ));
103
103
}
104
104
105
105
@ EventHandler
@@ -141,14 +141,14 @@ public void onPluginUpdate() {
141
141
if (oldController != newController && newController != null && newController != Team .derelict ) {
142
142
final var player = Groups .player .find (p -> p .team () == newController );
143
143
if (player != null ) {
144
- DistributorProvider .get ().getEventBus ().post (new HexCaptureEvent (player , hex ));
144
+ Distributor .get ().getEventBus ().post (new HexCaptureEvent (player , hex ));
145
145
}
146
146
}
147
147
148
148
if (oldController != newController && oldController != null && oldController != Team .derelict ) {
149
149
final var player = Groups .player .find (p -> p .team () == oldController );
150
150
if (player != null ) {
151
- DistributorProvider .get ().getEventBus ().post (new HexLostEvent (player , hex ));
151
+ Distributor .get ().getEventBus ().post (new HexLostEvent (player , hex ));
152
152
}
153
153
}
154
154
}
@@ -158,7 +158,7 @@ public void onPluginUpdate() {
158
158
for (final var player : Groups .player ) {
159
159
if (player .team () != Team .derelict && player .team ().cores ().isEmpty ()) {
160
160
final var oldTeam = player .team ();
161
- DistributorProvider .get ().getEventBus ().post (new HexPlayerQuitEvent (player , oldTeam , true ));
161
+ Distributor .get ().getEventBus ().post (new HexPlayerQuitEvent (player , oldTeam , true ));
162
162
}
163
163
164
164
if (player .team () == Team .derelict ) {
@@ -183,7 +183,7 @@ public void onPluginUpdate() {
183
183
private void killTeam (final Team team ) {
184
184
this .hexed .getHexedState0 ().setDying (team , true );
185
185
team .data ().destroyToDerelict ();
186
- DistributorProvider .get ()
186
+ Distributor .get ()
187
187
.getPluginScheduler ()
188
188
.schedule (this .hexed )
189
189
.delay (8 , MindustryTimeUnit .SECONDS )
@@ -199,7 +199,7 @@ private void endGame() {
199
199
.filter (team -> team != Team .derelict )
200
200
.collect (maxList (Comparator .comparingInt (
201
201
team -> this .hexed .getHexedState ().getControlled (team ).size ())));
202
- final var bus = DistributorProvider .get ().getEventBus ();
202
+ final var bus = Distributor .get ().getEventBus ();
203
203
bus .post (new GameOverEvent (winners .size () == 1 ? winners .get (0 ) : Team .derelict ));
204
204
bus .post (new HexedGameOverEvent (winners ));
205
205
}
0 commit comments