-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag '1.2.1+1.19.4' into 1.20.1
- Loading branch information
Showing
4 changed files
with
25 additions
and
15 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 |
---|---|---|
@@ -1,9 +1,24 @@ | ||
package tk.estecka.packrulemenus; | ||
|
||
import java.util.Optional; | ||
import java.util.function.Consumer; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import net.fabricmc.loader.api.FabricLoader; | ||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.gui.screen.Screen; | ||
import net.minecraft.client.gui.screen.world.EditGameRulesScreen; | ||
import net.minecraft.world.GameRules; | ||
import tk.estecka.clothgamerules.api.ClothGamerulesScreenFactory; | ||
|
||
public class PackRuleMenus | ||
{ | ||
static public final Logger LOGGER = LoggerFactory.getLogger("Pack-Rule Menus"); | ||
} | ||
|
||
static public Screen CreateGameruleScreen(Screen parent, GameRules rules, Consumer<Optional<GameRules>> saveConsumer){ | ||
if (FabricLoader.getInstance().isModLoaded("cloth-gamerules")) | ||
return ClothGamerulesScreenFactory.CreateScreen(parent, rules, saveConsumer); | ||
else | ||
return new EditGameRulesScreen(rules, saveConsumer.andThen( __->MinecraftClient.getInstance().setScreen(parent) )); | ||
} | ||
} |
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