diff --git a/build.gradle b/build.gradle index e1c4bd1..f995b1f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,12 +1,8 @@ plugins { - id 'fabric-loom' version '0.11-SNAPSHOT' + id 'fabric-loom' version '1.1.9' id 'maven-publish' } -sourceCompatibility = JavaVersion.VERSION_17 -targetCompatibility = JavaVersion.VERSION_17 - -archivesBaseName = project.archives_base_name version = project.mod_version group = project.maven_group @@ -30,31 +26,35 @@ dependencies { compileOnly 'com.google.code.findbugs:jsr305:+' } +base { + archivesName = project.archives_base_name +} + processResources { inputs.property "version", project.version filesMatching("fabric.mod.json") { expand "version": project.version } - - // from(sourceSets.main.resources.srcDirs) { - // exclude "fabric.mod.json" - // } } -// ensure that the encoding is set to UTF-8, no matter what the system default is -// this fixes some edge cases with special characters not displaying correctly -// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html -tasks.withType(JavaCompile) { - options.encoding = "UTF-8" +tasks.withType(JavaCompile).configureEach { + // Minecraft 1.18 (1.18-pre2) upwards uses Java 17. + it.options.release = 17 + // ensure that the encoding is set to UTF-8, no matter what the system default is + // this fixes some edge cases with special characters not displaying correctly + // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html + it.options.encoding = "UTF-8" } -// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task -// if it is present. -// If you remove this task, sources will not be generated. -task sourcesJar(type: Jar, dependsOn: classes) { - classifier = "sources" - from sourceSets.main.allSource +java { + // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task + // if it is present. + // If you remove this line, sources will not be generated. + withSourcesJar() + + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } jar { @@ -74,10 +74,4 @@ publishing { } } } - - // select the repositories you want to publish to - repositories { - // uncomment to publish to the local maven - // mavenLocal() - } -} +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 7bb54f7..c11707e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,13 +3,13 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use - minecraft_version=1.19.3 - yarn_mappings=1.19.3+build.5 - loader_version=0.14.13 + minecraft_version=1.19.4 + yarn_mappings=1.19.4+build.2 + loader_version=0.14.19 # Mod Properties - mod_version = 1.2.6 + mod_version = 1.2.7 maven_group = net.entityoutliner archives_base_name = entity-outliner @@ -17,5 +17,5 @@ org.gradle.jvmargs=-Xmx1G # Dependencies # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api - fabric_version=0.73.0+1.19.3 - modmenu_version=5.0.2 + fabric_version=0.78.0+1.19.4 + modmenu_version=6.2.0 diff --git a/src/main/java/net/entityoutliner/ui/ColorWidget.java b/src/main/java/net/entityoutliner/ui/ColorWidget.java index 6652977..96c78e0 100644 --- a/src/main/java/net/entityoutliner/ui/ColorWidget.java +++ b/src/main/java/net/entityoutliner/ui/ColorWidget.java @@ -2,12 +2,9 @@ import java.util.Map; -import com.mojang.blaze3d.platform.GlStateManager; import com.mojang.blaze3d.systems.RenderSystem; - import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder; import net.minecraft.client.gui.widget.PressableWidget; import net.minecraft.client.util.math.MatrixStack; @@ -44,15 +41,11 @@ public void onPress() { } public void renderButton(MatrixStack matrices, int mouseX, int mouseY, float delta) { - MinecraftClient minecraftClient = MinecraftClient.getInstance(); RenderSystem.setShaderTexture(0, TEXTURE); RenderSystem.enableDepthTest(); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, this.alpha); RenderSystem.enableBlend(); - RenderSystem.defaultBlendFunc(); - RenderSystem.blendFunc(GlStateManager.SrcFactor.SRC_ALPHA, GlStateManager.DstFactor.ONE_MINUS_SRC_ALPHA); drawTexture(matrices, this.getX(), this.getY(), this.isFocused() ? 20.0F : 0.0F, this.color.ordinal() * 20, 20, 20, 40, 180); - this.renderBackground(matrices, minecraftClient, mouseX, mouseY); } public enum Color { diff --git a/src/main/java/net/entityoutliner/ui/EntityListWidget.java b/src/main/java/net/entityoutliner/ui/EntityListWidget.java index 9a8d31e..a8745fc 100644 --- a/src/main/java/net/entityoutliner/ui/EntityListWidget.java +++ b/src/main/java/net/entityoutliner/ui/EntityListWidget.java @@ -10,7 +10,6 @@ import net.fabricmc.api.Environment; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.TextRenderer; -import net.minecraft.client.gui.DrawableHelper; import net.minecraft.client.gui.Element; import net.minecraft.client.gui.Selectable; import net.minecraft.client.gui.widget.CheckboxWidget; @@ -152,7 +151,7 @@ public static EntityListWidget.HeaderEntry create(SpawnGroup category, TextRende } public void render(MatrixStack matrices, int i, int j, int k, int l, int m, int n, int o, boolean bl, float f) { - DrawableHelper.drawCenteredText(matrices, this.font, this.title, this.width / 2, j + (this.height / 2) - (this.font.fontHeight / 2), 16777215); + drawCenteredTextWithShadow(matrices, this.font, this.title, this.width / 2, j + (this.height / 2) - (this.font.fontHeight / 2), 16777215); } public List children() { diff --git a/src/main/java/net/entityoutliner/ui/EntitySelector.java b/src/main/java/net/entityoutliner/ui/EntitySelector.java index f6eb31a..b1c7ffe 100644 --- a/src/main/java/net/entityoutliner/ui/EntitySelector.java +++ b/src/main/java/net/entityoutliner/ui/EntitySelector.java @@ -247,7 +247,6 @@ public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { // Render our search bar this.setFocused(this.searchField); - this.searchField.setTextFieldFocused(true); this.searchField.render(matrices, mouseX, mouseY, delta); // Render buttons diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 04d78f5..968f083 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -33,11 +33,10 @@ ], "depends": { - "fabricloader": ">=0.7.4", - "fabric": "*", - "fabric-lifecycle-events-v1": "*", - "fabric-key-binding-api-v1": "*", - "minecraft": ">=1.19" + "fabricloader": ">=0.14.17", + "fabric-api": "*", + "minecraft": "~1.19.4", + "java": ">=17" }, "suggests": { "flamingo": "*"