mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-12 13:44:07 +01:00
Wrong load order
This commit is contained in:
parent
c072a0887a
commit
023ab5e8a6
@ -116,13 +116,6 @@ public class LookClose extends Trait implements Toggleable, CommandConfigurable
|
|||||||
@Override
|
@Override
|
||||||
public void load(DataKey key) {
|
public void load(DataKey key) {
|
||||||
range = key.getDouble("range");
|
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 };
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -148,6 +141,13 @@ public class LookClose extends Trait implements Toggleable, CommandConfigurable
|
|||||||
public void run() {
|
public void run() {
|
||||||
if (!enabled || !npc.isSpawned() || npc.getNavigator().isNavigating())
|
if (!enabled || !npc.isSpawned() || npc.getNavigator().isNavigating())
|
||||||
return;
|
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);
|
npc.getEntity().getLocation(NPC_LOCATION);
|
||||||
if (hasInvalidTarget()) {
|
if (hasInvalidTarget()) {
|
||||||
findNewTarget();
|
findNewTarget();
|
||||||
|
Loading…
Reference in New Issue
Block a user