mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-16 04:24:43 +02:00
Refactoring to make my life easier
This commit is contained in:
@ -1,35 +0,0 @@
|
||||
package com.gmail.nossr50.events.skills.secondaryabilities;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
|
||||
|
||||
public class SecondaryAbilityEvent extends McMMOPlayerSkillEvent implements Cancellable {
|
||||
private SecondaryAbility secondaryAbility;
|
||||
private boolean cancelled;
|
||||
|
||||
public SecondaryAbilityEvent(Player player, SecondaryAbility secondaryAbility) {
|
||||
super(player, SkillType.bySecondaryAbility(secondaryAbility));
|
||||
this.secondaryAbility = secondaryAbility;
|
||||
cancelled = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the SecondaryAbility involved in the event
|
||||
* @return the SecondaryAbility
|
||||
*/
|
||||
public SecondaryAbility getSecondaryAbility() {
|
||||
return secondaryAbility;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean newValue) {
|
||||
this.cancelled = newValue;
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.gmail.nossr50.events.skills.secondaryabilities;
|
||||
|
||||
import com.gmail.nossr50.datatypes.skills.SubSkill;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkill;
|
||||
import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
|
||||
|
||||
public class SubSkillEvent extends McMMOPlayerSkillEvent implements Cancellable {
|
||||
private SubSkill subSkill;
|
||||
private boolean cancelled;
|
||||
|
||||
public SubSkillEvent(Player player, SubSkill subSkill) {
|
||||
super(player, PrimarySkill.bySecondaryAbility(subSkill));
|
||||
this.subSkill = subSkill;
|
||||
cancelled = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the SubSkill involved in the event
|
||||
* @return the SubSkill
|
||||
*/
|
||||
public SubSkill getSubSkill() {
|
||||
return subSkill;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean newValue) {
|
||||
this.cancelled = newValue;
|
||||
}
|
||||
}
|
@ -1,13 +1,12 @@
|
||||
package com.gmail.nossr50.events.skills.secondaryabilities;
|
||||
|
||||
import com.gmail.nossr50.datatypes.skills.SubSkill;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
|
||||
|
||||
public class SecondaryAbilityWeightedActivationCheckEvent extends SecondaryAbilityEvent {
|
||||
public class SubSkillWeightedActivationCheckEvent extends SubSkillEvent {
|
||||
private double chance;
|
||||
|
||||
public SecondaryAbilityWeightedActivationCheckEvent(Player player, SecondaryAbility ability, double chance) {
|
||||
public SubSkillWeightedActivationCheckEvent(Player player, SubSkill ability, double chance) {
|
||||
super(player, ability);
|
||||
this.chance = chance;
|
||||
}
|
Reference in New Issue
Block a user