mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-01-23 03:17:53 +01:00
Embeddium compat
This commit is contained in:
parent
db9e1b753a
commit
566df485d5
6 changed files with 41 additions and 5 deletions
|
@ -3,6 +3,7 @@ package dev.engine_room.flywheel.impl.compat;
|
|||
import dev.engine_room.flywheel.impl.FlwImplXplat;
|
||||
|
||||
public enum CompatMod {
|
||||
EMBEDDIUM("embeddium"),
|
||||
IRIS("iris"),
|
||||
SODIUM("sodium");
|
||||
|
||||
|
|
|
@ -33,6 +33,8 @@ fabric_api_version = 0.105.0+1.21.1
|
|||
# Build dependency mod versions
|
||||
sodium_version = mc1.21.1-0.6.0-beta.4
|
||||
iris_version = 1.8.0-beta.8+1.21.1
|
||||
# There is no oculus for 1.21.1 so we will only support iris
|
||||
embeddium_version = 1.0.11+mc1.21.1
|
||||
|
||||
# Publication info
|
||||
group = dev.engine_room.flywheel
|
||||
|
|
|
@ -89,6 +89,8 @@ dependencies {
|
|||
modCompileOnly("maven.modrinth:sodium:${property("sodium_version")}-neoforge")
|
||||
modCompileOnly("maven.modrinth:iris:${property("iris_version")}-neoforge")
|
||||
|
||||
modCompileOnly("maven.modrinth:embeddium:${property("embeddium_version")}")
|
||||
|
||||
"forApi"(project(path = ":common", configuration = "commonApiOnly"))
|
||||
"forLib"(project(path = ":common", configuration = "commonLib"))
|
||||
"forBackend"(project(path = ":common", configuration = "commonBackend"))
|
||||
|
|
|
@ -8,6 +8,7 @@ import dev.engine_room.flywheel.api.event.EndClientResourceReloadEvent;
|
|||
import dev.engine_room.flywheel.api.event.ReloadLevelRendererEvent;
|
||||
import dev.engine_room.flywheel.backend.compile.FlwProgramsReloader;
|
||||
import dev.engine_room.flywheel.backend.engine.uniform.Uniforms;
|
||||
import dev.engine_room.flywheel.impl.compat.EmbeddiumCompat;
|
||||
import dev.engine_room.flywheel.impl.visualization.VisualizationEventHandler;
|
||||
import dev.engine_room.flywheel.lib.model.baked.PartialModelEventHandler;
|
||||
import dev.engine_room.flywheel.lib.util.LevelAttached;
|
||||
|
@ -51,6 +52,8 @@ public final class FlywheelNeoForge {
|
|||
|
||||
CrashReportCallables.registerCrashCallable("Flywheel Backend", BackendManagerImpl::getBackendString);
|
||||
FlwImpl.init();
|
||||
|
||||
EmbeddiumCompat.init();
|
||||
}
|
||||
|
||||
private static void registerImplEventListeners(IEventBus gameEventBus, IEventBus modEventBus) {
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
package dev.engine_room.flywheel.impl.compat;
|
||||
|
||||
import org.embeddedt.embeddium.api.ChunkDataBuiltEvent;
|
||||
|
||||
import dev.engine_room.flywheel.impl.FlwImpl;
|
||||
import dev.engine_room.flywheel.lib.visualization.VisualizationHelper;
|
||||
|
||||
public final class EmbeddiumCompat {
|
||||
public static final boolean ACTIVE = CompatMod.EMBEDDIUM.isLoaded;
|
||||
|
||||
static {
|
||||
if (ACTIVE) {
|
||||
FlwImpl.LOGGER.debug("Detected Embeddium");
|
||||
}
|
||||
}
|
||||
|
||||
private EmbeddiumCompat() {
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
if (ACTIVE) {
|
||||
Internals.init();
|
||||
}
|
||||
}
|
||||
|
||||
private static final class Internals {
|
||||
static void init() {
|
||||
ChunkDataBuiltEvent.BUS.addListener(event -> {
|
||||
event.getDataBuilder().removeBlockEntitiesIf(VisualizationHelper::tryAddBlockEntity);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -36,8 +36,3 @@ modId = "sodium"
|
|||
type = "optional"
|
||||
versionRange = "[0.6.0-beta.2,)"
|
||||
side = "CLIENT"
|
||||
|
||||
[[dependencies.${mod_id}]]
|
||||
modId = "embeddium"
|
||||
type = "incompatible"
|
||||
reason = "Remove Embeddium and install Sodium"
|
||||
|
|
Loading…
Reference in a new issue