Changed Software Architecture

based on this GoTo talk: https://www.youtube.com/watch?v=GAFZcYlO5S0
This commit is contained in:
alisolarflare 2016-11-12 09:52:08 -05:00
parent 0f1e896722
commit 0df59ba8d4
65 changed files with 273 additions and 321 deletions

View file

@ -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()+ ").");

View file

@ -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

View file

@ -1,4 +1,4 @@
package alisolarflare.modules;
package alisolarflare.components;
import org.bukkit.command.CommandSender;

View file

@ -1,4 +1,4 @@
package alisolarflare.modules;
package alisolarflare.components;
import buttondevteam.lib.chat.TBMCCommandBase;

View file

@ -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

View file

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

View file

@ -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 <frequency> [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<Link> linkList = new ArrayList<Link>();
AliLinkModule subplugin;
AliLinkComponent subplugin;
private JavaPlugin plugin;
/**

View file

@ -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{
/**

View file

@ -1,4 +1,4 @@
package alisolarflare.components.links.tasks;
package alisolarflare.components.alilinks.tasks;
import org.bukkit.Location;
import org.bukkit.Material;

View file

@ -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<Player> cbCreatives = new ArrayList<Player>();
@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));
}
}

View file

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

View file

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

View file

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

View file

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

View file

@ -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

View file

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

View file

@ -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{

View file

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

View file

@ -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 {

View file

@ -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 {

View file

@ -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{

View file

@ -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{

View file

@ -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{

View file

@ -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{

View file

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

View file

@ -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 {

View file

@ -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) {

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.gpowers;
package alisolarflare.components.gpowers;
import java.util.HashMap;
import java.util.Map;

View file

@ -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 {

View file

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

View file

@ -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 {

View file

@ -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 {

View file

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

View file

@ -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{

View file

@ -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<Link> aliLink = deserializer.loadLink(aliLink);
//System.out.println(aliLink);
}
/**@deprecated*/
@SuppressWarnings("unchecked")
public List<Link> loadLinkList(){
List<Link> aliLinkList;
try{
FileInputStream fin = new FileInputStream("AliLinkList.ser");
ObjectInputStream ois = new ObjectInputStream(fin);
aliLinkList = (List<Link>) ois.readObject();
ois.close();
return aliLinkList;
}catch(Exception ex){
ex.printStackTrace();
return null;
}
}
}

View file

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

View file

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

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.magic.tricks;
package alisolarflare.components.magic.tricks;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.EntityType;

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.magic.tricks;
package alisolarflare.components.magic.tricks;
import org.bukkit.Particle;
import org.bukkit.entity.Arrow;

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.magic.tricks;
package alisolarflare.components.magic.tricks;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.magic.tricks;
package alisolarflare.components.magic.tricks;
import org.bukkit.GameMode;
import org.bukkit.Location;

View file

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

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.magic.tricks;
package alisolarflare.components.magic.tricks;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;

View file

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

View file

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

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.minigames;
package alisolarflare.components.minigames;
public enum GameState {
Idle, FreeForAll, Heroes;

View file

@ -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<String> fighters;
private GameState gameState;

View file

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

View file

@ -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 {

View file

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

View file

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

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.minigames.data;
package alisolarflare.components.minigames.data;
import org.bukkit.Location;

View file

@ -1,4 +1,4 @@
package alisolarflare.modules.minigames.entities;
package alisolarflare.components.minigames.entities;
import org.bukkit.entity.Player;

View file

@ -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<Player> cbCreatives = new ArrayList<Player>();
@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));
}
}

View file

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

View file

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

View file

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

View file

@ -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) {

View file

@ -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*/

View file

@ -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;
/**

View file

@ -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{

View file

@ -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{

View file

@ -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{

View file

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

View file

@ -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) {