-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Config for marker set properties and duration
Finishes point 2. in #1
- Loading branch information
1 parent
5fc5d30
commit 78df061
Showing
3 changed files
with
57 additions
and
11 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
40 changes: 40 additions & 0 deletions
40
src/main/java/com/technicjelle/bluemapchatmarkers/Config.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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.technicjelle.bluemapchatmarkers; | ||
|
||
import com.technicjelle.MCUtils; | ||
import org.bukkit.configuration.file.FileConfiguration; | ||
|
||
import java.io.IOException; | ||
|
||
public class Config { | ||
public static final String MARKER_SET_ID = "chat-markers"; | ||
|
||
private final BlueMapChatMarkers plugin; | ||
|
||
public String markerSetName; | ||
public boolean toggleable; | ||
public boolean defaultHidden; | ||
public long markerDuration; | ||
|
||
public Config(BlueMapChatMarkers plugin) { | ||
this.plugin = plugin; | ||
|
||
try { | ||
MCUtils.copyPluginResourceToConfigDir(plugin, "config.yml", "config.yml", false); | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
|
||
//Load config from disk | ||
plugin.reloadConfig(); | ||
|
||
//Load config values into variables | ||
markerSetName = configFile().getString("MarkerSetName"); | ||
toggleable = configFile().getBoolean("Toggleable"); | ||
defaultHidden = configFile().getBoolean("DefaultHidden"); | ||
markerDuration = configFile().getLong("MarkerDuration"); | ||
} | ||
|
||
private FileConfiguration configFile() { | ||
return plugin.getConfig(); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Marker Set Options | ||
# Documentation: https://bluemap.bluecolored.de/wiki/customization/Markers.html#marker-sets | ||
MarkerSetName: "Chat Messages" | ||
Toggleable: true | ||
DefaultHidden: false | ||
|
||
# Amount of time a chat marker stays on the map (in seconds) | ||
MarkerDuration: 60 |