-
-
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
18 changed files
with
63 additions
and
181 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
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.Supplier; | ||
|
||
import com.google.common.base.Suppliers; | ||
|
||
import net.fabricmc.loader.api.FabricLoader; | ||
|
||
public enum CompatMods { | ||
SODIUM, | ||
EMBEDDIUM; | ||
|
||
private final Supplier<Boolean> isLoaded; | ||
|
||
CompatMods() { | ||
isLoaded = Suppliers.memoize(() -> FabricLoader.getInstance().isModLoaded(name())); | ||
} | ||
|
||
public boolean isLoaded() { | ||
return isLoaded.get(); | ||
} | ||
} |
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
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
fabric/src/main/java/dev/engine_room/flywheel/impl/mixin/sodium/SodiumMixinPlugin.java
This file was deleted.
Oops, something went wrong.
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
14 changes: 0 additions & 14 deletions
14
fabric/src/main/resources/flywheel.impl.sodium.mixins.json
This file was deleted.
Oops, something went wrong.
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.
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 was deleted.
Oops, something went wrong.
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
Binary file not shown.
Binary file not shown.