Fix usage of teleport location set by '/as settp'

- It was accidentally trying to get the teleport location from the plugin config file instead of the region config file.
- Also added the possibility to set the teleport location in groups and default.yml
This commit is contained in:
Thijs Wiefferink 2017-08-05 20:25:06 +02:00
parent 053d75181d
commit c8d869ce15
1 changed files with 2 additions and 4 deletions

View File

@ -37,9 +37,7 @@ public class TeleportFeature extends RegionFeature {
* @return The teleport location, or null if not set
*/
public Location getTeleportLocation() {
Location result;
result = Utils.configToLocation(config.getConfigurationSection("general.teleportLocation"));
return result;
return Utils.configToLocation(region.getConfigurationSectionSetting("general.teleportLocation"));
}
/**
@ -47,7 +45,7 @@ public class TeleportFeature extends RegionFeature {
* @return true if the region has a teleportlocation, false otherwise
*/
public boolean hasTeleportLocation() {
return config.isSet("general.teleportLocation");
return region.getConfigurationSectionSetting("general.teleportLocation") != null;
}
/**