diff --git a/src/main/java/com/jozufozu/flywheel/FlywheelClient.java b/src/main/java/com/jozufozu/flywheel/FlywheelClient.java index a8b7b19ae..dc0e7b4e4 100644 --- a/src/main/java/com/jozufozu/flywheel/FlywheelClient.java +++ b/src/main/java/com/jozufozu/flywheel/FlywheelClient.java @@ -5,6 +5,7 @@ import com.jozufozu.flywheel.core.Contexts; import com.jozufozu.flywheel.core.Materials; import com.jozufozu.flywheel.core.PartialModel; import com.jozufozu.flywheel.core.StitchedSprite; +import com.jozufozu.flywheel.mixin.PausedPartialTickAccessor; import com.jozufozu.flywheel.vanilla.VanillaInstances; import net.minecraftforge.eventbus.api.IEventBus; @@ -26,5 +27,12 @@ public class FlywheelClient { modEventBus.addListener(StitchedSprite::onTextureStitchPost); VanillaInstances.init(); + + // https://github.com/Jozufozu/Flywheel/issues/69 + // Weird issue with accessor loading. + // Only thing I've seen that's close to a fix is to force the class to load before trying to use it. + // From the SpongePowered discord: + // https://discord.com/channels/142425412096491520/626802111455297538/675007581168599041 + Flywheel.log.info("Successfully loaded {}", PausedPartialTickAccessor.class.getName()); } } diff --git a/src/main/java/com/jozufozu/flywheel/mixin/PausedPartialTickAccessor.java b/src/main/java/com/jozufozu/flywheel/mixin/PausedPartialTickAccessor.java index 550f6d4ab..ab5e5aa18 100644 --- a/src/main/java/com/jozufozu/flywheel/mixin/PausedPartialTickAccessor.java +++ b/src/main/java/com/jozufozu/flywheel/mixin/PausedPartialTickAccessor.java @@ -9,5 +9,5 @@ import net.minecraft.client.Minecraft; public interface PausedPartialTickAccessor { @Accessor("pausePartialTick") - float getPausePartialTick(); + float flywheel$getPartialTicksPaused(); } diff --git a/src/main/java/com/jozufozu/flywheel/util/AnimationTickHolder.java b/src/main/java/com/jozufozu/flywheel/util/AnimationTickHolder.java index 0a8374f42..c16da14d8 100644 --- a/src/main/java/com/jozufozu/flywheel/util/AnimationTickHolder.java +++ b/src/main/java/com/jozufozu/flywheel/util/AnimationTickHolder.java @@ -37,6 +37,6 @@ public class AnimationTickHolder { public static float getPartialTicks() { Minecraft mc = Minecraft.getInstance(); - return (mc.isPaused() ? ((PausedPartialTickAccessor) mc).getPausePartialTick() : mc.getFrameTime()); + return (mc.isPaused() ? ((PausedPartialTickAccessor) mc).flywheel$getPartialTicksPaused() : mc.getFrameTime()); } }