File tree Expand file tree Collapse file tree
src/main/java/org/embeddedt/archaicfix Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,7 +64,8 @@ public enum Mixin implements IMixins {
6464 "core.MixinGuiIngameForge" ,
6565 "core.MixinFMLClientHandler" ,
6666 "core.MixinSplashProgress" ,
67- "core.AccessorSplashProgress" )),
67+ "core.AccessorSplashProgress" ,
68+ "core.MixinTimer" )),
6869 RECIPE_CACHING (new ArchaicBuilder ()
6970 .setPhase (Phase .EARLY )
7071 .setApplyIf (() -> ArchaicConfig .cacheRecipes )
Original file line number Diff line number Diff line change 1+ package org .embeddedt .archaicfix .mixins .client .core ;
2+
3+ import net .minecraft .util .Timer ;
4+ import org .spongepowered .asm .mixin .Mixin ;
5+ import org .spongepowered .asm .mixin .Shadow ;
6+ import org .spongepowered .asm .mixin .injection .At ;
7+ import org .spongepowered .asm .mixin .injection .Inject ;
8+ import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
9+
10+ @ Mixin (Timer .class )
11+ public class MixinTimer {
12+ @ Shadow
13+ private double timeSyncAdjustment ;
14+
15+ @ Shadow
16+ private long field_74285_i ;
17+
18+ /**
19+ * @author embeddedt
20+ * @reason Disable vanilla's broken mechanism for trying to coordinate two clocks and just use the result of
21+ * System.nanoTime() as is. This fixes the client sometimes feeling very sluggish when opening a world.
22+ */
23+ @ Inject (method = "updateTimer" , at = @ At ("HEAD" ))
24+ private void disableTimeSyncAdjustment (CallbackInfo ci ) {
25+ this .timeSyncAdjustment = 1.0D ;
26+ this .field_74285_i = 0L ;
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments