Curios API (Fabric)

Curios API (Fabric)

819k Downloads

Mismatch between the docs and the actual mod

ofek2608 opened this issue ยท 2 comments

commented

Versions (Be specific, do not write "latest"):

  • Curios: 5.2.0-beta.3+1.20.1
  • Forge/Fabric: forge

Observed Behavior:

Using data to register slot on a custom namespace does nothing.

Expected Behavior:

Register a slot type, as seen in the docs
https://docs.illusivesoulworks.com/curios/slot-register#directory

Steps to Reproduce:

Create a file data/example/curios/slots/myslot.json with the config
Then it doesn't appear in the game.

after looking a bit in the sources, seems like CuriosSlotManager filters only curios slots with namespace "curios"
https://github.com/TheIllusiveC4/Curios/blob/1.20.x/src/main/java/top/theillusivec4/curios/common/data/CuriosSlotManager.java#L50

commented

Create a file data/example/curios/slots/myslot.json with the config
Then it doesn't appear in the game.

Did you follow the follow-up instructions on adding a slot type to the player/entity? Otherwise, the slot exists but is not assigned to anything.

after looking a bit in the sources, seems like CuriosSlotManager filters only curios slots with namespace "curios"
https://github.com/TheIllusiveC4/Curios/blob/1.20.x/src/main/java/top/theillusivec4/curios/common/data/CuriosSlotManager.java#L50

This section of the code processes slots in the Curios namespace first, you can see later it processes the rest as well:

for (Map.Entry<ResourceLocation, JsonElement> entry : pObject.entrySet()) {
ResourceLocation resourcelocation = entry.getKey();
if (resourcelocation.getPath().startsWith("_") ||
resourcelocation.getNamespace().equals("curios")) {
continue;
}
try {
String id = resourcelocation.getPath();
fromJson(map.computeIfAbsent(id, (k) -> new SlotType.Builder(id)),
GsonHelper.convertToJsonObject(entry.getValue(), "top element"));
modMap.computeIfAbsent(id, (k) -> ImmutableSet.builder())
.add(resourcelocation.getNamespace());
} catch (IllegalArgumentException | JsonParseException e) {
Curios.LOGGER.error("Parsing error loading curio slot {}", resourcelocation, e);
}
}

commented

Hey, sorry, no i didn't i guess i rushed a bit to the bug reports. thanks, and sorry.