Jump to content

Recommended Posts

Posted

I am trying to make the world place a fluid inside of a nether portal type structure that spawns a Portal to my custom dimension. I have been told that I should cause a block update to make it spawn the portal after the fluid is placed. How would I go about doing this?

Posted

What makes the portal in the code? the portal frame or the fluid

 

I think the fluid, because I just changed that portion of the vanilla code from fire to my fluid. Then I gave my fluid fire like properties. I can place the fluid in my frame normally and create the portal. I just cant get the world to place it.

Posted

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);

    }

 

 

Posted

what I wanted to see is where this is called, since you said in the fluid, is it in the onBlockNeighborChange?

 

I dont get what you mean, I called createHeavenPortal in the onDeathUpdate method of the entity I made. It is supposed to work so that when I kill the entity it spawns this portal. Just like the enderdragon

Posted

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.

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.