Posted April 20, 201510 yr 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]
April 20, 201510 yr Most methods in TileEntity (and most other classes) run on both the client and the server. However, I have no idea what you are asking about; please clarify your question and post the relevant code. http://i.imgur.com/NdrFdld.png[/img]
April 20, 201510 yr Author 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]
April 20, 201510 yr Well, that's not a vanilla method, so you just have to make sure wherever you call it from is on the server. http://i.imgur.com/NdrFdld.png[/img]
April 20, 201510 yr Author And I've noticed that somethings that require the server aren't working, like the device count when you right click a bus, guis, physics... in my testing enviro that is [shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]
April 20, 201510 yr Did you register your tile entity? GameRegistry.registerTileEntity(YourTileEntityClass.class, "yourTileEntityName"); http://i.imgur.com/NdrFdld.png[/img]
April 20, 201510 yr Author Yep. Checked that. I have the code on github, and I think I may have fixed it, but have doing one server side thing, it lags out and server stops happening. [shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]
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.