From 0df59ba8d4ecb0dd2dbdeb4de4da60b0fe52362b Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 12 Nov 2016 09:52:08 -0500 Subject: [PATCH] Changed Software Architecture based on this GoTo talk: https://www.youtube.com/watch?v=GAFZcYlO5S0 --- src/alisolarflare/AliPresents.java | 22 ++++----- .../Module.java => components/Component.java} | 4 +- .../{modules => components}/ModCommand.java | 2 +- .../PlayerCommand.java | 2 +- .../AliLinkComponent.java} | 12 ++--- .../commands/PressAliLink.java | 6 +-- .../commands/SetAliLink.java | 10 ++-- .../{links => alilinks}/entities/Link.java | 4 +- .../tasks/UnpressTask.java | 2 +- .../CreativeBoundariesComponent.java | 30 ++++++++++++ .../creativeboundaries/commands/Cbgm0.java | 10 ++-- .../creativeboundaries/commands/Cbgm1.java | 10 ++-- .../commands/SetDickmode.java | 10 ++-- .../listeners/ItemRestrictionListener.java | 8 ++-- .../listeners/PlotChangeListener.java | 8 ++-- .../components/easyuhc/EasyUHCComponent.java | 32 +++++++++++++ .../easyuhc/commands/ActivatePowers.java | 4 +- .../easyuhc/commands/SetUHCLobby.java | 10 ++-- .../easyuhc/commands/SetWorldBorders.java | 4 +- .../easyuhc/commands/ShrinkWorldBorders.java | 4 +- .../easyuhc/commands/SpreadPlayers.java | 4 +- .../easyuhc/commands/StartTimer.java | 4 +- .../easyuhc/commands/StartUHC.java | 4 +- .../easyuhc/commands/TeleportToUHC.java | 4 +- ...oorModule.java => FlairDoorComponent.java} | 4 +- .../flairdoor/commands/FlairMe.java | 2 +- .../gpowers/GPowerComponent.java} | 14 +++--- .../gpowers/GPowerMemory.java | 2 +- .../gpowers/commands/GPower.java | 6 +-- .../gpowers/commands/PowerAll.java | 8 ++-- .../gpowers/commands/PowerDown.java | 6 +-- .../gpowers/commands/PowerUp.java | 6 +-- .../gpowers/listeners/gPowerApplyingTask.java | 4 +- .../gpowers/listeners/gPowerListener.java | 4 +- .../links/serializer/Deserializer.java | 42 ---------------- .../links/serializer/Serializer.java | 38 --------------- .../components/magic/MagicComponent.java | 18 +++++++ .../magic/tricks/AliArrowListener.java | 2 +- .../magic/tricks/AliArrowTask.java | 2 +- .../magic/tricks/BoomBowDeathListener.java | 2 +- .../magic/tricks/BoomBowListener.java | 2 +- .../magic/tricks/BoomBowRule.java | 4 +- .../magic/tricks/BoomDecayTask.java | 2 +- .../components/metrics/MetricsModule.java | 48 +++++++++++++++++++ .../listeners/PlayerLoginListener.java | 6 +-- .../minigames/GameState.java | 2 +- .../minigames/MinigameModule.java | 16 +++---- .../minigames/commands/JoinMinigame.java | 6 +-- .../minigames/commands/LeaveMinigame.java | 6 +-- .../minigames/commands/ListFighters.java | 6 +-- .../minigames/commands/SetColourSpawn.java | 6 +-- .../minigames/data/SpawnSet.java | 2 +- .../minigames/entities/Fighter.java | 2 +- .../CreativeBoundariesModule.java | 30 ------------ .../modules/easyuhc/EasyUHCModule.java | 32 ------------- .../modules/magic/MagicModule.java | 18 ------- .../modules/metrics/MetricsModule.java | 16 ------- src/graveyard/autouhc/UHCModule.java | 4 +- .../autouhc/controller/SetMatchState.java | 2 +- src/graveyard/autouhc/idle/AddToUHC.java | 2 +- src/graveyard/autouhc/idle/JoinUHC.java | 2 +- .../autouhc/intro/ConfigureMatch.java | 2 +- .../autouhc/intro/ScheduleMatch.java | 2 +- src/graveyard/autouhc/intro/StartMatch.java | 2 +- src/graveyard/shulker/AliShulkerModule.java | 4 +- 65 files changed, 273 insertions(+), 321 deletions(-) rename src/alisolarflare/{modules/Module.java => components/Component.java} (94%) rename src/alisolarflare/{modules => components}/ModCommand.java (91%) rename src/alisolarflare/{modules => components}/PlayerCommand.java (94%) rename src/alisolarflare/components/{links/AliLinkModule.java => alilinks/AliLinkComponent.java} (62%) rename src/alisolarflare/components/{links => alilinks}/commands/PressAliLink.java (82%) rename src/alisolarflare/components/{links => alilinks}/commands/SetAliLink.java (91%) rename src/alisolarflare/components/{links => alilinks}/entities/Link.java (87%) rename src/alisolarflare/components/{links => alilinks}/tasks/UnpressTask.java (86%) create mode 100644 src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java rename src/alisolarflare/{modules => components}/creativeboundaries/commands/Cbgm0.java (62%) rename src/alisolarflare/{modules => components}/creativeboundaries/commands/Cbgm1.java (82%) rename src/alisolarflare/{modules => components}/creativeboundaries/commands/SetDickmode.java (71%) rename src/alisolarflare/{modules => components}/creativeboundaries/listeners/ItemRestrictionListener.java (58%) rename src/alisolarflare/{modules => components}/creativeboundaries/listeners/PlotChangeListener.java (85%) create mode 100644 src/alisolarflare/components/easyuhc/EasyUHCComponent.java rename src/alisolarflare/{modules => components}/easyuhc/commands/ActivatePowers.java (65%) rename src/alisolarflare/{modules => components}/easyuhc/commands/SetUHCLobby.java (58%) rename src/alisolarflare/{modules => components}/easyuhc/commands/SetWorldBorders.java (65%) rename src/alisolarflare/{modules => components}/easyuhc/commands/ShrinkWorldBorders.java (69%) rename src/alisolarflare/{modules => components}/easyuhc/commands/SpreadPlayers.java (68%) rename src/alisolarflare/{modules => components}/easyuhc/commands/StartTimer.java (68%) rename src/alisolarflare/{modules => components}/easyuhc/commands/StartUHC.java (68%) rename src/alisolarflare/{modules => components}/easyuhc/commands/TeleportToUHC.java (68%) rename src/alisolarflare/components/flairdoor/{FlairDoorModule.java => FlairDoorComponent.java} (77%) rename src/alisolarflare/{modules/gpowers/GPowerModule.java => components/gpowers/GPowerComponent.java} (51%) rename src/alisolarflare/{modules => components}/gpowers/GPowerMemory.java (94%) rename src/alisolarflare/{modules => components}/gpowers/commands/GPower.java (89%) rename src/alisolarflare/{modules => components}/gpowers/commands/PowerAll.java (67%) rename src/alisolarflare/{modules => components}/gpowers/commands/PowerDown.java (78%) rename src/alisolarflare/{modules => components}/gpowers/commands/PowerUp.java (78%) rename src/alisolarflare/{modules => components}/gpowers/listeners/gPowerApplyingTask.java (94%) rename src/alisolarflare/{modules => components}/gpowers/listeners/gPowerListener.java (72%) delete mode 100644 src/alisolarflare/components/links/serializer/Deserializer.java delete mode 100644 src/alisolarflare/components/links/serializer/Serializer.java create mode 100644 src/alisolarflare/components/magic/MagicComponent.java rename src/alisolarflare/{modules => components}/magic/tricks/AliArrowListener.java (91%) rename src/alisolarflare/{modules => components}/magic/tricks/AliArrowTask.java (91%) rename src/alisolarflare/{modules => components}/magic/tricks/BoomBowDeathListener.java (88%) rename src/alisolarflare/{modules => components}/magic/tricks/BoomBowListener.java (95%) rename src/alisolarflare/{modules => components}/magic/tricks/BoomBowRule.java (92%) rename src/alisolarflare/{modules => components}/magic/tricks/BoomDecayTask.java (87%) create mode 100644 src/alisolarflare/components/metrics/MetricsModule.java rename src/alisolarflare/{modules => components}/metrics/listeners/PlayerLoginListener.java (64%) rename src/alisolarflare/{modules => components}/minigames/GameState.java (52%) rename src/alisolarflare/{modules => components}/minigames/MinigameModule.java (55%) rename src/alisolarflare/{modules => components}/minigames/commands/JoinMinigame.java (79%) rename src/alisolarflare/{modules => components}/minigames/commands/LeaveMinigame.java (79%) rename src/alisolarflare/{modules => components}/minigames/commands/ListFighters.java (66%) rename src/alisolarflare/{modules => components}/minigames/commands/SetColourSpawn.java (88%) rename src/alisolarflare/{modules => components}/minigames/data/SpawnSet.java (92%) rename src/alisolarflare/{modules => components}/minigames/entities/Fighter.java (73%) delete mode 100644 src/alisolarflare/modules/creativeboundaries/CreativeBoundariesModule.java delete mode 100644 src/alisolarflare/modules/easyuhc/EasyUHCModule.java delete mode 100644 src/alisolarflare/modules/magic/MagicModule.java delete mode 100644 src/alisolarflare/modules/metrics/MetricsModule.java diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index c9330d1..a68d201 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -6,12 +6,12 @@ import org.bukkit.plugin.PluginDescriptionFile; //import alisolarflare.links.AliLinkSubPlug; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.flairdoor.FlairDoorModule; -import alisolarflare.components.links.AliLinkModule; -import alisolarflare.modules.creativeboundaries.CreativeBoundariesModule; -import alisolarflare.modules.easyuhc.EasyUHCModule; -import alisolarflare.modules.magic.MagicModule; -import alisolarflare.modules.minigames.MinigameModule; +import alisolarflare.components.alilinks.AliLinkComponent; +import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; +import alisolarflare.components.easyuhc.EasyUHCComponent; +import alisolarflare.components.flairdoor.FlairDoorComponent; +import alisolarflare.components.magic.MagicComponent; +import alisolarflare.components.minigames.MinigameModule; public class AliPresents extends JavaPlugin{ public void onEnable(){ @@ -21,12 +21,12 @@ public class AliPresents extends JavaPlugin{ logger.info(pdfFile.getName() + " has been started (V." + pdfFile.getVersion()+ ")."); - new FlairDoorModule().register(this); - new AliLinkModule().register(this); - new EasyUHCModule().register(this); - new MagicModule().register(this); + new FlairDoorComponent().register(this); + new AliLinkComponent().register(this); + new EasyUHCComponent().register(this); + new MagicComponent().register(this); new MinigameModule().register(this); - new CreativeBoundariesModule().register(this); + new CreativeBoundariesComponent().register(this); logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ")."); diff --git a/src/alisolarflare/modules/Module.java b/src/alisolarflare/components/Component.java similarity index 94% rename from src/alisolarflare/modules/Module.java rename to src/alisolarflare/components/Component.java index 9818c99..13bfeab 100644 --- a/src/alisolarflare/modules/Module.java +++ b/src/alisolarflare/components/Component.java @@ -1,4 +1,4 @@ -package alisolarflare.modules; +package alisolarflare.components; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.event.Listener; @@ -20,7 +20,7 @@ import buttondevteam.lib.chat.TBMCCommandBase; * @author Alisolarflare * */ -public abstract class Module{ +public abstract class Component{ /** * Registers the module, when called by the JavaPlugin class. Call diff --git a/src/alisolarflare/modules/ModCommand.java b/src/alisolarflare/components/ModCommand.java similarity index 91% rename from src/alisolarflare/modules/ModCommand.java rename to src/alisolarflare/components/ModCommand.java index 2a650f0..c359349 100644 --- a/src/alisolarflare/modules/ModCommand.java +++ b/src/alisolarflare/components/ModCommand.java @@ -1,4 +1,4 @@ -package alisolarflare.modules; +package alisolarflare.components; import org.bukkit.command.CommandSender; diff --git a/src/alisolarflare/modules/PlayerCommand.java b/src/alisolarflare/components/PlayerCommand.java similarity index 94% rename from src/alisolarflare/modules/PlayerCommand.java rename to src/alisolarflare/components/PlayerCommand.java index 51dcad9..e3bfae5 100644 --- a/src/alisolarflare/modules/PlayerCommand.java +++ b/src/alisolarflare/components/PlayerCommand.java @@ -1,4 +1,4 @@ -package alisolarflare.modules; +package alisolarflare.components; import buttondevteam.lib.chat.TBMCCommandBase; diff --git a/src/alisolarflare/components/links/AliLinkModule.java b/src/alisolarflare/components/alilinks/AliLinkComponent.java similarity index 62% rename from src/alisolarflare/components/links/AliLinkModule.java rename to src/alisolarflare/components/alilinks/AliLinkComponent.java index 5a40320..9e6741e 100644 --- a/src/alisolarflare/components/links/AliLinkModule.java +++ b/src/alisolarflare/components/alilinks/AliLinkComponent.java @@ -1,15 +1,15 @@ -package alisolarflare.components.links; +package alisolarflare.components.alilinks; import java.util.List; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.links.commands.PressAliLink; -import alisolarflare.components.links.commands.SetAliLink; -import alisolarflare.components.links.entities.Link; -import alisolarflare.modules.Module; +import alisolarflare.components.Component; +import alisolarflare.components.alilinks.commands.PressAliLink; +import alisolarflare.components.alilinks.commands.SetAliLink; +import alisolarflare.components.alilinks.entities.Link; -public class AliLinkModule extends Module { +public class AliLinkComponent extends Component { private SetAliLink setAliLink; @Override diff --git a/src/alisolarflare/components/links/commands/PressAliLink.java b/src/alisolarflare/components/alilinks/commands/PressAliLink.java similarity index 82% rename from src/alisolarflare/components/links/commands/PressAliLink.java rename to src/alisolarflare/components/alilinks/commands/PressAliLink.java index 657c611..9ba8e68 100644 --- a/src/alisolarflare/components/links/commands/PressAliLink.java +++ b/src/alisolarflare/components/alilinks/commands/PressAliLink.java @@ -1,10 +1,10 @@ -package alisolarflare.components.links.commands; +package alisolarflare.components.alilinks.commands; import org.bukkit.command.CommandSender; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.links.entities.Link; -import alisolarflare.modules.PlayerCommand; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.alilinks.entities.Link; public class PressAliLink extends PlayerCommand { private JavaPlugin plugin; diff --git a/src/alisolarflare/components/links/commands/SetAliLink.java b/src/alisolarflare/components/alilinks/commands/SetAliLink.java similarity index 91% rename from src/alisolarflare/components/links/commands/SetAliLink.java rename to src/alisolarflare/components/alilinks/commands/SetAliLink.java index f25d8f7..b98ff5b 100644 --- a/src/alisolarflare/components/links/commands/SetAliLink.java +++ b/src/alisolarflare/components/alilinks/commands/SetAliLink.java @@ -1,4 +1,4 @@ -package alisolarflare.components.links.commands; +package alisolarflare.components.alilinks.commands; import java.util.ArrayList; import java.util.List; @@ -9,9 +9,9 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.links.AliLinkModule; -import alisolarflare.components.links.entities.Link; -import alisolarflare.modules.PlayerCommand; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.alilinks.AliLinkComponent; +import alisolarflare.components.alilinks.entities.Link; /** * This class manages the command /SetAliLink [x] [y] [z]. This command creates an Ali-Link, a location in a world that when called on by {@link PressAliLink}, creates a temporary redstone @@ -23,7 +23,7 @@ import alisolarflare.modules.PlayerCommand; */ public class SetAliLink extends PlayerCommand { public List linkList = new ArrayList(); - AliLinkModule subplugin; + AliLinkComponent subplugin; private JavaPlugin plugin; /** diff --git a/src/alisolarflare/components/links/entities/Link.java b/src/alisolarflare/components/alilinks/entities/Link.java similarity index 87% rename from src/alisolarflare/components/links/entities/Link.java rename to src/alisolarflare/components/alilinks/entities/Link.java index f55bfc8..55199d9 100644 --- a/src/alisolarflare/components/links/entities/Link.java +++ b/src/alisolarflare/components/alilinks/entities/Link.java @@ -1,4 +1,4 @@ -package alisolarflare.components.links.entities; +package alisolarflare.components.alilinks.entities; import java.io.Serializable; @@ -6,7 +6,7 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.components.links.tasks.UnpressTask; +import alisolarflare.components.alilinks.tasks.UnpressTask; public class Link implements Serializable{ /** diff --git a/src/alisolarflare/components/links/tasks/UnpressTask.java b/src/alisolarflare/components/alilinks/tasks/UnpressTask.java similarity index 86% rename from src/alisolarflare/components/links/tasks/UnpressTask.java rename to src/alisolarflare/components/alilinks/tasks/UnpressTask.java index 769f4f1..8820778 100644 --- a/src/alisolarflare/components/links/tasks/UnpressTask.java +++ b/src/alisolarflare/components/alilinks/tasks/UnpressTask.java @@ -1,4 +1,4 @@ -package alisolarflare.components.links.tasks; +package alisolarflare.components.alilinks.tasks; import org.bukkit.Location; import org.bukkit.Material; diff --git a/src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java b/src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java new file mode 100644 index 0000000..466859e --- /dev/null +++ b/src/alisolarflare/components/creativeboundaries/CreativeBoundariesComponent.java @@ -0,0 +1,30 @@ +package alisolarflare.components.creativeboundaries; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.components.Component; +import alisolarflare.components.creativeboundaries.commands.Cbgm0; +import alisolarflare.components.creativeboundaries.commands.Cbgm1; +import alisolarflare.components.creativeboundaries.commands.SetDickmode; +import alisolarflare.components.creativeboundaries.listeners.ItemRestrictionListener; +import alisolarflare.components.creativeboundaries.listeners.PlotChangeListener; + + +public class CreativeBoundariesComponent extends Component{ + public boolean dickmode; + public List cbCreatives = new ArrayList(); + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new Cbgm1(this)); + registerCommand(plugin, new Cbgm0(this)); + registerCommand(plugin, new SetDickmode(this)); + + registerListener(plugin, new PlotChangeListener(this)); + //registerListener(plugin, new ItemRestrictionListener(this)); + } + +} diff --git a/src/alisolarflare/modules/creativeboundaries/commands/Cbgm0.java b/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java similarity index 62% rename from src/alisolarflare/modules/creativeboundaries/commands/Cbgm0.java rename to src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java index 70da940..2551d68 100644 --- a/src/alisolarflare/modules/creativeboundaries/commands/Cbgm0.java +++ b/src/alisolarflare/components/creativeboundaries/commands/Cbgm0.java @@ -1,17 +1,17 @@ -package alisolarflare.modules.creativeboundaries.commands; +package alisolarflare.components.creativeboundaries.commands; import org.bukkit.GameMode; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.creativeboundaries.CreativeBoundariesModule; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; public class Cbgm0 extends PlayerCommand{ - private CreativeBoundariesModule module; + private CreativeBoundariesComponent module; - public Cbgm0(CreativeBoundariesModule module) { + public Cbgm0(CreativeBoundariesComponent module) { this.module = module; } diff --git a/src/alisolarflare/modules/creativeboundaries/commands/Cbgm1.java b/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java similarity index 82% rename from src/alisolarflare/modules/creativeboundaries/commands/Cbgm1.java rename to src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java index b6e888e..9767dd3 100644 --- a/src/alisolarflare/modules/creativeboundaries/commands/Cbgm1.java +++ b/src/alisolarflare/components/creativeboundaries/commands/Cbgm1.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.creativeboundaries.commands; +package alisolarflare.components.creativeboundaries.commands; import org.bukkit.GameMode; import org.bukkit.command.CommandSender; @@ -10,14 +10,14 @@ import com.palmergames.bukkit.towny.object.Town; import com.palmergames.bukkit.towny.object.TownBlock; import com.palmergames.bukkit.towny.object.TownyUniverse; -import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.creativeboundaries.CreativeBoundariesModule; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; public class Cbgm1 extends PlayerCommand { - private CreativeBoundariesModule module; + private CreativeBoundariesComponent module; - public Cbgm1(CreativeBoundariesModule module) { + public Cbgm1(CreativeBoundariesComponent module) { this.module = module; } diff --git a/src/alisolarflare/modules/creativeboundaries/commands/SetDickmode.java b/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java similarity index 71% rename from src/alisolarflare/modules/creativeboundaries/commands/SetDickmode.java rename to src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java index bbf3026..8650dd1 100644 --- a/src/alisolarflare/modules/creativeboundaries/commands/SetDickmode.java +++ b/src/alisolarflare/components/creativeboundaries/commands/SetDickmode.java @@ -1,14 +1,14 @@ -package alisolarflare.modules.creativeboundaries.commands; +package alisolarflare.components.creativeboundaries.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.creativeboundaries.CreativeBoundariesModule; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; public class SetDickmode extends PlayerCommand{ - private CreativeBoundariesModule module; + private CreativeBoundariesComponent module; - public SetDickmode(CreativeBoundariesModule module){ + public SetDickmode(CreativeBoundariesComponent module){ this.module = module; } diff --git a/src/alisolarflare/modules/creativeboundaries/listeners/ItemRestrictionListener.java b/src/alisolarflare/components/creativeboundaries/listeners/ItemRestrictionListener.java similarity index 58% rename from src/alisolarflare/modules/creativeboundaries/listeners/ItemRestrictionListener.java rename to src/alisolarflare/components/creativeboundaries/listeners/ItemRestrictionListener.java index 3cb6581..acb431b 100644 --- a/src/alisolarflare/modules/creativeboundaries/listeners/ItemRestrictionListener.java +++ b/src/alisolarflare/components/creativeboundaries/listeners/ItemRestrictionListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.creativeboundaries.listeners; +package alisolarflare.components.creativeboundaries.listeners; import java.util.List; @@ -7,13 +7,13 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryCreativeEvent; -import alisolarflare.modules.creativeboundaries.CreativeBoundariesModule; +import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; public class ItemRestrictionListener implements Listener { - private CreativeBoundariesModule module; + private CreativeBoundariesComponent module; - public ItemRestrictionListener(CreativeBoundariesModule module) { + public ItemRestrictionListener(CreativeBoundariesComponent module) { this.module = module; } diff --git a/src/alisolarflare/modules/creativeboundaries/listeners/PlotChangeListener.java b/src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java similarity index 85% rename from src/alisolarflare/modules/creativeboundaries/listeners/PlotChangeListener.java rename to src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java index a257f89..2516b4e 100644 --- a/src/alisolarflare/modules/creativeboundaries/listeners/PlotChangeListener.java +++ b/src/alisolarflare/components/creativeboundaries/listeners/PlotChangeListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.creativeboundaries.listeners; +package alisolarflare.components.creativeboundaries.listeners; import org.bukkit.GameMode; import org.bukkit.entity.Player; @@ -12,11 +12,11 @@ import com.palmergames.bukkit.towny.object.Town; import com.palmergames.bukkit.towny.object.TownBlock; import com.palmergames.bukkit.towny.object.TownyUniverse; -import alisolarflare.modules.creativeboundaries.CreativeBoundariesModule; +import alisolarflare.components.creativeboundaries.CreativeBoundariesComponent; public class PlotChangeListener implements Listener{ - public CreativeBoundariesModule module; - public PlotChangeListener(CreativeBoundariesModule module){ + public CreativeBoundariesComponent module; + public PlotChangeListener(CreativeBoundariesComponent module){ this.module = module; } @EventHandler diff --git a/src/alisolarflare/components/easyuhc/EasyUHCComponent.java b/src/alisolarflare/components/easyuhc/EasyUHCComponent.java new file mode 100644 index 0000000..3487368 --- /dev/null +++ b/src/alisolarflare/components/easyuhc/EasyUHCComponent.java @@ -0,0 +1,32 @@ +package alisolarflare.components.easyuhc; + +import org.bukkit.Location; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.components.Component; +import alisolarflare.components.easyuhc.commands.ActivatePowers; +import alisolarflare.components.easyuhc.commands.SetUHCLobby; +import alisolarflare.components.easyuhc.commands.SetWorldBorders; +import alisolarflare.components.easyuhc.commands.SpreadPlayers; +import alisolarflare.components.easyuhc.commands.StartTimer; +import alisolarflare.components.easyuhc.commands.StartUHC; +import alisolarflare.components.easyuhc.commands.TeleportToUHC; + +public class EasyUHCComponent extends Component{ + public Location lobbyLocation; + @Override + public void register(JavaPlugin plugin) { + + + + registerCommand(plugin, new ActivatePowers()); + registerCommand(plugin, new SetUHCLobby(this)); + registerCommand(plugin, new SetWorldBorders()); + registerCommand(plugin, new SetWorldBorders()); + registerCommand(plugin, new SpreadPlayers()); + registerCommand(plugin, new StartTimer()); + registerCommand(plugin, new StartUHC()); + registerCommand(plugin, new TeleportToUHC()); + + } +} diff --git a/src/alisolarflare/modules/easyuhc/commands/ActivatePowers.java b/src/alisolarflare/components/easyuhc/commands/ActivatePowers.java similarity index 65% rename from src/alisolarflare/modules/easyuhc/commands/ActivatePowers.java rename to src/alisolarflare/components/easyuhc/commands/ActivatePowers.java index 00395d1..7c19b02 100644 --- a/src/alisolarflare/modules/easyuhc/commands/ActivatePowers.java +++ b/src/alisolarflare/components/easyuhc/commands/ActivatePowers.java @@ -1,8 +1,8 @@ -package alisolarflare.modules.easyuhc.commands; +package alisolarflare.components.easyuhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; public class ActivatePowers extends ModCommand{ diff --git a/src/alisolarflare/modules/easyuhc/commands/SetUHCLobby.java b/src/alisolarflare/components/easyuhc/commands/SetUHCLobby.java similarity index 58% rename from src/alisolarflare/modules/easyuhc/commands/SetUHCLobby.java rename to src/alisolarflare/components/easyuhc/commands/SetUHCLobby.java index 57c9e31..907a1b8 100644 --- a/src/alisolarflare/modules/easyuhc/commands/SetUHCLobby.java +++ b/src/alisolarflare/components/easyuhc/commands/SetUHCLobby.java @@ -1,14 +1,14 @@ -package alisolarflare.modules.easyuhc.commands; +package alisolarflare.components.easyuhc.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.ModCommand; -import alisolarflare.modules.easyuhc.EasyUHCModule; +import alisolarflare.components.ModCommand; +import alisolarflare.components.easyuhc.EasyUHCComponent; public class SetUHCLobby extends ModCommand{ - EasyUHCModule module; - public SetUHCLobby(EasyUHCModule easyUHCModule) { + EasyUHCComponent module; + public SetUHCLobby(EasyUHCComponent easyUHCModule) { this.module = easyUHCModule; } diff --git a/src/alisolarflare/modules/easyuhc/commands/SetWorldBorders.java b/src/alisolarflare/components/easyuhc/commands/SetWorldBorders.java similarity index 65% rename from src/alisolarflare/modules/easyuhc/commands/SetWorldBorders.java rename to src/alisolarflare/components/easyuhc/commands/SetWorldBorders.java index deb6a12..69ff39a 100644 --- a/src/alisolarflare/modules/easyuhc/commands/SetWorldBorders.java +++ b/src/alisolarflare/components/easyuhc/commands/SetWorldBorders.java @@ -1,8 +1,8 @@ -package alisolarflare.modules.easyuhc.commands; +package alisolarflare.components.easyuhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; public class SetWorldBorders extends ModCommand { diff --git a/src/alisolarflare/modules/easyuhc/commands/ShrinkWorldBorders.java b/src/alisolarflare/components/easyuhc/commands/ShrinkWorldBorders.java similarity index 69% rename from src/alisolarflare/modules/easyuhc/commands/ShrinkWorldBorders.java rename to src/alisolarflare/components/easyuhc/commands/ShrinkWorldBorders.java index d15b370..4cf60d2 100644 --- a/src/alisolarflare/modules/easyuhc/commands/ShrinkWorldBorders.java +++ b/src/alisolarflare/components/easyuhc/commands/ShrinkWorldBorders.java @@ -1,8 +1,8 @@ -package alisolarflare.modules.easyuhc.commands; +package alisolarflare.components.easyuhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; public class ShrinkWorldBorders extends ModCommand { diff --git a/src/alisolarflare/modules/easyuhc/commands/SpreadPlayers.java b/src/alisolarflare/components/easyuhc/commands/SpreadPlayers.java similarity index 68% rename from src/alisolarflare/modules/easyuhc/commands/SpreadPlayers.java rename to src/alisolarflare/components/easyuhc/commands/SpreadPlayers.java index b6cbd9e..cb9e621 100644 --- a/src/alisolarflare/modules/easyuhc/commands/SpreadPlayers.java +++ b/src/alisolarflare/components/easyuhc/commands/SpreadPlayers.java @@ -1,8 +1,8 @@ -package alisolarflare.modules.easyuhc.commands; +package alisolarflare.components.easyuhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; public class SpreadPlayers extends ModCommand{ diff --git a/src/alisolarflare/modules/easyuhc/commands/StartTimer.java b/src/alisolarflare/components/easyuhc/commands/StartTimer.java similarity index 68% rename from src/alisolarflare/modules/easyuhc/commands/StartTimer.java rename to src/alisolarflare/components/easyuhc/commands/StartTimer.java index 9d2fb47..9af948a 100644 --- a/src/alisolarflare/modules/easyuhc/commands/StartTimer.java +++ b/src/alisolarflare/components/easyuhc/commands/StartTimer.java @@ -1,8 +1,8 @@ -package alisolarflare.modules.easyuhc.commands; +package alisolarflare.components.easyuhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; public class StartTimer extends ModCommand{ diff --git a/src/alisolarflare/modules/easyuhc/commands/StartUHC.java b/src/alisolarflare/components/easyuhc/commands/StartUHC.java similarity index 68% rename from src/alisolarflare/modules/easyuhc/commands/StartUHC.java rename to src/alisolarflare/components/easyuhc/commands/StartUHC.java index 68b7557..04bb96a 100644 --- a/src/alisolarflare/modules/easyuhc/commands/StartUHC.java +++ b/src/alisolarflare/components/easyuhc/commands/StartUHC.java @@ -1,8 +1,8 @@ -package alisolarflare.modules.easyuhc.commands; +package alisolarflare.components.easyuhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; public class StartUHC extends ModCommand{ diff --git a/src/alisolarflare/modules/easyuhc/commands/TeleportToUHC.java b/src/alisolarflare/components/easyuhc/commands/TeleportToUHC.java similarity index 68% rename from src/alisolarflare/modules/easyuhc/commands/TeleportToUHC.java rename to src/alisolarflare/components/easyuhc/commands/TeleportToUHC.java index b5c3665..856b4ab 100644 --- a/src/alisolarflare/modules/easyuhc/commands/TeleportToUHC.java +++ b/src/alisolarflare/components/easyuhc/commands/TeleportToUHC.java @@ -1,8 +1,8 @@ -package alisolarflare.modules.easyuhc.commands; +package alisolarflare.components.easyuhc.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.PlayerCommand; +import alisolarflare.components.PlayerCommand; public class TeleportToUHC extends PlayerCommand{ diff --git a/src/alisolarflare/components/flairdoor/FlairDoorModule.java b/src/alisolarflare/components/flairdoor/FlairDoorComponent.java similarity index 77% rename from src/alisolarflare/components/flairdoor/FlairDoorModule.java rename to src/alisolarflare/components/flairdoor/FlairDoorComponent.java index 290522c..34a9ead 100644 --- a/src/alisolarflare/components/flairdoor/FlairDoorModule.java +++ b/src/alisolarflare/components/flairdoor/FlairDoorComponent.java @@ -2,11 +2,11 @@ package alisolarflare.components.flairdoor; import org.bukkit.plugin.java.JavaPlugin; +import alisolarflare.components.Component; import alisolarflare.components.flairdoor.commands.FlairMe; import alisolarflare.components.flairdoor.listeners.PortalListener; -import alisolarflare.modules.Module; -public class FlairDoorModule extends Module { +public class FlairDoorComponent extends Component { @Override public void register(JavaPlugin plugin) { registerCommand(plugin, new FlairMe()); diff --git a/src/alisolarflare/components/flairdoor/commands/FlairMe.java b/src/alisolarflare/components/flairdoor/commands/FlairMe.java index 8745da8..cceaaf3 100644 --- a/src/alisolarflare/components/flairdoor/commands/FlairMe.java +++ b/src/alisolarflare/components/flairdoor/commands/FlairMe.java @@ -3,8 +3,8 @@ package alisolarflare.components.flairdoor.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import alisolarflare.components.PlayerCommand; import alisolarflare.components.flairdoor.listeners.PortalListener; -import alisolarflare.modules.PlayerCommand; public class FlairMe extends PlayerCommand { diff --git a/src/alisolarflare/modules/gpowers/GPowerModule.java b/src/alisolarflare/components/gpowers/GPowerComponent.java similarity index 51% rename from src/alisolarflare/modules/gpowers/GPowerModule.java rename to src/alisolarflare/components/gpowers/GPowerComponent.java index 3c74111..91ea408 100644 --- a/src/alisolarflare/modules/gpowers/GPowerModule.java +++ b/src/alisolarflare/components/gpowers/GPowerComponent.java @@ -1,14 +1,14 @@ -package alisolarflare.modules.gpowers; +package alisolarflare.components.gpowers; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.Module; -import alisolarflare.modules.gpowers.commands.GPower; -import alisolarflare.modules.gpowers.commands.PowerDown; -import alisolarflare.modules.gpowers.commands.PowerUp; -import alisolarflare.modules.gpowers.listeners.gPowerListener; +import alisolarflare.components.Component; +import alisolarflare.components.gpowers.commands.GPower; +import alisolarflare.components.gpowers.commands.PowerDown; +import alisolarflare.components.gpowers.commands.PowerUp; +import alisolarflare.components.gpowers.listeners.gPowerListener; -public class GPowerModule extends Module { +public class GPowerComponent extends Component { @Override public void register(JavaPlugin plugin) { diff --git a/src/alisolarflare/modules/gpowers/GPowerMemory.java b/src/alisolarflare/components/gpowers/GPowerMemory.java similarity index 94% rename from src/alisolarflare/modules/gpowers/GPowerMemory.java rename to src/alisolarflare/components/gpowers/GPowerMemory.java index e0891d2..44e0089 100644 --- a/src/alisolarflare/modules/gpowers/GPowerMemory.java +++ b/src/alisolarflare/components/gpowers/GPowerMemory.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.gpowers; +package alisolarflare.components.gpowers; import java.util.HashMap; import java.util.Map; diff --git a/src/alisolarflare/modules/gpowers/commands/GPower.java b/src/alisolarflare/components/gpowers/commands/GPower.java similarity index 89% rename from src/alisolarflare/modules/gpowers/commands/GPower.java rename to src/alisolarflare/components/gpowers/commands/GPower.java index 7777d09..bfd8ce5 100644 --- a/src/alisolarflare/modules/gpowers/commands/GPower.java +++ b/src/alisolarflare/components/gpowers/commands/GPower.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.gpowers.commands; +package alisolarflare.components.gpowers.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.gpowers.GPowerMemory; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.gpowers.GPowerMemory; public class GPower extends PlayerCommand { diff --git a/src/alisolarflare/modules/gpowers/commands/PowerAll.java b/src/alisolarflare/components/gpowers/commands/PowerAll.java similarity index 67% rename from src/alisolarflare/modules/gpowers/commands/PowerAll.java rename to src/alisolarflare/components/gpowers/commands/PowerAll.java index b92aba1..a6fafe2 100644 --- a/src/alisolarflare/modules/gpowers/commands/PowerAll.java +++ b/src/alisolarflare/components/gpowers/commands/PowerAll.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.gpowers.commands; +package alisolarflare.components.gpowers.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.ModCommand; -import alisolarflare.modules.gpowers.GPowerMemory; -import alisolarflare.modules.gpowers.GPowerMemory.poweredPlayer; +import alisolarflare.components.ModCommand; +import alisolarflare.components.gpowers.GPowerMemory; +import alisolarflare.components.gpowers.GPowerMemory.poweredPlayer; public class PowerAll extends ModCommand{ private GPowerMemory gPowerMemory; diff --git a/src/alisolarflare/modules/gpowers/commands/PowerDown.java b/src/alisolarflare/components/gpowers/commands/PowerDown.java similarity index 78% rename from src/alisolarflare/modules/gpowers/commands/PowerDown.java rename to src/alisolarflare/components/gpowers/commands/PowerDown.java index a7849f6..42ca6c0 100644 --- a/src/alisolarflare/modules/gpowers/commands/PowerDown.java +++ b/src/alisolarflare/components/gpowers/commands/PowerDown.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.gpowers.commands; +package alisolarflare.components.gpowers.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.gpowers.GPowerMemory; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.gpowers.GPowerMemory; public class PowerDown extends PlayerCommand { diff --git a/src/alisolarflare/modules/gpowers/commands/PowerUp.java b/src/alisolarflare/components/gpowers/commands/PowerUp.java similarity index 78% rename from src/alisolarflare/modules/gpowers/commands/PowerUp.java rename to src/alisolarflare/components/gpowers/commands/PowerUp.java index c82e669..433ac32 100644 --- a/src/alisolarflare/modules/gpowers/commands/PowerUp.java +++ b/src/alisolarflare/components/gpowers/commands/PowerUp.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.gpowers.commands; +package alisolarflare.components.gpowers.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.gpowers.GPowerMemory; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.gpowers.GPowerMemory; public class PowerUp extends PlayerCommand { diff --git a/src/alisolarflare/modules/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java similarity index 94% rename from src/alisolarflare/modules/gpowers/listeners/gPowerApplyingTask.java rename to src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java index d1404c3..35f1f2b 100644 --- a/src/alisolarflare/modules/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/components/gpowers/listeners/gPowerApplyingTask.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.gpowers.listeners; +package alisolarflare.components.gpowers.listeners; import java.util.Map; import java.util.UUID; @@ -10,7 +10,7 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.scheduler.BukkitRunnable; -import alisolarflare.modules.gpowers.GPowerMemory.poweredPlayer; +import alisolarflare.components.gpowers.GPowerMemory.poweredPlayer; public class gPowerApplyingTask extends BukkitRunnable{ private int powerLength = 300; diff --git a/src/alisolarflare/modules/gpowers/listeners/gPowerListener.java b/src/alisolarflare/components/gpowers/listeners/gPowerListener.java similarity index 72% rename from src/alisolarflare/modules/gpowers/listeners/gPowerListener.java rename to src/alisolarflare/components/gpowers/listeners/gPowerListener.java index 7021d68..6ef02dd 100644 --- a/src/alisolarflare/modules/gpowers/listeners/gPowerListener.java +++ b/src/alisolarflare/components/gpowers/listeners/gPowerListener.java @@ -1,9 +1,9 @@ -package alisolarflare.modules.gpowers.listeners; +package alisolarflare.components.gpowers.listeners; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.gpowers.GPowerMemory; +import alisolarflare.components.gpowers.GPowerMemory; public class gPowerListener implements Listener{ diff --git a/src/alisolarflare/components/links/serializer/Deserializer.java b/src/alisolarflare/components/links/serializer/Deserializer.java deleted file mode 100644 index cfc1786..0000000 --- a/src/alisolarflare/components/links/serializer/Deserializer.java +++ /dev/null @@ -1,42 +0,0 @@ -package alisolarflare.components.links.serializer; - - -import java.io.FileInputStream; -import java.io.ObjectInputStream; -import java.util.List; - -import alisolarflare.components.links.entities.Link; - -/** - * @deprecated - * @author Alisolarflare - * - */ -public class Deserializer{ - - public static void main (String args[]) { - - //Deserializer deserializer = new Deserializer(); - //List aliLink = deserializer.loadLink(aliLink); - //System.out.println(aliLink); - } - - /**@deprecated*/ - @SuppressWarnings("unchecked") - public List loadLinkList(){ - List aliLinkList; - try{ - - FileInputStream fin = new FileInputStream("AliLinkList.ser"); - ObjectInputStream ois = new ObjectInputStream(fin); - aliLinkList = (List) ois.readObject(); - ois.close(); - - return aliLinkList; - - }catch(Exception ex){ - ex.printStackTrace(); - return null; - } - } -} diff --git a/src/alisolarflare/components/links/serializer/Serializer.java b/src/alisolarflare/components/links/serializer/Serializer.java deleted file mode 100644 index fe4efef..0000000 --- a/src/alisolarflare/components/links/serializer/Serializer.java +++ /dev/null @@ -1,38 +0,0 @@ -package alisolarflare.components.links.serializer; - - -import java.io.FileOutputStream; -import java.io.ObjectOutputStream; -import java.util.List; - -import alisolarflare.components.links.entities.Link; - -/** - * @deprecated - * @author Alisolarflare - * - */ -public class Serializer { - - public static void main (String args[]) { - - //Serializer serializer = new Serializer(); - //serializer.saveLink(plugin, frequency, location) - } - /**@deprecated*/ - public void saveLinkList(List aliLinkList){ - //saves link - - try{ - - FileOutputStream fout = new FileOutputStream("AliLinkList.ser"); - ObjectOutputStream oos = new ObjectOutputStream(fout); - oos.writeObject(aliLinkList); - oos.close(); - System.out.println("Done"); - - }catch(Exception ex){ - ex.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/src/alisolarflare/components/magic/MagicComponent.java b/src/alisolarflare/components/magic/MagicComponent.java new file mode 100644 index 0000000..835c80e --- /dev/null +++ b/src/alisolarflare/components/magic/MagicComponent.java @@ -0,0 +1,18 @@ +package alisolarflare.components.magic; + +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.components.Component; +import alisolarflare.components.magic.tricks.AliArrowListener; +import alisolarflare.components.magic.tricks.BoomBowDeathListener; +import alisolarflare.components.magic.tricks.BoomBowListener; + +public class MagicComponent extends Component{ + + @Override + public void register(JavaPlugin plugin) { + registerListener(plugin, new AliArrowListener(plugin)); + registerListener(plugin, new BoomBowDeathListener()); + registerListener(plugin, new BoomBowListener(plugin)); + } +} diff --git a/src/alisolarflare/modules/magic/tricks/AliArrowListener.java b/src/alisolarflare/components/magic/tricks/AliArrowListener.java similarity index 91% rename from src/alisolarflare/modules/magic/tricks/AliArrowListener.java rename to src/alisolarflare/components/magic/tricks/AliArrowListener.java index 437fa02..cbbe46c 100644 --- a/src/alisolarflare/modules/magic/tricks/AliArrowListener.java +++ b/src/alisolarflare/components/magic/tricks/AliArrowListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.magic.tricks; +package alisolarflare.components.magic.tricks; import org.bukkit.entity.Arrow; import org.bukkit.entity.EntityType; diff --git a/src/alisolarflare/modules/magic/tricks/AliArrowTask.java b/src/alisolarflare/components/magic/tricks/AliArrowTask.java similarity index 91% rename from src/alisolarflare/modules/magic/tricks/AliArrowTask.java rename to src/alisolarflare/components/magic/tricks/AliArrowTask.java index b21f161..6aa6665 100644 --- a/src/alisolarflare/modules/magic/tricks/AliArrowTask.java +++ b/src/alisolarflare/components/magic/tricks/AliArrowTask.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.magic.tricks; +package alisolarflare.components.magic.tricks; import org.bukkit.Particle; import org.bukkit.entity.Arrow; diff --git a/src/alisolarflare/modules/magic/tricks/BoomBowDeathListener.java b/src/alisolarflare/components/magic/tricks/BoomBowDeathListener.java similarity index 88% rename from src/alisolarflare/modules/magic/tricks/BoomBowDeathListener.java rename to src/alisolarflare/components/magic/tricks/BoomBowDeathListener.java index 5a7b749..1b55fe4 100644 --- a/src/alisolarflare/modules/magic/tricks/BoomBowDeathListener.java +++ b/src/alisolarflare/components/magic/tricks/BoomBowDeathListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.magic.tricks; +package alisolarflare.components.magic.tricks; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; diff --git a/src/alisolarflare/modules/magic/tricks/BoomBowListener.java b/src/alisolarflare/components/magic/tricks/BoomBowListener.java similarity index 95% rename from src/alisolarflare/modules/magic/tricks/BoomBowListener.java rename to src/alisolarflare/components/magic/tricks/BoomBowListener.java index d650646..6aaca6a 100644 --- a/src/alisolarflare/modules/magic/tricks/BoomBowListener.java +++ b/src/alisolarflare/components/magic/tricks/BoomBowListener.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.magic.tricks; +package alisolarflare.components.magic.tricks; import org.bukkit.GameMode; import org.bukkit.Location; diff --git a/src/alisolarflare/modules/magic/tricks/BoomBowRule.java b/src/alisolarflare/components/magic/tricks/BoomBowRule.java similarity index 92% rename from src/alisolarflare/modules/magic/tricks/BoomBowRule.java rename to src/alisolarflare/components/magic/tricks/BoomBowRule.java index e701070..9d9d9c0 100644 --- a/src/alisolarflare/modules/magic/tricks/BoomBowRule.java +++ b/src/alisolarflare/components/magic/tricks/BoomBowRule.java @@ -1,9 +1,9 @@ -package alisolarflare.modules.magic.tricks; +package alisolarflare.components.magic.tricks; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; //HEHEHHEHEH EAASSSTER EGGS public class BoomBowRule extends ModCommand{ public static boolean boomDecay; diff --git a/src/alisolarflare/modules/magic/tricks/BoomDecayTask.java b/src/alisolarflare/components/magic/tricks/BoomDecayTask.java similarity index 87% rename from src/alisolarflare/modules/magic/tricks/BoomDecayTask.java rename to src/alisolarflare/components/magic/tricks/BoomDecayTask.java index 5cc0401..15a5474 100644 --- a/src/alisolarflare/modules/magic/tricks/BoomDecayTask.java +++ b/src/alisolarflare/components/magic/tricks/BoomDecayTask.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.magic.tricks; +package alisolarflare.components.magic.tricks; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitRunnable; diff --git a/src/alisolarflare/components/metrics/MetricsModule.java b/src/alisolarflare/components/metrics/MetricsModule.java new file mode 100644 index 0000000..4672898 --- /dev/null +++ b/src/alisolarflare/components/metrics/MetricsModule.java @@ -0,0 +1,48 @@ +package alisolarflare.components.metrics; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.List; + +import org.bukkit.configuration.InvalidConfigurationException; +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.components.Component; + +public class MetricsModule extends Component{ + + public FileConfiguration metricsYml; + private List playerList; + + @Override + public void register(JavaPlugin plugin){ + + try { + loadFileConfiguration(plugin, "config.yml"); + } catch (IOException | InvalidConfigurationException e) { + e.printStackTrace(); + return; + } + + + } + + private FileConfiguration loadFileConfiguration(JavaPlugin plugin, String fileName) throws FileNotFoundException, IOException, InvalidConfigurationException { + + File file = new File(plugin.getDataFolder(), fileName); + + if (!file.exists()) { + file.getParentFile().mkdirs(); + plugin.saveResource(fileName, false); + } + + FileConfiguration config = new YamlConfiguration(); + + config.load(file); + + return config; + } +} diff --git a/src/alisolarflare/modules/metrics/listeners/PlayerLoginListener.java b/src/alisolarflare/components/metrics/listeners/PlayerLoginListener.java similarity index 64% rename from src/alisolarflare/modules/metrics/listeners/PlayerLoginListener.java rename to src/alisolarflare/components/metrics/listeners/PlayerLoginListener.java index b512120..289c2fd 100644 --- a/src/alisolarflare/modules/metrics/listeners/PlayerLoginListener.java +++ b/src/alisolarflare/components/metrics/listeners/PlayerLoginListener.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.metrics.listeners; +package alisolarflare.components.metrics.listeners; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerLoginEvent; -import alisolarflare.modules.metrics.MetricsModule; +import alisolarflare.components.metrics.MetricsModule; public class PlayerLoginListener implements Listener{ @@ -14,7 +14,7 @@ public class PlayerLoginListener implements Listener{ } @EventHandler public void onPlayerLogin(PlayerLoginEvent event){ - module.saveData(module.config, "loginlog."+System.currentTimeMillis(), event.getPlayer().getName()); + module.saveData(module.metricsYml, "loginlog."+System.currentTimeMillis(), event.getPlayer().getName()); event.getPlayer(); } } diff --git a/src/alisolarflare/modules/minigames/GameState.java b/src/alisolarflare/components/minigames/GameState.java similarity index 52% rename from src/alisolarflare/modules/minigames/GameState.java rename to src/alisolarflare/components/minigames/GameState.java index c985192..7a5a953 100644 --- a/src/alisolarflare/modules/minigames/GameState.java +++ b/src/alisolarflare/components/minigames/GameState.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.minigames; +package alisolarflare.components.minigames; public enum GameState { Idle, FreeForAll, Heroes; diff --git a/src/alisolarflare/modules/minigames/MinigameModule.java b/src/alisolarflare/components/minigames/MinigameModule.java similarity index 55% rename from src/alisolarflare/modules/minigames/MinigameModule.java rename to src/alisolarflare/components/minigames/MinigameModule.java index 30f832e..51e332c 100644 --- a/src/alisolarflare/modules/minigames/MinigameModule.java +++ b/src/alisolarflare/components/minigames/MinigameModule.java @@ -1,17 +1,17 @@ -package alisolarflare.modules.minigames; +package alisolarflare.components.minigames; import java.util.List; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.Module; -import alisolarflare.modules.minigames.commands.JoinMinigame; -import alisolarflare.modules.minigames.commands.LeaveMinigame; -import alisolarflare.modules.minigames.commands.ListFighters; -import alisolarflare.modules.minigames.commands.SetColourSpawn; -import alisolarflare.modules.minigames.data.SpawnSet; +import alisolarflare.components.Component; +import alisolarflare.components.minigames.commands.JoinMinigame; +import alisolarflare.components.minigames.commands.LeaveMinigame; +import alisolarflare.components.minigames.commands.ListFighters; +import alisolarflare.components.minigames.commands.SetColourSpawn; +import alisolarflare.components.minigames.data.SpawnSet; -public class MinigameModule extends Module{ +public class MinigameModule extends Component{ public SpawnSet spawnSet; public List fighters; private GameState gameState; diff --git a/src/alisolarflare/modules/minigames/commands/JoinMinigame.java b/src/alisolarflare/components/minigames/commands/JoinMinigame.java similarity index 79% rename from src/alisolarflare/modules/minigames/commands/JoinMinigame.java rename to src/alisolarflare/components/minigames/commands/JoinMinigame.java index 4c958a7..88a5cb0 100644 --- a/src/alisolarflare/modules/minigames/commands/JoinMinigame.java +++ b/src/alisolarflare/components/minigames/commands/JoinMinigame.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.minigames.commands; +package alisolarflare.components.minigames.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.minigames.MinigameModule; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.minigames.MinigameModule; public class JoinMinigame extends PlayerCommand { private MinigameModule module; diff --git a/src/alisolarflare/modules/minigames/commands/LeaveMinigame.java b/src/alisolarflare/components/minigames/commands/LeaveMinigame.java similarity index 79% rename from src/alisolarflare/modules/minigames/commands/LeaveMinigame.java rename to src/alisolarflare/components/minigames/commands/LeaveMinigame.java index e712bd0..3685433 100644 --- a/src/alisolarflare/modules/minigames/commands/LeaveMinigame.java +++ b/src/alisolarflare/components/minigames/commands/LeaveMinigame.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.minigames.commands; +package alisolarflare.components.minigames.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.minigames.MinigameModule; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.minigames.MinigameModule; public class LeaveMinigame extends PlayerCommand { diff --git a/src/alisolarflare/modules/minigames/commands/ListFighters.java b/src/alisolarflare/components/minigames/commands/ListFighters.java similarity index 66% rename from src/alisolarflare/modules/minigames/commands/ListFighters.java rename to src/alisolarflare/components/minigames/commands/ListFighters.java index 0d3b769..f0d1738 100644 --- a/src/alisolarflare/modules/minigames/commands/ListFighters.java +++ b/src/alisolarflare/components/minigames/commands/ListFighters.java @@ -1,9 +1,9 @@ -package alisolarflare.modules.minigames.commands; +package alisolarflare.components.minigames.commands; import org.bukkit.command.CommandSender; -import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.minigames.MinigameModule; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.minigames.MinigameModule; public class ListFighters extends PlayerCommand { private MinigameModule lobby; diff --git a/src/alisolarflare/modules/minigames/commands/SetColourSpawn.java b/src/alisolarflare/components/minigames/commands/SetColourSpawn.java similarity index 88% rename from src/alisolarflare/modules/minigames/commands/SetColourSpawn.java rename to src/alisolarflare/components/minigames/commands/SetColourSpawn.java index db07787..eb44a5d 100644 --- a/src/alisolarflare/modules/minigames/commands/SetColourSpawn.java +++ b/src/alisolarflare/components/minigames/commands/SetColourSpawn.java @@ -1,10 +1,10 @@ -package alisolarflare.modules.minigames.commands; +package alisolarflare.components.minigames.commands; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.PlayerCommand; -import alisolarflare.modules.minigames.data.SpawnSet; +import alisolarflare.components.PlayerCommand; +import alisolarflare.components.minigames.data.SpawnSet; public class SetColourSpawn extends PlayerCommand{ private SpawnSet spawnSet; diff --git a/src/alisolarflare/modules/minigames/data/SpawnSet.java b/src/alisolarflare/components/minigames/data/SpawnSet.java similarity index 92% rename from src/alisolarflare/modules/minigames/data/SpawnSet.java rename to src/alisolarflare/components/minigames/data/SpawnSet.java index 10f519e..dfd2ba9 100644 --- a/src/alisolarflare/modules/minigames/data/SpawnSet.java +++ b/src/alisolarflare/components/minigames/data/SpawnSet.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.minigames.data; +package alisolarflare.components.minigames.data; import org.bukkit.Location; diff --git a/src/alisolarflare/modules/minigames/entities/Fighter.java b/src/alisolarflare/components/minigames/entities/Fighter.java similarity index 73% rename from src/alisolarflare/modules/minigames/entities/Fighter.java rename to src/alisolarflare/components/minigames/entities/Fighter.java index ace6db1..79fc62a 100644 --- a/src/alisolarflare/modules/minigames/entities/Fighter.java +++ b/src/alisolarflare/components/minigames/entities/Fighter.java @@ -1,4 +1,4 @@ -package alisolarflare.modules.minigames.entities; +package alisolarflare.components.minigames.entities; import org.bukkit.entity.Player; diff --git a/src/alisolarflare/modules/creativeboundaries/CreativeBoundariesModule.java b/src/alisolarflare/modules/creativeboundaries/CreativeBoundariesModule.java deleted file mode 100644 index d9ecdf8..0000000 --- a/src/alisolarflare/modules/creativeboundaries/CreativeBoundariesModule.java +++ /dev/null @@ -1,30 +0,0 @@ -package alisolarflare.modules.creativeboundaries; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.modules.Module; -import alisolarflare.modules.creativeboundaries.commands.Cbgm0; -import alisolarflare.modules.creativeboundaries.commands.Cbgm1; -import alisolarflare.modules.creativeboundaries.commands.SetDickmode; -import alisolarflare.modules.creativeboundaries.listeners.ItemRestrictionListener; -import alisolarflare.modules.creativeboundaries.listeners.PlotChangeListener; - - -public class CreativeBoundariesModule extends Module{ - public boolean dickmode; - public List cbCreatives = new ArrayList(); - @Override - public void register(JavaPlugin plugin) { - registerCommand(plugin, new Cbgm1(this)); - registerCommand(plugin, new Cbgm0(this)); - registerCommand(plugin, new SetDickmode(this)); - - registerListener(plugin, new PlotChangeListener(this)); - //registerListener(plugin, new ItemRestrictionListener(this)); - } - -} diff --git a/src/alisolarflare/modules/easyuhc/EasyUHCModule.java b/src/alisolarflare/modules/easyuhc/EasyUHCModule.java deleted file mode 100644 index 3d49527..0000000 --- a/src/alisolarflare/modules/easyuhc/EasyUHCModule.java +++ /dev/null @@ -1,32 +0,0 @@ -package alisolarflare.modules.easyuhc; - -import org.bukkit.Location; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.modules.Module; -import alisolarflare.modules.easyuhc.commands.ActivatePowers; -import alisolarflare.modules.easyuhc.commands.SetUHCLobby; -import alisolarflare.modules.easyuhc.commands.SetWorldBorders; -import alisolarflare.modules.easyuhc.commands.SpreadPlayers; -import alisolarflare.modules.easyuhc.commands.StartTimer; -import alisolarflare.modules.easyuhc.commands.StartUHC; -import alisolarflare.modules.easyuhc.commands.TeleportToUHC; - -public class EasyUHCModule extends Module{ - public Location lobbyLocation; - @Override - public void register(JavaPlugin plugin) { - - - - registerCommand(plugin, new ActivatePowers()); - registerCommand(plugin, new SetUHCLobby(this)); - registerCommand(plugin, new SetWorldBorders()); - registerCommand(plugin, new SetWorldBorders()); - registerCommand(plugin, new SpreadPlayers()); - registerCommand(plugin, new StartTimer()); - registerCommand(plugin, new StartUHC()); - registerCommand(plugin, new TeleportToUHC()); - - } -} diff --git a/src/alisolarflare/modules/magic/MagicModule.java b/src/alisolarflare/modules/magic/MagicModule.java deleted file mode 100644 index 76477c2..0000000 --- a/src/alisolarflare/modules/magic/MagicModule.java +++ /dev/null @@ -1,18 +0,0 @@ -package alisolarflare.modules.magic; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.modules.Module; -import alisolarflare.modules.magic.tricks.AliArrowListener; -import alisolarflare.modules.magic.tricks.BoomBowDeathListener; -import alisolarflare.modules.magic.tricks.BoomBowListener; - -public class MagicModule extends Module{ - - @Override - public void register(JavaPlugin plugin) { - registerListener(plugin, new AliArrowListener(plugin)); - registerListener(plugin, new BoomBowDeathListener()); - registerListener(plugin, new BoomBowListener(plugin)); - } -} diff --git a/src/alisolarflare/modules/metrics/MetricsModule.java b/src/alisolarflare/modules/metrics/MetricsModule.java deleted file mode 100644 index a4ca43e..0000000 --- a/src/alisolarflare/modules/metrics/MetricsModule.java +++ /dev/null @@ -1,16 +0,0 @@ -package alisolarflare.modules.metrics; - -import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.modules.Module; - -public class MetricsModule extends Module{ - - public FileConfiguration config; - - @Override - public void register(JavaPlugin plugin) { - this.config = plugin.getConfig(); - } -} diff --git a/src/graveyard/autouhc/UHCModule.java b/src/graveyard/autouhc/UHCModule.java index 1891c31..861a834 100644 --- a/src/graveyard/autouhc/UHCModule.java +++ b/src/graveyard/autouhc/UHCModule.java @@ -1,12 +1,12 @@ package graveyard.autouhc; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.Module; +import alisolarflare.components.Component; import graveyard.autouhc.memory.MatchState; import graveyard.autouhc.memory.UHCMatch; /**@deprecated*/ -public class UHCModule extends Module { +public class UHCModule extends Component { public UHCMatch match; public void register(JavaPlugin plugin) { diff --git a/src/graveyard/autouhc/controller/SetMatchState.java b/src/graveyard/autouhc/controller/SetMatchState.java index 00f8d94..bced5be 100644 --- a/src/graveyard/autouhc/controller/SetMatchState.java +++ b/src/graveyard/autouhc/controller/SetMatchState.java @@ -3,7 +3,7 @@ package graveyard.autouhc.controller; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; import graveyard.autouhc.memory.MatchState; import graveyard.autouhc.memory.UHCMatch; /**@deprecated*/ diff --git a/src/graveyard/autouhc/idle/AddToUHC.java b/src/graveyard/autouhc/idle/AddToUHC.java index f1ffa57..030fb85 100644 --- a/src/graveyard/autouhc/idle/AddToUHC.java +++ b/src/graveyard/autouhc/idle/AddToUHC.java @@ -3,7 +3,7 @@ package graveyard.autouhc.idle; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; import graveyard.autouhc.memory.UHCMatch; /** diff --git a/src/graveyard/autouhc/idle/JoinUHC.java b/src/graveyard/autouhc/idle/JoinUHC.java index c37d301..f1a09a1 100644 --- a/src/graveyard/autouhc/idle/JoinUHC.java +++ b/src/graveyard/autouhc/idle/JoinUHC.java @@ -3,7 +3,7 @@ package graveyard.autouhc.idle; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; import graveyard.autouhc.memory.UHCMatch; /**@deprecated*/ public class JoinUHC extends ModCommand{ diff --git a/src/graveyard/autouhc/intro/ConfigureMatch.java b/src/graveyard/autouhc/intro/ConfigureMatch.java index 49f1bfb..50ac73d 100644 --- a/src/graveyard/autouhc/intro/ConfigureMatch.java +++ b/src/graveyard/autouhc/intro/ConfigureMatch.java @@ -2,7 +2,7 @@ package graveyard.autouhc.intro; import org.bukkit.command.CommandSender; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; import graveyard.autouhc.memory.UHCMatch; /**@deprecated*/ public class ConfigureMatch extends ModCommand{ diff --git a/src/graveyard/autouhc/intro/ScheduleMatch.java b/src/graveyard/autouhc/intro/ScheduleMatch.java index 91b130a..670826e 100644 --- a/src/graveyard/autouhc/intro/ScheduleMatch.java +++ b/src/graveyard/autouhc/intro/ScheduleMatch.java @@ -2,7 +2,7 @@ package graveyard.autouhc.intro; import org.bukkit.command.CommandSender; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; import graveyard.autouhc.memory.UHCMatch; /**@deprecated*/ public class ScheduleMatch extends ModCommand{ diff --git a/src/graveyard/autouhc/intro/StartMatch.java b/src/graveyard/autouhc/intro/StartMatch.java index 22f2b5a..26a6948 100644 --- a/src/graveyard/autouhc/intro/StartMatch.java +++ b/src/graveyard/autouhc/intro/StartMatch.java @@ -2,7 +2,7 @@ package graveyard.autouhc.intro; import org.bukkit.command.CommandSender; -import alisolarflare.modules.ModCommand; +import alisolarflare.components.ModCommand; import graveyard.autouhc.memory.MatchState; import graveyard.autouhc.memory.UHCMatch; diff --git a/src/graveyard/shulker/AliShulkerModule.java b/src/graveyard/shulker/AliShulkerModule.java index 6b47bdd..04c6037 100644 --- a/src/graveyard/shulker/AliShulkerModule.java +++ b/src/graveyard/shulker/AliShulkerModule.java @@ -2,11 +2,11 @@ package graveyard.shulker; import org.bukkit.plugin.java.JavaPlugin; -import alisolarflare.modules.Module; +import alisolarflare.components.Component; import graveyard.shulker.commands.AliShulker; /**@deprecated*/ -public class AliShulkerModule extends Module { +public class AliShulkerModule extends Component { @Override public void register(JavaPlugin plugin) {