mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 06:28:49 +00:00
Fix last position not being updated
This commit is contained in:
1 file changed
+7
-1
@@ -85,6 +85,10 @@ public class Teleport {
|
|||||||
if (localTarget.isPresent()) {
|
if (localTarget.isPresent()) {
|
||||||
fireEvent((event) -> {
|
fireEvent((event) -> {
|
||||||
executeEconomyActions();
|
executeEconomyActions();
|
||||||
|
if (updateLastPosition) {
|
||||||
|
plugin.getDatabase().setLastPosition(teleporter, teleporter.getPosition());
|
||||||
|
}
|
||||||
|
|
||||||
teleporter.teleportLocally(localTarget.get().getPosition(), async);
|
teleporter.teleportLocally(localTarget.get().getPosition(), async);
|
||||||
this.displayTeleportingComplete(teleporter);
|
this.displayTeleportingComplete(teleporter);
|
||||||
});
|
});
|
||||||
@@ -98,7 +102,6 @@ public class Teleport {
|
|||||||
.type(Message.Type.TELEPORT_TO_NETWORKED_POSITION)
|
.type(Message.Type.TELEPORT_TO_NETWORKED_POSITION)
|
||||||
.target(username.name())
|
.target(username.name())
|
||||||
.build().send(plugin.getMessenger(), executor);
|
.build().send(plugin.getMessenger(), executor);
|
||||||
this.displayTeleportingComplete(teleporter);
|
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -108,6 +111,9 @@ public class Teleport {
|
|||||||
|
|
||||||
fireEvent((event) -> {
|
fireEvent((event) -> {
|
||||||
executeEconomyActions();
|
executeEconomyActions();
|
||||||
|
if (updateLastPosition) {
|
||||||
|
plugin.getDatabase().setLastPosition(teleporter, teleporter.getPosition());
|
||||||
|
}
|
||||||
|
|
||||||
final Position target = (Position) this.target;
|
final Position target = (Position) this.target;
|
||||||
if (!plugin.getSettings().isCrossServer() || target.getServer().equals(plugin.getServerName())) {
|
if (!plugin.getSettings().isCrossServer() || target.getServer().equals(plugin.getServerName())) {
|
||||||
|
|||||||
Reference in new issue
Block a user