Refactored code to make subcommands #23

Merged
alisolarflare merged 6 commits from Refactoring into master 2016-12-17 07:43:27 +00:00
40 changed files with 210 additions and 261 deletions

View file

@ -3,71 +3,23 @@ name: AliPresents
version: 2.0.2 version: 2.0.2
commands: commands:
flairme:
description: Activates the Flair Me Command. Ask Ali - she was tired when writing this description
gpower:
description: Testing command for ghostie powers
powerup:
description: Official g-power command that activates the ghostie powerups
powerdown:
description: Offical g-power command that deactivates the ghostie powerups
alilink: alilink:
description: Arguments - press or set description: creates wireless redstone
cbgm0: cashmob:
description: Creative Boundaries Gamemode 0 - allows players to return to survival description: creates mobs
cbgm1: cb:
description: Creative Boundaries Gamemode 1 - allows players to access creative within their towns. Creative is removed outside of towns so be careful description: creates creative boundaries
setforceboundaries: debug:
description: Should players automatically return to creative when outside town borders? Dickmode says yes. description: debug commands
joinminigame: flaircolour:
description: Join a Button Minigame description: flaaairs
leaveminigame: fruit:
description: Leave a button minigame description: fruits
listfighters: gpower:
description: List all fighters currently in a button minigame description: powerssss
setcolourspawn: insurance:
description: sets the spawn points for each colour in a button minigame description: item block insurance
setmatchstate: magic:
description: sets the current state of the ultrahardcore game. description: magic
addtouhc: metrics:
description: Adds a player to the UltraHardcore match description: metrics system
joinuhc:
description: This command allows you to join an UltraHardcore match
configurematch:
description: Configures an UltraHardcore match
schedulematch:
description: Schedules an UltraHardcore match
startmatch:
description: Starts an UltraHardcore match
spreadplayers:
description: Admin command that spreads players around an ultrahardcore match
teleporttouhc:
description: Teleports you to the ultrahardcore match
setuhclobby:
description: Sets the area where a uhc will take place
activatepowers:
description: Admin command that activates gpowers on a uhc
setworldborders:
description: sets the worldborders to a uhc match
startuhc:
description: starts an ultrahardcore match
starttimer:
description: starts an ultrahardcore timer
powerall:
description: activate every player's power
setproximitylocation:
description: sets one of two proximity blocks to create a space that players can change their flairs with using flairportals. Ask ali XD
getloginmetrics:
description: Gets metrics
getinsurance:
description: Gets insurance
getinsurancenugget:
description: Gets insurance nugget
getinsurancebar:
description: Gets insurance bar
getinsuranceblock:
description: Gets insurance block
createbankchest:
description: Creates a Bank Chest
getletterdye:
description: Creates Letter Dye

32
pom.xml
View file

@ -73,13 +73,13 @@
<url>https://jitpack.io</url> <url>https://jitpack.io</url>
</repository> </repository>
<repository> <repository>
<id>ess-repo</id> <id>ess-repo</id>
<url>http://repo.ess3.net/content/groups/essentials</url> <url>http://repo.ess3.net/content/groups/essentials</url>
</repository> </repository>
<repository> <repository>
<id>citizensnpcs</id> <id>citizensnpcs</id>
<url>http://repo.citizensnpcs.co/</url> <url>http://repo.citizensnpcs.co/</url>
</repository> </repository>
</repositories> </repositories>
<dependencies> <dependencies>
@ -100,14 +100,14 @@
<version>master-SNAPSHOT</version> <version>master-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.ess3</groupId> <groupId>net.ess3</groupId>
<artifactId>Essentials</artifactId> <artifactId>Essentials</artifactId>
<version>2.14-SNAPSHOT</version> <version>2.14-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.citizensnpcs</groupId> <groupId>net.citizensnpcs</groupId>
<artifactId>citizens-v1_11_R1</artifactId> <artifactId>citizens-v1_11_R1</artifactId>
<version>2.0.21-SNAPSHOT</version> <version>2.0.21-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View file

