-
Notifications
You must be signed in to change notification settings - Fork 88
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
3 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
src/main/java/me/jellysquid/mods/sodium/client/world/ChunkBiomeContainerExtended.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 me.jellysquid.mods.sodium.client.world; | ||
|
||
import net.minecraft.world.level.chunk.ChunkBiomeContainer; | ||
|
||
public interface ChunkBiomeContainerExtended { | ||
static ChunkBiomeContainer clone(ChunkBiomeContainer container) { | ||
return container != null ? ((ChunkBiomeContainerExtended)container).embeddium$copy() : null; | ||
} | ||
|
||
ChunkBiomeContainer embeddium$copy(); | ||
} |
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
25 changes: 25 additions & 0 deletions
25
src/main/java/me/jellysquid/mods/sodium/mixin/core/world/chunk/ChunkBiomeContainerMixin.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,25 @@ | ||
package me.jellysquid.mods.sodium.mixin.core.world.chunk; | ||
|
||
import me.jellysquid.mods.sodium.client.world.ChunkBiomeContainerExtended; | ||
import net.minecraft.core.IdMap; | ||
import net.minecraft.world.level.biome.Biome; | ||
import net.minecraft.world.level.chunk.ChunkBiomeContainer; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
|
||
@Mixin(ChunkBiomeContainer.class) | ||
public class ChunkBiomeContainerMixin implements ChunkBiomeContainerExtended { | ||
@Shadow | ||
@Final | ||
private IdMap<Biome> biomeRegistry; | ||
|
||
@Shadow | ||
@Final | ||
private Biome[] biomes; | ||
|
||
@Override | ||
public ChunkBiomeContainer embeddium$copy() { | ||
return new ChunkBiomeContainer(this.biomeRegistry, this.biomes.clone()); | ||
} | ||
} |