Code Clean-Sweep!
This commit is contained in:
parent
7d7a8f0b7e
commit
02e6be9d0e
34 changed files with 610 additions and 766 deletions
|
|
@ -1,10 +1,10 @@
|
|||
package MysticOres.Worldgen;
|
||||
|
||||
import MysticOres.MysticOres;
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
import MysticOres.Lib.Rarity;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class WorldGenHandler
|
||||
public class GeneratorManager
|
||||
{
|
||||
public static void init()
|
||||
{
|
||||
|
|
@ -16,9 +16,9 @@ public class WorldGenHandler
|
|||
GameRegistry.registerWorldGenerator(new WorldGenAmethyst());
|
||||
GameRegistry.registerWorldGenerator(new WorldGenAdamantine());
|
||||
GameRegistry.registerWorldGenerator(new WorldGenAgate());
|
||||
GameRegistry.registerWorldGenerator(new WorldGenMysticNetherMinable(BlockHandler.BlockBase.blockID, 7, 2));
|
||||
GameRegistry.registerWorldGenerator(new WorldGenMysticNetherMinable(BlockHandler.BlockBase.blockID, 8, 3));
|
||||
GameRegistry.registerWorldGenerator(new WorldGenMysticNetherMinable(BlockHandler.BlockBase.blockID, 9, 2));
|
||||
GameRegistry.registerWorldGenerator(new WorldGenMysticNetherMinable(BlockHandler.BlockBase.blockID, 10, 3));
|
||||
GameRegistry.registerWorldGenerator(new NetherGenMineable(BlockHandler.BlockBase.blockID, 7, Rarity.BLOODSTONE + 1));
|
||||
GameRegistry.registerWorldGenerator(new NetherGenMineable(BlockHandler.BlockBase.blockID, 8, Rarity.BLACKSOULSTONE + 1));
|
||||
GameRegistry.registerWorldGenerator(new NetherGenMineable(BlockHandler.BlockBase.blockID, 9, Rarity.BLUESOULSTONE + 1));
|
||||
GameRegistry.registerWorldGenerator(new NetherGenMineable(BlockHandler.BlockBase.blockID, 10, Rarity.REDSOULSTONE));
|
||||
}
|
||||
}
|
||||
|
|
@ -7,25 +7,28 @@ import net.minecraft.util.MathHelper;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public class NetherHandler extends WorldGenerator {
|
||||
public class NetherGenHelper extends WorldGenerator
|
||||
{
|
||||
|
||||
private int minableBlockId;
|
||||
private int minableBlockMeta = 0;
|
||||
|
||||
private int numberOfBlocks;
|
||||
|
||||
public NetherHandler(int par1, int par2) {
|
||||
public NetherGenHelper(int par1, int par2)
|
||||
{
|
||||
this.minableBlockId = par1;
|
||||
this.numberOfBlocks = par2;
|
||||
}
|
||||
|
||||
public NetherHandler(int id, int meta, int number) {
|
||||
public NetherGenHelper(int id, int meta, int number)
|
||||
{
|
||||
this(id, number);
|
||||
minableBlockMeta = meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) {
|
||||
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
|
||||
{
|
||||
float var6 = par2Random.nextFloat() * (float) Math.PI;
|
||||
double var7 = (double) ((float) (par3 + 8) + MathHelper.sin(var6) * (float) this.numberOfBlocks / 8.0F);
|
||||
double var9 = (double) ((float) (par3 + 8) - MathHelper.sin(var6) * (float) this.numberOfBlocks / 8.0F);
|
||||
|
|
@ -34,7 +37,8 @@ public class NetherHandler extends WorldGenerator {
|
|||
double var15 = (double) (par4 + par2Random.nextInt(3) - 2);
|
||||
double var17 = (double) (par4 + par2Random.nextInt(3) - 2);
|
||||
|
||||
for (int nBlockNumberTry = 0; nBlockNumberTry <= this.numberOfBlocks; ++nBlockNumberTry) {
|
||||
for (int nBlockNumberTry = 0; nBlockNumberTry <= this.numberOfBlocks; ++nBlockNumberTry)
|
||||
{
|
||||
double var20 = var7 + (var9 - var7) * (double) nBlockNumberTry / (double) this.numberOfBlocks;
|
||||
double var22 = var15 + (var17 - var15) * (double) nBlockNumberTry / (double) this.numberOfBlocks;
|
||||
double var24 = var11 + (var13 - var11) * (double) nBlockNumberTry / (double) this.numberOfBlocks;
|
||||
|
|
@ -48,19 +52,25 @@ public class NetherHandler extends WorldGenerator {
|
|||
int var36 = MathHelper.floor_double(var22 + var30 / 2.0D);
|
||||
int var37 = MathHelper.floor_double(var24 + var28 / 2.0D);
|
||||
|
||||
for (int var38 = var32; var38 <= var35; ++var38) {
|
||||
for (int var38 = var32; var38 <= var35; ++var38)
|
||||
{
|
||||
double var39 = ((double) var38 + 0.5D - var20) / (var28 / 2.0D);
|
||||
|
||||
if (var39 * var39 < 1.0D) {
|
||||
for (int var41 = var33; var41 <= var36; ++var41) {
|
||||
if (var39 * var39 < 1.0D)
|
||||
{
|
||||
for (int var41 = var33; var41 <= var36; ++var41)
|
||||
{
|
||||
double var42 = ((double) var41 + 0.5D - var22) / (var30 / 2.0D);
|
||||
|
||||
if (var39 * var39 + var42 * var42 < 1.0D) {
|
||||
for (int var44 = var34; var44 <= var37; ++var44) {
|
||||
if (var39 * var39 + var42 * var42 < 1.0D)
|
||||
{
|
||||
for (int var44 = var34; var44 <= var37; ++var44)
|
||||
{
|
||||
double var45 = ((double) var44 + 0.5D - var24) / (var28 / 2.0D);
|
||||
|
||||
int blocktoreplace = par1World.getBlockId(var38, var41, var44);
|
||||
if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && blocktoreplace == Block.netherrack.blockID) {
|
||||
if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && blocktoreplace == Block.netherrack.blockID)
|
||||
{
|
||||
par1World.setBlock(var38, var41, var44, this.minableBlockId, minableBlockMeta, 3);
|
||||
}
|
||||
}
|
||||
|
|
@ -8,36 +8,40 @@ import net.minecraft.world.chunk.IChunkProvider;
|
|||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenMysticNetherMinable implements IWorldGenerator {
|
||||
public class NetherGenMineable implements IWorldGenerator
|
||||
{
|
||||
|
||||
private int minableBlockId;
|
||||
private int minableBlockMeta = 0;
|
||||
|
||||
private int numberOfBlocks;
|
||||
|
||||
public WorldGenMysticNetherMinable(int blockId, int numBlocks) {
|
||||
public NetherGenMineable(int blockId, int numBlocks)
|
||||
{
|
||||
this.minableBlockId = blockId;
|
||||
this.numberOfBlocks = numBlocks;
|
||||
}
|
||||
|
||||
public WorldGenMysticNetherMinable(int blockId, int meta, int numBlocks) {
|
||||
public NetherGenMineable(int blockId, int meta, int numBlocks)
|
||||
{
|
||||
this(blockId, numBlocks);
|
||||
minableBlockMeta = meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
|
||||
{
|
||||
if (world.provider.isHellWorld)
|
||||
generateNether(world, random, chunkX * 16, chunkZ * 16);
|
||||
|
||||
}
|
||||
|
||||
private void generateNether(World world, Random random, int i, int j) {
|
||||
for (int j1 = 0; j1 < 50; j1++) {
|
||||
private void generateNether(World world, Random random, int i, int j)
|
||||
{
|
||||
for (int j1 = 0; j1 < 50; j1++)
|
||||
{
|
||||
int Xcoordinate = i + random.nextInt(16);
|
||||
int Zcoordinate = j + random.nextInt(16);
|
||||
int Ycoordinate = random.nextInt(256);
|
||||
new NetherHandler(minableBlockId, minableBlockMeta, numberOfBlocks).generate(world, random, Xcoordinate, Ycoordinate, Zcoordinate);
|
||||
new NetherGenHelper(minableBlockId, minableBlockMeta, numberOfBlocks).generate(world, random, Xcoordinate, Ycoordinate, Zcoordinate);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -2,14 +2,11 @@ package MysticOres.Worldgen;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import MysticOres.ConfigurationManager;
|
||||
import MysticOres.MysticOres;
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
import MysticOres.Lib.Rarity;
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenAdamantine implements IWorldGenerator {
|
||||
|
|
@ -22,7 +19,7 @@ public class WorldGenAdamantine implements IWorldGenerator {
|
|||
}
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||
for (int i = 0; i < ConfigurationManager.AdamantineRarity; i++)
|
||||
for (int i = 0; i < Rarity.ADAMANTINE; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(8);
|
||||
int Ycoord = random.nextInt(16);
|
||||
|
|
|
|||
|
|
@ -2,15 +2,12 @@ package MysticOres.Worldgen;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import MysticOres.ConfigurationManager;
|
||||
import MysticOres.MysticOres;
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
import MysticOres.Lib.Rarity;
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenAgate implements IWorldGenerator
|
||||
|
|
@ -23,7 +20,7 @@ public class WorldGenAgate implements IWorldGenerator
|
|||
}
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||
for (int i = 0; i < ConfigurationManager.AgateRarity; i++)
|
||||
for (int i = 0; i < Rarity.AGATE; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(32);
|
||||
int Ycoord = random.nextInt(60);
|
||||
|
|
|
|||
|
|
@ -2,15 +2,12 @@ package MysticOres.Worldgen;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import MysticOres.ConfigurationManager;
|
||||
import MysticOres.MysticOres;
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
import MysticOres.Lib.Rarity;
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenAmethyst implements IWorldGenerator {
|
||||
|
|
@ -24,7 +21,7 @@ public class WorldGenAmethyst implements IWorldGenerator {
|
|||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
||||
{
|
||||
for (int i = 0; i < ConfigurationManager.AmethystRarity; i++)
|
||||
for (int i = 0; i < Rarity.AMETHYST; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(24);
|
||||
int Ycoord = random.nextInt(60);
|
||||
|
|
|
|||
|
|
@ -2,15 +2,12 @@ package MysticOres.Worldgen;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import MysticOres.ConfigurationManager;
|
||||
import MysticOres.MysticOres;
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
import MysticOres.Lib.Rarity;
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenIridium implements IWorldGenerator {
|
||||
|
|
@ -24,7 +21,7 @@ public class WorldGenIridium implements IWorldGenerator {
|
|||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
||||
{
|
||||
for (int i = 0; i < ConfigurationManager.IridiumRarity; i++)
|
||||
for (int i = 0; i < Rarity.IRIDIUM; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(16);
|
||||
int Ycoord = random.nextInt(12);
|
||||
|
|
|
|||
|
|
@ -2,15 +2,12 @@ package MysticOres.Worldgen;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import MysticOres.ConfigurationManager;
|
||||
import MysticOres.MysticOres;
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
import MysticOres.Lib.Rarity;
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenMithril implements IWorldGenerator {
|
||||
|
|
@ -23,7 +20,7 @@ public class WorldGenMithril implements IWorldGenerator {
|
|||
}
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||
for (int i = 0; i < ConfigurationManager.MithrilRarity; i++)
|
||||
for (int i = 0; i < Rarity.MITHRIL; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(16);
|
||||
int Ycoord = random.nextInt(64);
|
||||
|
|
|
|||
|
|
@ -2,15 +2,12 @@ package MysticOres.Worldgen;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import MysticOres.ConfigurationManager;
|
||||
import MysticOres.MysticOres;
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
import MysticOres.Lib.Rarity;
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenTopaz implements IWorldGenerator {
|
||||
|
|
@ -23,7 +20,7 @@ public class WorldGenTopaz implements IWorldGenerator {
|
|||
}
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||
for (int i = 0; i < ConfigurationManager.TopazRarity; i++)
|
||||
for (int i = 0; i < Rarity.TOPAZ; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(16);
|
||||
int Ycoord = random.nextInt(60);
|
||||
|
|
|
|||
|
|
@ -2,15 +2,12 @@ package MysticOres.Worldgen;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import MysticOres.ConfigurationManager;
|
||||
import MysticOres.MysticOres;
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
import MysticOres.Lib.Rarity;
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenTourmaline implements IWorldGenerator {
|
||||
|
|
@ -22,7 +19,7 @@ public class WorldGenTourmaline implements IWorldGenerator {
|
|||
}
|
||||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ) {
|
||||
for (int i = 0; i < ConfigurationManager.TourmalineRarity; i++){
|
||||
for (int i = 0; i < Rarity.TOURMALINE; i++){
|
||||
int Xcoord = blockX + random.nextInt(32);
|
||||
int Ycoord = random.nextInt(60);
|
||||
int Zcoord = blockZ + random.nextInt(32);
|
||||
|
|
|
|||
|
|
@ -2,15 +2,12 @@ package MysticOres.Worldgen;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import MysticOres.ConfigurationManager;
|
||||
import MysticOres.MysticOres;
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import MysticOres.Blocks.BlockHandler;
|
||||
import MysticOres.Lib.Rarity;
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class WorldGenVerdite implements IWorldGenerator {
|
||||
|
|
@ -24,10 +21,10 @@ public class WorldGenVerdite implements IWorldGenerator {
|
|||
|
||||
private void generateSurface(World world, Random random, int blockX, int blockZ)
|
||||
{
|
||||
for (int i = 0; i < ConfigurationManager.VerditeRarity; i++)
|
||||
for (int i = 0; i < Rarity.VERDITE; i++)
|
||||
{
|
||||
int Xcoord = blockX + random.nextInt(16);
|
||||
int Ycoord = random.nextInt(30) + 70;
|
||||
int Ycoord = random.nextInt(20) + 80;
|
||||
int Zcoord = blockZ + random.nextInt(16);
|
||||
|
||||
(new WorldGenMinable(BlockHandler.BlockBase.blockID, 6, 9, Block.stone.blockID)).generate(world, random, Xcoord, Ycoord, Zcoord);
|
||||
|
|
|
|||
Loading…
Reference in a new issue