Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/publish
Original file line number Diff line number Diff line change
@@ -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 }}
10 changes: 5 additions & 5 deletions ALGORITHM.MD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- 渲染:按运算结果渲染

## 算法概述
### 中心环绕型
### 中心环绕式
#### 固有转换:经度锁定
- 计算玩家视坐标到目标坐标的位向量(概念上是三维射线的意思)
- 三维变换归一化获得在“单位球壳”上的坐标点
Expand All @@ -25,16 +25,16 @@
#### 编写中心环绕型(早期代码)时的思考
在实际应用中发现水平方向存在**“面对实体后向左转91度箭头就由左边变到右边,而右边需要转271度”**的现象,常规位锁定不起效

认定为在固定的世界三维空间的表述中坐标值的正负性是实际影响投影边界的因素
认定为在固定的世界三维空间的表述中坐标值的正负性是实际影响投影边界的因素(后来才得知VMP矩阵相关的知识)

故采用视向量=>映射点坐标系,重构向量,变换(可以解释为旋转?)到视向量水平方向的坐标系

验证此变换,定义为三维前向经度锁定

> 在不断追求中学习并进步

### 目标锁定型
相较于中心环绕型,在设计目标锁定型时,查阅了更多资料,明白了很多投影知识
### 绑定定位式
相较于中心环绕型,在设计绑定定位式时,查阅了更多资料,明白了很多投影知识

该投影与FOV(视场角)一同计算,将**不会产生变换偏差**

Expand Down Expand Up @@ -74,4 +74,4 @@
- 矩阵投影的解释--AI:高中也能看得懂的数学解释(实则不然)
- 矩阵与运算--网络资源(记不住了)

感谢如此庞大的社区和丰富的、公众化的资源,让我有机会完成这样一个小型辅助模组
感谢如此庞大的社区和丰富的、公众化的资源,让我有机会完成这样一个小小的辅助模组
19 changes: 14 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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) {
Expand All @@ -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")
}
}
}
}
Expand All @@ -169,4 +178,4 @@ idea {
downloadSources = true
downloadJavadoc = true
}
}
}
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ public StaticComponent addStaticPosTickLimitedComponent(String modID, String ide
}


public @Nullable List<ControllableTrackerState> getEntityTrackingComponentFromModId(String modId) {
return entityPointers.get(modId);
public @Nullable List<SimpleComponent> getEntityTrackingComponentFromModId(String modId) {
return entityPointers.get(modId).stream().map(state -> (SimpleComponent) state).toList();
}

public @Nullable List<ControllableTrackerState> getEntityTrackingComponentFromModId(String modId, String identifyName) {
List<ControllableTrackerState> states = getEntityTrackingComponentFromModId(modId);
return states == null ? null : states.stream().filter(pointer -> pointer.getIdentifyName().equals(identifyName)).toList();
public @Nullable List<SimpleComponent> getEntityTrackingComponentFromModId(String modId, String identifyName) {
List<ControllableTrackerState> states = entityPointers.get(modId);
return states == null ? null : states.stream().filter(pointer -> pointer.getIdentifyName().equals(identifyName)).map(state -> (SimpleComponent) state).toList();
}


Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading