1
Leaking worlds problem
I am working on a mod and tried to generate ores in the END, however, no ores appear, they appeared once, but the next three world generations they did not appear anymore, I get this error in eclipse :
Also here are the class files :
WORLDGENERATOR
CUSTOM WORLDGENMINABLE
2013-04-25 17:38:41 [SEVERE] [ForgeModLoader] Detected leaking worlds in memory. There are 2 worlds that appear to be persisting. A mod is likely caching the world incorrectly
2013-04-25 17:38:41 [SEVERE] [ForgeModLoader] The world 48651ff0 (New World) has leaked.Also here are the class files :
WORLDGENERATOR
package Archedeon;
import java.util.Random;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import cpw.mods.fml.common.IWorldGenerator;
public class WorldGeneratorArchedeon implements IWorldGenerator {
@Override
public void generate(Random random, int chunkX, int chunkZ, World world,
IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch(world.provider.dimensionId){
case 1:
generateNether(world, random, chunkX*16, chunkZ*16);
case 0:
generateSurface(world, random, chunkX*16, chunkZ*16);
case -1:
generateEnd(world, random, chunkX*16, chunkZ*16);
}
}
private void generateEnd(World world, Random random, int chunkX, int chunkZ) {
for(int i = 1; i <100; i++){
int xCoord = chunkX + random.nextInt(16);
int yCoord = random.nextInt(70);
int zCoord = chunkZ + random.nextInt(16);
(new WorldGenMinable2(Archedeon.dragonBlock.blockID, 2)).generate(world, random, xCoord, yCoord, zCoord);
}
}
private void generateSurface(World world, Random random, int chunkX, int chunkZ) {
}
private void generateNether(World world, Random random, int chunkX, int chunkZ) {
}
}
CUSTOM WORLDGENMINABLE
package Archedeon;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
public class WorldGenMinable2 extends WorldGenerator
{
/** The block ID of the ore to be placed using this generator. */
private int minableBlockId;
private int minableBlockMeta = 0;
/** The number of blocks to generate. */
private int numberOfBlocks;
private int field_94523_c;
public WorldGenMinable2(int par1, int par2)
{
this(par1, par2, Block.whiteStone.blockID);
}
public WorldGenMinable2(int par1, int par2, int par3)
{
this.minableBlockId = par1;
this.numberOfBlocks = par2;
this.field_94523_c = par3;
}
public WorldGenMinable2(int id, int meta, int number, int target)
{
this(id, number, target);
minableBlockMeta = meta;
}
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
{
float f = par2Random.nextFloat() * (float)Math.PI;
double d0 = (double)((float)(par3 + 8) + MathHelper.sin(f) * (float)this.numberOfBlocks / 8.0F);
double d1 = (double)((float)(par3 + 8) - MathHelper.sin(f) * (float)this.numberOfBlocks / 8.0F);
double d2 = (double)((float)(par5 + 8) + MathHelper.cos(f) * (float)this.numberOfBlocks / 8.0F);
double d3 = (double)((float)(par5 + 8) - MathHelper.cos(f) * (float)this.numberOfBlocks / 8.0F);
double d4 = (double)(par4 + par2Random.nextInt(3) - 2);
double d5 = (double)(par4 + par2Random.nextInt(3) - 2);
for (int l = 0; l <= this.numberOfBlocks; ++l)
{
double d6 = d0 + (d1 - d0) * (double)l / (double)this.numberOfBlocks;
double d7 = d4 + (d5 - d4) * (double)l / (double)this.numberOfBlocks;
double d8 = d2 + (d3 - d2) * (double)l / (double)this.numberOfBlocks;
double d9 = par2Random.nextDouble() * (double)this.numberOfBlocks / 16.0D;
double d10 = (double)(MathHelper.sin((float)l * (float)Math.PI / (float)this.numberOfBlocks) + 1.0F) * d9 + 1.0D;
double d11 = (double)(MathHelper.sin((float)l * (float)Math.PI / (float)this.numberOfBlocks) + 1.0F) * d9 + 1.0D;
int i1 = MathHelper.floor_double(d6 - d10 / 2.0D);
int j1 = MathHelper.floor_double(d7 - d11 / 2.0D);
int k1 = MathHelper.floor_double(d8 - d10 / 2.0D);
int l1 = MathHelper.floor_double(d6 + d10 / 2.0D);
int i2 = MathHelper.floor_double(d7 + d11 / 2.0D);
int j2 = MathHelper.floor_double(d8 + d10 / 2.0D);
for (int k2 = i1; k2 <= l1; ++k2)
{
double d12 = ((double)k2 + 0.5D - d6) / (d10 / 2.0D);
if (d12 * d12 < 1.0D)
{
for (int l2 = j1; l2 <= i2; ++l2)
{
double d13 = ((double)l2 + 0.5D - d7) / (d11 / 2.0D);
if (d12 * d12 + d13 * d13 < 1.0D)
{
for (int i3 = k1; i3 <= j2; ++i3)
{
double d14 = ((double)i3 + 0.5D - d8) / (d10 / 2.0D);
Block block = Block.blocksList[par1World.getBlockId(k2, l2, i3)];
if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && (block != null && block.isGenMineableReplaceable(par1World, k2, l2, i3, field_94523_c)))
{
par1World.setBlock(k2, l2, i3, this.minableBlockId, minableBlockMeta, 2);
}
}
}
}
}
}
}
return true;
}
}
4
Ya know, when he said he's making a mod and supplies the class file.
GENERALLY he's making a mod.
On Topic:
You'll need to use jvisualvm and check a heap dump to find where a reference to the world is being kept.
GENERALLY he's making a mod.
On Topic:
You'll need to use jvisualvm and check a heap dump to find where a reference to the world is being kept.
This is a mod right? If not, ores can't generate in the end!
bump, once more
Bump, urgent help required.
