kumpelblase2 / Remote-Entities

A library that enables you to control entities in minecraft.
Other
31 stars 28 forks source link

DesireMoveToLocation shouldExecute #48

Closed rmb938 closed 11 years ago

rmb938 commented 11 years ago

The distanceSquared can sometimes be greater then 1.15 so using the minecraft navigation f() method fixes this issue.

kumpelblase2 commented 11 years ago

You made that line way longer than you need. To get the entity handle you could just do this.getEntityHandle() and done. Secondly, I'm not really sure if that wouldn't end in an infinite loop. Because in the update method it resets the path, which is, after a second though, not really good, so I'll probably remove it anyway. Last thing is that using your method, it would not work if it is already moving which is bad, since .f() checks if the entity has no path.

I see what you're aiming for, but the execution is not quite right.

kumpelblase2 commented 11 years ago

Closed with https://github.com/kumpelblase2/Remote-Entities/commit/ab5824b8fa52db7360d812863262e71035f32b33

rmb938 commented 11 years ago

Your fix works but there is one other issue that may or may not have been there before. When the location that it is trying to walk to is outside of its path finding range DesireMoveToLocation never finishes. Should be easy enough to fix. Also sorry with all the issues, just switched from Citizens2 and just trying to convert my existing code.

Also do you mind adding two methods to get and set the pathfinding range from a RemoteEntity

kumpelblase2 commented 11 years ago

I'll add something which makes it possible, just give me some time.

kumpelblase2 commented 11 years ago

See : https://github.com/kumpelblase2/Remote-Entities/commit/1eed1abaa98191e6545785d68bf4784dbea74c36