13
0
geforkt von Mirrors/Velocity

Shorten name of DurationUtils#toTicks

Dieser Commit ist enthalten in:
Andrew Steinborn 2020-09-19 16:47:55 -04:00
Ursprung 279a3d68ac
Commit b61321f4f7
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -311,9 +311,9 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
TitlePacket timesPkt = TitlePacket.timesForProtocolVersion(this.getProtocolVersion());
net.kyori.adventure.title.Title.Times times = title.times();
if (times != null) {
timesPkt.setFadeIn((int) DurationUtils.convertDurationToTicks(times.fadeIn()));
timesPkt.setStay((int) DurationUtils.convertDurationToTicks(times.stay()));
timesPkt.setFadeOut((int) DurationUtils.convertDurationToTicks(times.fadeOut()));
timesPkt.setFadeIn((int) DurationUtils.toTicks(times.fadeIn()));
timesPkt.setStay((int) DurationUtils.toTicks(times.stay()));
timesPkt.setFadeOut((int) DurationUtils.toTicks(times.fadeOut()));
}
connection.delayedWrite(timesPkt);

Datei anzeigen

@ -18,7 +18,7 @@ public final class DurationUtils {
* @param duration the duration to convert into Minecraft ticks
* @return the duration represented as the number of Minecraft ticks
*/
public static long convertDurationToTicks(Duration duration) {
public static long toTicks(Duration duration) {
return duration.toMillis() / ONE_TICK_IN_MILLISECONDS;
}
}