From bb661da35e152d9a2f7e82d44eecbb2d6e233b29 Mon Sep 17 00:00:00 2001 From: Sollace Date: Mon, 12 Feb 2024 13:27:50 +0000 Subject: [PATCH] Add a LEVEL option to the mana command --- .../com/minelittlepony/unicopia/command/ManaCommand.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minelittlepony/unicopia/command/ManaCommand.java b/src/main/java/com/minelittlepony/unicopia/command/ManaCommand.java index 8af79712..6383163a 100644 --- a/src/main/java/com/minelittlepony/unicopia/command/ManaCommand.java +++ b/src/main/java/com/minelittlepony/unicopia/command/ManaCommand.java @@ -32,6 +32,11 @@ public class ManaCommand { var bar = type.getBar(pony.getMagicalReserves()); float value = source.getArgument("value", Float.class); + if (type == ManaType.LEVEL) { + pony.getLevel().set((int)value); + value -= (int)value; + type = ManaType.XP; + } if (type == ManaType.XP) { int currentLevel = pony.getLevel().get(); while (type == ManaType.XP && value > 1) { @@ -52,7 +57,8 @@ public class ManaCommand { EXHAUSTION(MagicReserves::getExhaustion), ENERGY(MagicReserves::getEnergy), MANA(MagicReserves::getMana), - XP(MagicReserves::getXp); + XP(MagicReserves::getXp), + LEVEL(MagicReserves::getXp); private final Function getter;