Naiten Posted May 11, 2013 Share Posted May 11, 2013 Hello. I've fixed problems with my entities being jumping, but now i have antoher problem. Whenever i try to move the wagon, it runs some distance and then teleports to the place i've spawned it at. Any help? Deleted from considerations of secrecy. Quote If i helped you, don't forget pressing "Thank You" button. Thanks for your time. Link to comment Share on other sites More sharing options...
Draco18s Posted May 11, 2013 Share Posted May 11, 2013 Hello. I've fixed problems with my entities being jumping, but now i have antoher problem. Whenever i try to move the wagon, it runs some distance and then teleports to the place i've spawned it at. Any help? It teleports back to where it started because you only moved it client side. When it later got a position packet from the server, it moved to those coordinates. Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given. Link to comment Share on other sites More sharing options...
Naiten Posted May 11, 2013 Author Share Posted May 11, 2013 It teleports back to where it started because you only moved it client side. When it later got a position packet from the server, it moved to those coordinates. I bet no, because on flat grass it runs well. However on my rails (0.375 m high) and on half-blocks everything is not so good... Quote If i helped you, don't forget pressing "Thank You" button. Thanks for your time. Link to comment Share on other sites More sharing options...
Naiten Posted May 12, 2013 Author Share Posted May 12, 2013 So, anyone? --- This is just weird. If i put the loco on rails, it twithes, if i put it on the ground, it runs well. But if i put it on the ground and then it runs on the rails it also runs well o_O Quote If i helped you, don't forget pressing "Thank You" button. Thanks for your time. Link to comment Share on other sites More sharing options...
Zetal Posted May 12, 2013 Share Posted May 12, 2013 When you update the entity's position client-side for rendering, do you do any rounding? Quote Have a modding question? PM me and hopefully I'll be able to help. Good at 2d Pixel Art? We need your help! http://www.minecraftforum.net/topic/1806355-looking-for-2d-pixel-artist/ Link to comment Share on other sites More sharing options...
Naiten Posted May 13, 2013 Author Share Posted May 13, 2013 When you update the entity's position client-side for rendering, do you do any rounding? I've said, this is not the problem of server-client, because it lags only on certain blocks like mine rails and half-slabs... --- Also, i've fixed my rails block collision, but this gave no effect on the locomotive... It still runs good on earth and bad on rails -.- --- Here's the video showing the bug. And i repeat once again, this is problem of collision thing, not server-client system... http://www.youtube.com/watch?v=p0mmf_x78l4 Quote If i helped you, don't forget pressing "Thank You" button. Thanks for your time. Link to comment Share on other sites More sharing options...
Zetal Posted May 13, 2013 Share Posted May 13, 2013 I understand you think so, but anything the client see's is purely what the server tells it to see. If it's twitching, it could be that your rendering code told it to twitch, which I seriously doubt since I think you know what you're doing in that regard, or because it's on the rails, the server is sending asynchronous update packets with partially invalid position coordinates. The fact that it does this on HalfSlabs as well makes it seem like there is a rounding issue in where it's trying to set it's position- the entity wants to be lower, the server pushes it up, and it twitches. That's just my theory, anyway. Quote Have a modding question? PM me and hopefully I'll be able to help. Good at 2d Pixel Art? We need your help! http://www.minecraftforum.net/topic/1806355-looking-for-2d-pixel-artist/ Link to comment Share on other sites More sharing options...
Naiten Posted May 13, 2013 Author Share Posted May 13, 2013 So, where do you think the error is? It uses standard pushOutOfBLocks() and i think it's somewhere there... And i can't even imagine why it rides rails well if strted on ground -.- Quote If i helped you, don't forget pressing "Thank You" button. Thanks for your time. Link to comment Share on other sites More sharing options...
Zetal Posted May 13, 2013 Share Posted May 13, 2013 To be frank I just don't really know- it's only a suspicion. You should add in a lot of debug statements to make sure that every variable is what you think it is- and if it's not, that might be your issue. Try setting motionY to 0, just as a debug. See what happens, I guess? Sorry I'm not much help atm. Quote Have a modding question? PM me and hopefully I'll be able to help. Good at 2d Pixel Art? We need your help! http://www.minecraftforum.net/topic/1806355-looking-for-2d-pixel-artist/ Link to comment Share on other sites More sharing options...
Naiten Posted May 14, 2013 Author Share Posted May 14, 2013 This saved my mental health. if(underBlockId < 1 && underBlockId != RoW.rails.blockID && underBlockId != RoW.railGag.blockID){ addVelocity(0, -0.04, 0); } if(underBlockId == RoW.rails.blockID || underBlockId == RoW.railGag.blockID){ setPosition(posX, MathHelper.floor_double(posY) + 0.38, posZ); // 0.38 = my rail block height (0.375) + little spare space. } Quote If i helped you, don't forget pressing "Thank You" button. Thanks for your time. Link to comment Share on other sites More sharing options...
Recommended Posts
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.