Fix homes not deleting for unloaded worlds
This commit is contained in:
parent
cd3076bd55
commit
6e8fce7560
|
|
@ -23,7 +23,7 @@ public class DelHomeCommand extends PlayerSubCommand {
|
|||
// }
|
||||
|
||||
String home = (args.length > 0) ? args[0] : "home";
|
||||
if (playerConfig.getHome(home) == null) {
|
||||
if (!playerConfig.hasHome(home)) {
|
||||
player.sendRichMessage(Config.HOME_DOES_NOT_EXIST, Placeholder.unparsed("home", home));
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,6 +110,11 @@ public class PlayerConfig extends YamlConfiguration {
|
|||
setStoredLocation(death ? "teleports.death" : "teleports.back", location);
|
||||
}
|
||||
|
||||
public boolean hasHome(String name) {
|
||||
ConfigurationSection section = getConfigurationSection("home." + name);
|
||||
return section != null;
|
||||
}
|
||||
|
||||
public Location getHome(String name) {
|
||||
return getStoredLocation("home." + name);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user