mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 14:38:52 +00:00
API: Add methods for setting and editing meta tags
This commit is contained in:
1 parent
f3d6f86568
commit
4ebbba730c
3 files changed
+111
No files matched your search
@@ -264,4 +264,19 @@ public class HomesManager {
|
||||
this.cacheHome(home, true);
|
||||
}
|
||||
|
||||
public void setHomeMetaTags(@NotNull User owner, @NotNull String name, @NotNull Map<String, String> tags) throws ValidationException {
|
||||
final Optional<Home> optionalHome = plugin.getDatabase().getHome(owner, name);
|
||||
if (optionalHome.isEmpty()) {
|
||||
throw new ValidationException(ValidationException.Type.NOT_FOUND);
|
||||
}
|
||||
|
||||
this.setHomeMetaTags(optionalHome.get(), tags);
|
||||
}
|
||||
|
||||
public void setHomeMetaTags(@NotNull Home home, @NotNull Map<String, String> tags) {
|
||||
home.getMeta().setTags(tags);
|
||||
plugin.getDatabase().saveHome(home);
|
||||
this.cacheHome(home, true);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user