Vastly improved structure generation
This commit is contained in:
parent
579ddee7f0
commit
55d14fc782
8 changed files with 4509 additions and 5159 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -5,9 +5,8 @@
|
||||||
*.pydevproject
|
*.pydevproject
|
||||||
.project
|
.project
|
||||||
.metadata
|
.metadata
|
||||||
bin/
|
common/bin/
|
||||||
tmp/
|
tmp/
|
||||||
*.class
|
|
||||||
*.tmp
|
*.tmp
|
||||||
*.bak
|
*.bak
|
||||||
*.swp
|
*.swp
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,31 +0,0 @@
|
||||||
package mysticruins;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.IWorldGenerator;
|
|
||||||
|
|
||||||
public class WorldGenMysticDungeon implements IWorldGenerator
|
|
||||||
{
|
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
|
||||||
{
|
|
||||||
switch (world.provider.dimensionId)
|
|
||||||
{
|
|
||||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < Config.DunRarity; i++)
|
|
||||||
{
|
|
||||||
int Xcoord1 = blockX + random.nextInt(16) + 8;
|
|
||||||
int Ycoord1 = random.nextInt(9) + 28;
|
|
||||||
int Zcoord1 = blockZ + random.nextInt(16) + 8;
|
|
||||||
|
|
||||||
(new StructureMysticDungeon()).generate(world, random, Xcoord1, Ycoord1, Zcoord1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
package mysticruins;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.IWorldGenerator;
|
|
||||||
|
|
||||||
public class WorldGenRuin$1 implements IWorldGenerator
|
|
||||||
{
|
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
|
||||||
{
|
|
||||||
switch (world.provider.dimensionId)
|
|
||||||
{
|
|
||||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < Config.RuinRarity; i++)
|
|
||||||
{
|
|
||||||
int Xcoord1 = blockX + random.nextInt(16) + 8;
|
|
||||||
int Ycoord1 = random.nextInt(11) + 60;
|
|
||||||
int Zcoord1 = blockZ + random.nextInt(16) + 8;
|
|
||||||
|
|
||||||
(new StructureRuin$1()).generate(world, random, Xcoord1, Ycoord1, Zcoord1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
package mysticruins;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.IWorldGenerator;
|
|
||||||
|
|
||||||
public class WorldGenRuin implements IWorldGenerator
|
|
||||||
{
|
|
||||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
|
||||||
{
|
|
||||||
switch (world.provider.dimensionId)
|
|
||||||
{
|
|
||||||
case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < Config.RuinRarity; i++)
|
|
||||||
{
|
|
||||||
int Xcoord1 = blockX + random.nextInt(16) + 8;
|
|
||||||
int Ycoord1 = random.nextInt(11) + 60;
|
|
||||||
int Zcoord1 = blockZ + random.nextInt(16) + 8;
|
|
||||||
|
|
||||||
(new StructureRuin()).generate(world, random, Xcoord1, Ycoord1, Zcoord1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
43
common/mysticruins/WorldGenMystic.java
Normal file
43
common/mysticruins/WorldGenMystic.java
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
package mysticruins;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
|
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||||
|
import cpw.mods.fml.common.IWorldGenerator;
|
||||||
|
|
||||||
|
public class WorldGenMystic implements IWorldGenerator {
|
||||||
|
public static final WorldGenerator ruin = new StructureRuin();
|
||||||
|
public static final WorldGenerator ruin1 = new StructureRuin$1();
|
||||||
|
public static final WorldGenerator dungeon = new StructureMysticDungeon();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
||||||
|
if (Config.ruinAllowId.contains(world.provider.dimensionId)) {
|
||||||
|
generateRuins(world, random, chunkX * 16, chunkZ * 16);
|
||||||
|
}
|
||||||
|
if (Config.dungeonAllowId.contains(world.provider.dimensionId)) {
|
||||||
|
generateDungeon(world, random, chunkX * 16, chunkZ * 16);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void generateDungeon(World world, Random random, int blockX, int blockZ) {
|
||||||
|
for (int i = 0; i < Config.DunRarity; i++) {
|
||||||
|
int Xcoord1 = blockX + random.nextInt(16) + 8;
|
||||||
|
int Ycoord1 = random.nextInt(9) + 28;
|
||||||
|
int Zcoord1 = blockZ + random.nextInt(16) + 8;
|
||||||
|
dungeon.generate(world, random, Xcoord1, Ycoord1, Zcoord1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void generateRuins(World world, Random random, int blockX, int blockZ) {
|
||||||
|
for (int i = 0; i < Config.RuinRarity; i++) {
|
||||||
|
int Xcoord1 = blockX + random.nextInt(16) + 8;
|
||||||
|
int Ycoord1 = random.nextInt(11) + 60;
|
||||||
|
int Zcoord1 = blockZ + random.nextInt(16) + 8;
|
||||||
|
ruin.generate(world, random, Xcoord1, Ycoord1, Zcoord1);
|
||||||
|
ruin1.generate(world, random, Xcoord1, Ycoord1, Zcoord1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue