Skip to content

Commit

Permalink
Bugfixes
Browse files Browse the repository at this point in the history
- Moved death position active delay from SC to tracker
- Fix error on reload which disabled installed trackers
  • Loading branch information
arboriginal committed Feb 14, 2019
1 parent 9af5e58 commit 91d25ec
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ delays:
update_version_cache: 60 # (minute) Duration of cache of online version found (should stay large or you will reach rate limit from Github)
update_compass: 100 # (millisec) Compass datas refresh on player move, put 0 if you have predator's eyes
trackers_list: 2000 # (millisec) Active trackers list (by player) cache
death_position: 900 # (seconds) Time the last death location stays active
elytra_durability: 5 # (seconds) Elytra durability calculation (if used in bossbar progress).
fix_uuid: 50 # (ticks) Time (after login) before to fix UUID which can happens, especialy in offline mode.
option_take_effect: 20 # (ticks) Time to wait before a new open takes effect in the currently active player compasses.
Expand Down
2 changes: 1 addition & 1 deletion src/me/arboriginal/SimpleCompass/managers/DataManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public List<String> activeTargetsList(Player player, String type) {
String key = activeTargetsKey(player, type);
List<String> list = new ArrayList<String>();

if (users.getList(key) != null) for (String tracker : users.getStringList(key)) list.add(tracker);
if (users.getList(key) != null) for (String target : users.getStringList(key)) list.add(target);

return list;
}
Expand Down
12 changes: 8 additions & 4 deletions src/me/arboriginal/SimpleCompass/plugin/AbstractTracker.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
public abstract class AbstractTracker {
protected SimpleCompass sc;
protected File sf;
protected URL res;

public enum TrackingActions {
ADD, ACCEPT, ASK, DEL, DENY, HELP, START, STOP,
Expand All @@ -37,8 +38,9 @@ public enum TargetSelector {
// ----------------------------------------------------------------------------------------------

public AbstractTracker(SimpleCompass plugin) {
sc = plugin;
sf = new File(sc.getDataFolder(), "trackers/" + getClass().getSimpleName() + ".yml");
sc = plugin;
sf = new File(sc.getDataFolder(), "trackers/" + getClass().getSimpleName() + ".yml");
res = getClass().getResource("/settings.yml");
}

// ----------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -68,8 +70,10 @@ public String version() {
* so DO NOT USE sc.config here, and DO NOT call methods which use this.
*/
public boolean init() {
URL res = getClass().getResource("/settings.yml");
if (res == null) return false;
if (res == null) {
sc.getLogger().warning("settings.yml missing in " + sf.getAbsolutePath());
return false;
}

settings = YamlConfiguration.loadConfiguration(sf);
settings.options().copyDefaults(true);
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: SimpleCompass
description: Simple compass to help player who don't have sense of direction.
version: 0.9.5
version: 0.9.6

author: arboriginal
website: https://www.spigotmc.org/resources/simplecompass.63140/
Expand Down

0 comments on commit 91d25ec

Please sign in to comment.