Skip to content

Commit

Permalink
Rendering Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shartte committed Jan 11, 2025
1 parent f1c9e1c commit 4b74379
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 57 deletions.
45 changes: 23 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ base {
archivesName = "appliedenergistics2"
}

neoForge.version = project.neoforge_version

sourceSets {
main {
resources {
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand All @@ -162,8 +175,6 @@ Map<String, String> commonSystemProperties = [
]

neoForge {
version = project.neoforge_version

mods {
ae2 {
sourceSet sourceSets.main
Expand All @@ -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()
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ 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"
includeGroup "dev.architectury"
}
}
maven {
url "https://maven2.bai.lol"
url = "https://maven2.bai.lol"
content {
includeGroup "mcp.mobius.waila"
includeGroup "lol.bai"
Expand All @@ -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"
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/appeng/client/gui/AEBaseScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
33 changes: 5 additions & 28 deletions src/main/java/appeng/core/AppEngClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,14 @@
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;
import guideme.guidebook.compiler.TagCompiler;
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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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 -> {
Expand Down Expand Up @@ -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() {
Expand Down
Binary file not shown.
Binary file not shown.

0 comments on commit 4b74379

Please sign in to comment.