Skip to content

Commit

Permalink
Port to 1.21.3 (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
Estecka authored Oct 23, 2024
1 parent 826d653 commit bc3a190
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 13 deletions.
20 changes: 20 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,26 @@ repositories {
}
}

loom {
runs {
client {
configName "Client"
programArgs "--username"
programArgs "Dev"
runDir "run/client"
}
clientClothless {
inherit client
configName "Client (Clothless)"
property("fabric.debug.disableModIds", "cloth-gamerules")
}
server {
configName "Server"
runDir "run/server"
}
}
}

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.21
yarn_mappings=1.21+build.9
loader_version=0.15.11
minecraft_version=1.21.3
yarn_mappings=1.21.3+build.2
loader_version=0.16.7

# Fabric API
fabric_version=0.100.7+1.21
fabric_version=0.106.1+1.21.3

# Mod Properties
mod_version=2.0.2
maven_group=fr.estecka.packrulemenus
archives_base_name=packrule-menus

# Optional Dependencies
clothGamerules_version=1.1.1+1.19.4
cloth_version=15.0.128
modmenu_version=11.0.1
clothGamerules_version=1.2.0+1.21.3
cloth_version=16.0.141
modmenu_version=12.0.0-beta.1
4 changes: 3 additions & 1 deletion src/main/java/fr/estecka/packrulemenus/GameruleHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.world.EditGameRulesScreen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.resource.featuretoggle.FeatureSet;
import net.minecraft.server.integrated.IntegratedServer;
import net.minecraft.text.Text;
import net.minecraft.world.GameRules;
Expand All @@ -25,10 +26,11 @@ public GameruleHandler(Screen parent, IntegratedServer server){

public ButtonWidget CreateButton() {
final GameRules worldRules = server.getOverworld().getGameRules();
final FeatureSet features = server.getOverworld().getEnabledFeatures();

return ButtonWidget.builder(
Text.translatable("selectWorld.gameRules"),
__ -> client.setScreen( CreateGameruleScreen(parent, worldRules.copy(), optRules -> optRules.ifPresent(r -> worldRules.setAllValues(r, server))) )
__ -> client.setScreen( CreateGameruleScreen(parent, worldRules.copy(features), optRules -> optRules.ifPresent(r -> worldRules.setAllValues(r, server))) )
)
.build()
;
Expand Down
7 changes: 2 additions & 5 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@
"packrule-menus.mixins.json"
],
"depends": {
"minecraft": ">=1.20.5 <1.21.2",
"fabricloader": ">=0.15.11",
"minecraft": "~1.21.2",
"fabricloader": ">=0.16.7",
"java": ">=21"
},
"recommends": {
"minecraft": "^1.21.0"
}
}

0 comments on commit bc3a190

Please sign in to comment.