修复耐力bug
This commit is contained in:
parent
d0ad586f71
commit
c8a9ce9277
2 changed files with 8 additions and 2 deletions
|
@ -199,6 +199,9 @@ public class ClickHandler {
|
|||
|
||||
if (key == Minecraft.getInstance().options.keyJump.getKey().getValue()) {
|
||||
handleDoubleJump(player);
|
||||
if (player.onGround()) {
|
||||
stamina += 5;
|
||||
}
|
||||
}
|
||||
|
||||
if (key == ModKeyMappings.RELOAD.getKey().getValue()) {
|
||||
|
@ -389,6 +392,7 @@ public class ClickHandler {
|
|||
ClientEventHandler.zoom = false;
|
||||
ClientEventHandler.zoomVehicle = false;
|
||||
ClientEventHandler.entity = null;
|
||||
breath = false;
|
||||
}
|
||||
|
||||
private static void editModelShake() {
|
||||
|
|
|
@ -295,12 +295,14 @@ public class ClientEventHandler {
|
|||
|
||||
//耐力
|
||||
public static void staminaSystem() {
|
||||
if (notInGame()) return;
|
||||
|
||||
LocalPlayer player = Minecraft.getInstance().player;
|
||||
if (player == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
tacticalSprint = !exhaustion && !zoom && isMoving() && player.isSprinting() && player.getVehicle() == null && player.onGround();
|
||||
tacticalSprint = !exhaustion && !zoom && isMoving() && player.isSprinting() && player.getVehicle() == null && player.onGround() && !player.getAbilities().flying;
|
||||
|
||||
ItemStack stack = player.getMainHandItem();
|
||||
|
||||
|
@ -331,7 +333,7 @@ public class ClientEventHandler {
|
|||
exhaustion = false;
|
||||
}
|
||||
|
||||
if ((ModKeyMappings.BREATH.isDown() && zoom) || tacticalSprint) {
|
||||
if ((ModKeyMappings.BREATH.isDown() && zoom) || (tacticalSprint)) {
|
||||
switchTime = Math.min(switchTime + 0.65, 5);
|
||||
} else if (switchTime > 0 && stamina == 0) {
|
||||
switchTime = Math.max(switchTime - 0.15, 0);
|
||||
|
|
Loading…
Add table
Reference in a new issue