L'instance de PandacraftUtils n'est plus passé en paramètre des constructeurs des modules

This commit is contained in:
Marc Baloup 2015-01-24 03:18:11 -05:00
parent 6b01e8e28d
commit 47dca6fb8a
10 changed files with 23 additions and 32 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jardesc> <jardesc>
<jar path="PandacraftUtils/jar_export/PandacraftUtils-3.0.jar"/> <jar path="PandacraftUtils/jar_export/PandacraftUtils-3.1.jar"/>
<options buildIfNeeded="true" compress="true" descriptionLocation="/PandacraftUtils/make_jar.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/> <options buildIfNeeded="true" compress="true" descriptionLocation="/PandacraftUtils/make_jar.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
<storedRefactorings deprecationInfo="true" structuralOnly="false"/> <storedRefactorings deprecationInfo="true" structuralOnly="false"/>
<selectedProjects/> <selectedProjects/>

View File

@ -1,6 +1,6 @@
name: PandacraftUtils name: PandacraftUtils
main: net.mc_pandacraft.java.plugin.pandacraftutils.PandacraftUtils main: net.mc_pandacraft.java.plugin.pandacraftutils.PandacraftUtils
version: 3.0 version: 3.1

View File

@ -17,7 +17,6 @@ import net.mc_pandacraft.java.plugin.pandacraftutils.modules.cheat_protect.Creat
import net.mc_pandacraft.java.plugin.pandacraftutils.modules.cheat_protect.NoPvpProtectManager; import net.mc_pandacraft.java.plugin.pandacraftutils.modules.cheat_protect.NoPvpProtectManager;
import net.mc_pandacraft.java.plugin.pandacraftutils.players.OnlinePlayerManager; import net.mc_pandacraft.java.plugin.pandacraftutils.players.OnlinePlayerManager;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
@ -73,15 +72,15 @@ public class PandacraftUtils extends JavaPlugin {
afkManager = new AfkManager(); afkManager = new AfkManager();
wESelectionDisplayManager = new WESelectionDisplayManager(); wESelectionDisplayManager = new WESelectionDisplayManager();
commandAliasManager = new CommandAliasManager(this); commandAliasManager = new CommandAliasManager();
spawnTimeManager = new SpawnTimeManager(this); spawnTimeManager = new SpawnTimeManager();
chatAnalysisManager = new ChatAnalysisManager(); chatAnalysisManager = new ChatAnalysisManager();
creativCheatManager = new CreativCheatManager(this); creativCheatManager = new CreativCheatManager();
noPvpProtectManager = new NoPvpProtectManager(this); noPvpProtectManager = new NoPvpProtectManager();
loginLogoutMessageManager = new LoginLogoutMessageManager(this); loginLogoutMessageManager = new LoginLogoutMessageManager();
calculatorManager = new CalculatorManager(this); calculatorManager = new CalculatorManager();
survivalCuboManager = new SurvivalCuboManager(); survivalCuboManager = new SurvivalCuboManager();
serverPingListener = new PacketOutServerInfoListener(this); serverPingListener = new PacketOutServerInfoListener();
staffQueueManager = new StaffQueueManager(); staffQueueManager = new StaffQueueManager();
tpsAnalysisManager = new TPSAnalysisManager(); tpsAnalysisManager = new TPSAnalysisManager();
autoMessagesManager = new AutoMessagesManager(); autoMessagesManager = new AutoMessagesManager();

View File

@ -20,15 +20,13 @@ import org.bukkit.event.player.PlayerQuitEvent;
public class CalculatorManager implements Listener { public class CalculatorManager implements Listener {
private PandacraftUtils plugin; private PandacraftUtils plugin = PandacraftUtils.getInstance();
private Map<Player, List<HistoryElement>> history = new HashMap<Player, List<HistoryElement>>(); private Map<Player, List<HistoryElement>> history = new HashMap<Player, List<HistoryElement>>();
public CalculatorManager(PandacraftUtils pl) { public CalculatorManager() {
plugin = pl;
plugin.getServer().getPluginManager().registerEvents(this, plugin); plugin.getServer().getPluginManager().registerEvents(this, plugin);
// analyse des joueurs déjà en ligne (/reload) // analyse des joueurs déjà en ligne (/reload)

View File

@ -13,11 +13,10 @@ import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent;
public class CommandAliasManager implements Listener { public class CommandAliasManager implements Listener {
private PandacraftUtils plugin; private PandacraftUtils plugin = PandacraftUtils.getInstance();
public CommandAliasManager(PandacraftUtils pl) { public CommandAliasManager() {
plugin = pl;
plugin.getServer().getPluginManager().registerEvents(this, plugin); plugin.getServer().getPluginManager().registerEvents(this, plugin);

View File

@ -18,13 +18,12 @@ import de.luricos.bukkit.xAuth.events.xAuthLoginEvent;
public class LoginLogoutMessageManager implements Listener { public class LoginLogoutMessageManager implements Listener {
private PandacraftUtils plugin; private PandacraftUtils plugin = PandacraftUtils.getInstance();
private List<Player> loggedInPlayer = new ArrayList<Player>(); private List<Player> loggedInPlayer = new ArrayList<Player>();
public LoginLogoutMessageManager(PandacraftUtils pl) { public LoginLogoutMessageManager() {
plugin = pl;
plugin.getServer().getPluginManager().registerEvents(this, plugin); plugin.getServer().getPluginManager().registerEvents(this, plugin);
} }

View File

@ -18,11 +18,10 @@ import net.mc_pandacraft.java.plugin.pandacraftutils.PandacraftUtils;
import net.mc_pandacraft.java.plugin.pandacraftutils.plugin_interface.EssentialsInterface; import net.mc_pandacraft.java.plugin.pandacraftutils.plugin_interface.EssentialsInterface;
public class PacketOutServerInfoListener { public class PacketOutServerInfoListener {
private PandacraftUtils plugin; private PandacraftUtils plugin = PandacraftUtils.getInstance();
public PacketOutServerInfoListener(PandacraftUtils pl) { public PacketOutServerInfoListener() {
plugin = pl;
ProtocolLibrary ProtocolLibrary
.getProtocolManager() .getProtocolManager()

View File

@ -9,15 +9,14 @@ import org.bukkit.scheduler.BukkitRunnable;
public class SpawnTimeManager extends BukkitRunnable { public class SpawnTimeManager extends BukkitRunnable {
private PandacraftUtils plugin; private PandacraftUtils plugin = PandacraftUtils.getInstance();
int timeTick = 0; int timeTick = 0;
private String initial_map_name = "spawn"; private String initial_map_name = "spawn";
public SpawnTimeManager(PandacraftUtils pl) { public SpawnTimeManager() {
plugin = pl;
run(); run();
plugin.getServer().getScheduler().runTaskTimer(plugin, this, 1L, 2L); plugin.getServer().getScheduler().runTaskTimer(plugin, this, 1L, 2L);
} }

View File

@ -7,11 +7,10 @@ import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerMoveEvent;
public class CreativCheatManager implements Listener { public class CreativCheatManager implements Listener {
private PandacraftUtils plugin; private PandacraftUtils plugin = PandacraftUtils.getInstance();
public CreativCheatManager(PandacraftUtils pl) public CreativCheatManager()
{ {
plugin = pl;
plugin.getServer().getPluginManager().registerEvents(this, plugin); plugin.getServer().getPluginManager().registerEvents(this, plugin);
} }

View File

@ -21,7 +21,7 @@ import org.bukkit.event.player.PlayerBucketEmptyEvent;
public class NoPvpProtectManager implements Listener { public class NoPvpProtectManager implements Listener {
private PandacraftUtils plugin; private PandacraftUtils plugin = PandacraftUtils.getInstance();
private double lava_distance = 5; private double lava_distance = 5;
private double fire_distance = 5; private double fire_distance = 5;
@ -29,9 +29,8 @@ public class NoPvpProtectManager implements Listener {
private String last_logger_message = ""; private String last_logger_message = "";
public NoPvpProtectManager(PandacraftUtils pl) public NoPvpProtectManager()
{ {
plugin = pl;
plugin.getServer().getPluginManager().registerEvents(this, plugin); plugin.getServer().getPluginManager().registerEvents(this, plugin);
} }