Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Shorten name of DurationUtils#toTicks
Dieser Commit ist enthalten in:
Ursprung
279a3d68ac
Commit
b61321f4f7
@ -311,9 +311,9 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
|||||||
TitlePacket timesPkt = TitlePacket.timesForProtocolVersion(this.getProtocolVersion());
|
TitlePacket timesPkt = TitlePacket.timesForProtocolVersion(this.getProtocolVersion());
|
||||||
net.kyori.adventure.title.Title.Times times = title.times();
|
net.kyori.adventure.title.Title.Times times = title.times();
|
||||||
if (times != null) {
|
if (times != null) {
|
||||||
timesPkt.setFadeIn((int) DurationUtils.convertDurationToTicks(times.fadeIn()));
|
timesPkt.setFadeIn((int) DurationUtils.toTicks(times.fadeIn()));
|
||||||
timesPkt.setStay((int) DurationUtils.convertDurationToTicks(times.stay()));
|
timesPkt.setStay((int) DurationUtils.toTicks(times.stay()));
|
||||||
timesPkt.setFadeOut((int) DurationUtils.convertDurationToTicks(times.fadeOut()));
|
timesPkt.setFadeOut((int) DurationUtils.toTicks(times.fadeOut()));
|
||||||
}
|
}
|
||||||
connection.delayedWrite(timesPkt);
|
connection.delayedWrite(timesPkt);
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ public final class DurationUtils {
|
|||||||
* @param duration the duration to convert into Minecraft ticks
|
* @param duration the duration to convert into Minecraft ticks
|
||||||
* @return the duration represented as the number of 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;
|
return duration.toMillis() / ONE_TICK_IN_MILLISECONDS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren