Firework API
Want to easily spawn fireworks without using lengthy builders? Then FireworkAPI is for you!
- 0
- February 13, 2014
Firework API
Want to easily spawn fireworks without using lengthy builders? Then FireworkAPI is for you!
- 0
- February 13, 2014
TeamAPI
TeamAPI is a small library that allows developers to create teams, store values, store custom data for players, and easily retrieve this data!
NONE
Add this API to your build path, and if you put the plugin on Bukkit, make sure to mark TeamAPI as a dependency.
List<Participant> players = new ArrayList<Participant>(); List<Team> team = new ArrayList<Team>();
TeamAPI api = new TeamAPI(); Team team = api.createTeam("Warrior", Color.BLUE); // Create a team with the name Warrior and blue armor
public void setArmor(Participant p){ Player player = p.getPlayer(); // get the player behind a participant ItemStack[] armor = p.getTeam().getArmor(); // get the team's armor player.setArmorContents(armor); }
public void addFivePoints(Participant p){ p.addPoints(5); }
// this assumes you have a Participant variable called p Integer points = p.getPoints();
public void takeFivePoints(Participant p){ p.removePoints(5); }
public void reset(Participant p){ p.resetPoints(); }
public String getTeamName(Team t){ return t.getColoredName(); }
public Integer getPoints(Team t){ return t.getPoints(); }
// this assumes you have a Team called t t.addPoints(10); // add 10 points t.removePoints(8); // remove 8 points t.resetPoints(); // reset their points
public void swapOut(Participant in, Participant out){ Team inTeam = in.getTeam(); Team outTeam = out.getTeam(); inTeam.addPlayer(out); // add out to in's team outTeam().addPlayer(in); // add in to out's team inTeam.removePlayer(in); // remove in from their team outTeam().removePlayer(out); // remove out from their team }
public Color byPlayer(Participant e){ return e.getTeam().getColor(); } public Color byTeam(Team t){ return t.getColor(); }
public List<Participant> byTeam(Team t){ return t.getPlayers(); } public List<Participant> byPlayer(Participant e){ return e.getTeam().getPlayers(); }
public Participant find(Player p, List<Participant> players){ TeamAPI api = new TeamAPI(); Participant e = api.findPlayer(players, p); return e; }
More examples will be added as needed!
Have a question? Post a comment!
Want to easily spawn fireworks without using lengthy builders? Then FireworkAPI is for you!
Want to easily spawn fireworks without using lengthy builders? Then FireworkAPI is for you!