|
@@ -5,19 +5,19 @@ import org.bukkit.event.entity.EntityDamageEvent;
|
|
|
|
|
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
|
import com.gmail.nossr50.datatypes.SkillType;
|
|
import com.gmail.nossr50.datatypes.SkillType;
|
|
|
|
+import com.gmail.nossr50.util.Permissions;
|
|
import com.gmail.nossr50.util.Users;
|
|
import com.gmail.nossr50.util.Users;
|
|
|
|
|
|
public class AcrobaticsManager {
|
|
public class AcrobaticsManager {
|
|
private Player player;
|
|
private Player player;
|
|
private PlayerProfile profile;
|
|
private PlayerProfile profile;
|
|
private int skillLevel;
|
|
private int skillLevel;
|
|
- private AcrobaticsPermissionsHandler permHandler;
|
|
|
|
|
|
+ private Permissions permissionInstance = Permissions.getInstance();
|
|
|
|
|
|
public AcrobaticsManager (Player player) {
|
|
public AcrobaticsManager (Player player) {
|
|
this.player = player;
|
|
this.player = player;
|
|
this.profile = Users.getProfile(player);
|
|
this.profile = Users.getProfile(player);
|
|
this.skillLevel = profile.getSkillLevel(SkillType.ACROBATICS);
|
|
this.skillLevel = profile.getSkillLevel(SkillType.ACROBATICS);
|
|
- this.permHandler = new AcrobaticsPermissionsHandler(player);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -26,7 +26,7 @@ public class AcrobaticsManager {
|
|
* @param event The event to check
|
|
* @param event The event to check
|
|
*/
|
|
*/
|
|
public void rollCheck(EntityDamageEvent event) {
|
|
public void rollCheck(EntityDamageEvent event) {
|
|
- if (!permHandler.hasRollPermissions()) {
|
|
|
|
|
|
+ if (!permissionInstance.roll(player)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -48,7 +48,7 @@ public class AcrobaticsManager {
|
|
* @param event The event to check
|
|
* @param event The event to check
|
|
*/
|
|
*/
|
|
public void dodgeCheck(EntityDamageEvent event) {
|
|
public void dodgeCheck(EntityDamageEvent event) {
|
|
- if (!permHandler.canDodge()) {
|
|
|
|
|
|
+ if (!permissionInstance.dodge(player)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -72,8 +72,4 @@ public class AcrobaticsManager {
|
|
protected int getSkillLevel() {
|
|
protected int getSkillLevel() {
|
|
return skillLevel;
|
|
return skillLevel;
|
|
}
|
|
}
|
|
-
|
|
|
|
- protected AcrobaticsPermissionsHandler getPermissionsHandler() {
|
|
|
|
- return permHandler;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|