Jump to content

Recommended Posts

Posted

SOLVED

----------

Problem: I had a block where when you bump into it, it takes you inside of it, I added a new dimension for this but couldn't figure out how to generate the interior only once in the dimension.

 

Solution: In whatever your teleporting method is, either an item, colliding with block, etc... whereever you change the player's dimension is where you need to do the generation. Just use entity.getEntityWorld() to get the world, AFTER you change dimensions, then you will have the "dimension's world". Then use that world to do all of the structure creation.

 

Posted

I'm not sure if worlds have nbt but you could generate the structure once with an IWorldGenerator and then create a tag that says the structure has been built so it doesn't keep rebuilding it. Then again I've never really messed around with a chunk provider so I have no idea if this is possible.

The proud(ish) developer of Ancients

Posted

Don't think it would work. I added a dummy variable to hold whether or not it's been built and based on that add the block.

 

private boolean built = false;

 

if(built == false)

{

  addblockstuffhere

  built = true;

}

Posted

Oh, yes, sorry. Forgot to include that in last post ??? It doesn't work, it just doesn't add anything, but... I did another test, I had a counter variable, that increased every time that method was called and was printed out. When I first entered my dimension it was being increased without stopping until a certain point.. then it only increased as a moved towards un-generates terrain.

Posted

If it's easier, I could also just have it generate a cube of air and then build the structure inside. But I also couldn't get that working, as I keep getting index out of bound errors.

Posted
  On 5/28/2015 at 11:34 AM, Born2Code said:

If it's easier, I could also just have it generate a cube of air and then build the structure inside. But I also couldn't get that working, as I keep getting index out of bound errors.

Post your current code.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Posted

Here..

 

    public void func_180520_a(int p_180520_1_, int p_180520_2_, ChunkPrimer primer)

    {

        for(int x = 0; x < 100; x++)

        {

            for(int z = 0; z < 100; z++)

            {

                primer.setBlockState(x, 100, z, Blocks.air.getDefaultState());

            }

        }

 

        primer.setBlockState(0, 100, 0, Blocks.end_stone.getDefaultState());

    }

 

Posted
  On 5/28/2015 at 11:59 AM, Born2Code said:

Here..

 

    public void func_180520_a(int p_180520_1_, int p_180520_2_, ChunkPrimer primer)

    {

        for(int x = 0; x < 100; x++)

        {

            for(int z = 0; z < 100; z++)

            {

                primer.setBlockState(x, 100, z, Blocks.air.getDefaultState());

            }

        }

 

        primer.setBlockState(0, 100, 0, Blocks.end_stone.getDefaultState());

    }

1. You should post the full code, not just a method.

2. Post the crash report together.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Posted

Generating a cube of air and my structure inside forever was just a quick though, I would prefer the OP answered instead.

 

ChunkProvider

 

  Reveal hidden contents

 

Posted

1. First remove this line:

private static final String __OBFID = "CL_00000397";

It is minecraft deobfuscation id, which is totally useless and unrelated with modding.

(+ Do not copy-paste code if you cant fully understand the code..)

2. Please rephrase your issue, I cant understand what is your problem.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Posted
  On 5/28/2015 at 12:11 PM, Abastro said:

  Quote

Here..

 

    public void func_180520_a(int p_180520_1_, int p_180520_2_, ChunkPrimer primer)

    {

        for(int x = 0; x < 100; x++)

        {

            for(int z = 0; z < 100; z++)

            {

                primer.setBlockState(x, 100, z, Blocks.air.getDefaultState());

            }

        }

 

        primer.setBlockState(0, 100, 0, Blocks.end_stone.getDefaultState());

    }

1. You should post the full code, not just a method.

2. Post the crash report together.

 

 

All I need, is an empty dimension, with one structure generated inside, that way when teleported there (working), I am teleported into that structure.

Guest
This topic is now closed to further replies.

Announcements



  • Create New...

Important Information

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