diff --git a/build.gradle b/build.gradle index a59c0e7f..626fa69b 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ apply plugin: 'maven-publish' apply plugin: 'net.minecraftforge.gradle' apply plugin: 'org.parchmentmc.librarian.forgegradle' -version = '0.5.0-dev.4' +version = '0.5.0-dev.5' group = 'at.petra-k.hexcasting' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'hexcasting' diff --git a/src/main/java/at/petrak/hexcasting/common/casting/colors/FrozenColorizer.java b/src/main/java/at/petrak/hexcasting/common/casting/colors/FrozenColorizer.java index 16ebcdd2..651c319f 100644 --- a/src/main/java/at/petrak/hexcasting/common/casting/colors/FrozenColorizer.java +++ b/src/main/java/at/petrak/hexcasting/common/casting/colors/FrozenColorizer.java @@ -77,13 +77,13 @@ public record FrozenColorizer(Item item, UUID owner) { } private static int morphBetweenColors(int[] colors, Vec3 gradientDir, float time, Vec3 position) { - float fIdx = ((time + (float) gradientDir.dot(position)) % 1f) * colors.length; + float fIdx = Mth.positiveModulo(time + (float) gradientDir.dot(position), 1f) * colors.length; int baseIdx = Mth.floor(fIdx); float tRaw = fIdx - baseIdx; // float t = -(float) (Math.cbrt(Mth.cos(tRaw * Mth.PI)) / 2) + 0.5f; float t = tRaw; - int start = colors[baseIdx]; + int start = colors[baseIdx % colors.length]; int end = colors[(baseIdx + 1) % colors.length]; var r1 = FastColor.ARGB32.red(start);