Fix format parsing in /ptime (Fixes #5655)

This commit is contained in:
Josh Roy 2024-02-09 22:31:28 -05:00
parent 1e040fa7b5
commit 596ba6e2f5
1 changed files with 3 additions and 2 deletions

View File

@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.IUser; import com.earth2me.essentials.IUser;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.AdventureUtil;
import com.earth2me.essentials.utils.DescParseTickFormat; import com.earth2me.essentials.utils.DescParseTickFormat;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.bukkit.Server; import org.bukkit.Server;
@ -82,7 +83,7 @@ public class Commandptime extends EssentialsLoopCommand {
} }
final String formattedTime = DescParseTickFormat.format(ticks); final String formattedTime = DescParseTickFormat.format(ticks);
sender.sendTl(fixed ? "pTimeSetFixed" : "pTimeSet", formattedTime, joiner.toString()); sender.sendTl(fixed ? "pTimeSetFixed" : "pTimeSet", AdventureUtil.parsed(formattedTime), joiner.toString());
} }
public void getUserTime(final CommandSource sender, final IUser user) { public void getUserTime(final CommandSource sender, final IUser user) {
@ -96,7 +97,7 @@ public class Commandptime extends EssentialsLoopCommand {
} }
final String time = DescParseTickFormat.format(user.getBase().getPlayerTime()); final String time = DescParseTickFormat.format(user.getBase().getPlayerTime());
sender.sendTl(user.getBase().isPlayerTimeRelative() ? "pTimeCurrent" : "pTimeCurrentFixed", user.getName(), time); sender.sendTl(user.getBase().isPlayerTimeRelative() ? "pTimeCurrent" : "pTimeCurrentFixed", user.getName(), AdventureUtil.parsed(time));
} }
private void setUserTime(final User user, final Long ticks, final Boolean relative) { private void setUserTime(final User user, final Long ticks, final Boolean relative) {