More experimental features

This commit is contained in:
embeddedt 2023-01-28 10:56:50 -05:00
parent 5c4e77b211
commit 5c914deeb7
No known key found for this signature in database
GPG Key ID: A69433EC199B5613
4 changed files with 28 additions and 2 deletions

View File

@ -18,6 +18,7 @@ public class ModernFixEarlyConfig {
// You must manually add a rule for any new mixins not covered by an existing package rule.
this.addMixinRule("core", true); // TODO: Don't actually allow the user to disable this
this.addMixinRule("feature.measure_time", true);
this.addMixinRule("feature.reduce_loading_screen_freezes", false);
this.addMixinRule("perf.remove_biome_temperature_cache", true);
this.addMixinRule("perf.resourcepacks", true);
this.addMixinRule("perf.reduce_blockstate_cache_rebuilds", true);

View File

@ -1,2 +0,0 @@
package org.embeddedt.modernfix.mixin.bugfix.buggy_tooltip_handlers;public class ForgeEventFactoryMixin {
}

View File

@ -0,0 +1,26 @@
package org.embeddedt.modernfix.mixin.feature.reduce_loading_screen_freezes;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.model.ModelBakery;
import net.minecraft.util.Util;
import net.minecraftforge.fml.loading.progress.StartupMessageManager;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
@Mixin(ModelBakery.class)
public class ModelBakeryMixin {
@Redirect(method = "uploadTextures", at = @At(value = "INVOKE", target = "Ljava/util/Set;forEach(Ljava/util/function/Consumer;)V", ordinal = 0))
private void bakeAndTickGUI(Set instance, Consumer consumer) {
StartupMessageManager.mcLoaderConsumer().ifPresent(c -> c.accept("Baking models"));
CompletableFuture<Void> modelBakingFuture = CompletableFuture.runAsync(() -> {
instance.forEach(consumer);
}, Util.backgroundExecutor());
/* allow the GUI to continue running */
Minecraft.getInstance().managedBlock(modelBakingFuture::isDone);
}
}

View File

@ -28,6 +28,7 @@
],
"client": [
"feature.measure_time.MinecraftMixin",
"feature.reduce_loading_screen_freezes.ModelBakeryMixin",
"perf.skip_first_datapack_reload.MinecraftMixin",
"bugfix.concurrency.RenderTypeMixin",
"bugfix.concurrency.MinecraftMixin",