74 lines
3.9 KiB
Diff
74 lines
3.9 KiB
Diff
--- ../src-base/minecraft/net/minecraft/world/gen/ChunkGeneratorEnd.java
|
|
+++ ../src-work/minecraft/net/minecraft/world/gen/ChunkGeneratorEnd.java
|
|
@@ -43,6 +43,9 @@
|
|
double[] field_185967_f;
|
|
double[] field_185968_g;
|
|
private final WorldGenEndIsland field_185975_r = new WorldGenEndIsland();
|
|
+ // temporary variables used during event handling
|
|
+ private int chunkX = 0;
|
|
+ private int chunkZ = 0;
|
|
|
|
public ChunkGeneratorEnd(World p_i47241_1_, boolean p_i47241_2_, long p_i47241_3_, BlockPos p_i47241_5_)
|
|
{
|
|
@@ -56,6 +59,17 @@
|
|
this.field_73214_a = new NoiseGeneratorOctaves(this.field_73220_k, 10);
|
|
this.field_73212_b = new NoiseGeneratorOctaves(this.field_73220_k, 16);
|
|
this.field_185973_o = new NoiseGeneratorSimplex(this.field_73220_k);
|
|
+
|
|
+ net.minecraftforge.event.terraingen.InitNoiseGensEvent.ContextEnd ctx =
|
|
+ new net.minecraftforge.event.terraingen.InitNoiseGensEvent.ContextEnd(field_185969_i, field_185970_j, field_185971_k, field_73214_a, field_73212_b, field_185973_o);
|
|
+ ctx = net.minecraftforge.event.terraingen.TerrainGen.getModdedNoiseGenerators(p_i47241_1_, this.field_73220_k, ctx);
|
|
+ this.field_185969_i = ctx.getLPerlin1();
|
|
+ this.field_185970_j = ctx.getLPerlin2();
|
|
+ this.field_185971_k = ctx.getPerlin();
|
|
+ this.field_73214_a = ctx.getDepth();
|
|
+ this.field_73212_b = ctx.getScale();
|
|
+ this.field_185973_o = ctx.getIsland();
|
|
+ this.field_185972_n = (MapGenEndCity) net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(this.field_185972_n, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.END_CITY);
|
|
}
|
|
|
|
public void func_180518_a(int p_180518_1_, int p_180518_2_, ChunkPrimer p_180518_3_)
|
|
@@ -128,6 +142,7 @@
|
|
|
|
public void func_185962_a(ChunkPrimer p_185962_1_)
|
|
{
|
|
+ if (!net.minecraftforge.event.ForgeEventFactory.onReplaceBiomeBlocks(this, this.chunkX, this.chunkZ, p_185962_1_, this.field_73230_p)) return;
|
|
for (int i = 0; i < 16; ++i)
|
|
{
|
|
for (int j = 0; j < 16; ++j)
|
|
@@ -173,6 +188,7 @@
|
|
|
|
public Chunk func_185932_a(int p_185932_1_, int p_185932_2_)
|
|
{
|
|
+ this.chunkX = p_185932_1_; this.chunkZ = p_185932_2_;
|
|
this.field_73220_k.setSeed((long)p_185932_1_ * 341873128712L + (long)p_185932_2_ * 132897987541L);
|
|
ChunkPrimer chunkprimer = new ChunkPrimer();
|
|
this.field_73231_z = this.field_73230_p.func_72959_q().func_76933_b(this.field_73231_z, p_185932_1_ * 16, p_185932_2_ * 16, 16, 16);
|
|
@@ -254,6 +270,10 @@
|
|
|
|
private double[] func_185963_a(double[] p_185963_1_, int p_185963_2_, int p_185963_3_, int p_185963_4_, int p_185963_5_, int p_185963_6_, int p_185963_7_)
|
|
{
|
|
+ net.minecraftforge.event.terraingen.ChunkGeneratorEvent.InitNoiseField event = new net.minecraftforge.event.terraingen.ChunkGeneratorEvent.InitNoiseField(this, p_185963_1_, p_185963_2_, p_185963_3_, p_185963_4_, p_185963_5_, p_185963_6_, p_185963_7_);
|
|
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
|
|
+ if (event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY) return event.getNoisefield();
|
|
+
|
|
if (p_185963_1_ == null)
|
|
{
|
|
p_185963_1_ = new double[p_185963_5_ * p_185963_6_ * p_185963_7_];
|
|
@@ -326,6 +346,7 @@
|
|
public void func_185931_b(int p_185931_1_, int p_185931_2_)
|
|
{
|
|
BlockFalling.field_149832_M = true;
|
|
+ net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(true, this, this.field_73230_p, this.field_73220_k, p_185931_1_, p_185931_2_, false);
|
|
BlockPos blockpos = new BlockPos(p_185931_1_ * 16, 0, p_185931_2_ * 16);
|
|
|
|
if (this.field_73229_q)
|
|
@@ -394,6 +415,7 @@
|
|
}
|
|
}
|
|
|
|
+ net.minecraftforge.event.ForgeEventFactory.onChunkPopulate(false, this, this.field_73230_p, this.field_73220_k, p_185931_1_, p_185931_2_, false);
|
|
BlockFalling.field_149832_M = false;
|
|
}
|
|
|