|
|
|
@ -20,8 +20,6 @@ import org.bukkit.potion.PotionEffect;
|
|
|
|
|
import org.bukkit.potion.PotionEffectType;
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.time.Instant;
|
|
|
|
|
import java.time.Period;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.logging.Level;
|
|
|
|
|
|
|
|
|
@ -164,7 +162,6 @@ public class PlayerSetter {
|
|
|
|
|
= DataSerializer.deserializeAdvancementData(data.getSerializedAdvancements());
|
|
|
|
|
|
|
|
|
|
if (Settings.useNativeImplementation) {
|
|
|
|
|
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
|
|
|
|
try {
|
|
|
|
|
nativeSyncPlayerAdvancements(player, advancementRecords);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
@ -177,7 +174,6 @@ public class PlayerSetter {
|
|
|
|
|
setPlayerAdvancements(player, advancementRecords, data);
|
|
|
|
|
plugin.getLogger().log(Level.SEVERE, e.getMessage(), e);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
setPlayerAdvancements(player, advancementRecords, data);
|
|
|
|
|
}
|
|
|
|
@ -310,12 +306,9 @@ public class PlayerSetter {
|
|
|
|
|
AdvancementUtils.startProgress(playerAdvancements, advancement, nativeAdvancementProgress);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
synchronized (playerAdvancements) {
|
|
|
|
|
AdvancementUtils.ensureAllVisible(playerAdvancements); // Set all completed advancement is visible
|
|
|
|
|
AdvancementUtils.markPlayerAdvancementsFirst(playerAdvancements); // Mark the sending of visible advancement as the first
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Update a player's advancements and progress to match the advancementData
|
|
|
|
|