File tree Expand file tree Collapse file tree
src/main/java/org/dimdev/vanillafix/bugs/mixins Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package org .dimdev .vanillafix .bugs .mixins ;
22
3+ import org .dimdev .vanillafix .VanillaFix ;
34import org .dimdev .vanillafix .util .annotation .MixinConfigValue ;
45import org .spongepowered .asm .mixin .Mixin ;
56import org .spongepowered .asm .mixin .Overwrite ;
7+ import org .spongepowered .asm .mixin .injection .At ;
8+ import org .spongepowered .asm .mixin .injection .Inject ;
9+ import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
610
711import net .minecraft .server .MinecraftServer ;
812import net .minecraft .server .WorldGenerationProgressListener ;
913
1014@ MixinConfigValue (category = "bugFixes" , value = "disableInitialChunkLoad" )
11- @ Mixin (MinecraftServer .class )
15+ @ Mixin (value = MinecraftServer .class , priority = 1 )
1216public class MinecraftServerMixin {
1317 /**
1418 * @reason Disable initial chunk load. This makes world load much faster, but in exchange
1519 * the player may see incomplete chunks (like when teleporting to a new area).
1620 * @author ?
1721 */
18- @ Overwrite
19- private void prepareStartRegion (WorldGenerationProgressListener worldGenerationProgressListener ) {
22+ @ Inject (method = "prepareStartRegion" , at = @ At ("HEAD" ), cancellable = true )
23+ private void prepareStartRegion (WorldGenerationProgressListener worldGenerationProgressListener , CallbackInfo ci ) {
24+ if (VanillaFix .config ().bugFixes .disableInitialChunkLoad ) {
25+ ci .cancel ();
26+ }
2027 }
2128}
You can’t perform that action at this time.
0 commit comments