diff --git a/src/main/java/cn/nukkit/entity/EntityHuman.java b/src/main/java/cn/nukkit/entity/EntityHuman.java index 98d8ee82c41..9209aa514c8 100644 --- a/src/main/java/cn/nukkit/entity/EntityHuman.java +++ b/src/main/java/cn/nukkit/entity/EntityHuman.java @@ -182,7 +182,7 @@ protected void initEntity() { } if (skinTag.contains("PieceTintColors")) { ListTag tintColors = skinTag.getList("PieceTintColors", CompoundTag.class); - for (CompoundTag tintColor: tintColors.getAll()) { + for (CompoundTag tintColor : tintColors.getAll()) { newSkin.getTintColors().add(new PersonaPieceTint( tintColor.getString("PieceType"), tintColor.getList("Colors", StringTag.class).getAll().stream() @@ -190,7 +190,9 @@ protected void initEntity() { )); } } - newSkin.setTrusted(skinTag.getBoolean("IsTrustedSkin")); + if (skinTag.contains("IsTrustedSkin")) { + newSkin.setTrusted(skinTag.getBoolean("IsTrustedSkin")); + } this.setSkin(newSkin); } diff --git a/src/main/java/cn/nukkit/entity/data/Skin.java b/src/main/java/cn/nukkit/entity/data/Skin.java index d00def76a94..94c7281a9af 100644 --- a/src/main/java/cn/nukkit/entity/data/Skin.java +++ b/src/main/java/cn/nukkit/entity/data/Skin.java @@ -47,7 +47,7 @@ public class Skin { private String capeId; private String skinColor = "#0"; private String armSize = "wide"; - private boolean trusted; + private boolean trusted = false; public boolean isValid() { return isValidSkin() && isValidResourcePatch();