-
Notifications
You must be signed in to change notification settings - Fork 4
/
VillageDefense.java
43 lines (33 loc) · 1.02 KB
/
VillageDefense.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
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import plugily.projects.villagedefense.api.event.game.VillageGameStateChangeEvent;
import xyz.derkades.ssx_connector.Addon;
public class VillageDefense extends Addon {
private String state;
private String arena;
@Override
public String getAuthor() {
return "Lmmb74";
}
@Override
public String getDescription() {
return "Addon for the minigame VillageDefense by Plugily-Projects";
}
@Override
public String getVersion() {
return "1.0.0";
}
@Override
public void onLoad() {
this.registerListeners();
this.state = "Unknown";
this.addPlaceholder("vd-state", () -> this.config.getString(this.state));
this.arena = "Unknown";
this.addPlaceholder("vd-arena", () -> this.arena);
}
@EventHandler(priority = EventPriority.MONITOR)
public void onStateChange(final VillageGameStateChangeEvent e) {
this.state = e.getArenaState().getFormattedName();
this.arena = e.getArena().getMapName();
}
}