diff --git a/.github/workflows/publish b/.github/workflows/publish new file mode 100644 index 0000000..5fb06ce --- /dev/null +++ b/.github/workflows/publish @@ -0,0 +1,37 @@ +name: Publish Release + +on: + workflow_dispatch: + release: + types: + - published + +permissions: + contents: write + +jobs: + Build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + distribution: 'adopt' + java-version: 21 + - name: Cache + uses: actions/cache@v4 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + .gradle + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'build.gradle') }} + - uses: gradle/actions/wrapper-validation@v3 + - run: | + chmod +x gradlew + ./gradlew build publish + env: + MAGIC_TEAM_USERNAME: ${{ secrets.MAGIC_TEAM_USERNAME }} + MAGIC_TEAM_TOKEN: ${{ secrets.MAGIC_TEAM_TOKEN }} diff --git a/ALGORITHM.MD b/ALGORITHM.MD index fa31680..bef0fa5 100644 --- a/ALGORITHM.MD +++ b/ALGORITHM.MD @@ -8,7 +8,7 @@ - 渲染:按运算结果渲染 ## 算法概述 -### 中心环绕型 +### 中心环绕式 #### 固有转换:经度锁定 - 计算玩家视坐标到目标坐标的位向量(概念上是三维射线的意思) - 三维变换归一化获得在“单位球壳”上的坐标点 @@ -25,7 +25,7 @@ #### 编写中心环绕型(早期代码)时的思考 在实际应用中发现水平方向存在**“面对实体后向左转91度箭头就由左边变到右边,而右边需要转271度”**的现象,常规位锁定不起效 -认定为在固定的世界三维空间的表述中坐标值的正负性是实际影响投影边界的因素 +认定为在固定的世界三维空间的表述中坐标值的正负性是实际影响投影边界的因素(后来才得知VMP矩阵相关的知识) 故采用视向量=>映射点坐标系,重构向量,变换(可以解释为旋转?)到视向量水平方向的坐标系 @@ -33,8 +33,8 @@ > 在不断追求中学习并进步 -### 目标锁定型 -相较于中心环绕型,在设计目标锁定型时,查阅了更多资料,明白了很多投影知识 +### 绑定定位式 +相较于中心环绕型,在设计绑定定位式时,查阅了更多资料,明白了很多投影知识 该投影与FOV(视场角)一同计算,将**不会产生变换偏差** @@ -74,4 +74,4 @@ - 矩阵投影的解释--AI:高中也能看得懂的数学解释(实则不然) - 矩阵与运算--网络资源(记不住了) -感谢如此庞大的社区和丰富的、公众化的资源,让我有机会完成这样一个小型辅助模组。 \ No newline at end of file +感谢如此庞大的社区和丰富的、公众化的资源,让我有机会完成这样一个小小的辅助模组。 \ No newline at end of file diff --git a/build.gradle b/build.gradle index bf75022..f89a747 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ plugins { id 'java-library' id 'maven-publish' id 'idea' - id 'net.neoforged.moddev' version '2.0.88' + id 'net.neoforged.moddev' version '2.0.140' } version = mod_version @@ -130,7 +130,6 @@ tasks.withType(ProcessResources).configureEach { var replaceProperties = [minecraft_version : minecraft_version, minecraft_version_range: minecraft_version_range, neo_version : neo_version, - neo_version_range : neo_version_range, loader_version_range : loader_version_range, mod_id : mod_id, mod_name : mod_name, @@ -145,7 +144,12 @@ tasks.withType(ProcessResources).configureEach { } } -// Example configuration to allow publishing using the maven-publish plugin +java.withSourcesJar() + +ext { + releasesUrl = "https://maven.confluence.ink/releases" + snapshotsUrl = "https://maven.confluence.ink/snapshots" +} publishing { publications { register('mavenJava', MavenPublication) { @@ -154,7 +158,12 @@ publishing { } repositories { maven { - url "file://${project.projectDir}/repo" + name = "Confluence" + url = version.toString().endsWith("SNAPSHOT") ? snapshotsUrl : releasesUrl + credentials { + username = System.getenv("MAGIC_TEAM_USERNAME") + password = System.getenv("MAGIC_TEAM_TOKEN") + } } } } @@ -169,4 +178,4 @@ idea { downloadSources = true downloadJavadoc = true } -} \ No newline at end of file +} diff --git a/gradle.properties b/gradle.properties index 25f76cc..1231661 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,8 +9,7 @@ parchment_mappings_version=2024.11.13 minecraft_version=1.21.1 minecraft_version_range=[1.21.1, 1.22) -neo_version=21.1.218 -neo_version_range=[21.1.0,) +neo_version=21.1.219 loader_version_range=[4,) mod_id=the_trackers diff --git a/src/main/java/nowebsite/makertechno/the_trackers/core/track/WorldSingletonTracker.java b/src/main/java/nowebsite/makertechno/the_trackers/core/track/WorldSingletonTracker.java index aae202f..7a3ae67 100644 --- a/src/main/java/nowebsite/makertechno/the_trackers/core/track/WorldSingletonTracker.java +++ b/src/main/java/nowebsite/makertechno/the_trackers/core/track/WorldSingletonTracker.java @@ -151,13 +151,13 @@ public StaticComponent addStaticPosTickLimitedComponent(String modID, String ide } - public @Nullable List getEntityTrackingComponentFromModId(String modId) { - return entityPointers.get(modId); + public @Nullable List getEntityTrackingComponentFromModId(String modId) { + return entityPointers.get(modId).stream().map(state -> (SimpleComponent) state).toList(); } - public @Nullable List getEntityTrackingComponentFromModId(String modId, String identifyName) { - List states = getEntityTrackingComponentFromModId(modId); - return states == null ? null : states.stream().filter(pointer -> pointer.getIdentifyName().equals(identifyName)).toList(); + public @Nullable List getEntityTrackingComponentFromModId(String modId, String identifyName) { + List states = entityPointers.get(modId); + return states == null ? null : states.stream().filter(pointer -> pointer.getIdentifyName().equals(identifyName)).map(state -> (SimpleComponent) state).toList(); } diff --git a/src/main/resources/META-INF/neoforge.mods.toml b/src/main/resources/META-INF/neoforge.mods.toml index 1256c9b..b2f47d5 100644 --- a/src/main/resources/META-INF/neoforge.mods.toml +++ b/src/main/resources/META-INF/neoforge.mods.toml @@ -71,7 +71,7 @@ ${mod_description} # Optional field describing why the dependency is required or why it is incompatible # reason="..." # The version range of the dependency - versionRange="${neo_version_range}" #mandatory + versionRange="[${neo_version},)" #mandatory # An ordering relationship for the dependency. # BEFORE - This mod is loaded BEFORE the dependency # AFTER - This mod is loaded AFTER the dependency diff --git a/src/main/resources/assets/the_trackers/textures/icons/normal_red.png b/src/main/resources/assets/the_trackers/textures/icons/normal_red.png new file mode 100644 index 0000000..3dce758 Binary files /dev/null and b/src/main/resources/assets/the_trackers/textures/icons/normal_red.png differ