Merge branch '1.21' into 1.21.3

# Conflicts:
#	gradle.properties
#	src/main/java/com/minelittlepony/client/transform/PonyTransformation.java
This commit is contained in:
Sollace 2024-12-13 22:09:36 +01:00
commit bcfed6cc84
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
3 changed files with 83 additions and 3 deletions

View file

@ -175,4 +175,4 @@ publishing {
}
}
}
}
}

View file

@ -14,6 +14,8 @@ public enum SizePreset implements Size {
BULKY (0xce3254, 0.5f, 1, 1.05F),
LANKY (0x3254ce, 0.45F, 0.85F, 0.9F),
NORMAL (0x000000, 0.4f, 0.8F, 0.8F),
STOCKY (0xb2e7dd, 0.45F, 0.8F, 0.8F),
SQUAT (0xa3d2c7, 0.4F, 0.7F, 0.67F),
YEARLING(0x53beff, 0.4F, 0.6F, 0.65F),
FOAL (0xffbe53, 0.25f, 0.6F, 0.5F),
UNSET (0x000000, 1, 1, 1);

View file

@ -27,8 +27,46 @@ public enum PonyTransformation {
if (attributes.isCrouching) stack.translate(-0.03F, 0.03F, 0.13F);
break;
case HEAD:
if (attributes.isLyingDown) stack.translate(-0.05F, -0.05F, 0);
if (attributes.isCrouching) stack.translate(0, 0.1F, -0);
if (attributes.isLyingDown) stack.translate(0, -0.05F, 0);
if (attributes.isCrouching) stack.translate(0, 0.1F, 0);
break;
case BACK:
translateForRider(stack);
break;
default:
}
}
},
STOCKY(SizePreset.STOCKY, 0, 3F, 0.75F) {
@Override
public void transform(ModelAttributes attributes, BodyPart part, MatrixStack stack) {
if (attributes.isSwimming) stack.translate(0, -0.3F, 0);
if (attributes.isCrouching) stack.translate(0, -0.2F, 0);
if (attributes.isLyingDown) stack.translate(0, -0.77F, 0.1F);
if (attributes.isSleeping) stack.translate(0, 0.16F, 0);
if (attributes.isSitting) stack.translate(0, -0.25F, -0.2F);
switch (part) {
case NECK:
stack.translate(-0.015F, -0.05F, -0.04F);
stack.scale(1.4F, 1, 1.2F);
if (attributes.isCrouching) stack.translate(-0.025F, 0.03F, 0.15F);
if (attributes.isSitting) stack.translate(0, 0, 0.03F);
break;
case HEAD:
if (attributes.isLyingDown) stack.translate(0, -0.05F, 0);
if (attributes.isCrouching) stack.translate(0, 0.1F, 0);
break;
case BODY:
stack.translate(0, -0.15F, -0.05F);
if (attributes.isCrouching) stack.translate(0, -0.07F, 0.04F);
if (attributes.isLyingDown) stack.translate(0, -0.1F, 0);
stack.scale(1.4F, 1.3F, 1.1F);
break;
case LEGS:
stack.translate(0, 0, -0.1F);
if (attributes.isCrouching) stack.translate(0, 0, 0.1F);
stack.scale(1.1F, 1, 1.1F);
break;
case BACK:
translateForRider(stack);
@ -208,6 +246,46 @@ public enum PonyTransformation {
break;
}
}
},
SQUAT(SizePreset.SQUAT, 0, 3.4F, 0.75F) {
@Override
public void transform(ModelAttributes attributes, BodyPart part, MatrixStack stack) {
if (attributes.isSwimming) stack.translate(0, -0.6F, 0);
if (attributes.isCrouching) stack.translate(0, -0.2F, 0);
if (attributes.isLyingDown) stack.translate(0, -1, 0);
if (attributes.isSleeping) stack.translate(0, 0.2F, 0);
if (attributes.isSitting) stack.translate(0, -0.5F, -0.2F);
stack.translate(0, -0.05F, 0);
switch (part) {
case NECK:
stack.translate(-0.01F, 0.1F, 0.03F);
stack.scale(1.4F, 1, 1.1F);
if (attributes.isCrouching) stack.translate(-0.03F, 0.04F, 0.1F);
break;
case HEAD:
stack.translate(0, 0.07F, 0);
stack.scale(1.15F, 1.15F, 1.15F);
if (attributes.isCrouching) stack.translate(0, 0.07F, 0);
break;
case BODY:
stack.scale(1.4F, 1.3F, 1);
if (attributes.isCrouching) stack.translate(0, -0.05F, 0);
break;
case TAIL:
stack.translate(0, -0.1F, 0);
break;
case LEGS:
stack.translate(0, 0.35F, 0.02F);
stack.scale(1.1F, 0.8F, 1.1F);
if (attributes.isLyingDown) stack.translate(0, -0.1F, 0);
break;
case BACK:
translateForRider(stack);
break;
}
}
};
private static final Map<Size, PonyTransformation> REGISTRY = Arrays.stream(values()).collect(Collectors.toMap(i -> i.size, Function.identity()));