-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fill int biome array after calling chunk generator
- Loading branch information
Showing
7 changed files
with
48 additions
and
91 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
37 changes: 0 additions & 37 deletions
37
src/main/java/org/dimdev/jeid/mixin/core/MixinChunkGenerator.java
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
src/main/java/org/dimdev/jeid/mixin/core/MixinChunkProviderServer.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,33 @@ | ||
package org.dimdev.jeid.mixin.core; | ||
|
||
import net.minecraft.world.WorldServer; | ||
import net.minecraft.world.biome.Biome; | ||
import net.minecraft.world.chunk.Chunk; | ||
import net.minecraft.world.gen.ChunkProviderServer; | ||
import net.minecraft.world.gen.IChunkGenerator; | ||
import org.dimdev.jeid.INewChunk; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(ChunkProviderServer.class) | ||
public class MixinChunkProviderServer { | ||
@Shadow @Final public WorldServer world; | ||
private Biome[] reusableBiomeList = new Biome[256]; | ||
|
||
/** @reason Return an empty biome byte array if the chunk is using an int biome array. **/ | ||
@Redirect(method = "provideChunk", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/gen/IChunkGenerator;generateChunk(II)Lnet/minecraft/world/chunk/Chunk;")) | ||
private Chunk generateChunk(IChunkGenerator generator, int x, int z) { | ||
Chunk chunk = generator.generateChunk(x, z); | ||
Biome[] biomes = world.getBiomeProvider().getBiomes(reusableBiomeList, x * 16, z * 16, 16, 16); | ||
|
||
INewChunk newChunk = (INewChunk) chunk; | ||
int[] intBiomeArray = newChunk.getIntBiomeArray(); | ||
for (int i = 0; i < intBiomeArray.length; ++i) { | ||
intBiomeArray[i] = Biome.getIdForBiome(biomes[i]); | ||
} | ||
return chunk; | ||
} | ||
} |
40 changes: 0 additions & 40 deletions
40
src/main/java/org/dimdev/jeid/mixin/modsupport/MixinModChunkGenerator.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 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