This commit is contained in:
fullwall 2012-09-06 17:35:10 +08:00
parent 64df7c8efb
commit 4073ceea54
7 changed files with 11 additions and 12 deletions

View File

@ -6,7 +6,7 @@
<groupId>net.citizensnpcs</groupId>
<artifactId>citizens</artifactId>
<version>2.0</version>
<version>2.0.1</version>
<name>Citizens</name>
<properties>
@ -103,10 +103,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.4</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<minimizeJar>true</minimizeJar>
</configuration>
<executions>
<execution>
<phase>package</phase>

View File

@ -28,9 +28,7 @@ public class CitizensNavigator implements Navigator {
int lastX, lastY, lastZ;
private NavigatorParameters localParams = defaultParams;
private final CitizensNPC npc;
private int stationaryTicks;
private boolean updatedAvoidWater = false;
public CitizensNavigator(CitizensNPC npc) {

View File

@ -31,6 +31,7 @@ public class MCNavigationStrategy implements PathStrategy {
cancelReason = CancelReason.STUCK;
}
@Override
public CancelReason getCancelReason() {
return cancelReason;
}
@ -52,6 +53,8 @@ public class MCNavigationStrategy implements PathStrategy {
@Override
public boolean update() {
if (cancelReason != null)
return true;
navigation.a(parameters.avoidWater());
navigation.a(parameters.speed());
return navigation.f();

View File

@ -75,12 +75,12 @@ public class MCTargetStrategy implements PathStrategy, EntityTarget {
@Override
public boolean update() {
if (target == null)
return true;
if (target.dead) {
if (target == null || target.dead) {
cancelReason = CancelReason.TARGET_DIED;
return true;
}
if (cancelReason != null)
return true;
navigation.a(target, parameters.speed());
handle.getControllerLook().a(target, 10.0F, handle.bf());
if (aggro && canAttack()) {

View File

@ -135,7 +135,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
bt *= 0.9F;
float prev = aG;
aG *= bs();
aG *= bs() * npc.getNavigator().getDefaultParameters().speed();
e(br, bs); // movement method
aG = prev;
as = yaw; // update head yaw to match entity yaw

View File

@ -160,6 +160,8 @@ public class LinearWaypointProvider implements WaypointProvider {
public void load(DataKey key) {
for (DataKey root : key.getRelative("points").getIntegerSubKeys()) {
root = root.getRelative("location");
if (Bukkit.getWorld(root.getString("world")) == null)
continue;
waypoints.add(new Waypoint(new Location(Bukkit.getWorld(root.getString("world")), root
.getDouble("x"), root.getDouble("y"), root.getDouble("z"), (float) root.getDouble("yaw",
0), (float) root.getDouble("pitch", 0))));

View File

@ -1,7 +1,7 @@
name: Citizens
authors: [aPunch, fullwall]
softdepend: [Vault]
version: 2.0
version: 2.0.1
main: net.citizensnpcs.Citizens
website: http://www.citizensnpcs.net
commands: