Skip to content

Commit 69319ce

Browse files
committed
Revert "fix(sleep): actually revoke invuln on sleep state change (#374)"
This reverts commit 082a432.
1 parent 4b97174 commit 69319ce

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

src/main/java/com/fibermc/essentialcommands/playerdata/PlayerData.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -399,17 +399,11 @@ public boolean isSleepingFromCommand() {
399399
return isSleepingFromCommand;
400400
}
401401

402-
public void setIsSleepingFromCommand(boolean isStartingSleeping) {
403-
if (this.isSleepingFromCommand == isStartingSleeping) {
404-
return;
405-
}
406-
if (isStartingSleeping) {
402+
public void setIsSleepingFromCommand(boolean sleepingFromCommand) {
403+
this.isSleepingFromCommand = sleepingFromCommand;
404+
if (CONFIG.SLEEP_INVULN && sleepingFromCommand) {
407405
Pal.grantAbility(player, VanillaAbilities.INVULNERABLE, ECAbilitySources.SLEEP_INVULN);
408-
} else {
409-
// ending sleeping
410-
Pal.revokeAbility(player, VanillaAbilities.INVULNERABLE, ECAbilitySources.SLEEP_INVULN);
411406
}
412-
this.isSleepingFromCommand = isStartingSleeping;
413407
}
414408

415409
public void setPreviousLocation(MinecraftLocation location) {

0 commit comments

Comments
 (0)