mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +01:00
Dinner time!
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
94b8e2a239
commit
19eadde312
@ -142,12 +142,14 @@ public final class CraftServer implements Server {
|
||||
return new World[]{console.e.getWorld()};
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public long getTime() {
|
||||
return console.e.e;
|
||||
return getWorlds()[0].getFullTime();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setTime(long time) {
|
||||
console.e.e = time;
|
||||
getWorlds()[0].setFullTime(time);
|
||||
}
|
||||
|
||||
public ServerConfigurationManager getHandle() {
|
||||
|
@ -243,6 +243,26 @@ public class CraftWorld implements World {
|
||||
return "CraftWorld";
|
||||
}
|
||||
|
||||
public long getTime() {
|
||||
long time = getFullTime() % 24000;
|
||||
if (time < 0) time += 24000;
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(long time) {
|
||||
long margin = (time - getFullTime()) % 24000;
|
||||
if (margin < 0) margin += 24000;
|
||||
setFullTime(getFullTime() + margin);
|
||||
}
|
||||
|
||||
public long getFullTime() {
|
||||
return world.e;
|
||||
}
|
||||
|
||||
public void setFullTime(long time) {
|
||||
world.e = time;
|
||||
}
|
||||
|
||||
private final class ChunkCoordinate {
|
||||
public final int x;
|
||||
public final int z;
|
||||
|
Loading…
Reference in New Issue
Block a user