-
-
Notifications
You must be signed in to change notification settings - Fork 643
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refs/heads/1.20.6' into 1.21
# Conflicts: # src/main/java/net/irisshaders/iris/mixin/vertices/MixinBufferBuilder.java
- Loading branch information
Showing
5 changed files
with
72 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/net/irisshaders/iris/mixin/MixinQuickPlayDev.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package net.irisshaders.iris.mixin; | ||
|
||
import net.fabricmc.loader.api.FabricLoader; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.screens.DisconnectedScreen; | ||
import net.minecraft.client.gui.screens.Screen; | ||
import net.minecraft.client.gui.screens.TitleScreen; | ||
import net.minecraft.client.gui.screens.worldselection.SelectWorldScreen; | ||
import net.minecraft.client.quickplay.QuickPlay; | ||
import net.minecraft.world.Difficulty; | ||
import net.minecraft.world.level.GameRules; | ||
import net.minecraft.world.level.GameType; | ||
import net.minecraft.world.level.LevelSettings; | ||
import net.minecraft.world.level.WorldDataConfiguration; | ||
import net.minecraft.world.level.levelgen.WorldOptions; | ||
import net.minecraft.world.level.levelgen.presets.WorldPresets; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(QuickPlay.class) | ||
public class MixinQuickPlayDev { | ||
@Inject(method = "joinSingleplayerWorld", at = @At("HEAD"), cancellable = true) | ||
private static void iris$createWorldIfDev(Minecraft minecraft, String string, CallbackInfo ci) { | ||
if (FabricLoader.getInstance().isDevelopmentEnvironment()) { | ||
ci.cancel(); | ||
|
||
if (!minecraft.getLevelSource().levelExists(string)) { | ||
minecraft.createWorldOpenFlows().createFreshLevel(string, new LevelSettings(string, GameType.CREATIVE, false, Difficulty.HARD, true, new GameRules(), WorldDataConfiguration.DEFAULT), | ||
WorldOptions.defaultWithRandomSeed(), WorldPresets::createNormalWorldDimensions, Minecraft.getInstance().screen); | ||
} else { | ||
minecraft.createWorldOpenFlows().openWorld(string, () -> minecraft.setScreen(new TitleScreen())); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters