End ore will now only generate in the End

This commit is contained in:
Gig 2015-05-30 02:42:43 +01:00
parent 18eed2bf0a
commit 83d6613f94

View file

@ -31,8 +31,7 @@ public class TROreGen implements IWorldGenerator {
WorldGenMinable oreLead; WorldGenMinable oreLead;
WorldGenMinable oreSilver; WorldGenMinable oreSilver;
public TROreGen() public TROreGen(){
{
// World // World
oreGalena = new WorldGenMinable(ModBlocks.ore, 0, ConfigTechReborn.GalenaOreRare, Blocks.stone); oreGalena = new WorldGenMinable(ModBlocks.ore, 0, ConfigTechReborn.GalenaOreRare, Blocks.stone);
oreIridium = new WorldGenMinable(ModBlocks.ore, 1, ConfigTechReborn.IridiumOreRare, Blocks.stone); oreIridium = new WorldGenMinable(ModBlocks.ore, 1, ConfigTechReborn.IridiumOreRare, Blocks.stone);
@ -58,8 +57,7 @@ public class TROreGen implements IWorldGenerator {
LogHelper.info("WorldGen Loaded"); LogHelper.info("WorldGen Loaded");
} }
public void retroGen(Random random, int chunkX, int chunkZ, World world) public void retroGen(Random random, int chunkX, int chunkZ, World world) {
{
//TODO //TODO
generateUndergroundOres(random, chunkX, chunkZ, world); generateUndergroundOres(random, chunkX, chunkZ, world);
generateHellOres(random, chunkX, chunkZ, world); generateHellOres(random, chunkX, chunkZ, world);
@ -69,16 +67,12 @@ public class TROreGen implements IWorldGenerator {
@Override @Override
public void generate(Random random, int xChunk, int zChunk, World world, public void generate(Random random, int xChunk, int zChunk, World world,
IChunkProvider chunkGenerator, IChunkProvider chunkProvider) IChunkProvider chunkGenerator, IChunkProvider chunkProvider){
{ if (world.provider.isSurfaceWorld()){
if (world.provider.isSurfaceWorld())
{
generateUndergroundOres(random, xChunk * 16, zChunk * 16, world); generateUndergroundOres(random, xChunk * 16, zChunk * 16, world);
} else if (world.provider.isHellWorld) } else if (world.provider.isHellWorld){
{ generateHellOres(random, xChunk * 16, zChunk * 16, world);
generateHellOres(random, xChunk * 16, zChunk * 16, world); } else if (world.provider.dimensionId == 1){
} else
{
generateEndOres(random, xChunk * 16, zChunk * 16, world); generateEndOres(random, xChunk * 16, zChunk * 16, world);
} }
@ -88,90 +82,72 @@ public class TROreGen implements IWorldGenerator {
World world) World world)
{ {
int xPos, yPos, zPos; int xPos, yPos, zPos;
if (config.GalenaOreTrue) if (config.GalenaOreTrue){
{ for (int i = 0; i <= 16; i++){
for (int i = 0; i <= 16; i++)
{
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreGalena.generate(world, random, xPos, yPos, zPos); oreGalena.generate(world, random, xPos, yPos, zPos);
} }
} }
if (config.IridiumOreTrue) if (config.IridiumOreTrue){
{ for (int i = 0; i <= 16; i++){
for (int i = 0; i <= 16; i++)
{
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreIridium.generate(world, random, xPos, yPos, zPos); oreIridium.generate(world, random, xPos, yPos, zPos);
} }
} }
if (config.RubyOreTrue) if (config.RubyOreTrue){
{ for (int i = 0; i <= 16; i++){
for (int i = 0; i <= 16; i++)
{
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreRuby.generate(world, random, xPos, yPos, zPos); oreRuby.generate(world, random, xPos, yPos, zPos);
} }
} }
if (config.SapphireOreTrue) if (config.SapphireOreTrue){
{ for (int i = 0; i <= 16; i++){
for (int i = 0; i <= 16; i++)
{
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreSapphire.generate(world, random, xPos, yPos, zPos); oreSapphire.generate(world, random, xPos, yPos, zPos);
} }
} }
if (config.BauxiteOreTrue) if (config.BauxiteOreTrue){
{ for (int i = 0; i <= 16; i++){
for (int i = 0; i <= 16; i++)
{
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreBauxite.generate(world, random, xPos, yPos, zPos); oreBauxite.generate(world, random, xPos, yPos, zPos);
} }
} }
if (config.TetrahedriteOreTrue) if (config.TetrahedriteOreTrue){
{ for (int i = 0; i <= 16; i++){
for (int i = 0; i <= 16; i++)
{
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreTetrahedrite.generate(world, random, xPos, yPos, zPos); oreTetrahedrite.generate(world, random, xPos, yPos, zPos);
} }
} }
if (config.CassiteriteOreTrue) if (config.CassiteriteOreTrue){
{ for (int i = 0; i <= 16; i++){
for (int i = 0; i <= 16; i++)
{
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreCassiterite.generate(world, random, xPos, yPos, zPos); oreCassiterite.generate(world, random, xPos, yPos, zPos);
} }
} }
if (config.LeadOreTrue) if (config.LeadOreTrue){
{ for (int i = 0; i <= 16; i++){
for (int i = 0; i <= 16; i++)
{
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreLead.generate(world, random, xPos, yPos, zPos); oreLead.generate(world, random, xPos, yPos, zPos);
} }
} }
if (config.SilverOreTrue) if (config.SilverOreTrue){
{ for (int i = 0; i <= 16; i++){
for (int i = 0; i <= 16; i++)
{
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
@ -180,33 +156,26 @@ public class TROreGen implements IWorldGenerator {
} }
} }
void generateHellOres(Random random, int xChunk, int zChunk, World world) void generateHellOres(Random random, int xChunk, int zChunk, World world){
{
int xPos, yPos, zPos; int xPos, yPos, zPos;
if (config.PyriteOreTrue) if (config.PyriteOreTrue){
{ for (int i = 0; i <= 16; i++){
for (int i = 0; i <= 16; i++)
{
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
orePyrite.generate(world, random, xPos, yPos, zPos); orePyrite.generate(world, random, xPos, yPos, zPos);
} }
} }
if (config.CinnabarOreTrue) if (config.CinnabarOreTrue){
{ for (int i = 0; i <= 16; i++){
for (int i = 0; i <= 16; i++)
{
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreCinnabar.generate(world, random, xPos, yPos, zPos); oreCinnabar.generate(world, random, xPos, yPos, zPos);
} }
} }
if (config.SphaleriteOreTrue) if (config.SphaleriteOreTrue){
{ for (int i = 0; i <= 16; i++){
for (int i = 0; i <= 16; i++)
{
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
@ -215,43 +184,34 @@ public class TROreGen implements IWorldGenerator {
} }
} }
void generateEndOres(Random random, int xChunk, int zChunk, World world) void generateEndOres(Random random, int xChunk, int zChunk, World world){
{
int xPos, yPos, zPos; int xPos, yPos, zPos;
if (config.TungstenOreTrue) if (config.TungstenOreTrue){
{ for (int i = 0; i <= 16; i++){
for (int i = 0; i <= 16; i++)
{
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreTungston.generate(world, random, xPos, yPos, zPos); oreTungston.generate(world, random, xPos, yPos, zPos);
} }
} }
if (config.SheldoniteOreTrue) if (config.SheldoniteOreTrue){
{ for (int i = 0; i <= 16; i++){
for (int i = 0; i <= 16; i++)
{
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
oreSheldonite.generate(world, random, xPos, yPos, zPos); oreSheldonite.generate(world, random, xPos, yPos, zPos);
} }
} }
if (config.PeridotOreTrue) if (config.PeridotOreTrue){
{ for (int i = 0; i <= 16; i++){
for (int i = 0; i <= 16; i++)
{
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);
orePeridot.generate(world, random, xPos, yPos, zPos); orePeridot.generate(world, random, xPos, yPos, zPos);
} }
} }
if (config.SodaliteOreTrue) if (config.SodaliteOreTrue){
{ for (int i = 0; i <= 16; i++){
for (int i = 0; i <= 16; i++)
{
xPos = xChunk + random.nextInt(16); xPos = xChunk + random.nextInt(16);
yPos = 60 + random.nextInt(60 - 20); yPos = 60 + random.nextInt(60 - 20);
zPos = zChunk + random.nextInt(16); zPos = zChunk + random.nextInt(16);