mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
API: New events, move around old ones, setters
This commit is contained in:
1 parent
6a62cea52c
commit
503898a0ef
44 files changed
+538
-236
No files matched your search
@@ -13,10 +13,12 @@ public class SetWarpCommand extends SetPositionCommand {
|
||||
|
||||
@Override
|
||||
protected void execute(@NotNull OnlineUser setter, @NotNull String name) {
|
||||
try {
|
||||
plugin.getManager().warps().createWarp(name, setter.getPosition());
|
||||
} catch (ValidationException e) {
|
||||
e.dispatchWarpError(setter, plugin, name);
|
||||
}
|
||||
plugin.fireEvent(plugin.getWarpCreateEvent(name, setter.getPosition(), setter), (event) -> {
|
||||
try {
|
||||
plugin.getManager().warps().createWarp(event.getName(), event.getPosition());
|
||||
} catch (ValidationException e) {
|
||||
e.dispatchWarpError(setter, plugin, event.getName());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user