-
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.
- Loading branch information
Showing
10 changed files
with
156 additions
and
74 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,70 @@ | ||
String default_minecraft_version = "1.19.2" | ||
Properties localProperties = new Properties() | ||
String minecraft_version | ||
if (project.rootProject.file('build.properties').exists()) { | ||
localProperties.load(project.rootProject.file('build.properties').newDataInputStream()) | ||
} | ||
if (localProperties.containsKey("MC_VERSION")) { | ||
String notDotted = localProperties.get("MC_VERSION") | ||
String dotted = notDotted.substring(0, 1) + "." + | ||
Integer.toString(Integer.parseInt(notDotted.substring(1, 3))) + "." + | ||
Integer.toString(Integer.parseInt(notDotted.substring(3, 5))) | ||
minecraft_version = dotted | ||
} else { | ||
minecraft_version = rootProject.properties.containsKey("buildVersion") ? rootProject.properties.get("buildVersion") : default_minecraft_version | ||
} | ||
rootProject.ext.minecraft_version = minecraft_version | ||
rootProject.ext.minecraft_main_version = minecraft_version.split("\\.")[1] as int | ||
rootProject.ext.minecraft_version_int = minecraft_version.split("\\.")[0] + | ||
minecraft_version.split("\\.")[1].padLeft(2, '0') + | ||
(minecraft_version.split("\\.").length > 2 ? minecraft_version.split("\\.")[2].padLeft(2, '0') : "00") | ||
rootProject.ext.is_1_19_3 = minecraft_version == "1.19.3" || minecraft_version == "1.19.4" | ||
rootProject.ext.is_1_20 = minecraft_version == "1.20" || minecraft_version == "1.20.1" | ||
|
||
rootProject.ext.supports_minecraft_version = [ | ||
"1.16.5": "1.16.x", | ||
"1.17.1": "1.17.x", "1.18.2": "1.18.x", | ||
"1.19.2": "1.19.2", "1.19.3": "1.19.3", "1.19.4": "1.19.4", | ||
"1.20.1": "1.20.x", "1.20.4": "1.20.x" | ||
][minecraft_version] | ||
rootProject.ext.supports_minecraft_version_range = [ | ||
"1.16.5": "[1.16, 1.17)", | ||
"1.17.1": "[1.17, 1.18)", "1.18.2": "[1.18, 1.19)", | ||
"1.19.2": "1.19.2", "1.19.3": "1.19.3", "1.19.4": "1.19.4", | ||
"1.20.1": "[1.20, 1.21)", "1.20.4": "1.20.x" | ||
][minecraft_version] | ||
|
||
rootProject.ext.parchment_version = [ | ||
"1.16.5": "2022.03.06", | ||
"1.17.1": "2021.12.12", "1.18.2": "2022.11.06", | ||
"1.19.2": "2022.11.27", "1.19.3": "2023.06.25", "1.19.4": "2023.06.26", | ||
"1.20.1": "2023.09.03", "1.20.4": "" | ||
][minecraft_version] | ||
|
||
rootProject.ext.fabric_loader_version = "0.15.3" | ||
rootProject.ext.fabric_api_version = [ | ||
"1.16.5": "0.42.0", | ||
"1.17.1": "0.46.1+1.17", "1.18.2": "0.77.0+1.18.2", | ||
"1.19.2": "0.77.0+1.19.2", "1.19.3": "0.76.1+1.19.3", "1.19.4": "0.87.2+1.19.4", | ||
"1.20.1": "0.91.0+1.20.1", "1.20.4": "0.93.1+1.20.4" | ||
][minecraft_version] | ||
rootProject.ext.mod_menu_version = [ | ||
"1.16.5": "1.16.23", | ||
"1.17.1": "2.0.17", "1.18.2": "3.2.5", | ||
"1.19.2": "4.1.2", "1.19.3": "5.1.0", "1.19.4": "6.3.1", | ||
"1.20.1": "7.2.2", "1.20.4": "9.0.0" | ||
][minecraft_version] | ||
|
||
rootProject.ext.forge_version = minecraft_version + "-" + [ | ||
"1.16.5": "36.2.34", | ||
"1.17.1": "37.1.1", "1.18.2": "40.2.0", | ||
"1.19.2": "43.3.0", "1.19.3": "44.1.0", "1.19.4": "45.2.0", | ||
"1.20.1": "47.2.0", "1.20.4": "49.0.19" | ||
][minecraft_version] | ||
rootProject.ext.architectury_version = [ | ||
"1.16.5": "1.32.68", | ||
"1.17.1": "2.10.12", "1.18.2": "4.11.93", | ||
"1.19.2": "6.5.85", "1.19.3": "7.1.86", "1.19.4": "8.2.89", | ||
"1.20.1": "9.1.12", "1.20.4": "11.0.11" | ||
][minecraft_version] | ||
rootProject.ext.architectury_id = minecraft_main_version == 16 ? "me.shedaniel" : "dev.architectury" |
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
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 |
---|---|---|
|
@@ -51,10 +51,4 @@ public net.minecraft.client.gui.components.Button build() { | |
} | ||
} | ||
|
||
#else | ||
|
||
public class Button { | ||
|
||
} | ||
|
||
#endif |
44 changes: 44 additions & 0 deletions
44
common/src/main/java/cn/zbx1425/worldcomment/util/compat/Checkbox.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,44 @@ | ||
package cn.zbx1425.worldcomment.util.compat; | ||
|
||
#if MC_VERSION < "12003" | ||
|
||
import net.minecraft.client.gui.Font; | ||
import net.minecraft.network.chat.Component; | ||
|
||
public class Checkbox { | ||
|
||
public static Checkbox.Builder builder(Component var0, Font var1) { | ||
return new Checkbox.Builder(var0, var1); | ||
} | ||
|
||
public static class Builder { | ||
private final Component message; | ||
private int x; | ||
private int y; | ||
private boolean selected = false; | ||
|
||
public Builder(Component var1, Font ignored) { | ||
this.message = var1; | ||
} | ||
|
||
public Checkbox.Builder pos(int var1, int var2) { | ||
this.x = var1; | ||
this.y = var2; | ||
return this; | ||
} | ||
|
||
public Checkbox.Builder selected(boolean var1) { | ||
this.selected = var1; | ||
return this; | ||
} | ||
|
||
public net.minecraft.client.gui.components.Checkbox build() { | ||
net.minecraft.client.gui.components.Checkbox var1 = | ||
new net.minecraft.client.gui.components.Checkbox(this.x, this.y, 800, 20, | ||
this.message, this.selected, true); | ||
return var1; | ||
} | ||
} | ||
} | ||
|
||
#endif |