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:
Preva1l authored and GitHub committed 2024-02-25 16:47:16 +00:00
1 parent 2f2ae6f0d2
commit 1cb56f93fb
27 files changed
+108 -21

No files matched your search

@@ -130,7 +130,7 @@ public class FabricCommand {
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),
@@ -164,6 +164,21 @@ public class FabricUser 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.setInvulnerable(true);
// Remove the invulnerability
plugin.runSyncDelayed(() -> player.setInvulnerable(false), invulnerabilityTimeInTicks);
}
@NotNull
private static Identifier parseIdentifier(@NotNull String channel) {
if (channel.equals("BungeeCord")) {