Skip to content

Commit

Permalink
Removed bukkit runnables
Browse files Browse the repository at this point in the history
  • Loading branch information
KartoffelChipss committed Apr 26, 2024
1 parent 86911ae commit 16398b8
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 25 deletions.
2 changes: 1 addition & 1 deletion dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>org.strassburger</groupId>
<artifactId>LifeStealZ</artifactId>
<name>LifeStealZ</name>
<version>1.1.1</version>
<version>1.1.2</version>
<description>A LifeSteal SMP plugin providing you all the features you need!</description>
<build>
<resources>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.strassburger</groupId>
<artifactId>LifeStealZ</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
<packaging>jar</packaging>

<name>LifeStealZ</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,10 @@ public void onPlayerJoin(PlayerJoinEvent event) {
playerData = newPlayerData;
}

applyInvulnerability(player);
LifeStealZ.setMaxHealth(player, playerData.getMaxhp());

if (player.isOp() && LifeStealZ.getInstance().getConfig().getBoolean("checkForUpdates") && LifeStealZ.getInstance().getVersionChecker().NEW_VERSION_AVAILABLE) {
player.sendMessage(MessageUtils.getAndFormatMsg(true, "messages.newVersionAvailable", "&7A new version of LifeStealZ is available!\\n&c<click:OPEN_URL:https://modrinth.com/plugin/lifestealz/versions>https://modrinth.com/plugin/lifestealz/versions</click>"));
}
}

private void applyInvulnerability(Player player) {
player.setInvulnerable(true);
new BukkitRunnable() {
@Override
public void run() {
player.setInvulnerable(false);
}
}.runTaskLater(LifeStealZ.getInstance(), 20L);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ public void onPlayerLogin(PlayerLoginEvent event) {

PlayerData playerData = LifeStealZ.getInstance().getPlayerDataStorage().load(player.getUniqueId());

applyInvulnerability(player);

List<String> worldWhitelisted = LifeStealZ.getInstance().getConfig().getStringList("worlds");
if (!worldWhitelisted.contains(player.getLocation().getWorld().getName())) return;

Expand All @@ -40,14 +38,4 @@ public void onPlayerLogin(PlayerLoginEvent event) {
}

}

private void applyInvulnerability(Player player) {
player.setInvulnerable(true);
new BukkitRunnable() {
@Override
public void run() {
player.setInvulnerable(false);
}
}.runTaskLater(LifeStealZ.getInstance(), 20L);
}
}

0 comments on commit 16398b8

Please sign in to comment.