mirror of
https://github.com/GTMEGA/EndlessIDs.git
synced 2026-11-18 19:39:11 +00:00
another RTG crash fix
This commit is contained in:
1 file changed
+53
+53
@@ -27,12 +27,23 @@ import com.falsepattern.endlessids.mixin.helpers.BiomePatchHelper;
|
||||
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.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.Slice;
|
||||
import rtg.util.CellNoise;
|
||||
import rtg.util.OpenSimplexNoise;
|
||||
import rtg.world.biome.RTGBiomeProvider;
|
||||
import rtg.world.biome.realistic.RealisticBiomeBase;
|
||||
import rtg.world.gen.ChunkProviderRTG;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@Mixin(value = ChunkProviderRTG.class,
|
||||
remap = false)
|
||||
public abstract class ChunkProviderRTGMixin {
|
||||
@@ -42,6 +53,18 @@ public abstract class ChunkProviderRTGMixin {
|
||||
@Shadow
|
||||
private int[] xyinverted;
|
||||
|
||||
@Shadow private long worldSeed;
|
||||
|
||||
@Shadow private World worldObj;
|
||||
|
||||
@Shadow protected RTGBiomeProvider cmr;
|
||||
|
||||
@Shadow private Random mapRand;
|
||||
|
||||
@Shadow private OpenSimplexNoise simplex;
|
||||
|
||||
@Shadow private CellNoise cell;
|
||||
|
||||
@Redirect(method = "provideChunk",
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/chunk/Chunk;getBiomeArray()[B",
|
||||
@@ -61,4 +84,34 @@ public abstract class ChunkProviderRTGMixin {
|
||||
private void removeUnnecessarySet(Chunk chunk, byte[] bytes) {
|
||||
|
||||
}
|
||||
|
||||
@ModifyConstant(method = "provideChunk",
|
||||
constant = @Constant(intValue = 256,
|
||||
ordinal = 0),
|
||||
slice = @Slice(from = @At(value = "INVOKE",
|
||||
target = "Lrtg/world/gen/ChunkProviderRTG;generateTerrain(Lrtg/world/biome/RTGBiomeProvider;II[Lnet/minecraft/block/Block;[B[Lrtg/world/biome/realistic/RealisticBiomeBase;[F)V",
|
||||
shift = At.Shift.AFTER)),
|
||||
require = 1)
|
||||
private int noDefaultLoop(int constant) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Redirect(method = "provideChunk",
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lrtg/world/gen/ChunkProviderRTG;generateTerrain(Lrtg/world/biome/RTGBiomeProvider;II[Lnet/minecraft/block/Block;[B[Lrtg/world/biome/realistic/RealisticBiomeBase;[F)V"),
|
||||
require = 1)
|
||||
private void injectTheFunny(ChunkProviderRTG instance,
|
||||
RTGBiomeProvider cmr,
|
||||
int cx,
|
||||
int cy,
|
||||
Block[] blocks,
|
||||
byte[] metadata,
|
||||
RealisticBiomeBase[] biomes,
|
||||
float[] noise) {
|
||||
instance.generateTerrain(cmr, cx, cy, blocks, metadata, biomes, noise);
|
||||
for (int ci = 0; ci < 256; ci++) {
|
||||
int biomeID = biomes[ci].baseBiome.biomeID;
|
||||
RealisticBiomeBase.getBiome(biomeID).generateMapGen(blocks, metadata, worldSeed, worldObj, cmr, mapRand, cx, cy, simplex, cell, noise);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user