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"?>
<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"/>
<storedRefactorings deprecationInfo="true" structuralOnly="false"/>
<selectedProjects/>

View File

@ -1,6 +1,6 @@
name: 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.players.OnlinePlayerManager;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
@ -73,15 +72,15 @@ public class PandacraftUtils extends JavaPlugin {
afkManager = new AfkManager();
wESelectionDisplayManager = new WESelectionDisplayManager();
commandAliasManager = new CommandAliasManager(this);
spawnTimeManager = new SpawnTimeManager(this);
commandAliasManager = new CommandAliasManager();
spawnTimeManager = new SpawnTimeManager();
chatAnalysisManager = new ChatAnalysisManager();
creativCheatManager = new CreativCheatManager(this);
noPvpProtectManager = new NoPvpProtectManager(this);
loginLogoutMessageManager = new LoginLogoutMessageManager(this);
calculatorManager = new CalculatorManager(this);
creativCheatManager = new CreativCheatManager();
noPvpProtectManager = new NoPvpProtectManager();
loginLogoutMessageManager = new LoginLogoutMessageManager();
calculatorManager = new CalculatorManager();
survivalCuboManager = new SurvivalCuboManager();
serverPingListener = new PacketOutServerInfoListener(this);
serverPingListener = new PacketOutServerInfoListener();
staffQueueManager = new StaffQueueManager();
tpsAnalysisManager = new TPSAnalysisManager();
autoMessagesManager = new AutoMessagesManager();

View File

@ -20,15 +20,13 @@ import org.bukkit.event.player.PlayerQuitEvent;
public class CalculatorManager implements Listener {
private PandacraftUtils plugin;
private PandacraftUtils plugin = PandacraftUtils.getInstance();
private Map<Player, List<HistoryElement>> history = new HashMap<Player, List<HistoryElement>>();
public CalculatorManager(PandacraftUtils pl) {
plugin = pl;
public CalculatorManager() {
plugin.getServer().getPluginManager().registerEvents(this, plugin);
// 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;
public class CommandAliasManager implements Listener {
private PandacraftUtils plugin;
private PandacraftUtils plugin = PandacraftUtils.getInstance();
public CommandAliasManager(PandacraftUtils pl) {
plugin = pl;
public CommandAliasManager() {
plugin.getServer().getPluginManager().registerEvents(this, plugin);

View File

@ -18,13 +18,12 @@ import de.luricos.bukkit.xAuth.events.xAuthLoginEvent;
public class LoginLogoutMessageManager implements Listener {
private PandacraftUtils plugin;
private PandacraftUtils plugin = PandacraftUtils.getInstance();
private List<Player> loggedInPlayer = new ArrayList<Player>();
public LoginLogoutMessageManager(PandacraftUtils pl) {
plugin = pl;
public LoginLogoutMessageManager() {
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;
public class PacketOutServerInfoListener {
private PandacraftUtils plugin;
private PandacraftUtils plugin = PandacraftUtils.getInstance();
public PacketOutServerInfoListener(PandacraftUtils pl) {
plugin = pl;
public PacketOutServerInfoListener() {
ProtocolLibrary
.getProtocolManager()

View File

@ -9,15 +9,14 @@ import org.bukkit.scheduler.BukkitRunnable;
public class SpawnTimeManager extends BukkitRunnable {
private PandacraftUtils plugin;
private PandacraftUtils plugin = PandacraftUtils.getInstance();
int timeTick = 0;
private String initial_map_name = "spawn";
public SpawnTimeManager(PandacraftUtils pl) {
plugin = pl;
public SpawnTimeManager() {
run();
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;
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);
}

View File

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