mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 19:24:44 +02:00
CompatibilityLayer framework
This commit is contained in:
@ -10,6 +10,7 @@ import org.bukkit.event.Cancellable;
|
||||
public class SubSkillEvent extends McMMOPlayerSkillEvent implements Cancellable {
|
||||
private SubSkillType subSkillType;
|
||||
private boolean cancelled = false;
|
||||
private double resultModifier = 1.0D;
|
||||
|
||||
/**
|
||||
* Only skills using the old system will fire this event
|
||||
@ -23,11 +24,33 @@ public class SubSkillEvent extends McMMOPlayerSkillEvent implements Cancellable
|
||||
this.subSkillType = subSkillType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Only skills using the old system will fire this event
|
||||
* @param player target player
|
||||
* @param subSkillType target subskill
|
||||
* @param resultModifier a value multiplied against the final result of the dice roll, typically between 0-1.0
|
||||
* @Deprecated Skills will be using a new system stemming from the AbstractSubSkill class so make sure you check for both events, this event will be removed eventually.
|
||||
*/
|
||||
@Deprecated
|
||||
public SubSkillEvent(Player player, SubSkillType subSkillType, double resultModifier) {
|
||||
super(player, PrimarySkillType.bySecondaryAbility(subSkillType));
|
||||
this.subSkillType = subSkillType;
|
||||
this.resultModifier = resultModifier;
|
||||
}
|
||||
|
||||
public SubSkillEvent(Player player, AbstractSubSkill abstractSubSkill)
|
||||
{
|
||||
super(player, abstractSubSkill.getPrimarySkill());
|
||||
}
|
||||
|
||||
public double getResultModifier() {
|
||||
return resultModifier;
|
||||
}
|
||||
|
||||
public void setResultModifier(double resultModifier) {
|
||||
this.resultModifier = resultModifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the SubSkillType involved in the event
|
||||
* @return the SubSkillType
|
||||
|
Reference in New Issue
Block a user