mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-07 08:47:35 +01:00
Added per player time support. Thanks eisental, Shamebot and needspeed10!
By: EvilSeph <evilseph@unaligned.org>
This commit is contained in:
parent
bdcef14cde
commit
e7815b7313
@ -236,4 +236,46 @@ public interface Player extends HumanEntity, CommandSender {
|
|||||||
* @param amount Amount to increment this statistic by
|
* @param amount Amount to increment this statistic by
|
||||||
*/
|
*/
|
||||||
public void incrementStatistic(Statistic statistic, Material material, int amount);
|
public void incrementStatistic(Statistic statistic, Material material, int amount);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the current time on the player's client. When relative is true the player's time
|
||||||
|
* will be kept synchronized to its world time with the specified offset.
|
||||||
|
*
|
||||||
|
* When using non relative time the player's time will stay fixed at the specified time parameter. It's up to
|
||||||
|
* the caller to continue updating the player's time. To restore player time to normal use resetPlayerTime().
|
||||||
|
*
|
||||||
|
* @param time The current player's perceived time or the player's time offset from the server time.
|
||||||
|
* @param relative When true the player time is kept relative to its world time.
|
||||||
|
*/
|
||||||
|
public void setPlayerTime(long time, boolean relative);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the player's current timestamp.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public long getPlayerTime();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the player's current time offset relative to server time, or the current player's fixed time
|
||||||
|
* if the player's time is absolute.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public long getPlayerTimeOffset();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the player's time is relative to the server time, otherwise the player's time is absolute and
|
||||||
|
* will not change its current time unless done so with setPlayerTime().
|
||||||
|
*
|
||||||
|
* @return true if the player's time is relative to the server time.
|
||||||
|
*/
|
||||||
|
public boolean isPlayerTimeRelative();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Restores the normal condition where the player's time is synchronized with the server time.
|
||||||
|
* Equivalent to calling setPlayerTime(0, true).
|
||||||
|
*/
|
||||||
|
public void resetPlayerTime();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user