public class PlayerAdvancementTracker extends Object
Modifier and Type | Field and Description |
---|---|
private File |
advancementFile |
private Map<Advancement,AdvancementProgress> |
advancementToProgress |
private Advancement |
currentDisplayTab |
private boolean |
dirty |
private com.mojang.datafixers.DataFixer |
field_25324 |
private PlayerManager |
field_25325 |
private static Gson |
GSON |
private static TypeToken<Map<Identifier,AdvancementProgress>> |
JSON_TYPE |
private static Logger |
LOGGER |
private ServerPlayerEntity |
owner |
private Set<Advancement> |
progressUpdates |
private Set<Advancement> |
visibilityUpdates |
private Set<Advancement> |
visibleAdvancements |
Constructor and Description |
---|
PlayerAdvancementTracker(com.mojang.datafixers.DataFixer dataFixer,
PlayerManager playerManager,
ServerAdvancementLoader serverAdvancementLoader,
File file,
ServerPlayerEntity serverPlayerEntity) |
private static final Logger LOGGER
private static final Gson GSON
private static final TypeToken<Map<Identifier,AdvancementProgress>> JSON_TYPE
private final com.mojang.datafixers.DataFixer field_25324
private final PlayerManager field_25325
private final File advancementFile
private final Map<Advancement,AdvancementProgress> advancementToProgress
private final Set<Advancement> visibleAdvancements
private final Set<Advancement> visibilityUpdates
private final Set<Advancement> progressUpdates
private ServerPlayerEntity owner
@Nullable private Advancement currentDisplayTab
private boolean dirty
public PlayerAdvancementTracker(com.mojang.datafixers.DataFixer dataFixer, PlayerManager playerManager, ServerAdvancementLoader serverAdvancementLoader, File file, ServerPlayerEntity serverPlayerEntity)
public void setOwner(ServerPlayerEntity owner)
public void clearCriteria()
public void reload(ServerAdvancementLoader advancementLoader)
private void beginTrackingAllAdvancements(ServerAdvancementLoader advancementLoader)
private void updateCompleted()
private void rewardEmptyAdvancements(ServerAdvancementLoader advancementLoader)
private void load(ServerAdvancementLoader advancementLoader)
public void save()
public boolean grantCriterion(Advancement advancement, String criterionName)
public boolean revokeCriterion(Advancement advancement, String criterionName)
private void beginTracking(Advancement advancement)
private void endTrackingCompleted(Advancement advancement)
public void sendUpdate(ServerPlayerEntity player)
public void setDisplayTab(@Nullable Advancement advancement)
public AdvancementProgress getProgress(Advancement advancement)
private void initProgress(Advancement advancement, AdvancementProgress progress)
private void updateDisplay(Advancement advancement)
private boolean canSee(Advancement advancement)
private boolean hasChildrenDone(Advancement advancement)