refactored hotfixes

This commit is contained in:
alisolarflare 2016-12-19 15:58:10 -05:00
parent 18e210785a
commit 341fb1be2e
9 changed files with 16 additions and 58 deletions

View file

@ -7,15 +7,12 @@ import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import buttondevteam.alipresents.components.alilinks.AliLinkComponent; import buttondevteam.alipresents.components.alilinks.AliLinkComponent;
import buttondevteam.alipresents.components.cashmob.CashMobComponent;
import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesComponent; import buttondevteam.alipresents.components.creativeboundaries.CreativeBoundariesComponent;
import buttondevteam.alipresents.components.flaircolour.FlairColourComponent; import buttondevteam.alipresents.components.flaircolour.FlairColourComponent;
import buttondevteam.alipresents.components.fruit.FruitComponent;
import buttondevteam.alipresents.components.gpower.GPowerComponent; import buttondevteam.alipresents.components.gpower.GPowerComponent;
import buttondevteam.alipresents.components.hotfix.HotfixComponent; import buttondevteam.alipresents.components.hotfix.HotfixComponent;
import buttondevteam.alipresents.components.insurance.InsuranceComponent; import buttondevteam.alipresents.components.insurance.InsuranceComponent;
import buttondevteam.alipresents.components.magic.MagicComponent; import buttondevteam.alipresents.components.magic.MagicComponent;
import buttondevteam.alipresents.components.spawn.SpawnComponent;
public class AliPresents extends JavaPlugin{ public class AliPresents extends JavaPlugin{
public void onEnable(){ public void onEnable(){
@ -26,16 +23,13 @@ public class AliPresents extends JavaPlugin{
new AliLinkComponent().register(this); new AliLinkComponent().register(this);
new CashMobComponent().register(this);
new CreativeBoundariesComponent().register(this); new CreativeBoundariesComponent().register(this);
new FlairColourComponent().register(this); new FlairColourComponent().register(this);
new FruitComponent().register(this);
new GPowerComponent().register(this); new GPowerComponent().register(this);
new HotfixComponent().register(this); new HotfixComponent().register(this);
new InsuranceComponent().register(this); new InsuranceComponent().register(this);
new MagicComponent().register(this); new MagicComponent().register(this);
//new MetricsComponent().register(this); //new MetricsComponent().register(this);
new SpawnComponent().register(this);
logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ")."); logger.info(pdfFile.getName() + " has fully registered (V." + pdfFile.getVersion()+ ").");

View file

@ -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")));
}
}

View file

@ -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());
}
}

View file

@ -1,14 +1,24 @@
package buttondevteam.alipresents.components.hotfix; package buttondevteam.alipresents.components.hotfix;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import com.earth2me.essentials.Essentials;
import buttondevteam.alipresents.architecture.Component; 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 { public class HotfixComponent extends Component {
@Override @Override
public void register(JavaPlugin plugin) { public void register(JavaPlugin plugin) {
registerListener(plugin, new NetherDisableListener()); registerListener(plugin, new NetherDisableListener());
registerListener(plugin, new CowSpawnLoop(plugin));
registerListener(plugin, new MobKillListener((Essentials) Bukkit.getPluginManager().getPlugin("Essentials")));
registerListener(plugin, new GrassBreakListener());
} }

View file

@ -1,4 +1,4 @@
package buttondevteam.alipresents.components.spawn.cows; package buttondevteam.alipresents.components.hotfix.hotfixes;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;

View file

@ -1,4 +1,4 @@
package buttondevteam.alipresents.components.fruit; package buttondevteam.alipresents.components.hotfix.hotfixes;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;

View file

@ -1,4 +1,4 @@
package buttondevteam.alipresents.components.cashmob; package buttondevteam.alipresents.components.hotfix.hotfixes;
import java.math.BigDecimal; import java.math.BigDecimal;

View file

@ -1,4 +1,4 @@
package buttondevteam.alipresents.components.hotfix; package buttondevteam.alipresents.components.hotfix.hotfixes;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
@ -7,6 +7,8 @@ import org.bukkit.event.player.PlayerPortalEvent;
public class NetherDisableListener implements Listener{ public class NetherDisableListener implements Listener{
@EventHandler @EventHandler
public void onPortalEnter(PlayerPortalEvent event){ 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); event.setCancelled(true);
} }
} }

View file

@ -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));
}
}