mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-06-19 23:31:27 +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.IHeadless;
|
||||||
import com.volmit.iris.core.nms.container.IPackRepository;
|
import com.volmit.iris.core.nms.container.IPackRepository;
|
||||||
import com.volmit.iris.core.nms.v1_20_R3.mca.ChunkSerializer;
|
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.IrisBiomeCustom;
|
||||||
import com.volmit.iris.engine.object.IrisBiomeReplacement;
|
import com.volmit.iris.engine.object.IrisBiomeReplacement;
|
||||||
import com.volmit.iris.engine.object.IrisDimension;
|
import com.volmit.iris.engine.object.IrisDimension;
|
||||||
@@ -502,7 +503,26 @@ public class NMSBinding implements INMSBinding {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int countCustomBiomes() {
|
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);
|
AtomicInteger a = new AtomicInteger(0);
|
||||||
|
|
||||||
getCustomBiomeRegistry().keySet().forEach((i) -> {
|
getCustomBiomeRegistry().keySet().forEach((i) -> {
|
||||||
@@ -510,6 +530,10 @@ public class NMSBinding implements INMSBinding {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!register.contains(i.getNamespace())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
a.incrementAndGet();
|
a.incrementAndGet();
|
||||||
Iris.debug("Custom Biome: " + i);
|
Iris.debug("Custom Biome: " + i);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user