From 831c9b9e47aec220ea7b6c4d0fcb1f2fad71a1ff Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Tue, 25 Jan 2022 10:12:08 -0800 Subject: [PATCH] Update changelog and document Translate#nudge --- changelog.txt | 12 ++++++++++++ .../jozufozu/flywheel/util/transform/Translate.java | 9 +++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index ccd0e4240..981b3af55 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,15 @@ +0.6.0: +With this release, Flywheel is no longer needed on servers! Forge finally has client commands, +and the /flywheel command now takes advantage of this. +Fixes + - Fix crash when running with sodium/magnesium. +Technical/API + - Backend is now a static class. + - Shaders are now compiled on-the-fly and cached. + - Significantly reduced the amount of boilerplate needed in instancing shaders. + - Struct types no longer need to be registered ahead of time. + - Simplify unnecessarily complicated game state system. + 0.5.1: Fixes - Fix crash on resource reload with backend off diff --git a/src/main/java/com/jozufozu/flywheel/util/transform/Translate.java b/src/main/java/com/jozufozu/flywheel/util/transform/Translate.java index 2e3da5a32..df6b91abd 100644 --- a/src/main/java/com/jozufozu/flywheel/util/transform/Translate.java +++ b/src/main/java/com/jozufozu/flywheel/util/transform/Translate.java @@ -56,8 +56,13 @@ public interface Translate { return translate(-vec.getX(), -vec.getY(), -vec.getZ()); } - default Self nudge(int id) { - long randomBits = (long) id * 31L * 493286711L; + /** + * Translates this object randomly by a very small amount. + * @param seed The seed to use to generate the random offsets. + * @return {@code this} + */ + default Self nudge(int seed) { + long randomBits = (long) seed * 31L * 493286711L; randomBits = randomBits * randomBits * 4392167121L + randomBits * 98761L; float xNudge = (((float) (randomBits >> 16 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; float yNudge = (((float) (randomBits >> 20 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F;