commented out a *SHIT TON* of code

This commit is contained in:
alisolarflare 2016-11-24 21:48:27 -05:00
parent 63a6c775a4
commit 6d0ee4e224
20 changed files with 269 additions and 286 deletions

View file

@ -2,7 +2,7 @@ package alisolarflare.components.alilinks.commands;
import java.util.List;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import alisolarflare.components.PlayerCommand;
@ -18,9 +18,9 @@ public class PressAliLink extends PlayerCommand {
}
@Override
public boolean OnCommand(CommandSender sender, String label, String[] inputFrequencies) {
public boolean OnCommand(Player player, String label, String[] inputFrequencies) {
if (inputFrequencies.length < 1) {
sender.sendMessage("You must specify a link frequency");
player.sendMessage("You must specify a link frequency");
return false;
}
@ -31,7 +31,7 @@ public class PressAliLink extends PlayerCommand {
}
}
}
sender.sendMessage("Link pressed!");
player.sendMessage("Link pressed!");
return true;
}
@Override

View file

@ -5,7 +5,6 @@ import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
@ -24,12 +23,10 @@ public class SetAliLink extends PlayerCommand {
}
@Override
public boolean OnCommand(CommandSender sender, String label, String[] args) {
Player player = (Player) sender;
player.sendMessage("you pressed");
public boolean OnCommand(Player player, String label, String[] args) {
if (args == null || args.length < 1) {
sender.sendMessage("You must specify a link frequency");
sender.sendMessage("/pressalilink [name]");
player.sendMessage("You must specify a link frequency");
player.sendMessage("/pressalilink [name]");
return false;
}

View file

@ -1,6 +1,6 @@
package alisolarflare.components.creativeboundaries.commands;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import alisolarflare.components.ModCommand;
import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent;
@ -13,19 +13,19 @@ public class SetDickmode extends ModCommand{
}
@Override
public boolean OnCommand(CommandSender sender, String label, String[] args) {
public boolean OnCommand(Player player, String label, String[] args) {
if(args.length < 1){
sender.sendMessage("You must use True, False, 1, or 0 as arguments!");
player.sendMessage("You must use True, False, 1, or 0 as arguments!");
return false;
}
String firstArgument = args[0];
if(firstArgument.startsWith("t") || firstArgument.equals("1")){
sender.sendMessage("Dickmode has been turned on!");
player.sendMessage("Dickmode has been turned on!");
dickMode = true;
return true;
}
if(firstArgument.startsWith("f") || firstArgument.equals("0")){
sender.sendMessage("Dickmode has been turned off!");
player.sendMessage("Dickmode has been turned off!");
dickMode = false;
return true;
}

View file

@ -1,6 +1,5 @@
package alisolarflare.components.easyuhc.commands;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import alisolarflare.components.ModCommand;
@ -13,8 +12,8 @@ public class SetUHCLobby extends ModCommand{
}
@Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
module.lobbyLocation = ((Player) sender).getLocation();
public boolean OnCommand(Player player, String alias, String[] args) {
module.lobbyLocation = player.getLocation();
return false;
}

View file

@ -1,13 +1,13 @@
package alisolarflare.components.easyuhc.commands;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import alisolarflare.components.ModCommand;
public class SetWorldBorders extends ModCommand {
@Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
public boolean OnCommand(Player player, String alias, String[] args) {
return false;
}

View file

@ -1,13 +1,13 @@
package alisolarflare.components.easyuhc.commands;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import alisolarflare.components.ModCommand;
public class ShrinkWorldBorders extends ModCommand {
@Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
public boolean OnCommand(Player player, String alias, String[] args) {
// TODO Auto-generated method stub
return false;
}

View file

@ -1,13 +1,13 @@
package alisolarflare.components.easyuhc.commands;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import alisolarflare.components.ModCommand;
public class SpreadPlayers extends ModCommand{
@Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
public boolean OnCommand(Player player, String alias, String[] args) {
// TODO Auto-generated method stub
return false;
}

View file

@ -1,13 +1,13 @@
package alisolarflare.components.easyuhc.commands;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import alisolarflare.components.ModCommand;
public class StartTimer extends ModCommand{
@Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
public boolean OnCommand(Player player, String alias, String[] args) {
// TODO Auto-generated method stub
return false;
}

View file

@ -1,13 +1,13 @@
package alisolarflare.components.easyuhc.commands;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import alisolarflare.components.ModCommand;
public class StartUHC extends ModCommand{
@Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
public boolean OnCommand(Player player, String alias, String[] args) {
// TODO Auto-generated method stub
return false;
}

View file

@ -1,13 +1,13 @@
package alisolarflare.components.easyuhc.commands;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import alisolarflare.components.PlayerCommand;
public class TeleportToUHC extends PlayerCommand{
@Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
public boolean OnCommand(Player player, String alias, String[] args) {
// TODO Auto-generated method stub
return false;
}

View file

@ -1,6 +1,5 @@
package alisolarflare.components.flairdoor.commands;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import alisolarflare.components.ModCommand;
@ -15,13 +14,11 @@ public class SetProximityLocation extends ModCommand{
}
@Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
public boolean OnCommand(Player player, String alias, String[] args) {
if (args.length < 1){
sender.sendMessage("You must enter an argument");
player.sendMessage("You must enter an argument");
return false;
}
Player player = (Player) sender;
String firstChar = args[0].substring(0, 1);
switch(firstChar){

View file

@ -1,6 +1,6 @@
package alisolarflare.components.gpowers.commands;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import alisolarflare.components.ModCommand;
import alisolarflare.components.gpowers.GPowerMemory;
@ -13,7 +13,7 @@ public class PowerAll extends ModCommand{
this.gPowerMemory = gPowerMemory;
}
@Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
public boolean OnCommand(Player player, String alias, String[] args) {
for (poweredPlayer poweredPlayer : gPowerMemory.poweredPlayerList.values()){
poweredPlayer.isPowersActive = true;
}

View file

@ -1,6 +1,5 @@
package alisolarflare.components.gpowers.commands;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import alisolarflare.components.PlayerCommand;
@ -15,8 +14,7 @@ public class PowerDown extends PlayerCommand {
}
@Override
public boolean OnCommand(CommandSender sender, String label, String[] args) {
Player player = (Player) sender;
public boolean OnCommand(Player player, String label, String[] args) {
gPowerMemory.PowerDownPlayer(player);
return true;
}

View file

@ -1,6 +1,5 @@
package alisolarflare.components.gpowers.commands;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import alisolarflare.components.PlayerCommand;
@ -15,11 +14,7 @@ public class PowerUp extends PlayerCommand {
}
@Override
public boolean OnCommand(CommandSender sender, String label, String[] args) {
if (!(sender instanceof Player))
sender.sendMessage("You must be a player to use this command! Contact a dev/ali if you think this is wrong");
Player player = (Player) sender;
public boolean OnCommand(Player player, String label, String[] args) {
gPowerMemory.PowerUpPlayer(player);
return true;
}

View file

@ -1,6 +1,5 @@
package alisolarflare.components.minigames.commands;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import alisolarflare.components.ModCommand;
@ -13,11 +12,9 @@ public class SetColourSpawn extends ModCommand{
this.spawnSet = spawnSet;
}
@Override
public boolean OnCommand(CommandSender sender, String label, String[] args) {
Player player = (Player) sender;
public boolean OnCommand(Player player, String label, String[] args) {
if(args.length == 0){
sender.sendMessage("ERROR: Arguments required.");
player.sendMessage("ERROR: Arguments required.");
return false;
}
@ -26,34 +23,34 @@ public class SetColourSpawn extends ModCommand{
input.toLowerCase();
switch(input){
case ("r"):
sender.sendMessage("Setting Red Spawn...");
player.sendMessage("Setting Red Spawn...");
spawnSet.setRSpawn(player.getLocation());
sender.sendMessage("Red Spawn Set!");
player.sendMessage("Red Spawn Set!");
break;
case ("o"):
sender.sendMessage("Setting Orange Spawn...");
player.sendMessage("Setting Orange Spawn...");
spawnSet.setRSpawn(player.getLocation());
sender.sendMessage("Orange Spawn Set!");
player.sendMessage("Orange Spawn Set!");
break;
case ("y"):
sender.sendMessage("Setting Yellow Spawn...");
player.sendMessage("Setting Yellow Spawn...");
spawnSet.setRSpawn(player.getLocation());
sender.sendMessage("Yellow Spawn Set!");
player.sendMessage("Yellow Spawn Set!");
break;
case ("g"):
sender.sendMessage("Setting Green Spawn...");
player.sendMessage("Setting Green Spawn...");
spawnSet.setRSpawn(player.getLocation());
sender.sendMessage("Green Spawn Set!");
player.sendMessage("Green Spawn Set!");
break;
case ("b"):
sender.sendMessage("Setting Blue Spawn...");
player.sendMessage("Setting Blue Spawn...");
spawnSet.setRSpawn(player.getLocation());
sender.sendMessage("Blue Spawn Set!");
player.sendMessage("Blue Spawn Set!");
break;
case ("p"):
sender.sendMessage("Setting Purple Spawn...");
player.sendMessage("Setting Purple Spawn...");
spawnSet.setRSpawn(player.getLocation());
sender.sendMessage("Purple Spawn Set!");
player.sendMessage("Purple Spawn Set!");
break;
}
return true;

View file

@ -1,30 +1,30 @@
package graveyard.autouhc;
import org.bukkit.plugin.java.JavaPlugin;
import alisolarflare.components.Component;
import graveyard.autouhc.memory.MatchState;
import graveyard.autouhc.memory.UHCMatch;
/**@deprecated*/
public class UHCModule extends Component {
public UHCMatch match;
public void register(JavaPlugin plugin) {
if (plugin.getConfig().contains("UHCMatchState")){
match = new UHCMatch(plugin.getConfig(), MatchState.valueOf(plugin.getConfig().getString("UHCMatchState")));
}else{
match = new UHCMatch(plugin.getConfig(), MatchState.IDLE);
}
//registerCommand(plugin, new SetMatchState(match));
//registerCommand(plugin, new AddToUHC(match));
//registerCommand(plugin, new JoinUHC(match));
//registerCommand(plugin, new StartMatch(match));
//registerCommand(plugin, new ConfigureMatch(match));
//registerCommand(plugin, new ScheduleMatch(match));
}
}
//package graveyard.autouhc;
//import org.bukkit.plugin.java.JavaPlugin;
//
//import alisolarflare.components.Component;
//import graveyard.autouhc.memory.MatchState;
//import graveyard.autouhc.memory.UHCMatch;
//
///**@deprecated*/
//public class UHCModule extends Component {
// public UHCMatch match;
//
// public void register(JavaPlugin plugin) {
//
//
// if (plugin.getConfig().contains("UHCMatchState")){
// match = new UHCMatch(plugin.getConfig(), MatchState.valueOf(plugin.getConfig().getString("UHCMatchState")));
// }else{
// match = new UHCMatch(plugin.getConfig(), MatchState.IDLE);
// }
//
//
// //registerCommand(plugin, new SetMatchState(match));
// //registerCommand(plugin, new AddToUHC(match));
// //registerCommand(plugin, new JoinUHC(match));
// //registerCommand(plugin, new StartMatch(match));
// //registerCommand(plugin, new ConfigureMatch(match));
// //registerCommand(plugin, new ScheduleMatch(match));
//
// }
//}

View file

@ -1,71 +1,71 @@
package graveyard.autouhc.controller;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import alisolarflare.components.ModCommand;
import graveyard.autouhc.memory.MatchState;
import graveyard.autouhc.memory.UHCMatch;
/**@deprecated*/
public class SetMatchState extends ModCommand{
UHCMatch match;
public SetMatchState(UHCMatch match) {
this.match = match;
}
@Override
public boolean OnCommand(CommandSender sender, String alias, 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().equalsIgnoreCase("alisolarflare") && player.getName().equalsIgnoreCase("Arsen_Derby_FTW")){
sender.sendMessage("You must be either Ali or Arsen to use this command!");
return false;
}
if(args.length < 1 ){
player.sendMessage("Usage: /setMatchState [stateToBeSet]");
player.sendMessage("States: IDLE, WAITING, SETUP, INTRO, PEACE, POWER, TENSION, END");
return false;
}
String inputState = args[0];
boolean inputIsValidState = false;
for (MatchState defaultMatchState : MatchState.values()){
if(inputState.equalsIgnoreCase(defaultMatchState.toString())){
inputIsValidState = true;
}
}
if (inputIsValidState){
match.setMatchState(MatchState.valueOf(inputState));
player.sendMessage("Match State set to: " + match.getMatchState().toString() + "!");
}else{
player.sendMessage("Error, could not parse state.");
player.sendMessage("Valid States: IDLE, WAITING, SETUP, INTRO, PEACE, POWER, TENSION, END");
return false;
}
return false;
}
@Override
public boolean GetPlayerOnly() {
// TODO Auto-generated method stub
return true;
}
@Override
public boolean GetModOnly() {
// TODO Auto-generated method stub
return false;
}
}
//package graveyard.autouhc.controller;
//
//import org.bukkit.command.CommandSender;
//import org.bukkit.entity.Player;
//
//import alisolarflare.components.ModCommand;
//import graveyard.autouhc.memory.MatchState;
//import graveyard.autouhc.memory.UHCMatch;
///**@deprecated*/
//public class SetMatchState extends ModCommand{
//
// UHCMatch match;
// public SetMatchState(UHCMatch match) {
// this.match = match;
// }
//
// @Override
// public boolean OnCommand(CommandSender sender, String alias, 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().equalsIgnoreCase("alisolarflare") && player.getName().equalsIgnoreCase("Arsen_Derby_FTW")){
// sender.sendMessage("You must be either Ali or Arsen to use this command!");
// return false;
// }
//
//
// if(args.length < 1 ){
// player.sendMessage("Usage: /setMatchState [stateToBeSet]");
// player.sendMessage("States: IDLE, WAITING, SETUP, INTRO, PEACE, POWER, TENSION, END");
// return false;
// }
//
// String inputState = args[0];
// boolean inputIsValidState = false;
// for (MatchState defaultMatchState : MatchState.values()){
// if(inputState.equalsIgnoreCase(defaultMatchState.toString())){
// inputIsValidState = true;
// }
// }
//
// if (inputIsValidState){
// match.setMatchState(MatchState.valueOf(inputState));
// player.sendMessage("Match State set to: " + match.getMatchState().toString() + "!");
// }else{
// player.sendMessage("Error, could not parse state.");
// player.sendMessage("Valid States: IDLE, WAITING, SETUP, INTRO, PEACE, POWER, TENSION, END");
// return false;
// }
//
//
// return false;
// }
//
// @Override
// public boolean GetPlayerOnly() {
// // TODO Auto-generated method stub
// return true;
// }
//
// @Override
// public boolean GetModOnly() {
// // TODO Auto-generated method stub
// return false;
// }
//
//}

View file

@ -1,19 +1,19 @@
package graveyard.autouhc.intro;
import org.bukkit.command.CommandSender;
import alisolarflare.components.ModCommand;
import graveyard.autouhc.memory.UHCMatch;
/**@deprecated*/
public class ScheduleMatch extends ModCommand{
public ScheduleMatch(UHCMatch match) {
// TODO Auto-generated constructor stub
}
@Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
// TODO Auto-generated method stub
return false;
}
}
//package graveyard.autouhc.intro;
//
//import org.bukkit.command.CommandSender;
//
//import alisolarflare.components.ModCommand;
//import graveyard.autouhc.memory.UHCMatch;
///**@deprecated*/
//public class ScheduleMatch extends ModCommand{
//
// public ScheduleMatch(UHCMatch match) {
// // TODO Auto-generated constructor stub
// }
//
// @Override
// public boolean OnCommand(CommandSender sender, String alias, String[] args) {
// // TODO Auto-generated method stub
// return false;
// }
//}

View file

@ -1,52 +1,52 @@
package graveyard.autouhc.intro;
import org.bukkit.command.CommandSender;
import alisolarflare.components.ModCommand;
import graveyard.autouhc.memory.MatchState;
import graveyard.autouhc.memory.UHCMatch;
/**@deprecated*/
public class StartMatch extends ModCommand {
private UHCMatch match;
/**@deprecated*/
public StartMatch(UHCMatch match) {
this.match = match;
}
@Override
public boolean OnCommand(CommandSender sender, String label, String[] args) {
if (!sender.hasPermission("moderator") && !(sender.getName() == ""))
sender.sendMessage("You must be a moderator or Arsenalis to use this command! "
+ "Contact a TBMC dev if you think this is wrong");
//ACTIVATES MATCH
switch(match.getMatchState()){
case IDLE:
sender.sendMessage("There is currently a match ready... Activating...");
match.setMatchState(MatchState.INTRO);
break;
case WAITING:
sender.sendMessage("There currently a match planned for: TIME:TIME:TIME");
break;
case END:
sender.sendMessage("The match has ended! Would you like to restart using current settings?");
break;
default:
sender.sendMessage("You cannot start a match now, one is already in progress!");
}
return false;
}
@Override
public String GetCommandPath() {
return "startmatch";
}
}
//package graveyard.autouhc.intro;
//
//import org.bukkit.command.CommandSender;
//
//import alisolarflare.components.ModCommand;
//import graveyard.autouhc.memory.MatchState;
//import graveyard.autouhc.memory.UHCMatch;
//
///**@deprecated*/
//public class StartMatch extends ModCommand {
// private UHCMatch match;
// /**@deprecated*/
// public StartMatch(UHCMatch match) {
// this.match = match;
// }
//
// @Override
// public boolean OnCommand(CommandSender sender, String label, String[] args) {
//
// if (!sender.hasPermission("moderator") && !(sender.getName() == ""))
// sender.sendMessage("You must be a moderator or Arsenalis to use this command! "
// + "Contact a TBMC dev if you think this is wrong");
//
// //ACTIVATES MATCH
// switch(match.getMatchState()){
// case IDLE:
// sender.sendMessage("There is currently a match ready... Activating...");
// match.setMatchState(MatchState.INTRO);
// break;
//
// case WAITING:
// sender.sendMessage("There currently a match planned for: TIME:TIME:TIME");
// break;
//
// case END:
// sender.sendMessage("The match has ended! Would you like to restart using current settings?");
// break;
//
// default:
// sender.sendMessage("You cannot start a match now, one is already in progress!");
// }
//
// return false;
//
//
// }
//
// @Override
// public String GetCommandPath() {
// return "startmatch";
// }
//}

View file

@ -1,51 +1,51 @@
package graveyard.autouhc.memory;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.configuration.file.FileConfiguration;
/**@deprecated*/
public class UHCMatch {
private FileConfiguration config;
private MatchState matchState = MatchState.IDLE;
private List<String> playerList = new ArrayList<String>();
private Location lobbyLocation;
public UHCMatch(FileConfiguration fileConfiguration, MatchState state) {
this.config = fileConfiguration;
this.matchState = state;
}
public MatchState getMatchState(){
return matchState;
}
public void setMatchState(MatchState newMS){
matchState = newMS;
config.set("UHCMatchState", newMS.toString());
switch(newMS){
default:
break;
}
}
public List<String> getPlayerList() {
return playerList;
}
public void setPlayerList(List<String> playerList) {
this.playerList = playerList;
}
public Location getLobbyLocation() {
return lobbyLocation;
}
public void setLobbyLocation(Location lobbyLocation) {
this.lobbyLocation = lobbyLocation;
}
}
//package graveyard.autouhc.memory;
//
//import java.util.ArrayList;
//import java.util.List;
//
//import org.bukkit.Location;
//import org.bukkit.configuration.file.FileConfiguration;
//
///**@deprecated*/
//public class UHCMatch {
// private FileConfiguration config;
// private MatchState matchState = MatchState.IDLE;
// private List<String> playerList = new ArrayList<String>();
//
// private Location lobbyLocation;
// public UHCMatch(FileConfiguration fileConfiguration, MatchState state) {
// this.config = fileConfiguration;
// this.matchState = state;
// }
//
// public MatchState getMatchState(){
// return matchState;
// }
//
// public void setMatchState(MatchState newMS){
// matchState = newMS;
// config.set("UHCMatchState", newMS.toString());
// switch(newMS){
// default:
// break;
// }
// }
//
// public List<String> getPlayerList() {
// return playerList;
// }
//
// public void setPlayerList(List<String> playerList) {
// this.playerList = playerList;
// }
//
// public Location getLobbyLocation() {
//
// return lobbyLocation;
// }
//
// public void setLobbyLocation(Location lobbyLocation) {
// this.lobbyLocation = lobbyLocation;
// }
//
//}