Yo norbi this is pretty cool
This commit is contained in:
parent
848811dbfb
commit
7dfb9a9c72
2 changed files with 62 additions and 60 deletions
|
@ -1,35 +1,34 @@
|
|||
package alisolarflare.uhc;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class AddToUHC implements CommandExecutor{
|
||||
private UHCMemoryUnit generalMemory;
|
||||
|
||||
public AddToUHC(UHCSubPlugin uhcSubPlugin){
|
||||
this.generalMemory = uhcSubPlugin.generalMemory;
|
||||
}
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player)){
|
||||
sender.sendMessage("You must be a player to use this command!");
|
||||
return false;
|
||||
}
|
||||
Player player = (Player) sender;
|
||||
if (player.getName() != "alisolarflare"){
|
||||
sender.sendMessage("You must be Ali to use this command, send her a message to change the permissions");
|
||||
return false;
|
||||
}
|
||||
if (args.length <= 1){
|
||||
sender.sendMessage("You must supply at least one playername");
|
||||
}
|
||||
|
||||
for (int i = 0; i > args.length; i++){
|
||||
//TO BE CONTINUED
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
package alisolarflare.uhc;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class AddToUHC implements CommandExecutor{
|
||||
private UHCMemoryUnit generalMemory;
|
||||
|
||||
public AddToUHC(UHCSubPlugin uhcSubPlugin){
|
||||
this.generalMemory = uhcSubPlugin.generalMemory;
|
||||
}
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player)){
|
||||
sender.sendMessage("You must be a player to use this command!");
|
||||
return false;
|
||||
}
|
||||
Player player = (Player) sender;
|
||||
if (player.getName() != "alisolarflare"){
|
||||
sender.sendMessage("You must be Ali to use this command, send her a message to change the permissions");
|
||||
return false;
|
||||
}
|
||||
if (args.length <= 1){
|
||||
sender.sendMessage("You must supply at least one playername");
|
||||
}
|
||||
for (int i = 0; i > args.length; i++){
|
||||
generalMemory.addPlayerToMatch(player);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,25 +1,28 @@
|
|||
package alisolarflare.uhc;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class UHCMemoryUnit {
|
||||
private List<Player> matchPlayers = new ArrayList<Player>();
|
||||
|
||||
public void addPlayerToMatch(Player player){
|
||||
matchPlayers.add(player);
|
||||
}
|
||||
public void removePlayerFromMatch(Player player){
|
||||
if (matchPlayers.contains(player)){
|
||||
matchPlayers.remove(player);
|
||||
}
|
||||
}
|
||||
public void removeAllPlayersFromMatch(){
|
||||
matchPlayers.clear();
|
||||
}
|
||||
public void endMatch(){
|
||||
matchPlayers.clear();
|
||||
}
|
||||
}
|
||||
package alisolarflare.uhc;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class UHCMemoryUnit {
|
||||
private List<String> matchPlayerUsernames = new ArrayList<String>();
|
||||
|
||||
public void addPlayerToMatch(String playername){
|
||||
matchPlayerUsernames.add(playername);
|
||||
}
|
||||
public void addPlayerToMatch(Player player){
|
||||
matchPlayerUsernames.add(player.toString());
|
||||
}
|
||||
public void removePlayerFromMatch(Player player){
|
||||
if (matchPlayerUsernames.contains(player)){
|
||||
matchPlayerUsernames.remove(player.toString());
|
||||
}
|
||||
}
|
||||
public void removeAllPlayersFromMatch(){
|
||||
matchPlayerUsernames.clear();
|
||||
}
|
||||
public void endMatch(){
|
||||
matchPlayerUsernames.clear();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue