Because McMMOPlayerUnarmEvent is a silly name.

This commit is contained in:
GJ 2013-01-21 12:35:38 -05:00
parent 0276294569
commit 299c7ff804
3 changed files with 5 additions and 4 deletions

View File

@ -11,6 +11,7 @@ Version 1.4.00-dev
Version 1.3.14 Version 1.3.14
+ Added new Hylian Luck skill to Herbalism. + Added new Hylian Luck skill to Herbalism.
+ Added new cancellable McMMOPlayerDisarmEvent for Citizens compatibility - fires whenever a player is disarmed.
= Fixed a memory leak involving mob tracking = Fixed a memory leak involving mob tracking
- Removed extra durability loss from Leaf Blower - Removed extra durability loss from Leaf Blower

View File

@ -5,11 +5,11 @@ import org.bukkit.event.Cancellable;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
public class McMMOPlayerUnarmEvent extends McMMOPlayerSkillEvent implements Cancellable { public class McMMOPlayerDisarmEvent extends McMMOPlayerSkillEvent implements Cancellable {
private boolean cancelled; private boolean cancelled;
private Player defender; private Player defender;
public McMMOPlayerUnarmEvent(Player defender) { public McMMOPlayerDisarmEvent(Player defender) {
super(defender, SkillType.UNARMED); super(defender, SkillType.UNARMED);
this.defender = defender; this.defender = defender;
} }

View File

@ -5,7 +5,7 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.events.skills.McMMOPlayerUnarmEvent; import com.gmail.nossr50.events.skills.McMMOPlayerDisarmEvent;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
@ -36,7 +36,7 @@ public class DisarmEventHandler {
} }
protected void handleDisarm() { protected void handleDisarm() {
McMMOPlayerUnarmEvent event = new McMMOPlayerUnarmEvent(defender); McMMOPlayerDisarmEvent event = new McMMOPlayerDisarmEvent(defender);
mcMMO.p.getServer().getPluginManager().callEvent(event); mcMMO.p.getServer().getPluginManager().callEvent(event);
if(!event.isCancelled()) { if(!event.isCancelled()) {