Minecart system overhaul
#8
So, I've been using MCP to decompile the minecraft source code. These were my findings:

-The Y offset of an entity riding the car has following offset:
(double)this.height * 0.0D - 0.3;
Thats strange, why not simpily -0.3? I guess the decompiler does some strange things here

-I believe to have found the friction code (pseudocode):
if( MineCartIsRiddenByEntity ) {
  SpeedX *= 0.997;
  SpeedY *= 0.0;
  SpeedZ *= 0.997;
} else {
  SpeedX *= 0.96;
  SpeedY *= 0.0;
  SpeedZ *= 0.96;
}
I believe it's called once per tick. I don't really understand why SpeedY is set to 0. I cannot find code after this that seems to alter SpeedY. When the cart is not on a rail the friction constant seems to be 0.5 and when it is in the air, the friction constant is 0.95

-The entity collision code is there too

I'll have to spend some more time to try to figure out the stuff that's going on. With mostly undocumented code and often inexistens function/variable names (func_70495_a sounds nice for a function, does it?Tongue) it'll need some time.
Reply
Thanks given by:


Messages In This Thread
Minecart system overhaul - by ChriPiv - 08-18-2014, 02:42 AM
RE: Minecart system overhaul - by xoft - 08-18-2014, 06:27 AM
RE: Minecart system overhaul - by ChriPiv - 08-18-2014, 08:11 AM
RE: Minecart system overhaul - by ChriPiv - 08-18-2014, 11:42 PM
RE: Minecart system overhaul - by tigerw - 08-19-2014, 01:44 AM
RE: Minecart system overhaul - by NiLSPACE - 08-19-2014, 02:29 AM
RE: Minecart system overhaul - by xoft - 08-19-2014, 06:40 AM
RE: Minecart system overhaul - by tigerw - 08-20-2014, 06:58 AM
RE: Minecart system overhaul - by ChriPiv - 08-19-2014, 10:57 PM
RE: Minecart system overhaul - by tigerw - 08-19-2014, 11:59 PM
RE: Minecart system overhaul - by ChriPiv - 08-20-2014, 12:39 AM
RE: Minecart system overhaul - by ChriPiv - 08-20-2014, 10:34 PM
RE: Minecart system overhaul - by NiLSPACE - 08-20-2014, 11:13 PM



Users browsing this thread: 2 Guest(s)