Fix validation in RotationBuilder#angle (fixes #6323) (#6408)

This commit is contained in:
Choonster TheMage 2020-01-08 09:21:12 +11:00 committed by LexManos
parent ca62702ff9
commit dd0260c476

View file

@ -550,7 +550,7 @@ public class ModelBuilder<T extends ModelBuilder<T>> extends ModelFile {
*/
public RotationBuilder angle(float angle) {
// Same logic from BlockPart.Deserializer#parseAngle
Preconditions.checkArgument(angle != 0.0F && MathHelper.abs(angle) != 22.5F && MathHelper.abs(angle) != 45.0F, "Invalid rotation %f found, only -45/-22.5/0/22.5/45 allowed", angle);
Preconditions.checkArgument(angle == 0.0F || MathHelper.abs(angle) == 22.5F || MathHelper.abs(angle) == 45.0F, "Invalid rotation %f found, only -45/-22.5/0/22.5/45 allowed", angle);
this.angle = angle;
return this;
}