diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb031d5..fcb8806 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,34 +10,32 @@ jobs: steps: - name: checkout repository uses: actions/checkout@v2 - - name: setup jdk 17 - uses: actions/setup-java@v1 + - name: setup jdk 21 + uses: actions/setup-java@v4 with: - java-version: 17 + distribution: temurin + java-version: 21 # to cache gradle files - name: Setup Gradle - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 with: - cache-read-only: false gradle-home-cache-cleanup: true - - name: make gradle wrapper executable - if: ${{ runner.os != 'Windows' }} - run: chmod +x ./gradlecw + dependency-graph: generate-and-submit +# Already needs to be executable, so the dirty check is correct +# - name: make gradle wrapper executable +# if: ${{ runner.os != 'Windows' }} +# run: chmod +x ./gradlecw - name: build run: ./gradlecw build - name: capture build artifacts uses: actions/upload-artifact@v2 with: name: Artifacts - path: | - EntityCulling-Fabric/build/libs/* - EntityCulling-Forge/build/libs/* - EntityCulling-Neo/build/libs/* - EntityCulling-Versionless/build/libs/* - - name: Test Report - uses: dorny/test-reporter@v1 - if: success() || failure() - with: - name: JUnit Tests - path: '**/build/test-results/test/TEST-*.xml' - reporter: java-junit \ No newline at end of file + path: 'versions/**/build/libs/*.jar' +# - name: Test Report +# uses: dorny/test-reporter@v1 +# if: success() || failure() +# with: +# name: JUnit Tests +# path: '**/build/test-results/test/TEST-*.xml' +# reporter: java-junit \ No newline at end of file diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 8037700..05b4623 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -8,10 +8,10 @@ jobs: steps: - name: checkout repository uses: actions/checkout@v2 - - name: setup jdk 17 + - name: setup jdk 21 uses: actions/setup-java@v1 with: - java-version: 17 + java-version: 21 - name: make gradle wrapper executable run: chmod +x ./gradlecw - name: build @@ -19,57 +19,22 @@ jobs: - name: Release uses: softprops/action-gh-release@v1 with: - files: | - EntityCulling-Fabric/build/libs/* - EntityCulling-Forge/build/libs/* - EntityCulling-Neo/build/libs/* - EntityCulling-Versionless/build/libs/* - - name: Publish-Neo-Curseforge + files: 'versions/**/build/libs/!(*-@(dev|sources|javadoc|all)).jar' + - name: Publish-1.20.5-fabric-Curseforge uses: Kir-Antipov/mc-publish@v3.3.0 with: curseforge-id: 448233 - curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} - loaders: neoforge - name: ${{github.ref_name}} - NeoForge - version-type: beta - files: '*Neo/build/libs/!(*-@(dev|sources|javadoc|all)).jar' - game-versions: 1.20.4 - - name: Publish-Neo-Modrinth - uses: Kir-Antipov/mc-publish@v3.3.0 - with: - modrinth-id: NNAgCjsB - modrinth-token: ${{ secrets.MODRINTH_TOKEN }} - loaders: neoforge - name: ${{github.ref_name}} - NeoForge - files: '*Neo/build/libs/!(*-@(dev|sources|javadoc|all)).jar' - game-versions: 1.20.4 - - name: Publish-Forge-Curseforge - uses: Kir-Antipov/mc-publish@v3.3.0 - with: - curseforge-id: 448233 - curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} - loaders: forge - name: ${{github.ref_name}} - Forge - version-type: beta - files: '*Forge/build/libs/!(*-@(dev|sources|javadoc|all)).jar' - game-versions: 1.20.4 - - name: Publish-Forge-Modrinth - uses: Kir-Antipov/mc-publish@v3.3.0 - with: - modrinth-id: NNAgCjsB - modrinth-token: ${{ secrets.MODRINTH_TOKEN }} - loaders: forge - name: ${{github.ref_name}} - Forge - files: '*Forge/build/libs/!(*-@(dev|sources|javadoc|all)).jar' - game-versions: 1.20.4 - - name: Publish-Fabric + curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} + loaders: fabric + name: ${{github.ref_name}}-1.20.5 - Fabric + files: 'versions/1.20.5-fabric/build/libs/!(*-@(dev|sources|javadoc|all)).jar' + game-versions: 1.20.5 + - name: Publish-1.20.5-fabric-Modrinth uses: Kir-Antipov/mc-publish@v3.3.0 with: modrinth-id: NNAgCjsB modrinth-token: ${{ secrets.MODRINTH_TOKEN }} - curseforge-id: 448233 - curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} loaders: fabric - name: ${{github.ref_name}} - Fabric - files: '*Fabric/build/libs/!(*-@(dev|sources|javadoc|all)).jar' - game-versions: 1.20.4 + name: ${{github.ref_name}}-1.20.5 - Fabric + files: 'versions/1.20.5-fabric/build/libs/!(*-@(dev|sources|javadoc|all)).jar' + game-versions: 1.20.5 diff --git a/.gitignore b/.gitignore index dfa27ff..ab0ad04 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,11 @@ gradle/wrapper VersionShared UtilityCode formatter.xml +src/main/fabric-resources/fabric.mod.json +src/main/forge-resources/META-INF/mods.toml +src/main/neoforge-resources/META-INF/mods.toml +**/src/main/java/dev/tr7zw/config/CustomConfigScreen.java +**/src/main/java/dev/tr7zw/util/ComponentProvider.java +src/main/resources/pack.mcmeta +src/main/java/dev/tr7zw/util/ModLoaderUtil.java +src/main/java/dev/tr7zw/util/NMSHelper.java diff --git a/EntityCulling-Fabric/src/main/resources/fabric.mod.json b/EntityCulling-Fabric/src/main/resources/fabric.mod.json deleted file mode 100644 index f70257b..0000000 --- a/EntityCulling-Fabric/src/main/resources/fabric.mod.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "schemaVersion": 1, - "id": "${mod_id}", - "version": "${version}", - "name": "${mod_name}", - "description": "${description}", - "authors": [ - "${mod_author}" - ], - "contact": { - "homepage": "${homepage_url}", - "sources": "${sources_url}", - "issues": "${issues_url}" - }, - "license": "${license_name}", - "icon": "assets/${mod_id}/icon.png", - "environment": "CLIENT", - "entrypoints": { - "client": [ - "dev.tr7zw.entityculling.EntityCullingMod" - ] - }, - "mixins": [ - "${mod_id}.mixins.json" - ], - "depends": { - "minecraft": "${minecraft_version_range_fabric}" - } -} diff --git a/gradle-compose.yml b/gradle-compose.yml index 7db3773..9719e84 100644 --- a/gradle-compose.yml +++ b/gradle-compose.yml @@ -1,5 +1,5 @@ version: '0.0.2' -source: "https://github.com/tr7zw/ModComposeTemplate/tree/1.20.4" +source: "https://github.com/tr7zw/ProcessedModTemplate/tree/master" replacements: name: "EntityCulling" id: "entityculling" @@ -8,15 +8,16 @@ replacements: homepageUrl: "https://modrinth.com/mod/entityculling" sourcesUrl: "https://github.com/tr7zw/EntityCulling" issuesUrl: "https://github.com/tr7zw/EntityCulling/issues" + fabric_entrypoint: "dev.tr7zw.entityculling.EntityCullingMod" + fabric_modmenu_entrypoint: "none" relocationpackage: "dev.tr7zw.entityculling" dependencies: ' inc "com.logisticscraft:occlusionculling:0.0.8-SNAPSHOT" - - inc project(":EntityCulling-Versionless") ' licensename: "LICENSE-EntityCulling" modrinthid: NNAgCjsB curseforgeid: 448233 + versionlessname: "EntityCulling-Versionless" enabledFlags: - autopublish - publishFabric @@ -24,35 +25,10 @@ enabledFlags: - publishNeo - modrinth - curseforge + - versionless rootProject: template: "." subProjects: - EntityCulling-Fabric: - template: "Fabric" - EntityCulling-Forge: - template: "Forge" - replacements: - dependencies: ' - inc "com.logisticscraft:occlusionculling:0.0.8-SNAPSHOT" - - forgeRuntimeLibrary "com.logisticscraft:occlusionculling:0.0.8-SNAPSHOT" - - inc project(":EntityCulling-Versionless") - - forgeRuntimeLibrary project(":EntityCulling-Versionless") - ' - EntityCulling-Neo: - template: "Neo" - replacements: - dependencies: ' - inc "com.logisticscraft:occlusionculling:0.0.8-SNAPSHOT" - - forgeRuntimeLibrary "com.logisticscraft:occlusionculling:0.0.8-SNAPSHOT" - - inc project(":EntityCulling-Versionless") - - forgeRuntimeLibrary project(":EntityCulling-Versionless") - ' EntityCulling-Versionless: template: "Versionless" replacements: diff --git a/gradle/gradle-compose.jar b/gradle/gradle-compose.jar index 8242f8a..4f20b77 100644 Binary files a/gradle/gradle-compose.jar and b/gradle/gradle-compose.jar differ diff --git a/settings.json b/settings.json new file mode 100644 index 0000000..eba69c7 --- /dev/null +++ b/settings.json @@ -0,0 +1,5 @@ +{ + "versions": [ + "1.20.5-fabric" + ] +} diff --git a/Shared/src/main/java/dev/tr7zw/entityculling/CullTask.java b/src/main/java/dev/tr7zw/entityculling/CullTask.java similarity index 100% rename from Shared/src/main/java/dev/tr7zw/entityculling/CullTask.java rename to src/main/java/dev/tr7zw/entityculling/CullTask.java diff --git a/EntityCulling-Fabric/src/main/java/dev/tr7zw/entityculling/EntityCullingMod.java b/src/main/java/dev/tr7zw/entityculling/EntityCullingMod.java similarity index 100% rename from EntityCulling-Fabric/src/main/java/dev/tr7zw/entityculling/EntityCullingMod.java rename to src/main/java/dev/tr7zw/entityculling/EntityCullingMod.java diff --git a/Shared/src/main/java/dev/tr7zw/entityculling/EntityCullingModBase.java b/src/main/java/dev/tr7zw/entityculling/EntityCullingModBase.java similarity index 100% rename from Shared/src/main/java/dev/tr7zw/entityculling/EntityCullingModBase.java rename to src/main/java/dev/tr7zw/entityculling/EntityCullingModBase.java diff --git a/Shared/src/main/java/dev/tr7zw/entityculling/Provider.java b/src/main/java/dev/tr7zw/entityculling/Provider.java similarity index 100% rename from Shared/src/main/java/dev/tr7zw/entityculling/Provider.java rename to src/main/java/dev/tr7zw/entityculling/Provider.java diff --git a/Shared/src/main/java/dev/tr7zw/entityculling/access/EntityRendererInter.java b/src/main/java/dev/tr7zw/entityculling/access/EntityRendererInter.java similarity index 93% rename from Shared/src/main/java/dev/tr7zw/entityculling/access/EntityRendererInter.java rename to src/main/java/dev/tr7zw/entityculling/access/EntityRendererInter.java index d9319be..f5a0bcf 100644 --- a/Shared/src/main/java/dev/tr7zw/entityculling/access/EntityRendererInter.java +++ b/src/main/java/dev/tr7zw/entityculling/access/EntityRendererInter.java @@ -11,6 +11,6 @@ public interface EntityRendererInter { boolean shadowShouldShowName(T entity); void shadowRenderNameTag(T entity, Component component, PoseStack poseStack, MultiBufferSource multiBufferSource, - int light); + int light, float f); } \ No newline at end of file diff --git a/Shared/src/main/java/dev/tr7zw/entityculling/mixin/BlockEntityRenderDispatcherMixin.java b/src/main/java/dev/tr7zw/entityculling/mixin/BlockEntityRenderDispatcherMixin.java similarity index 100% rename from Shared/src/main/java/dev/tr7zw/entityculling/mixin/BlockEntityRenderDispatcherMixin.java rename to src/main/java/dev/tr7zw/entityculling/mixin/BlockEntityRenderDispatcherMixin.java diff --git a/Shared/src/main/java/dev/tr7zw/entityculling/mixin/ClientWorldMixin.java b/src/main/java/dev/tr7zw/entityculling/mixin/ClientWorldMixin.java similarity index 100% rename from Shared/src/main/java/dev/tr7zw/entityculling/mixin/ClientWorldMixin.java rename to src/main/java/dev/tr7zw/entityculling/mixin/ClientWorldMixin.java diff --git a/Shared/src/main/java/dev/tr7zw/entityculling/mixin/CullableMixin.java b/src/main/java/dev/tr7zw/entityculling/mixin/CullableMixin.java similarity index 100% rename from Shared/src/main/java/dev/tr7zw/entityculling/mixin/CullableMixin.java rename to src/main/java/dev/tr7zw/entityculling/mixin/CullableMixin.java diff --git a/Shared/src/main/java/dev/tr7zw/entityculling/mixin/DebugHudMixin.java b/src/main/java/dev/tr7zw/entityculling/mixin/DebugHudMixin.java similarity index 100% rename from Shared/src/main/java/dev/tr7zw/entityculling/mixin/DebugHudMixin.java rename to src/main/java/dev/tr7zw/entityculling/mixin/DebugHudMixin.java diff --git a/Shared/src/main/java/dev/tr7zw/entityculling/mixin/EntityRendererMixin.java b/src/main/java/dev/tr7zw/entityculling/mixin/EntityRendererMixin.java similarity index 86% rename from Shared/src/main/java/dev/tr7zw/entityculling/mixin/EntityRendererMixin.java rename to src/main/java/dev/tr7zw/entityculling/mixin/EntityRendererMixin.java index 058c097..4387a9a 100644 --- a/Shared/src/main/java/dev/tr7zw/entityculling/mixin/EntityRendererMixin.java +++ b/src/main/java/dev/tr7zw/entityculling/mixin/EntityRendererMixin.java @@ -21,8 +21,8 @@ public boolean shadowShouldShowName(T entity) { @Override public void shadowRenderNameTag(T entity, Component component, PoseStack poseStack, - MultiBufferSource multiBufferSource, int light) { - renderNameTag(entity, component, poseStack, multiBufferSource, light); + MultiBufferSource multiBufferSource, int light, float f) { + renderNameTag(entity, component, poseStack, multiBufferSource, light, f); } @Shadow @@ -30,6 +30,6 @@ public void shadowRenderNameTag(T entity, Component component, PoseStack poseSta @Shadow public abstract void renderNameTag(T entity, Component component, PoseStack poseStack, - MultiBufferSource multiBufferSource, int i); + MultiBufferSource multiBufferSource, int i, float f); } diff --git a/Shared/src/main/java/dev/tr7zw/entityculling/mixin/WorldRendererMixin.java b/src/main/java/dev/tr7zw/entityculling/mixin/WorldRendererMixin.java similarity index 98% rename from Shared/src/main/java/dev/tr7zw/entityculling/mixin/WorldRendererMixin.java rename to src/main/java/dev/tr7zw/entityculling/mixin/WorldRendererMixin.java index 3029603..0598e89 100644 --- a/Shared/src/main/java/dev/tr7zw/entityculling/mixin/WorldRendererMixin.java +++ b/src/main/java/dev/tr7zw/entityculling/mixin/WorldRendererMixin.java @@ -49,7 +49,7 @@ private void renderEntity(Entity entity, double cameraX, double cameraY, double matrices.pushPose(); matrices.translate(d, e, f); entityRendererInter.shadowRenderNameTag(entity, entity.getDisplayName(), matrices, vertexConsumers, - this.entityRenderDispatcher.getPackedLightCoords(entity, tickDelta)); + this.entityRenderDispatcher.getPackedLightCoords(entity, tickDelta), tickDelta); matrices.popPose(); } EntityCullingModBase.instance.skippedEntities++; diff --git a/Shared/src/main/resources/assets/entityculling/lang/en_us.json b/src/main/resources/assets/entityculling/lang/en_us.json similarity index 100% rename from Shared/src/main/resources/assets/entityculling/lang/en_us.json rename to src/main/resources/assets/entityculling/lang/en_us.json diff --git a/Shared/src/main/resources/assets/entityculling/lang/fr_fr.json b/src/main/resources/assets/entityculling/lang/fr_fr.json similarity index 100% rename from Shared/src/main/resources/assets/entityculling/lang/fr_fr.json rename to src/main/resources/assets/entityculling/lang/fr_fr.json diff --git a/Shared/src/main/resources/assets/entityculling/lang/it_it.json b/src/main/resources/assets/entityculling/lang/it_it.json similarity index 100% rename from Shared/src/main/resources/assets/entityculling/lang/it_it.json rename to src/main/resources/assets/entityculling/lang/it_it.json diff --git a/Shared/src/main/resources/assets/entityculling/lang/pt_br.json b/src/main/resources/assets/entityculling/lang/pt_br.json similarity index 100% rename from Shared/src/main/resources/assets/entityculling/lang/pt_br.json rename to src/main/resources/assets/entityculling/lang/pt_br.json diff --git a/Shared/src/main/resources/assets/entityculling/lang/ru_ru.json b/src/main/resources/assets/entityculling/lang/ru_ru.json similarity index 100% rename from Shared/src/main/resources/assets/entityculling/lang/ru_ru.json rename to src/main/resources/assets/entityculling/lang/ru_ru.json diff --git a/Shared/src/main/resources/assets/entityculling/lang/uk_ua.json b/src/main/resources/assets/entityculling/lang/uk_ua.json similarity index 100% rename from Shared/src/main/resources/assets/entityculling/lang/uk_ua.json rename to src/main/resources/assets/entityculling/lang/uk_ua.json diff --git a/Shared/src/main/resources/assets/entityculling/lang/vi_vn.json b/src/main/resources/assets/entityculling/lang/vi_vn.json similarity index 100% rename from Shared/src/main/resources/assets/entityculling/lang/vi_vn.json rename to src/main/resources/assets/entityculling/lang/vi_vn.json diff --git a/Shared/src/main/resources/assets/entityculling/lang/zh_tw.json b/src/main/resources/assets/entityculling/lang/zh_tw.json similarity index 96% rename from Shared/src/main/resources/assets/entityculling/lang/zh_tw.json rename to src/main/resources/assets/entityculling/lang/zh_tw.json index e797f3f..1e68e4e 100644 --- a/Shared/src/main/resources/assets/entityculling/lang/zh_tw.json +++ b/src/main/resources/assets/entityculling/lang/zh_tw.json @@ -1,4 +1,4 @@ -{ - "text.entityculling.title": "EntityCulling", - "key.entityculling.toggle": "開關剔除除錯" -} +{ + "text.entityculling.title": "EntityCulling", + "key.entityculling.toggle": "開關剔除除錯" +} diff --git a/Shared/src/main/resources/entityculling.mixins.json b/src/main/resources/entityculling.mixins.json similarity index 100% rename from Shared/src/main/resources/entityculling.mixins.json rename to src/main/resources/entityculling.mixins.json diff --git a/Shared/src/main/resources/assets/entityculling/icon.png b/src/main/resources/icon.png similarity index 100% rename from Shared/src/main/resources/assets/entityculling/icon.png rename to src/main/resources/icon.png diff --git a/EntityCulling-Fabric/src/test/java/dev/tr7zw/tests/MixinTests.java b/src/test/java/dev/tr7zw/tests/MixinTests.java similarity index 100% rename from EntityCulling-Fabric/src/test/java/dev/tr7zw/tests/MixinTests.java rename to src/test/java/dev/tr7zw/tests/MixinTests.java diff --git a/versions/mainProject b/versions/mainProject new file mode 100644 index 0000000..1b98e10 --- /dev/null +++ b/versions/mainProject @@ -0,0 +1 @@ +1.20.5-fabric \ No newline at end of file