mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
No reason to have our scoreboard stuff in a different listener.
This commit is contained in:
parent
abfedf381d
commit
734815c58d
@ -1,5 +1,6 @@
|
|||||||
package com.gmail.nossr50.listeners;
|
package com.gmail.nossr50.listeners;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
@ -353,6 +354,7 @@ public class PlayerListener implements Listener {
|
|||||||
BleedTimerTask.bleedOut(player);
|
BleedTimerTask.bleedOut(player);
|
||||||
mcMMOPlayer.getProfile().save();
|
mcMMOPlayer.getProfile().save();
|
||||||
UserManager.remove(player.getName());
|
UserManager.remove(player.getName());
|
||||||
|
ScoreboardManager.teardownPlayer(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -373,6 +375,7 @@ public class PlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
UserManager.addUser(player).actualizeRespawnATS();
|
UserManager.addUser(player).actualizeRespawnATS();
|
||||||
|
ScoreboardManager.setupPlayer(player);
|
||||||
|
|
||||||
if (Config.getInstance().getMOTDEnabled() && Permissions.motd(player)) {
|
if (Config.getInstance().getMOTDEnabled() && Permissions.motd(player)) {
|
||||||
Motd.displayAll(player);
|
Motd.displayAll(player);
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
package com.gmail.nossr50.listeners;
|
|
||||||
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.EventPriority;
|
|
||||||
import org.bukkit.event.Listener;
|
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
|
||||||
|
|
||||||
import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent;
|
|
||||||
import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent;
|
|
||||||
import com.gmail.nossr50.events.skills.abilities.McMMOPlayerAbilityActivateEvent;
|
|
||||||
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
|
|
||||||
|
|
||||||
public class ScoreboardsListener implements Listener {
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
|
||||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
|
||||||
ScoreboardManager.setupPlayer(event.getPlayer());
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
|
||||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
|
||||||
ScoreboardManager.teardownPlayer(event.getPlayer());
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
|
||||||
public void onPlayerLevelUp(McMMOPlayerLevelUpEvent event) {
|
|
||||||
ScoreboardManager.handleLevelUp(event.getPlayer(), event.getSkill());
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
|
||||||
public void onPlayerXp(McMMOPlayerXpGainEvent event) {
|
|
||||||
ScoreboardManager.handleXp(event.getPlayer(), event.getSkill());
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
|
||||||
public void onAbility(McMMOPlayerAbilityActivateEvent event) {
|
|
||||||
ScoreboardManager.cooldownUpdate(event.getPlayer(), event.getSkill());
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +1,10 @@
|
|||||||
package com.gmail.nossr50.listeners;
|
package com.gmail.nossr50.listeners;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
|
import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent;
|
||||||
|
import com.gmail.nossr50.events.skills.abilities.McMMOPlayerAbilityActivateEvent;
|
||||||
|
import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
@ -10,12 +15,27 @@ import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent;
|
|||||||
public class SelfListener implements Listener {
|
public class SelfListener implements Listener {
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onPlayerLevelUp(McMMOPlayerLevelUpEvent event) {
|
public void onPlayerLevelUp(McMMOPlayerLevelUpEvent event) {
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
SkillType skill = event.getSkill();
|
||||||
|
|
||||||
|
ScoreboardManager.handleLevelUp(player, skill);
|
||||||
|
|
||||||
if (!Config.getInstance().getLevelUpEffectsEnabled()) {
|
if (!Config.getInstance().getLevelUpEffectsEnabled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((event.getSkillLevel() % Config.getInstance().getLevelUpEffectsTier()) == 0) {
|
if ((event.getSkillLevel() % Config.getInstance().getLevelUpEffectsTier()) == 0) {
|
||||||
event.getSkill().celebrateLevelUp(event.getPlayer());
|
skill.celebrateLevelUp(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
|
public void onPlayerXp(McMMOPlayerXpGainEvent event) {
|
||||||
|
ScoreboardManager.handleXp(event.getPlayer(), event.getSkill());
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
|
public void onAbility(McMMOPlayerAbilityActivateEvent event) {
|
||||||
|
ScoreboardManager.cooldownUpdate(event.getPlayer(), event.getSkill());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,6 @@ import com.gmail.nossr50.listeners.BlockListener;
|
|||||||
import com.gmail.nossr50.listeners.EntityListener;
|
import com.gmail.nossr50.listeners.EntityListener;
|
||||||
import com.gmail.nossr50.listeners.InventoryListener;
|
import com.gmail.nossr50.listeners.InventoryListener;
|
||||||
import com.gmail.nossr50.listeners.PlayerListener;
|
import com.gmail.nossr50.listeners.PlayerListener;
|
||||||
import com.gmail.nossr50.listeners.ScoreboardsListener;
|
|
||||||
import com.gmail.nossr50.listeners.SelfListener;
|
import com.gmail.nossr50.listeners.SelfListener;
|
||||||
import com.gmail.nossr50.listeners.WorldListener;
|
import com.gmail.nossr50.listeners.WorldListener;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
@ -441,7 +440,6 @@ public class mcMMO extends JavaPlugin {
|
|||||||
pluginManager.registerEvents(new EntityListener(this), this);
|
pluginManager.registerEvents(new EntityListener(this), this);
|
||||||
pluginManager.registerEvents(new InventoryListener(this), this);
|
pluginManager.registerEvents(new InventoryListener(this), this);
|
||||||
pluginManager.registerEvents(new SelfListener(), this);
|
pluginManager.registerEvents(new SelfListener(), this);
|
||||||
pluginManager.registerEvents(new ScoreboardsListener(), this);
|
|
||||||
pluginManager.registerEvents(new WorldListener(this), this);
|
pluginManager.registerEvents(new WorldListener(this), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user