use of au.com.mineauz.minigames.script.ScriptObject in project Minigames by AddstarMC.
the class BroadcastAction method executeNodeAction.
@Override
public void executeNodeAction(final MinigamePlayer player, final Node node) {
ScriptObject base = new ScriptObject() {
@Override
public Set<String> getKeys() {
return ImmutableSet.of("player", "area", "minigame", "team");
}
@Override
public String getAsString() {
return "";
}
@Override
public ScriptReference get(String name) {
if (name.equalsIgnoreCase("player")) {
return player;
} else if (name.equalsIgnoreCase("area")) {
return node;
} else if (name.equalsIgnoreCase("minigame")) {
return player.getMinigame();
} else if (name.equalsIgnoreCase("team")) {
return player.getTeam();
}
return null;
}
};
execute(player, base);
}
Aggregations