mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-29 09:15:27 +00:00
Batch 7 stage 1: jigsaw definitions from the module build
The jigsaw definitions, StructureResources and IrisDirection now come from IrisModule. Iris registers iris:structure (StructureModule) with its own modules; iris:structure-model keeps the validator and the locator and vanilla structure services. StructureResources lookups take the pack's PackResources, so callers pass data.getPackResources(); the Bukkit plugin compiles against the API for that. IrisRegistrant extends the module's KeyedResource, which holds the load key. A structure's loot placement is StructurePlacing.lootPlacement. Studio maps an API object reference (GeneratedObject) to Iris's object loader.
This commit is contained in:
1 parent
c9e36761e4
commit
74b129e105
32 files changed
+112
-1181
No files matched your search
+4
-4
@@ -263,7 +263,7 @@ public class CommandJigsaw implements DirectorExecutor {
|
||||
if (data == null) {
|
||||
return;
|
||||
}
|
||||
IrisStructure irisStructure = StructureResources.structure(data, structure);
|
||||
IrisStructure irisStructure = StructureResources.structure(data.getPackResources(), structure);
|
||||
if (irisStructure == null) {
|
||||
sendError(commandSender, "No Iris jigsaw structure '" + structure + "' exists in this pack.");
|
||||
return;
|
||||
@@ -1216,7 +1216,7 @@ public class CommandJigsaw implements DirectorExecutor {
|
||||
static JigsawStudioLayout loadPersistedLayout(ActiveContext context) throws IOException {
|
||||
IrisData source = context.request().source();
|
||||
source.invalidateStructureResources();
|
||||
IrisStructure structure = StructureResources.structure(source, context.request().structureKey());
|
||||
IrisStructure structure = StructureResources.structure(source.getPackResources(), context.request().structureKey());
|
||||
if (structure == null) {
|
||||
throw new IOException("The structure could not be reloaded after the graph transaction");
|
||||
}
|
||||
@@ -1276,7 +1276,7 @@ public class CommandJigsaw implements DirectorExecutor {
|
||||
|
||||
static String nextThemeKey(ActiveContext context) throws IOException {
|
||||
IrisStructure structure = StructureResources.structure(
|
||||
context.request().source(),
|
||||
context.request().source().getPackResources(),
|
||||
context.request().structureKey());
|
||||
if (structure == null) {
|
||||
throw new IOException("The active jigsaw structure could not be loaded");
|
||||
@@ -1749,7 +1749,7 @@ public class CommandJigsaw implements DirectorExecutor {
|
||||
sendError(this, "Open a Jigsaw Studio project first.");
|
||||
return;
|
||||
}
|
||||
IrisJigsawPiece piece = StructureResources.piece(context.request().source(), pieceKey);
|
||||
IrisJigsawPiece piece = StructureResources.piece(context.request().source().getPackResources(), pieceKey);
|
||||
if (piece == null) {
|
||||
sendError(this, "No jigsaw piece '" + pieceKey + "' exists in this pack.");
|
||||
return;
|
||||
|
||||
+2
-2
@@ -301,7 +301,7 @@ public class CommandStructure implements DirectorExecutor {
|
||||
sender().sendMessage(IrisLanguage.text(BukkitCommandMessagesExtended.COMMAND_STRUCTURE_COULD_NOT_RESOLVE_PACK_DIMENSION_4, MessageArgument.untrusted("value", dimension.getLoadKey())));
|
||||
return;
|
||||
}
|
||||
IrisStructure s = StructureResources.structure(data, structure);
|
||||
IrisStructure s = StructureResources.structure(data.getPackResources(), structure);
|
||||
if (s == null) {
|
||||
sender().sendMessage(IrisLanguage.text(BukkitCommandMessagesExtended.COMMAND_STRUCTURE_NO_IRIS_STRUCTURE_THIS_PACK, MessageArgument.untrusted("structure", structure)));
|
||||
return;
|
||||
@@ -339,7 +339,7 @@ public class CommandStructure implements DirectorExecutor {
|
||||
sender().sendMessage(IrisLanguage.text(BukkitCommandMessagesExtended.COMMAND_STRUCTURE_COULD_NOT_RESOLVE_PACK_DIMENSION_5, MessageArgument.untrusted("value", dimension.getLoadKey())));
|
||||
return;
|
||||
}
|
||||
IrisStructure s = StructureResources.structure(data, structure);
|
||||
IrisStructure s = StructureResources.structure(data.getPackResources(), structure);
|
||||
if (s == null) {
|
||||
sender().sendMessage(IrisLanguage.text(BukkitCommandMessagesExtended.COMMAND_STRUCTURE_NO_IRIS_STRUCTURE_THIS_PACK_2, MessageArgument.untrusted("structure", structure)));
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user