Jump to content

Recommended Posts

Posted

I'm having a minor problem I can't solve and I've got no matches on google so far.

 

I'm having a block that spreads, consisting out of this code in my Block.class:

  public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
    {
            if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && Block.lightOpacity[par1World.getBlockId(par2, par3 + 1, par4)] > 2)
            {
                par1World.setBlockWithNotify(par2, par3, par4, Mod.ModBlock..blockID);
            }
            else if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 1)
            {
                for (int var6 = 0; var6 < 46; ++var6)
                {
                    int var7 = par2 + par5Random.nextInt(10) - 1;
                    int var8 = par3 + par5Random.nextInt(10) - 3;
                    int var9 = par4 + par5Random.nextInt(10) - 1;
                    int var10 = par1World.getBlockId(var7, var8 + 1, var9);

                    if (par1World.getBlockId(var7, var8, var9) == Mod.ModBlock.blockID)
                    {
                        par1World.setBlockWithNotify(var7, var8, var9,mod_Mod.ModBlock.blockID);
                    }  
                    else if (par1World.getBlockId(var7, var8, var9) == Mod.ModBlock.blockID)
                    {
                        par1World.setBlockWithNotify(var7, var8, var9,mod_Mod.ModBlock.blockID);
                    }  
                }
            }
        }
    }

 

Its spreads all the ways except up, wich is what I need.

Is there a possible way of doing this?

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.