mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 19:24:44 +02:00
Event updates
This commit is contained in:
@ -3,28 +3,16 @@ package com.gmail.nossr50.events.skills.abilities;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
|
||||
|
||||
public class McMMOPlayerAbilityActivateEvent extends McMMOPlayerSkillEvent implements Cancellable {
|
||||
|
||||
private AbilityType abilityType;
|
||||
public class McMMOPlayerAbilityActivateEvent extends McMMOPlayerAbilityEvent implements Cancellable {
|
||||
private boolean cancelled;
|
||||
|
||||
public McMMOPlayerAbilityActivateEvent(Player player, SkillType skill) {
|
||||
super(player, skill);
|
||||
abilityType = skill.getAbility();
|
||||
cancelled = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The ability type involved in this event
|
||||
*/
|
||||
public AbilityType getAbilityType() {
|
||||
return abilityType;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
@ -2,21 +2,10 @@ package com.gmail.nossr50.events.skills.abilities;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
|
||||
|
||||
public class McMMOPlayerAbilityDeactivateEvent extends McMMOPlayerSkillEvent {
|
||||
|
||||
private AbilityType ability;
|
||||
|
||||
public class McMMOPlayerAbilityDeactivateEvent extends McMMOPlayerAbilityEvent {
|
||||
public McMMOPlayerAbilityDeactivateEvent(Player player, SkillType skill) {
|
||||
super(player, skill);
|
||||
this.ability = skill.getAbility();
|
||||
}
|
||||
|
||||
public AbilityType getAbility() {
|
||||
return ability;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,20 @@
|
||||
package com.gmail.nossr50.events.skills.abilities;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
|
||||
|
||||
public class McMMOPlayerAbilityEvent extends McMMOPlayerSkillEvent {
|
||||
private AbilityType ability;
|
||||
|
||||
protected McMMOPlayerAbilityEvent(Player player, SkillType skill) {
|
||||
super(player, skill);
|
||||
ability = skill.getAbility();
|
||||
}
|
||||
|
||||
public AbilityType getAbility() {
|
||||
return ability;
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.gmail.nossr50.events.skills.fishing;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
|
||||
|
||||
public class McMMOPlayerFishingEvent extends McMMOPlayerSkillEvent implements Cancellable {
|
||||
private boolean cancelled;
|
||||
|
||||
protected McMMOPlayerFishingEvent(Player player) {
|
||||
super(player, SkillType.FISHING);
|
||||
cancelled = false;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean newValue) {
|
||||
this.cancelled = newValue;
|
||||
}
|
||||
}
|
@ -1,20 +1,14 @@
|
||||
package com.gmail.nossr50.events.skills.fishing;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
|
||||
|
||||
public class McMMOPlayerFishingTreasureEvent extends McMMOPlayerSkillEvent implements Cancellable {
|
||||
|
||||
private boolean cancelled = false;
|
||||
public class McMMOPlayerFishingTreasureEvent extends McMMOPlayerFishingEvent {
|
||||
private ItemStack treasure;
|
||||
private int xp;
|
||||
|
||||
public McMMOPlayerFishingTreasureEvent(Player player, ItemStack treasure, int xp) {
|
||||
super(player, SkillType.FISHING);
|
||||
super(player);
|
||||
this.treasure = treasure;
|
||||
this.xp = xp;
|
||||
}
|
||||
@ -27,14 +21,6 @@ public class McMMOPlayerFishingTreasureEvent extends McMMOPlayerSkillEvent imple
|
||||
this.treasure = item;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean newValue) {
|
||||
this.cancelled = newValue;
|
||||
}
|
||||
|
||||
public int getXp() {
|
||||
return xp;
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class McMMOPlayerMagicHunterEvent extends McMMOPlayerFishingTreasureEvent {
|
||||
|
||||
private Map<Enchantment, Integer> enchants;
|
||||
|
||||
public McMMOPlayerMagicHunterEvent(Player player, ItemStack treasure, int xp, Map<Enchantment, Integer> enchants) {
|
||||
|
@ -1,30 +1,16 @@
|
||||
package com.gmail.nossr50.events.skills.fishing;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
|
||||
|
||||
public class McMMOPlayerShakeEvent extends McMMOPlayerSkillEvent implements Cancellable {
|
||||
|
||||
private boolean cancelled = false;
|
||||
public class McMMOPlayerShakeEvent extends McMMOPlayerFishingEvent {
|
||||
private ItemStack drop;
|
||||
|
||||
public McMMOPlayerShakeEvent(Player player, ItemStack drop) {
|
||||
super(player, SkillType.FISHING);
|
||||
super(player);
|
||||
this.drop = drop;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean newValue) {
|
||||
this.cancelled = newValue;
|
||||
}
|
||||
|
||||
public ItemStack getDrop() {
|
||||
return drop;
|
||||
}
|
||||
@ -32,5 +18,4 @@ public class McMMOPlayerShakeEvent extends McMMOPlayerSkillEvent implements Canc
|
||||
public void setDrop(ItemStack drop) {
|
||||
this.drop = drop;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user