mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-01 16:19:53 +01:00
Name 'em all the same.
This commit is contained in:
parent
070189a7fd
commit
f5290c3256
@ -180,7 +180,7 @@ public class EntityListener implements Listener {
|
|||||||
switch (cause) {
|
switch (cause) {
|
||||||
case FALL:
|
case FALL:
|
||||||
if (Acrobatics.canRoll(player)) {
|
if (Acrobatics.canRoll(player)) {
|
||||||
event.setDamage(SkillManagerStore.getInstance().getAcrobaticsManager(player.getName()).processRoll(event.getDamage()));
|
event.setDamage(SkillManagerStore.getInstance().getAcrobaticsManager(player.getName()).rollCheck(event.getDamage()));
|
||||||
|
|
||||||
if (event.getDamage() == 0) {
|
if (event.getDamage() == 0) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
@ -53,11 +53,11 @@ public class AcrobaticsManager extends SkillManager {
|
|||||||
* @param damage The amount of damage initially dealt by the event
|
* @param damage The amount of damage initially dealt by the event
|
||||||
* @return the modified event damage if the roll was successful, the original event damage otherwise
|
* @return the modified event damage if the roll was successful, the original event damage otherwise
|
||||||
*/
|
*/
|
||||||
public int processRoll(int damage) {
|
public int rollCheck(int damage) {
|
||||||
Player player = getPlayer();
|
Player player = getPlayer();
|
||||||
|
|
||||||
if (player.isSneaking() && Permissions.gracefulRoll(player)) {
|
if (player.isSneaking() && Permissions.gracefulRoll(player)) {
|
||||||
return processGracefulRoll(player, damage);
|
return gracefulRollCheck(player, damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
int modifiedDamage = Acrobatics.calculateModifiedRollDamage(damage, Acrobatics.rollThreshold);
|
int modifiedDamage = Acrobatics.calculateModifiedRollDamage(damage, Acrobatics.rollThreshold);
|
||||||
@ -75,7 +75,7 @@ public class AcrobaticsManager extends SkillManager {
|
|||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int processGracefulRoll(Player player, int damage) {
|
private int gracefulRollCheck(Player player, int damage) {
|
||||||
int modifiedDamage = Acrobatics.calculateModifiedRollDamage(damage, Acrobatics.gracefulRollThreshold);
|
int modifiedDamage = Acrobatics.calculateModifiedRollDamage(damage, Acrobatics.gracefulRollThreshold);
|
||||||
|
|
||||||
if (!Acrobatics.isFatal(player, modifiedDamage) && Acrobatics.isSuccessfulRoll(player, Acrobatics.gracefulRollMaxChance, Acrobatics.gracefulRollMaxBonusLevel, Acrobatics.gracefulRollSuccessModifier)) {
|
if (!Acrobatics.isFatal(player, modifiedDamage) && Acrobatics.isSuccessfulRoll(player, Acrobatics.gracefulRollMaxChance, Acrobatics.gracefulRollMaxBonusLevel, Acrobatics.gracefulRollSuccessModifier)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user