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); despawnNPCs(false);
ProfileFetcher.reset(); ProfileFetcher.reset();
Skin.clearCache(); Skin.clearCache();
getServer().getPluginManager().callEvent(new CitizensPreReloadEvent()); getServer().getPluginManager().callEvent(new CitizensPreReloadEvent());
saves.reloadFromSource(); saves.reloadFromSource();

View File

@ -169,7 +169,7 @@ public class CitizensNPC extends AbstractNPC {
@Override @Override
public boolean isUpdating(NPCUpdate update) { public boolean isUpdating(NPCUpdate update) {
return update == NPCUpdate.PACKET 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; : false;
} }

View File

@ -251,7 +251,7 @@ public class CitizensNavigator implements Navigator, Runnable {
} else { } else {
root.removeKey("distancemargin"); 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()); root.setInt("updatepathrate", defaultParams.updatePathRate());
} else { } else {
root.removeKey("updatepathrate"); root.removeKey("updatepathrate");

View File

@ -280,7 +280,7 @@ public class Text extends Trait implements Runnable, Listener {
sendText(player); sendText(player);
int delay = this.delay == -1 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()) .nextInt(Setting.DEFAULT_TEXT_DELAY_MAX.asTicks() - Setting.DEFAULT_TEXT_DELAY_MIN.asTicks())
: this.delay; : this.delay;
if (delay <= 0) if (delay <= 0)