2015-11-09 06:50:45 +00:00
|
|
|
--- ../src-base/minecraft/net/minecraft/world/gen/MapGenRavine.java
|
|
|
|
+++ ../src-work/minecraft/net/minecraft/world/gen/MapGenRavine.java
|
2015-11-13 05:09:34 +00:00
|
|
|
@@ -128,7 +128,7 @@
|
2015-11-09 06:50:45 +00:00
|
|
|
{
|
2015-11-22 05:46:26 +00:00
|
|
|
IBlockState iblockstate = p_180707_5_.func_177856_a(j1, l1, k1);
|
2015-11-09 06:50:45 +00:00
|
|
|
|
2015-11-22 05:46:26 +00:00
|
|
|
- if (iblockstate.func_177230_c() == Blocks.field_150358_i || iblockstate.func_177230_c() == Blocks.field_150355_j)
|
EntityAIAttackOnCollide, ServerStatusResponse, MinecraftServer, NetHandlerLoginServer, Vec3, BiomeGenBase, AnvilChunkLoader, ChunkProviderServer, MapGenRavine, MinecraftServer updated; fix in Block, GuiIngameForge; can load the world and play with ~20 more manual error fixes.
2015-11-10 18:47:08 +00:00
|
|
|
+ if (isOceanBlock(p_180707_5_, j1, l1, k1, p_180707_3_, p_180707_4_))
|
2015-11-09 06:50:45 +00:00
|
|
|
{
|
|
|
|
flag2 = true;
|
|
|
|
}
|
2015-11-13 05:09:34 +00:00
|
|
|
@@ -165,28 +165,12 @@
|
EntityAIAttackOnCollide, ServerStatusResponse, MinecraftServer, NetHandlerLoginServer, Vec3, BiomeGenBase, AnvilChunkLoader, ChunkProviderServer, MapGenRavine, MinecraftServer updated; fix in Block, GuiIngameForge; can load the world and play with ~20 more manual error fixes.
2015-11-10 18:47:08 +00:00
|
|
|
{
|
2015-11-22 05:46:26 +00:00
|
|
|
IBlockState iblockstate1 = p_180707_5_.func_177856_a(j3, j2, i2);
|
EntityAIAttackOnCollide, ServerStatusResponse, MinecraftServer, NetHandlerLoginServer, Vec3, BiomeGenBase, AnvilChunkLoader, ChunkProviderServer, MapGenRavine, MinecraftServer updated; fix in Block, GuiIngameForge; can load the world and play with ~20 more manual error fixes.
2015-11-10 18:47:08 +00:00
|
|
|
|
2015-11-22 05:46:26 +00:00
|
|
|
- if (iblockstate1.func_177230_c() == Blocks.field_150349_c)
|
EntityAIAttackOnCollide, ServerStatusResponse, MinecraftServer, NetHandlerLoginServer, Vec3, BiomeGenBase, AnvilChunkLoader, ChunkProviderServer, MapGenRavine, MinecraftServer updated; fix in Block, GuiIngameForge; can load the world and play with ~20 more manual error fixes.
2015-11-10 18:47:08 +00:00
|
|
|
+ if (isTopBlock(p_180707_5_, j3, j2, i2, p_180707_3_, p_180707_4_))
|
|
|
|
{
|
|
|
|
flag = true;
|
|
|
|
}
|
|
|
|
|
2015-11-22 05:46:26 +00:00
|
|
|
- if (iblockstate1.func_177230_c() == Blocks.field_150348_b || iblockstate1.func_177230_c() == Blocks.field_150346_d || iblockstate1.func_177230_c() == Blocks.field_150349_c)
|
EntityAIAttackOnCollide, ServerStatusResponse, MinecraftServer, NetHandlerLoginServer, Vec3, BiomeGenBase, AnvilChunkLoader, ChunkProviderServer, MapGenRavine, MinecraftServer updated; fix in Block, GuiIngameForge; can load the world and play with ~20 more manual error fixes.
2015-11-10 18:47:08 +00:00
|
|
|
- {
|
|
|
|
- if (j2 - 1 < 10)
|
|
|
|
- {
|
2015-11-22 05:46:26 +00:00
|
|
|
- p_180707_5_.func_177855_a(j3, j2, i2, Blocks.field_150356_k.func_176223_P());
|
EntityAIAttackOnCollide, ServerStatusResponse, MinecraftServer, NetHandlerLoginServer, Vec3, BiomeGenBase, AnvilChunkLoader, ChunkProviderServer, MapGenRavine, MinecraftServer updated; fix in Block, GuiIngameForge; can load the world and play with ~20 more manual error fixes.
2015-11-10 18:47:08 +00:00
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
2015-11-22 05:46:26 +00:00
|
|
|
- p_180707_5_.func_177855_a(j3, j2, i2, Blocks.field_150350_a.func_176223_P());
|
EntityAIAttackOnCollide, ServerStatusResponse, MinecraftServer, NetHandlerLoginServer, Vec3, BiomeGenBase, AnvilChunkLoader, ChunkProviderServer, MapGenRavine, MinecraftServer updated; fix in Block, GuiIngameForge; can load the world and play with ~20 more manual error fixes.
2015-11-10 18:47:08 +00:00
|
|
|
-
|
2015-11-22 05:46:26 +00:00
|
|
|
- if (flag && p_180707_5_.func_177856_a(j3, j2 - 1, i2).func_177230_c() == Blocks.field_150346_d)
|
EntityAIAttackOnCollide, ServerStatusResponse, MinecraftServer, NetHandlerLoginServer, Vec3, BiomeGenBase, AnvilChunkLoader, ChunkProviderServer, MapGenRavine, MinecraftServer updated; fix in Block, GuiIngameForge; can load the world and play with ~20 more manual error fixes.
2015-11-10 18:47:08 +00:00
|
|
|
- {
|
|
|
|
- blockpos$mutableblockpos.func_181079_c(j3 + p_180707_3_ * 16, 0, i2 + p_180707_4_ * 16);
|
2015-11-22 05:46:26 +00:00
|
|
|
- p_180707_5_.func_177855_a(j3, j2 - 1, i2, this.field_75039_c.func_180494_b(blockpos$mutableblockpos).field_76752_A);
|
EntityAIAttackOnCollide, ServerStatusResponse, MinecraftServer, NetHandlerLoginServer, Vec3, BiomeGenBase, AnvilChunkLoader, ChunkProviderServer, MapGenRavine, MinecraftServer updated; fix in Block, GuiIngameForge; can load the world and play with ~20 more manual error fixes.
2015-11-10 18:47:08 +00:00
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
+ digBlock(p_180707_5_, j3, j2, i2, p_180707_3_, p_180707_4_, flag);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-11-13 05:09:34 +00:00
|
|
|
@@ -221,4 +205,68 @@
|
2015-11-09 06:50:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+ protected boolean isOceanBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ)
|
|
|
|
+ {
|
2015-11-22 05:46:26 +00:00
|
|
|
+ net.minecraft.block.Block block = data.func_177856_a(x, y, z).func_177230_c();
|
|
|
|
+ return block== Blocks.field_150358_i || block == Blocks.field_150355_j;
|
2015-11-09 06:50:45 +00:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //Exception biomes to make sure we generate like vanilla
|
|
|
|
+ private boolean isExceptionBiome(net.minecraft.world.biome.BiomeGenBase biome)
|
|
|
|
+ {
|
2015-11-22 05:46:26 +00:00
|
|
|
+ if (biome == net.minecraft.world.biome.BiomeGenBase.field_76787_r) return true;
|
|
|
|
+ if (biome == net.minecraft.world.biome.BiomeGenBase.field_76769_d) return true;
|
|
|
|
+ if (biome == net.minecraft.world.biome.BiomeGenBase.field_76789_p) return true;
|
|
|
|
+ if (biome == net.minecraft.world.biome.BiomeGenBase.field_76788_q) return true;
|
2015-11-09 06:50:45 +00:00
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //Determine if the block at the specified location is the top block for the biome, we take into account
|
|
|
|
+ //Vanilla bugs to make sure that we generate the map the same way vanilla does.
|
|
|
|
+ private boolean isTopBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ)
|
|
|
|
+ {
|
2015-11-22 05:46:26 +00:00
|
|
|
+ net.minecraft.world.biome.BiomeGenBase biome = field_75039_c.func_180494_b(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16));
|
|
|
|
+ IBlockState state = data.func_177856_a(x, y, z);
|
|
|
|
+ return (isExceptionBiome(biome) ? state.func_177230_c() == Blocks.field_150349_c : state.func_177230_c() == biome.field_76752_A);
|
2015-11-09 06:50:45 +00:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Digs out the current block, default implementation removes stone, filler, and top block
|
|
|
|
+ * Sets the block to lava if y is less then 10, and air other wise.
|
|
|
|
+ * If setting to air, it also checks to see if we've broken the surface and if so
|
|
|
|
+ * tries to make the floor the biome's top block
|
|
|
|
+ *
|
|
|
|
+ * @param data Block data array
|
|
|
|
+ * @param index Pre-calculated index into block data
|
|
|
|
+ * @param x local X position
|
|
|
|
+ * @param y local Y position
|
|
|
|
+ * @param z local Z position
|
|
|
|
+ * @param chunkX Chunk X position
|
|
|
|
+ * @param chunkZ Chunk Y position
|
|
|
|
+ * @param foundTop True if we've encountered the biome's top block. Ideally if we've broken the surface.
|
|
|
|
+ */
|
|
|
|
+ protected void digBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ, boolean foundTop)
|
|
|
|
+ {
|
2015-11-22 05:46:26 +00:00
|
|
|
+ net.minecraft.world.biome.BiomeGenBase biome = field_75039_c.func_180494_b(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16));
|
|
|
|
+ IBlockState state = data.func_177856_a(x, y, z);
|
|
|
|
+ IBlockState top = isExceptionBiome(biome) ? Blocks.field_150349_c.func_176223_P() : biome.field_76752_A;
|
|
|
|
+ IBlockState filler = isExceptionBiome(biome) ? Blocks.field_150346_d.func_176223_P() : biome.field_76753_B;
|
2015-11-09 06:50:45 +00:00
|
|
|
+
|
2015-11-22 05:46:26 +00:00
|
|
|
+ if (state.func_177230_c() == Blocks.field_150348_b || state.func_177230_c() == top.func_177230_c() || state.func_177230_c() == filler.func_177230_c())
|
2015-11-09 06:50:45 +00:00
|
|
|
+ {
|
|
|
|
+ if (y < 10)
|
|
|
|
+ {
|
2015-11-22 05:46:26 +00:00
|
|
|
+ data.func_177855_a(x, y, z, Blocks.field_150353_l.func_176223_P());
|
2015-11-09 06:50:45 +00:00
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
2015-11-22 05:46:26 +00:00
|
|
|
+ data.func_177855_a(x, y, z, Blocks.field_150350_a.func_176223_P());
|
2015-11-09 06:50:45 +00:00
|
|
|
+
|
2015-11-22 05:46:26 +00:00
|
|
|
+ if (foundTop && data.func_177856_a(x, y - 1, z).func_177230_c() == filler.func_177230_c())
|
2015-11-09 06:50:45 +00:00
|
|
|
+ {
|
2015-11-22 05:46:26 +00:00
|
|
|
+ data.func_177855_a(x, y - 1, z, top.func_177230_c().func_176223_P());
|
2015-11-09 06:50:45 +00:00
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
}
|