Jump to content

Recommended Posts

Posted

So, I have a block that will teleport players to a new dimension when they right click on it.

 

But I got reports of players on servers, where they need to get OP in order for the Teleportation to work.

 

Any idea what could be the problem? Maybe the teleportation itself, or something else around the code I'm not sure of?

 

	/** Teleports a player to a specific location in a dimension. */
public static void teleport(EntityPlayerMP player, int dimension, int x, int y, int z, float yaw) {
	if (player.dimension == dimension) {
		player.rotationYaw = yaw;
		player.setPositionAndUpdate(x + 0.5, y, z + 0.5);
	}
	else {
            player.timeUntilPortal = player.getPortalCooldown();
		WorldManager.theServer.getConfigurationManager().transferPlayerToDimension(player, dimension, new TeleporterHub(dimension, x, y, z, yaw));
	}
}

 

And also

 

	public TeleporterHub(int dimension, int x, int y, int z, float yaw) {
	this(WorldManager.theServer.worldServerForDimension(dimension), x, y, z, yaw);
}
public TeleporterHub(WorldServer world, int x, int y, int z, float yaw) {
	super(world);
	this.theWorld = world;
	this.posX = x;
	this.posY = y;
	this.posZ = z;
	this.rotation = yaw;
}

 

I'm not sure what other code you should need to see what the problem is. Any ideas, any advice?

 

 

Posted

what happens if they dont have op? ur code looks fine to me

 

I will try to get some logs or something. I think it just doesn't teleport them, no crashes as far as I know. Gonna try to get more info and post it.

Posted

I'm assuming your ran a client / server in dev environment and de-op'd your toon for testing?  vs just running a singleplayer instance.

Long time Bukkit & Forge Programmer

Happy to try and help

Posted

Are you using eclipse?  you just run both a server and a client instance from inside it.  Tons of tuts on it.  Then connect to your own little temp fake server.

Long time Bukkit & Forge Programmer

Happy to try and help

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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