Merge 1.19.2 into 1.19.4

This commit is contained in:
embeddedt 2023-08-15 21:19:15 -04:00
commit a918c09543
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -0,0 +1,24 @@
package org.embeddedt.modernfix.forge.mixin.bugfix.extra_experimental_screen;
import com.mojang.serialization.Lifecycle;
import net.minecraft.client.gui.screens.worldselection.CreateWorldScreen;
import net.minecraft.world.level.storage.PrimaryLevelData;
import net.minecraft.world.level.storage.WorldData;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;
@Mixin(CreateWorldScreen.class)
public class CreateWorldScreenMixin {
/**
* Fix experimental world dialog still being shown the first time you reopen a world that was created
* as experimental.
*/
@ModifyArg(method = "createNewWorld", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screens/worldselection/WorldOpenFlows;createLevelFromExistingSettings(Lnet/minecraft/world/level/storage/LevelStorageSource$LevelStorageAccess;Lnet/minecraft/server/ReloadableServerResources;Lnet/minecraft/core/RegistryAccess$Frozen;Lnet/minecraft/world/level/storage/WorldData;)V"), index = 3)
private WorldData setExperimentalFlag(WorldData data) {
if(data instanceof PrimaryLevelData pld && data.worldGenSettingsLifecycle() != Lifecycle.stable()) {
pld.withConfirmedWarning(true);
}
return data;
}
}