Skip to content

Commit 14a75fb

Browse files
committed
Updated Locate Loot
1 parent baedb36 commit 14a75fb

3 files changed

Lines changed: 261 additions & 25 deletions

File tree

src/main/java/dev/xpple/seedmapper/command/arguments/ItemAndEnchantmentsPredicateArgument.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ private int parseItem() throws CommandSyntaxException {
253253
};
254254
String itemString = reader.readUnquotedString();
255255
Integer item = ITEMS.get(itemString);
256+
if (item == null && itemString.startsWith("minecraft:")) {
257+
item = ITEMS.get(itemString.substring("minecraft:".length()));
258+
}
256259
if (item == null) {
257260
reader.setCursor(cursor);
258261
throw CommandExceptions.UNKNOWN_ITEM_EXCEPTION.create(itemString);

src/main/java/dev/xpple/seedmapper/command/commands/LocateCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public class LocateCommand {
7474
public static final Set<Integer> LOOT_SUPPORTED_STRUCTURES = Set.of(Cubiomes.Treasure(), Cubiomes.Desert_Pyramid(), Cubiomes.End_City(), Cubiomes.Igloo(), Cubiomes.Jungle_Pyramid(), Cubiomes.Ruined_Portal(), Cubiomes.Ruined_Portal_N(), Cubiomes.Fortress(), Cubiomes.Bastion(), Cubiomes.Outpost(), Cubiomes.Shipwreck());
7575

7676
public record LootStructureResult(String structureName, int count, List<BlockPos> positions) {}
77-
public record LootLocateResult(int totalFound, String itemName, BlockPos pos, List<LootStructureResult> structureResults) {}
77+
public record LootLocateResult(int totalFound, String itemName, BlockPos pos, BlockPos searchOrigin, List<LootStructureResult> structureResults) {}
7878

7979
public static void register(CommandDispatcher<FabricClientCommandSource> dispatcher) {
8080
dispatcher.register(literal("sm:locate")
@@ -480,7 +480,7 @@ record StructureIterationState(MemorySegment structureConfig, StructureChecks.Ge
480480
}
481481
}
482482
String itemName = Cubiomes.global_id2item_name(itemPredicate.item(), version).getString(0);
483-
return new LootLocateResult(found[0], itemName, primaryPos[0] == null ? center : primaryPos[0], List.copyOf(structureResults));
483+
return new LootLocateResult(found[0], itemName, primaryPos[0] == null ? center : primaryPos[0], center, List.copyOf(structureResults));
484484
}
485485
}
486486

0 commit comments

Comments
 (0)