-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added support for a custom advancement on first time passing an exam #3
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,9 +20,11 @@ public class Exams extends JavaPlugin | |
|
||
public boolean debug = false; | ||
public boolean examPricesEnabled = true; | ||
public boolean grantAdvancement = false; | ||
|
||
public String serverName = "Your Server"; | ||
public String languageFilename = "english.yml"; | ||
public String examAdvacementName = "doggycraft:doggycraft/student"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a hardcoded advancement, for completing your first exam. Or specify more precisely, that this advancement is a one-time advancement, by calling it something like "firstExamAdvancement". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agree on naming but the "hardcoded" bit is just a default value. it is change later when the config is loaded. |
||
|
||
public int minExamTime = 60; | ||
public int autoCleanTime = 8*60; | ||
|
@@ -86,6 +88,8 @@ public void loadSettings() | |
serverName = config.getString("ServerName", "Your Server"); | ||
minExamTime = config.getInt("MinExamTime", 60); | ||
requiredExamScore = config.getInt("RequiredExamScore", 80); | ||
examAdvacementName = config.getString("AdvancementName", "doggycraft:doggycraft/student"); | ||
grantAdvancement = config.getBoolean("GrantAdvancement", false); | ||
debug = config.getBoolean("Debug", false); | ||
} | ||
|
||
|
@@ -94,6 +98,8 @@ public void saveSettings() | |
config.set("ServerName", serverName); | ||
config.set("MinExamTime", minExamTime); | ||
config.set("RequiredExamScore", requiredExamScore); | ||
config.set("AdvancementName", examAdvacementName); | ||
config.set("GrantAdvancement", grantAdvancement); | ||
config.set("Debug", debug); | ||
|
||
saveConfig(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be changed to see if the exam has an Advancement specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree on the part of the if(plugin.grantAdvancement) check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now one advancement works as a prof of concept.
The reason you can turn this feature on and of is exactly because people might not have a datapack on their server or want to have one. And it does not have to be a specific datapack. Thats why it can be change in the config.yml so people can create their own datapacks with the advancement they what to give.