Refactored code to make subcommands #23

Merged
alisolarflare merged 6 commits from Refactoring into master 2016-12-17 07:43:27 +00:00
23 changed files with 86 additions and 129 deletions
Showing only changes of commit 872e1c8ac7 - Show all commits

View file

@ -3,71 +3,23 @@ name: AliPresents
version: 2.0.2
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:
description: Arguments - press or set
cbgm0:
description: Creative Boundaries Gamemode 0 - allows players to return to survival
cbgm1:
description: Creative Boundaries Gamemode 1 - allows players to access creative within their towns. Creative is removed outside of towns so be careful
setforceboundaries:
description: Should players automatically return to creative when outside town borders? Dickmode says yes.
joinminigame:
description: Join a Button Minigame
leaveminigame:
description: Leave a button minigame
listfighters:
description: List all fighters currently in a button minigame
setcolourspawn:
description: sets the spawn points for each colour in a button minigame
setmatchstate:
description: sets the current state of the ultrahardcore game.
addtouhc:
description: Adds a player to the UltraHardcore match
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
description: creates wireless redstone
cashmob:
description: creates mobs
cb:
description: creates creative boundaries
debug:
description: debug commands
flaircolouring:
description: flaaairs
fruit:
description: fruits
gpower:
description: powerssss
insurance:
description: item block insurance
magic:
description: magic
metrics:
description: metrics system

View file

@ -7,12 +7,11 @@ import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;
import buttondevteam.alipresents.components.alilinks.AliLinkComponent;
import buttondevteam.alipresents.components.bankchest.BankChestComponent;
import buttondevteam.alipresents.components.cashmob.CashMobComponent;
import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesComponent;
import buttondevteam.alipresents.components.flaircolouring.FlairColouringComponent;
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.magic.MagicComponent;
import buttondevteam.alipresents.components.spawn.SpawnComponent;
@ -26,7 +25,6 @@ public class AliPresents extends JavaPlugin{
new AliLinkComponent().register(this);
new BankChestComponent().register(this);
new CashMobComponent().register(this);
new CreativeBoundariesComponent().register(this);
new FlairColouringComponent().register(this);

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;
public class Cbgm0 extends PlayerCommand{
@Override
public String GetCommandPath() {
return "cb gm1";
}
@Override
public boolean OnCommand(Player player, String arg2, String[] arg3) {
CreativeBoundariesAPI.toSurvival(player);

View file

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

View file

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

View file

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

View file

@ -6,6 +6,10 @@ import buttondevteam.alipresents.architecture.commands.PlayerCommand;
import buttondevteam.alipresents.components.flaircolouring.FlairColouringComponent;
public class FlairMe extends PlayerCommand {
@Override
public String GetCommandPath() {
return "flaircolouring flairme";
}
private FlairColouringComponent component;
public FlairMe(FlairColouringComponent flairDoorComponent) {

View file

@ -1,12 +1,12 @@
package buttondevteam.alipresents.components.gpowers;
package buttondevteam.alipresents.components.gpower;
import org.bukkit.plugin.java.JavaPlugin;
import buttondevteam.alipresents.architecture.Component;
import buttondevteam.alipresents.components.gpowers.commands.GPower;
import buttondevteam.alipresents.components.gpowers.enchant.EnchantingLoop;
import buttondevteam.alipresents.components.gpowers.powerstate.PowerDown;
import buttondevteam.alipresents.components.gpowers.powerstate.PowerUp;
import buttondevteam.alipresents.components.gpower.commands.GPower;
import buttondevteam.alipresents.components.gpower.enchant.EnchantingLoop;
import buttondevteam.alipresents.components.gpower.powerstate.PowerDown;
import buttondevteam.alipresents.components.gpower.powerstate.PowerUp;
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;

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.Map;
@ -9,7 +9,7 @@ import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import buttondevteam.alipresents.components.gpowers.PoweredPlayer;
import buttondevteam.alipresents.components.gpower.PoweredPlayer;
public class GPowerAPI{
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 buttondevteam.alipresents.architecture.commands.PlayerCommand;
import buttondevteam.alipresents.components.gpowers.api.GPowerAPI;
import buttondevteam.alipresents.components.gpower.api.GPowerAPI;
public class GPower extends PlayerCommand {
@Override
public String GetCommandPath() {
return "gpower";
}
@Override
public boolean OnCommand(Player player, String label, String[] args) {
if (args.length < 2) {
@ -36,11 +40,6 @@ public class GPower extends PlayerCommand {
return true;
}
@Override
public String GetCommandPath() {
return "gpower";
}
public String[] GetHelpText(String alias){
return new String[]{
"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.entity.Player;
@ -6,7 +6,7 @@ import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
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{
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 buttondevteam.alipresents.architecture.commands.ModCommand;
import buttondevteam.alipresents.components.gpowers.api.GPowerAPI;
import buttondevteam.alipresents.components.gpower.api.GPowerAPI;
public class PowerAll extends ModCommand{
@Override

View file

@ -1,9 +1,9 @@
package buttondevteam.alipresents.components.gpowers.powerstate;
package buttondevteam.alipresents.components.gpower.powerstate;
import org.bukkit.entity.Player;
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 {
@Override

View file

@ -1,9 +1,9 @@
package buttondevteam.alipresents.components.gpowers.powerstate;
package buttondevteam.alipresents.components.gpower.powerstate;
import org.bukkit.entity.Player;
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 {
@Override

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;
}
@Override
public String GetCommandPath() {
return "insurance getBar";
}
}

View file

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

View file

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

View file

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