Timestamp is millis now, fix dimension storage

This commit is contained in:
Nassim Jahnke 2022-05-13 10:11:26 +02:00
parent 1e0c0ebb2d
commit fdc73126f7
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
2 changed files with 4 additions and 4 deletions

View File

@ -218,7 +218,7 @@ public final class Protocol1_18_2To1_19 extends BackwardsProtocol<ClientboundPac
@Override
public void registerMap() {
map(Type.STRING); // Message
create(Type.LONG, Instant.now().getEpochSecond()); // Timestamp
create(Type.LONG, Instant.now().toEpochMilli()); // Timestamp
create(Type.LONG, 0L); // Salt
handler(wrapper -> {
final String message = wrapper.get(Type.STRING, 0);

View File

@ -129,11 +129,11 @@ public final class EntityPackets1_19 extends EntityRewriter<Protocol1_18_2To1_19
for (final Tag dimension : dimensions) {
final CompoundTag dimensionCompound = (CompoundTag) dimension;
final StringTag nameTag = dimensionCompound.get("name");
dimensionsMap.put(nameTag.getValue(), dimensionCompound);
final CompoundTag dimensionData = dimensionCompound.get("element");
dimensionsMap.put(nameTag.getValue(), dimensionData);
if (!found && nameTag.getValue().equals(dimensionKey)) {
final CompoundTag compoundTag = dimensionCompound.get("element");
wrapper.write(Type.NBT, compoundTag);
wrapper.write(Type.NBT, dimensionData);
found = true;
}
}