Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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'!

 

 

 

 

.

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.

  • Author

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'!

 

 

 

 

.

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

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...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.