refactoring
All checks were successful
Build / build (push) Successful in 7m43s

This commit is contained in:
unurled 2024-09-28 14:36:19 +02:00
parent c5acbc28ef
commit 7f326710b9
Signed by: unurled
GPG key ID: EFC5F5E709B47DDD
2 changed files with 87 additions and 47 deletions

View file

@ -43,6 +43,8 @@ public final class SR extends JavaPlugin {
PacketEvents.getAPI().init(); PacketEvents.getAPI().init();
InvUI.getInstance().setPlugin(this);
SRCore.getInstance() SRCore.getInstance()
.getManagers() .getManagers()
.register( .register(
@ -60,8 +62,6 @@ public final class SR extends JavaPlugin {
TreasureManager.class, TreasureManager.class,
BackgroundManager.class, BackgroundManager.class,
ResourcePackManager.class)); ResourcePackManager.class));
InvUI.getInstance().setPlugin(this);
} }
@Override @Override

View file

@ -4,14 +4,48 @@ import org.bukkit.NamespacedKey;
import org.bukkit.persistence.PersistentDataType; import org.bukkit.persistence.PersistentDataType;
public enum Attribute { public enum Attribute {
HEALTH("HEALTH", "Health", 100, 100000, 0, new NamespacedKey("sr", "health")), HEALTH(
STRENGTH("STRENGTH", "Strength", 10, 10000, 0, new NamespacedKey("sr", "strength")), "HEALTH",
DEFENSE("DEFENSE", "Defense", 10, 10000, 0, new NamespacedKey("sr", "defense")), "Health",
AGILITY("AGILITY", "Agility", 100, 10000, 0, new NamespacedKey("sr", "agility")), 100,
100000,
0,
new NamespacedKey("sr", "health")
),
STRENGTH(
"STRENGTH",
"Strength",
10,
10000,
0,
new NamespacedKey("sr", "strength")
),
DEFENSE(
"DEFENSE",
"Defense",
10,
10000,
0,
new NamespacedKey("sr", "defense")
),
AGILITY(
"AGILITY",
"Agility",
100,
10000,
0,
new NamespacedKey("sr", "agility")
),
LUCK("LUCK", "Luck", 100, 99999, -99999, new NamespacedKey("sr", "luck")), LUCK("LUCK", "Luck", 100, 99999, -99999, new NamespacedKey("sr", "luck")),
MANA("MANA", "Mana", 100, 10000, 0, new NamespacedKey("sr", "mana")), MANA("MANA", "Mana", 100, 10000, 0, new NamespacedKey("sr", "mana")),
CHARISMA("CHARISMA", "Charisma", 0, 10000, -10000, new NamespacedKey("sr", "charisma")), CHARISMA(
; "CHARISMA",
"Charisma",
0,
10000,
-10000,
new NamespacedKey("sr", "charisma")
);
private final String name; private final String name;
private final String id; private final String id;
@ -21,7 +55,13 @@ public enum Attribute {
private final NamespacedKey key; private final NamespacedKey key;
Attribute( Attribute(
String id, String name, int defaultValue, int maxValue, int minValue, NamespacedKey key) { String id,
String name,
int defaultValue,
int maxValue,
int minValue,
NamespacedKey key
) {
this.id = id; this.id = id;
this.name = name; this.name = name;
this.defaultValue = defaultValue; this.defaultValue = defaultValue;