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 static Gson |
GSON |
private static TypeToken<Map<Identifier,AdvancementProgress>> |
JSON_TYPE |
private static Logger |
LOGGER |
private ServerPlayerEntity |
owner |
private Set<Advancement> |
progressUpdates |
private MinecraftServer |
server |
private Set<Advancement> |
visibilityUpdates |
private Set<Advancement> |
visibleAdvancements |
Constructor and Description |
---|
PlayerAdvancementTracker(MinecraftServer server,
File advancementFile,
ServerPlayerEntity owner) |
Modifier and Type | Method and Description |
---|---|
private void |
beginTracking(Advancement advancement) |
private void |
beginTrackingAllAdvancements() |
private boolean |
canSee(Advancement advancement) |
void |
clearCriteria() |
private void |
endTrackingCompleted(Advancement advancement) |
AdvancementProgress |
getProgress(Advancement advancement) |
boolean |
grantCriterion(Advancement advancement,
String criterion) |
private boolean |
hasChildrenDone(Advancement advancement) |
private void |
initProgress(Advancement advancement,
AdvancementProgress progress) |
private void |
load() |
void |
reload() |
boolean |
revokeCriterion(Advancement advancement,
String criterion) |
private void |
rewardEmptyAdvancements() |
void |
save() |
void |
sendUpdate(ServerPlayerEntity serverPlayerEntity) |
void |
setDisplayTab(Advancement advancement) |
void |
setOwner(ServerPlayerEntity owner) |
private void |
updateCompleted() |
private void |
updateDisplay(Advancement advancement) |
private static final Logger LOGGER
private static final Gson GSON
private static final TypeToken<Map<Identifier,AdvancementProgress>> JSON_TYPE
private final MinecraftServer server
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(MinecraftServer server, File advancementFile, ServerPlayerEntity owner)
public void setOwner(ServerPlayerEntity owner)
public void clearCriteria()
public void reload()
private void beginTrackingAllAdvancements()
private void updateCompleted()
private void rewardEmptyAdvancements()
private void load()
public void save()
public boolean grantCriterion(Advancement advancement, String criterion)
public boolean revokeCriterion(Advancement advancement, String criterion)
private void beginTracking(Advancement advancement)
private void endTrackingCompleted(Advancement advancement)
public void sendUpdate(ServerPlayerEntity serverPlayerEntity)
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)