diff --git a/common/biomesoplenty/BiomesOPlenty.java b/common/biomesoplenty/BiomesOPlenty.java index b0667e519..975689bdf 100644 --- a/common/biomesoplenty/BiomesOPlenty.java +++ b/common/biomesoplenty/BiomesOPlenty.java @@ -10,6 +10,7 @@ import biomesoplenty.configuration.BOPEntities; import biomesoplenty.configuration.BOPFluids; import biomesoplenty.configuration.BOPItems; import biomesoplenty.configuration.BOPPotions; +import biomesoplenty.configuration.BOPStructures; import biomesoplenty.configuration.BOPVanillaCompat; import biomesoplenty.configuration.configfile.BOPConfiguration; import biomesoplenty.configuration.configfile.BOPConfigurationIDs; @@ -72,6 +73,7 @@ public class BiomesOPlenty BOPItems.init(); BOPFluids.init(); BOPCrafting.init(); + BOPStructures.init(); BOPBiomes.init(); BOPEntities.init(); BOPVanillaCompat.init(); diff --git a/common/biomesoplenty/configuration/BOPStructures.java b/common/biomesoplenty/configuration/BOPStructures.java new file mode 100644 index 000000000..f0f5a034d --- /dev/null +++ b/common/biomesoplenty/configuration/BOPStructures.java @@ -0,0 +1,12 @@ +package biomesoplenty.configuration; + +import net.minecraft.world.gen.structure.MapGenStructureIO; +import biomesoplenty.worldgen.structure.BOPStructureVillageStart; + +public class BOPStructures +{ + public static void init() + { + MapGenStructureIO.func_143034_b(BOPStructureVillageStart.class, "BOPVillage"); + } +} diff --git a/common/biomesoplenty/handlers/SoundHandler.java b/common/biomesoplenty/handlers/SoundHandler.java index 6cec5d6fa..a88c4f392 100644 --- a/common/biomesoplenty/handlers/SoundHandler.java +++ b/common/biomesoplenty/handlers/SoundHandler.java @@ -23,7 +23,7 @@ public class SoundHandler { try { - event.manager.soundPoolSounds.addSound(soundFile); + event.manager.addSound(soundFile); } catch (Exception e) @@ -36,7 +36,7 @@ public class SoundHandler { try { - event.manager.soundPoolStreaming.addSound(recordSoundFile); + event.manager.addSound(recordSoundFile); } catch (Exception e) diff --git a/common/biomesoplenty/worldgen/structure/BOPMapGenScatteredFeature.java b/common/biomesoplenty/worldgen/structure/BOPMapGenScatteredFeature.java index 0f1285b44..10f5f22ff 100644 --- a/common/biomesoplenty/worldgen/structure/BOPMapGenScatteredFeature.java +++ b/common/biomesoplenty/worldgen/structure/BOPMapGenScatteredFeature.java @@ -12,7 +12,10 @@ import net.minecraft.entity.monster.EntityWitch; import net.minecraft.util.MathHelper; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.SpawnListEntry; +import net.minecraft.world.gen.structure.ComponentScatteredFeatureSwampHut; import net.minecraft.world.gen.structure.MapGenStructure; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureScatteredFeatureStart; import net.minecraft.world.gen.structure.StructureStart; import biomesoplenty.api.Biomes; @@ -57,6 +60,12 @@ public class BOPMapGenScatteredFeature extends MapGenStructure } } } + + @Override + public String func_143025_a() + { + return "Temple"; + } @Override protected boolean canSpawnStructureAtCoords(int par1, int par2) @@ -104,6 +113,21 @@ public class BOPMapGenScatteredFeature extends MapGenStructure { return new BOPStructureScatteredFeatureStart(worldObj, rand, par1, par2); } + + public boolean func_143030_a(int par1, int par2, int par3) + { + StructureStart structurestart = this.func_143028_c(par1, par2, par3); + + if (structurestart != null && structurestart instanceof StructureScatteredFeatureStart && !structurestart.components.isEmpty()) + { + StructureComponent structurecomponent = (StructureComponent)structurestart.components.getFirst(); + return structurecomponent instanceof ComponentScatteredFeatureSwampHut; + } + else + { + return false; + } + } /** * returns possible spawns for scattered features diff --git a/common/biomesoplenty/worldgen/structure/BOPMapGenVillage.java b/common/biomesoplenty/worldgen/structure/BOPMapGenVillage.java index 7c2b9f09b..1c548d14b 100644 --- a/common/biomesoplenty/worldgen/structure/BOPMapGenVillage.java +++ b/common/biomesoplenty/worldgen/structure/BOPMapGenVillage.java @@ -51,6 +51,12 @@ public class BOPMapGenVillage extends MapGenStructure } } } + + @Override + public String func_143025_a() + { + return "BOPVillage"; + } @Override protected boolean canSpawnStructureAtCoords(int par1, int par2) diff --git a/common/biomesoplenty/worldgen/structure/BOPStructureVillageStart.java b/common/biomesoplenty/worldgen/structure/BOPStructureVillageStart.java index 9a9e09afb..f9f8726b5 100644 --- a/common/biomesoplenty/worldgen/structure/BOPStructureVillageStart.java +++ b/common/biomesoplenty/worldgen/structure/BOPStructureVillageStart.java @@ -4,6 +4,7 @@ import java.util.Iterator; import java.util.List; import java.util.Random; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraft.world.gen.structure.ComponentVillageRoadPiece; import net.minecraft.world.gen.structure.ComponentVillageStartPiece; @@ -11,7 +12,7 @@ import net.minecraft.world.gen.structure.StructureComponent; import net.minecraft.world.gen.structure.StructureStart; import net.minecraft.world.gen.structure.StructureVillagePieces; -class BOPStructureVillageStart extends StructureStart +public class BOPStructureVillageStart extends StructureStart { /** well ... thats what it does */ private boolean hasMoreThanTwoComponents = false; @@ -61,12 +62,21 @@ class BOPStructureVillageStart extends StructureStart hasMoreThanTwoComponents = l > 2; } - /** - * currently only defined for Villages, returns true if Village has more than 2 non-road components - */ - @Override - public boolean isSizeableStructure() + @Override + public boolean isSizeableStructure() { - return hasMoreThanTwoComponents; + return hasMoreThanTwoComponents; + } + + public void func_143022_a(NBTTagCompound par1NBTTagCompound) + { + super.func_143022_a(par1NBTTagCompound); + par1NBTTagCompound.setBoolean("Valid", this.hasMoreThanTwoComponents); + } + + public void func_143017_b(NBTTagCompound nbttagcompound) + { + super.func_143017_b(nbttagcompound); + this.hasMoreThanTwoComponents = nbttagcompound.getBoolean("Valid"); } }