From e3f58c8cb1bf8ada8bfb3fefc254407c60e1f6e9 Mon Sep 17 00:00:00 2001 From: tr7zw Date: Sat, 25 May 2024 21:55:48 +0200 Subject: [PATCH] Backport current build to 1.20.4-1.20.1 --- .github/workflows/tag.yml | 149 ++++++++++++++++++ settings.json | 8 + .../tr7zw/entityculling/EntityCullingMod.java | 13 +- .../mixin/EntityRendererMixin.java | 18 ++- 4 files changed, 182 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 3e71aa6..9c0d01b 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -20,6 +20,155 @@ jobs: uses: softprops/action-gh-release@v1 with: files: 'versions/**/build/libs/!(*-@(dev|sources|javadoc|all)).jar' + - name: Publish-1.20.1-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}}-1.20.1 - Forge + version-type: beta + files: 'versions/1.20.1-forge/build/libs/!(*-@(dev|sources|javadoc|all)).jar' + game-versions: 1.20.1 + - name: Publish-1.20.1-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}}-1.20.1 - Forge + files: 'versions/1.20.1-forge/build/libs/!(*-@(dev|sources|javadoc|all)).jar' + game-versions: 1.20.1 + - name: Publish-1.20.1-fabric-Curseforge + uses: Kir-Antipov/mc-publish@v3.3.0 + with: + curseforge-id: 448233 + curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} + loaders: fabric + name: ${{github.ref_name}}-1.20.1 - Fabric + files: 'versions/1.20.1-fabric/build/libs/!(*-@(dev|sources|javadoc|all)).jar' + game-versions: 1.20.1 + - name: Publish-1.20.1-fabric-Modrinth + uses: Kir-Antipov/mc-publish@v3.3.0 + with: + modrinth-id: NNAgCjsB + modrinth-token: ${{ secrets.MODRINTH_TOKEN }} + loaders: fabric + name: ${{github.ref_name}}-1.20.1 - Fabric + files: 'versions/1.20.1-fabric/build/libs/!(*-@(dev|sources|javadoc|all)).jar' + game-versions: 1.20.1 + - name: Publish-1.20.2-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}}-1.20.2 - Forge + version-type: beta + files: 'versions/1.20.2-forge/build/libs/!(*-@(dev|sources|javadoc|all)).jar' + game-versions: 1.20.2 + - name: Publish-1.20.2-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}}-1.20.2 - Forge + files: 'versions/1.20.2-forge/build/libs/!(*-@(dev|sources|javadoc|all)).jar' + game-versions: 1.20.2 + - name: Publish-1.20.2-neoforge-Curseforge + uses: Kir-Antipov/mc-publish@v3.3.0 + with: + curseforge-id: 448233 + curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} + loaders: neoforge + name: ${{github.ref_name}}-1.20.2 - NeoForge + version-type: beta + files: 'versions/1.20.2-neoforge/build/libs/!(*-@(dev|sources|javadoc|all)).jar' + game-versions: 1.20.2 + - name: Publish-1.20.2-neoforge-Modrinth + uses: Kir-Antipov/mc-publish@v3.3.0 + with: + modrinth-id: NNAgCjsB + modrinth-token: ${{ secrets.MODRINTH_TOKEN }} + loaders: neoforge + name: ${{github.ref_name}}-1.20.2 - NeoForge + files: 'versions/1.20.2-neoforge/build/libs/!(*-@(dev|sources|javadoc|all)).jar' + game-versions: 1.20.2 + - name: Publish-1.20.2-fabric-Curseforge + uses: Kir-Antipov/mc-publish@v3.3.0 + with: + curseforge-id: 448233 + curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} + loaders: fabric + name: ${{github.ref_name}}-1.20.2 - Fabric + files: 'versions/1.20.2-fabric/build/libs/!(*-@(dev|sources|javadoc|all)).jar' + game-versions: 1.20.2 + - name: Publish-1.20.2-fabric-Modrinth + uses: Kir-Antipov/mc-publish@v3.3.0 + with: + modrinth-id: NNAgCjsB + modrinth-token: ${{ secrets.MODRINTH_TOKEN }} + loaders: fabric + name: ${{github.ref_name}}-1.20.2 - Fabric + files: 'versions/1.20.2-fabric/build/libs/!(*-@(dev|sources|javadoc|all)).jar' + game-versions: 1.20.2 + - name: Publish-1.20.4-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}}-1.20.4 - Forge + version-type: beta + files: 'versions/1.20.4-forge/build/libs/!(*-@(dev|sources|javadoc|all)).jar' + game-versions: 1.20.4 + - name: Publish-1.20.4-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}}-1.20.4 - Forge + files: 'versions/1.20.4-forge/build/libs/!(*-@(dev|sources|javadoc|all)).jar' + game-versions: 1.20.4 + - name: Publish-1.20.4-neoforge-Curseforge + uses: Kir-Antipov/mc-publish@v3.3.0 + with: + curseforge-id: 448233 + curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} + loaders: neoforge + name: ${{github.ref_name}}-1.20.4 - NeoForge + version-type: beta + files: 'versions/1.20.4-neoforge/build/libs/!(*-@(dev|sources|javadoc|all)).jar' + game-versions: 1.20.4 + - name: Publish-1.20.4-neoforge-Modrinth + uses: Kir-Antipov/mc-publish@v3.3.0 + with: + modrinth-id: NNAgCjsB + modrinth-token: ${{ secrets.MODRINTH_TOKEN }} + loaders: neoforge + name: ${{github.ref_name}}-1.20.4 - NeoForge + files: 'versions/1.20.4-neoforge/build/libs/!(*-@(dev|sources|javadoc|all)).jar' + game-versions: 1.20.4 + - name: Publish-1.20.4-fabric-Curseforge + uses: Kir-Antipov/mc-publish@v3.3.0 + with: + curseforge-id: 448233 + curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} + loaders: fabric + name: ${{github.ref_name}}-1.20.4 - Fabric + files: 'versions/1.20.4-fabric/build/libs/!(*-@(dev|sources|javadoc|all)).jar' + game-versions: 1.20.4 + - name: Publish-1.20.4-fabric-Modrinth + uses: Kir-Antipov/mc-publish@v3.3.0 + with: + modrinth-id: NNAgCjsB + modrinth-token: ${{ secrets.MODRINTH_TOKEN }} + loaders: fabric + name: ${{github.ref_name}}-1.20.4 - Fabric + files: 'versions/1.20.4-fabric/build/libs/!(*-@(dev|sources|javadoc|all)).jar' + game-versions: 1.20.4 - name: Publish-1.20.6-forge-Curseforge uses: Kir-Antipov/mc-publish@v3.3.0 with: diff --git a/settings.json b/settings.json index 73dd0bb..af9e6a0 100644 --- a/settings.json +++ b/settings.json @@ -1,5 +1,13 @@ { "versions": [ + "1.20.1-forge", + "1.20.1-fabric", + "1.20.2-forge", + "1.20.2-neoforge", + "1.20.2-fabric", + "1.20.4-forge", + "1.20.4-neoforge", + "1.20.4-fabric", "1.20.6-forge", "1.20.6-neoforge", "1.20.6-fabric" diff --git a/src/main/java/dev/tr7zw/entityculling/EntityCullingMod.java b/src/main/java/dev/tr7zw/entityculling/EntityCullingMod.java index 622dc16..093840a 100644 --- a/src/main/java/dev/tr7zw/entityculling/EntityCullingMod.java +++ b/src/main/java/dev/tr7zw/entityculling/EntityCullingMod.java @@ -9,13 +9,18 @@ import net.fabricmc.api.ClientModInitializer; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; //#elseif NEOFORGE +//#if MC >= 12005 +//$$ import net.neoforged.neoforge.client.event.ClientTickEvent; +//$$ import net.neoforged.neoforge.event.tick.LevelTickEvent; +//#else +//$$ import net.neoforged.neoforge.event.TickEvent.ClientTickEvent; +//$$ import net.neoforged.neoforge.event.TickEvent.LevelTickEvent; +//#endif //$$ import net.neoforged.fml.IExtensionPoint; //$$ import net.neoforged.fml.ModLoadingContext; //$$ import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent; //$$ import net.neoforged.fml.javafmlmod.FMLJavaModLoadingContext; -//$$ import net.neoforged.neoforge.client.event.ClientTickEvent; //$$ import net.neoforged.neoforge.common.NeoForge; -//$$ import net.neoforged.neoforge.event.tick.LevelTickEvent; //#else //$$ import net.minecraftforge.common.MinecraftForge; //$$ import net.minecraftforge.event.TickEvent.ClientTickEvent; @@ -72,7 +77,7 @@ public void initModloader() { //#endif //$$ } //$$ - //#if NEOFORGE + //#if NEOFORGE && MC >= 12005 //$$ private void doClientTick(ClientTickEvent.Pre event) { //#else //$$ private void doClientTick(ClientTickEvent event) { @@ -80,7 +85,7 @@ public void initModloader() { //$$ this.clientTick(); //$$ } //$$ - //#if NEOFORGE + //#if NEOFORGE && MC >= 12005 //$$ private void doWorldTick(LevelTickEvent.Pre event) { //#else //$$ private void doWorldTick(LevelTickEvent event) { diff --git a/src/main/java/dev/tr7zw/entityculling/mixin/EntityRendererMixin.java b/src/main/java/dev/tr7zw/entityculling/mixin/EntityRendererMixin.java index 4387a9a..bdee746 100644 --- a/src/main/java/dev/tr7zw/entityculling/mixin/EntityRendererMixin.java +++ b/src/main/java/dev/tr7zw/entityculling/mixin/EntityRendererMixin.java @@ -22,7 +22,14 @@ public boolean shadowShouldShowName(T entity) { @Override public void shadowRenderNameTag(T entity, Component component, PoseStack poseStack, MultiBufferSource multiBufferSource, int light, float f) { - renderNameTag(entity, component, poseStack, multiBufferSource, light, f); + renderNameTag(entity, component, poseStack, multiBufferSource, light + // spotless:off + //#if MC >= 12005 + , f); + //#else + //$$); + //#endif + //spotless:on } @Shadow @@ -30,6 +37,13 @@ public void shadowRenderNameTag(T entity, Component component, PoseStack poseSta @Shadow public abstract void renderNameTag(T entity, Component component, PoseStack poseStack, - MultiBufferSource multiBufferSource, int i, float f); + MultiBufferSource multiBufferSource, int i + // spotless:off + //#if MC >= 12005 + , float f); + //#else + //$$); + //#endif + //spotless:on }