mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-12 01:41:05 +01:00
Dinner time!
This commit is contained in:
parent
923ab54e38
commit
657913faeb
2 changed files with 24 additions and 2 deletions
|
@ -142,12 +142,14 @@ public final class CraftServer implements Server {
|
||||||
return new World[]{console.e.getWorld()};
|
return new World[]{console.e.getWorld()};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public long getTime() {
|
public long getTime() {
|
||||||
return console.e.e;
|
return getWorlds()[0].getFullTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public void setTime(long time) {
|
public void setTime(long time) {
|
||||||
console.e.e = time;
|
getWorlds()[0].setFullTime(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerConfigurationManager getHandle() {
|
public ServerConfigurationManager getHandle() {
|
||||||
|
|
|
@ -243,6 +243,26 @@ public class CraftWorld implements World {
|
||||||
return "CraftWorld";
|
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 {
|
private final class ChunkCoordinate {
|
||||||
public final int x;
|
public final int x;
|
||||||
public final int z;
|
public final int z;
|
||||||
|
|
Loading…
Reference in a new issue