aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets
diff options
context:
space:
mode:
authorAaron <51387595+AzureAaron@users.noreply.github.com>2024-02-05 22:09:46 -0500
committerAaron <51387595+AzureAaron@users.noreply.github.com>2024-04-26 16:23:19 -0400
commita0588bc0fce38990f06e66b5be9c89417217408f (patch)
tree1657452eb0d0e80df463fe62965f6f67d67b3be2 /src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets
parent37ad3ca7aa844bf0db54e7ee21e35837fd3cbbc1 (diff)
downloadSkyblocker-a0588bc0fce38990f06e66b5be9c89417217408f.tar.gz
Skyblocker-a0588bc0fce38990f06e66b5be9c89417217408f.tar.bz2
Skyblocker-a0588bc0fce38990f06e66b5be9c89417217408f.zip
24w05a/b
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets')
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonManager.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonManager.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonManager.java
index 86997cd3..c90f1134 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonManager.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonManager.java
@@ -35,6 +35,7 @@ import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents;
import net.fabricmc.fabric.api.event.player.UseBlockCallback;
import net.minecraft.block.Blocks;
import net.minecraft.client.MinecraftClient;
+import net.minecraft.command.CommandRegistryAccess;
import net.minecraft.command.CommandSource;
import net.minecraft.command.argument.BlockPosArgumentType;
import net.minecraft.command.argument.PosArgument;
@@ -244,8 +245,8 @@ public class DungeonManager {
.then(literal("markAsMissing").then(markSecretsCommand(false)))
.then(literal("getRelativePos").executes(DungeonManager::getRelativePos))
.then(literal("getRelativeTargetPos").executes(DungeonManager::getRelativeTargetPos))
- .then(literal("addWaypoint").then(addCustomWaypointCommand(false)))
- .then(literal("addWaypointRelatively").then(addCustomWaypointCommand(true)))
+ .then(literal("addWaypoint").then(addCustomWaypointCommand(false, registryAccess)))
+ .then(literal("addWaypointRelatively").then(addCustomWaypointCommand(true, registryAccess)))
.then(literal("removeWaypoint").then(removeCustomWaypointCommand(false)))
.then(literal("removeWaypointRelatively").then(removeCustomWaypointCommand(true)))
))));
@@ -385,11 +386,11 @@ public class DungeonManager {
return Command.SINGLE_SUCCESS;
}
- private static RequiredArgumentBuilder<FabricClientCommandSource, PosArgument> addCustomWaypointCommand(boolean relative) {
+ private static RequiredArgumentBuilder<FabricClientCommandSource, PosArgument> addCustomWaypointCommand(boolean relative, CommandRegistryAccess registryAccess) {
return argument("pos", BlockPosArgumentType.blockPos())
.then(argument("secretIndex", IntegerArgumentType.integer())
.then(argument("category", SecretWaypoint.Category.CategoryArgumentType.category())
- .then(argument("name", TextArgumentType.text()).executes(context -> {
+ .then(argument("name", TextArgumentType.text(registryAccess)).executes(context -> {
// TODO Less hacky way with custom ClientBlockPosArgumentType
BlockPos pos = context.getArgument("pos", PosArgument.class).toAbsoluteBlockPos(new ServerCommandSource(null, context.getSource().getPosition(), context.getSource().getRotation(), null, 0, null, null, null, null));
return relative ? addCustomWaypointRelative(context, pos) : addCustomWaypoint(context, pos);