Add option in config to toggle spending stamina

This commit is contained in:
Melledy
2023-11-13 21:57:33 -08:00
parent dda7e67018
commit ea62d4c3d8
2 changed files with 4 additions and 0 deletions

View File

@@ -84,6 +84,7 @@ public class Config {
@Getter
public static class ServerOptions {
public int entitySceneLimit = 2000;
public boolean spendStamina = true;
public Set<String> defaultPermissions = Set.of("*");
}

View File

@@ -365,6 +365,9 @@ public class Player {
}
public void spendStamina(int amount) {
if (!LunarCore.getConfig().getServerOptions().spendStamina) {
return;
}
this.stamina = Math.max(this.stamina - amount, 0);
this.sendPacket(new PacketStaminaInfoScNotify(this));
}