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.

[Solved] Custom Portal Creates Nether Portal in Custom Dimension when Teleported

Featured Replies

Posted

This is what happens:

1. Player creates custom portal

2. Player teleports to custom dimension

3. Instead of another custom portal, a nether portal is created in the custom dimension

 

My code:

mod_MOreTrees: http://paste.minecraftforge.net/view/6847afd3

BlockPortalOreleans: http://paste.minecraftforge.net/view/ec0a8390

ChunkProviderOreleans: http://paste.minecraftforge.net/view/100e33ed

PortalPositionOreleans: http://paste.minecraftforge.net/view/ea275cb8

TeleporterOreleans: http://paste.minecraftforge.net/view/d3b49a9d

WorldProviderOreleans: http://paste.minecraftforge.net/view/1d8000f1

Before you even think about modding,

  • Author

I think I've managed to get the player to teleport into the custom portal, but I'm not sure. I can't tell because whenever I go into a portal, I immediately teleport back to the normal world.

Before you even think about modding,

  • Author

I've fixed it!

In Block PortalOreleans, I just had to change this:

    public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
    {
        if ((par5Entity.ridingEntity == null) && (par5Entity.riddenByEntity == null) && (par5Entity instanceof EntityPlayerMP))
        {
            EntityPlayerMP thePlayer = (EntityPlayerMP) par5Entity;
           
            if (thePlayer.timeUntilPortal > 0)
            {
                thePlayer.timeUntilPortal = 10;
            }
            else if (thePlayer.dimension != mod_MOreTrees.oreleansID)
            {
                thePlayer.timeUntilPortal = 10;
                thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, mod_MOreTrees.oreleansID);
            }
            else
            {
                thePlayer.timeUntilPortal = 10;
                thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, 0);
            }
        }
    }

Into this:

    public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
    {
        if ((par5Entity.ridingEntity == null) && (par5Entity.riddenByEntity == null) && (par5Entity instanceof EntityPlayerMP))
        {
            EntityPlayerMP thePlayer = (EntityPlayerMP) par5Entity;
            
            if (thePlayer.timeUntilPortal > 0)
            {
                thePlayer.timeUntilPortal = 10;
            }
            else if (thePlayer.dimension != mod_MOreTrees.oreleansID)
            {
                thePlayer.timeUntilPortal = 10;
                thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, mod_MOreTrees.oreleansID, new TeleporterOreleans(thePlayer.mcServer.worldServerForDimension(mod_MOreTrees.oreleansID)));
            }
            else
            {
                thePlayer.timeUntilPortal = 10;
                thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, 0, new TeleporterOreleans(thePlayer.mcServer.worldServerForDimension(0)));
            }
        }
    }

Before you even think about modding,

Guest
This topic is now closed to further replies.

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.