-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
61 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 21 additions & 4 deletions
25
src/main/java/com/yayaduck/paper/perworldadvancements/PerWorldAdvancements.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,35 @@ | ||
package com.yayaduck.paper.perworldadvancements; | ||
import org.bukkit.configuration.file.FileConfiguration; | ||
import org.bukkit.plugin.java.JavaPlugin; | ||
|
||
import java.util.ArrayList; | ||
|
||
public final class PerWorldAdvancements extends JavaPlugin { | ||
@Override | ||
public void onEnable() { | ||
getLogger().info("\"PerWorldAdvancements: Enabled! 🦆"); | ||
setDefaults(); | ||
getServer().getPluginManager().registerEvents(new AdvancementListener(this), this); | ||
|
||
this.getConfig().addDefault("enableDebug", false); | ||
this.saveDefaultConfig(); | ||
getLogger().info("PerWorldAdvancements: Enabled! 🦆"); | ||
getLogger().info("PerWorldAdvancements: Worlds configured: " | ||
+ getConfig().getStringList("worlds")); | ||
} | ||
|
||
@Override | ||
public void onDisable() { | ||
getLogger().info("PerWorldAdvancements: Byebye! 🦃"); | ||
} | ||
|
||
private void setDefaults() { | ||
FileConfiguration config = this.getConfig(); | ||
|
||
config.addDefault("enableDebug", false); | ||
|
||
ArrayList<String> worlds = new ArrayList<>(); | ||
worlds.add("exampleworld1"); | ||
worlds.add("exampleworld2"); | ||
worlds.add("exampleworld2_nether"); | ||
config.addDefault("worlds", worlds); | ||
|
||
saveDefaultConfig(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
enableDebug: false | ||
# If set to true, the plugin will log information about every cancelled advancement to the console. | ||
enableDebug: false | ||
|
||
# The worlds where achievements will be disabled. | ||
worlds: | ||
- "exampleworld1" | ||
- "exampleworld2" | ||
- "exampleworld2_nether" |