diff options
author | Maximusbarcz <maxim.baranek@gmail.com> | 2023-01-02 18:12:41 +0100 |
---|---|---|
committer | Maximusbarcz <maxim.baranek@gmail.com> | 2023-01-02 18:12:41 +0100 |
commit | 255cbe744535466951b8f1699202763520f1fc95 (patch) | |
tree | ed97f5fd15ce1a539cfcf2150a23c269e6a2acd4 /src/main/java/dev/mayaqq/ygasi/registry | |
parent | 730ba6e636d952e9730e3b9bbc035c894dfff25b (diff) | |
download | ygasi-255cbe744535466951b8f1699202763520f1fc95.tar.gz ygasi-255cbe744535466951b8f1699202763520f1fc95.tar.bz2 ygasi-255cbe744535466951b8f1699202763520f1fc95.zip |
Added some nifty features (like a reset gui and a reset all advancements util)
Diffstat (limited to 'src/main/java/dev/mayaqq/ygasi/registry')
3 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/dev/mayaqq/ygasi/registry/CommandRegistry.java b/src/main/java/dev/mayaqq/ygasi/registry/CommandRegistry.java index 1da9830..aa03f96 100644 --- a/src/main/java/dev/mayaqq/ygasi/registry/CommandRegistry.java +++ b/src/main/java/dev/mayaqq/ygasi/registry/CommandRegistry.java @@ -18,6 +18,7 @@ import net.minecraft.text.Text; import java.io.File; import static dev.mayaqq.ygasi.registry.StatRegistry.SKILL_POINTS; +import static dev.mayaqq.ygasi.registry.StatRegistry.SKILL_POINTS_TOTAL; import static net.minecraft.server.command.CommandManager.literal; public class CommandRegistry { @@ -57,6 +58,7 @@ public class CommandRegistry { .executes(context -> { ServerPlayerEntity player = EntityArgumentType.getPlayer(context, "target"); player.resetStat(Stats.CUSTOM.getOrCreateStat(SKILL_POINTS)); + player.resetStat(Stats.CUSTOM.getOrCreateStat(StatRegistry.SKILL_POINTS_TOTAL)); context.getSource().sendMessage(Text.literal("§aSkill Points reset to 0 for " + player.getEntityName() + ".")); return 1; }))) @@ -66,6 +68,7 @@ public class CommandRegistry { .executes(context -> { ServerPlayerEntity player = EntityArgumentType.getPlayer(context, "target"); player.increaseStat(SKILL_POINTS, IntegerArgumentType.getInteger(context, "amount")); + player.increaseStat(SKILL_POINTS_TOTAL, IntegerArgumentType.getInteger(context, "amount")); context.getSource().sendMessage(Text.literal("§aSkill Points increased by " + IntegerArgumentType.getInteger(context, "amount") + " for " + player.getEntityName() + ".")); return 1; })))) @@ -73,7 +76,7 @@ public class CommandRegistry { .then(CommandManager.argument("target", EntityArgumentType.player()) .executes(context -> { ServerPlayerEntity player = EntityArgumentType.getPlayer(context, "target"); - context.getSource().sendMessage(Text.literal("§a" + player.getEntityName() + " has " + player.getStatHandler().getStat(Stats.CUSTOM.getOrCreateStat(SKILL_POINTS)) + " Unspent Skill Points.")); + context.getSource().sendMessage(Text.literal("§a" + player.getEntityName() + " has " + player.getStatHandler().getStat(Stats.CUSTOM.getOrCreateStat(SKILL_POINTS)) + " Unspent Skill Points and " + player.getStatHandler().getStat(Stats.CUSTOM.getOrCreateStat(SKILL_POINTS_TOTAL)) + " Total Skill Points.")); return 1; }))) .then(literal("config") diff --git a/src/main/java/dev/mayaqq/ygasi/registry/ConfigRegistry.java b/src/main/java/dev/mayaqq/ygasi/registry/ConfigRegistry.java index 658f044..0b5cfa5 100644 --- a/src/main/java/dev/mayaqq/ygasi/registry/ConfigRegistry.java +++ b/src/main/java/dev/mayaqq/ygasi/registry/ConfigRegistry.java @@ -51,6 +51,7 @@ public class ConfigRegistry { public int pointsRewarded = 1; public int branchCost = 16; public Boolean enableSkillBook = true; + public int offence1Cost = 3; public Config() {} } diff --git a/src/main/java/dev/mayaqq/ygasi/registry/StatRegistry.java b/src/main/java/dev/mayaqq/ygasi/registry/StatRegistry.java index 5d6d165..4dbdbd3 100644 --- a/src/main/java/dev/mayaqq/ygasi/registry/StatRegistry.java +++ b/src/main/java/dev/mayaqq/ygasi/registry/StatRegistry.java @@ -7,6 +7,7 @@ import net.minecraft.util.Identifier; public class StatRegistry { public static Identifier SKILL_POINTS = PolymerStat.registerStat("skill_points", StatFormatter.DEFAULT); + public static Identifier SKILL_POINTS_TOTAL = PolymerStat.registerStat("skill_points_total", StatFormatter.DEFAULT); public static void skillRegister() {} } |