-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
132 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
common/src/main/java/dev/engine_room/flywheel/impl/compat/CompatMods.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package dev.engine_room.flywheel.impl.compat; | ||
|
||
import java.util.function.BooleanSupplier; | ||
|
||
import dev.engine_room.flywheel.impl.FlwImplXplat; | ||
|
||
public enum CompatMods { | ||
SODIUM("sodium"), | ||
EMBEDDIUM("embeddium"), | ||
IRIS("iris"), | ||
OCULUS("oculus"); | ||
|
||
private final BooleanSupplier isLoaded; | ||
|
||
CompatMods(String modid) { | ||
isLoaded = FlwImplXplat.INSTANCE.getModLoaded(modid); | ||
} | ||
|
||
public boolean isLoaded() { | ||
return isLoaded.getAsBoolean(); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
common/src/main/java/dev/engine_room/flywheel/impl/compat/EmbeddiumCompat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package dev.engine_room.flywheel.impl.compat; | ||
|
||
import org.embeddedt.embeddium.api.ChunkDataBuiltEvent; | ||
|
||
public class EmbeddiumCompat { | ||
public static void init() { | ||
ChunkDataBuiltEvent.BUS.addListener(event -> { | ||
event.getDataBuilder().removeBlockEntitiesIf(InstancedRenderDispatcher::tryAddBlockEntity); | ||
}); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
common/src/main/java/dev/engine_room/flywheel/impl/compat/SodiumCompat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package dev.engine_room.flywheel.impl.compat; | ||
|
||
import dev.engine_room.flywheel.lib.visualization.VisualizationHelper; | ||
import net.caffeinemc.mods.sodium.api.blockentity.BlockEntityRenderHandler; | ||
import net.caffeinemc.mods.sodium.api.blockentity.BlockEntityRenderPredicate; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraft.world.level.block.entity.BlockEntityType; | ||
|
||
public class SodiumCompat { | ||
public static <T extends BlockEntity> Object forBlockEntityType(BlockEntityType<T> type) { | ||
BlockEntityRenderPredicate<T> predicate = (getter, pos, be) -> VisualizationHelper.tryAddBlockEntity(be); | ||
BlockEntityRenderHandler.instance().addRenderPredicate(type, predicate); | ||
return predicate; | ||
} | ||
|
||
public static <T extends BlockEntity> void removePredicate(BlockEntityType<T> type, Object predicate) { | ||
BlockEntityRenderHandler.instance().removeRenderPredicate(type, (BlockEntityRenderPredicate<T>) predicate); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
...rc/main/java/dev/engine_room/flywheel/impl/mixin/sodium/ChunkBuilderMeshingTaskMixin.java
This file was deleted.
Oops, something went wrong.
48 changes: 0 additions & 48 deletions
48
forge/src/main/java/dev/engine_room/flywheel/impl/mixin/sodium/SodiumMixinPlugin.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.