aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeItem.java2
-rw-r--r--src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITType.java3
-rw-r--r--src/main/java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java6
3 files changed, 6 insertions, 5 deletions
diff --git a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeItem.java b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeItem.java
index 14b8813..aa3562b 100644
--- a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeItem.java
+++ b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeItem.java
@@ -57,7 +57,7 @@ public class TypeItem extends CITType {
public CITOverrideList bakedSubModels = new CITOverrideList();
@Override
- public void load(List<? extends CITCondition> conditions, PropertyGroup properties) throws CITParsingException {
+ public void load(List<? extends CITCondition> conditions, PropertyGroup properties, ResourceManager resourceManager) throws CITParsingException {
for (CITCondition condition : conditions)
if (condition instanceof ConditionItems conditionItems)
items.addAll(Arrays.asList(conditionItems.items));
diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITType.java b/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITType.java
index b618dde..7ee1e03 100644
--- a/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITType.java
+++ b/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITType.java
@@ -1,5 +1,6 @@
package shcm.shsupercm.fabric.citresewn.cit;
+import net.minecraft.resource.ResourceManager;
import shcm.shsupercm.fabric.citresewn.CITResewn;
import shcm.shsupercm.fabric.citresewn.ex.CITParsingException;
import shcm.shsupercm.fabric.citresewn.pack.format.PropertyGroup;
@@ -8,7 +9,7 @@ import shcm.shsupercm.fabric.citresewn.pack.format.PropertyValue;
import java.util.List;
public abstract class CITType {
- public abstract void load(List<? extends CITCondition> conditions, PropertyGroup properties) throws CITParsingException;
+ public abstract void load(List<? extends CITCondition> conditions, PropertyGroup properties, ResourceManager resourceManager) throws CITParsingException;
protected void warn(String message, PropertyValue value, PropertyGroup properties) {
CITResewn.logWarnLoading("Warning: " + CITParsingException.descriptionOf(message, properties, value.position()));
diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java
index 1dbc22d..38ca718 100644
--- a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java
+++ b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java
@@ -65,7 +65,7 @@ public class PackParser {
for (Identifier identifier : resourceManager.findResources(root + "/cit", s -> s.endsWith(".properties"))) {
String packName = null;
try (Resource resource = resourceManager.getResource(identifier)) {
- cits.add(parseCIT(PropertyGroup.tryParseGroup(packName = resource.getResourcePackName(), identifier, resource.getInputStream())));
+ cits.add(parseCIT(PropertyGroup.tryParseGroup(packName = resource.getResourcePackName(), identifier, resource.getInputStream()), resourceManager));
} catch (CITParsingException e) {
CITResewn.logErrorLoading(e.getMessage());
} catch (Exception e) {
@@ -77,7 +77,7 @@ public class PackParser {
return cits;
}
- public static CIT<?> parseCIT(PropertyGroup properties) throws CITParsingException {
+ public static CIT<?> parseCIT(PropertyGroup properties, ResourceManager resourceManager) throws CITParsingException {
CITType citType = CITRegistry.parseType(properties);
ArrayList<CITCondition> conditions = new ArrayList<>();
@@ -109,7 +109,7 @@ public class PackParser {
return condition == null;
});
- citType.load(conditions, properties);
+ citType.load(conditions, properties, resourceManager);
return new CIT<>(properties.identifier, properties.packName, citType, conditions.toArray(new CITCondition[0]), weight.weight);
}