forked from MagicBane/Server
Complete JodaTime -> java.time migration (remaining objects, db handlers, net msg, jobs) + QC pass; untrack working reference files
This commit is contained in:
1 parent
efd35e89f1
commit
93eb77fcc8
26 files changed
+160
-426
No files matched your search
@@ -12,7 +12,7 @@ package engine.net;
|
||||
import engine.math.Vector3f;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.util.ByteBufferUtils;
|
||||
import org.joda.time.DateTime;
|
||||
import java.time.Instant;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -57,13 +57,13 @@ public class ByteBufferWriter {
|
||||
this.bb.putLong(x);
|
||||
}
|
||||
|
||||
public synchronized void putDateTime(DateTime dateTime) {
|
||||
this.put((byte) dateTime.getDayOfMonth());
|
||||
this.put((byte) ((byte) dateTime.getMonthOfYear() - 1));
|
||||
this.putInt(dateTime.getYear() - 1900);
|
||||
this.put((byte) dateTime.getHourOfDay());
|
||||
this.put((byte) dateTime.getMinuteOfHour());
|
||||
this.put((byte) dateTime.getSecondOfDay());
|
||||
public synchronized void putDateTime(Instant dateTime) {
|
||||
this.put((byte) dateTime.atZone(ZoneId.systemDefault()).toLocalDate().getDayOfMonth());
|
||||
this.put((byte) ((byte) dateTime.atZone(ZoneId.systemDefault()).toLocalDate().getMonthValue() - 1));
|
||||
this.putInt(dateTime.atZone(ZoneId.systemDefault()).toLocalDate().getYear() - 1900);
|
||||
this.put((byte) dateTime.atZone(ZoneId.systemDefault()).toLocalTime().getHour());
|
||||
this.put((byte) dateTime.atZone(ZoneId.systemDefault()).toLocalTime().getMinute());
|
||||
this.put((byte) dateTime.atZone(ZoneId.systemDefault()).toLocalTime().getSecond());
|
||||
}
|
||||
|
||||
public synchronized void putLocalDateTime(LocalDateTime dateTime) {
|
||||
|
||||
Reference in new issue
Block a user