Posted July 31, 201411 yr 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?
August 1, 201411 yr Author hi try World.scheduleBlockUpdate() (must be done on the server) -TGG It still just spawns the fluid inside of the portal frame and doesn't actually create a portal...
August 1, 201411 yr Author 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.
August 1, 201411 yr Author 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); }
August 1, 201411 yr what I wanted to see is where this is called, since you said in the fluid, is it in the onBlockNeighborChange?
August 1, 201411 yr Author 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
August 1, 201411 yr 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.