Jump to content

[SOLVED!] Dimension portal issue


Gaara51

Recommended Posts

Original:

This was posted originally due to my own portal door issue. I was unable to open the portal with my custom fire block.

 

Where info on how to fix is:

http://www.minecraftforge.net/forum/index.php/topic,7974.0.html

I originally helped him, and told him how to fix the constant teleport issue, and in return he was able to help me with my portal door not opening.

If I helped, please click the 'Thank you'!

 

 

 

 

.

Link to comment
Share on other sites

Well, You created Your own fire class, which is not a bad idea, but You also have to create Your custom portal class.

 

In the new PortalBlock, override

OnEntityCollidedWithBlock

method, to send Entity into Your dimension (If You have any trouble with it, check code of Vanilla portal blocks (Ender or Nether)).

 

Then in Your fireBlock, in onblockPlaced method, if obsidian criteria is met (check neighboring block ids, it doesn't need to be obsidian in fact), place a few PortalBlocks in desired shape.

 

I'm not sure, if it's the best and cleanest solution, but I think this should do the trick. Just be careful with custom portal block, as from what I remember, they tend to disappear if they're not supported by obsidian blocks, You may need to trim it a little.

Link to comment
Share on other sites

Well, You created Your own fire class, which is not a bad idea, but You also have to create Your custom portal class.

 

In the new PortalBlock, override

OnEntityCollidedWithBlock

method, to send Entity into Your dimension (If You have any trouble with it, check code of Vanilla portal blocks (Ender or Nether)).

 

Then in Your fireBlock, in onblockPlaced method, if obsidian criteria is met (check neighboring block ids, it doesn't need to be obsidian in fact), place a few PortalBlocks in desired shape.

 

I'm not sure, if it's the best and cleanest solution, but I think this should do the trick. Just be careful with custom portal block, as from what I remember, they tend to disappear if they're not supported by obsidian blocks, You may need to trim it a little.

 

I did make my own custom portal block. I made my custom every thing pretty much. My portal works, and creates it correctly on the other end. It also, when you teleport back, creates another perfect portal. Though it doesn't want to create the portal when the player trys to do it with the custom ignitor. (The ignitor simply places the custom fire, nothing with the portal creation.)

If I helped, please click the 'Thank you'!

 

 

 

 

.

Link to comment
Share on other sites

In Your BlockTestPortal create a method

 

    public boolean tryToCreatePortal(World par1World, int par2, int par3, int par4)
    {
        byte b0 = 0;
        byte b1 = 0;

        if (par1World.getBlockId(par2 - 1, par3, par4) == Block.obsidian.blockID || par1World.getBlockId(par2 + 1, par3, par4) == Block.obsidian.blockID)
        {
            b0 = 1;
        }

        if (par1World.getBlockId(par2, par3, par4 - 1) == Block.obsidian.blockID || par1World.getBlockId(par2, par3, par4 + 1) == Block.obsidian.blockID)
        {
            b1 = 1;
        }

        if (b0 == b1)
        {
            return false;
        }
        else
        {
            if (par1World.getBlockId(par2 - b0, par3, par4 - b1) == 0)
            {
                par2 -= b0;
                par4 -= b1;
            }

            int l;
            int i1;

            for (l = -1; l <= 2; ++l)
            {
                for (i1 = -1; i1 <= 3; ++i1)
                {
                    boolean flag = l == -1 || l == 2 || i1 == -1 || i1 == 3;

                    if (l != -1 && l != 2 || i1 != -1 && i1 != 3)
                    {
                        int j1 = par1World.getBlockId(par2 + b0 * l, par3 + i1, par4 + b1 * l);

                        if (flag)
                        {
                            if (j1 != Block.obsidian.blockID)
                            {
                                return false;
                            }
                        }
                        else if (j1 != 0 && j1 != GaaraMod.blockIgnitor.blockID)
                        {
                            return false;
                        }
                    }
                }
            }

            for (l = 0; l < 2; ++l)
            {
                for (i1 = 0; i1 < 3; ++i1)
                {
                    par1World.setBlock(par2 + b0 * l, par3 + i1, par4 + b1 * l, GaaraMod.testPortal.blockID, 0, 2);
                }
            }

            return true;
        }
    }

Then, in IgnitorBlock, in onBlockAdded, change the first if to include Your portalBlock

 

   public void onBlockAdded(World par1World, int par2, int par3, int par4)
   {
      if (par1World.provider.dimensionId > 0 || par1World.getBlockId(par2, par3 - 1, par4) != Block.obsidian.blockID || ![b]GaaraMod.testPortal[/b].tryToCreatePortal(par1World, par2, par3, par4))
...

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.