From 4b743790fa49c4870c3e1d2de1bce77250237a88 Mon Sep 17 00:00:00 2001 From: Sebastian Hartte Date: Sat, 11 Jan 2025 21:44:59 +0100 Subject: [PATCH] Rendering Fixes --- build.gradle | 45 +++++++++--------- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle | 10 ++-- .../java/appeng/client/gui/AEBaseScreen.java | 2 +- src/main/java/appeng/core/AppEngClient.java | 33 ++----------- .../assets/ae2/textures/guide/buttons.png | Bin 861 -> 0 bytes .../assets/ae2/textures/guide/diamond.png | Bin 255 -> 0 bytes 7 files changed, 35 insertions(+), 57 deletions(-) delete mode 100644 src/main/resources/assets/ae2/textures/guide/buttons.png delete mode 100644 src/main/resources/assets/ae2/textures/guide/diamond.png diff --git a/build.gradle b/build.gradle index 24d84861c2e..a0d79dc1b2b 100644 --- a/build.gradle +++ b/build.gradle @@ -30,6 +30,8 @@ base { archivesName = "appliedenergistics2" } +neoForge.version = project.neoforge_version + sourceSets { main { resources { @@ -61,6 +63,17 @@ dependencies { guideExportOnly("org.bytedeco:ffmpeg-platform:${ffmpeg_version}") implementation("appeng:guideme") + // Do not inherit any transitive dependencies here since we rely on those transitive dependencies being + // present in Minecrafts own dependencies already. + additionalRuntimeClasspath("io.methvin:directory-watcher:${directory_watcher_version}") { + transitive = false + } + additionalRuntimeClasspath("org.yaml:snakeyaml:${snakeyaml_version}") { + transitive = false + } + additionalRuntimeClasspath("com.google.flatbuffers:flatbuffers-java:${flatbuffers_version}") { + transitive = false + } // compile against provided APIs compileOnly "dev.emi:emi-neoforge:${emi_version}:api" @@ -145,7 +158,7 @@ test { useJUnitPlatform() // Might not need this anymore... - systemProperty "guideDev.ae2guide.sources", file("guidebook").absolutePath + systemProperty "guideDev.ae2.guide.sources", file("guidebook").absolutePath } dependencies { @@ -162,8 +175,6 @@ Map commonSystemProperties = [ ] neoForge { - version = project.neoforge_version - mods { ae2 { sourceSet sourceSets.main @@ -175,31 +186,24 @@ neoForge { gameDirectory = project.file('run') systemProperties = commonSystemProperties // property "mixin.debug.export", "true" + logLevel = org.slf4j.event.Level.DEBUG + systemProperties.put("guideDev.ae2.guide.sources", file("guidebook").absolutePath) } client { client() - systemProperties = [ - * : commonSystemProperties, - "appeng.tests" : "true", - "guideDev.ae2guide.sources": file("guidebook").absolutePath, - ] + systemProperties.put("appeng.tests", "true") } gametestWorld { client() programArguments = [ "--username", "AE2Dev", "--quickPlaySingleplayer", "GametestWorld" ] - systemProperties = [ - "appeng.tests" : "true", - "guideDev.ae2guide.sources": file("guidebook").absolutePath, - ] + systemProperties.put("appeng.tests", "true") } guide { client() - systemProperties = [ - "guideDev.ae2guide.sources" : file("guidebook").absolutePath, - "guideDev.ae2guide.startupPage": "ae2:index.md" - ] + + systemProperties.put("guideDev.ae2.guide.startupPage", "ae2:index.md") } server { server() @@ -215,12 +219,9 @@ neoForge { } guideexport { client() - systemProperties = [ - "appeng.runGuideExportAndExit": "true", - "appeng.guideExportFolder" : file("$buildDir/guide").absolutePath, - "guideDev.ae2guide.sources" : file("guidebook").absolutePath, - "appeng.version" : project.version - ] + systemProperties.put("guideDev.ae2.guide.export.runAndExit", "true") + systemProperties.put("guideDev.ae2.guide.export.destination", file("build/guide").absolutePath) + systemProperties.put("guideDev.ae2.guide.export.version", project.version) } // Use to run the tests gametest { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2617362fd0b..18362b78bde 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle b/settings.gradle index 90972135a50..e3469d1ed90 100644 --- a/settings.gradle +++ b/settings.gradle @@ -22,7 +22,7 @@ dependencyResolutionManagement { rulesMode = RulesMode.FAIL_ON_PROJECT_RULES repositories { maven { - url "https://maven.shedaniel.me/" + url = "https://maven.shedaniel.me/" content { includeGroup "me.shedaniel" includeGroup "me.shedaniel.cloth" @@ -30,7 +30,7 @@ dependencyResolutionManagement { } } maven { - url "https://maven2.bai.lol" + url = "https://maven2.bai.lol" content { includeGroup "mcp.mobius.waila" includeGroup "lol.bai" @@ -44,14 +44,14 @@ dependencyResolutionManagement { } } maven { - name 'cursemaven' - url "https://www.cursemaven.com" + name = 'cursemaven' + url = "https://www.cursemaven.com" content { includeGroup "curse.maven" } } maven { // for TOP - url "https://maven.k-4u.nl/" + url = "https://maven.k-4u.nl/" content { includeGroup "mcjty.theoneprobe" } diff --git a/src/main/java/appeng/client/gui/AEBaseScreen.java b/src/main/java/appeng/client/gui/AEBaseScreen.java index 4ee89fb492d..154f1ed9614 100644 --- a/src/main/java/appeng/client/gui/AEBaseScreen.java +++ b/src/main/java/appeng/client/gui/AEBaseScreen.java @@ -27,6 +27,7 @@ import java.util.Set; import java.util.concurrent.TimeUnit; +import appeng.client.gui.style.BackgroundGenerator; import com.google.common.base.Stopwatch; import com.mojang.blaze3d.platform.InputConstants; @@ -63,7 +64,6 @@ import guideme.guidebook.indices.ItemIndex; import guideme.guidebook.style.ResolvedTextStyle; import guideme.guidebook.style.TextStyle; -import guideme.util.BackgroundGenerator; import appeng.api.behaviors.ContainerItemStrategies; import appeng.api.behaviors.EmptyingAction; diff --git a/src/main/java/appeng/core/AppEngClient.java b/src/main/java/appeng/core/AppEngClient.java index 09618a0918b..7ea42423bf5 100644 --- a/src/main/java/appeng/core/AppEngClient.java +++ b/src/main/java/appeng/core/AppEngClient.java @@ -67,6 +67,7 @@ import net.neoforged.neoforge.event.server.ServerStartingEvent; import net.neoforged.neoforge.network.PacketDistributor; +import guideme.GuideME; import guideme.guidebook.Guide; import guideme.guidebook.PageAnchor; import guideme.guidebook.command.GuidebookStructureCommands; @@ -74,8 +75,6 @@ import guideme.guidebook.compiler.tags.RecipeTypeMappingSupplier; import guideme.guidebook.hotkey.OpenGuideHotkey; import guideme.guidebook.scene.ImplicitAnnotationStrategy; -import guideme.guidebook.screen.GlobalInMemoryHistory; -import guideme.guidebook.screen.GuideScreen; import appeng.api.parts.CableRenderMode; import appeng.blockentity.networking.CableBusTESR; @@ -184,7 +183,6 @@ public AppEngClient(IEventBus modEventBus, ModContainer container) { BlockAttackHook.install(); RenderBlockOutlineHook.install(); guide = createGuide(modEventBus); - OpenGuideHotkey.init(); NeoForge.EVENT_BUS.addListener(EventPriority.LOWEST, (ClientTickEvent.Pre e) -> { updateCableRenderMode(); @@ -234,7 +232,8 @@ private void registerClientCommands() { } private Guide createGuide(IEventBus modEventBus) { - var guide = Guide.builder(modEventBus, MOD_ID, "ae2guide") + var guide = Guide.builder(modEventBus, AppEng.makeId("guide")) + .folder("ae2guide") .extension(ImplicitAnnotationStrategy.EXTENSION_POINT, new PartAnnotationStrategy()) .extension(TagCompiler.EXTENSION_POINT, new ConfigValueTagExtension()) .extension(RecipeTypeMappingSupplier.EXTENSION_POINT, mappings -> { @@ -513,34 +512,12 @@ public CableRenderMode getCableRenderMode() { @Override public void openGuideAtPreviousPage(ResourceLocation initialPage) { - try { - var screen = GuideScreen.openAtPreviousPage(guide, PageAnchor.page(initialPage), - GlobalInMemoryHistory.INSTANCE); - - openGuideScreen(screen); - } catch (Exception e) { - LOG.error("Failed to open guide.", e); - } + GuideME.openGuideAtPreviousPage(guide, initialPage); } @Override public void openGuideAtAnchor(PageAnchor anchor) { - try { - var screen = GuideScreen.openNew(guide, anchor, GlobalInMemoryHistory.INSTANCE); - - openGuideScreen(screen); - } catch (Exception e) { - LOG.error("Failed to open guide at {}.", anchor, e); - } - } - - private static void openGuideScreen(GuideScreen screen) { - var minecraft = Minecraft.getInstance(); - if (minecraft.screen != null) { - screen.setReturnToOnClose(minecraft.screen); - } - - minecraft.setScreen(screen); + GuideME.openGuideAtAnchor(guide, anchor); } public Guide getGuide() { diff --git a/src/main/resources/assets/ae2/textures/guide/buttons.png b/src/main/resources/assets/ae2/textures/guide/buttons.png deleted file mode 100644 index a5808a56f119aa37ea8745fd1c88bec12d823100..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 861 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=oCO|{#S9GG!XV7ZFl&wk0|PU^ zr;B4q#hkZMhJB9>c$Vzw?Cqr^77~ws%pvwep6a+F8R~ zcU=}0XWim+s%TQIQXiYZq!TKxeX5ZuYxaEqaOQ{N+XfRZ#!Gx2k6Hh(czyP1_3d|i z411-F6Yj?^jQi_(>d3Y=cQIld4hE-Mvk01BqpDX$rI7_X}-f4}r!kB8&I zxko!iC8zX#`{f)}r7d{Q^1-`jp&#zW-+KOhdHmXYHvg9V+Q7GTf7D*y6sLMG`x_FO zYx4T)bnI8KXRH7&2q5Kb) zS;a}MWLS6NPsHB|Y>)RfEkC`%=pr5>pvZRC8^(nZUuqYnAzV zSLlDa9i0u940l<|?$0n~w5<5GxB%>z4Jwd-Y3skxa`9zjv&y z>&u`2zNp+#<@j=%_*6NjkINd$fA0vCe!SRxlbk?!F_X$FtN7j^fr(`fQmqV`>`MYU eCJ@8?&yeo*x{h1xZv-&EFnGH9xvXEamT(Rp_AY0e`CJTAvi$Au=ox}g>1zOGSZVpmARHvyJI+M0$pPM$k?LjD==Vu+sW3!;l(H8DR8lttt#_wS>$$G-N=t#886p%tk@!Pp?p*I zVWACABDw52UB0YZt$F3W%lCip#eFWT+st`eYRsU}{iBF8_sLn+FCOj}cC$@OWvjWg zOrJyMN%~S=?~G3Oi|uT4M7m~{U$wq1