mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
Put McMMOPlayer to use where it made sense
It's basically a wrapper for anything related to players, as a consequence Users.getProfile() is now depreciated. Also removed SkillTools.xpProcessing() because of some redundancy with McMMOPlayer.addXp(). + some cleanup for consistency sake.
This commit is contained in:
@ -11,7 +11,6 @@ public class BleedEventHandler {
|
||||
private SwordsManager manager;
|
||||
private int skillLevel;
|
||||
private LivingEntity defender;
|
||||
|
||||
protected int skillModifier;
|
||||
|
||||
protected BleedEventHandler(SwordsManager manager, LivingEntity defender) {
|
||||
@ -40,7 +39,7 @@ public class BleedEventHandler {
|
||||
}
|
||||
|
||||
protected void sendAbilityMessages() {
|
||||
manager.getPlayer().sendMessage(LocaleLoader.getString("Swords.Combat.Bleeding"));
|
||||
manager.getMcMMOPlayer().getPlayer().sendMessage(LocaleLoader.getString("Swords.Combat.Bleeding"));
|
||||
|
||||
if (defender instanceof Player) {
|
||||
((Player) defender).sendMessage(LocaleLoader.getString("Swords.Combat.Bleeding.Started"));
|
||||
|
@ -9,15 +9,12 @@ import com.gmail.nossr50.util.Misc;
|
||||
|
||||
public class CounterAttackEventHandler {
|
||||
private SwordsManager manager;
|
||||
private Player player;
|
||||
private LivingEntity attacker;
|
||||
private int damage;
|
||||
|
||||
protected int skillModifier;
|
||||
|
||||
protected CounterAttackEventHandler(SwordsManager manager, LivingEntity attacker, int damage) {
|
||||
this.manager = manager;
|
||||
this.player = manager.getPlayer();
|
||||
this.attacker = attacker;
|
||||
this.damage = damage;
|
||||
}
|
||||
@ -31,10 +28,7 @@ public class CounterAttackEventHandler {
|
||||
}
|
||||
|
||||
protected void sendAbilityMessages() {
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
player.sendMessage(LocaleLoader.getString("Swords.Combat.Countered"));
|
||||
manager.getMcMMOPlayer().getPlayer().sendMessage(LocaleLoader.getString("Swords.Combat.Countered"));
|
||||
|
||||
if (attacker instanceof Player) {
|
||||
((Player) attacker).sendMessage(LocaleLoader.getString("Swords.Combat.Counter.Hit"));
|
||||
|
@ -1,25 +1,24 @@
|
||||
package com.gmail.nossr50.skills.swords;
|
||||
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.skills.runnables.BleedTimer;
|
||||
import com.gmail.nossr50.skills.utilities.CombatTools;
|
||||
import com.gmail.nossr50.skills.utilities.SkillType;
|
||||
|
||||
public class SerratedStrikesEventHandler {
|
||||
private Player player;
|
||||
private SwordsManager manager;
|
||||
private LivingEntity target;
|
||||
private int damage;
|
||||
|
||||
protected SerratedStrikesEventHandler(SwordsManager manager, LivingEntity target, int damage) {
|
||||
this.player = manager.getPlayer();
|
||||
this.manager = manager;
|
||||
this.target = target;
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
protected void applyAbilityEffects() {
|
||||
CombatTools.applyAbilityAoE(player, target, damage / Swords.serratedStrikesModifier, SkillType.SWORDS);
|
||||
CombatTools.applyAbilityAoE(manager.getMcMMOPlayer().getPlayer(), target, damage / Swords.serratedStrikesModifier, SkillType.SWORDS);
|
||||
BleedTimer.add(target, Swords.serratedStrikesBleedTicks);
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,15 @@
|
||||
package com.gmail.nossr50.skills.swords;
|
||||
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.datatypes.McMMOPlayer;
|
||||
import com.gmail.nossr50.skills.SkillManager;
|
||||
import com.gmail.nossr50.skills.utilities.SkillType;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
|
||||
public class SwordsManager extends SkillManager {
|
||||
public SwordsManager (Player player) {
|
||||
super(player, SkillType.SWORDS);
|
||||
public SwordsManager(McMMOPlayer mcMMOPlayer) {
|
||||
super(mcMMOPlayer, SkillType.SWORDS);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user