aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/shcm/shsupercm/fabric/citresewn/mixin/ReloadableResourceManagerImplMixin.java
diff options
context:
space:
mode:
authorSHsuperCM <shsupercm@gmail.com>2021-08-20 18:08:11 +0300
committerSHsuperCM <shsupercm@gmail.com>2021-08-20 18:08:11 +0300
commitc684710b01ed4d1b9b5363c392e24f31d31c527a (patch)
tree890eafd67c923f91b7d634f3c1880a821003ae79 /src/main/java/shcm/shsupercm/fabric/citresewn/mixin/ReloadableResourceManagerImplMixin.java
parentec00a9307d3eadca3a7407173320f7f941401164 (diff)
downloadCITResewn-c684710b01ed4d1b9b5363c392e24f31d31c527a.tar.gz
CITResewn-c684710b01ed4d1b9b5363c392e24f31d31c527a.tar.bz2
CITResewn-c684710b01ed4d1b9b5363c392e24f31d31c527a.zip
Finished parser framework and cit.properties parsing
Diffstat (limited to 'src/main/java/shcm/shsupercm/fabric/citresewn/mixin/ReloadableResourceManagerImplMixin.java')
-rw-r--r--src/main/java/shcm/shsupercm/fabric/citresewn/mixin/ReloadableResourceManagerImplMixin.java23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/mixin/ReloadableResourceManagerImplMixin.java b/src/main/java/shcm/shsupercm/fabric/citresewn/mixin/ReloadableResourceManagerImplMixin.java
index 01b092b..fb5a267 100644
--- a/src/main/java/shcm/shsupercm/fabric/citresewn/mixin/ReloadableResourceManagerImplMixin.java
+++ b/src/main/java/shcm/shsupercm/fabric/citresewn/mixin/ReloadableResourceManagerImplMixin.java
@@ -1,6 +1,5 @@
package shcm.shsupercm.fabric.citresewn.mixin;
-import net.minecraft.client.MinecraftClient;
import net.minecraft.resource.*;
import net.minecraft.util.Identifier;
import net.minecraft.util.Unit;
@@ -10,6 +9,10 @@ import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
+import shcm.shsupercm.fabric.citresewn.ActiveCITs;
+import shcm.shsupercm.fabric.citresewn.CITResewn;
+import shcm.shsupercm.fabric.citresewn.pack.CITParser;
+import shcm.shsupercm.fabric.citresewn.pack.cits.CIT;
import java.util.*;
import java.util.concurrent.CompletableFuture;
@@ -29,20 +32,14 @@ public abstract class ReloadableResourceManagerImplMixin implements ReloadableRe
if (this.type != ResourceType.CLIENT_RESOURCES)
return;
- Map<String, ResourcePack> citFiles = new HashMap<>();
- for (ResourcePack pack : packs) {
- for (Identifier identifier : pack.findResources(ResourceType.CLIENT_RESOURCES, "minecraft", "citresewn/cit", 5, s -> true))
- citFiles.put(identifier.getPath(), pack);
- for (Identifier identifier : pack.findResources(ResourceType.CLIENT_RESOURCES, "minecraft", "mcpatcher/cit", 5, s -> true))
- citFiles.put(identifier.getPath(), pack);
- for (Identifier identifier : pack.findResources(ResourceType.CLIENT_RESOURCES, "minecraft", "optifine/cit", 5, s -> true))
- citFiles.put(identifier.getPath(), pack);
+ if (CITResewn.INSTANCE.activeCITs != null) {
+ CITResewn.INSTANCE.activeCITs.dispose();
+ CITResewn.INSTANCE.activeCITs = null;
}
- for (Map.Entry<String, ResourcePack> citFile : citFiles.entrySet()) {
+ Collection<CIT> cits = CITParser.parse(packs);
- }
-
- new String();
+ if (cits.size() > 0)
+ CITResewn.INSTANCE.activeCITs = new ActiveCITs(cits);
}
} \ No newline at end of file