mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-11-10 20:45:59 +01:00
Possible fix(es) for accessor crash
- Haven't been able to reproduce - Try forcing PausedPartialTickAccessor to load early - Try renaming the method
This commit is contained in:
parent
cd4d5d1b72
commit
15ea38ede7
@ -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());
|
||||
}
|
||||
}
|
||||
|
@ -9,5 +9,5 @@ import net.minecraft.client.Minecraft;
|
||||
public interface PausedPartialTickAccessor {
|
||||
|
||||
@Accessor("pausePartialTick")
|
||||
float getPausePartialTick();
|
||||
float flywheel$getPartialTicksPaused();
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user