102 lines
6.0 KiB
Diff
102 lines
6.0 KiB
Diff
--- a/net/minecraft/world/gen/feature/structure/VillagePieces.java
|
|
+++ b/net/minecraft/world/gen/feature/structure/VillagePieces.java
|
|
@@ -64,6 +64,7 @@
|
|
list.add(new VillagePieces.PieceWeight(VillagePieces.Field2.class, 3, MathHelper.func_76136_a(p_75084_0_, 2 + p_75084_1_, 4 + p_75084_1_ * 2)));
|
|
list.add(new VillagePieces.PieceWeight(VillagePieces.House2.class, 15, MathHelper.func_76136_a(p_75084_0_, 0, 1 + p_75084_1_)));
|
|
list.add(new VillagePieces.PieceWeight(VillagePieces.House3.class, 8, MathHelper.func_76136_a(p_75084_0_, 0 + p_75084_1_, 3 + p_75084_1_ * 2)));
|
|
+ net.minecraftforge.fml.common.registry.VillagerRegistry.addExtraVillageComponents(list, p_75084_0_, p_75084_1_);
|
|
Iterator<VillagePieces.PieceWeight> iterator = list.iterator();
|
|
|
|
while(iterator.hasNext()) {
|
|
@@ -111,6 +112,8 @@
|
|
villagepieces$village = VillagePieces.House2.func_175855_a(p_176065_0_, p_176065_2_, p_176065_3_, p_176065_4_, p_176065_5_, p_176065_6_, p_176065_7_, p_176065_8_);
|
|
} else if (oclass == VillagePieces.House3.class) {
|
|
villagepieces$village = VillagePieces.House3.func_175849_a(p_176065_0_, p_176065_2_, p_176065_3_, p_176065_4_, p_176065_5_, p_176065_6_, p_176065_7_, p_176065_8_);
|
|
+ } else {
|
|
+ villagepieces$village = net.minecraftforge.fml.common.registry.VillagerRegistry.getVillageComponent(p_176065_1_, p_176065_0_, p_176065_2_, p_176065_3_, p_176065_4_, p_176065_5_, p_176065_6_, p_176065_7_, p_176065_8_);
|
|
}
|
|
|
|
return villagepieces$village;
|
|
@@ -1288,17 +1291,24 @@
|
|
public List<VillagePieces.PieceWeight> field_74931_h;
|
|
public List<StructurePiece> field_74932_i = Lists.<StructurePiece>newArrayList();
|
|
public List<StructurePiece> field_74930_j = Lists.<StructurePiece>newArrayList();
|
|
+ public @javax.annotation.Nullable net.minecraft.world.biome.Biome biome;
|
|
|
|
public Start() {
|
|
}
|
|
|
|
public Start(int p_i48769_1_, Random p_i48769_2_, int p_i48769_3_, int p_i48769_4_, List<VillagePieces.PieceWeight> p_i48769_5_, VillageConfig p_i48769_6_) {
|
|
+ this(p_i48769_1_, p_i48769_2_, p_i48769_3_, p_i48769_4_, p_i48769_5_, p_i48769_6_, null);
|
|
+ }
|
|
+
|
|
+ public Start(int p_i48769_1_, Random p_i48769_2_, int p_i48769_3_, int p_i48769_4_, List<VillagePieces.PieceWeight> p_i48769_5_, VillageConfig p_i48769_6_, net.minecraft.world.biome.Biome biome) {
|
|
super((VillagePieces.Start)null, 0, p_i48769_2_, p_i48769_3_, p_i48769_4_);
|
|
this.field_74931_h = p_i48769_5_;
|
|
this.field_74928_c = p_i48769_6_.field_202461_a;
|
|
this.field_189928_h = p_i48769_6_.field_202462_b;
|
|
this.func_202579_a(this.field_189928_h);
|
|
this.field_189929_i = p_i48769_2_.nextInt(50) == 0;
|
|
+ this.biome = biome;
|
|
+ this.startPiece = this;
|
|
}
|
|
}
|
|
|
|
@@ -1363,11 +1373,12 @@
|
|
}
|
|
}
|
|
|
|
- abstract static class Village extends StructurePiece {
|
|
+ public abstract static class Village extends StructurePiece {
|
|
protected int field_143015_k = -1;
|
|
private int field_74896_a;
|
|
protected VillagePieces.Type field_189928_h;
|
|
protected boolean field_189929_i;
|
|
+ protected VillagePieces.Start startPiece;
|
|
|
|
public Village() {
|
|
}
|
|
@@ -1377,6 +1388,7 @@
|
|
if (p_i2107_1_ != null) {
|
|
this.field_189928_h = p_i2107_1_.field_189928_h;
|
|
this.field_189929_i = p_i2107_1_.field_189929_i;
|
|
+ this.startPiece = p_i2107_1_;
|
|
}
|
|
|
|
}
|
|
@@ -1480,13 +1492,12 @@
|
|
EntityZombieVillager entityzombievillager = new EntityZombieVillager(p_74893_1_.func_201672_e());
|
|
entityzombievillager.func_70012_b((double)j + 0.5D, (double)k, (double)l + 0.5D, 0.0F, 0.0F);
|
|
entityzombievillager.func_204210_a(p_74893_1_.func_175649_E(new BlockPos(entityzombievillager)), (IEntityLivingData)null, (NBTTagCompound)null);
|
|
- entityzombievillager.func_190733_a(this.func_180779_c(i, 0));
|
|
entityzombievillager.func_110163_bv();
|
|
p_74893_1_.func_72838_d(entityzombievillager);
|
|
} else {
|
|
EntityVillager entityvillager = new EntityVillager(p_74893_1_.func_201672_e());
|
|
entityvillager.func_70012_b((double)j + 0.5D, (double)k, (double)l + 0.5D, 0.0F, 0.0F);
|
|
- entityvillager.func_70938_b(this.func_180779_c(i, p_74893_1_.func_201674_k().nextInt(6)));
|
|
+ entityvillager.setProfession(this.chooseForgeProfession(i, entityvillager.getProfessionForge()));
|
|
entityvillager.func_190672_a(p_74893_1_.func_175649_E(new BlockPos(entityvillager)), (IEntityLivingData)null, (NBTTagCompound)null, false);
|
|
p_74893_1_.func_72838_d(entityvillager);
|
|
}
|
|
@@ -1495,11 +1506,19 @@
|
|
}
|
|
}
|
|
|
|
+ @Deprecated // Use Forge version below
|
|
protected int func_180779_c(int p_180779_1_, int p_180779_2_) {
|
|
return p_180779_2_;
|
|
}
|
|
+
|
|
+ protected net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession chooseForgeProfession(int count, net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession prof) {
|
|
+ return net.minecraftforge.fml.common.registry.VillagerRegistry.getById(func_180779_c(count, net.minecraftforge.fml.common.registry.VillagerRegistry.getId(prof)));
|
|
+ }
|
|
|
|
protected IBlockState func_175847_a(IBlockState p_175847_1_) {
|
|
+ net.minecraftforge.event.terraingen.BiomeEvent.GetVillageBlockID event = new net.minecraftforge.event.terraingen.BiomeEvent.GetVillageBlockID(startPiece == null ? null : startPiece.biome, p_175847_1_);
|
|
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
|
|
+ if (event.getResult() == net.minecraftforge.eventbus.api.Event.Result.DENY) return event.getReplacement();
|
|
Block block = p_175847_1_.func_177230_c();
|
|
if (this.field_189928_h == VillagePieces.Type.SANDSTONE) {
|
|
if (block.func_203417_a(BlockTags.field_200031_h) || block == Blocks.field_150347_e) {
|