Jump to content

[1.8][Almost Solved]Get block-set block methods/ IWorldGenerator with structures


Recommended Posts

Posted

What are the getting and setting block methods for 1.8?

If there are none (which I highly doubt) how can I make my structure generate in-world (I already have the IWorldGenerator set up).

The proud(ish) developer of Ancients

Posted

So far I have found a set block method but no get block method. I need the get block method for detecting what the top block's y coord is at the specified x/z coordinates. I need the y-coord so that my structure doesn't spawn in the ground, or in the air.

The proud(ish) developer of Ancients

Posted

Yes, thanks. Also how do I use IBlockState to set a block? It's an interface so I can't instantiate it. Is there a method somewhere kind of like getAxisAlignedBB that returns it?

The proud(ish) developer of Ancients

Posted

I'm not sure this is how IBlockState is supposed to work but I'm using this code to spawn my block (x/z are random coords from IWorldGenerator):

BlockPos block = new BlockPos(x,0,z);

block = world.getTopSolidOrLiquidBlock(block);

System.out.println("Top Block is:"+block.getY());

IBlockState state = Ancients.invincible.getDefaultState();

world.setBlockState(block, state);

The proud(ish) developer of Ancients

Posted

It gets the proper block, but it doesn't set the block to my 'invincible' block. Did I miss a method that I need to use?

The proud(ish) developer of Ancients

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.