mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-14 14:24:37 +01:00
Add option in config to toggle spending stamina
This commit is contained in:
@@ -84,6 +84,7 @@ public class Config {
|
|||||||
@Getter
|
@Getter
|
||||||
public static class ServerOptions {
|
public static class ServerOptions {
|
||||||
public int entitySceneLimit = 2000;
|
public int entitySceneLimit = 2000;
|
||||||
|
public boolean spendStamina = true;
|
||||||
public Set<String> defaultPermissions = Set.of("*");
|
public Set<String> defaultPermissions = Set.of("*");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -365,6 +365,9 @@ public class Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void spendStamina(int amount) {
|
public void spendStamina(int amount) {
|
||||||
|
if (!LunarCore.getConfig().getServerOptions().spendStamina) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.stamina = Math.max(this.stamina - amount, 0);
|
this.stamina = Math.max(this.stamina - amount, 0);
|
||||||
this.sendPacket(new PacketStaminaInfoScNotify(this));
|
this.sendPacket(new PacketStaminaInfoScNotify(this));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user