mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 14:38:53 +00:00
Add clear method to database
This commit is contained in:
2 files changed
+11
-2
No files matched your search
@@ -289,6 +289,15 @@ public abstract class Database {
|
|||||||
*/
|
*/
|
||||||
public abstract void setCurrentTeleport(@NotNull User user, @Nullable Teleport teleport);
|
public abstract void setCurrentTeleport(@NotNull User user, @Nullable Teleport teleport);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears the current {@link Teleport} being executed by a {@link User}
|
||||||
|
*
|
||||||
|
* @param user The {@link User} to clear the current teleport of
|
||||||
|
*/
|
||||||
|
public final void clearCurrentTeleport(@NotNull User user) {
|
||||||
|
this.setCurrentTeleport(user, null);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the last teleport {@link Position} of a specified {@link User}
|
* Get the last teleport {@link Position} of a specified {@link User}
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ public class EventListener {
|
|||||||
} catch (TeleportationException e) {
|
} catch (TeleportationException e) {
|
||||||
e.displayMessage(teleporter, plugin);
|
e.displayMessage(teleporter, plugin);
|
||||||
}
|
}
|
||||||
plugin.getDatabase().setCurrentTeleport(teleporter, null);
|
plugin.getDatabase().clearCurrentTeleport(teleporter);
|
||||||
teleport.displayTeleportingComplete(teleporter);
|
teleport.displayTeleportingComplete(teleporter);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -149,7 +149,7 @@ public class EventListener {
|
|||||||
e.displayMessage(teleporter, plugin);
|
e.displayMessage(teleporter, plugin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
plugin.getDatabase().setCurrentTeleport(teleporter, null);
|
plugin.getDatabase().clearCurrentTeleport(teleporter);
|
||||||
plugin.getDatabase().setRespawnPosition(teleporter, bedPosition.orElse(null));
|
plugin.getDatabase().setRespawnPosition(teleporter, bedPosition.orElse(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user