Jump to content

Recommended Posts

Posted

Hi community

I'm creating a mod for which I need to explode blocks if they don't are surounded with specific other blocks.

I did it with the onBlockAdded methob:

 

    public void onBlockAdded(WorldProvider par5wp, World par1World,int par2, int par3, int par4, int par6)

    {

        super.onBlockAdded(par1World, par2, par3, par4);

        if (par1World.getBlockId(par2, par3 - 1, par4) != (255|574) & par1World.getBlockId(par2 - 1, par3, par4) != (255|574) & par1World.getBlockId(par2, par3, par4-1) != (255|574) & par1World.getBlockId(par2 + 1, par3, par4) != (255|574)

        & par1World.getBlockId(par2, par3+1, par4) != (255|574) & par1World.getBlockId(par2, par3, par4 + 1) != (255|574))

        {

            if (par1World.isRemote)

            {

 

                par1World.newExplosion((Entity)null, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), 5.0F, true, true);

           

            }

 

    }

 

 

But it doesn't explode!!

Whats wrong here?

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.