Skip to content

Commit

Permalink
Fix timestamps updating for vanilla players
Browse files Browse the repository at this point in the history
Affected only vanilla players who had never logged in on a Craftbukkit-based server
  • Loading branch information
Jikoo committed Feb 15, 2024
1 parent 7c00373 commit 92ef1de
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ private <T extends Tag> void copyValue(
CompoundTag oldContainer = getTag(source, container, CompoundTag.class);
CompoundTag newContainer = getTag(target, container, CompoundTag.class);

// Container being null means the server implementation doesn't store this data.
if (oldContainer == null || newContainer == null) {
// New container being null means the server implementation doesn't store this data.
if (newContainer == null) {
return;
}

Expand All @@ -146,9 +146,12 @@ private <T extends Tag> void copyValue(
}

private <T extends Tag> @Nullable T getTag(
@NotNull CompoundTag container,
@Nullable CompoundTag container,
@NotNull String key,
@NotNull Class<T> dataType) {
if (container == null) {
return null;
}
Tag value = container.get(key);
if (value == null || !dataType.isAssignableFrom(value.getClass())) {
return null;
Expand Down

0 comments on commit 92ef1de

Please sign in to comment.