mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +00:00
fix: Teleport Invulnerability oversight & incorrect values on Sponge (#671)
This commit is contained in:
1 parent
0eeab972e4
commit
afae073ab7
9 files changed
+41
-2
No files matched your search
@@ -103,6 +103,7 @@ public class SpongeHuskHomes implements HuskHomes, SpongeTask.Supplier, SpongeSa
|
||||
private final Set<SavedUser> savedUsers = Sets.newHashSet();
|
||||
private final Map<String, List<String>> globalPlayerList = Maps.newConcurrentMap();
|
||||
private final Set<UUID> currentlyOnWarmup = Sets.newHashSet();
|
||||
private final Set<UUID> currentlyInvulnerable = Sets.newHashSet();
|
||||
|
||||
@Inject
|
||||
@ConfigDir(sharedRoot = false)
|
||||
|
||||
@@ -147,9 +147,15 @@ public class SpongeUser extends OnlineUser {
|
||||
return;
|
||||
}
|
||||
long invulnerabilityTimeInTicks = 20L * plugin.getSettings().getGeneral().getTeleportInvulnerabilityTime();
|
||||
player.invulnerable().set(false);
|
||||
player.invulnerable().set(true);
|
||||
// Remove the invulnerability
|
||||
plugin.runSyncDelayed(() -> player.invulnerable().set(true), this, invulnerabilityTimeInTicks);
|
||||
plugin.runSyncDelayed(() -> player.invulnerable().set(false), this, invulnerabilityTimeInTicks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeInvulnerabilityIfPermitted() {
|
||||
if (plugin.isInvulnerable(this.getUuid())) {
|
||||
player.invulnerable().set(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user