Files
2020-05-06 05:37:07 +08:00

19 lines
1.2 KiB
Diff

--- ../src-base/minecraft/net/minecraft/world/biome/BiomeJungle.java
+++ ../src-work/minecraft/net/minecraft/world/biome/BiomeJungle.java
@@ -81,10 +81,14 @@
super.decorate(worldIn, rand, pos);
int i = rand.nextInt(16) + 8;
int j = rand.nextInt(16) + 8;
- int k = rand.nextInt(worldIn.getHeight(pos.add(i, 0, j)).getY() * 2);
+ int height = worldIn.getHeight(pos.add(i, 0, j)).getY() * 2; // could == 0, which crashes nextInt
+ if (height < 1) height = 1;
+ int k = rand.nextInt(height);
+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, new net.minecraft.util.math.ChunkPos(pos), pos.add(i, k, j), net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.PUMPKIN))
(new WorldGenMelon()).generate(worldIn, rand, pos.add(i, k, j));
WorldGenVines worldgenvines = new WorldGenVines();
+ if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, new net.minecraft.util.math.ChunkPos(pos), net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS))
for (int j1 = 0; j1 < 50; ++j1)
{
k = rand.nextInt(16) + 8;