Skip to content

Commit

Permalink
姿势Pose全新加入
Browse files Browse the repository at this point in the history
  • Loading branch information
boybook committed Sep 21, 2023
1 parent d39a751 commit 02fe18e
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/main/java/cn/nukkit/entity/data/Skin.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* Nukkit Project
*/
@ToString(exclude = {"geometryData", "animationData"})
public class Skin {
public class Skin implements Cloneable {
private static final int PIXEL_SIZE = 4;

public static final int SINGLE_SKIN_SIZE = 64 * 32 * PIXEL_SIZE;
Expand Down Expand Up @@ -462,4 +462,26 @@ private static String convertLegacyGeometryName(String geometryName) {
return "{\"geometry\" : {\"default\" : \"" + geometryName + "\"}}";
}

@Override
public Skin clone() {
// TODO 可能没有完全clone
try {
Skin skin = (Skin) super.clone();
skin.skinResourcePatch = skinResourcePatch;
skin.skinId = skinId;
skin.fullSkinId = fullSkinId;
skin.playFabId = playFabId;
skin.skinData = skinData;
skin.capeData = capeData;
skin.geometryData = geometryData;
skin.animations.addAll(animations);
skin.animationData = animationData;
skin.personaPieces.addAll(personaPieces);
skin.tintColors.addAll(tintColors);
return skin;
} catch (CloneNotSupportedException e) {
throw new AssertionError(e);
}
}

}

0 comments on commit 02fe18e

Please sign in to comment.