Jump to content

[SOLVED] Custom Dimension - World isn't being created


Recommended Posts

Posted

I had a mod in 1.6.4 that created a few new dimensions as well as dynamically created a range of 'worlds' on setup.  This was really just a pattern of dimensions, but whatever.  It doesn't really matter for this discussion.

 

I just got done converting it to 1.7.2 and I'm having an odd issue I just can't figure out.

 

I originally did this based upon Wuppy's Tutorials and other Dimension code. so I follow their world registration code as follows:

 

 

 

 

** the number it is getting from the propertiest function is 26.  I have the boolean pass in there just to verify it worked.  It does, both come back as pass.

 

pass = DimensionManager.registerProviderType(properties().creep_dimension(), MyWorldProviderCreep.class, true);

DimensionManager.registerDimension(properties().creep_dimension(), properties().creep_dimension());

pass = DimensionManager.isDimensionRegistered(properties().creep_dimension());

 

 

 

 

This all comes back that it is working and minecraft comes up fine.  I run through the loaded dimensions and check properties on a recurring pattern and that would crash the server.  I figured maybe the DimensionManager just hadn't loaded things up yet so I through a check in for null on the return of world. 

 

Ultimately I found this error at other places.  It doesn't really seem to be creating a world.

 

If I run the following function :

 

 

 

 

    public World find_world(int dimension) {

    instance.logger.log(Level.INFO, "World Find Started");

   

        // Cycle through each world

    for (World item : MinecraftServer.getServer().worldServers) {

        //for (World item : DimensionManager.getWorlds()) {

        instance.logger.log(Level.INFO, "  checking dimension of " + item.provider.dimensionId);

       

            if (item.provider.dimensionId == dimension) {

            instance.logger.log(Level.INFO, "  SUCCESS");

           

                return item;

               

            }

           

        }

 

        // Default

        return null;

       

    }

 

 

 

 

I can tell it thinks the dimensionID for my custom world is zero instead of what the DimensionManager tells me it recorded.

 

Next step is I go to DimensionManager and look at its worlds list.  It has the same exact issue as the server.  It list my new dimension with a dimensionID of zero. 

 

Anybody have experience with this?  Why isn't Forge's DimensionManager creating the world with the right dimensionID.  Is there something new I have to tell it to do in 1.7.2 that wasn't there in 1.6.4.  This part of the code for providers, ect didn't really change that much and my 1.6.4 version works like a charm.

Long time Bukkit & Forge Programmer

Happy to try and help

Posted

Just noticed something.  I experimented with hardcoding my dimensionId inside of the customworldprovider and everything worked like a charm. 

 

I don't really want to do that and i didn't in 1.6.4.  Going to try and figure out how not to.  Would appreciate any advice.

Long time Bukkit & Forge Programmer

Happy to try and help

Posted

Well, I feel like an idiot.

 

In case you happen to have the same issue, here was the offending line of code

 

 

 

 

    @Override

    public void setDimension(int dim) {

     

   

   

    }

 

 

 

 

What you have to ask, is WHY, WHY???  I don't know.  I was working on something and I intended to put something there and never got around to it.  Deleted the whole spot and BINGO!!  everything works again. 

Long time Bukkit & Forge Programmer

Happy to try and help

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.