Fix frog color translation

This commit is contained in:
Camotoy 2022-05-31 14:51:21 -04:00
parent 81bb6f124e
commit eb23a46887
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F
2 changed files with 7 additions and 2 deletions

View file

@ -54,7 +54,12 @@ public class FrogEntity extends AnimalEntity {
}
public void setFrogVariant(IntEntityMetadata entityMetadata) {
dirtyMetadata.put(EntityData.VARIANT, entityMetadata.getPrimitiveValue());
int variant = entityMetadata.getPrimitiveValue();
dirtyMetadata.put(EntityData.VARIANT, switch (variant) {
case 1 -> 2; // White
case 2 -> 1; // Green
default -> variant;
});
}
public void setTongueTarget(ObjectEntityMetadata<OptionalInt> entityMetadata) {

View file

@ -110,7 +110,7 @@ public class MathUtils {
* @param high The high bound of the clamp
* @return the clamped value
*/
public static double clamp(float value, float low, float high) {
public static float clamp(float value, float low, float high) {
if (value < low) {
return low;
}