diff options
Diffstat (limited to 'src/Java/gtPlusPlus/australia')
8 files changed, 597 insertions, 57 deletions
diff --git a/src/Java/gtPlusPlus/australia/GTplusplus_Australia.java b/src/Java/gtPlusPlus/australia/GTplusplus_Australia.java index 70e6268e9d..af7c143a95 100644 --- a/src/Java/gtPlusPlus/australia/GTplusplus_Australia.java +++ b/src/Java/gtPlusPlus/australia/GTplusplus_Australia.java @@ -22,6 +22,7 @@ import gtPlusPlus.australia.block.AustraliaContentLoader; import gtPlusPlus.australia.dimension.Dimension_Australia; import gtPlusPlus.australia.gen.gt.WorldGen_Australia_Ores; import gtPlusPlus.australia.gen.gt.WorldGen_GT_Australia_Base; +import gtPlusPlus.australia.gen.map.structure.StructureManager; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.CORE.Australia; import gtPlusPlus.xmod.gregtech.api.util.GTPP_Config; @@ -38,16 +39,16 @@ public class GTplusplus_Australia implements ActionListener { public static GTPP_Config sCustomWorldgenFile = null; // Dark World Handler - protected static volatile Biome_AustralianDesert Australian_Desert_Biome_1; - protected static volatile Biome_AustralianDesert2 Australian_Desert_Biome_2; - - protected static volatile Biome_AustralianDesert_Ex Australian_Desert_Biome_3; - protected static volatile Biome_AustralianForest Australian_Forest_Biome; - protected static volatile Biome_AustralianOcean Australian_Ocean_Biome; - protected static volatile Biome_AustralianOutback Australian_Outback_Biome; - protected static volatile Biome_AustralianPlains Australian_Plains_Biome; + //protected static volatile Biome_AustralianDesert Australian_Desert_Biome_1; + //protected static volatile Biome_AustralianDesert2 Australian_Desert_Biome_2; + + public static volatile Biome_AustralianDesert_Ex Australian_Desert_Biome_3; + public static volatile Biome_AustralianForest Australian_Forest_Biome; + public static volatile Biome_AustralianOcean Australian_Ocean_Biome; + public static volatile Biome_AustralianOutback Australian_Outback_Biome; + public static volatile Biome_AustralianPlains Australian_Plains_Biome; - protected static volatile Dimension_Australia Australia_Dimension; + public static volatile Dimension_Australia Australia_Dimension; public static int globalAustraliaPortalSpawnTimer = 0; // Pre-Init @@ -61,12 +62,12 @@ public class GTplusplus_Australia implements ActionListener { Australia_Dimension = new Dimension_Australia(); Australia_Dimension.instance = instance; - Australian_Desert_Biome_1 = (new Biome_AustralianDesert()); - Australian_Desert_Biome_2 = (new Biome_AustralianDesert2()); - Australian_Desert_Biome_1.instance = instance; - Australian_Desert_Biome_2.instance = instance; - Australian_Desert_Biome_1.preInit(event); - Australian_Desert_Biome_2.preInit(event); + //Australian_Desert_Biome_1 = (new Biome_AustralianDesert()); + //Australian_Desert_Biome_2 = (new Biome_AustralianDesert2()); + //Australian_Desert_Biome_1.instance = instance; + //Australian_Desert_Biome_2.instance = instance; + //Australian_Desert_Biome_1.preInit(event); + //Australian_Desert_Biome_2.preInit(event); Australian_Desert_Biome_3 = (Biome_AustralianDesert_Ex.biome); @@ -75,6 +76,8 @@ public class GTplusplus_Australia implements ActionListener { Australian_Outback_Biome = (Biome_AustralianOutback.biome); Australian_Plains_Biome = Biome_AustralianPlains.biome; + //Load Villages + StructureManager.registerVillageComponents(); //Load/Set Custom Ore Gen sCustomWorldgenFile = new GTPP_Config(new Configuration(new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "Australia.cfg"))); @@ -88,8 +91,8 @@ public class GTplusplus_Australia implements ActionListener { //Load World and Biome GameRegistry.registerWorldGenerator(new WorldGen_GT_Australia_Base(), Short.MAX_VALUE); - Australian_Desert_Biome_1.load(); - Australian_Desert_Biome_2.load(); + //Australian_Desert_Biome_1.load(); + //Australian_Desert_Biome_2.load(); Australian_Desert_Biome_3.load(); Australian_Forest_Biome.load(); Australian_Ocean_Biome.load(); @@ -127,8 +130,8 @@ public class GTplusplus_Australia implements ActionListener { @EventHandler public void serverLoad(FMLServerStartingEvent event) { - Australian_Desert_Biome_1.serverLoad(event); - Australian_Desert_Biome_2.serverLoad(event); + //Australian_Desert_Biome_1.serverLoad(event); + //Australian_Desert_Biome_2.serverLoad(event); } @EventHandler diff --git a/src/Java/gtPlusPlus/australia/chunk/ChunkProviderAustralia.java b/src/Java/gtPlusPlus/australia/chunk/ChunkProviderAustralia.java index e5390d3238..7c36c76489 100644 --- a/src/Java/gtPlusPlus/australia/chunk/ChunkProviderAustralia.java +++ b/src/Java/gtPlusPlus/australia/chunk/ChunkProviderAustralia.java @@ -1,10 +1,16 @@ package gtPlusPlus.australia.chunk; +import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ANIMALS; + +import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Random; import cpw.mods.fml.common.eventhandler.Event.Result; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.australia.block.AustraliaContentLoader; +import gtPlusPlus.australia.gen.map.MapGenExtendedVillage; import gtPlusPlus.core.util.math.MathUtils; import net.minecraft.block.Block; import net.minecraft.entity.EnumCreatureType; @@ -79,11 +85,53 @@ public class ChunkProviderAustralia implements IChunkProvider { double[] doubleArray4; int[][] field_73219_j = new int[32][32]; + Map map; + + //Some Init Field? { - caveGenerator = TerrainGen.getModdedMapGen(caveGenerator, - net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.CAVE); + + + List<BiomeGenBase> y = new ArrayList<BiomeGenBase>(); + for (Object r : MapGenVillage.villageSpawnBiomes.toArray()) { + if (r instanceof BiomeGenBase) { + y.add((BiomeGenBase) r); + } + } + for (BiomeGenBase h : y) { + if (!MapGenVillage.villageSpawnBiomes.contains(h)) { + if (h instanceof BiomeGenBase) { + y.add(h); + } + } + } + if (!MapGenVillage.villageSpawnBiomes.toArray().equals(y.toArray())) { + MapGenVillage.villageSpawnBiomes = y; + } + + /*if (map == null) { + map = FlatGeneratorInfo.createFlatGeneratorFromString("abcdefg12345678").getWorldFeatures(); + }*/ + + /*if (map != null && map.containsKey("village")){ + Map map1 = (Map)map.get("village"); + if (!map1.containsKey("size")) + { + map1.put("size", "10"); + } + villageGenerator = new MapGenExtendedVillage(map1); + villageGenerator = (MapGenExtendedVillage) TerrainGen.getModdedMapGen(villageGenerator, + net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.VILLAGE); + Logger.INFO("Registered Valid Chunk Provider for Custom Villages."); + } + else { + Logger.INFO("Failed to register Valid Chunk Provider for Custom Villages."); + }*/ + + villageGenerator = (MapGenVillage) TerrainGen.getModdedMapGen(villageGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.VILLAGE); + caveGenerator = TerrainGen.getModdedMapGen(caveGenerator, + net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.CAVE); mineshaftGenerator = (MapGenMineshaft) TerrainGen.getModdedMapGen(mineshaftGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.MINESHAFT); scatteredFeatureGenerator = (MapGenScatteredFeature) TerrainGen.getModdedMapGen(scatteredFeatureGenerator, @@ -234,7 +282,7 @@ public class ChunkProviderAustralia implements IChunkProvider { chunk.generateSkylightMap(); return chunk; }*/ - + /** * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the * specified chunk from the map seed and chunk seed @@ -248,9 +296,14 @@ public class ChunkProviderAustralia implements IChunkProvider { generateTerrain(x, z, ablock); biomesForGeneration = worldObj.getWorldChunkManager().loadBlockGeneratorData(biomesForGeneration, x * 16, z * 16, 16, 16); replaceBlocksForBiome(x, z, ablock, abyte, biomesForGeneration); + caveGenerator.func_151539_a(this, worldObj, x, z, ablock); + caveGenerator.func_151539_a(this, worldObj, x, z, ablock); + ravineGenerator.func_151539_a(this, worldObj, x, z, ablock); ravineGenerator.func_151539_a(this, worldObj, x, z, ablock); villageGenerator.func_151539_a(this, worldObj, x, z, ablock); + scatteredFeatureGenerator.func_151539_a(this, worldObj, x, z, ablock); + mineshaftGenerator.func_151539_a(this, worldObj, x, z, ablock); Chunk chunk = new Chunk(worldObj, ablock, abyte, x, z); byte[] abyte1 = chunk.getBiomeArray(); @@ -311,7 +364,7 @@ public class ChunkProviderAustralia implements IChunkProvider { for (int k3 = 0; k3 < 4; ++k3) if ((d15 += d16) > 0.0D) - par3BlockArray[j3 += short1] = MathUtils.randInt(0, 10) < 9 ? Blocks.stone : AustraliaContentLoader.mValidGenerationBlocks.get(MathUtils.randInt(0, AustraliaContentLoader.mValidGenerationBlocks.size()-1)); + par3BlockArray[j3 += short1] = Blocks.stone; else if (k2 * 8 + l2 < b0) par3BlockArray[j3 += short1] = Blocks.water; else @@ -553,6 +606,20 @@ public class ChunkProviderAustralia implements IChunkProvider { boolean flag = false; MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(par1IChunkProvider, this.worldObj, this.rand, par2, par3, flag)); + + if (true) + { + this.mineshaftGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3); + flag = this.villageGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3); + this.scatteredFeatureGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3); + if (flag) { + Logger.INFO("Did Generate? "+flag); + } + else { + //Logger.INFO("Can village spawn here? "+villageGenerator.villageSpawnBiomes.contains(biomegenbase)); + } + } + if ((biomegenbase != BiomeGenBase.desert) && (biomegenbase != BiomeGenBase.desertHills) && (!flag)) { if ((this.rand.nextInt(4) == 0) && (TerrainGen.populate(par1IChunkProvider, this.worldObj, this.rand, par2, par3, flag, PopulateChunkEvent.Populate.EventType.LAKE))) @@ -578,6 +645,10 @@ public class ChunkProviderAustralia implements IChunkProvider { biomegenbase.decorate(this.worldObj, this.rand, k, l); SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand); + if (TerrainGen.populate(this, worldObj, rand, par2, par3, flag, ANIMALS)) + { + SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand); + } k += 8; l += 8; @@ -644,8 +715,9 @@ public class ChunkProviderAustralia implements IChunkProvider { @Override public ChunkPosition func_147416_a(World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_, int p_147416_5_) { + Logger.INFO("func_147416_a: "+p_147416_2_); return - "Village".equals(p_147416_2_) && + "ExtendedVillage".equals(p_147416_2_) && this.villageGenerator != null ? this.villageGenerator.func_151545_a(p_147416_1_, p_147416_3_, p_147416_4_, p_147416_5_) : @@ -659,6 +731,10 @@ public class ChunkProviderAustralia implements IChunkProvider { @Override public void recreateStructures(int par1, int par2) { + //Logger.INFO("Recreating Structs"); + this.mineshaftGenerator.func_151539_a(this, this.worldObj, par1, par2, (Block[])null); + this.villageGenerator.func_151539_a(this, this.worldObj, par1, par2, (Block[])null); + this.scatteredFeatureGenerator.func_151539_a(this, this.worldObj, par1, par2, (Block[])null); } }
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_Australia_Ores.java b/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_Australia_Ores.java index aaa7dcb3f5..71ef94e58b 100644 --- a/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_Australia_Ores.java +++ b/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_Australia_Ores.java @@ -303,7 +303,8 @@ public class WorldGen_Australia_Ores { static long ID = 0; public static void generateValidOreVeins(){ - validOreveins.put(ID++, BaseVein);/* + //validOreveins.put(ID++, BaseVein); + /* validOreveins.put(ID++, Vein1); validOreveins.put(ID++, Vein2); validOreveins.put(ID++, Vein3); diff --git a/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Base.java b/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Base.java index 41c1816481..c451090303 100644 --- a/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Base.java +++ b/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Base.java @@ -104,17 +104,17 @@ public class WorldGen_GT_Australia_Base implements IWorldGenerator { private synchronized void generateEverglades(Random aRandom, int aX, int aZ, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { - Logger.WORLD("Trying to Generate Dimension."); + Logger.WARNING("Trying to Generate Dimension."); synchronized (listLock) { - Logger.WORLD("Locked List addition."); + Logger.WARNING("Locked List addition."); if (WorldGen_GT_Australia_Base.mList.add(new WorldGenContainer(new XSTR(Math.abs(aRandom.nextInt()) + 1), aX, aZ, Dimension_Australia.DIMID, aWorld, aChunkGenerator, aChunkProvider, aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8).biomeName))){ - Logger.WORLD("Locked List addition. Success."); + Logger.WARNING("Locked List addition. Success."); } else { - Logger.WORLD("Locked List addition. Fail."); + Logger.WARNING("Locked List addition. Fail."); } if (debugWorldGen) GT_Log.out.println("ADD WorldSeed:" + aWorld.getSeed() + " DimId" + aWorld.provider.dimensionId @@ -122,9 +122,9 @@ public class WorldGen_GT_Australia_Base implements IWorldGenerator { } if (!this.mIsGenerating) { - Logger.WORLD("Is not generating."); + Logger.WARNING("Is not generating."); this.mIsGenerating = true; - Logger.WORLD("Setting Generation to true."); + Logger.WARNING("Setting Generation to true."); int mList_sS = WorldGen_GT_Australia_Base.mList.size(); mList_sS = Math.min(mList_sS, 3); // Run a maximum of 3 chunks at a // time through worldgen. Extra @@ -136,13 +136,13 @@ public class WorldGen_GT_Australia_Base implements IWorldGenerator { + " chunk x:" + toRun.mX + " z:" + toRun.mZ + " SIZE: " + WorldGen_GT_Australia_Base.mList.size() + " i: " + i); synchronized (listLock) { - Logger.WORLD("Locked List Removal."); + Logger.WARNING("Locked List Removal."); WorldGen_GT_Australia_Base.mList.remove(0); } toRun.run(); } this.mIsGenerating = false; - Logger.WORLD("Is Generating now set to false.."); + Logger.WARNING("Is Generating now set to false.."); } } @@ -245,14 +245,14 @@ public class WorldGen_GT_Australia_Base implements IWorldGenerator { + this.mWorld.getSeed()); } - Logger.INFO("[World Generation Debug] !validOreveins.containsKey(oreveinSeed) | oreveinSeed: "+oreveinSeed); + Logger.WARNING("[World Generation Debug] !validOreveins.containsKey(oreveinSeed) | oreveinSeed: "+oreveinSeed); // Search for a valid orevein for this dimension if (!validOreveins.containsKey(oreveinSeed)) { - Logger.INFO("[World Generation Debug] oreveinPercentageRoll < oreveinPercentage? "+((oreveinPercentageRoll < oreveinPercentage))); - Logger.INFO("[World Generation Debug] WorldGen_GT_Ore_Layer.sWeight > 0? "+(WorldGen_GT_Australia_Ore_Layer.sWeight > 0)); - Logger.INFO("[World Generation Debug] WorldGen_GT_Ore_Layer.sList.size() > 0? "+(WorldGen_GT_Australia_Ore_Layer.sList.size() > 0)); + Logger.WARNING("[World Generation Debug] oreveinPercentageRoll < oreveinPercentage? "+((oreveinPercentageRoll < oreveinPercentage))); + Logger.WARNING("[World Generation Debug] WorldGen_GT_Ore_Layer.sWeight > 0? "+(WorldGen_GT_Australia_Ore_Layer.sWeight > 0)); + Logger.WARNING("[World Generation Debug] WorldGen_GT_Ore_Layer.sList.size() > 0? "+(WorldGen_GT_Australia_Ore_Layer.sList.size() > 0)); if ((oreveinPercentageRoll < oreveinPercentage) && (WorldGen_GT_Australia_Ore_Layer.sWeight > 0) && (WorldGen_GT_Australia_Ore_Layer.sList.size() > 0)) { int placementAttempts = 0; @@ -260,14 +260,14 @@ public class WorldGen_GT_Australia_Base implements IWorldGenerator { int i; for (i = 0; (i < oreveinAttempts) && (!oreveinFound) && (placementAttempts < oreveinMaxPlacementAttempts); i++) { - Logger.INFO("[World Generation Debug] i: "+i); - Logger.INFO("[World Generation Debug] placementAttempts: "+placementAttempts); - Logger.INFO("[World Generation Debug] oreveinAttempts: "+oreveinAttempts); - Logger.INFO("[World Generation Debug] (placementAttempts < oreveinMaxPlacementAttempts): "+(placementAttempts < oreveinMaxPlacementAttempts)); - Logger.INFO("[World Generation Debug] oreveinFound: "+oreveinFound); + Logger.WARNING("[World Generation Debug] i: "+i); + Logger.WARNING("[World Generation Debug] placementAttempts: "+placementAttempts); + Logger.WARNING("[World Generation Debug] oreveinAttempts: "+oreveinAttempts); + Logger.WARNING("[World Generation Debug] (placementAttempts < oreveinMaxPlacementAttempts): "+(placementAttempts < oreveinMaxPlacementAttempts)); + Logger.WARNING("[World Generation Debug] oreveinFound: "+oreveinFound); int tRandomWeight = oreveinRNG.nextInt(WorldGen_GT_Australia_Ore_Layer.sWeight); for (WorldGen_GT_Australia_Ore_Layer tWorldGen : WorldGen_GT_Australia_Ore_Layer.sList) { - Logger.INFO("[World Generation Debug] Iterating sList - Size: "+WorldGen_GT_Australia_Ore_Layer.sList.size()); + Logger.WARNING("[World Generation Debug] Iterating sList - Size: "+WorldGen_GT_Australia_Ore_Layer.sList.size()); tRandomWeight -= (tWorldGen).mWeight; if (tRandomWeight <= 0) { try { @@ -292,18 +292,18 @@ public class WorldGen_GT_Australia_Base implements IWorldGenerator { + placementAttempts + " dimensionName=" + tDimensionName); validOreveins.put(oreveinSeed, tWorldGen); oreveinFound = true; - Logger.INFO("[World Generation Debug] ORE_PLACED"); + Logger.WARNING("[World Generation Debug] ORE_PLACED"); break; case WorldGen_GT_Australia_Ore_Layer.NO_ORE_IN_BOTTOM_LAYER: placementAttempts++; - Logger.INFO("[World Generation Debug] NO_ORE_IN_BOTTOM_LAYER | Attempts: "+placementAttempts); + Logger.WARNING("[World Generation Debug] NO_ORE_IN_BOTTOM_LAYER | Attempts: "+placementAttempts); // SHould do retry in this case // until out of chances break; case WorldGen_GT_Australia_Ore_Layer.NO_OVERLAP: // Orevein didn't reach this chunk, // can't add it yet to the hash - Logger.INFO("[World Generation Debug] NO_OVERLAP"); + Logger.WARNING("[World Generation Debug] NO_OVERLAP"); if (debugWorldGen) GT_Log.out.println( " Added far oreveinSeed=" + oreveinSeed + " " + ( tWorldGen).mWorldGenName + @@ -323,7 +323,7 @@ public class WorldGen_GT_Australia_Base implements IWorldGenerator { " dimensionName=" + tDimensionName ); // SHould do retry in this case until out of chances - Logger.INFO("[World Generation Debug] NO_OVERLAP_AIR_BLOCK"); + Logger.WARNING("[World Generation Debug] NO_OVERLAP_AIR_BLOCK"); placementAttempts++; break; } diff --git a/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Ore_Layer.java b/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Ore_Layer.java index 4011d2ce48..bbaa7ef008 100644 --- a/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Ore_Layer.java +++ b/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Ore_Layer.java @@ -88,7 +88,7 @@ extends WorldGen_GT_Australia { public WorldGen_GT_Australia_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, boolean aOverworld, boolean aNether, boolean aEnd, boolean GC_UNUSED1, boolean GC_UNUSED2, boolean GC_UNUSED3, Material aPrimary, Material aSecondary, Material aBetween, Material aSporadic) { super(aName, sList, aDefault); - Logger.WORLD("Creating Ore Layer Object"); + Logger.WARNING("Creating Ore Layer Object"); this.mOverworld = GTplusplus_Australia.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld); this.mNether = GTplusplus_Australia.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Nether", aNether); this.mEnd = GTplusplus_Australia.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "TheEnd", aEnd); @@ -145,7 +145,7 @@ extends WorldGen_GT_Australia { this.mSecondaryMeta = this.mSecondary.getOreBlock(1); this.mBetweenMeta = this.mBetween.getOreBlock(1); this.mSporadicMeta = this.mSporadic.getOreBlock(1); - Logger.WORLD("[Vein Generator] An Ore in a Vein had defaulted back to a default value, so they have now been reset to correct values."); + Logger.WARNING("[Vein Generator] An Ore in a Vein had defaulted back to a default value, so they have now been reset to correct values."); } if( mWorldGenName.equals("vein0") ) { @@ -153,7 +153,7 @@ extends WorldGen_GT_Australia { " NoOresInVein-vein0" ); // This is a special empty orevein - Logger.WORLD("[World Generation Debug] Special Empty Vein placed."); + Logger.WARNING("[World Generation Debug] Special Empty Vein placed."); return ORE_PLACED; } if (aDimensionType != Dimension_Australia.DIMID) { @@ -164,7 +164,7 @@ extends WorldGen_GT_Australia { ); } */ - Logger.WORLD("[World Generation Debug] Wrong dimension."); + Logger.WARNING("[World Generation Debug] Wrong dimension."); return WRONG_DIMENSION; } if (!this.mRestrictBiome.equals("None") && !(this.mRestrictBiome.equals(aBiome))) { @@ -254,7 +254,7 @@ extends WorldGen_GT_Australia { ); return NO_ORE_IN_BOTTOM_LAYER; // Exit early, didn't place anything in the bottom layer }*/ - Logger.WORLD("[World Generation Debug] Trying to set Ores?"); + Logger.WARNING("[World Generation Debug] Trying to set Ores?"); for (level = tMinY; level < (tMinY-1+3); level++) { for (int tX = wX; tX < eX; tX++) { int placeX = Math.max(1, Math.max(MathHelper.abs_int(wXVein - tX), MathHelper.abs_int(eXVein - tX))/localDensity); @@ -390,7 +390,7 @@ extends WorldGen_GT_Australia { if (fString.contains(ore1String)){ int r = f.mMetaItemSubID; if (setOreBlock(aWorld, aX, aY, aZ, r, false)){ - Logger.WORLD("[World Generation Debug] Set "+f.mDefaultLocalName+" Ore at X: "+aX+" | Y: "+aY+" | Z: "+aZ); + Logger.WARNING("[World Generation Debug] Set "+f.mDefaultLocalName+" Ore at X: "+aX+" | Y: "+aY+" | Z: "+aZ); return true; } } @@ -405,7 +405,7 @@ extends WorldGen_GT_Australia { if (fString.contains(ore2String)){ int r = f.mMetaItemSubID; if (setOreBlock(aWorld, aX, aY, aZ, r, false)){ - Logger.WORLD("[World Generation Debug] Set "+f.mDefaultLocalName+" Ore at X: "+aX+" | Y: "+aY+" | Z: "+aZ); + Logger.WARNING("[World Generation Debug] Set "+f.mDefaultLocalName+" Ore at X: "+aX+" | Y: "+aY+" | Z: "+aZ); return true; } } @@ -420,7 +420,7 @@ extends WorldGen_GT_Australia { if (fString.contains(ore3String)){ int r = f.mMetaItemSubID; if (setOreBlock(aWorld, aX, aY, aZ, r, false)){ - Logger.WORLD("[World Generation Debug] Set "+f.mDefaultLocalName+" Ore at X: "+aX+" | Y: "+aY+" | Z: "+aZ); + Logger.WARNING("[World Generation Debug] Set "+f.mDefaultLocalName+" Ore at X: "+aX+" | Y: "+aY+" | Z: "+aZ); return true; } } @@ -435,7 +435,7 @@ extends WorldGen_GT_Australia { if (fString.contains(ore4String)){ int r = f.mMetaItemSubID; if (setOreBlock(aWorld, aX, aY, aZ, r, false)){ - Logger.WORLD("[World Generation Debug] Set "+f.mDefaultLocalName+" Ore at X: "+aX+" | Y: "+aY+" | Z: "+aZ); + Logger.WARNING("[World Generation Debug] Set "+f.mDefaultLocalName+" Ore at X: "+aX+" | Y: "+aY+" | Z: "+aZ); return true; } } @@ -460,7 +460,7 @@ extends WorldGen_GT_Australia { tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.sandstone)) { if (aWorld.setBlock(aX, aY, aZ, tOreBlock, 0, 3)){ - Logger.WORLD("[World Generation Debug] Set "+tOreBlock.getLocalizedName()+" at X: "+aX+" | Y: "+aY+" | Z: "+aZ); + Logger.WARNING("[World Generation Debug] Set "+tOreBlock.getLocalizedName()+" at X: "+aX+" | Y: "+aY+" | Z: "+aZ); return true; } } diff --git a/src/Java/gtPlusPlus/australia/gen/map/MapGenExtendedVillage.java b/src/Java/gtPlusPlus/australia/gen/map/MapGenExtendedVillage.java new file mode 100644 index 0000000000..8fc6940242 --- /dev/null +++ b/src/Java/gtPlusPlus/australia/gen/map/MapGenExtendedVillage.java @@ -0,0 +1,265 @@ +package gtPlusPlus.australia.gen.map; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; + +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.australia.GTplusplus_Australia; + +import java.util.Map.Entry; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.structure.MapGenStructure; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureStart; +import net.minecraft.world.gen.structure.StructureVillagePieces; + +public class MapGenExtendedVillage extends MapGenStructure +{ + /** A list of all the biomes villages can spawn in. */ + public static List<BiomeGenBase> villageSpawnBiomes = Arrays.asList(new BiomeGenBase[] {GTplusplus_Australia.Australian_Desert_Biome_3, GTplusplus_Australia.Australian_Plains_Biome, GTplusplus_Australia.Australian_Forest_Biome, GTplusplus_Australia.Australian_Outback_Biome}); + /** World terrain type, 0 for normal, 1 for flat map */ + private int terrainType; + private int field_82665_g; + private int field_82666_h; + + public MapGenExtendedVillage(){ + this.field_82665_g = 8; + this.field_82666_h = 4; + } + + public MapGenExtendedVillage(Map<?, ?> p_i2093_1_){ + this(); + Iterator<?> iterator = p_i2093_1_.entrySet().iterator(); + + Logger.INFO("Created Extended Village Object."); + + while (iterator.hasNext()) + { + Entry<?, ?> entry = (Entry<?, ?>)iterator.next(); + + if (((String)entry.getKey()).equals("size")) + { + this.terrainType = MathHelper.parseIntWithDefaultAndMax((String)entry.getValue(), this.terrainType, 0); + } + else if (((String)entry.getKey()).equals("distance")) + { + this.field_82665_g = MathHelper.parseIntWithDefaultAndMax((String)entry.getValue(), this.field_82665_g, this.field_82666_h + 1); + } + } + } + + public String func_143025_a() + { + return "ExtendedVillage"; + } + + protected boolean canSpawnStructureAtCoords(int p_75047_1_, int p_75047_2_) + { + + + int k = p_75047_1_; + int l = p_75047_2_; + + if (p_75047_1_ < 0) + { + p_75047_1_ -= this.field_82665_g - 1; + } + + if (p_75047_2_ < 0) + { + p_75047_2_ -= this.field_82665_g - 1; + } + + int i1 = p_75047_1_ / this.field_82665_g; + int j1 = p_75047_2_ / this.field_82665_g; + Random random = this.worldObj.setRandomSeed(i1, j1, 10387312); + i1 *= this.field_82665_g; + j1 *= this.field_82665_g; + i1 += random.nextInt(this.field_82665_g - this.field_82666_h); + j1 += random.nextInt(this.field_82665_g - this.field_82666_h); + + if (k == i1 && l == j1) + { + boolean flag = this.worldObj.getWorldChunkManager().areBiomesViable(k * 16 + 8, l * 16 + 8, 0, villageSpawnBiomes); + + if (flag) + { + Logger.INFO("Found viable biome(s) for custom village"); + return true; + } + } + + return false; + } + + protected StructureStart getStructureStart(int p_75049_1_, int p_75049_2_) + { + return new MapGenExtendedVillage.Start(this.worldObj, this.rand, p_75049_1_, p_75049_2_, this.terrainType); + } + + public static class Start extends StructureStart + { + /** well ... thats what it does */ + private boolean hasMoreThanTwoComponents; + + public Start() { + } + + public Start(World p_i2092_1_, Random p_i2092_2_, int p_i2092_3_, int p_i2092_4_, int p_i2092_5_) + { + super(p_i2092_3_, p_i2092_4_); + Logger.INFO("Trying to Start Village Builder."); + List<?> list = StructureVillagePieces.getStructureVillageWeightedPieceList(p_i2092_2_, p_i2092_5_); + StructureVillagePieces.Start start = new StructureVillagePieces.Start(p_i2092_1_.getWorldChunkManager(), 0, p_i2092_2_, (p_i2092_3_ << 4) + 2, (p_i2092_4_ << 4) + 2, list, p_i2092_5_); + this.components.add(start); + start.buildComponent(start, this.components, p_i2092_2_); + List<?> list1 = start.field_74930_j; + List<?> list2 = start.field_74932_i; + int l; + Logger.INFO("List1: "+list1.size()+" | List2: "+list2.size()); + + while (!list1.isEmpty() || !list2.isEmpty()) + { + Logger.INFO("Iterating non empty list."); + StructureComponent structurecomponent; + + if (list1.isEmpty()) + { + l = p_i2092_2_.nextInt(list2.size()); + structurecomponent = (StructureComponent)list2.remove(l); + structurecomponent.buildComponent(start, this.components, p_i2092_2_); + } + else + { + l = p_i2092_2_.nextInt(list1.size()); + structurecomponent = (StructureComponent)list1.remove(l); + structurecomponent.buildComponent(start, this.components, p_i2092_2_); + } + } + Logger.INFO("Finished iterating lists, updating bounding box for structure."); + + this.updateBoundingBox(); + l = 0; + Iterator iterator = this.components.iterator(); + + while (iterator.hasNext()) + { + Logger.INFO("Iterating Components."); + StructureComponent structurecomponent1 = (StructureComponent)iterator.next(); + + if (!(structurecomponent1 instanceof StructureVillagePieces.Road)) + { + ++l; + } + } + + Logger.INFO("hasMoreThanTwoComponents? "+(l > 2)); + this.hasMoreThanTwoComponents = l > 2; + } + + /** + * currently only defined for Villages, returns true if Village has more than 2 non-road components + */ + public boolean isSizeableStructure() + { + //return this.hasMoreThanTwoComponents; + return true; + } + + public void func_143022_a(NBTTagCompound p_143022_1_) + { + super.func_143022_a(p_143022_1_); + p_143022_1_.setBoolean("Valid", this.hasMoreThanTwoComponents); + } + + public void func_143017_b(NBTTagCompound p_143017_1_) + { + super.func_143017_b(p_143017_1_); + this.hasMoreThanTwoComponents = p_143017_1_.getBoolean("Valid"); + } + } + + /** + * Generates structures in specified chunk next to existing structures. Does *not* generate StructureStarts. + */ + @Override + public boolean generateStructuresInChunk(World p_75051_1_, Random p_75051_2_, int p_75051_3_, int p_75051_4_){ + //Logger.INFO("Try generate Structs in chunk."); + this.callPrivateFunction1(p_75051_1_); + int k = (p_75051_3_ << 4) + 8; + int l = (p_75051_4_ << 4) + 8; + boolean flag = false; + Iterator iterator = this.structureMap.values().iterator(); + + //Logger.INFO("Iteration Size: "+this.structureMap.values().size()); + while (iterator.hasNext()) + { + //Logger.INFO("Iterating."); + StructureStart structurestart = (StructureStart)iterator.next(); + + if (structurestart.isSizeableStructure() && (structurestart.getBoundingBox().intersectsWith(k, l, k + 15, l + 15) || structurestart.getBoundingBox().intersectsWith(k, l, k - 15, l - 15))) + { + Logger.INFO("Iterating. 2"); + structurestart.generateStructure(p_75051_1_, p_75051_2_, new StructureBoundingBox(k, l, k + 15, l + 15)); + flag = true; + this.callPrivateFunction2(structurestart.func_143019_e(), structurestart.func_143018_f(), structurestart); + } + /* else { + Logger.INFO("Iterating. 3"); + Logger.INFO("structurestart.isSizeableStructure()? "+structurestart.isSizeableStructure()); + Logger.INFO("structurestart.getBoundingBox().intersectsWith(k, l, k + 15, l + 15)? "+(structurestart.getBoundingBox().intersectsWith(k, l, k + 15, l + 15) || structurestart.getBoundingBox().intersectsWith(k, l, k - 15, l - 15))); + Logger.INFO("K: "+k+" | L: "+l); + Logger.INFO("structure bounding box info: x-:"+structurestart.getBoundingBox().minX+" y-:"+structurestart.getBoundingBox().minY+" x+:"+structurestart.getBoundingBox().maxX+" y+:"+structurestart.getBoundingBox().maxY); + }*/ + } + + return flag; + } + + Method mMethod1; + Method mMethod2; + private boolean callPrivateFunction1(World aWorld) { + if (mMethod1 == null) { + try { + mMethod1 = MapGenStructure.class.getDeclaredMethod("func_143027_a", World.class); + } catch (NoSuchMethodException | SecurityException e) { + return false; + } + } + if (mMethod1 != null) { + try { + //Logger.INFO("Invoking func_143027_a"); + mMethod1.invoke(this, aWorld); + return true; + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {} + } + return false; + } + + private boolean callPrivateFunction2(int aInt1, int aInt2, StructureStart aStruct) { + if (mMethod2 == null) { + try { + mMethod2 = MapGenStructure.class.getDeclaredMethod("func_143026_a", int.class, int.class, StructureStart.class); + } catch (NoSuchMethodException | SecurityException e) { + return false; + } + } + if (mMethod2 != null) { + try { + Logger.INFO("Invoking func_143026_a"); + mMethod2.invoke(this, aInt1, aInt2, aStruct); + return true; + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {} + } + return false; + } +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/australia/gen/map/structure/StructureManager.java b/src/Java/gtPlusPlus/australia/gen/map/structure/StructureManager.java new file mode 100644 index 0000000000..b3238a5903 --- /dev/null +++ b/src/Java/gtPlusPlus/australia/gen/map/structure/StructureManager.java @@ -0,0 +1,20 @@ +package gtPlusPlus.australia.gen.map.structure; + +import gtPlusPlus.australia.gen.map.MapGenExtendedVillage; +import gtPlusPlus.australia.gen.map.structure.type.ComponentVillageBank; +import gtPlusPlus.core.lib.CORE; +import net.minecraft.world.gen.structure.MapGenStructureIO; + +public class StructureManager { + + public static void registerVillageComponents() { + try { + //Register Village + MapGenStructureIO.registerStructure(MapGenExtendedVillage.Start.class, "ExtendedVillage"); + + //Register Structures within village + MapGenStructureIO.func_143031_a(ComponentVillageBank.class, CORE.MODID+":"+"Bank"); + } catch (Throwable e) {} + } + +} diff --git a/src/Java/gtPlusPlus/australia/gen/map/structure/type/ComponentVillageBank.java b/src/Java/gtPlusPlus/australia/gen/map/structure/type/ComponentVillageBank.java new file mode 100644 index 0000000000..5b7017aaf0 --- /dev/null +++ b/src/Java/gtPlusPlus/australia/gen/map/structure/type/ComponentVillageBank.java @@ -0,0 +1,175 @@ +package gtPlusPlus.australia.gen.map.structure.type; + +import static net.minecraftforge.common.ChestGenHooks.VILLAGE_BLACKSMITH; + +import java.util.List; +import java.util.Random; + +import gtPlusPlus.api.objects.Logger; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureVillagePieces; +import net.minecraft.world.gen.structure.StructureVillagePieces.House2; +import net.minecraftforge.common.ChestGenHooks; + +public class ComponentVillageBank extends House2 { + + /** List of items that Village's Blacksmith chest can contain. */ + public static final WeightedRandomChestContent[] villageBlacksmithChestContents = new WeightedRandomChestContent[] { + new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 3), + new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), + new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5), + new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), + new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15), + new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.iron_sword, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.iron_chestplate, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.iron_helmet, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.iron_leggings, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.iron_boots, 0, 1, 1, 5), + new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.obsidian), 0, 3, 7, 5), + new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.sapling), 0, 3, 7, 5), + new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 3), + new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1), + new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 1), + new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1) + }; + + private boolean hasMadeChest; + + public ComponentVillageBank() { + Logger.INFO("Created a Bank."); + } + + public ComponentVillageBank(StructureVillagePieces.Start aStart, int p_i2103_2_, Random aRand, + StructureBoundingBox aBox, int aCoordBaseMode) { + super(aStart, p_i2103_2_, aRand, aBox, aCoordBaseMode); + this.coordBaseMode = aCoordBaseMode; + this.boundingBox = aBox; + } + + public static StructureVillagePieces.House2 func_74915_a(StructureVillagePieces.Start p_74915_0_, List p_74915_1_, + Random p_74915_2_, int p_74915_3_, int p_74915_4_, int p_74915_5_, int p_74915_6_, int p_74915_7_) { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74915_3_, + p_74915_4_, p_74915_5_, 0, 0, 0, 10, 6, 7, p_74915_6_); + Logger.INFO("12334453"); + return canVillageGoDeeper(structureboundingbox) + && StructureComponent.findIntersecting(p_74915_1_, structureboundingbox) == null + ? new StructureVillagePieces.House2(p_74915_0_, p_74915_7_, p_74915_2_, structureboundingbox, + p_74915_6_) + : null; + } + + protected void func_143012_a(NBTTagCompound aNBT) { + super.func_143012_a(aNBT); + aNBT.setBoolean("Chest", this.hasMadeChest); + } + + protected void func_143011_b(NBTTagCompound aNBT) { + super.func_143011_b(aNBT); + this.hasMadeChest = aNBT.getBoolean("Chest"); + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob + * Spawners, it closes Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World aWorld, Random aRand, StructureBoundingBox aBox) { + if (this.field_143015_k < 0) { + this.field_143015_k = this.getAverageGroundLevel(aWorld, aBox); + + if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 6 - 1, 0); + } + + this.fillWithBlocks(aWorld, aBox, 0, 1, 0, 9, 4, 6, Blocks.air, Blocks.air, false); + this.fillWithBlocks(aWorld, aBox, 0, 0, 0, 9, 0, 6, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(aWorld, aBox, 0, 4, 0, 9, 4, 6, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(aWorld, aBox, 0, 5, 0, 9, 5, 6, Blocks.stone_slab, Blocks.stone_slab, false); + this.fillWithBlocks(aWorld, aBox, 1, 5, 1, 8, 5, 5, Blocks.air, Blocks.air, false); + this.fillWithBlocks(aWorld, aBox, 1, 1, 0, 2, 3, 0, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(aWorld, aBox, 0, 1, 0, 0, 4, 0, Blocks.log, Blocks.log, false); + this.fillWithBlocks(aWorld, aBox, 3, 1, 0, 3, 4, 0, Blocks.log, Blocks.log, false); + this.fillWithBlocks(aWorld, aBox, 0, 1, 6, 0, 4, 6, Blocks.log, Blocks.log, false); + this.placeBlockAtCurrentPosition(aWorld, Blocks.planks, 0, 3, 3, 1, aBox); + this.fillWithBlocks(aWorld, aBox, 3, 1, 2, 3, 3, 2, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(aWorld, aBox, 4, 1, 3, 5, 3, 3, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(aWorld, aBox, 0, 1, 1, 0, 3, 5, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(aWorld, aBox, 1, 1, 6, 5, 3, 6, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(aWorld, aBox, 5, 1, 0, 5, 3, 0, Blocks.fence, Blocks.fence, false); + this.fillWithBlocks(aWorld, aBox, 9, 1, 0, 9, 3, 0, Blocks.fence, Blocks.fence, false); + this.fillWithBlocks(aWorld, aBox, 6, 1, 4, 9, 4, 6, Blocks.cobblestone, Blocks.cobblestone, false); + this.placeBlockAtCurrentPosition(aWorld, Blocks.flowing_lava, 0, 7, 1, 5, aBox); + this.placeBlockAtCurrentPosition(aWorld, Blocks.flowing_lava, 0, 8, 1, 5, aBox); + this.placeBlockAtCurrentPosition(aWorld, Blocks.iron_bars, 0, 9, 2, 5, aBox); + this.placeBlockAtCurrentPosition(aWorld, Blocks.iron_bars, 0, 9, 2, 4, aBox); + this.fillWithBlocks(aWorld, aBox, 7, 2, 4, 8, 2, 5, Blocks.air, Blocks.air, false); + this.placeBlockAtCurrentPosition(aWorld, Blocks.cobblestone, 0, 6, 1, 3, aBox); + this.placeBlockAtCurrentPosition(aWorld, Blocks.furnace, 0, 6, 2, 3, aBox); + this.placeBlockAtCurrentPosition(aWorld, Blocks.furnace, 0, 6, 3, 3, aBox); + this.placeBlockAtCurrentPosition(aWorld, Blocks.double_stone_slab, 0, 8, 1, 1, aBox); + this.placeBlockAtCurrentPosition(aWorld, Blocks.glass_pane, 0, 0, 2, 2, aBox); + this.placeBlockAtCurrentPosition(aWorld, Blocks.glass_pane, 0, 0, 2, 4, aBox); + this.placeBlockAtCurrentPosition(aWorld, Blocks.glass_pane, 0, 2, 2, 6, aBox); + this.placeBlockAtCurrentPosition(aWorld, Blocks.glass_pane, 0, 4, 2, 6, aBox); + this.placeBlockAtCurrentPosition(aWorld, Blocks.fence, 0, 2, 1, 4, aBox); + this.placeBlockAtCurrentPosition(aWorld, Blocks.wooden_pressure_plate, 0, 2, 2, 4, aBox); + this.placeBlockAtCurrentPosition(aWorld, Blocks.planks, 0, 1, 1, 5, aBox); + this.placeBlockAtCurrentPosition(aWorld, Blocks.oak_stairs, + this.getMetadataWithOffset(Blocks.oak_stairs, 3), 2, 1, 5, aBox); + this.placeBlockAtCurrentPosition(aWorld, Blocks.oak_stairs, + this.getMetadataWithOffset(Blocks.oak_stairs, 1), 1, 1, 4, aBox); + int i; + int j; + + if (!this.hasMadeChest) { + i = this.getYWithOffset(1); + j = this.getXWithOffset(5, 5); + int k = this.getZWithOffset(5, 5); + + if (aBox.isVecInside(j, i, k)) { + this.hasMadeChest = true; + this.generateStructureChestContents(aWorld, aBox, aRand, 5, 1, 5, + ChestGenHooks.getItems(VILLAGE_BLACKSMITH, aRand), + ChestGenHooks.getCount(VILLAGE_BLACKSMITH, aRand)); + } + } + + for (i = 6; i <= 8; ++i) { + if (this.getBlockAtCurrentPosition(aWorld, i, 0, -1, aBox).getMaterial() == Material.air && this + .getBlockAtCurrentPosition(aWorld, i, -1, -1, aBox).getMaterial() != Material.air) { + this.placeBlockAtCurrentPosition(aWorld, Blocks.stone_stairs, + this.getMetadataWithOffset(Blocks.stone_stairs, 3), i, 0, -1, aBox); + } + } + + for (i = 0; i < 7; ++i) { + for (j = 0; j < 10; ++j) { + this.clearCurrentPositionBlocksUpwards(aWorld, j, 6, i, aBox); + this.func_151554_b(aWorld, Blocks.cobblestone, 0, j, -1, i, aBox); + } + } + + this.spawnVillagers(aWorld, aBox, 7, 1, 1, 1); + return true; + } + + /** + * Returns the villager type to spawn in this component, based on the number of + * villagers already spawned. + */ + protected int getVillagerType(int p_74888_1_) { + return 7735; + } + +} |