Well, the idea is that, when you are in the chunk, when the item is used, the chunk will get a layer of stone underneath the player.
Here's the code:
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if(!par2World.isRemote){
par2World.setBlock((int)par3EntityPlayer.posX, (int)par3EntityPlayer.posY -1, (int)par3EntityPlayer.posZ - 1, Blocks.stone);
Chunk Chunk = par2World.getChunkFromBlockCoords((int)par3EntityPlayer.posX, (int)par3EntityPlayer.posZ);
int X1 = Chunk.xPosition;
int Z1 = Chunk.zPosition;
Reference.printGame(String.valueOf(Chunk.xPosition), par3EntityPlayer);
Reference.printGame(String.valueOf(Chunk.zPosition), par3EntityPlayer);
int X2 = Chunk.xPosition + 15;
int Z2 = Chunk.zPosition + 15;
if(!par2World.isRemote){
Reference.fillChunk(X2, Z2, par2World, par3EntityPlayer, Blocks.stone);
par2World.setBlock(X1, (int) par3EntityPlayer.posY - 1, Z1, Blocks.stone);
}
}
return par1ItemStack;
}
This piece of code was to get the block placing function right
public static void fillChunk(int X, int Z, World par1World, Entity Player, Block Block){
for(int i=1; i<17; i++){
printConsole("Count is: " + i);
par1World.setBlock(X, (int)Player.posY -1, Z, Block);
for(int j=1; j<17; j++){
printConsole("Count is: " + String.valueOf(i) + j);
par1World.setBlock(X, (int)Player.posY -1, Z, Block);
}
}
}