diff options
author | SHsuperCM <shsupercm@gmail.com> | 2022-03-26 11:03:40 +0300 |
---|---|---|
committer | SHsuperCM <shsupercm@gmail.com> | 2022-03-26 11:03:40 +0300 |
commit | acc5caebf0763915d216fb35f6e37b9ad3b7f3ff (patch) | |
tree | a124ad97a41f1ae8620451fb2ac46a2611cdfc9b /src/main/java/shcm/shsupercm/fabric/citresewn/cit/ActiveCITs.java | |
parent | 0484498863626dc57d55d381b7b394b5cc9234c2 (diff) | |
download | CITResewn-acc5caebf0763915d216fb35f6e37b9ad3b7f3ff.tar.gz CITResewn-acc5caebf0763915d216fb35f6e37b9ad3b7f3ff.tar.bz2 CITResewn-acc5caebf0763915d216fb35f6e37b9ad3b7f3ff.zip |
Implemented fallback behavior and fixed weight bug
Diffstat (limited to 'src/main/java/shcm/shsupercm/fabric/citresewn/cit/ActiveCITs.java')
-rw-r--r-- | src/main/java/shcm/shsupercm/fabric/citresewn/cit/ActiveCITs.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/cit/ActiveCITs.java b/src/main/java/shcm/shsupercm/fabric/citresewn/cit/ActiveCITs.java index 82f341f..379c94d 100644 --- a/src/main/java/shcm/shsupercm/fabric/citresewn/cit/ActiveCITs.java +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/cit/ActiveCITs.java @@ -5,6 +5,7 @@ import net.minecraft.resource.ResourceManager; import net.minecraft.util.profiler.Profiler; import shcm.shsupercm.fabric.citresewn.api.CITDisposable; import shcm.shsupercm.fabric.citresewn.api.CITTypeContainer; +import shcm.shsupercm.fabric.citresewn.cit.builtin.conditions.core.*; import shcm.shsupercm.fabric.citresewn.config.CITResewnConfig; import shcm.shsupercm.fabric.citresewn.pack.GlobalProperties; import shcm.shsupercm.fabric.citresewn.pack.PackParser; @@ -87,10 +88,15 @@ public class ActiveCITs { private ActiveCITs() {} profiler.swap("citresewn:load_cits"); List<CIT<?>> cits = PackParser.parseCITs(resourceManager); + + FallbackCondition.apply(cits); + for (CIT<?> cit : cits) active.cits.computeIfAbsent(cit.type.getClass(), type -> new ArrayList<>()).add(cit); + for (Map.Entry<Class<? extends CITType>, List<CIT<?>>> entry : active.cits.entrySet()) { - entry.getValue().sort(Comparator.<CIT<?>>comparingInt(cit -> cit.weight).reversed().thenComparing(cit -> cit.propertiesIdentifier.toString())); + WeightCondition.apply(entry.getValue()); + for (CITTypeContainer<? extends CITType> typeContainer : CITRegistry.TYPES.values()) if (typeContainer.type == entry.getKey()) { typeContainer.loadUntyped(entry.getValue()); |