mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 22:27:32 +00:00
API methods for dash
This commit is contained in:
1 parent
22ca64ccf8
commit
d050dd4c5c
2 files changed
+17
-5
No files matched your search
@@ -349,14 +349,26 @@ public class AbilityDash extends AbilityMovement implements IAbilityDash {
|
||||
this.dashAngle = dashAngle;
|
||||
}
|
||||
|
||||
public DashDirection getDashDirection() {
|
||||
public DashDirection getDashDirectionEnum() {
|
||||
return dashDirection;
|
||||
}
|
||||
|
||||
public void setDashDirection(DashDirection dashDirection) {
|
||||
public void setDashDirectionEnum(DashDirection dashDirection) {
|
||||
this.dashDirection = dashDirection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDashDirection() {
|
||||
return dashDirection.ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDashDirection(int mode) {
|
||||
DashDirection[] values = DashDirection.values();
|
||||
this.dashDirection = mode >= 0 && mode < values.length ? values[mode] : DashDirection.FORWARD;
|
||||
}
|
||||
|
||||
|
||||
public DashDirection getChosenDirection() {
|
||||
return chosenDirection;
|
||||
}
|
||||
@@ -380,9 +392,9 @@ public class AbilityDash extends AbilityMovement implements IAbilityDash {
|
||||
FieldDef.floatField("ability.dashSpeed", this::getDashSpeed, this::setDashSpeed)
|
||||
),
|
||||
FieldDef.row(
|
||||
FieldDef.enumField("ability.dashDirection", DashDirection.class, this::getDashDirection, this::setDashDirection),
|
||||
FieldDef.enumField("ability.dashDirection", DashDirection.class, this::getDashDirectionEnum, this::setDashDirectionEnum),
|
||||
FieldDef.floatField("ability.dashAngle", this::getDashAngle, this::setDashAngle)
|
||||
.visibleWhen(() -> getDashDirection() == DashDirection.CUSTOM)
|
||||
.visibleWhen(() -> getDashDirectionEnum() == DashDirection.CUSTOM)
|
||||
).visibleWhen(() -> this.getDashModeEnum() == DashMode.DIRECTIONAL)
|
||||
));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user