fix(UC-02): clean theme IDs — strip directory prefix and .json suffix
RISK-003: Definition IDs were "tiedup:tiedup_room_themes/oubliette.json" instead of clean "tiedup:oubliette". Now derived from filename only.
This commit is contained in:
@@ -59,8 +59,14 @@ public class RoomThemeReloadListener
|
|||||||
ResourceLocation fileId = entry.getKey();
|
ResourceLocation fileId = entry.getKey();
|
||||||
Resource resource = entry.getValue();
|
Resource resource = entry.getValue();
|
||||||
|
|
||||||
|
// Derive clean ID from file path: "tiedup:tiedup_room_themes/oubliette.json" -> "tiedup:oubliette"
|
||||||
|
String cleanPath = fileId.getPath()
|
||||||
|
.replace(DIRECTORY + "/", "")
|
||||||
|
.replace(".json", "");
|
||||||
|
ResourceLocation cleanId = new ResourceLocation(fileId.getNamespace(), cleanPath);
|
||||||
|
|
||||||
try (InputStream input = resource.open()) {
|
try (InputStream input = resource.open()) {
|
||||||
RoomThemeDefinition def = RoomThemeParser.parse(input, fileId);
|
RoomThemeDefinition def = RoomThemeParser.parse(input, cleanId);
|
||||||
|
|
||||||
if (def != null) {
|
if (def != null) {
|
||||||
// Check for duplicate IDs (fileId IS the ID for room themes)
|
// Check for duplicate IDs (fileId IS the ID for room themes)
|
||||||
|
|||||||
Reference in New Issue
Block a user