mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Refactor all the listeners!
This commit is contained in:
parent
05724ae64f
commit
fea3bd6aa4
@ -300,6 +300,7 @@ public class Config extends ConfigLoader{
|
|||||||
|
|
||||||
// Setup default HUD
|
// Setup default HUD
|
||||||
String temp = config.getString("Spout.HUD.Default", "STANDARD");
|
String temp = config.getString("Spout.HUD.Default", "STANDARD");
|
||||||
|
|
||||||
for (HUDType x : HUDType.values()) {
|
for (HUDType x : HUDType.values()) {
|
||||||
if (x.toString().equalsIgnoreCase(temp)) {
|
if (x.toString().equalsIgnoreCase(temp)) {
|
||||||
defaulthud = x;
|
defaulthud = x;
|
||||||
@ -323,12 +324,6 @@ public class Config extends ConfigLoader{
|
|||||||
showDisplayName = config.getBoolean("Spout.Party.HUD.Show_Display_Name", false);
|
showDisplayName = config.getBoolean("Spout.Party.HUD.Show_Display_Name", false);
|
||||||
partybar = config.getBoolean("Spout.Party.HUD.Enabled", true);
|
partybar = config.getBoolean("Spout.Party.HUD.Enabled", true);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
enableOnlyActivateWhenSneaking = config.getBoolean("Abilities.Activation.Only_Activate_When_Sneaking", false);
|
enableOnlyActivateWhenSneaking = config.getBoolean("Abilities.Activation.Only_Activate_When_Sneaking", false);
|
||||||
|
|
||||||
greenTerraCooldown = config.getInt("Abilities.Cooldowns.Green_Terra", 240);
|
greenTerraCooldown = config.getInt("Abilities.Cooldowns.Green_Terra", 240);
|
||||||
|
@ -40,10 +40,10 @@ import org.bukkit.metadata.FixedMetadataValue;
|
|||||||
|
|
||||||
import org.getspout.spoutapi.sound.SoundEffect;
|
import org.getspout.spoutapi.sound.SoundEffect;
|
||||||
|
|
||||||
public class mcBlockListener implements Listener {
|
public class BlockListener implements Listener {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
|
|
||||||
public mcBlockListener(final mcMMO plugin) {
|
public BlockListener(final mcMMO plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
@ -40,10 +40,10 @@ import com.gmail.nossr50.skills.BlastMining;
|
|||||||
import com.gmail.nossr50.skills.Skills;
|
import com.gmail.nossr50.skills.Skills;
|
||||||
import com.gmail.nossr50.skills.Taming;
|
import com.gmail.nossr50.skills.Taming;
|
||||||
|
|
||||||
public class mcEntityListener implements Listener {
|
public class EntityListener implements Listener {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
|
|
||||||
public mcEntityListener(final mcMMO plugin) {
|
public EntityListener(final mcMMO plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
@ -49,10 +49,10 @@ import com.gmail.nossr50.skills.Repair;
|
|||||||
import com.gmail.nossr50.skills.Skills;
|
import com.gmail.nossr50.skills.Skills;
|
||||||
import com.gmail.nossr50.skills.Taming;
|
import com.gmail.nossr50.skills.Taming;
|
||||||
|
|
||||||
public class mcPlayerListener implements Listener {
|
public class PlayerListener implements Listener {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
|
|
||||||
public mcPlayerListener(final mcMMO plugin) {
|
public PlayerListener(final mcMMO plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
@ -8,7 +8,7 @@ import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent;
|
|||||||
/**
|
/**
|
||||||
* Listener for listening to our own events, only really useful for catching errors
|
* Listener for listening to our own events, only really useful for catching errors
|
||||||
*/
|
*/
|
||||||
public class mcSelfListener implements Listener {
|
public class SelfListener implements Listener {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monitor internal XP gain events.
|
* Monitor internal XP gain events.
|
@ -11,10 +11,10 @@ import com.gmail.nossr50.mcMMO;
|
|||||||
import com.gmail.nossr50.datatypes.popups.PopupMMO;
|
import com.gmail.nossr50.datatypes.popups.PopupMMO;
|
||||||
import com.gmail.nossr50.spout.SpoutStuff;
|
import com.gmail.nossr50.spout.SpoutStuff;
|
||||||
|
|
||||||
public class mcSpoutInputListener implements Listener {
|
public class SpoutInputListener implements Listener {
|
||||||
private mcMMO plugin;
|
private mcMMO plugin;
|
||||||
|
|
||||||
public mcSpoutInputListener(mcMMO plugin) {
|
public SpoutInputListener(mcMMO plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
@ -13,11 +13,11 @@ import com.gmail.nossr50.datatypes.HUDmmo;
|
|||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.spout.SpoutStuff;
|
import com.gmail.nossr50.spout.SpoutStuff;
|
||||||
|
|
||||||
public class mcSpoutListener implements Listener {
|
public class SpoutListener implements Listener {
|
||||||
//Why do we have this here? We never use it...
|
//Why do we have this here? We never use it...
|
||||||
mcMMO plugin = null;
|
mcMMO plugin = null;
|
||||||
|
|
||||||
public mcSpoutListener(mcMMO pluginx) {
|
public SpoutListener(mcMMO pluginx) {
|
||||||
plugin = pluginx;
|
plugin = pluginx;
|
||||||
}
|
}
|
||||||
|
|
@ -17,11 +17,11 @@ import com.gmail.nossr50.datatypes.buttons.ButtonPartyToggle;
|
|||||||
import com.gmail.nossr50.datatypes.popups.PopupMMO;
|
import com.gmail.nossr50.datatypes.popups.PopupMMO;
|
||||||
import com.gmail.nossr50.spout.SpoutStuff;
|
import com.gmail.nossr50.spout.SpoutStuff;
|
||||||
|
|
||||||
public class mcSpoutScreenListener implements Listener {
|
public class SpoutScreenListener implements Listener {
|
||||||
//Why do we have this here? We never use it...
|
//Why do we have this here? We never use it...
|
||||||
mcMMO plugin = null;
|
mcMMO plugin = null;
|
||||||
|
|
||||||
public mcSpoutScreenListener(mcMMO pluginx) {
|
public SpoutScreenListener(mcMMO pluginx) {
|
||||||
plugin = pluginx;
|
plugin = pluginx;
|
||||||
}
|
}
|
||||||
|
|
@ -8,9 +8,9 @@ import com.gmail.nossr50.commands.party.*;
|
|||||||
import com.gmail.nossr50.commands.general.*;
|
import com.gmail.nossr50.commands.general.*;
|
||||||
import com.gmail.nossr50.config.*;
|
import com.gmail.nossr50.config.*;
|
||||||
import com.gmail.nossr50.runnables.*;
|
import com.gmail.nossr50.runnables.*;
|
||||||
import com.gmail.nossr50.listeners.mcBlockListener;
|
import com.gmail.nossr50.listeners.BlockListener;
|
||||||
import com.gmail.nossr50.listeners.mcEntityListener;
|
import com.gmail.nossr50.listeners.EntityListener;
|
||||||
import com.gmail.nossr50.listeners.mcPlayerListener;
|
import com.gmail.nossr50.listeners.PlayerListener;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.mcLocale;
|
||||||
import com.gmail.nossr50.party.Party;
|
import com.gmail.nossr50.party.Party;
|
||||||
|
|
||||||
@ -36,9 +36,9 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
public class mcMMO extends JavaPlugin {
|
public class mcMMO extends JavaPlugin {
|
||||||
|
|
||||||
private final mcPlayerListener playerListener = new mcPlayerListener(this);
|
private final PlayerListener playerListener = new PlayerListener(this);
|
||||||
private final mcBlockListener blockListener = new mcBlockListener(this);
|
private final BlockListener blockListener = new BlockListener(this);
|
||||||
private final mcEntityListener entityListener = new mcEntityListener(this);
|
private final EntityListener entityListener = new EntityListener(this);
|
||||||
|
|
||||||
public HashMap<String, String> aliasMap = new HashMap<String, String>(); //Alias - Command
|
public HashMap<String, String> aliasMap = new HashMap<String, String>(); //Alias - Command
|
||||||
public HashMap<Entity, Integer> arrowTracker = new HashMap<Entity, Integer>();
|
public HashMap<Entity, Integer> arrowTracker = new HashMap<Entity, Integer>();
|
||||||
|
@ -27,9 +27,9 @@ import com.gmail.nossr50.datatypes.HUDmmo;
|
|||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.popups.PopupMMO;
|
import com.gmail.nossr50.datatypes.popups.PopupMMO;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.listeners.mcSpoutInputListener;
|
import com.gmail.nossr50.listeners.SpoutInputListener;
|
||||||
import com.gmail.nossr50.listeners.mcSpoutListener;
|
import com.gmail.nossr50.listeners.SpoutListener;
|
||||||
import com.gmail.nossr50.listeners.mcSpoutScreenListener;
|
import com.gmail.nossr50.listeners.SpoutScreenListener;
|
||||||
|
|
||||||
public class SpoutStuff {
|
public class SpoutStuff {
|
||||||
private static mcMMO plugin = mcMMO.p;
|
private static mcMMO plugin = mcMMO.p;
|
||||||
@ -40,9 +40,9 @@ public class SpoutStuff {
|
|||||||
public final static String hudRetroDirectory = hudDirectory + "Retro" + File.separator;
|
public final static String hudRetroDirectory = hudDirectory + "Retro" + File.separator;
|
||||||
public final static String soundDirectory = spoutDirectory + "Sound" + File.separator;
|
public final static String soundDirectory = spoutDirectory + "Sound" + File.separator;
|
||||||
|
|
||||||
private final static mcSpoutListener spoutListener = new mcSpoutListener(plugin);
|
private final static SpoutListener spoutListener = new SpoutListener(plugin);
|
||||||
private final static mcSpoutInputListener spoutInputListener = new mcSpoutInputListener(plugin);
|
private final static SpoutInputListener spoutInputListener = new SpoutInputListener(plugin);
|
||||||
private final static mcSpoutScreenListener spoutScreenListener = new mcSpoutScreenListener(plugin);
|
private final static SpoutScreenListener spoutScreenListener = new SpoutScreenListener(plugin);
|
||||||
|
|
||||||
public static HashMap<Player, HUDmmo> playerHUDs = new HashMap<Player, HUDmmo>();
|
public static HashMap<Player, HUDmmo> playerHUDs = new HashMap<Player, HUDmmo>();
|
||||||
public static HashMap<SpoutPlayer, PopupMMO> playerScreens = new HashMap<SpoutPlayer, PopupMMO>();
|
public static HashMap<SpoutPlayer, PopupMMO> playerScreens = new HashMap<SpoutPlayer, PopupMMO>();
|
||||||
|
Loading…
Reference in New Issue
Block a user