Jump to content

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


Recommended Posts

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,

Posted

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,

Posted

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.

Announcements



×
×
  • Create New...

Important Information

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