Fix a few more invalid ticks

This commit is contained in:
fullwall 2023-03-13 02:41:43 +08:00
parent bd8d5a7f74
commit 4053795588
4 changed files with 3 additions and 4 deletions

View File

@ -509,7 +509,6 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
despawnNPCs(false);
ProfileFetcher.reset();
Skin.clearCache();
getServer().getPluginManager().callEvent(new CitizensPreReloadEvent());
saves.reloadFromSource();

View File

@ -169,7 +169,7 @@ public class CitizensNPC extends AbstractNPC {
@Override
public boolean isUpdating(NPCUpdate update) {
return update == NPCUpdate.PACKET
? updateCounter > data().get(NPC.Metadata.PACKET_UPDATE_DELAY, Setting.PACKET_UPDATE_DELAY.asInt())
? updateCounter > data().get(NPC.Metadata.PACKET_UPDATE_DELAY, Setting.PACKET_UPDATE_DELAY.asTicks())
: false;
}

View File

@ -251,7 +251,7 @@ public class CitizensNavigator implements Navigator, Runnable {
} else {
root.removeKey("distancemargin");
}
if (defaultParams.updatePathRate() != Setting.DEFAULT_PATHFINDER_UPDATE_PATH_RATE.asInt()) {
if (defaultParams.updatePathRate() != Setting.DEFAULT_PATHFINDER_UPDATE_PATH_RATE.asTicks()) {
root.setInt("updatepathrate", defaultParams.updatePathRate());
} else {
root.removeKey("updatepathrate");

View File

@ -280,7 +280,7 @@ public class Text extends Trait implements Runnable, Listener {
sendText(player);
int delay = this.delay == -1
? Setting.DEFAULT_TEXT_DELAY_MIN.asInt() + Util.getFastRandom()
? Setting.DEFAULT_TEXT_DELAY_MIN.asTicks() + Util.getFastRandom()
.nextInt(Setting.DEFAULT_TEXT_DELAY_MAX.asTicks() - Setting.DEFAULT_TEXT_DELAY_MIN.asTicks())
: this.delay;
if (delay <= 0)