Jump to content

[1.7.10] Players on a server need OP to be teleported


American2050

Recommended Posts

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?

 

 

Link to comment
Share on other sites

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.