Skip to content

Commit

Permalink
Fix sodium compat for 1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
hlysine committed Sep 15, 2024
1 parent 58bbacf commit 135a98f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package com.copycatsplus.copycats.compat;

import com.copycatsplus.copycats.mixin.compat.rubidium.WorldSliceAccessor;
import me.jellysquid.mods.sodium.client.world.WorldSlice;
import net.minecraft.world.level.BlockGetter;

public class SodiumCompat {
public static BlockGetter unwrapSodiumLevel(BlockGetter level) {
if (level instanceof WorldSlice slice) {
return slice.world;
return ((WorldSliceAccessor) slice).getWorld();
}
return level;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.copycatsplus.copycats.mixin.compat.rubidium;

import me.jellysquid.mods.sodium.client.world.WorldSlice;
import net.minecraft.world.level.Level;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(WorldSlice.class)
public interface WorldSliceAccessor {
@Accessor
Level getWorld();
}
1 change: 1 addition & 0 deletions common/src/main/resources/copycats-common.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"compat.radium.PathNodeDefaultsMixin",
"compat.rubidium.BlockOcclusionCacheMixin",
"compat.rubidium.BlockRendererMixin",
"compat.rubidium.WorldSliceAccessor",
"copycat.VoxelShapeAccessor",
"copycat.cogwheel.CogWheelBlockItemMixin",
"copycat.fluid_pipe.FluidPipeBlockMixin",
Expand Down

0 comments on commit 135a98f

Please sign in to comment.