1

Portal to New Dimension Help

Kowloon_4g's Avatar Kowloon_4g4/21/13 2:31 pm
1 emeralds 255 6
4/21/2013 2:52 pm
Kowloon_4g's Avatar Kowloon_4g
I've been trying to make a new dimension and so far everything is working except for the teleporter. When i step inside the portal block i get sent into an infinite loop of me being teleported to my dimension and then to the overworld. I know my problem is on the onEntityCollidedWithBlock

My code is here.

public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
{
if (par5Entity.ridingEntity == null && par5Entity.riddenByEntity == null)
{
if(par5Entity instanceof EntityPlayerMP)
{
EntityPlayerMP Player = (EntityPlayerMP) par5Entity;
if(par5Entity.dimension != Blade_Base.CelestialDimension)
{
Player.mcServer.getConfigurationManager().transferPlayerToDimension(Player, Blade_Base.CelestialDimension, new CelestialTeleporter(Player.mcServer.worldServerForDimension(Blade_Base.CelestialDimension)));
}
else
{
Player.mcServer.getConfigurationManager().transferPlayerToDimension(Player, 0, new CelestialTeleporter(Player.mcServer.worldServerForDimension(0)));
}
}
}
}


Can someone tell me how to fix this?
Posted by Kowloon_4g's Avatar
Kowloon_4g
Level 53 : Grandmaster Dragonborn
42

Create an account or sign in to comment.

6

1
04/21/2013 2:52 pm
Level 53 : Grandmaster Dragonborn
Kowloon_4g
Kowloon_4g's Avatar
Im a noob at this stuff
1
04/21/2013 2:51 pm
Level 54 : Grandmaster Programmer
nickfromgreece
nickfromgreece's Avatar
you dont talk programmy
1
04/21/2013 2:49 pm
Level 53 : Grandmaster Dragonborn
Kowloon_4g
Kowloon_4g's Avatar
I didn't understand a word you said haha
1
04/21/2013 2:44 pm
Level 54 : Grandmaster Programmer
nickfromgreece
nickfromgreece's Avatar
2 new integers currtime prevtptime everytime currtime is the systems time and check if oldtime isnt null and its bigger by 5000 (5 secs) tp else not and at the end set oldtime to currtime so the loop can be repeated the next time
1
04/21/2013 2:41 pm
Level 53 : Grandmaster Dragonborn
Kowloon_4g
Kowloon_4g's Avatar
Its teleporting where i want it to. What i want it to do is give the portal a cooldown time. For example, you would have to wait 5 seconds in the portal before you get teleported.
1
04/21/2013 2:37 pm
Level 54 : Grandmaster Programmer
nickfromgreece
nickfromgreece's Avatar
i think the problem is not here
i think the problem is in the teleporter class.

aka the portal back is spawning where the players spawn point is
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome