Skip to content

Commit 22b4975

Browse files
CopilotJRoy
andauthored
Fixes stale cached locations after using /settpr (#6305)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: JRoy <10731363+JRoy@users.noreply.github.com>
1 parent 65120e9 commit 22b4975

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Essentials/src/main/java/com/earth2me/essentials/RandomTeleport.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ public Location getCenter(final String name) {
6969
public void setCenter(final String name, final Location center) {
7070
config.setProperty(locationKey(name, "center"), center);
7171
config.save();
72+
// Clear cached locations since center changed
73+
this.getCachedLocations(name).clear();
7274
}
7375

7476
public double getMinRange(final String name) {
@@ -78,6 +80,8 @@ public double getMinRange(final String name) {
7880
public void setMinRange(final String name, final double minRange) {
7981
config.setProperty(locationKey(name, "min-range"), minRange);
8082
config.save();
83+
// Clear cached locations since min range changed
84+
this.getCachedLocations(name).clear();
8185
}
8286

8387
public double getMaxRange(final String name) {
@@ -87,6 +91,8 @@ public double getMaxRange(final String name) {
8791
public void setMaxRange(final String name, final double maxRange) {
8892
config.setProperty(locationKey(name, "max-range"), maxRange);
8993
config.save();
94+
// Clear cached locations since max range changed
95+
this.getCachedLocations(name).clear();
9096
}
9197

9298
public String getDefaultLocation() {

0 commit comments

Comments
 (0)