use of net.minecraft.server.PlayerAdvancements in project Denizen-For-Bukkit by DenizenScript.
the class AdvancementHelperImpl method update.
@Override
public void update(Player player) {
ServerPlayer nmsPlayer = ((CraftPlayer) player).getHandle();
nmsPlayer.connection.send(new ClientboundUpdateAdvancementsPacket(true, Collections.emptySet(), Collections.emptySet(), Collections.emptyMap()));
PlayerAdvancements data = nmsPlayer.getAdvancements();
// save progress
data.save();
// clear progress
data.reload(DedicatedServer.getServer().getAdvancements());
// load progress and update client
data.flushDirty(nmsPlayer);
}
use of net.minecraft.server.PlayerAdvancements in project Denizen-For-Bukkit by DenizenScript.
the class AdvancementHelperImpl method update.
@Override
public void update(Player player) {
ServerPlayer nmsPlayer = ((CraftPlayer) player).getHandle();
nmsPlayer.connection.send(new ClientboundUpdateAdvancementsPacket(true, Collections.emptySet(), Collections.emptySet(), Collections.emptyMap()));
PlayerAdvancements data = nmsPlayer.getAdvancements();
// save progress
data.save();
// clear progress
data.reload(DedicatedServer.getServer().getAdvancements());
// load progress and update client
data.flushDirty(nmsPlayer);
}
Aggregations