@ -7,12 +7,11 @@ import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import buttondevteam.alipresents.components.alilinks.AliLinkComponent; import buttondevteam.alipresents.components.alilinks.AliLinkComponent;
import buttondevteam.alipresents.components.bankchest.BankChestComponent;
import buttondevteam.alipresents.components.cashmob.CashMobComponent; import buttondevteam.alipresents.components.cashmob.CashMobComponent;
import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesComponent; import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesComponent;
import buttondevteam.alipresents.components.flaircolouring.FlairColouringComponent; import buttondevteam.alipresents.components.flaircolour.FlairColourComponent;
import buttondevteam.alipresents.components.fruit.FruitComponent; import buttondevteam.alipresents.components.fruit.FruitComponent;
import buttondevteam.alipresents.components.gpowers.GPowerComponent; import buttondevteam.alipresents.components.gpower.GPowerComponent;
import buttondevteam.alipresents.components.insurance.InsuranceComponent; import buttondevteam.alipresents.components.insurance.InsuranceComponent;
import buttondevteam.alipresents.components.magic.MagicComponent; import buttondevteam.alipresents.components.magic.MagicComponent;
import buttondevteam.alipresents.components.spawn.SpawnComponent; import buttondevteam.alipresents.components.spawn.SpawnComponent;
@ -26,10 +25,9 @@ public class AliPresents extends JavaPlugin{
new AliLinkComponent().register(this); new AliLinkComponent().register(this);
new BankChestComponent().register(this);
new CashMobComponent().register(this); new CashMobComponent().register(this);
new CreativeBoundariesComponent().register(this); new CreativeBoundariesComponent().register(this);
new FlairColouringComponent().register(this); new FlairColourComponent().register(this);
new FruitComponent().register(this); new FruitComponent().register(this);
new GPowerComponent().register(this); new GPowerComponent().register(this);
new InsuranceComponent().register(this); new InsuranceComponent().register(this);

View file

@ -12,7 +12,6 @@ public abstract class ModCommand extends PlayerCommand{
@Override @Override
public boolean GetModOnly() { public boolean GetModOnly() {
// TODO Auto-generated method stub
return true; return true;
} }
} }

View file

