mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +00:00
feat: add tp invulerability option, show privacy in /homelist (#577)
* Renamed PrivateHomeListCommand.java to HomeListCommand.java as it shows all homes not just private homes * Implemented https://github.com/WiIIiam278/HuskHomes/issues/543 * Implemented https://github.com/WiIIiam278/HuskHomes/issues/515 * added changes to all lang files, removed un used imports, fix error where it would not remove invulnerability from player on sponge
This commit is contained in:
1 parent
2f2ae6f0d2
commit
1cb56f93fb
27 files changed
+108
-21
No files matched your search
@@ -157,7 +157,7 @@ public class SpongeCommand implements Raw {
|
||||
public enum Type {
|
||||
HOME_COMMAND(PrivateHomeCommand::new),
|
||||
SET_HOME_COMMAND(SetHomeCommand::new),
|
||||
HOME_LIST_COMMAND(PrivateHomeListCommand::new),
|
||||
HOME_LIST_COMMAND(HomeListCommand::new),
|
||||
DEL_HOME_COMMAND(DelHomeCommand::new),
|
||||
EDIT_HOME_COMMAND(EditHomeCommand::new),
|
||||
PUBLIC_HOME_COMMAND(PublicHomeCommand::new),
|
||||
|
||||
@@ -131,4 +131,18 @@ public class SpongeUser extends OnlineUser {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles player invulnerability after teleporting
|
||||
*/
|
||||
@Override
|
||||
public void handleInvulnerability() {
|
||||
if (plugin.getSettings().getGeneral().getTeleportInvulnerabilityTime() <= 0) {
|
||||
return;
|
||||
}
|
||||
long invulnerabilityTimeInTicks = 20L * plugin.getSettings().getGeneral().getTeleportInvulnerabilityTime();
|
||||
player.invulnerable().set(false);
|
||||
// Remove the invulnerability
|
||||
plugin.runSyncDelayed(() -> player.invulnerable().set(true), invulnerabilityTimeInTicks);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user