Jump to content

[SOLVED!] [1.7.2/1.7.10] Bound must be positive Error


Recommended Posts

Posted

When I try to cross over to my custom dimension, I get this error:

 

  Reveal hidden contents

 

 

Here is my ChunkProvider:

 

  Reveal hidden contents

 

 

TeleporterNillax code:

 

  Reveal hidden contents

 

 

BlockPortalNillax:

 

  Reveal hidden contents

 

 

WorldGenZQuest:

 

  Reveal hidden contents

 

 

WorldGen MineableZQuest:

 

  Reveal hidden contents

 

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Posted

hi

 

I suggest you place a breakpoint at ChunkProviderNillax.populate(ChunkProviderNillax.java:467 and see why it is trying to generate a random number with an upper bound less than 0.

 

My guess is that you haven't initialised your animal spawning list properly, i.e. maxGroupCount and minGroupCount, assuming my line numbering is the same as yours

 

                int i1 = spawnlistentry.minGroupCount + par6Random.nextInt(1 + spawnlistentry.maxGroupCount - spawnlistentry.minGroupCount);

 

Are you familiar with breakpoints and watches?  If not, try these

http://www.vogella.com/tutorials/EclipseDebugging/article.html

http://www.terryanderson.ca/debugging/run.html

 

-TGG

 

 

 

Posted

Where in your code are you using "Random.nextInt(Unknown Source)" when using nextInt you have to use a postive and greater then 0 value (because it returns a random between 0 and value)

 

that is the only issue, then it crawls up from spawnAnimals to your populate function line 467. What is that line btw, can you just post that segment for me?

Posted

It's somewhere in this part but I dont understand why im getting an error when I got an extact copy of the source (with some changes to the blocks)

 

  Reveal hidden contents

 

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Posted

Do you have to tell a dimension what mobs it can spawn? I think when it goes to spawn mobs it gets an empty list when it goes to randomly pick one to spawn "Random.nextInt(value)"

 

  On 8/3/2014 at 12:21 AM, TheGreyGhost said:

...

My guess is that you haven't initialised your animal spawning list properly, i.e. maxGroupCount and minGroupCount, assuming my line numbering is the same as yours

 

                int i1 = spawnlistentry.minGroupCount + par6Random.nextInt(1 + spawnlistentry.maxGroupCount - spawnlistentry.minGroupCount);

...

 

I'm just reading your errorlog and the stacktrace seems to lead to what TGG suggested.

Posted

The problem is that I don't know where to put it at, it was working before and now it suddenly doesn't want to work anymore. I copied exactly from the source code and that still didn't work.

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Posted

Hi

 

This line in vanilla retrieves your list of spawnable creatures

        List list = par1BiomeGenBase.getSpawnableList(EnumCreatureType.creature);

 

1) Place the breakpoint in your code here

SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand);

 

2) Step into performWorldGenSpawning

 

When you get to

        List list = par1BiomeGenBase.getSpawnableList(EnumCreatureType.creature);

 

Then inspect the list.  It will have a number of elements in it like this

    public static class SpawnListEntry extends WeightedRandom.Item
        {
            /** Holds the class of the entity to be spawned. */
            public Class entityClass;
            public int minGroupCount;
            public int maxGroupCount;

One of these will have maxGroupCount less than minGroupCount.  This is causing the problem.

 

Use your debugger to print the list item, which will tell you which Entity it is.  That should hopefully give you a clue.

 

If you have no joy with the debugger, you could use ordinary code instead, eg

 

From your code:

 if (TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, ANIMALS))
{
      List list = biomegenbase.getSpawnableList(EnumCreatureType.creature);
      System.out.println("biomegenbase.getSpawnableList:");
      for (Object entry : list) {
        System.out.println((BiomeGenBase.SpawnListEntry)entry);
      }

  SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand);
}

 

Run it, wait for it to crash, then look at the debug log and see which entry might have caused the problem.

 

-TGG

Posted
  On 8/6/2014 at 11:13 AM, TheGreyGhost said:

Hi

 

This line in vanilla retrieves your list of spawnable creatures

        List list = par1BiomeGenBase.getSpawnableList(EnumCreatureType.creature);

 

1) Place the breakpoint in your code here

SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand);

 

2) Step into performWorldGenSpawning

 

When you get to

        List list = par1BiomeGenBase.getSpawnableList(EnumCreatureType.creature);

 

Then inspect the list.  It will have a number of elements in it like this

    public static class SpawnListEntry extends WeightedRandom.Item
        {
            /** Holds the class of the entity to be spawned. */
            public Class entityClass;
            public int minGroupCount;
            public int maxGroupCount;

One of these will have maxGroupCount less than minGroupCount.  This is causing the problem.

 

Use your debugger to print the list item, which will tell you which Entity it is.  That should hopefully give you a clue.

 

If you have no joy with the debugger, you could use ordinary code instead, eg

 

From your code:

 if (TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, ANIMALS))
{
      List list = biomegenbase.getSpawnableList(EnumCreatureType.creature);
      System.out.println("biomegenbase.getSpawnableList:");
      for (Object entry : list) {
        System.out.println((BiomeGenBase.SpawnListEntry)entry);
      }

  SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand);
}

 

Run it, wait for it to crash, then look at the debug log and see which entry might have caused the problem.

 

-TGG

Thanks! When you said that the maxGroupCount might be last than the minGroupCount, I started looking through my custom biomes and discovered that I mixed up the two variables. Then I ran it and the dimension travel works perfectly without that error. :D

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.