-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix emissive texture Z-fighting with shaders, Fix crashing without Iris
- Loading branch information
Showing
5 changed files
with
48 additions
and
32 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
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,42 @@ | ||
package net.puzzlemc.gui; | ||
|
||
import net.coderbot.iris.Iris; | ||
import net.coderbot.iris.config.IrisConfig; | ||
import net.coderbot.iris.gui.screen.ShaderPackScreen; | ||
import net.fabricmc.loader.api.FabricLoader; | ||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.text.Text; | ||
import net.minecraft.text.TranslatableText; | ||
import net.puzzlemc.gui.screen.widget.PuzzleWidget; | ||
|
||
import java.io.IOException; | ||
|
||
public class IrisCompat { | ||
public static void init() { | ||
if (FabricLoader.getInstance().isModLoaded("iris")) { | ||
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(Text.of("Iris"))); | ||
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(Text.of("Enable Shaders"), (button) -> button.setMessage(Iris.getIrisConfig().areShadersEnabled() ? PuzzleClient.YES : PuzzleClient.NO), (button) -> { | ||
IrisConfig irisConfig = Iris.getIrisConfig(); | ||
irisConfig.setShadersEnabled(!irisConfig.areShadersEnabled()); | ||
try { | ||
Iris.getIrisConfig().save(); | ||
} catch (IOException e) { | ||
Iris.logger.error("Error saving configuration file!"); | ||
Iris.logger.catching(e); | ||
} | ||
|
||
try { | ||
Iris.reload(); | ||
} catch (IOException e) { | ||
Iris.logger.error("Error reloading shader pack while applying changes!"); | ||
Iris.logger.catching(e); | ||
} | ||
})); | ||
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(new TranslatableText("options.iris.shaderPackSelection.title"), (button) -> button.setMessage(Text.of("OPEN")), (button) -> { | ||
MinecraftClient client = MinecraftClient.getInstance(); | ||
ShaderPackScreen shaderPackPage = new ShaderPackScreen(client.currentScreen); | ||
client.setScreen(shaderPackPage); | ||
})); | ||
} | ||
} | ||
} |
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