Skip to content

Commit

Permalink
fix building the Entrypoint.java with java 8
Browse files Browse the repository at this point in the history
  • Loading branch information
BluCobalt committed Jan 11, 2024
1 parent 1101da7 commit 20cd0c0
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 23 deletions.
4 changes: 2 additions & 2 deletions base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ plugins {
}

dependencies {
minecraft "com.mojang:minecraft:1.20.4"
mappings "net.fabricmc:yarn:1.20.4+build.3:v2"
minecraft "com.mojang:minecraft:1.16.5"
mappings "net.fabricmc:yarn:${project.yarn_1_16_5}:v2"
modImplementation("net.fabricmc:fabric-loader:${project.loader_version}")
}

18 changes: 5 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import groovy.json.JsonOutput
import groovy.json.JsonSlurper

plugins {
id("fabric-loom") version "1.4-SNAPSHOT" apply false
id("legacy-looming") version "1.4-SNAPSHOT" apply false
Expand All @@ -9,9 +6,6 @@ plugins {
}

subprojects {
if (project.name == ":versions")
{}

apply(plugin = "java")
apply(plugin = "base")
apply(plugin = "com.github.hierynomus.license-base")
Expand All @@ -26,13 +20,11 @@ subprojects {
options.encoding = "UTF-8"
println(project.name)

// "if the project name is base, use java 17 (because base is always the newest)"
// "if the project name is 1.17.1 or newer, use java 17"
// "if it does not match any of the above, use java 8"

sourceCompatibility = if (project.name == "versions" || project.name == "base" || ((project.name.replace(".", "").toInt() >= 1171)) && (project.name != "1.7.10")) "17" else "1.8"
targetCompatibility = if (project.name == "versions" || project.name == "base" || ((project.name.replace(".", "").toInt() >= 1171)) && (project.name != "1.7.10")) "17" else "1.8"
// ^^^- that versions block is because gradle includes the "versions" folder as a project for some reason
// if the project is 1.17.1 or newer use java 17 else use java 8
@Suppress("LocalVariableName") // because gradle has a shit ton of variables that match any combination of "target" and "version" you could think of
val target_version = if (project.name == "base" || project.name == "1.7.10" || (project.name.replace(".", "").toInt() < 1171)) "1.8" else "17"
sourceCompatibility = target_version
targetCompatibility = target_version
}

withType(ProcessResources::class) {
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ org.gradle.caching=true
#fabric.loom.multiProjectOptimisation=true

version = 2.0.0
yarn_1_20_4 = 1.20.4+build.3
yarn_1_19_4 = 1.19.4+build.2
yarn_1_18_2 = 1.18.2+build.4
yarn_1_17_1 = 1.17.1+build.65
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ public class TitleScreenMixin1_19_4
public void donothing(int y, int spacingY, CallbackInfo ci)
{
if (MinecraftClient.getInstance().currentScreen instanceof TitleScreen){
TitleScreenAccessor1_20_4 ts = (TitleScreenAccessor1_20_4) MinecraftClient.getInstance().currentScreen;
TitleScreenAccessor1_19_4 ts = (TitleScreenAccessor1_19_4) MinecraftClient.getInstance().currentScreen;
List<Drawable> drawables = ts.getDrawables();
for (Drawable drawable : drawables) {
if (drawable instanceof ButtonWidget){
ButtonWidget buttonWidget = (ButtonWidget) drawable;
Text message = buttonWidget.getMessage();
MutableText t = (MutableText) message;
TranslatableTextAccessor1_20_4 accessor = (TranslatableTextAccessor1_20_4) t.getContent();
TranslatableTextAccessor1_19_4 accessor = (TranslatableTextAccessor1_19_4) t.getContent();
if (accessor.getKey().equals("menu.online")){
((ButtonWidget) drawable).visible = false;
}
Expand Down
2 changes: 1 addition & 1 deletion versions/1.20.4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

dependencies {
minecraft "com.mojang:minecraft:1.20.4"
mappings "net.fabricmc:yarn:1.20.4+build.3:v2"
mappings "net.fabricmc:yarn:${project.yarn_1_20_4}:v2"
implementation project(path: ":base", configuration: "namedElements")
modImplementation("net.fabricmc:fabric-loader:${project.loader_version}")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,4 @@ public void donothing(int y, int spacingY, CallbackInfo ci)
}
}
}
// @Inject(method = "isRealmsNotificationsGuiDisplayed", at = @At(value = "RETURN"), cancellable = true)
// public void fakereturn(CallbackInfoReturnable<Boolean> cir)
// {
// cir.setReturnValue(false);
// }
}

0 comments on commit 20cd0c0

Please sign in to comment.