EssentialsX

EssentialsX

2M Downloads

Jailing offline players doesn't work with jail-online-time set to true

Krakenied opened this issue ยท 1 comments

commented

Type of bug

Other unexpected behaviour

/ess dump all output

n/a

Error log (if applicable)

n/a

Bug description

Example player data file with jail-online-time option set to true after jailing:

the command is /jail {player} {jail} 3m

when player is online:

  jail: 180000
  onlinejail: 55718738

when player is offline:

  jail: 180000
  onlinejail: 3600

https://github.com/EssentialsX/Essentials/blob/2.x/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtogglejail.java#L85

My guess is that player.getBase().getStatistic(PLAY_ONE_TICK) returns some weird value (maybe 0) for offline players and that's the thing that needs to be fixed, however I'm not sure about the correct approach to that.

(Discord forum)

Steps to reproduce

Above ^

Expected behaviour

Time should be set correctly lol

Actual behaviour

Time isn't set correctly and player gets unjailed instantly on login

commented

@Krakenied We figured it out, it was a weird rabbit hole to go down. Should work fine now.