Merge 1.19.2 into 1.20
This commit is contained in:
commit
daea9dd83a
|
|
@ -20,6 +20,7 @@ import org.objectweb.asm.tree.ClassNode;
|
|||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
import java.util.function.BooleanSupplier;
|
||||
|
|
@ -156,7 +157,6 @@ public class ModernFixEarlyConfig {
|
|||
|
||||
private static final ImmutableMap<String, Boolean> DEFAULT_SETTING_OVERRIDES = new DefaultSettingMapBuilder()
|
||||
.put("mixin.perf.dynamic_resources", false)
|
||||
.putConditionally(() -> !isFabric, "mixin.perf.async_jei", false)
|
||||
.put("mixin.perf.dynamic_sounds", false)
|
||||
.put("mixin.perf.dynamic_block_codecs", false)
|
||||
.put("mixin.feature.direct_stack_trace", false)
|
||||
|
|
@ -237,7 +237,10 @@ public class ModernFixEarlyConfig {
|
|||
if(!ModernFixPlatformHooks.INSTANCE.isDevEnv())
|
||||
return;
|
||||
try {
|
||||
if(ModernFixEarlyConfig.class.getClassLoader().getResource("/net/minecraft/world/level/Level.class") == null) {
|
||||
URL deobfClass = isFabric ?
|
||||
ModernFixEarlyConfig.class.getResource("/net/minecraft/world/level/Level.class") :
|
||||
ModernFixEarlyConfig.class.getClassLoader().getResource("/net/minecraft/world/level/Level.class");
|
||||
if(deobfClass == null) {
|
||||
LOGGER.warn("We are in a non-Mojmap dev environment. Disabling blockstate cache patch");
|
||||
this.options.get("mixin.perf.reduce_blockstate_cache_rebuilds").addModOverride(false, "[not mojmap]");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ public class ModernFixConfigScreen extends Screen {
|
|||
|
||||
public boolean madeChanges = false;
|
||||
private Button doneButton, wikiButton;
|
||||
private double lastScrollAmount = 0;
|
||||
|
||||
public ModernFixConfigScreen(Screen lastScreen) {
|
||||
super(Component.translatable("modernfix.config"));
|
||||
this.lastScreen = lastScreen;
|
||||
|
|
@ -21,6 +23,7 @@ public class ModernFixConfigScreen extends Screen {
|
|||
@Override
|
||||
protected void init() {
|
||||
this.optionList = new OptionList(this, this.minecraft);
|
||||
this.optionList.setScrollAmount(lastScrollAmount);
|
||||
this.addWidget(this.optionList);
|
||||
this.wikiButton = new Button.Builder(Component.translatable("modernfix.config.wiki"), (arg) -> {
|
||||
Util.getPlatform().openUri("https://github.com/embeddedt/ModernFix/wiki/Summary-of-Patches");
|
||||
|
|
@ -45,4 +48,8 @@ public class ModernFixConfigScreen extends Screen {
|
|||
this.doneButton.setMessage(madeChanges ? Component.translatable("modernfix.config.done_restart") : CommonComponents.GUI_DONE);
|
||||
super.render(guiGraphics, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
public void setLastScrollAmount(double d) {
|
||||
this.lastScrollAmount = d;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,6 +166,7 @@ public class OptionList extends ContainerObjectSelectionList<OptionList.Entry> {
|
|||
}).tooltip(toggleTooltip).pos(0, 0).size(55, 20).build();
|
||||
updateStatus();
|
||||
this.helpButton = new Button.Builder(Component.literal("?"), (arg) -> {
|
||||
mainScreen.setLastScrollAmount(getScrollAmount());
|
||||
Minecraft.getInstance().setScreen(new ModernFixOptionInfoScreen(mainScreen, optionName));
|
||||
}).pos(75, 0).size(20, 20).build();
|
||||
if(!I18n.exists("modernfix.option." + optionName)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user