Attempted to update to 1.6.4, some issues with villages

This commit is contained in:
Adubbz 2013-09-21 16:53:11 +10:00
parent 265e683112
commit adeb945ed2
6 changed files with 63 additions and 9 deletions

View file

@ -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();

View file

@ -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");
}
}

View file

@ -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)

View file

@ -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;
@ -58,6 +61,12 @@ public class BOPMapGenScatteredFeature extends MapGenStructure
}
}
@Override
public String func_143025_a()
{
return "Temple";
}
@Override
protected boolean canSpawnStructureAtCoords(int par1, int par2)
{
@ -105,6 +114,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
*/

View file

@ -52,6 +52,12 @@ public class BOPMapGenVillage extends MapGenStructure
}
}
@Override
public String func_143025_a()
{
return "BOPVillage";
}
@Override
protected boolean canSpawnStructureAtCoords(int par1, int par2)
{

View file

@ -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()
{
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");
}
}