mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-13 13:54:37 +01:00
Add option in config to toggle spending stamina
This commit is contained in:
@@ -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("*");
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user