mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-02-16 10:30:53 +00:00
Fixed biome NMS calculations
This commit is contained in:
@@ -41,6 +41,7 @@ import com.mojang.serialization.Lifecycle;
|
||||
import com.volmit.iris.core.nms.IHeadless;
|
||||
import com.volmit.iris.core.nms.container.IPackRepository;
|
||||
import com.volmit.iris.core.nms.v1_20_R3.mca.ChunkSerializer;
|
||||
import com.volmit.iris.core.service.StudioSVC;
|
||||
import com.volmit.iris.engine.object.IrisBiomeCustom;
|
||||
import com.volmit.iris.engine.object.IrisBiomeReplacement;
|
||||
import com.volmit.iris.engine.object.IrisDimension;
|
||||
@@ -502,7 +503,26 @@ public class NMSBinding implements INMSBinding {
|
||||
|
||||
@Override
|
||||
public int countCustomBiomes() {
|
||||
// todo inaccurate shit
|
||||
// todo inaccurate
|
||||
|
||||
List<String> register = new ArrayList<>();
|
||||
File packFolder = Iris.service(StudioSVC.class).getWorkspaceFolder();
|
||||
File[] packs = packFolder.listFiles(File::isDirectory);
|
||||
if (packs == null || packs.length == 0)
|
||||
return 0;
|
||||
|
||||
for (File pack : packs) {
|
||||
File dimensionsDir = new File(pack, "dimensions");
|
||||
if (dimensionsDir.isDirectory()) {
|
||||
File[] jsonFiles = dimensionsDir.listFiles((dir, name) -> name.toLowerCase().endsWith(".json"));
|
||||
if (jsonFiles != null) {
|
||||
for (File jsonFile : jsonFiles) {
|
||||
register.add(jsonFile.getName().replace(".json", ""));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AtomicInteger a = new AtomicInteger(0);
|
||||
|
||||
getCustomBiomeRegistry().keySet().forEach((i) -> {
|
||||
@@ -510,6 +530,10 @@ public class NMSBinding implements INMSBinding {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!register.contains(i.getNamespace())) {
|
||||
return;
|
||||
}
|
||||
|
||||
a.incrementAndGet();
|
||||
Iris.debug("Custom Biome: " + i);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user