@ -7,24 +7,24 @@ import org.bukkit.entity.Player;
public abstract class PlayerCommand extends BaseCommand{ public abstract class PlayerCommand extends BaseCommand{
/**replaces CommandExecutor functionality*/ /**replaces CommandExecutor functionality*/
@Override @Override
public boolean onCommand(CommandSender commandSender, Command command, String string, String[] args){ public boolean onCommand(CommandSender sender, Command command, String string, String[] args){
return OnCommand(commandSender, string, args); sender.sendMessage("activating" + string.toString());
return OnCommand(sender, string, args);
} }
/**replaces TBMCCommandBase functionality*/ /**replaces TBMCCommandBase functionality*/
@Override @Override
public boolean OnCommand(CommandSender sender, String alias, String[] args){ public boolean OnCommand(CommandSender sender, String alias, String[] args){
sender.sendMessage("activating" + alias.toString());
return OnCommand((Player) sender, alias, args); return OnCommand((Player) sender, alias, args);
} }
public abstract boolean OnCommand(Player player, String alias, String[] args); public abstract boolean OnCommand(Player player, String alias, String[] args);
@Override @Override
public boolean GetPlayerOnly() { public boolean GetPlayerOnly() {
// TODO Auto-generated method stub
return true; return true;
} }
@Override @Override
public boolean GetModOnly() { public boolean GetModOnly() {
// TODO Auto-generated method stub
return false; return false;
} }
@Override @Override

View file

@ -1,15 +0,0 @@
package buttondevteam.alipresents.architecture.commands.subcommands;
public abstract class ModSubCommand extends SubCommand{
@Override
public boolean getPlayerOnly() {
// TODO Auto-generated method stub
return true;
}
@Override
public boolean getModOnly() {
// TODO Auto-generated method stub
return true;
}
}

View file

@ -1,16 +0,0 @@
package buttondevteam.alipresents.architecture.commands.subcommands;
public abstract class PlayerSubCommand extends SubCommand{
@Override
public boolean getModOnly() {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean getPlayerOnly() {
// TODO Auto-generated method stub
return true;
}
}

View file

@ -1,10 +0,0 @@
package buttondevteam.alipresents.architecture.commands.subcommands;
import org.bukkit.entity.Player;
public abstract class SubCommand {
public abstract boolean run(Player player, String label, String[] args);
public abstract boolean getPlayerOnly();
public abstract boolean getModOnly();
public abstract String[] GetHelpText(String alias);
}

View file

@ -3,11 +3,20 @@ package buttondevteam.alipresents.components.alilinks;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import buttondevteam.alipresents.architecture.Component; import buttondevteam.alipresents.architecture.Component;
import buttondevteam.alipresents.components.alilinks.commands.AliLink; import buttondevteam.alipresents.components.alilinks.commands.Press;
import buttondevteam.alipresents.components.alilinks.commands.Set;
public class AliLinkComponent extends Component { public class AliLinkComponent extends Component {
private static JavaPlugin p;
public static JavaPlugin getPlugin() {
return p;
}
@Override @Override
public void register(JavaPlugin plugin) { public void register(JavaPlugin plugin) {
registerCommand(plugin, new AliLink(plugin)); p = plugin;
registerCommand(plugin, new Press());
registerCommand(plugin, new Set());
} }
} }

View file

@ -1,34 +0,0 @@
package buttondevteam.alipresents.components.alilinks.commands;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import buttondevteam.alipresents.architecture.commands.PlayerCommand;
import buttondevteam.alipresents.components.alilinks.AliLinkAPI;
public class AliLink extends PlayerCommand{
private JavaPlugin plugin;
public AliLink(JavaPlugin plugin) {
this.plugin = plugin;
}
@Override
public boolean OnCommand(Player player, String alias, String[] inputFrequencies) {
if(inputFrequencies.length < 1)
return false;
switch (inputFrequencies[0].toLowerCase()){
case "press":
return AliLinkAPI.sendPressEvent(player, inputFrequencies, plugin);
case "set":
return AliLinkAPI.createAliLink(player, inputFrequencies);
default:
return false;
}
}
}

View file

@ -0,0 +1,21 @@
package buttondevteam.alipresents.components.alilinks.commands;
import org.bukkit.entity.Player;
import buttondevteam.alipresents.architecture.commands.PlayerCommand;
import buttondevteam.alipresents.components.alilinks.AliLinkAPI;
import buttondevteam.alipresents.components.alilinks.AliLinkComponent;
public class Press extends PlayerCommand {
@Override
public String GetCommandPath() {
return "alilink press";
}
@Override
public boolean OnCommand(Player player, String alias, String[] args) {
if (args.length < 1)
return false;
return AliLinkAPI.sendPressEvent(player, args, AliLinkComponent.getPlugin());
}
}

View file

@ -0,0 +1,20 @@
package buttondevteam.alipresents.components.alilinks.commands;
import org.bukkit.entity.Player;
import buttondevteam.alipresents.architecture.commands.ModCommand;
import buttondevteam.alipresents.components.alilinks.AliLinkAPI;
public class Set extends ModCommand {
@Override
public String GetCommandPath() {
return "alilink set";
}
@Override
public boolean OnCommand(Player player, String alias, String[] args) {
if (args.length < 1)
return false;
return AliLinkAPI.createAliLink(player, args);
}
}

View file

@ -1,15 +0,0 @@
package buttondevteam.alipresents.components.bankchest;
import org.bukkit.plugin.java.JavaPlugin;
import buttondevteam.alipresents.architecture.Component;
public class BankChestComponent extends Component {
@Override
public void register(JavaPlugin plugin) {
registerCommand(plugin, new CreateBankChest());
registerListener(plugin, new BankChestListener());
}
}

View file

@ -1,6 +0,0 @@
package buttondevteam.alipresents.components.bankchest;
import org.bukkit.event.Listener;
public class BankChestListener implements Listener {
}

View file

@ -1,15 +0,0 @@
package buttondevteam.alipresents.components.bankchest;
import org.bukkit.entity.Player;
import buttondevteam.alipresents.architecture.commands.ModCommand;
public class CreateBankChest extends ModCommand {
@Override
public boolean OnCommand(Player player, String alias, String[] args) {
// TODO Auto-generated method stub
return false;
}
}

View file

@ -6,6 +6,10 @@ import buttondevteam.alipresents.architecture.commands.PlayerCommand;
import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesAPI; import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesAPI;
public class Cbgm0 extends PlayerCommand{ public class Cbgm0 extends PlayerCommand{
@Override
public String GetCommandPath() {
return "cb gm1";
}
@Override @Override
public boolean OnCommand(Player player, String arg2, String[] arg3) { public boolean OnCommand(Player player, String arg2, String[] arg3) {
CreativeBoundariesAPI.toSurvival(player); CreativeBoundariesAPI.toSurvival(player);

View file

@ -6,6 +6,10 @@ import buttondevteam.alipresents.architecture.commands.PlayerCommand;
import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesAPI; import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesAPI;
public class Cbgm1 extends PlayerCommand { public class Cbgm1 extends PlayerCommand {
@Override
public String GetCommandPath() {
return "cb gm0";
}
@Override @Override
public boolean OnCommand(Player player, String arg2, String[] arg3) { public boolean OnCommand(Player player, String arg2, String[] arg3) {
return CreativeBoundariesAPI.toCreative(player); return CreativeBoundariesAPI.toCreative(player);

View file

@ -6,6 +6,11 @@ import buttondevteam.alipresents.architecture.commands.ModCommand;
import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesAPI; import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesAPI;
public class SetForceBoundaries extends ModCommand{ public class SetForceBoundaries extends ModCommand{
@Override
public String GetCommandPath() {
return "cb set forceboundaries";
}
@Override @Override
public boolean OnCommand(Player player, String label, String[] args) { public boolean OnCommand(Player player, String label, String[] args) {
return (CreativeBoundariesAPI.setForceBoundaries(player, args)); return (CreativeBoundariesAPI.setForceBoundaries(player, args));

View file

@ -1,10 +1,10 @@
package buttondevteam.alipresents.components.flaircolouring; package buttondevteam.alipresents.components.flaircolour;
import org.bukkit.DyeColor; import org.bukkit.DyeColor;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
public class FlairColouringAPI { public class FlairColourAPI {
public static void recolourPlayer(User user, DyeColor dyecolour){ public static void recolourPlayer(User user, DyeColor dyecolour){
String name = user._getNickname(); String name = user._getNickname();
String sanitizedName = ""; String sanitizedName = "";

View file

@ -1,4 +1,4 @@
package buttondevteam.alipresents.components.flaircolouring; package buttondevteam.alipresents.components.flaircolour;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -13,15 +13,15 @@ import org.bukkit.plugin.java.JavaPlugin;
import com.earth2me.essentials.Essentials; import com.earth2me.essentials.Essentials;
import buttondevteam.alipresents.architecture.Component; import buttondevteam.alipresents.architecture.Component;
import buttondevteam.alipresents.components.flaircolouring.letterdyes.GetLetterDye; import buttondevteam.alipresents.components.flaircolour.letterdyes.GetLetterDye;
import buttondevteam.alipresents.components.flaircolouring.letterdyes.LetterDye; import buttondevteam.alipresents.components.flaircolour.letterdyes.LetterDye;
import buttondevteam.alipresents.components.flaircolouring.letterdyes.LetterDyeListener; import buttondevteam.alipresents.components.flaircolour.letterdyes.LetterDyeListener;
import buttondevteam.alipresents.components.flaircolouring.portals.FlairMe; import buttondevteam.alipresents.components.flaircolour.portals.FlairMe;
import buttondevteam.alipresents.components.flaircolouring.portals.PlayerProximityLoop; import buttondevteam.alipresents.components.flaircolour.portals.PlayerProximityLoop;
import buttondevteam.alipresents.components.flaircolouring.portals.PortalListener; import buttondevteam.alipresents.components.flaircolour.portals.PortalListener;
import buttondevteam.alipresents.components.flaircolouring.portals.SetProximityLocation; import buttondevteam.alipresents.components.flaircolour.portals.SetProximityLocation;
public class FlairColouringComponent extends Component { public class FlairColourComponent extends Component {
public List<Player> playersToBeFlaired = new ArrayList<Player>(); public List<Player> playersToBeFlaired = new ArrayList<Player>();
@Override @Override
public void register(JavaPlugin plugin) { public void register(JavaPlugin plugin) {

View file

@ -1,10 +1,14 @@
package buttondevteam.alipresents.components.flaircolouring.letterdyes; package buttondevteam.alipresents.components.flaircolour.letterdyes;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import buttondevteam.alipresents.architecture.commands.PlayerCommand; import buttondevteam.alipresents.architecture.commands.PlayerCommand;
public class GetLetterDye extends PlayerCommand{ public class GetLetterDye extends PlayerCommand{
@Override
public String GetCommandPath() {
return "flaircolour getletterdye";
}
@Override @Override
public boolean OnCommand(Player player, String alias, String[] args) { public boolean OnCommand(Player player, String alias, String[] args) {
player.getInventory().addItem(LetterDye.getLetterDye()); player.getInventory().addItem(LetterDye.getLetterDye());

View file

@ -1,4 +1,4 @@
package buttondevteam.alipresents.components.flaircolouring.letterdyes; package buttondevteam.alipresents.components.flaircolour.letterdyes;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment; import org.bukkit.enchantments.Enchantment;

View file

@ -1,4 +1,4 @@
package buttondevteam.alipresents.components.flaircolouring.letterdyes; package buttondevteam.alipresents.components.flaircolour.letterdyes;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment; import org.bukkit.enchantments.Enchantment;
@ -12,7 +12,7 @@ import org.bukkit.material.Dye;
import com.earth2me.essentials.Essentials; import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import buttondevteam.alipresents.components.flaircolouring.FlairColouringAPI; import buttondevteam.alipresents.components.flaircolour.FlairColourAPI;
public class LetterDyeListener implements Listener{ public class LetterDyeListener implements Listener{
private Essentials essentials; private Essentials essentials;
@ -32,7 +32,7 @@ public class LetterDyeListener implements Listener{
Dye dye = (Dye) event.getItem().getData(); Dye dye = (Dye) event.getItem().getData();
User user = essentials.getUser(event.getPlayer()); User user = essentials.getUser(event.getPlayer());
user.setNickname(FlairColouringAPI.colourShiftRight(user._getNickname(), dye.getColor())); user.setNickname(FlairColourAPI.colourShiftRight(user._getNickname(), dye.getColor()));
}catch(Exception e){ }catch(Exception e){
event.getPlayer().sendMessage(e.getStackTrace().toString()); event.getPlayer().sendMessage(e.getStackTrace().toString());
} }

View file

@ -1,14 +1,18 @@
package buttondevteam.alipresents.components.flaircolouring.portals; package buttondevteam.alipresents.components.flaircolour.portals;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import buttondevteam.alipresents.architecture.commands.PlayerCommand; import buttondevteam.alipresents.architecture.commands.PlayerCommand;
import buttondevteam.alipresents.components.flaircolouring.FlairColouringComponent; import buttondevteam.alipresents.components.flaircolour.FlairColourComponent;
public class FlairMe extends PlayerCommand { public class FlairMe extends PlayerCommand {
@Override
public String GetCommandPath() {
return "flaircolour flairme";
}
private FlairColouringComponent component; private FlairColourComponent component;
public FlairMe(FlairColouringComponent flairDoorComponent) { public FlairMe(FlairColourComponent flairDoorComponent) {
this.component = flairDoorComponent; this.component = flairDoorComponent;
} }
@Override @Override

View file

@ -1,4 +1,4 @@
package buttondevteam.alipresents.components.flaircolouring.portals; package buttondevteam.alipresents.components.flaircolour.portals;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -6,11 +6,11 @@ import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
import buttondevteam.alipresents.components.flaircolouring.FlairColouringComponent; import buttondevteam.alipresents.components.flaircolour.FlairColourComponent;
public class PlayerProximityLoop extends BukkitRunnable implements Listener{ public class PlayerProximityLoop extends BukkitRunnable implements Listener{
private static JavaPlugin plugin; private static JavaPlugin plugin;
private static FlairColouringComponent component; private static FlairColourComponent component;
private static Location startLocation; private static Location startLocation;
private static Location endLocation; private static Location endLocation;
@ -21,7 +21,7 @@ public class PlayerProximityLoop extends BukkitRunnable implements Listener{
private static int eY; private static int eY;
private static int eZ; private static int eZ;
public PlayerProximityLoop(JavaPlugin plugin, FlairColouringComponent component) { public PlayerProximityLoop(JavaPlugin plugin, FlairColourComponent component) {
PlayerProximityLoop.plugin = plugin; PlayerProximityLoop.plugin = plugin;
PlayerProximityLoop.component = component; PlayerProximityLoop.component = component;
this.runTaskTimer(plugin, 0, 20); this.runTaskTimer(plugin, 0, 20);

View file

@ -1,4 +1,4 @@
package buttondevteam.alipresents.components.flaircolouring.portals; package buttondevteam.alipresents.components.flaircolour.portals;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.DyeColor; import org.bukkit.DyeColor;
@ -13,17 +13,17 @@ import org.bukkit.plugin.java.JavaPlugin;
import com.earth2me.essentials.Essentials; import com.earth2me.essentials.Essentials;
import buttondevteam.alipresents.components.flaircolouring.FlairColouringAPI; import buttondevteam.alipresents.components.flaircolour.FlairColourAPI;
import buttondevteam.alipresents.components.flaircolouring.FlairColouringComponent; import buttondevteam.alipresents.components.flaircolour.FlairColourComponent;
public class PortalListener implements Listener{ public class PortalListener implements Listener{
public JavaPlugin plugin; public JavaPlugin plugin;
Essentials essentials; Essentials essentials;
private FlairColouringComponent component; private FlairColourComponent component;
public PortalListener(JavaPlugin plugin, FlairColouringComponent component) { public PortalListener(JavaPlugin plugin, FlairColourComponent component) {
this.plugin = plugin; this.plugin = plugin;
this.component = component; this.component = component;
this.essentials = ((Essentials) Bukkit.getPluginManager().getPlugin("Essentials")); this.essentials = ((Essentials) Bukkit.getPluginManager().getPlugin("Essentials"));
@ -51,7 +51,7 @@ public class PortalListener implements Listener{
Block BottomBlock = player.getWorld().getBlockAt(x,y-4,z); //Block under middle block Block BottomBlock = player.getWorld().getBlockAt(x,y-4,z); //Block under middle block
if(HigherBlock.getType() == Material.STONE){ if(HigherBlock.getType() == Material.STONE){
FlairColouringAPI.recolourPlayer(essentials.getUser(player), DyeColor.GRAY); FlairColourAPI.recolourPlayer(essentials.getUser(player), DyeColor.GRAY);
component.playersToBeFlaired.remove(player.getName()); component.playersToBeFlaired.remove(player.getName());
return; return;
} }
@ -67,7 +67,7 @@ public class PortalListener implements Listener{
return; return;
} }
FlairColouringAPI.recolourPlayer(essentials.getUser(player), woolColour); FlairColourAPI.recolourPlayer(essentials.getUser(player), woolColour);
component.playersToBeFlaired.remove(player.getName()); component.playersToBeFlaired.remove(player.getName());
} }

View file

@ -1,4 +1,4 @@
package buttondevteam.alipresents.components.flaircolouring.portals; package buttondevteam.alipresents.components.flaircolour.portals;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -36,4 +36,9 @@ public class SetProximityLocation extends ModCommand{
"change their colour state." "change their colour state."
}; };
} }
@Override
public String GetCommandPath() {
return "flaircolour setproximitylocation";
}
} }

View file

@ -1,12 +1,12 @@
package buttondevteam.alipresents.components.gpowers; package buttondevteam.alipresents.components.gpower;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import buttondevteam.alipresents.architecture.Component; import buttondevteam.alipresents.architecture.Component;
import buttondevteam.alipresents.components.gpowers.commands.GPower; import buttondevteam.alipresents.components.gpower.commands.GPower;
import buttondevteam.alipresents.components.gpowers.enchant.EnchantingLoop; import buttondevteam.alipresents.components.gpower.enchant.EnchantingLoop;
import buttondevteam.alipresents.components.gpowers.powerstate.PowerDown; import buttondevteam.alipresents.components.gpower.powerstate.PowerDown;
import buttondevteam.alipresents.components.gpowers.powerstate.PowerUp; import buttondevteam.alipresents.components.gpower.powerstate.PowerUp;
public class GPowerComponent extends Component { public class GPowerComponent extends Component {

View file

@ -1,4 +1,4 @@
package buttondevteam.alipresents.components.gpowers; package buttondevteam.alipresents.components.gpower;
import java.util.UUID; import java.util.UUID;

View file

@ -1,4 +1,4 @@
package buttondevteam.alipresents.components.gpowers.api; package buttondevteam.alipresents.components.gpower.api;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -9,7 +9,7 @@ import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionEffectType;
import buttondevteam.alipresents.components.gpowers.PoweredPlayer; import buttondevteam.alipresents.components.gpower.PoweredPlayer;
public class GPowerAPI{ public class GPowerAPI{
public static final int defaultPowerLength = 300; public static final int defaultPowerLength = 300;

View file

@ -1,11 +1,15 @@
package buttondevteam.alipresents.components.gpowers.commands; package buttondevteam.alipresents.components.gpower.commands;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import buttondevteam.alipresents.architecture.commands.PlayerCommand; import buttondevteam.alipresents.architecture.commands.PlayerCommand;
import buttondevteam.alipresents.components.gpowers.api.GPowerAPI; import buttondevteam.alipresents.components.gpower.api.GPowerAPI;
public class GPower extends PlayerCommand { public class GPower extends PlayerCommand {
@Override
public String GetCommandPath() {
return "gpower";
}
@Override @Override
public boolean OnCommand(Player player, String label, String[] args) { public boolean OnCommand(Player player, String label, String[] args) {
if (args.length < 2) { if (args.length < 2) {
@ -36,11 +40,6 @@ public class GPower extends PlayerCommand {
return true; return true;
} }
@Override
public String GetCommandPath() {
return "gpower";
}
public String[] GetHelpText(String alias){ public String[] GetHelpText(String alias){
return new String[]{ return new String[]{
"Usage: /gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]" "Usage: /gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]"

View file

@ -1,4 +1,4 @@
package buttondevteam.alipresents.components.gpowers.enchant; package buttondevteam.alipresents.components.gpower.enchant;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -6,7 +6,7 @@ import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
import buttondevteam.alipresents.components.gpowers.api.GPowerAPI; import buttondevteam.alipresents.components.gpower.api.GPowerAPI;
public class EnchantingLoop extends BukkitRunnable implements Listener{ public class EnchantingLoop extends BukkitRunnable implements Listener{
private Server server; private Server server;

View file

@ -1,9 +1,9 @@
package buttondevteam.alipresents.components.gpowers.powerstate; package buttondevteam.alipresents.components.gpower.powerstate;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import buttondevteam.alipresents.architecture.commands.ModCommand; import buttondevteam.alipresents.architecture.commands.ModCommand;
import buttondevteam.alipresents.components.gpowers.api.GPowerAPI; import buttondevteam.alipresents.components.gpower.api.GPowerAPI;
public class PowerAll extends ModCommand{ public class PowerAll extends ModCommand{
@Override @Override
@ -16,4 +16,8 @@ public class PowerAll extends ModCommand{
"Usage: Type /PowerAll to activate all powers for all players with gpowers" "Usage: Type /PowerAll to activate all powers for all players with gpowers"
}; };
} }
@Override
public String GetCommandPath() {
return "gpower powerall";
}
} }

View file

@ -1,9 +1,9 @@
package buttondevteam.alipresents.components.gpowers.powerstate; package buttondevteam.alipresents.components.gpower.powerstate;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import buttondevteam.alipresents.architecture.commands.PlayerCommand; import buttondevteam.alipresents.architecture.commands.PlayerCommand;
import buttondevteam.alipresents.components.gpowers.api.GPowerAPI; import buttondevteam.alipresents.components.gpower.api.GPowerAPI;
public class PowerDown extends PlayerCommand { public class PowerDown extends PlayerCommand {
@Override @Override
@ -17,4 +17,9 @@ public class PowerDown extends PlayerCommand {
"Usage: Type /PowerDown to disable your g-power" "Usage: Type /PowerDown to disable your g-power"
}; };
} }
@Override
public String GetCommandPath() {
return "gpower powerdown";
}
} }

View file

@ -1,9 +1,9 @@
package buttondevteam.alipresents.components.gpowers.powerstate; package buttondevteam.alipresents.components.gpower.powerstate;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import buttondevteam.alipresents.architecture.commands.PlayerCommand; import buttondevteam.alipresents.architecture.commands.PlayerCommand;
import buttondevteam.alipresents.components.gpowers.api.GPowerAPI; import buttondevteam.alipresents.components.gpower.api.GPowerAPI;
public class PowerUp extends PlayerCommand { public class PowerUp extends PlayerCommand {
@Override @Override
@ -17,4 +17,8 @@ public class PowerUp extends PlayerCommand {
"Usage: Type /PowerUp to activate your registered G-Power" "Usage: Type /PowerUp to activate your registered G-Power"
}; };
} }
@Override
public String GetCommandPath() {
return "gpower powerup";
}
} }

View file

@ -51,4 +51,9 @@ public class getInsurance extends ModCommand {
}; };
} }
@Override
public String GetCommandPath() {
return "insurance get";
}
} }

View file

@ -17,4 +17,9 @@ public class getInsuranceBar extends ModCommand {
} }
return true; return true;
} }
@Override
public String GetCommandPath() {
return "insurance getBar";
}
} }

View file

@ -18,4 +18,8 @@ public class getInsuranceBlock extends ModCommand {
return false; return false;
} }
@Override
public String GetCommandPath() {
return "insurance getblock";
}
} }

View file

@ -17,5 +17,9 @@ public class getInsuranceNugget extends ModCommand {
} }
return false; return false;
} }
@Override
public String GetCommandPath() {
return "insurance getnugget";
}
} }

View file

@ -65,4 +65,9 @@ public class GetLoginMetrics extends ModCommand{
} }
return true; return true;
} }
@Override
public String GetCommandPath() {
return "metrics get logins";
}
} }