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:
bm01
2013-02-01 06:38:25 +01:00
parent d0c0b9a089
commit 7d83dd8283
56 changed files with 487 additions and 524 deletions

View File

@ -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"));

View File

@ -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"));

View File

@ -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);
}
}

View File

@ -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);
}
/**