From 18e210785a49097df6cdf6305d3ec7933a27112a Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 19 Dec 2016 00:21:11 -0500 Subject: [PATCH] Hotfixed Nether Portals being active --- src/buttondevteam/alipresents/AliPresents.java | 2 ++ .../components/hotfix/HotfixComponent.java | 15 +++++++++++++++ .../components/hotfix/NetherDisableListener.java | 12 ++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java create mode 100644 src/buttondevteam/alipresents/components/hotfix/NetherDisableListener.java diff --git a/src/buttondevteam/alipresents/AliPresents.java b/src/buttondevteam/alipresents/AliPresents.java index dcc752c..9919a3f 100644 --- a/src/buttondevteam/alipresents/AliPresents.java +++ b/src/buttondevteam/alipresents/AliPresents.java @@ -12,6 +12,7 @@ import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundarie 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; @@ -30,6 +31,7 @@ public class AliPresents extends JavaPlugin{ 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); diff --git a/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java b/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java new file mode 100644 index 0000000..f8e4e10 --- /dev/null +++ b/src/buttondevteam/alipresents/components/hotfix/HotfixComponent.java @@ -0,0 +1,15 @@ +package buttondevteam.alipresents.components.hotfix; + +import org.bukkit.plugin.java.JavaPlugin; + +import buttondevteam.alipresents.architecture.Component; + +public class HotfixComponent extends Component { + + @Override + public void register(JavaPlugin plugin) { + registerListener(plugin, new NetherDisableListener()); + + } + +} diff --git a/src/buttondevteam/alipresents/components/hotfix/NetherDisableListener.java b/src/buttondevteam/alipresents/components/hotfix/NetherDisableListener.java new file mode 100644 index 0000000..788c698 --- /dev/null +++ b/src/buttondevteam/alipresents/components/hotfix/NetherDisableListener.java @@ -0,0 +1,12 @@ +package buttondevteam.alipresents.components.hotfix; + +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerPortalEvent; + +public class NetherDisableListener implements Listener{ + @EventHandler + public void onPortalEnter(PlayerPortalEvent event){ + event.setCancelled(true); + } +}