Skip to content

Commit

Permalink
Wrong load order
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Sep 23, 2019
1 parent c072a08 commit 023ab5e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions main/src/main/java/net/citizensnpcs/trait/LookClose.java
Expand Up @@ -116,13 +116,6 @@ private boolean isPluginVanished(Player player) {
@Override
public void load(DataKey key) {
range = key.getDouble("range");
// TODO: remove in a later version, defaults weren't saving properly
if (randomPitchRange == null) {
randomPitchRange = new float[] { -10, 0 };
}
if (randomYawRange == null) {
randomYawRange = new float[] { 0, 360 };
}
}

/**
Expand All @@ -148,6 +141,13 @@ private void randomLook() {
public void run() {
if (!enabled || !npc.isSpawned() || npc.getNavigator().isNavigating())
return;
// TODO: remove in a later version, defaults weren't saving properly
if (randomPitchRange == null) {
randomPitchRange = new float[] { -10, 0 };
}
if (randomYawRange == null) {
randomYawRange = new float[] { 0, 360 };
}
npc.getEntity().getLocation(NPC_LOCATION);
if (hasInvalidTarget()) {
findNewTarget();
Expand Down

0 comments on commit 023ab5e

Please sign in to comment.