Jump to content

Tile entity function running on client side?


KeeganDeathman

Recommended Posts

I have traced the problem! This one function is running on the client! Wait, what?

I have a data system, transmitted by busses, but my first "DataConnectedDevice", can't find the network! Turns out the function to register it isn't running on the server, it's on the client.

I think this is the problem, but I'm not sure.

 

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

Link to comment
Share on other sites

Okay so what is happening is the method is only being run on the client, when I need it on the server.

Here is the method in question

public void registerWithNetwork()
{
	if(!worldObj.isRemote) {
		System.out.println("remote");
		if (worldObj.getBlock(xCoord + 1, yCoord, zCoord) != null && id == null) {
			register(xCoord + 1, yCoord, zCoord);
		}if (worldObj.getBlock(xCoord - 1, yCoord, zCoord) != null && id == null) {
			register(xCoord - 1, yCoord, zCoord);
		}if (worldObj.getBlock(xCoord, yCoord + 1, zCoord) != null && id == null) {
			register(xCoord, yCoord + 1, zCoord);
		}if (worldObj.getBlock(xCoord, yCoord - 1, zCoord) != null && id == null) {
			register(xCoord, yCoord - 1, zCoord);
		}if (worldObj.getBlock(xCoord, yCoord, zCoord + 1) != null && id == null) {
			register(xCoord, yCoord, zCoord + 1);
		}if (worldObj.getBlock(xCoord, yCoord, zCoord - 1) != null && id == null) {
			register(xCoord, yCoord, zCoord - 1);
		}
	}
	else
	{
		System.out.println("So remote");
	}
}

 

What I'm asking is how could I get it to run on the server as well?

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

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.



×
×
  • Create New...

Important Information

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