From 341fb1be2ef21ff73edc38760d5982d3d3c8f219 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 19 Dec 2016 15:58:10 -0500 Subject: [PATCH] refactored hotfixes --- src/buttondevteam/alipresents/AliPresents.java | 6 ------ .../components/cashmob/CashMobComponent.java | 18 ------------------ .../components/fruit/FruitComponent.java | 15 --------------- .../components/hotfix/HotfixComponent.java | 10 ++++++++++ .../cows => hotfix/hotfixes}/CowSpawnLoop.java | 2 +- .../hotfixes}/GrassBreakListener.java | 2 +- .../hotfixes}/MobKillListener.java | 2 +- .../{ => hotfixes}/NetherDisableListener.java | 4 +++- .../components/spawn/SpawnComponent.java | 15 --------------- 9 files changed, 16 insertions(+), 58 deletions(-) delete mode 100644 src/buttondevteam/alipresents/components/cashmob/CashMobComponent.java delete mode 100644 src/buttondevteam/alipresents/components/fruit/FruitComponent.java rename src/buttondevteam/alipresents/components/{spawn/cows => hotfix/hotfixes}/CowSpawnLoop.java (95%) rename src/buttondevteam/alipresents/components/{fruit => hotfix/hotfixes}/GrassBreakListener.java (98%) rename src/buttondevteam/alipresents/components/{cashmob => hotfix/hotfixes}/MobKillListener.java (93%) rename src/buttondevteam/alipresents/components/hotfix/{ => hotfixes}/NetherDisableListener.java (55%) delete mode 100644 src/buttondevteam/alipresents/components/spawn/SpawnComponent.java diff --git a/src/buttondevteam/alipresents/AliPresents.java b/src/buttondevteam/alipresents/AliPresents.java index 9919a3f..d8ad8bc 100644 --- a/src/buttondevteam/alipresents/AliPresents.java +++ b/src/buttondevteam/alipresents/AliPresents.java @@ -7,15 +7,12 @@ import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.java.JavaPlugin; import buttondevteam.alipresents.components.alilinks.AliLinkComponent; -import buttondevteam.alipresents.components.cashmob.CashMobComponent; import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesComponent; import buttondevteam.alipresents.components.flaircolour.FlairColourComponent; -import buttondevteam.alipresents.components.fruit.FruitComponent; import buttondevteam.alipresents.components.gpower.GPowerComponent; import buttondevteam.alipresents.components.hotfix.HotfixComponent; import buttondevteam.alipresents.components.insurance.InsuranceComponent; import buttondevteam.alipresents.components.magic.MagicComponent; -import buttondevteam.alipresents.components.spawn.SpawnComponent; public class AliPresents extends JavaPlugin{ public void onEnable(){ @@ -26,16 +23,13 @@ public class AliPresents extends JavaPlugin{ new AliLinkComponent().register(this); - new CashMobComponent().register(this); new CreativeBoundariesComponent().register(this); new FlairColourComponent().register(this); - new FruitComponent().register(this); new GPowerComponent().register(this); new HotfixComponent().register(this); new InsuranceComponent().register(this); new MagicComponent().register(this); //new MetricsComponent().register(this); - new SpawnComponent().register(this); logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ")."); diff --git a/src/buttondevteam/alipresents/components/cashmob/CashMobComponent.java b/src/buttondevteam/alipresents/components/cashmob/CashMobComponent.java deleted file mode 100644 index b4a427f..0000000 --- a/src/buttondevteam/alipresents/components/cashmob/CashMobComponent.java +++ /dev/null @@ -1,18 +0,0 @@ -package buttondevteam.alipresents.components.cashmob; - -import org.bukkit.Bukkit; -import org.bukkit.plugin.java.JavaPlugin; - -import com.earth2me.essentials.Essentials; - -import buttondevteam.alipresents.architecture.Component; - -public class CashMobComponent extends Component{ - - @Override - public void register(JavaPlugin plugin) { - registerListener(plugin, new MobKillListener((Essentials) Bukkit.getPluginManager().getPlugin("Essentials"))); - - } - -} diff --git a/src/buttondevteam/alipresents/components/fruit/FruitComponent.java b/src/buttondevteam/alipresents/components/fruit/FruitComponent.java deleted file mode 100644 index 910f75f..0000000 --- a/src/buttondevteam/alipresents/components/fruit/FruitComponent.java +++ /dev/null @@ -1,15 +0,0 @@ -package buttondevteam.alipresents.components.fruit; - -import org.bukkit.plugin.java.JavaPlugin; - -import buttondevteam.alipresents.architecture.Component; - -public class FruitComponent extends Component{ - - @Override - public void register(JavaPlugin plugin) { - registerListener(plugin, new GrassBreakListener()); - - } - -} diff --git a/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java b/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java index f8e4e10..45e6a2a 100644 --- a/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java +++ b/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java @@ -1,14 +1,24 @@ package buttondevteam.alipresents.components.hotfix; +import org.bukkit.Bukkit; import org.bukkit.plugin.java.JavaPlugin; +import com.earth2me.essentials.Essentials; + import buttondevteam.alipresents.architecture.Component; +import buttondevteam.alipresents.components.hotfix.hotfixes.CowSpawnLoop; +import buttondevteam.alipresents.components.hotfix.hotfixes.GrassBreakListener; +import buttondevteam.alipresents.components.hotfix.hotfixes.MobKillListener; +import buttondevteam.alipresents.components.hotfix.hotfixes.NetherDisableListener; public class HotfixComponent extends Component { @Override public void register(JavaPlugin plugin) { registerListener(plugin, new NetherDisableListener()); + registerListener(plugin, new CowSpawnLoop(plugin)); + registerListener(plugin, new MobKillListener((Essentials) Bukkit.getPluginManager().getPlugin("Essentials"))); + registerListener(plugin, new GrassBreakListener()); } diff --git a/src/buttondevteam/alipresents/components/spawn/cows/CowSpawnLoop.java b/src/buttondevteam/alipresents/components/hotfix/hotfixes/CowSpawnLoop.java similarity index 95% rename from src/buttondevteam/alipresents/components/spawn/cows/CowSpawnLoop.java rename to src/buttondevteam/alipresents/components/hotfix/hotfixes/CowSpawnLoop.java index 24ee650..8fb663f 100644 --- a/src/buttondevteam/alipresents/components/spawn/cows/CowSpawnLoop.java +++ b/src/buttondevteam/alipresents/components/hotfix/hotfixes/CowSpawnLoop.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.spawn.cows; +package buttondevteam.alipresents.components.hotfix.hotfixes; import org.bukkit.Location; import org.bukkit.Material; diff --git a/src/buttondevteam/alipresents/components/fruit/GrassBreakListener.java b/src/buttondevteam/alipresents/components/hotfix/hotfixes/GrassBreakListener.java similarity index 98% rename from src/buttondevteam/alipresents/components/fruit/GrassBreakListener.java rename to src/buttondevteam/alipresents/components/hotfix/hotfixes/GrassBreakListener.java index 8279aa4..7ce406f 100644 --- a/src/buttondevteam/alipresents/components/fruit/GrassBreakListener.java +++ b/src/buttondevteam/alipresents/components/hotfix/hotfixes/GrassBreakListener.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.fruit; +package buttondevteam.alipresents.components.hotfix.hotfixes; import org.bukkit.Location; import org.bukkit.Material; diff --git a/src/buttondevteam/alipresents/components/cashmob/MobKillListener.java b/src/buttondevteam/alipresents/components/hotfix/hotfixes/MobKillListener.java similarity index 93% rename from src/buttondevteam/alipresents/components/cashmob/MobKillListener.java rename to src/buttondevteam/alipresents/components/hotfix/hotfixes/MobKillListener.java index c1a4791..f13aaee 100644 --- a/src/buttondevteam/alipresents/components/cashmob/MobKillListener.java +++ b/src/buttondevteam/alipresents/components/hotfix/hotfixes/MobKillListener.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.cashmob; +package buttondevteam.alipresents.components.hotfix.hotfixes; import java.math.BigDecimal; diff --git a/src/buttondevteam/alipresents/components/hotfix/NetherDisableListener.java b/src/buttondevteam/alipresents/components/hotfix/hotfixes/NetherDisableListener.java similarity index 55% rename from src/buttondevteam/alipresents/components/hotfix/NetherDisableListener.java rename to src/buttondevteam/alipresents/components/hotfix/hotfixes/NetherDisableListener.java index 788c698..b276e44 100644 --- a/src/buttondevteam/alipresents/components/hotfix/NetherDisableListener.java +++ b/src/buttondevteam/alipresents/components/hotfix/hotfixes/NetherDisableListener.java @@ -1,4 +1,4 @@ -package buttondevteam.alipresents.components.hotfix; +package buttondevteam.alipresents.components.hotfix.hotfixes; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; @@ -7,6 +7,8 @@ import org.bukkit.event.player.PlayerPortalEvent; public class NetherDisableListener implements Listener{ @EventHandler public void onPortalEnter(PlayerPortalEvent event){ + event.getPlayer().sendMessage("[HOTFIX] This portal is disabled!"); + event.getPlayer().sendMessage("[HOTFIX] Going to the Nether is disabled on the server"); event.setCancelled(true); } } diff --git a/src/buttondevteam/alipresents/components/spawn/SpawnComponent.java b/src/buttondevteam/alipresents/components/spawn/SpawnComponent.java deleted file mode 100644 index 189d844..0000000 --- a/src/buttondevteam/alipresents/components/spawn/SpawnComponent.java +++ /dev/null @@ -1,15 +0,0 @@ -package buttondevteam.alipresents.components.spawn; - -import org.bukkit.plugin.java.JavaPlugin; - -import buttondevteam.alipresents.architecture.Component; -import buttondevteam.alipresents.components.spawn.cows.CowSpawnLoop; - -public class SpawnComponent extends Component { - - @Override - public void register(JavaPlugin plugin) { - registerListener(plugin, new CowSpawnLoop(plugin)); - } - -}