1
Portal to New Dimension Help
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.
Can someone tell me how to fix this?
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?
Create an account or sign in to comment.
6
1
Im a noob at this stuff
1
you dont talk programmy
1
I didn't understand a word you said haha
1
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
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
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
i think the problem is in the teleporter class.
aka the portal back is spawning where the players spawn point is