-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathFindLocQuest.java
More file actions
42 lines (33 loc) · 861 Bytes
/
Copy pathFindLocQuest.java
File metadata and controls
42 lines (33 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
public class FindLocQuest extends Quest {
private boolean complete;
public FindLocQuest(QuestInfo info, Player player, boolean newQuest) {
super(info, player, newQuest);
complete = false;
}
public boolean isComplete() {
return complete;
}
public String getProgress() {
if (complete) {
return "Complete!";
} else {
return "not complete.";
}
}
public void loadProgress(String s) {
if (s == null || s.equals("0")) {
complete = false;
} else {
complete = true;
}
}
public void saveProgress() {
Craftizens.data.saveQuestProgress(player, this, complete?"1":"0");
}
public void onPlayerMove(Player player, Location from, Location to) {
if (!complete && boundary.contains(to.x,to.z)) {
complete = true;
player.sendMessage(Craftizens.TEXT_COLOR + "You have found " + info.getData() + ".");
}
}
}