Skip to content

Commit

Permalink
- Fix killed players that are sent to jail not keeping their So You've
Browse files Browse the repository at this point in the history
Been Jailed book.
    - Closes #5989.
  • Loading branch information
LlmDl committed Jun 30, 2022
1 parent 6376015 commit 812219b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.palmergames.bukkit.towny</groupId>
<artifactId>towny</artifactId>
<packaging>jar</packaging>
<version>0.98.2.7</version>
<version>0.98.2.8</version>

<licenses>
<license>
Expand Down
4 changes: 3 additions & 1 deletion resources/ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7545,4 +7545,6 @@ v0.92.0.11:
- Fix TownPreRuinedEvent firing Async.
- Handle more kinds of changes to cauldrons, courtesy of Warriorrrr with PR #5990.
0.98.2.8:
- Add simpler, more convenient way to get a Translator from a CommandSender.
- Add simpler, more convenient way to get a Translator from a CommandSender.
- Fix killed players that are sent to jail not keeping their So You've Been Jailed book.
- Closes #5989.
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,11 @@ public void isJailingAttackers(Player attackerPlayer, Player defenderPlayer, Res
if (!TownyUniverse.getInstance().getPermissionSource().testPermission(attackerPlayer, PermissionNodes.TOWNY_OUTLAW_JAILER.getNode()))
return;

// Send to jail. Hours are set later on.
JailUtil.jailResident(defenderResident, attackerTown.getPrimaryJail(), 0, JailReason.OUTLAW_DEATH.getHours(), JailReason.OUTLAW_DEATH, attackerResident.getPlayer());
// Send to jail. Hours are set later on. Task is set 1 tick later so the Jail book isn't removed from their death.
Bukkit.getScheduler().runTaskLater(
plugin, ()->
JailUtil.jailResident(defenderResident, attackerTown.getPrimaryJail(), 0, JailReason.OUTLAW_DEATH.getHours(), JailReason.OUTLAW_DEATH, attackerResident.getPlayer()),
1);
return;
}
}
Expand Down

0 comments on commit 812219b

Please sign in to comment.