Skip to content

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

@Krakenied

Description

@Krakenied

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug: confirmedConfirmed bugs in EssentialsX.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions