mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 17:18:37 +01:00
Load and save kit use timestamps consistently
Fixes #2301. The kit's name was previously sanitised/lowercased when accessed but not when saved. This fixes that. ensuring the kit delay will be reported correctly. Tested on 1.14.3 - does not appear to break existing kit delays.
This commit is contained in:
parent
ef7393036e
commit
2938330222
@ -801,15 +801,16 @@ public abstract class UserData extends PlayerExtension implements IConf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public long getKitTimestamp(String name) {
|
public long getKitTimestamp(String name) {
|
||||||
name = name.replace('.', '_').replace('/', '_');
|
name = name.replace('.', '_').replace('/', '_').toLowerCase(Locale.ENGLISH);
|
||||||
if (kitTimestamps != null && kitTimestamps.containsKey(name)) {
|
if (kitTimestamps != null && kitTimestamps.containsKey(name)) {
|
||||||
return kitTimestamps.get(name);
|
return kitTimestamps.get(name);
|
||||||
}
|
}
|
||||||
return 0l;
|
return 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setKitTimestamp(final String name, final long time) {
|
public void setKitTimestamp(String name, final long time) {
|
||||||
kitTimestamps.put(name.toLowerCase(Locale.ENGLISH), time);
|
name = name.replace('.', '_').replace('/', '_').toLowerCase(Locale.ENGLISH);
|
||||||
|
kitTimestamps.put(name, time);
|
||||||
config.setProperty("timestamps.kits", kitTimestamps);
|
config.setProperty("timestamps.kits", kitTimestamps);
|
||||||
config.save();
|
config.save();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user