Jump to content

Cause a block update on placement of block


Recommended Posts

Give us the class that has the portal creating functionality

 

Here is the part that creates the portal after I kill a certain entity:

 

 

 

private void createHeavenPortal(int x2, int z2){

int x = x2 + rand.nextInt(15);

int z = z2 + rand.nextInt(15);

 

int y = worldObj.getHeightValue(x,z)-1;

 

    worldObj.setBlock(x + 0, y + 0, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 1, y + 0, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 2, y + 0, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 3, y + 0, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 0, y + 1, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 1, y + 1, z + 0, FaithCraft2.WineBlock, 0, 3); <--- Fluid

worldObj.setBlock(x + 3, y + 1, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 0, y + 2, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 3, y + 2, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 0, y + 3, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 3, y + 3, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 0, y + 4, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 1, y + 4, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 2, y + 4, z + 0, FaithCraft2.HolyBlock, 0, 3);

worldObj.setBlock(x + 3, y + 4, z + 0, FaithCraft2.HolyBlock, 0, 3);

    }

 

 

Link to comment
Share on other sites

Then that's not the case of block updating.

What you should do is make the portal when you put the fluid, this happens in onBlockAdded event of the fluid's class, simply override it, remember to keep the super call, since the block liquid uses it.

Link to comment
Share on other sites

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.