From 6d90a97e4662b9eeea57a3484b5c3db51fdd92ee Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Wed, 10 May 2023 13:50:37 +0200 Subject: [PATCH 01/52] Added mcmod.info to versioncommit in release workflow --- .github/workflows/release-alpha.yml | 1 + .github/workflows/release-beta.yml | 1 + .github/workflows/release-release.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/release-alpha.yml b/.github/workflows/release-alpha.yml index 50353e6d..4f38a143 100644 --- a/.github/workflows/release-alpha.yml +++ b/.github/workflows/release-alpha.yml @@ -20,6 +20,7 @@ jobs: run: | sed -i 's/public static final String VERSION.*/public static final String VERSION = "${{ steps.getversion.outputs.version }}";/' src/main/java/net/landofrails/landofsignals/LandOfSignals.java sed -i "s/String version =.*/String version = '${{ steps.getversion.outputs.version }}'/" ./build.gradle + sed -i 's/"version":.*/"version": "${{ steps.getversion.outputs.version }}"/' src/main/resources/mcmod.info - name: Commit and push changes run: | git config --global user.name "MarkenJaden" diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 70257d85..899d79e2 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -20,6 +20,7 @@ jobs: run: | sed -i 's/public static final String VERSION.*/public static final String VERSION = "${{ steps.getversion.outputs.version }}";/' src/main/java/net/landofrails/landofsignals/LandOfSignals.java sed -i "s/String version =.*/String version = '${{ steps.getversion.outputs.version }}'/" ./build.gradle + sed -i 's/"version":.*/"version": "${{ steps.getversion.outputs.version }}"/' src/main/resources/mcmod.info - name: Commit and push changes run: | git config --global user.name "MarkenJaden" diff --git a/.github/workflows/release-release.yml b/.github/workflows/release-release.yml index 5bcdcbd2..63968300 100644 --- a/.github/workflows/release-release.yml +++ b/.github/workflows/release-release.yml @@ -20,6 +20,7 @@ jobs: run: | sed -i 's/public static final String VERSION.*/public static final String VERSION = "${{ steps.getversion.outputs.version }}";/' src/main/java/net/landofrails/landofsignals/LandOfSignals.java sed -i "s/String version =.*/String version = '${{ steps.getversion.outputs.version }}'/" ./build.gradle + sed -i 's/"version":.*/"version": "${{ steps.getversion.outputs.version }}"/' src/main/resources/mcmod.info - name: Commit and push changes run: | git config --global user.name "MarkenJaden" From c75cfe1e630706fbe9a2228c8d1757a803168f56 Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Wed, 10 May 2023 18:56:14 +0200 Subject: [PATCH 02/52] Might fix workflow failure when files are up-to-date --- .github/workflows/release-alpha.yml | 2 +- .github/workflows/release-beta.yml | 2 +- .github/workflows/release-release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-alpha.yml b/.github/workflows/release-alpha.yml index 4f38a143..6604f0a8 100644 --- a/.github/workflows/release-alpha.yml +++ b/.github/workflows/release-alpha.yml @@ -26,7 +26,7 @@ jobs: git config --global user.name "MarkenJaden" git config --global user.email "jjsch1410@gmail.com" git add -A - git commit -m "Updated mod version" + git diff-index --quiet HEAD || git commit -m "Updated mod version" git push build: diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index 899d79e2..ba526faa 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -26,7 +26,7 @@ jobs: git config --global user.name "MarkenJaden" git config --global user.email "jjsch1410@gmail.com" git add -A - git commit -m "Updated mod version" + git diff-index --quiet HEAD || git commit -m "Updated mod version" git push build: diff --git a/.github/workflows/release-release.yml b/.github/workflows/release-release.yml index 63968300..504aa65f 100644 --- a/.github/workflows/release-release.yml +++ b/.github/workflows/release-release.yml @@ -26,7 +26,7 @@ jobs: git config --global user.name "MarkenJaden" git config --global user.email "jjsch1410@gmail.com" git add -A - git commit -m "Updated mod version" + git diff-index --quiet HEAD || git commit -m "Updated mod version" git push build: From 5e0b7846af393f9b4e3b40e4fb89830bbe37c1c1 Mon Sep 17 00:00:00 2001 From: Danielxs01 Date: Thu, 11 May 2023 21:07:16 +0200 Subject: [PATCH 03/52] [#88] Removed redundant cache, removed cacheInfoOldContentPack --- .../render/item/ItemComplexSignalRender.java | 15 ------------- .../render/item/ItemSignalPartRender.java | 21 ++++--------------- 2 files changed, 4 insertions(+), 32 deletions(-) diff --git a/src/main/java/net/landofrails/landofsignals/render/item/ItemComplexSignalRender.java b/src/main/java/net/landofrails/landofsignals/render/item/ItemComplexSignalRender.java index 608516e4..582e02b9 100644 --- a/src/main/java/net/landofrails/landofsignals/render/item/ItemComplexSignalRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/item/ItemComplexSignalRender.java @@ -130,13 +130,6 @@ private static void renderBase(String itemId) { final String path = baseModels.getKey(); final String objId = itemId + "/base/" + path; - if (!cache.containsKey(objId)) { - try { - cache.put(objId, new OBJRender(new OBJModel(new Identifier(LandOfSignals.MODID, path), 0))); - } catch (Exception e) { - throw new ItemRenderException("Error loading item model/renderer...", e); - } - } final OBJRender renderer = cache.get(objId); for (ContentPackModel baseModel : baseModels.getValue()) { @@ -184,14 +177,6 @@ private static void renderSignals(String itemId, Map itemGroupSt final String path = signalModels.getKey(); final String objId = itemId + "/signals/" + path; - if (!cache.containsKey(objId)) { - try { - final Set objTextures = LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().get(itemId).getObjTextures().get(path); - cache.put(objId, new OBJRender(new OBJModel(new Identifier(LandOfSignals.MODID, path), 0, objTextures))); - } catch (final Exception e) { - throw new ItemRenderException("Error loading item model/renderer...", e); - } - } final OBJRender renderer = cache.get(objId); for (ContentPackModel signalModel : signalModels.getValue()) { diff --git a/src/main/java/net/landofrails/landofsignals/render/item/ItemSignalPartRender.java b/src/main/java/net/landofrails/landofsignals/render/item/ItemSignalPartRender.java index a0eec55d..c59b352c 100644 --- a/src/main/java/net/landofrails/landofsignals/render/item/ItemSignalPartRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/item/ItemSignalPartRender.java @@ -22,7 +22,6 @@ @SuppressWarnings("java:S3252") public class ItemSignalPartRender implements ItemRender.IItemModel { protected static final Map cache = new HashMap<>(); - protected static final Map cacheInfoOldContentPack = new HashMap<>(); @Override public StandardModel getModel(World world, ItemStack stack) { @@ -61,7 +60,6 @@ private static void renderBase(ContentPackSignal signal, String itemId) { try { String[] states = LOSBlocks.BLOCK_SIGNAL_PART.getAllStates(itemId); cache.put(objPath, new OBJRender(new OBJModel(new Identifier(LandOfSignals.MODID, objPath), 0, Arrays.asList(states)))); - cacheInfoOldContentPack.putIfAbsent(itemId, LOSBlocks.BLOCK_SIGNAL_PART.isOldContentPack(itemId)); } catch (Exception e) { throw new ItemRenderException("Error loading item model/renderer...", e); } @@ -74,13 +72,8 @@ private static void renderBase(ContentPackSignal signal, String itemId) { try (OpenGL.With ignored1 = OpenGL.matrix(); OpenGL.With ignored2 = renderer.bindTexture(baseState)) { // Render - if (Boolean.FALSE.equals(cacheInfoOldContentPack.get(itemId))) { - GL11.glScaled(scale[0], scale[1], scale[2]); - GL11.glTranslated(translate[0], translate[1], translate[2]); - } else { - GL11.glTranslated(translate[0], translate[1], translate[2]); - GL11.glScaled(scale[0], scale[1], scale[2]); - } + GL11.glTranslated(translate[0], translate[1], translate[2]); + GL11.glScaled(scale[0], scale[1], scale[2]); renderer.draw(); } @@ -94,7 +87,6 @@ private static void renderSignals(ContentPackSignal signal, String itemId, Strin try { String[] states = LOSBlocks.BLOCK_SIGNAL_PART.getAllStates(itemId); cache.put(objPath, new OBJRender(new OBJModel(new Identifier(LandOfSignals.MODID, objPath), 0, Arrays.asList(states)))); - cacheInfoOldContentPack.putIfAbsent(itemId, LOSBlocks.BLOCK_SIGNAL_PART.isOldContentPack(itemId)); } catch (Exception e) { throw new ItemRenderException("Error loading item model/renderer...", e); } @@ -107,13 +99,8 @@ private static void renderSignals(ContentPackSignal signal, String itemId, Strin try (OpenGL.With ignored1 = OpenGL.matrix(); OpenGL.With ignored2 = renderer.bindTexture(itemState)) { // Render - if (Boolean.FALSE.equals(cacheInfoOldContentPack.get(itemId))) { - GL11.glScaled(scale[0], scale[1], scale[2]); - GL11.glTranslated(translate[0], translate[1], translate[2]); - } else { - GL11.glTranslated(translate[0], translate[1], translate[2]); - GL11.glScaled(scale[0], scale[1], scale[2]); - } + GL11.glTranslated(translate[0], translate[1], translate[2]); + GL11.glScaled(scale[0], scale[1], scale[2]); renderer.draw(); } From 280b55fc8ae5439c7c8812be278198718ae66082 Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Fri, 12 May 2023 01:35:02 +0200 Subject: [PATCH 04/52] Added "-" between version and suffix --- .github/workflows/release-alpha.yml | 8 ++++---- .github/workflows/release-beta.yml | 4 ++-- .github/workflows/release-release.yml | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release-alpha.yml b/.github/workflows/release-alpha.yml index 6604f0a8..308d8236 100644 --- a/.github/workflows/release-alpha.yml +++ b/.github/workflows/release-alpha.yml @@ -9,7 +9,7 @@ jobs: - uses: actions/checkout@v3 with: token: ${{ secrets.PAT }} - + - name: Read VERSION file id: getversion run: echo "::set-output name=version::$(cat VERSION)" @@ -17,7 +17,7 @@ jobs: id: getsuffix run: echo "::set-output name=suffix::$(cat SUFFIX)" - name: Replace version number with new version - run: | + run: | sed -i 's/public static final String VERSION.*/public static final String VERSION = "${{ steps.getversion.outputs.version }}";/' src/main/java/net/landofrails/landofsignals/LandOfSignals.java sed -i "s/String version =.*/String version = '${{ steps.getversion.outputs.version }}'/" ./build.gradle sed -i 's/"version":.*/"version": "${{ steps.getversion.outputs.version }}"/' src/main/resources/mcmod.info @@ -28,7 +28,7 @@ jobs: git add -A git diff-index --quiet HEAD || git commit -m "Updated mod version" git push - + build: runs-on: ubuntu-latest strategy: @@ -101,7 +101,7 @@ jobs: token: ${{ secrets.LANDOFSIGNALS_UPLOAD }} project_id: 434307 game_endpoint: minecraft - file_path: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar + file_path: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}-${{ steps.getsuffix.outputs.suffix }}.jar changelog: ${{ steps.getchangelog.outputs.content }} changelog_type: markdown game_versions: ${{ matrix.version }} diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index ba526faa..f0d2b4ea 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -17,7 +17,7 @@ jobs: id: getsuffix run: echo "::set-output name=suffix::$(cat SUFFIX)" - name: Replace version number with new version - run: | + run: | sed -i 's/public static final String VERSION.*/public static final String VERSION = "${{ steps.getversion.outputs.version }}";/' src/main/java/net/landofrails/landofsignals/LandOfSignals.java sed -i "s/String version =.*/String version = '${{ steps.getversion.outputs.version }}'/" ./build.gradle sed -i 's/"version":.*/"version": "${{ steps.getversion.outputs.version }}"/' src/main/resources/mcmod.info @@ -101,7 +101,7 @@ jobs: token: ${{ secrets.LANDOFSIGNALS_UPLOAD }} project_id: 434307 game_endpoint: minecraft - file_path: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar + file_path: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}-${{ steps.getsuffix.outputs.suffix }}.jar changelog: ${{ steps.getchangelog.outputs.content }} changelog_type: markdown game_versions: ${{ matrix.version }} diff --git a/.github/workflows/release-release.yml b/.github/workflows/release-release.yml index 504aa65f..4a96e4a0 100644 --- a/.github/workflows/release-release.yml +++ b/.github/workflows/release-release.yml @@ -9,7 +9,7 @@ jobs: - uses: actions/checkout@v3 with: token: ${{ secrets.PAT }} - + - name: Read VERSION file id: getversion run: echo "::set-output name=version::$(cat VERSION)" @@ -17,7 +17,7 @@ jobs: id: getsuffix run: echo "::set-output name=suffix::$(cat SUFFIX)" - name: Replace version number with new version - run: | + run: | sed -i 's/public static final String VERSION.*/public static final String VERSION = "${{ steps.getversion.outputs.version }}";/' src/main/java/net/landofrails/landofsignals/LandOfSignals.java sed -i "s/String version =.*/String version = '${{ steps.getversion.outputs.version }}'/" ./build.gradle sed -i 's/"version":.*/"version": "${{ steps.getversion.outputs.version }}"/' src/main/resources/mcmod.info @@ -28,7 +28,7 @@ jobs: git add -A git diff-index --quiet HEAD || git commit -m "Updated mod version" git push - + build: runs-on: ubuntu-latest strategy: @@ -101,7 +101,7 @@ jobs: token: ${{ secrets.LANDOFSIGNALS_UPLOAD }} project_id: 434307 game_endpoint: minecraft - file_path: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar + file_path: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}-${{ steps.getsuffix.outputs.suffix }}.jar changelog: ${{ steps.getchangelog.outputs.content }} changelog_type: markdown game_versions: ${{ matrix.version }} From 7af9f72189aa8c183f340c154db3320c8e3128df Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Fri, 12 May 2023 01:36:16 +0200 Subject: [PATCH 05/52] Fixed dumb bug with missing "-" --- .github/workflows/release-alpha.yml | 2 +- .github/workflows/release-beta.yml | 2 +- .github/workflows/release-release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-alpha.yml b/.github/workflows/release-alpha.yml index 308d8236..85767e3c 100644 --- a/.github/workflows/release-alpha.yml +++ b/.github/workflows/release-alpha.yml @@ -94,7 +94,7 @@ jobs: id: getsuffix run: echo "::set-output name=suffix::$(cat SUFFIX)" - name: Rename with suffix - run: mv -n build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}.jar build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar + run: mv -n build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}.jar build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}-${{ steps.getsuffix.outputs.suffix }}.jar - name: Upload to CurseForge ${{matrix.branch}} uses: MarkenJaden/curseforge-upload@master with: diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index f0d2b4ea..d38a8497 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -94,7 +94,7 @@ jobs: id: getsuffix run: echo "::set-output name=suffix::$(cat SUFFIX)" - name: Rename with suffix - run: mv -n build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}.jar build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar + run: mv -n build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}.jar build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}-${{ steps.getsuffix.outputs.suffix }}.jar - name: Upload to CurseForge ${{matrix.branch}} uses: MarkenJaden/curseforge-upload@master with: diff --git a/.github/workflows/release-release.yml b/.github/workflows/release-release.yml index 4a96e4a0..74a625d4 100644 --- a/.github/workflows/release-release.yml +++ b/.github/workflows/release-release.yml @@ -94,7 +94,7 @@ jobs: id: getsuffix run: echo "::set-output name=suffix::$(cat SUFFIX)" - name: Rename with suffix - run: mv -n build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}.jar build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar + run: mv -n build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}.jar build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}-${{ steps.getsuffix.outputs.suffix }}.jar - name: Upload to CurseForge ${{matrix.branch}} uses: MarkenJaden/curseforge-upload@master with: From 2d842896955baaa52a77212e1bc74964b341f0f7 Mon Sep 17 00:00:00 2001 From: Danielxs01 Date: Sat, 13 May 2023 17:40:05 +0200 Subject: [PATCH 06/52] =?UTF-8?q?[#91]=20Added=2090=C2=B0=20versions=20of?= =?UTF-8?q?=20stellwand=20blocks=20except=20of=20streckenblock?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../landofrails/landofsignals/LOSBlocks.java | 170 +++++++++++++++--- 1 file changed, 142 insertions(+), 28 deletions(-) diff --git a/src/main/java/net/landofrails/landofsignals/LOSBlocks.java b/src/main/java/net/landofrails/landofsignals/LOSBlocks.java index 8ca684d7..03e82df7 100644 --- a/src/main/java/net/landofrails/landofsignals/LOSBlocks.java +++ b/src/main/java/net/landofrails/landofsignals/LOSBlocks.java @@ -154,7 +154,8 @@ public static void register() { Static.MISSING_NAME, Static.MISSING_OBJ, keyValueLinkedMap("default", null), - null + null, + false ); registerSingleGroupStellwandContent( @@ -162,7 +163,17 @@ public static void register() { "Signal Straight Track", "models/block/stellwand/blocksignal/blocktrackstraight/blocksignal.obj", keyValueLinkedMap("Off", "off", "White", "white", "Red", "red"), - "white" + "white", + false + ); + + registerSingleGroupStellwandContent( + "block_signal_straight_track_90deg", + "Signal Straight Track (90deg)", + "models/block/stellwand/blocksignal/blocktrackstraight/blocksignal.obj", + keyValueLinkedMap("Off", "off", "White", "white", "Red", "red"), + "white", + true ); registerSingleGroupStellwandContent( @@ -170,7 +181,17 @@ public static void register() { "Signal Straight Unisolated", "models/block/stellwand/blocksignal/blocktrackunisolated/unisolated.obj", keyValueLinkedMap("Off", "off", "White", "white"), - "white" + "white", + false + ); + + registerSingleGroupStellwandContent( + "block_signal_straight_unisolated_90deg", + "Signal Straight Unisolated (90deg)", + "models/block/stellwand/blocksignal/blocktrackunisolated/unisolated.obj", + keyValueLinkedMap("Off", "off", "White", "white"), + "white", + true ); registerSingleGroupStellwandContent( @@ -178,7 +199,8 @@ public static void register() { "Signal Diagonal Track DL", "models/block/stellwand/blocksignal/trackdiag/downleft/trackdiagdownleft.obj", keyValueLinkedMap("Off", "off", "White", "white", "Red", "red"), - "white" + "white", + false ); registerSingleGroupStellwandContent( @@ -186,7 +208,8 @@ public static void register() { "Signal Diagonal Track DR", "models/block/stellwand/blocksignal/trackdiag/downright/trackdiagdownright.obj", keyValueLinkedMap("Off", "off", "White", "white", "Red", "red"), - "white" + "white", + false ); registerSingleGroupStellwandContent( @@ -194,7 +217,8 @@ public static void register() { "Signal Diagonal Track UL", "models/block/stellwand/blocksignal/trackdiag/upleft/trackdiagupleft.obj", keyValueLinkedMap("Off", "off", "White", "white", "Red", "red"), - "white" + "white", + false ); registerSingleGroupStellwandContent( @@ -202,7 +226,8 @@ public static void register() { "Signal Diagonal Track UR", "models/block/stellwand/blocksignal/trackdiag/upright/trackdiagupright.obj", keyValueLinkedMap("Off", "off", "White", "white", "Red", "red"), - "white" + "white", + false ); registerSingleGroupStellwandContent( @@ -210,7 +235,17 @@ public static void register() { "Signal HSig Left", "models/block/stellwand/blocksignal/trackmainsignal/left/hsigleft.obj", keyValueLinkedMap("Off", "off", "Green", "green", "Orange", "orange", "Red", "red"), - "green" + "green", + false + ); + + registerSingleGroupStellwandContent( + "block_signal_hsig_left_90deg", + "Signal HSig Left (90deg)", + "models/block/stellwand/blocksignal/trackmainsignal/left/hsigleft.obj", + keyValueLinkedMap("Off", "off", "Green", "green", "Orange", "orange", "Red", "red"), + "green", + true ); registerSingleGroupStellwandContent( @@ -218,7 +253,17 @@ public static void register() { "Signal HSig Right", "models/block/stellwand/blocksignal/trackmainsignal/right/hsigright.obj", keyValueLinkedMap("Off", "off", "Green", "green", "Orange", "orange", "Red", "red"), - "green" + "green", + false + ); + + registerSingleGroupStellwandContent( + "block_signal_hsig_right_90deg", + "Signal HSig Right (90deg)", + "models/block/stellwand/blocksignal/trackmainsignal/right/hsigright.obj", + keyValueLinkedMap("Off", "off", "Green", "green", "Orange", "orange", "Red", "red"), + "green", + true ); registerSingleGroupStellwandContent( @@ -226,7 +271,17 @@ public static void register() { "Dwarfsignal bottom", "models/block/stellwand/blocksignal/blockdwarfsignal/blockdwarfsignalbottom.obj", keyValueLinkedMap("Off", "off", "Green", "green"), - "green" + "green", + false + ); + + registerSingleGroupStellwandContent( + "block_signal_dwarf_left", + "Dwarfsignal left", + "models/block/stellwand/blocksignal/blockdwarfsignal/blockdwarfsignalbottom.obj", + keyValueLinkedMap("Off", "off", "Green", "green"), + "green", + true ); registerSingleGroupStellwandContent( @@ -234,7 +289,17 @@ public static void register() { "Dwarfsignal top", "models/block/stellwand/blocksignal/blockdwarfsignal/blockdwarfsignaltop.obj", keyValueLinkedMap("Off", "off", "Green", "green"), - "green" + "green", + false + ); + + registerSingleGroupStellwandContent( + "block_signal_dwarf_right", + "Dwarfsignal right", + "models/block/stellwand/blocksignal/blockdwarfsignal/blockdwarfsignaltop.obj", + keyValueLinkedMap("Off", "off", "Green", "green"), + "green", + true ); registerSingleGroupStellwandContent( @@ -243,7 +308,18 @@ public static void register() { "models/block/stellwand/blocksignal/trackswitch/lrd/trackswitch.obj", keyValueLinkedMap("Off", "off", "Main single white", "main_signalwhite", "Main double white", "main_doublewhite", "Branch white", "branch_white", "Main double red", "main_doublered", "Branch red", "branch_red"), - "branch_white" + "branch_white", + false + ); + + registerSingleGroupStellwandContent( + "block_signal_track_switch_uld", + "Track switch (Up -> Left, Down)", + "models/block/stellwand/blocksignal/trackswitch/lrd/trackswitch.obj", + keyValueLinkedMap("Off", "off", "Main single white", "main_signalwhite", "Main double white", "main_doublewhite", + "Branch white", "branch_white", "Main double red", "main_doublered", "Branch red", "branch_red"), + "branch_white", + true ); registerSingleGroupStellwandContent( @@ -252,7 +328,18 @@ public static void register() { "models/block/stellwand/blocksignal/trackswitch/lru/trackswitch.obj", keyValueLinkedMap("Off", "off", "Main single white", "main_signalwhite", "Main double white", "main_doublewhite", "Branch white", "branch_white", "Main double red", "main_doublered", "Branch red", "branch_red"), - "branch_white" + "branch_white", + false + ); + + registerSingleGroupStellwandContent( + "block_signal_track_switch_urd", + "Track switch (Up -> Right, Down)", + "models/block/stellwand/blocksignal/trackswitch/lru/trackswitch.obj", + keyValueLinkedMap("Off", "off", "Main single white", "main_signalwhite", "Main double white", "main_doublewhite", "Branch white", + "branch_white", "Main double red", "main_doublered", "Branch red", "branch_red"), + "branch_white", + true ); registerSingleGroupStellwandContent( @@ -261,7 +348,18 @@ public static void register() { "models/block/stellwand/blocksignal/trackswitch/rld/trackswitch.obj", keyValueLinkedMap("Off", "off", "Main single white", "main_signalwhite", "Main double white", "main_doublewhite", "Branch white", "branch_white", "Main double red", "main_doublered", "Branch red", "branch_red"), - "branch_white" + "branch_white", + false + ); + + registerSingleGroupStellwandContent( + "block_signal_track_switch_dlu", + "Track switch (Down -> Left, Up)", + "models/block/stellwand/blocksignal/trackswitch/rld/trackswitch.obj", + keyValueLinkedMap("Off", "off", "Main single white", "main_signalwhite", "Main double white", "main_doublewhite", "Branch white", + "branch_white", "Main double red", "main_doublered", "Branch red", "branch_red"), + "branch_white", + true ); registerSingleGroupStellwandContent( @@ -270,10 +368,22 @@ public static void register() { "models/block/stellwand/blocksignal/trackswitch/rlu/trackswitch.obj", keyValueLinkedMap("Off", "off", "Main single white", "main_signalwhite", "Main double white", "main_doublewhite", "Branch white", "branch_white", "Main double red", "main_doublered", "Branch red", "branch_red"), - "branch_white" + "branch_white", + false ); - registerStreckenblock(); + registerSingleGroupStellwandContent( + "block_signal_track_switch_dru", + "Track switch (Down -> Right, Up)", + "models/block/stellwand/blocksignal/trackswitch/rlu/trackswitch.obj", + keyValueLinkedMap("Off", "off", "Main single white", "main_signalwhite", "Main double white", "main_doublewhite", "Branch white", + "branch_white", "Main double red", "main_doublered", "Branch red", "branch_red"), + "branch_white", + true + ); + + registerStreckenblock(false); + registerStreckenblock(true); // Signalboxes @@ -291,6 +401,8 @@ public static void register() { registerDecoContentPackStellwand("deco_filler", "Block Filler", models("models/block/stellwand/blockfiller/blockfiller/blockfiller.obj", new ContentPackModel[]{new ContentPackModel(new float[]{0.5f, 0f, 0.5f}, new float[]{0.5f, 0, 0.5f}, new float[]{1f, 1f, 1f}, new float[]{1f, 1f, 1f})})); registerDecoContentPackStellwand("deco_straight_track", "Straight track", models("models/block/stellwand/blockfiller/trackstraight/trackstraight.obj", new ContentPackModel[]{new ContentPackModel(new float[]{0.5f, 0.5f, 0.5f}, new float[]{0.5f, 0.5f, 0.5f}, new float[]{1f, 1f, 1f}, new float[]{1f, 1f, 1f}, new float[]{0f, 180f, 0f})})); + registerDecoContentPackStellwand("deco_straight_track_90deg", "Straight track (90deg)", models("models/block/stellwand/blockfiller/trackstraight/trackstraight.obj", new ContentPackModel[]{new ContentPackModel(new float[]{0.5f, 0.5f, 0.5f}, new float[]{0.5f, 0.5f, 0.5f}, new float[]{1f, 1f, 1f}, new float[]{1f, 1f, 1f}, new float[]{0f, 180, 90f})})); + registerDecoContentPackStellwand("deco_trackdiag_down_left", "Diagonal track (down - left)", models("models/block/stellwand/blockfiller/trackdiag/dl/trackdiag.obj", new ContentPackModel[]{new ContentPackModel(new float[]{0.5f, 0.5f, 0.5f}, new float[]{0.5f, 0.5f, 0.5f}, new float[]{1f, 1f, 1f}, new float[]{1f, 1f, 1f}, new float[]{0f, 180f, 0f})})); registerDecoContentPackStellwand("deco_trackdiag_down_right", "Diagonal track (down - right)", models("models/block/stellwand/blockfiller/trackdiag/dr/trackdiag.obj", new ContentPackModel[]{new ContentPackModel(new float[]{0.5f, 0.5f, 0.5f}, new float[]{0.5f, 0.5f, 0.5f}, new float[]{1f, 1f, 1f}, new float[]{1f, 1f, 1f}, new float[]{0f, 180f, 0f})})); registerDecoContentPackStellwand("deco_trackdiag_up_left", "Diagonal track (up - left)", models("models/block/stellwand/blockfiller/trackdiag/ul/trackdiag.obj", new ContentPackModel[]{new ContentPackModel(new float[]{0.5f, 0.5f, 0.5f}, new float[]{0.5f, 0.5f, 0.5f}, new float[]{1f, 1f, 1f}, new float[]{1f, 1f, 1f}, new float[]{0f, 180f, 0f})})); @@ -298,7 +410,9 @@ public static void register() { } - private static void registerStreckenblock() { + private static void registerStreckenblock(boolean ninetyDegree) { + String name = "Streckenblock" + (ninetyDegree ? " (90deg)" : ""); + String id = "block_signal_streckenblock" + (ninetyDegree ? "_90deg" : ""); String objPath = "models/block/stellwand/blockstreckenblock/streckenblock.obj"; Map groups = new HashMap<>(); @@ -321,17 +435,17 @@ private static void registerStreckenblock() { for (String[] state : preparedStates) { String stateId = groupId + state[0]; String stateName = groupName + " " + state[1]; - states.put(stateId, new net.landofrails.api.contentpacks.v2.complexsignal.ContentPackSignalState(stateName, signalModels(objPath, stateId, new float[]{.5f, 0f, .5f}, new float[]{.5f, 0f, .5f}))); + states.put(stateId, new net.landofrails.api.contentpacks.v2.complexsignal.ContentPackSignalState(stateName, signalModels(objPath, stateId, new float[]{0.5f, 0f, 0.5f}, new float[]{.5f, 0f, .5f}, ninetyDegree))); } groups.put(groupName, new net.landofrails.api.contentpacks.v2.complexsignal.ContentPackSignalGroup(groupName, states)); } ContentPackComplexSignal stellwandMultisignal = new ContentPackComplexSignal( - "Streckenblock", - "block_signal_streckenblock", + name, + id, 90f, LOSTabs.SIGNALS_TAB, - signalModels(objPath, "general", new float[]{.5f, 0f, .5f}, new float[]{.5f, 0f, .5f}), + signalModels(objPath, "general", new float[]{.5f, 0f, .5f}, new float[]{.5f, 0f, .5f}, ninetyDegree), groups, keyValueLinkedMap("Top left", "topLeftWhite", "Bottom right", "bottomRightRed"), null, @@ -389,12 +503,12 @@ private static void registerDecoContentPackStellwand(String id, String name, Map BLOCK_DECO.add(contentPackDeco); } - private static void registerSingleGroupStellwandContent(String id, String name, String objPath, Map signalNameAndId, String itemGroup) { + private static void registerSingleGroupStellwandContent(String id, String name, String objPath, Map signalNameAndId, String itemGroup, boolean ninetyDegree) { String groupIdName = "default"; LinkedHashMap states = new LinkedHashMap<>(); signalNameAndId.forEach((signalName, signalId) -> - states.put(signalId, new net.landofrails.api.contentpacks.v2.complexsignal.ContentPackSignalState(signalName, signalModels(objPath, signalId))) + states.put(signalId, new net.landofrails.api.contentpacks.v2.complexsignal.ContentPackSignalState(signalName, signalModels(objPath, signalId, ninetyDegree))) ); Map group = Collections.singletonMap(groupIdName, new net.landofrails.api.contentpacks.v2.complexsignal.ContentPackSignalGroup("default", states)); Map itemGroupStates = null; @@ -408,7 +522,7 @@ private static void registerSingleGroupStellwandContent(String id, String name, id, 90f, LOSTabs.SIGNALS_TAB, - signalModels(objPath, "general"), + signalModels(objPath, "general", ninetyDegree), group, itemGroupStates, null, @@ -458,7 +572,7 @@ private static Map keyValueLinkedMap(String... data) { return map; } - private static Map signalModels(String objPath, String objGroup) { + private static Map signalModels(String objPath, String objGroup, boolean rotateNinetyDegrees) { return models( objPath, new ContentPackModel[]{ @@ -467,14 +581,14 @@ private static Map signalModels(String objPath, Stri new float[]{0.5f, 0.5f, 0.5f}, new float[]{1f, 1f, 1f}, new float[]{1f, 1f, 1f}, - new float[]{0f, 180f, 0f}, + new float[]{0f, 180f, rotateNinetyDegrees ? 90f : 0f}, new String[]{objGroup} ) } ); } - private static Map signalModels(String objPath, String objGroup, float[] blockTranslation, float[] itemTranslation) { + private static Map signalModels(String objPath, String objGroup, float[] blockTranslation, float[] itemTranslation, boolean rotateNinetyDegrees) { return models( objPath, new ContentPackModel[]{ @@ -483,7 +597,7 @@ private static Map signalModels(String objPath, Stri itemTranslation, new float[]{1f, 1f, 1f}, new float[]{1f, 1f, 1f}, - new float[]{0f, 180f, 0f}, + new float[]{0f, 180f, rotateNinetyDegrees ? 90f : 0f}, new String[]{objGroup} ) } From 562e447c1e20d9aa6836db951e395c025d1eb4fa Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Mon, 15 May 2023 15:48:48 +0200 Subject: [PATCH 07/52] Fixed missing logging parameter in ContentPackHandlerV2#load Bump to v1.0.4 --- CHANGELOG.md | 4 ++++ VERSION | 2 +- build.gradle | 2 +- .../landofsignals/contentpacks/ContentPackHandlerV2.java | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17e870e1..88f3d751 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +#### Release 1.0.4 + +Fixed missing logging parameter in ContentPackHandlerV2#load + #### Release 1.0.3 Fixed #82 | 1.7.10 - 1.16.5:\ diff --git a/VERSION b/VERSION index 21e8796a..ee90284c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.3 +1.0.4 diff --git a/build.gradle b/build.gradle index fa87bfed..11fa833d 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ buildscript { apply plugin: 'cam72cam.universalmodcore' apply plugin: 'maven' -String version = '1.0.3' +String version = '1.0.4' universalmodcore { modPackage = 'net.landofrails.landofsignals' diff --git a/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandlerV2.java b/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandlerV2.java index 89798363..4ecc402d 100644 --- a/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandlerV2.java +++ b/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandlerV2.java @@ -63,7 +63,7 @@ public static void load(ZipFile zip, String name, boolean isUTF8) throws IOExcep contentPack.getContentSets().forEach(path -> loadSet(zip, path, contentPack, isUTF8)); } if (!hasContent && !hasContentSets) { - ModCore.warn("ContentPack %s does not contain any blocks"); + ModCore.warn("ContentPack %s does not contain any blocks", contentPack.getId()); } } From 015db4c28eda1796221e0b1db519131d5e7a50b5 Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Mon, 15 May 2023 16:01:30 +0200 Subject: [PATCH 08/52] Unified publish workflows --- .github/workflows/{release-alpha.yml => publish-alpha.yml} | 2 +- .github/workflows/{release-beta.yml => publish-beta.yml} | 2 +- .github/workflows/{release-release.yml => publish-release.yml} | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename .github/workflows/{release-alpha.yml => publish-alpha.yml} (99%) rename .github/workflows/{release-beta.yml => publish-beta.yml} (99%) rename .github/workflows/{release-release.yml => publish-release.yml} (99%) diff --git a/.github/workflows/release-alpha.yml b/.github/workflows/publish-alpha.yml similarity index 99% rename from .github/workflows/release-alpha.yml rename to .github/workflows/publish-alpha.yml index 85767e3c..33caf198 100644 --- a/.github/workflows/release-alpha.yml +++ b/.github/workflows/publish-alpha.yml @@ -1,4 +1,4 @@ -name: LandOfSignals Release Alpha Pipeline +name: LandOfSignals Publish-Alpha Pipeline on: [ workflow_dispatch ] diff --git a/.github/workflows/release-beta.yml b/.github/workflows/publish-beta.yml similarity index 99% rename from .github/workflows/release-beta.yml rename to .github/workflows/publish-beta.yml index d38a8497..8f152d16 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/publish-beta.yml @@ -1,4 +1,4 @@ -name: LandOfSignals Release-Beta Pipeline +name: LandOfSignals Publish-Beta Pipeline on: [ workflow_dispatch ] diff --git a/.github/workflows/release-release.yml b/.github/workflows/publish-release.yml similarity index 99% rename from .github/workflows/release-release.yml rename to .github/workflows/publish-release.yml index 74a625d4..f7aca1ac 100644 --- a/.github/workflows/release-release.yml +++ b/.github/workflows/publish-release.yml @@ -1,4 +1,4 @@ -name: LandOfSignals Release Pipeline +name: LandOfSignals Publish-Release Pipeline on: [ workflow_dispatch ] From 2eb199af2f5df5727fb8289bfaf94c51a4e4fdd9 Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Mon, 15 May 2023 16:07:33 +0200 Subject: [PATCH 09/52] Removed dumb "-" for SUFFIX --- .github/workflows/publish-alpha.yml | 4 ++-- .github/workflows/publish-beta.yml | 4 ++-- .github/workflows/publish-release.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-alpha.yml b/.github/workflows/publish-alpha.yml index 33caf198..756a8171 100644 --- a/.github/workflows/publish-alpha.yml +++ b/.github/workflows/publish-alpha.yml @@ -94,14 +94,14 @@ jobs: id: getsuffix run: echo "::set-output name=suffix::$(cat SUFFIX)" - name: Rename with suffix - run: mv -n build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}.jar build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}-${{ steps.getsuffix.outputs.suffix }}.jar + run: mv -n build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}.jar build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar - name: Upload to CurseForge ${{matrix.branch}} uses: MarkenJaden/curseforge-upload@master with: token: ${{ secrets.LANDOFSIGNALS_UPLOAD }} project_id: 434307 game_endpoint: minecraft - file_path: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}-${{ steps.getsuffix.outputs.suffix }}.jar + file_path: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar changelog: ${{ steps.getchangelog.outputs.content }} changelog_type: markdown game_versions: ${{ matrix.version }} diff --git a/.github/workflows/publish-beta.yml b/.github/workflows/publish-beta.yml index 8f152d16..8ea3d6bf 100644 --- a/.github/workflows/publish-beta.yml +++ b/.github/workflows/publish-beta.yml @@ -94,14 +94,14 @@ jobs: id: getsuffix run: echo "::set-output name=suffix::$(cat SUFFIX)" - name: Rename with suffix - run: mv -n build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}.jar build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}-${{ steps.getsuffix.outputs.suffix }}.jar + run: mv -n build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}.jar build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar - name: Upload to CurseForge ${{matrix.branch}} uses: MarkenJaden/curseforge-upload@master with: token: ${{ secrets.LANDOFSIGNALS_UPLOAD }} project_id: 434307 game_endpoint: minecraft - file_path: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}-${{ steps.getsuffix.outputs.suffix }}.jar + file_path: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar changelog: ${{ steps.getchangelog.outputs.content }} changelog_type: markdown game_versions: ${{ matrix.version }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index f7aca1ac..1a10ee1f 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -94,14 +94,14 @@ jobs: id: getsuffix run: echo "::set-output name=suffix::$(cat SUFFIX)" - name: Rename with suffix - run: mv -n build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}.jar build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}-${{ steps.getsuffix.outputs.suffix }}.jar + run: mv -n build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}.jar build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar - name: Upload to CurseForge ${{matrix.branch}} uses: MarkenJaden/curseforge-upload@master with: token: ${{ secrets.LANDOFSIGNALS_UPLOAD }} project_id: 434307 game_endpoint: minecraft - file_path: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}-${{ steps.getsuffix.outputs.suffix }}.jar + file_path: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar changelog: ${{ steps.getchangelog.outputs.content }} changelog_type: markdown game_versions: ${{ matrix.version }} From 2941f05d19df2be6f7c0d69684e4bd07a67bca10 Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Mon, 15 May 2023 14:11:43 +0000 Subject: [PATCH 10/52] Updated mod version --- src/main/java/net/landofrails/landofsignals/LandOfSignals.java | 2 +- src/main/resources/mcmod.info | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/landofrails/landofsignals/LandOfSignals.java b/src/main/java/net/landofrails/landofsignals/LandOfSignals.java index cfc48dba..5455d57e 100644 --- a/src/main/java/net/landofrails/landofsignals/LandOfSignals.java +++ b/src/main/java/net/landofrails/landofsignals/LandOfSignals.java @@ -28,7 +28,7 @@ public class LandOfSignals extends ModCore.Mod { @SuppressWarnings({"java:S1845"}) public static final String MODID = "landofsignals"; // Current version - public static final String VERSION = "1.0.3"; + public static final String VERSION = "1.0.4"; @Override public String modID() { diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 835553da..bde2ff1e 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "landofsignals", "name": "LandOfSignals", "description": "Adds fancy railroad signals, signs, decor and other stuff to the game. Use best in combination with a train mod.", - "version": "1.0.3", + "version": "1.0.4" "mcversion": "1.12.2", "url": "https://discord.gg/ykAqHKYjVM", "updateUrl": "https://www.curseforge.com/minecraft/mc-mods/landofsignals", From ae74bf15d8b14ba38123134187db2c636790e0c6 Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Mon, 15 May 2023 16:17:15 +0200 Subject: [PATCH 11/52] Fixed missing "," for mcmod.info --- .github/workflows/publish-alpha.yml | 2 +- .github/workflows/publish-beta.yml | 2 +- .github/workflows/publish-release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-alpha.yml b/.github/workflows/publish-alpha.yml index 756a8171..972737c9 100644 --- a/.github/workflows/publish-alpha.yml +++ b/.github/workflows/publish-alpha.yml @@ -20,7 +20,7 @@ jobs: run: | sed -i 's/public static final String VERSION.*/public static final String VERSION = "${{ steps.getversion.outputs.version }}";/' src/main/java/net/landofrails/landofsignals/LandOfSignals.java sed -i "s/String version =.*/String version = '${{ steps.getversion.outputs.version }}'/" ./build.gradle - sed -i 's/"version":.*/"version": "${{ steps.getversion.outputs.version }}"/' src/main/resources/mcmod.info + sed -i 's/"version":.*/"version": "${{ steps.getversion.outputs.version }}",/' src/main/resources/mcmod.info - name: Commit and push changes run: | git config --global user.name "MarkenJaden" diff --git a/.github/workflows/publish-beta.yml b/.github/workflows/publish-beta.yml index 8ea3d6bf..3af9772e 100644 --- a/.github/workflows/publish-beta.yml +++ b/.github/workflows/publish-beta.yml @@ -20,7 +20,7 @@ jobs: run: | sed -i 's/public static final String VERSION.*/public static final String VERSION = "${{ steps.getversion.outputs.version }}";/' src/main/java/net/landofrails/landofsignals/LandOfSignals.java sed -i "s/String version =.*/String version = '${{ steps.getversion.outputs.version }}'/" ./build.gradle - sed -i 's/"version":.*/"version": "${{ steps.getversion.outputs.version }}"/' src/main/resources/mcmod.info + sed -i 's/"version":.*/"version": "${{ steps.getversion.outputs.version }}",/' src/main/resources/mcmod.info - name: Commit and push changes run: | git config --global user.name "MarkenJaden" diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 1a10ee1f..dbf25108 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -20,7 +20,7 @@ jobs: run: | sed -i 's/public static final String VERSION.*/public static final String VERSION = "${{ steps.getversion.outputs.version }}";/' src/main/java/net/landofrails/landofsignals/LandOfSignals.java sed -i "s/String version =.*/String version = '${{ steps.getversion.outputs.version }}'/" ./build.gradle - sed -i 's/"version":.*/"version": "${{ steps.getversion.outputs.version }}"/' src/main/resources/mcmod.info + sed -i 's/"version":.*/"version": "${{ steps.getversion.outputs.version }}",/' src/main/resources/mcmod.info - name: Commit and push changes run: | git config --global user.name "MarkenJaden" From 83d6763a181c023ef9bd63bcd35ab2b902f2d02f Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Mon, 15 May 2023 14:29:07 +0000 Subject: [PATCH 12/52] Updated mod version --- src/main/resources/mcmod.info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index bde2ff1e..cc1076b1 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "landofsignals", "name": "LandOfSignals", "description": "Adds fancy railroad signals, signs, decor and other stuff to the game. Use best in combination with a train mod.", - "version": "1.0.4" + "version": "1.0.4", "mcversion": "1.12.2", "url": "https://discord.gg/ykAqHKYjVM", "updateUrl": "https://www.curseforge.com/minecraft/mc-mods/landofsignals", From 8eca8bf6e0961928ebe6ba51e22bd588d3ff982a Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Mon, 15 May 2023 21:59:45 +0200 Subject: [PATCH 13/52] Updated workflows according to https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ Removed test.yml --- .github/workflows/publish-alpha.yml | 10 ++++----- .github/workflows/publish-beta.yml | 10 ++++----- .github/workflows/publish-release.yml | 10 ++++----- .github/workflows/test.yml | 29 --------------------------- 4 files changed, 15 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/publish-alpha.yml b/.github/workflows/publish-alpha.yml index 972737c9..e4656031 100644 --- a/.github/workflows/publish-alpha.yml +++ b/.github/workflows/publish-alpha.yml @@ -12,10 +12,10 @@ jobs: - name: Read VERSION file id: getversion - run: echo "::set-output name=version::$(cat VERSION)" + run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT - name: Read SUFFIX file id: getsuffix - run: echo "::set-output name=suffix::$(cat SUFFIX)" + run: echo "suffix=$(cat SUFFIX)" >> $GITHUB_OUTPUT - name: Replace version number with new version run: | sed -i 's/public static final String VERSION.*/public static final String VERSION = "${{ steps.getversion.outputs.version }}";/' src/main/java/net/landofrails/landofsignals/LandOfSignals.java @@ -84,15 +84,15 @@ jobs: path: build/libs/LandOfSignals-${{matrix.branch}}-* - name: Read CHANGELOG.md file id: getchangelog - uses: juliangruber/read-file-action@v1.1.4 + uses: juliangruber/read-file-action@v1.1.6 with: path: ./CHANGELOG.md - name: Read VERSION file id: getversion - run: echo "::set-output name=version::$(cat VERSION)" + run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT - name: Read SUFFIX file id: getsuffix - run: echo "::set-output name=suffix::$(cat SUFFIX)" + run: echo "suffix=$(cat SUFFIX)" >> $GITHUB_OUTPUT - name: Rename with suffix run: mv -n build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}.jar build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar - name: Upload to CurseForge ${{matrix.branch}} diff --git a/.github/workflows/publish-beta.yml b/.github/workflows/publish-beta.yml index 3af9772e..b8c5749e 100644 --- a/.github/workflows/publish-beta.yml +++ b/.github/workflows/publish-beta.yml @@ -12,10 +12,10 @@ jobs: - name: Read VERSION file id: getversion - run: echo "::set-output name=version::$(cat VERSION)" + run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT - name: Read SUFFIX file id: getsuffix - run: echo "::set-output name=suffix::$(cat SUFFIX)" + run: echo "suffix=$(cat SUFFIX)" >> $GITHUB_OUTPUT - name: Replace version number with new version run: | sed -i 's/public static final String VERSION.*/public static final String VERSION = "${{ steps.getversion.outputs.version }}";/' src/main/java/net/landofrails/landofsignals/LandOfSignals.java @@ -84,15 +84,15 @@ jobs: path: build/libs/LandOfSignals-${{matrix.branch}}-* - name: Read CHANGELOG.md file id: getchangelog - uses: juliangruber/read-file-action@v1.1.4 + uses: juliangruber/read-file-action@v1.1.6 with: path: ./CHANGELOG.md - name: Read VERSION file id: getversion - run: echo "::set-output name=version::$(cat VERSION)" + run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT - name: Read SUFFIX file id: getsuffix - run: echo "::set-output name=suffix::$(cat SUFFIX)" + run: echo "suffix=$(cat SUFFIX)" >> $GITHUB_OUTPUT - name: Rename with suffix run: mv -n build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}.jar build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar - name: Upload to CurseForge ${{matrix.branch}} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index dbf25108..7e838920 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -12,10 +12,10 @@ jobs: - name: Read VERSION file id: getversion - run: echo "::set-output name=version::$(cat VERSION)" + run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT - name: Read SUFFIX file id: getsuffix - run: echo "::set-output name=suffix::$(cat SUFFIX)" + run: echo "suffix=$(cat SUFFIX)" >> $GITHUB_OUTPUT - name: Replace version number with new version run: | sed -i 's/public static final String VERSION.*/public static final String VERSION = "${{ steps.getversion.outputs.version }}";/' src/main/java/net/landofrails/landofsignals/LandOfSignals.java @@ -84,15 +84,15 @@ jobs: path: build/libs/LandOfSignals-${{matrix.branch}}-* - name: Read CHANGELOG.md file id: getchangelog - uses: juliangruber/read-file-action@v1.1.4 + uses: juliangruber/read-file-action@v1.1.6 with: path: ./CHANGELOG.md - name: Read VERSION file id: getversion - run: echo "::set-output name=version::$(cat VERSION)" + run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT - name: Read SUFFIX file id: getsuffix - run: echo "::set-output name=suffix::$(cat SUFFIX)" + run: echo "suffix=$(cat SUFFIX)" >> $GITHUB_OUTPUT - name: Rename with suffix run: mv -n build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}.jar build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar - name: Upload to CurseForge ${{matrix.branch}} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index cb14a7e1..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Test Pipeline - -on: [ workflow_dispatch ] - -jobs: - versioncommit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - token: ${{ secrets.PAT }} - - - name: Read VERSION file - id: getversion - run: echo "::set-output name=version::$(cat VERSION)" - - name: Read SUFFIX file - id: getsuffix - run: echo "::set-output name=suffix::$(cat SUFFIX)" - - name: Replace version number with new version - run: | - sed -i 's/public static final String VERSION.*/public static final String VERSION = "${{ steps.getversion.outputs.version }}";/' src/main/java/net/landofrails/landofsignals/LandOfSignals.java - sed -i "s/String version =.*/String version = '${{ steps.getversion.outputs.version }}'/" ./build.gradle - - name: Commit and push changes - run: | - git config --global user.name "MarkenJaden" - git config --global user.email "jjsch1410@gmail.com" - git add -A - git commit -m "Updated mod version" - git push From f241bb1dbb67ff66567a2a91e72c1d9165e32703 Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Mon, 15 May 2023 22:54:12 +0200 Subject: [PATCH 14/52] Updated workflows using new github actions to publish mod --- .github/workflows/publish-alpha.yml | 49 +++++++++++++++++++++------ .github/workflows/publish-beta.yml | 49 +++++++++++++++++++++------ .github/workflows/publish-release.yml | 49 +++++++++++++++++++++------ 3 files changed, 114 insertions(+), 33 deletions(-) diff --git a/.github/workflows/publish-alpha.yml b/.github/workflows/publish-alpha.yml index e4656031..26b712b6 100644 --- a/.github/workflows/publish-alpha.yml +++ b/.github/workflows/publish-alpha.yml @@ -95,15 +95,42 @@ jobs: run: echo "suffix=$(cat SUFFIX)" >> $GITHUB_OUTPUT - name: Rename with suffix run: mv -n build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}.jar build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar - - name: Upload to CurseForge ${{matrix.branch}} - uses: MarkenJaden/curseforge-upload@master + - name: Upload ${{matrix.branch}} + uses: Kir-Antipov/mc-publish@master with: - token: ${{ secrets.LANDOFSIGNALS_UPLOAD }} - project_id: 434307 - game_endpoint: minecraft - file_path: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar - changelog: ${{ steps.getchangelog.outputs.content }} - changelog_type: markdown - game_versions: ${{ matrix.version }} - release_type: alpha - relations: universal-mod-core:requiredDependency + # Modrinth + modrinth-id: r7aBIx6Q + modrinth-featured: true + modrinth-unfeature-mode: subset + modrinth-token: ${{ secrets.MODRINTH_TOKEN }} + + # CurseForge + curseforge-id: 434307 + curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} + curseforge-dependencies: | + universal-mod-core | depends | * + + # GitHub + github-tag: v${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} + github-generate-changelog: true + github-draft: false + github-prerelease: false + github-discussion: Announcements + github-token: ${{ secrets.GITHUB_TOKEN }} + + files: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar + + version: ${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} + version-type: alpha + changelog-file: CHANGELOG.md + + loaders: | + forge + game-versions: | + ${{ matrix.version }} + java: | + 8 + + retry-attempts: 2 + retry-delay: 10000 + fail-mode: fail diff --git a/.github/workflows/publish-beta.yml b/.github/workflows/publish-beta.yml index b8c5749e..83bf312a 100644 --- a/.github/workflows/publish-beta.yml +++ b/.github/workflows/publish-beta.yml @@ -95,15 +95,42 @@ jobs: run: echo "suffix=$(cat SUFFIX)" >> $GITHUB_OUTPUT - name: Rename with suffix run: mv -n build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}.jar build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar - - name: Upload to CurseForge ${{matrix.branch}} - uses: MarkenJaden/curseforge-upload@master + - name: Upload ${{matrix.branch}} + uses: Kir-Antipov/mc-publish@master with: - token: ${{ secrets.LANDOFSIGNALS_UPLOAD }} - project_id: 434307 - game_endpoint: minecraft - file_path: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar - changelog: ${{ steps.getchangelog.outputs.content }} - changelog_type: markdown - game_versions: ${{ matrix.version }} - release_type: beta - relations: universal-mod-core:requiredDependency + # Modrinth + modrinth-id: r7aBIx6Q + modrinth-featured: true + modrinth-unfeature-mode: subset + modrinth-token: ${{ secrets.MODRINTH_TOKEN }} + + # CurseForge + curseforge-id: 434307 + curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} + curseforge-dependencies: | + universal-mod-core | depends | * + + # GitHub + github-tag: v${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} + github-generate-changelog: true + github-draft: false + github-prerelease: false + github-discussion: Announcements + github-token: ${{ secrets.GITHUB_TOKEN }} + + files: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar + + version: ${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} + version-type: beta + changelog-file: CHANGELOG.md + + loaders: | + forge + game-versions: | + ${{ matrix.version }} + java: | + 8 + + retry-attempts: 2 + retry-delay: 10000 + fail-mode: fail diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 7e838920..74987c5a 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -95,15 +95,42 @@ jobs: run: echo "suffix=$(cat SUFFIX)" >> $GITHUB_OUTPUT - name: Rename with suffix run: mv -n build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}.jar build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar - - name: Upload to CurseForge ${{matrix.branch}} - uses: MarkenJaden/curseforge-upload@master + - name: Upload ${{matrix.branch}} + uses: Kir-Antipov/mc-publish@master with: - token: ${{ secrets.LANDOFSIGNALS_UPLOAD }} - project_id: 434307 - game_endpoint: minecraft - file_path: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar - changelog: ${{ steps.getchangelog.outputs.content }} - changelog_type: markdown - game_versions: ${{ matrix.version }} - release_type: release - relations: universal-mod-core:requiredDependency + # Modrinth + modrinth-id: r7aBIx6Q + modrinth-featured: true + modrinth-unfeature-mode: subset + modrinth-token: ${{ secrets.MODRINTH_TOKEN }} + + # CurseForge + curseforge-id: 434307 + curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} + curseforge-dependencies: | + universal-mod-core | depends | * + + # GitHub + github-tag: v${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} + github-generate-changelog: true + github-draft: false + github-prerelease: false + github-discussion: Announcements + github-token: ${{ secrets.GITHUB_TOKEN }} + + files: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar + + version: ${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} + version-type: release + changelog-file: CHANGELOG.md + + loaders: | + forge + game-versions: | + ${{ matrix.version }} + java: | + 8 + + retry-attempts: 2 + retry-delay: 10000 + fail-mode: fail From b44537a5eb99dcff1b26bc0d7fa17c9cce6dca45 Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Mon, 15 May 2023 22:55:18 +0200 Subject: [PATCH 15/52] Commented out CurseForge cause the newest version is already there --- .github/workflows/publish-alpha.yml | 8 ++++---- .github/workflows/publish-release.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish-alpha.yml b/.github/workflows/publish-alpha.yml index 26b712b6..0441b60e 100644 --- a/.github/workflows/publish-alpha.yml +++ b/.github/workflows/publish-alpha.yml @@ -105,10 +105,10 @@ jobs: modrinth-token: ${{ secrets.MODRINTH_TOKEN }} # CurseForge - curseforge-id: 434307 - curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} - curseforge-dependencies: | - universal-mod-core | depends | * + #curseforge-id: 434307 + #curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} + #curseforge-dependencies: | + # universal-mod-core | depends | * # GitHub github-tag: v${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 74987c5a..eb61f428 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -105,10 +105,10 @@ jobs: modrinth-token: ${{ secrets.MODRINTH_TOKEN }} # CurseForge - curseforge-id: 434307 - curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} - curseforge-dependencies: | - universal-mod-core | depends | * + #curseforge-id: 434307 + #curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} + #curseforge-dependencies: | + # universal-mod-core | depends | * # GitHub github-tag: v${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} From 5e5ab1cd2cb523abdaa0c9e8fe051afee02ad90f Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Mon, 15 May 2023 23:40:30 +0200 Subject: [PATCH 16/52] Updated workflow to use input choice instead of three different but yet similar workflows --- .github/workflows/publish-beta.yml | 136 ------------------ .github/workflows/publish-release.yml | 136 ------------------ .../{publish-alpha.yml => publish.yml} | 105 ++++++++------ 3 files changed, 61 insertions(+), 316 deletions(-) delete mode 100644 .github/workflows/publish-beta.yml delete mode 100644 .github/workflows/publish-release.yml rename .github/workflows/{publish-alpha.yml => publish.yml} (66%) diff --git a/.github/workflows/publish-beta.yml b/.github/workflows/publish-beta.yml deleted file mode 100644 index 83bf312a..00000000 --- a/.github/workflows/publish-beta.yml +++ /dev/null @@ -1,136 +0,0 @@ -name: LandOfSignals Publish-Beta Pipeline - -on: [ workflow_dispatch ] - -jobs: - versioncommit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - token: ${{ secrets.PAT }} - - - name: Read VERSION file - id: getversion - run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT - - name: Read SUFFIX file - id: getsuffix - run: echo "suffix=$(cat SUFFIX)" >> $GITHUB_OUTPUT - - name: Replace version number with new version - run: | - sed -i 's/public static final String VERSION.*/public static final String VERSION = "${{ steps.getversion.outputs.version }}";/' src/main/java/net/landofrails/landofsignals/LandOfSignals.java - sed -i "s/String version =.*/String version = '${{ steps.getversion.outputs.version }}'/" ./build.gradle - sed -i 's/"version":.*/"version": "${{ steps.getversion.outputs.version }}",/' src/main/resources/mcmod.info - - name: Commit and push changes - run: | - git config --global user.name "MarkenJaden" - git config --global user.email "jjsch1410@gmail.com" - git add -A - git diff-index --quiet HEAD || git commit -m "Updated mod version" - git push - - build: - runs-on: ubuntu-latest - strategy: - max-parallel: 1 - matrix: - branch: [ 1.7.10-forge, 1.10.2-forge, 1.11.2-forge, 1.12.2-forge, 1.14.4-forge, 1.15.2-forge, 1.16.5-forge ] - include: - - branch: 1.7.10-forge - version: 1.7.10 - - branch: 1.10.2-forge - version: 1.10.2 - - branch: 1.11.2-forge - version: 1.11.2 - - branch: 1.12.2-forge - version: 1.12.2 - - branch: 1.14.4-forge - version: 1.14.4 - - branch: 1.15.2-forge - version: 1.15.2 - - branch: 1.16.5-forge - version: 1.16.5 - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: '1.8' # The JDK version to make available on the path. - java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk - architecture: x64 # (x64 or x86) - defaults to x64 - - name: Install deps - run: sudo apt install -y pngquant findutils xvfb - - name: Hack Forge Gradle - run: mkdir -p ~/.gradle/caches/minecraft/; wget 'https://teamopenindustry.cc/maven/hack/ForgeGradleVersion.json' -O ~/.gradle/caches/minecraft/ForgeGradleVersion.json - - name: Setup Universal Mod Core (and helpers) - env: - BRANCH: ${{ matrix.branch }} - run: ./gradlew umc -D umc.loader=${BRANCH} -D ssh.http=true -Dtarget=release - - name: Hack Forge Gradle Part Two - env: - BRANCH: ${{ matrix.branch }} - run: git apply --ignore-space-change --ignore-whitespace ${BRANCH}.patch || true - - name: Gradle compile - run: ./gradlew classes - - name: Process images - run: find src/main/resources/assets/landofsignals/ | grep png | xargs -I foo pngquant -s1 -f --ext .png foo - - name: Run Data (optionalish) - run: xvfb-run --auto-servernum ./gradlew runData || xvfb-run --auto-servernum ./gradlew runData || true - - name: Gradle build - run: ./gradlew build -Dtarget=release - - uses: actions/upload-artifact@v3 - with: - name: LandOfSignals ${{matrix.branch}} - path: build/libs/LandOfSignals-${{matrix.branch}}-* - - name: Read CHANGELOG.md file - id: getchangelog - uses: juliangruber/read-file-action@v1.1.6 - with: - path: ./CHANGELOG.md - - name: Read VERSION file - id: getversion - run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT - - name: Read SUFFIX file - id: getsuffix - run: echo "suffix=$(cat SUFFIX)" >> $GITHUB_OUTPUT - - name: Rename with suffix - run: mv -n build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}.jar build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar - - name: Upload ${{matrix.branch}} - uses: Kir-Antipov/mc-publish@master - with: - # Modrinth - modrinth-id: r7aBIx6Q - modrinth-featured: true - modrinth-unfeature-mode: subset - modrinth-token: ${{ secrets.MODRINTH_TOKEN }} - - # CurseForge - curseforge-id: 434307 - curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} - curseforge-dependencies: | - universal-mod-core | depends | * - - # GitHub - github-tag: v${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} - github-generate-changelog: true - github-draft: false - github-prerelease: false - github-discussion: Announcements - github-token: ${{ secrets.GITHUB_TOKEN }} - - files: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar - - version: ${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} - version-type: beta - changelog-file: CHANGELOG.md - - loaders: | - forge - game-versions: | - ${{ matrix.version }} - java: | - 8 - - retry-attempts: 2 - retry-delay: 10000 - fail-mode: fail diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml deleted file mode 100644 index eb61f428..00000000 --- a/.github/workflows/publish-release.yml +++ /dev/null @@ -1,136 +0,0 @@ -name: LandOfSignals Publish-Release Pipeline - -on: [ workflow_dispatch ] - -jobs: - versioncommit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - token: ${{ secrets.PAT }} - - - name: Read VERSION file - id: getversion - run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT - - name: Read SUFFIX file - id: getsuffix - run: echo "suffix=$(cat SUFFIX)" >> $GITHUB_OUTPUT - - name: Replace version number with new version - run: | - sed -i 's/public static final String VERSION.*/public static final String VERSION = "${{ steps.getversion.outputs.version }}";/' src/main/java/net/landofrails/landofsignals/LandOfSignals.java - sed -i "s/String version =.*/String version = '${{ steps.getversion.outputs.version }}'/" ./build.gradle - sed -i 's/"version":.*/"version": "${{ steps.getversion.outputs.version }}",/' src/main/resources/mcmod.info - - name: Commit and push changes - run: | - git config --global user.name "MarkenJaden" - git config --global user.email "jjsch1410@gmail.com" - git add -A - git diff-index --quiet HEAD || git commit -m "Updated mod version" - git push - - build: - runs-on: ubuntu-latest - strategy: - max-parallel: 1 - matrix: - branch: [ 1.7.10-forge, 1.10.2-forge, 1.11.2-forge, 1.12.2-forge, 1.14.4-forge, 1.15.2-forge, 1.16.5-forge ] - include: - - branch: 1.7.10-forge - version: 1.7.10 - - branch: 1.10.2-forge - version: 1.10.2 - - branch: 1.11.2-forge - version: 1.11.2 - - branch: 1.12.2-forge - version: 1.12.2 - - branch: 1.14.4-forge - version: 1.14.4 - - branch: 1.15.2-forge - version: 1.15.2 - - branch: 1.16.5-forge - version: 1.16.5 - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: '1.8' # The JDK version to make available on the path. - java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk - architecture: x64 # (x64 or x86) - defaults to x64 - - name: Install deps - run: sudo apt install -y pngquant findutils xvfb - - name: Hack Forge Gradle - run: mkdir -p ~/.gradle/caches/minecraft/; wget 'https://teamopenindustry.cc/maven/hack/ForgeGradleVersion.json' -O ~/.gradle/caches/minecraft/ForgeGradleVersion.json - - name: Setup Universal Mod Core (and helpers) - env: - BRANCH: ${{ matrix.branch }} - run: ./gradlew umc -D umc.loader=${BRANCH} -D ssh.http=true -Dtarget=release - - name: Hack Forge Gradle Part Two - env: - BRANCH: ${{ matrix.branch }} - run: git apply --ignore-space-change --ignore-whitespace ${BRANCH}.patch || true - - name: Gradle compile - run: ./gradlew classes - - name: Process images - run: find src/main/resources/assets/landofsignals/ | grep png | xargs -I foo pngquant -s1 -f --ext .png foo - - name: Run Data (optionalish) - run: xvfb-run --auto-servernum ./gradlew runData || xvfb-run --auto-servernum ./gradlew runData || true - - name: Gradle build - run: ./gradlew build -Dtarget=release - - uses: actions/upload-artifact@v3 - with: - name: LandOfSignals ${{matrix.branch}} - path: build/libs/LandOfSignals-${{matrix.branch}}-* - - name: Read CHANGELOG.md file - id: getchangelog - uses: juliangruber/read-file-action@v1.1.6 - with: - path: ./CHANGELOG.md - - name: Read VERSION file - id: getversion - run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT - - name: Read SUFFIX file - id: getsuffix - run: echo "suffix=$(cat SUFFIX)" >> $GITHUB_OUTPUT - - name: Rename with suffix - run: mv -n build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}.jar build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar - - name: Upload ${{matrix.branch}} - uses: Kir-Antipov/mc-publish@master - with: - # Modrinth - modrinth-id: r7aBIx6Q - modrinth-featured: true - modrinth-unfeature-mode: subset - modrinth-token: ${{ secrets.MODRINTH_TOKEN }} - - # CurseForge - #curseforge-id: 434307 - #curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} - #curseforge-dependencies: | - # universal-mod-core | depends | * - - # GitHub - github-tag: v${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} - github-generate-changelog: true - github-draft: false - github-prerelease: false - github-discussion: Announcements - github-token: ${{ secrets.GITHUB_TOKEN }} - - files: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar - - version: ${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} - version-type: release - changelog-file: CHANGELOG.md - - loaders: | - forge - game-versions: | - ${{ matrix.version }} - java: | - 8 - - retry-attempts: 2 - retry-delay: 10000 - fail-mode: fail diff --git a/.github/workflows/publish-alpha.yml b/.github/workflows/publish.yml similarity index 66% rename from .github/workflows/publish-alpha.yml rename to .github/workflows/publish.yml index 0441b60e..f9978602 100644 --- a/.github/workflows/publish-alpha.yml +++ b/.github/workflows/publish.yml @@ -1,6 +1,16 @@ -name: LandOfSignals Publish-Alpha Pipeline +name: LandOfSignals Publish Pipeline -on: [ workflow_dispatch ] +on: + workflow_dispatch: + inputs: + type: + description: 'Type of release' + required: true + default: 'release' + options: + - 'alpha' + - 'beta' + - 'release' jobs: versioncommit: @@ -78,10 +88,6 @@ jobs: run: xvfb-run --auto-servernum ./gradlew runData || xvfb-run --auto-servernum ./gradlew runData || true - name: Gradle build run: ./gradlew build -Dtarget=release - - uses: actions/upload-artifact@v3 - with: - name: LandOfSignals ${{matrix.branch}} - path: build/libs/LandOfSignals-${{matrix.branch}}-* - name: Read CHANGELOG.md file id: getchangelog uses: juliangruber/read-file-action@v1.1.6 @@ -95,42 +101,53 @@ jobs: run: echo "suffix=$(cat SUFFIX)" >> $GITHUB_OUTPUT - name: Rename with suffix run: mv -n build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}.jar build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar - - name: Upload ${{matrix.branch}} - uses: Kir-Antipov/mc-publish@master + - uses: actions/upload-artifact@v3 with: - # Modrinth - modrinth-id: r7aBIx6Q - modrinth-featured: true - modrinth-unfeature-mode: subset - modrinth-token: ${{ secrets.MODRINTH_TOKEN }} - - # CurseForge - #curseforge-id: 434307 - #curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} - #curseforge-dependencies: | - # universal-mod-core | depends | * - - # GitHub - github-tag: v${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} - github-generate-changelog: true - github-draft: false - github-prerelease: false - github-discussion: Announcements - github-token: ${{ secrets.GITHUB_TOKEN }} - - files: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar - - version: ${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} - version-type: alpha - changelog-file: CHANGELOG.md - - loaders: | - forge - game-versions: | - ${{ matrix.version }} - java: | - 8 - - retry-attempts: 2 - retry-delay: 10000 - fail-mode: fail + name: LandOfSignals ${{matrix.branch}} + path: build/libs/LandOfSignals-* +# - uses: cloudposse/github-action-matrix-outputs-write@main +# id: out +# with: +# matrix-step-name: ${{ github.job }} +# matrix-key: ${{ matrix.branch }} +# outputs: |- +# image: ${{ steps.build.outputs.image }}:${{ steps.build.outputs.tag }} +# - name: Upload ${{matrix.branch}} +# uses: Kir-Antipov/mc-publish@master +# with: +# # Modrinth +# modrinth-id: r7aBIx6Q +# modrinth-featured: true +# modrinth-unfeature-mode: subset +# modrinth-token: ${{ secrets.MODRINTH_TOKEN }} +# +# # CurseForge +# #curseforge-id: 434307 +# #curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} +# #curseforge-dependencies: | +# # universal-mod-core | depends | * +# +# # GitHub +# github-tag: v${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} +# github-generate-changelog: true +# github-draft: false +# github-prerelease: false +# github-discussion: Announcements +# github-token: ${{ secrets.GITHUB_TOKEN }} +# +# files: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar +# +# version: ${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} +# version-type: ${{ inputs.type }} +# changelog-file: CHANGELOG.md +# +# loaders: | +# forge +# game-versions: | +# ${{ matrix.version }} +# java: | +# 8 +# +# retry-attempts: 2 +# retry-delay: 10000 +# fail-mode: fail From 2674243e995e26d5c4e3bf2ccac381be8a982a66 Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Mon, 15 May 2023 23:42:36 +0200 Subject: [PATCH 17/52] Added missing "choice" type --- .github/workflows/publish.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f9978602..d70ce15c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,10 +7,11 @@ on: description: 'Type of release' required: true default: 'release' + type: choice options: - - 'alpha' - - 'beta' - - 'release' + - alpha + - beta + - release jobs: versioncommit: From c90dc368bb55b7f26e428660dfd601269877ab25 Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Mon, 15 May 2023 23:49:36 +0200 Subject: [PATCH 18/52] Removed 1.7.10 cause forge is shit --- .github/workflows/publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d70ce15c..4fed79aa 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -45,10 +45,10 @@ jobs: strategy: max-parallel: 1 matrix: - branch: [ 1.7.10-forge, 1.10.2-forge, 1.11.2-forge, 1.12.2-forge, 1.14.4-forge, 1.15.2-forge, 1.16.5-forge ] + branch: [ 1.10.2-forge, 1.11.2-forge, 1.12.2-forge, 1.14.4-forge, 1.15.2-forge, 1.16.5-forge ] include: - - branch: 1.7.10-forge - version: 1.7.10 + # - branch: 1.7.10-forge + # version: 1.7.10 - branch: 1.10.2-forge version: 1.10.2 - branch: 1.11.2-forge From 4ab7de6ff5ea2477c18a4bf013c280bbbb2d88e2 Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Tue, 16 May 2023 00:07:55 +0200 Subject: [PATCH 19/52] Test upload & download artifacts --- .github/workflows/publish.yml | 93 ++++++++++++++++++++++++----------- 1 file changed, 63 insertions(+), 30 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4fed79aa..fbbfb1c1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -53,14 +53,14 @@ jobs: version: 1.10.2 - branch: 1.11.2-forge version: 1.11.2 - - branch: 1.12.2-forge - version: 1.12.2 - - branch: 1.14.4-forge - version: 1.14.4 - - branch: 1.15.2-forge - version: 1.15.2 - - branch: 1.16.5-forge - version: 1.16.5 + # - branch: 1.12.2-forge + # version: 1.12.2 + # - branch: 1.14.4-forge + # version: 1.14.4 + # - branch: 1.15.2-forge + # version: 1.15.2 + # - branch: 1.16.5-forge + # version: 1.16.5 steps: - uses: actions/checkout@v3 - name: Set up JDK 1.8 @@ -105,29 +105,62 @@ jobs: - uses: actions/upload-artifact@v3 with: name: LandOfSignals ${{matrix.branch}} - path: build/libs/LandOfSignals-* -# - uses: cloudposse/github-action-matrix-outputs-write@main -# id: out -# with: -# matrix-step-name: ${{ github.job }} -# matrix-key: ${{ matrix.branch }} -# outputs: |- -# image: ${{ steps.build.outputs.image }}:${{ steps.build.outputs.tag }} -# - name: Upload ${{matrix.branch}} + path: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar + # - name: Upload ${{matrix.branch}} + # uses: Kir-Antipov/mc-publish@master + # with: + # # Modrinth + # modrinth-id: r7aBIx6Q + # modrinth-featured: true + # modrinth-unfeature-mode: subset + # modrinth-token: ${{ secrets.MODRINTH_TOKEN }} + # + # # CurseForge + # #curseforge-id: 434307 + # #curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} + # #curseforge-dependencies: | + # # universal-mod-core | depends | * + # + # # GitHub + # github-tag: v${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} + # github-generate-changelog: true + # github-draft: false + # github-prerelease: false + # github-discussion: Announcements + # github-token: ${{ secrets.GITHUB_TOKEN }} + # + # files: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar + # + # version: ${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} + # version-type: ${{ inputs.type }} + # changelog-file: CHANGELOG.md + # + # loaders: | + # forge + # game-versions: | + # ${{ matrix.version }} + # java: | + # 8 + # + # retry-attempts: 2 + # retry-delay: 10000 + # fail-mode: fail + + package: + runs-on: ubuntu-latest + steps: + - name: Read VERSION file + id: getversion + run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT + - name: Read SUFFIX file + id: getsuffix + run: echo "suffix=$(cat SUFFIX)" >> $GITHUB_OUTPUT + - uses: actions/download-artifact@v3 + - name: Display structure of downloaded files + run: ls -R +# - name: Upload to GitHub # uses: Kir-Antipov/mc-publish@master # with: -# # Modrinth -# modrinth-id: r7aBIx6Q -# modrinth-featured: true -# modrinth-unfeature-mode: subset -# modrinth-token: ${{ secrets.MODRINTH_TOKEN }} -# -# # CurseForge -# #curseforge-id: 434307 -# #curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} -# #curseforge-dependencies: | -# # universal-mod-core | depends | * -# # # GitHub # github-tag: v${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} # github-generate-changelog: true @@ -136,7 +169,7 @@ jobs: # github-discussion: Announcements # github-token: ${{ secrets.GITHUB_TOKEN }} # -# files: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar +# files: LandOfSignals-* # # version: ${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} # version-type: ${{ inputs.type }} From d7feb0b35a3a3162546a6668f5a5d38eb574fe87 Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Tue, 16 May 2023 00:10:49 +0200 Subject: [PATCH 20/52] Added dependency to jobs --- .github/workflows/publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fbbfb1c1..64c2487c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -42,6 +42,7 @@ jobs: build: runs-on: ubuntu-latest + needs: [ versioncommit ] strategy: max-parallel: 1 matrix: @@ -148,6 +149,7 @@ jobs: package: runs-on: ubuntu-latest + needs: [ build ] steps: - name: Read VERSION file id: getversion From 74b8739e4cbec3199b0471ea31fc18fd168736d6 Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Tue, 16 May 2023 00:11:28 +0200 Subject: [PATCH 21/52] Removed trigger on workflow change --- .github/workflows/main.yml | 64 +++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 77cbd6cf..5a5f679a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ on: push: paths: - 'src/**' - - '.github/workflows/**' + # - '.github/workflows/**' workflow_dispatch: @@ -17,36 +17,36 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - branch: [1.7.10-forge, 1.10.2-forge, 1.11.2-forge, 1.12.2-forge, 1.14.4-forge, 1.15.2-forge, 1.16.5-forge] + branch: [ 1.7.10-forge, 1.10.2-forge, 1.11.2-forge, 1.12.2-forge, 1.14.4-forge, 1.15.2-forge, 1.16.5-forge ] steps: - - uses: actions/checkout@v3 - - name: Set up JDK 1.8 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '8' - - name: Install deps - run: sudo apt install -y pngquant findutils xvfb - - name: Hack Forge Gradle - run: mkdir -p ~/.gradle/caches/minecraft/; wget 'https://teamopenindustry.cc/maven/hack/ForgeGradleVersion.json' -O ~/.gradle/caches/minecraft/ForgeGradleVersion.json - - name: Setup Universal Mod Core (and helpers) - env: - BRANCH: ${{ matrix.branch }} - run: ./gradlew umc -D umc.loader=${BRANCH} -D ssh.http=true - - name: Hack Forge Gradle Part Two - env: - BRANCH: ${{ matrix.branch }} - run: git apply --ignore-space-change --ignore-whitespace ${BRANCH}.patch || true - - name: Gradle compile - run: ./gradlew classes - - name: Process images - run: find src/main/resources/assets/landofsignals/ | grep png | xargs -I foo pngquant -s1 -f --ext .png foo - - name: Run Data (optionalish) - run: xvfb-run --auto-servernum ./gradlew runData || xvfb-run --auto-servernum ./gradlew runData || true - - name: Gradle build - run: ./gradlew build - - uses: actions/upload-artifact@v3 - with: - name: LandOfSignals ${{matrix.branch}} - path: build/libs/LandOfSignals-${{matrix.branch}}-* + - uses: actions/checkout@v3 + - name: Set up JDK 1.8 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '8' + - name: Install deps + run: sudo apt install -y pngquant findutils xvfb + - name: Hack Forge Gradle + run: mkdir -p ~/.gradle/caches/minecraft/; wget 'https://teamopenindustry.cc/maven/hack/ForgeGradleVersion.json' -O ~/.gradle/caches/minecraft/ForgeGradleVersion.json + - name: Setup Universal Mod Core (and helpers) + env: + BRANCH: ${{ matrix.branch }} + run: ./gradlew umc -D umc.loader=${BRANCH} -D ssh.http=true + - name: Hack Forge Gradle Part Two + env: + BRANCH: ${{ matrix.branch }} + run: git apply --ignore-space-change --ignore-whitespace ${BRANCH}.patch || true + - name: Gradle compile + run: ./gradlew classes + - name: Process images + run: find src/main/resources/assets/landofsignals/ | grep png | xargs -I foo pngquant -s1 -f --ext .png foo + - name: Run Data (optionalish) + run: xvfb-run --auto-servernum ./gradlew runData || xvfb-run --auto-servernum ./gradlew runData || true + - name: Gradle build + run: ./gradlew build + - uses: actions/upload-artifact@v3 + with: + name: LandOfSignals ${{matrix.branch}} + path: build/libs/LandOfSignals-${{matrix.branch}}-* From b57b711f446cd849cd122e5aa52c5be1502c889f Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Tue, 16 May 2023 00:13:02 +0200 Subject: [PATCH 22/52] Removed other version for testing --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 64c2487c..2ba4e530 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -46,7 +46,7 @@ jobs: strategy: max-parallel: 1 matrix: - branch: [ 1.10.2-forge, 1.11.2-forge, 1.12.2-forge, 1.14.4-forge, 1.15.2-forge, 1.16.5-forge ] + branch: [ 1.10.2-forge, 1.11.2-forge ] include: # - branch: 1.7.10-forge # version: 1.7.10 From 1990a7626d030c7a624ab96868b24316aa18618f Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Tue, 16 May 2023 00:30:11 +0200 Subject: [PATCH 23/52] Complete test --- .github/workflows/publish.yml | 158 +++++++++++++++++----------------- 1 file changed, 79 insertions(+), 79 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2ba4e530..4521903f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -46,22 +46,22 @@ jobs: strategy: max-parallel: 1 matrix: - branch: [ 1.10.2-forge, 1.11.2-forge ] + branch: [ 1.10.2-forge, 1.11.2-forge, 1.12.2-forge, 1.14.4-forge, 1.15.2-forge, 1.16.5-forge ] include: - # - branch: 1.7.10-forge - # version: 1.7.10 + - branch: 1.7.10-forge + version: 1.7.10 - branch: 1.10.2-forge version: 1.10.2 - branch: 1.11.2-forge version: 1.11.2 - # - branch: 1.12.2-forge - # version: 1.12.2 - # - branch: 1.14.4-forge - # version: 1.14.4 - # - branch: 1.15.2-forge - # version: 1.15.2 - # - branch: 1.16.5-forge - # version: 1.16.5 + - branch: 1.12.2-forge + version: 1.12.2 + - branch: 1.14.4-forge + version: 1.14.4 + - branch: 1.15.2-forge + version: 1.15.2 + - branch: 1.16.5-forge + version: 1.16.5 steps: - uses: actions/checkout@v3 - name: Set up JDK 1.8 @@ -107,45 +107,45 @@ jobs: with: name: LandOfSignals ${{matrix.branch}} path: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar - # - name: Upload ${{matrix.branch}} - # uses: Kir-Antipov/mc-publish@master - # with: - # # Modrinth - # modrinth-id: r7aBIx6Q - # modrinth-featured: true - # modrinth-unfeature-mode: subset - # modrinth-token: ${{ secrets.MODRINTH_TOKEN }} - # - # # CurseForge - # #curseforge-id: 434307 - # #curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} - # #curseforge-dependencies: | - # # universal-mod-core | depends | * - # - # # GitHub - # github-tag: v${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} - # github-generate-changelog: true - # github-draft: false - # github-prerelease: false - # github-discussion: Announcements - # github-token: ${{ secrets.GITHUB_TOKEN }} - # - # files: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar - # - # version: ${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} - # version-type: ${{ inputs.type }} - # changelog-file: CHANGELOG.md - # - # loaders: | - # forge - # game-versions: | - # ${{ matrix.version }} - # java: | - # 8 - # - # retry-attempts: 2 - # retry-delay: 10000 - # fail-mode: fail + - name: Upload ${{matrix.branch}} + uses: Kir-Antipov/mc-publish@master + with: + # Modrinth + modrinth-id: r7aBIx6Q + modrinth-featured: true + modrinth-unfeature-mode: subset + modrinth-token: ${{ secrets.MODRINTH_TOKEN }} + + # CurseForge + #curseforge-id: 434307 + #curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} + #curseforge-dependencies: | + # universal-mod-core | depends | * + + # GitHub + github-tag: v${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} + github-generate-changelog: true + github-draft: false + github-prerelease: false + github-discussion: Announcements + github-token: ${{ secrets.GITHUB_TOKEN }} + + files: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar + + version: ${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} + version-type: ${{ inputs.type }} + changelog-file: CHANGELOG.md + + loaders: | + forge + game-versions: | + ${{ matrix.version }} + java: | + 8 + + retry-attempts: 2 + retry-delay: 10000 + fail-mode: fail package: runs-on: ubuntu-latest @@ -158,32 +158,32 @@ jobs: id: getsuffix run: echo "suffix=$(cat SUFFIX)" >> $GITHUB_OUTPUT - uses: actions/download-artifact@v3 - - name: Display structure of downloaded files - run: ls -R -# - name: Upload to GitHub -# uses: Kir-Antipov/mc-publish@master -# with: -# # GitHub -# github-tag: v${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} -# github-generate-changelog: true -# github-draft: false -# github-prerelease: false -# github-discussion: Announcements -# github-token: ${{ secrets.GITHUB_TOKEN }} -# -# files: LandOfSignals-* -# -# version: ${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} -# version-type: ${{ inputs.type }} -# changelog-file: CHANGELOG.md -# -# loaders: | -# forge -# game-versions: | -# ${{ matrix.version }} -# java: | -# 8 -# -# retry-attempts: 2 -# retry-delay: 10000 -# fail-mode: fail + - run: mkdir upload + - run: cp **/LandOfSignals-*.jar upload + - name: Upload to GitHub + uses: Kir-Antipov/mc-publish@master + with: + # GitHub + github-tag: v${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} + github-generate-changelog: true + github-draft: false + github-prerelease: false + github-discussion: Announcements + github-token: ${{ secrets.GITHUB_TOKEN }} + + files: upload/*.jar + + version: ${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} + version-type: ${{ inputs.type }} + changelog-file: CHANGELOG.md + + loaders: | + forge + game-versions: | + ${{ matrix.version }} + java: | + 8 + + retry-attempts: 2 + retry-delay: 10000 + fail-mode: fail From 8157b909644d77690983ebae13b5d1cf2a28d53b Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Tue, 16 May 2023 00:32:05 +0200 Subject: [PATCH 24/52] Fixed dumbness :D --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4521903f..bee43f99 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -46,7 +46,7 @@ jobs: strategy: max-parallel: 1 matrix: - branch: [ 1.10.2-forge, 1.11.2-forge, 1.12.2-forge, 1.14.4-forge, 1.15.2-forge, 1.16.5-forge ] + branch: [ 1.7.10-forge, 1.10.2-forge, 1.11.2-forge, 1.12.2-forge, 1.14.4-forge, 1.15.2-forge, 1.16.5-forge ] include: - branch: 1.7.10-forge version: 1.7.10 From a3d9cd86865463963972b5e011a60ced73a53f07 Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Tue, 16 May 2023 00:41:09 +0200 Subject: [PATCH 25/52] Fixed game-versions --- .github/workflows/publish.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bee43f99..df278a98 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -180,7 +180,13 @@ jobs: loaders: | forge game-versions: | - ${{ matrix.version }} + 1.7.10 + 1.10.2 + 1.11.2 + 1.12.2 + 1.14.4 + 1.15.2 + 1.16.5 java: | 8 From b5e7f3506a625bd57426f7f70c2b29d3d226edbe Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Tue, 16 May 2023 00:48:58 +0200 Subject: [PATCH 26/52] Fixed duplicate github publish --- .github/workflows/publish.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index df278a98..6fd8748c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -121,15 +121,7 @@ jobs: #curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} #curseforge-dependencies: | # universal-mod-core | depends | * - - # GitHub - github-tag: v${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} - github-generate-changelog: true - github-draft: false - github-prerelease: false - github-discussion: Announcements - github-token: ${{ secrets.GITHUB_TOKEN }} - + files: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar version: ${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} @@ -159,7 +151,7 @@ jobs: run: echo "suffix=$(cat SUFFIX)" >> $GITHUB_OUTPUT - uses: actions/download-artifact@v3 - run: mkdir upload - - run: cp **/LandOfSignals-*.jar upload + - run: cp **/*.jar upload - name: Upload to GitHub uses: Kir-Antipov/mc-publish@master with: From 3c4c3bcbb6410f843f5f62ecc10bf79dee734a11 Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Tue, 16 May 2023 01:13:23 +0200 Subject: [PATCH 27/52] Moved checkout to top --- .github/workflows/publish.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6fd8748c..e9662d0b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -143,6 +143,7 @@ jobs: runs-on: ubuntu-latest needs: [ build ] steps: + - uses: actions/checkout@v3 - name: Read VERSION file id: getversion run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT @@ -151,7 +152,7 @@ jobs: run: echo "suffix=$(cat SUFFIX)" >> $GITHUB_OUTPUT - uses: actions/download-artifact@v3 - run: mkdir upload - - run: cp **/*.jar upload + - run: cp **/LandOfSignals-*.jar upload - name: Upload to GitHub uses: Kir-Antipov/mc-publish@master with: @@ -163,11 +164,11 @@ jobs: github-discussion: Announcements github-token: ${{ secrets.GITHUB_TOKEN }} - files: upload/*.jar + files: upload/LandOfSignals-*.jar version: ${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} version-type: ${{ inputs.type }} - changelog-file: CHANGELOG.md + changelog-file: ./CHANGELOG.md loaders: | forge From 613f552d6c7bd8f1711225bc18182701cf519d36 Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Wed, 17 May 2023 23:57:30 +0200 Subject: [PATCH 28/52] Apply 1.7.10 patch correctly --- .github/workflows/publish.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e9662d0b..0a70b69b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -65,11 +65,10 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up JDK 1.8 - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: - java-version: '1.8' # The JDK version to make available on the path. - java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk - architecture: x64 # (x64 or x86) - defaults to x64 + distribution: 'temurin' + java-version: '8' - name: Install deps run: sudo apt install -y pngquant findutils xvfb - name: Hack Forge Gradle @@ -81,7 +80,7 @@ jobs: - name: Hack Forge Gradle Part Two env: BRANCH: ${{ matrix.branch }} - run: git apply ${BRANCH}.patch || true + run: git apply --ignore-space-change --ignore-whitespace ${BRANCH}.patch || true - name: Gradle compile run: ./gradlew classes - name: Process images From 71e684b34a0ec016776322576a990bef90cf3330 Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Wed, 17 May 2023 23:59:58 +0200 Subject: [PATCH 29/52] Added ./ to changelog-file --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0a70b69b..69faad2f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -125,7 +125,7 @@ jobs: version: ${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }} version-type: ${{ inputs.type }} - changelog-file: CHANGELOG.md + changelog-file: ./CHANGELOG.md loaders: | forge From a39c98fbade1a1f0e9b85cd991578b2d17b386dc Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Thu, 18 May 2023 00:25:01 +0200 Subject: [PATCH 30/52] Readded CurseForge to publish workflow --- .github/workflows/publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 69faad2f..8a5464d2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -116,10 +116,10 @@ jobs: modrinth-token: ${{ secrets.MODRINTH_TOKEN }} # CurseForge - #curseforge-id: 434307 - #curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} - #curseforge-dependencies: | - # universal-mod-core | depends | * + curseforge-id: 434307 + curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} + curseforge-dependencies: | + universal-mod-core | depends | * files: build/libs/LandOfSignals-${{matrix.branch}}-${{ steps.getversion.outputs.version }}${{ steps.getsuffix.outputs.suffix }}.jar From d32784628393b3b2df8a997243e3e1b3e518b946 Mon Sep 17 00:00:00 2001 From: Danielxs01 Date: Tue, 23 May 2023 22:32:50 +0200 Subject: [PATCH 31/52] [#91] Fix NullPointerException, Removed 90deg Steckenblock --- .../landofrails/landofsignals/LOSBlocks.java | 17 ++++++++--------- .../render/item/ItemComplexSignalRender.java | 14 ++++++++------ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/main/java/net/landofrails/landofsignals/LOSBlocks.java b/src/main/java/net/landofrails/landofsignals/LOSBlocks.java index 03e82df7..59636329 100644 --- a/src/main/java/net/landofrails/landofsignals/LOSBlocks.java +++ b/src/main/java/net/landofrails/landofsignals/LOSBlocks.java @@ -382,8 +382,7 @@ public static void register() { true ); - registerStreckenblock(false); - registerStreckenblock(true); + registerStreckenblock(); // Signalboxes @@ -410,9 +409,9 @@ public static void register() { } - private static void registerStreckenblock(boolean ninetyDegree) { - String name = "Streckenblock" + (ninetyDegree ? " (90deg)" : ""); - String id = "block_signal_streckenblock" + (ninetyDegree ? "_90deg" : ""); + private static void registerStreckenblock() { + String name = "Streckenblock"; + String id = "block_signal_streckenblock"; String objPath = "models/block/stellwand/blockstreckenblock/streckenblock.obj"; Map groups = new HashMap<>(); @@ -435,7 +434,7 @@ private static void registerStreckenblock(boolean ninetyDegree) { for (String[] state : preparedStates) { String stateId = groupId + state[0]; String stateName = groupName + " " + state[1]; - states.put(stateId, new net.landofrails.api.contentpacks.v2.complexsignal.ContentPackSignalState(stateName, signalModels(objPath, stateId, new float[]{0.5f, 0f, 0.5f}, new float[]{.5f, 0f, .5f}, ninetyDegree))); + states.put(stateId, new net.landofrails.api.contentpacks.v2.complexsignal.ContentPackSignalState(stateName, signalModels(objPath, stateId, new float[]{0.5f, 0f, 0.5f}, new float[]{.5f, 0f, .5f}))); } groups.put(groupName, new net.landofrails.api.contentpacks.v2.complexsignal.ContentPackSignalGroup(groupName, states)); } @@ -445,7 +444,7 @@ private static void registerStreckenblock(boolean ninetyDegree) { id, 90f, LOSTabs.SIGNALS_TAB, - signalModels(objPath, "general", new float[]{.5f, 0f, .5f}, new float[]{.5f, 0f, .5f}, ninetyDegree), + signalModels(objPath, "general", new float[]{.5f, 0f, .5f}, new float[]{.5f, 0f, .5f}), groups, keyValueLinkedMap("Top left", "topLeftWhite", "Bottom right", "bottomRightRed"), null, @@ -588,7 +587,7 @@ private static Map signalModels(String objPath, Stri ); } - private static Map signalModels(String objPath, String objGroup, float[] blockTranslation, float[] itemTranslation, boolean rotateNinetyDegrees) { + private static Map signalModels(String objPath, String objGroup, float[] blockTranslation, float[] itemTranslation) { return models( objPath, new ContentPackModel[]{ @@ -597,7 +596,7 @@ private static Map signalModels(String objPath, Stri itemTranslation, new float[]{1f, 1f, 1f}, new float[]{1f, 1f, 1f}, - new float[]{0f, 180f, rotateNinetyDegrees ? 90f : 0f}, + new float[]{0f, 180f, 0f}, new String[]{objGroup} ) } diff --git a/src/main/java/net/landofrails/landofsignals/render/item/ItemComplexSignalRender.java b/src/main/java/net/landofrails/landofsignals/render/item/ItemComplexSignalRender.java index 582e02b9..008315b7 100644 --- a/src/main/java/net/landofrails/landofsignals/render/item/ItemComplexSignalRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/item/ItemComplexSignalRender.java @@ -30,21 +30,23 @@ public class ItemComplexSignalRender implements ItemRender.IItemModel { protected static final Map cache = new HashMap<>(); protected static final Map> groupCache = new HashMap<>(); - private static void checkCache(String itemId, Collection groups, String identifier) { + private static final String SIGNAL_IDENTIFIER = "/signals/"; + + private static void checkCache(String itemId, Collection groups) { // Get first group, get first state, get first model Optional firstPath = groups.iterator().next().getStates().values().iterator().next().getModels().keySet().stream().findFirst(); if (!firstPath.isPresent()) return; - final String firstObjId = itemId + identifier + firstPath.get(); + final String firstObjId = itemId + SIGNAL_IDENTIFIER + firstPath.get(); if (cache.containsKey(firstObjId)) { return; } for (ContentPackSignalGroup group : groups) { for (ContentPackSignalState state : group.getStates().values()) { - checkCache(itemId, state.getModels(), identifier, false); + checkCache(itemId, state.getModels(), SIGNAL_IDENTIFIER, false); } } @@ -74,7 +76,7 @@ private static void checkCache(String itemId, Map mo for (ContentPackModel signalModel : modelEntry.getValue()) { String[] groups = signalModel.getObj_groups(); if (groups.length > 0) { - Predicate targetGroup = renderOBJGroup -> Arrays.stream(groups).anyMatch(renderOBJGroup::startsWith); + Predicate targetGroup = renderOBJGroup -> Arrays.stream(groups).filter(Objects::nonNull).anyMatch(renderOBJGroup::startsWith); List modes = renderer.model.groups().stream().filter(targetGroup) .collect(Collectors.toCollection(ArrayList::new)); String groupCacheId = objId + "@" + String.join("+", groups); @@ -166,7 +168,7 @@ private static void renderBase(String itemId) { private static void renderSignals(String itemId, Map itemGroupStates) { final Map signalGroups = LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().get(itemId).getSignals(); - checkCache(itemId, signalGroups.values(), "/signals/"); + checkCache(itemId, signalGroups.values()); for (Map.Entry signalGroup : signalGroups.entrySet()) { @@ -176,7 +178,7 @@ private static void renderSignals(String itemId, Map itemGroupSt final String path = signalModels.getKey(); - final String objId = itemId + "/signals/" + path; + final String objId = itemId + SIGNAL_IDENTIFIER + path; final OBJRender renderer = cache.get(objId); for (ContentPackModel signalModel : signalModels.getValue()) { From b7fbe6aec69772ca52895fc70d57feedc2b936b1 Mon Sep 17 00:00:00 2001 From: Danielxs01 Date: Thu, 25 May 2023 23:15:43 +0200 Subject: [PATCH 32/52] [#98] Added preloading mechanism (optional) Fixed NullPointerException for missing item/block (null group) --- .../landofsignals/LandOfSignals.java | 7 +- .../configs/LandOfSignalsConfig.java | 3 + .../contentpacks/ContentPackHandler.java | 158 ++++++++++++++++++ .../render/block/TileComplexSignalRender.java | 6 +- .../render/block/TileDecoRender.java | 2 +- .../render/block/TileSignPartRender.java | 2 +- .../render/block/TileSignalBoxRender.java | 2 +- .../render/block/TileSignalPartRender.java | 7 +- .../render/item/ItemComplexSignalRender.java | 6 +- .../render/item/ItemDecoRender.java | 2 +- .../render/item/ItemSignPartRender.java | 2 +- .../render/item/ItemSignalBoxRender.java | 2 +- .../render/item/ItemSignalPartRender.java | 6 +- .../exceptions/ContentPackException.java | 4 + 14 files changed, 191 insertions(+), 18 deletions(-) diff --git a/src/main/java/net/landofrails/landofsignals/LandOfSignals.java b/src/main/java/net/landofrails/landofsignals/LandOfSignals.java index 5455d57e..70f883ec 100644 --- a/src/main/java/net/landofrails/landofsignals/LandOfSignals.java +++ b/src/main/java/net/landofrails/landofsignals/LandOfSignals.java @@ -28,6 +28,7 @@ public class LandOfSignals extends ModCore.Mod { @SuppressWarnings({"java:S1845"}) public static final String MODID = "landofsignals"; // Current version + @SuppressWarnings("unused") public static final String VERSION = "1.0.4"; @Override @@ -117,9 +118,11 @@ public void clientEvent(final ModEvent event) { break; case SETUP: GlobalRender.registerOverlay(pt -> new ManipualtorOverlay().draw()); + + if(LandOfSignalsConfig.preloadModels) { + ContentPackHandler.preloadModels(); + } break; - case RELOAD: - case FINALIZE: default: break; } diff --git a/src/main/java/net/landofrails/landofsignals/configs/LandOfSignalsConfig.java b/src/main/java/net/landofrails/landofsignals/configs/LandOfSignalsConfig.java index 4befa92d..f71758ce 100644 --- a/src/main/java/net/landofrails/landofsignals/configs/LandOfSignalsConfig.java +++ b/src/main/java/net/landofrails/landofsignals/configs/LandOfSignalsConfig.java @@ -8,4 +8,7 @@ @SuppressWarnings({"java:S1118", "java:S1444"}) public class LandOfSignalsConfig { + @ConfigFile.Comment("Enables preloading, slower startup, less lag spikes. If you want to use it, set it to \"true\". | Default: false") + public static boolean preloadModels = false; + } diff --git a/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java b/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java index e0f0a1af..43035e94 100644 --- a/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java +++ b/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java @@ -1,14 +1,27 @@ package net.landofrails.landofsignals.contentpacks; +import cam72cam.mod.ModCore; +import cam72cam.mod.gui.Progress; +import cam72cam.mod.model.obj.OBJModel; +import cam72cam.mod.render.obj.OBJRender; +import cam72cam.mod.resource.Identifier; import net.landofrails.api.contentpacks.GenericContentPack; +import net.landofrails.api.contentpacks.v2.complexsignal.ContentPackSignalGroup; +import net.landofrails.api.contentpacks.v2.parent.ContentPackModel; +import net.landofrails.api.contentpacks.v2.signal.ContentPackSignal; +import net.landofrails.landofsignals.LOSBlocks; import net.landofrails.landofsignals.LandOfSignals; +import net.landofrails.landofsignals.render.block.*; +import net.landofrails.landofsignals.render.item.*; import net.landofrails.stellwand.utils.exceptions.ContentPackException; import java.io.File; import java.io.IOException; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; +import java.util.Arrays; import java.util.List; +import java.util.Map; import java.util.Optional; import java.util.function.Predicate; import java.util.stream.Collectors; @@ -17,6 +30,9 @@ public class ContentPackHandler { + private static final String GENERIC_ITEM_ERRMSG = "Couldn't preload item with id \"%s\". Cause:"; + private static final String GENERIC_BLOCK_ERRMSG = "Couldn't preload block with id \"%s\". Cause:"; + private ContentPackHandler() { } @@ -121,6 +137,148 @@ private static void load(ZipFile zip, ZipEntry landofsignalsJson, boolean isUTF8 } } + public static void preloadModels(){ + + LandOfSignals.info("Starting preloading models"); + + Progress.Bar topProgressBar = Progress.push("LandOfSignals", 2); + topProgressBar.step("Preloading models"); + + // Signalpart + Progress.Bar progressBar = Progress.push("Signalpart", LOSBlocks.BLOCK_SIGNAL_PART.getContentpackSignals().size()); + for (String id : LOSBlocks.BLOCK_SIGNAL_PART.getContentpackSignals().keySet()) { + ModCore.info("Preloading signalpart %s", id); + progressBar.step(LOSBlocks.BLOCK_SIGNAL_PART.getContentpackSignals().get(id).getName()); + + final ContentPackSignal signal = LOSBlocks.BLOCK_SIGNAL_PART.getContentpackSignals().get(id); + final String[] states = LOSBlocks.BLOCK_SIGNAL_PART.getAllStates(id); + final String objPath = signal.getModel(); + + // Cache items + try { + ItemSignalPartRender.cache().put(objPath, new OBJRender(new OBJModel(new Identifier(LandOfSignals.MODID, objPath), 0, Arrays.asList(states)))); + } catch (Exception e) { + String errmsg = "Couldn't preload item with id \"%s\" (objPath: %s). Cause:"; + throw new ContentPackException(String.format(errmsg, id, objPath), e); + } + + // Cache blocks + try { + TileSignalPartRender.cache().put(objPath, new OBJRender(new OBJModel(new Identifier(LandOfSignals.MODID, objPath), 0, Arrays.asList(states)))); + } catch (Exception e) { + String errmsg = "Couldn't preload block with id \"%s\" (objPath: %s). Cause:"; + throw new ContentPackException(String.format(errmsg, id, objPath), e); + } + } + Progress.pop(progressBar); + + // Complexsignals + progressBar = Progress.push("Complexsignal", LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().size()); + for(String id : LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().keySet()){ + ModCore.info("Preloading complexsignal %s", id); + progressBar.step(LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().get(id).getName()); + + final Map signalGroups = LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().get(id).getSignals(); + final Map base = LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().get(id).getBase(); + + // Cache items + try{ + ItemComplexSignalRender.checkCache(id, base, "/base/", false); + ItemComplexSignalRender.checkCache(id, signalGroups.values(), "/signals/"); + }catch (Exception e){ + throw new ContentPackException(String.format(GENERIC_ITEM_ERRMSG, id), e); + } + + // Cache blocks + try { + TileComplexSignalRender.checkCache(id, base, "/base/", true); + TileComplexSignalRender.checkCache(id, signalGroups.values(), "/signals/"); + }catch (Exception e){ + throw new ContentPackException(String.format(GENERIC_BLOCK_ERRMSG, id), e); + } + + } + Progress.pop(progressBar); + + // Blockdeco + progressBar = Progress.push("Deco", LOSBlocks.BLOCK_DECO.getContentpackDeco().size()); + for(String id : LOSBlocks.BLOCK_DECO.getContentpackDeco().keySet()){ + ModCore.info("Preloading deco %s", id); + progressBar.step(LOSBlocks.BLOCK_DECO.getContentpackDeco().get(id).getName()); + + final Map models = LOSBlocks.BLOCK_DECO.getContentpackDeco().get(id).getBase(); + + // Cache items + try{ + ItemDecoRender.checkCache(id, models); + }catch (Exception e){ + throw new ContentPackException(String.format(GENERIC_ITEM_ERRMSG, id), e); + } + + // Cache blocks + try { + TileDecoRender.checkCache(id, models); + }catch (Exception e){ + throw new ContentPackException(String.format(GENERIC_BLOCK_ERRMSG, id), e); + } + } + Progress.pop(progressBar); + + // Signparts + progressBar = Progress.push("Sign", LOSBlocks.BLOCK_SIGN_PART.getContentpackSigns().size()); + for(String id : LOSBlocks.BLOCK_SIGN_PART.getContentpackSigns().keySet()){ + ModCore.info("Preloading sign %s", id); + progressBar.step(LOSBlocks.BLOCK_SIGN_PART.getContentpackSigns().get(id).getName()); + + final Map base = LOSBlocks.BLOCK_SIGN_PART.getContentpackSigns().get(id).getBase(); + + // Cache items + try{ + ItemSignPartRender.checkCache(id, base); + }catch (Exception e){ + throw new ContentPackException(String.format(GENERIC_ITEM_ERRMSG, id), e); + } + + // Cache blocks + try { + TileSignPartRender.checkCache(id, base); + }catch (Exception e){ + throw new ContentPackException(String.format(GENERIC_BLOCK_ERRMSG, id), e); + } + + } + Progress.pop(progressBar); + + // Signalboxes + progressBar = Progress.push("Signalbox", LOSBlocks.BLOCK_SIGNAL_BOX.getContentpackSignalboxes().size()); + for(String id : LOSBlocks.BLOCK_SIGNAL_BOX.getContentpackSignalboxes().keySet()){ + ModCore.info("Preloading signalbox %s", id); + progressBar.step(LOSBlocks.BLOCK_SIGNAL_BOX.getContentpackSignalboxes().get(id).getName()); + + final Map base = LOSBlocks.BLOCK_SIGNAL_BOX.getContentpackSignalboxes().get(id).getBase(); + + // Cache items + try{ + ItemSignalBoxRender.checkCache(id, base); + }catch (Exception e){ + throw new ContentPackException(String.format(GENERIC_ITEM_ERRMSG, id), e); + } + + // Cache blocks + try { + TileSignalBoxRender.checkCache(id, base); + }catch (Exception e){ + throw new ContentPackException(String.format(GENERIC_BLOCK_ERRMSG, id), e); + } + + } + Progress.pop(progressBar); + topProgressBar.step("Finishing"); + Progress.pop(topProgressBar); + + LandOfSignals.info("Finished preloading models"); + + } // For method references private static Predicate not(Predicate t) { diff --git a/src/main/java/net/landofrails/landofsignals/render/block/TileComplexSignalRender.java b/src/main/java/net/landofrails/landofsignals/render/block/TileComplexSignalRender.java index fd8e893f..90d8a4e8 100644 --- a/src/main/java/net/landofrails/landofsignals/render/block/TileComplexSignalRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/block/TileComplexSignalRender.java @@ -30,7 +30,7 @@ private TileComplexSignalRender() { private static final Map cache = new HashMap<>(); private static final Map> groupCache = new HashMap<>(); - private static void checkCache(String blockId, Collection groups, String identifier) { + public static void checkCache(String blockId, Collection groups, String identifier) { // Get first group, get first state, get first model Optional firstPath = groups.iterator().next().getStates().values().iterator().next().getModels().keySet().stream().findFirst(); @@ -50,7 +50,7 @@ private static void checkCache(String blockId, Collection models, String identifier, boolean checkIfAlreadyExisting) { + public static void checkCache(String blockId, Map models, String identifier, boolean checkIfAlreadyExisting) { if (checkIfAlreadyExisting) { Optional firstPath = models.keySet().stream().findFirst(); if (!firstPath.isPresent()) @@ -74,7 +74,7 @@ private static void checkCache(String blockId, Map m for (ContentPackModel signalModel : modelEntry.getValue()) { String[] groups = signalModel.getObj_groups(); if (groups.length > 0) { - Predicate targetGroup = renderOBJGroup -> Arrays.stream(groups).anyMatch(renderOBJGroup::startsWith); + Predicate targetGroup = renderOBJGroup -> Arrays.stream(groups).filter(Objects::nonNull).anyMatch(renderOBJGroup::startsWith); List modes = renderer.model.groups().stream().filter(targetGroup) .collect(Collectors.toCollection(ArrayList::new)); String groupCacheId = objId + "@" + String.join("+", groups); diff --git a/src/main/java/net/landofrails/landofsignals/render/block/TileDecoRender.java b/src/main/java/net/landofrails/landofsignals/render/block/TileDecoRender.java index d0d0caba..535c046c 100644 --- a/src/main/java/net/landofrails/landofsignals/render/block/TileDecoRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/block/TileDecoRender.java @@ -29,7 +29,7 @@ private TileDecoRender() { private static final Map cache = new HashMap<>(); private static final Map> groupCache = new HashMap<>(); - private static void checkCache(String blockId, Map models) { + public static void checkCache(String blockId, Map models) { Optional firstPath = models.keySet().stream().findFirst(); if (!firstPath.isPresent()) return; diff --git a/src/main/java/net/landofrails/landofsignals/render/block/TileSignPartRender.java b/src/main/java/net/landofrails/landofsignals/render/block/TileSignPartRender.java index be59d5ca..387d4fdd 100644 --- a/src/main/java/net/landofrails/landofsignals/render/block/TileSignPartRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/block/TileSignPartRender.java @@ -29,7 +29,7 @@ private TileSignPartRender() { private static final Map cache = new HashMap<>(); private static final Map> groupCache = new HashMap<>(); - private static void checkCache(String blockId, Map models) { + public static void checkCache(String blockId, Map models) { Optional firstPath = models.keySet().stream().findFirst(); if (!firstPath.isPresent()) return; diff --git a/src/main/java/net/landofrails/landofsignals/render/block/TileSignalBoxRender.java b/src/main/java/net/landofrails/landofsignals/render/block/TileSignalBoxRender.java index 07e32278..491ab5f5 100644 --- a/src/main/java/net/landofrails/landofsignals/render/block/TileSignalBoxRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/block/TileSignalBoxRender.java @@ -29,7 +29,7 @@ private TileSignalBoxRender() { private static final Map cache = new HashMap<>(); private static final Map> groupCache = new HashMap<>(); - private static void checkCache(String blockId, Map models) { + public static void checkCache(String blockId, Map models) { Optional firstPath = models.keySet().stream().findFirst(); if (!firstPath.isPresent()) return; diff --git a/src/main/java/net/landofrails/landofsignals/render/block/TileSignalPartRender.java b/src/main/java/net/landofrails/landofsignals/render/block/TileSignalPartRender.java index ec8efbf6..537b9084 100644 --- a/src/main/java/net/landofrails/landofsignals/render/block/TileSignalPartRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/block/TileSignalPartRender.java @@ -26,7 +26,6 @@ private TileSignalPartRender() { } private static final Map cache = new HashMap<>(); - protected static final Map cacheInfoOldContentPack = new HashMap<>(); public static StandardModel render(final TileSignalPart tsp) { return new StandardModel().addCustom(() -> renderStuff(tsp)); @@ -65,7 +64,6 @@ private static void renderBase(String blockId, ContentPackSignal signal, TileSig try { String[] states = LOSBlocks.BLOCK_SIGNAL_PART.getAllStates(blockId); cache.put(objPath, new OBJRender(new OBJModel(new Identifier(LandOfSignals.MODID, objPath), 0, Arrays.asList(states)))); - cacheInfoOldContentPack.putIfAbsent(blockId, LOSBlocks.BLOCK_SIGNAL_PART.isOldContentPack(blockId)); } catch (Exception e) { throw new ItemRenderException("Error loading item model/renderer...", e); } @@ -105,7 +103,6 @@ private static void renderSignals(String blockId, ContentPackSignal signal, Tile try { String[] states = LOSBlocks.BLOCK_SIGNAL_PART.getAllStates(blockId); cache.put(objPath, new OBJRender(new OBJModel(new Identifier(LandOfSignals.MODID, objPath), 0, Arrays.asList(states)))); - cacheInfoOldContentPack.putIfAbsent(blockId, LOSBlocks.BLOCK_SIGNAL_PART.isOldContentPack(blockId)); } catch (Exception e) { throw new ItemRenderException("Error loading item model/renderer...", e); } @@ -132,4 +129,8 @@ private static void renderSignals(String blockId, ContentPackSignal signal, Tile } } + public static Map cache(){ + return cache; + } + } \ No newline at end of file diff --git a/src/main/java/net/landofrails/landofsignals/render/item/ItemComplexSignalRender.java b/src/main/java/net/landofrails/landofsignals/render/item/ItemComplexSignalRender.java index 582e02b9..9eada6b2 100644 --- a/src/main/java/net/landofrails/landofsignals/render/item/ItemComplexSignalRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/item/ItemComplexSignalRender.java @@ -30,7 +30,7 @@ public class ItemComplexSignalRender implements ItemRender.IItemModel { protected static final Map cache = new HashMap<>(); protected static final Map> groupCache = new HashMap<>(); - private static void checkCache(String itemId, Collection groups, String identifier) { + public static void checkCache(String itemId, Collection groups, String identifier) { // Get first group, get first state, get first model Optional firstPath = groups.iterator().next().getStates().values().iterator().next().getModels().keySet().stream().findFirst(); @@ -50,7 +50,7 @@ private static void checkCache(String itemId, Collection } - private static void checkCache(String itemId, Map models, String identifier, boolean checkIfAlreadyExisting) { + public static void checkCache(String itemId, Map models, String identifier, boolean checkIfAlreadyExisting) { if (checkIfAlreadyExisting) { Optional firstPath = models.keySet().stream().findFirst(); if (!firstPath.isPresent()) @@ -74,7 +74,7 @@ private static void checkCache(String itemId, Map mo for (ContentPackModel signalModel : modelEntry.getValue()) { String[] groups = signalModel.getObj_groups(); if (groups.length > 0) { - Predicate targetGroup = renderOBJGroup -> Arrays.stream(groups).anyMatch(renderOBJGroup::startsWith); + Predicate targetGroup = renderOBJGroup -> Arrays.stream(groups).filter(Objects::nonNull).anyMatch(renderOBJGroup::startsWith); List modes = renderer.model.groups().stream().filter(targetGroup) .collect(Collectors.toCollection(ArrayList::new)); String groupCacheId = objId + "@" + String.join("+", groups); diff --git a/src/main/java/net/landofrails/landofsignals/render/item/ItemDecoRender.java b/src/main/java/net/landofrails/landofsignals/render/item/ItemDecoRender.java index d350a868..2bdedc15 100644 --- a/src/main/java/net/landofrails/landofsignals/render/item/ItemDecoRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/item/ItemDecoRender.java @@ -27,7 +27,7 @@ public class ItemDecoRender implements ItemRender.IItemModel { protected static final Map cache = new HashMap<>(); private static final Map> groupCache = new HashMap<>(); - private static void checkCache(String itemId, Map models) { + public static void checkCache(String itemId, Map models) { Optional firstPath = models.keySet().stream().findFirst(); if (!firstPath.isPresent()) return; diff --git a/src/main/java/net/landofrails/landofsignals/render/item/ItemSignPartRender.java b/src/main/java/net/landofrails/landofsignals/render/item/ItemSignPartRender.java index 48e21eb8..52618a10 100644 --- a/src/main/java/net/landofrails/landofsignals/render/item/ItemSignPartRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/item/ItemSignPartRender.java @@ -27,7 +27,7 @@ public class ItemSignPartRender implements ItemRender.IItemModel { protected static final Map cache = new HashMap<>(); private static final Map> groupCache = new HashMap<>(); - private static void checkCache(String itemId, Map models) { + public static void checkCache(String itemId, Map models) { Optional firstPath = models.keySet().stream().findFirst(); if (!firstPath.isPresent()) return; diff --git a/src/main/java/net/landofrails/landofsignals/render/item/ItemSignalBoxRender.java b/src/main/java/net/landofrails/landofsignals/render/item/ItemSignalBoxRender.java index 0faa42b1..44e15ead 100644 --- a/src/main/java/net/landofrails/landofsignals/render/item/ItemSignalBoxRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/item/ItemSignalBoxRender.java @@ -27,7 +27,7 @@ public class ItemSignalBoxRender implements ItemRender.IItemModel { protected static final Map cache = new HashMap<>(); private static final Map> groupCache = new HashMap<>(); - private static void checkCache(String itemId, Map models) { + public static void checkCache(String itemId, Map models) { Optional firstPath = models.keySet().stream().findFirst(); if (!firstPath.isPresent()) return; diff --git a/src/main/java/net/landofrails/landofsignals/render/item/ItemSignalPartRender.java b/src/main/java/net/landofrails/landofsignals/render/item/ItemSignalPartRender.java index c59b352c..02573f14 100644 --- a/src/main/java/net/landofrails/landofsignals/render/item/ItemSignalPartRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/item/ItemSignalPartRender.java @@ -21,7 +21,7 @@ @SuppressWarnings("java:S3252") public class ItemSignalPartRender implements ItemRender.IItemModel { - protected static final Map cache = new HashMap<>(); + private static final Map cache = new HashMap<>(); @Override public StandardModel getModel(World world, ItemStack stack) { @@ -106,4 +106,8 @@ private static void renderSignals(ContentPackSignal signal, String itemId, Strin } } + public static Map cache(){ + return cache; + } + } diff --git a/src/main/java/net/landofrails/stellwand/utils/exceptions/ContentPackException.java b/src/main/java/net/landofrails/stellwand/utils/exceptions/ContentPackException.java index 379cd55d..11ce3815 100644 --- a/src/main/java/net/landofrails/stellwand/utils/exceptions/ContentPackException.java +++ b/src/main/java/net/landofrails/stellwand/utils/exceptions/ContentPackException.java @@ -12,4 +12,8 @@ public ContentPackException(String text) { super(text); } + public ContentPackException(String text, Throwable throwable) { + super(text, throwable); + } + } From 6d7bb1fa13c3708dbc25c253be38e062408d3643 Mon Sep 17 00:00:00 2001 From: Danielxs01 Date: Sat, 27 May 2023 01:15:23 +0200 Subject: [PATCH 33/52] [#91] Replaced textures for hsigright and unisolated --- .../blocktrackunisolated/unisolated.png | Bin 2479 -> 419 bytes .../trackmainsignal/right/hsigright.png | Bin 6694 -> 694 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/src/main/resources/assets/landofsignals/models/block/stellwand/blocksignal/blocktrackunisolated/unisolated.png b/src/main/resources/assets/landofsignals/models/block/stellwand/blocksignal/blocktrackunisolated/unisolated.png index d5a303c531d0d757ab3fbc663a8e385af511c843..976f1ccf70c81c0982774c714ed8aea4bfe9b2df 100644 GIT binary patch literal 419 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7xzrV9fG#aSW-L^Y+F@P9{eIhl|=y zx=sRbj-9A_bEdE7IvXFK{>{Vxo2K)gIq)xI`tjG6FQU@q8yEx_m>d{57#I~8SnzRf z2p@P`CtJd)kZ0WR`RSId_jlH(y_cW=ebwG#_uKjmj55C&)830WFt8{vFmf!AV)*aN zP`Iz@F^hnDg9YOeP6a=PLZ%L3hdB(7hQ81a{ix>>sq7jj?lJ&@r>mdKI;Vst0B7BL AK>z>% literal 2479 zcmdUx`#;kQ1INEi8fxy5XWC}SWyfvGWin(~3E_xWt}(YlAyaJapt(L#MrzX-QIAux zE@*OTxsKzOgviNl%bmrEW~b*Lc%J9i=ZDYd^ZLAApPxUkceaO{^Fdh+SpWbI;$0j) ze&Hl!)BAvzw^a-pByY$SVHh8xdSW;>% ztavPtWpIkG1qUNr|93?F#piY_zjqxAg8qI^+IS)f2B1$ZHSbY?_kO?EHMRDBSHZC<0d zPC_q(;7Gs@;5UyZgUY(zC}aV{rPlI>y(}@Sq9ru?=8}su_sNvABJd+}LSAL1sl*<; z!Vzknl{!_;9*S>;8>dtF6e}LbHt^=Et>Mnc1OicItA$`Bio9NI^1eO!qwL@*PU?Zo zu`_m}we;h->EbNSt*?zjTeTHx@Xv>#Js$I1GanC*Y=KvUpy(4R)glid1fR|R|WMiE(Ka`(lH7TUU-;bQC*A5?Q z5%|$oeL$!O6}@DQbbbk01}HE>yIti^n>!64(9ss|IVJ9&p}I$m53{(z2rE?5#B42G z?qpJjksKSY;h@qNC1143$FP+D7<%bi>Cy&uqAnM>AXzr*Db$;W;W+Bey1Vu-WUs`6A^BFV@5@2+~^S*FphqWb@%n-hsA;4|F3QOTlWfmlmpWAT8{iWr!+H2{*5anu2s>%LU zE0GP_w`sk-pC;M3d{;n0g~yyz>h}Du2$~->{?6RgE!7R)C>#hPi&y%_#%eXM8&MIY zq^+^JIUP#BJNAwBjnRE_hXd+u#Ct!6M{5>m-M}-#K*uDx(eJ|VBXP~v<0f|=_UXv# zC|E@R2&tm3dyOgC^E1R&n;n9Wa<9ywo<(wjR_Rk(y{RzWZc(X33b>tBkjl^UwC~X7 zRdO9Y!sFj|hB47!v5EU>LwPH-OO5{F;lOVpZ~O{TcTYjF(~#stBxNAMBZJ!trAbo3 z@;&g>j}Lqk|C(;Qu)lS9;2xcGjSbAwPH3AT!<{JeP7QzRK4G|HJD~57;^y5^B8&EG zJVcuO{rg?WS(oCez1>Wd#Xz~8^7?b;58)nzWF%s1NxGCoO4;Q*P{cEPt>73A3ou$YrT(T8`k&1So3^dca>;Sjz-%-v^-7ST= z<|T)xm85*(z!x{crU0bP_MIwImQGW6&-`fO@7JXt=XvBcxu_`T0f+b|CX=Ub=HSNt z^#F;w;;UDsyvf(Smfz)$=&NaLwxDqEe&j#IdHA&Y7^U=Pw$lD^Eyh!|clCW|&J z>N^7ON3Iw}HTth?2*16q%${+OffZ57v^`N&B&4S-g?c`55iEpPtNHx^T#sLgqRl>yDiyZL)#VShL?Aj`D$sK=OFa(VcMws4 z0#eDf)<~!y7n)_JYl=>3#K3~GPSD9exXfm&@!F`G;HC22()ATOtWI^kZbv=_*Tk{J zVE#cx3{x3C5fOx%X<_2ASXFSqXepD)Yz_=qsE)(gWbPq}twyq@9W>9;s{j>Ige8XT zOk<`izO@U+mY(#nUsjK(J^LK{ph|I~*yW)@SW5IadYcJw=6j#rUr|yI*$)(#Y9V!|xf~eRN zWl;SCJP_`1&u@yI=7pIpS?D#HcHjdd}rvB z?Rb;=fLJ2BqX*J?3FN;&{RymQv-T}&2b&{CZ2omm^tSZr*4oSho>5N=H2H5Z h@INxc|KaS1+QP`OplvnUKt@lWaS>NpcBbmAU`}+RXg|k&R}@+ zgW;au`rW#Z53ZS4nDWnn;VN^O@``!6CI18%t~Q4PnVF~m%x1jvuj%>p<&n1BXLkIX zI6L0<|I_D2*}4CG8KT7Q8@oLF8aaEu<^N01{iGqF6JEy$e)$^xOwRGbrhm@0TrV7fVN#Xf@#3|z*?xA%^S}7N+8%iEIyH6T?E1E! zd&L>%-{0N%;pg9a4DZWHv*YmjA1#S_3=cRNC?W3Y-@3I@L_uk8IWRpkc)I$ztaD0e F0s!R88jSz| literal 6694 zcmbtZWmptUv|iXH1$PMrM7kT17Rg0ex{(wlq@){mSsJ8Enw1i1kp=+)DQW3kq*q#c zsmpi&-QV}enVDzuJ?G3jXXcq`Ee$17;wQua0Du&x4Ar^Mk^c!H?tQ9edX@tK(CopW za(ccwdvKHL_XGON=W*I1Tc+u4nrJ7F7@#wSGdt*MNN8ZplKm4wsCL*7m4fezzpTuU z6A$GH!P?9JD35^u$jNudX4$C~3K>~h@KmGYnC<%LwihJeBXa?jBIORTNs-Od(yf|e z@H6+t3iwZ~hU3Yy<5bn9eq5HmNO^BX0_u9^j`{_N&Lv`{4K)C;C_aOOLo@MUkHC^| z(t$Wcfc1owm6c^8At(Virlo)J{Aj${Jv3ynbNV)8YMPN`rR6Y^79<-*fb4gW*L(uP z+pmm2o*T-pp4s{S)PbioTAYcgHF^2Kl}Jq=7zG3zJGI;669-R!Ph~G-+&B#q-=KhS zc_AnShXrNtY`fE9SyU?W@!mFE1UinB?3*06`*58Y(AQ7v{S17;-}I@YGu6TG4u z`vZr*d{&M-bG&T9nw3r_AI#EQ+8&|DvLd7i#pA7xH+vq}O62>zX?>AB%%5y_k_S+` zcBi_YwvaUgWpF-&gi+uKZtyEsrsY@aF|};0I(dn0Aj<^W3;5RNCIyL;njMVCx8lFeH)i=h(#Y%KLZ)@x-&8n1|o5E?@ zHF2y>7Mr$V>

%YKP~yo#^z}1mBy|PCp+=VrerOlJDZ%%M^eBZe7ST(G)BND)1MM zU72lr6+G`KrQ^Z_fE%d5uZuo!5l!XwD&+UNE${eO4j*Z-ubm^IuQy2Y>_l+iQ~_M1 zpZn>m#lf>j@n{GE>Sl^2R~JX`q~q!1hKr(on}BZW7r=)GN+F{-I6Qz7X6wYNg2l}_ zCF!Gl(HO!Vll1%-1dBZU0tl~V9|l!tOdZMHo-Qg}DLIGhy%QIkPlDO1Jts?u9OGGQ z5K#c!AD{gVNW0tYWy{5ELQtU1)>45CdQtt7{!i#J>Zyfwn)8s&?nqfYzx<4KTk51= zTS*8F%~Uzx&T)t7FxeU z?BRuHWO_?5CP-tq-J5xfn*x59y0{YJB!UjR9tb1~*XBG&4r27DmVi++C5B@r>p3Ql z2iMas&Q42GZ3g?&H@ccMEG=I+`)9&s01=ZT&ZIu0DDi+z6x`awpPsG)W}F*%zuwgd z6}?0yM`bPeZZ>lCD`pecv14@*gCtPaUMEy$r4~vK`#@GGBP6qzA?hPK3O{>bHZV`k zXO6(w_yaPAA7@YX<}zjn?EB+x;xKNE@JX#a7HGeA7st&3A5ZyH#4}c^V|t_@YRxfR zZGEZ&ZOR;>$Cfqb?`@Y{5#Hy~ee@;?*;Rw1GI!T0=*v7ERW_1)Uu{j|e53h`%KLsX zBokzN%ID+E|Heb)tPwr-!F`7sFXOW#?keR0KNy{T6H6G4t79 zZaA#IMO7oNQZ!$wOzw1{?WP7D2Nz_Hj%9AT22gpJ=9uAk9*tkvB#Xee!wfgS8Lln) z;ZIJ3f-V!5&zBEiFdfI?ETYV$?{glgyIlA7{d$TRbN8lNrs%WOh%*1S;j#Bn zI#}G?OWB8(k=XZd+n81hznwk}-BhD#L6}xl5iVh1fsH7?Df{55QgmuzW- z(eULYOyg=}B~2(QP2+|sHqAMKVhQ!@5A6@tn4Rm>xTEPib1EiT{n||{L>cevt+5xEIXu%L_CNPR3a#?Db4%IxNEJ6l)d z?g76@d4iXKwX*f*F;7u!uWfl@@^G2k;CoH`5j229rSXgmUg~BTbjX258>^bR%Z8T^ zJGgz5GC_$zqm)Z%1?>BG8ZI5tS4(%tgKuCF@fgqM?|wT5I$r1b2PUP%6$e*7Qn%1_ z9U9dp4(|RZsk?1%!F1-Zt55q1pT=cqG^jhE4b4=j+*5&R8_$H1J8INdu@jU zu|ah^fx(i+4LxM=#{zfFI?fNiYbtgt$dl=*+p?D}^7p<7=X;VCab||TTt9x}XU;Zd zz!1>4*7&BCf{b|pSc_Um7#3C5yz8oiX zg&Hd@HMUqDJw~P(c>LmlG0C?N!+k+mn$g*dZNf+96t{NUN|`X{dN}6%t`B|N3C_D< zxvW2_`d8)i{Ve{?P2=5V?`51`rjRuDgrJf~V{PjVQvetF_$Xos~n}j zqkAyiHFgSv4h^*>g^iUcsgaRIN7+|oBP#2?%^Fn?SYa)#Oi)$@=C0vwCS1-q?fS~f zUur09={r&L{g1~fv>e41Rp20DUO`7{!@=RblX?Gk>Aoyju><`vk!H;Y)=MkRAWDyA zd!LL>)Masy?-*TLH%^cW#?P6I;|M;()GNZqk89l3dK*g ziT#%>n((0)lpo7Pyndl>!~(=+O`GB;{uDX)js|Xe!1t-&7USk@0?C-xyYYpp1_Li)303=*pdz@v@mkA6%9CwlgQR!R@Qb zpPQnZbgvE=&D(Zb-VO^h|2ezN-H0oWO4YH*gHF_8+!S|0A`IHM+Z$7z&(C}69!aW~F<6)E z#XWUvdF>=>1HbYfffE)!-gV%%5QQWv16sUOizPwXl- z$o^R1su%&bC(Ntoh8$RHDqr z$EnHWtf8(M&0@92j_C77mt{$_9RK%DT2zx3z=j3!nFyJp_ryb$qUy}Qs#IJKEdHDvQ@T-3eugI`3(D2J62R&Yr@4I}7T$tRL! zg2XdbY9))WOo(1Q;_aV(ZF9STDg#Q3^N5&1dej;=UIkUT&JMc>of}T_85xHx7k&a z%J|QglG3+CQfT?P=~@rDa3B*D-R27oEkl%QZJ zmBqgZinuShEKmc`+E?wHJuA-#!#;wpnmZt>>OViWk>K7xmRG$-XRG!1uB1XH;gEs zeUC#Z--w!s4!C3IaN)7Re#|h?p|>k}C+}?Kp7t{wZsjA#%s*^hMRaHOc(#(xFY!mu z4+tR+Eb-GSsVW@&GaHY)jfpd-)sbu={-Es7(gd5g*UOEsgIl-d`(oHzyrYiPy9OF2 zS3h%4%!h}JOuXL9x4p)uix&V(!-n&%Lu}yf>h7J)oeX+eH4`-J2$7z5sZdv^jTe9V zTau2>Rk;Wpw7M3#d6@phK6kgXG~Rb1(e!HozSKPM_04Sw!UA==U3i0Ua$mlc#9@v< zV-$V%bi#OWoW9HXjf&K~!kqBUL6id1-YNMm8QPWgNUQ>n{)j5dYL9_hiQwt~OEB(> zSl}qyC#0X<++i;=r_AI*L1?nJnN$I~eX_soHAUPqOV!`aozDyq2o#@{merKS)R+Qf zCWU8#%MzlM-cBYvZZ}^w5+rj2AWG!SZZIACWm_jZt)atj19T%|jE&m6lA(ltDCGo~ zAdnQn7Ox=>)wWjE4&>Z_K_F@b4Y)ao@Lu}s^9itpEOJ6>c3zSyvd*=9D=WkmpOxg3 zA{B@Qc&oKTz$x`wcDA_DGWX&A9x-Q%c#wmP7KBQ<`M2H?U-QkkV{yKCu|Cg@vD5}; zw_t=%qw5Vw-vJ=uFQCj4mOuADawx z&;4dkfen;M`|oMiB+A-=-;FR<*{r%`DeAe;%%+)l=2#r$*FVr!G&bSRhP~Tw_{M2~ zv)({CA(1jZ5wqyqMbzpU`I7ox8%FCF>4*6KWFVg{ zmPkKMKwLyh-z=ujqO8MOs|~lhot*dS1MN2(g%(nzEPF6 z@nOnmu4-G#;k%t3b?{RlWg+@Y^>u3yw$p{@&G{A!ZqdJ`bkW{Ts}*Bd4~C*?-&*qSz~zG<~i;V4oJ>Q|^>uwaXJIHjc*>y`B1 zNW_qh*Y&DRSh2_GxR7cG^O6mNU{ynJ@~?DyV{6rwoki zHoYW+I(+5WuRIM59QAg%YU{rJ_VRGl8Grw@r%*V|kb(9~tgt^~gQQ%iesKEd6TN?) zx3|KA8lja@MX93M>W=TRuGo*(R24&E*3odJRJuWZy2-ypAQ6Mi`>q#l)y<&T9G4~dU?@mdGBoc+^Kah zqji(OCei>uxB2PDXDA{A#m6PpKS=|2Q+*fb>LV&9cnhVAusF8rz{IA3Vcr>YVF!qc zrZsIaRgVj)j=nHtnNkjVp?~?J`Q8h6*nbSLy>wX6U9&*@-Hqm}u3kL9*^9u!gf?FE z$#KW^WxA`?Mw^?gor>|omuPS$0$^%tVQ$D>=C?n_?pNrZciIyx13Pl~jf?ZLKzo}{ zZ$kf);u={7XRTi}9kYo+R}cukt)Tu4WOsR;8xyEoK36Olg6#JrOteuy|29ksHOTjtDw^%9nzXZP`1G(gZT{-mqGW(TG7R~ zp12R4!CzlFD)?~xo2w)&*;KQw z;ariO5aGPNWJYKGX%6lv2TnpDgDq6@=U$3w+P=llk9I+Rv@1)5668D~Cs!X@FS`zH zMbIgRI{T8Q08cBW>} zA2`}o!dA1}KU`~V6WB3k3jPGiCBzh#MME>~BIR(Iqpib;)>h+#7=x1U83JHDO*1r4 zT9gygJgGmbpe3)sEWZ3+-$HMwmet}tE&BUif5R(=S2xHXo~VWh!Qcm>QH)Z?P52>l z!4C!;$Z%BUR7{hC_`L2T7Z|YQG~Vi7r(?XgrNE^~ZT>P^XDe&_>vJA9kDBei+PL1j zAD5871V3UV03~WB2O!okdWnW9xut#I3}a|mWUv0^yQ%x=k>lPNH;tKpW%!w&%5gtW z7p0?Q>yuF^3RV_dZ+-WUt2okF2Fa}#CGYuHpYc!E(wL$WG%V9Ff=#aE8`a(Y1oBe0 zZV|29){@(1@_G@R7My>GC8bJVHBlXiH2=r=g1J8v(}K7w-jQ^&KkLx7FSQLg$scCN z({^wN0q$+`bFw*!yc0rXqjh5rB}AG9D)%}Ioc@^t11MQnQc_26Xi*apGr|ivgt*@* zNSerlcFP$cKkK~u0Bi0|eUsYGDKJ)iHjr!jlaq4r>5PiZN`YOv?!}HqzgGm|+xb2M ztpQ(n*tp3NK|B2oGJw=o$(1(nSuT=Jh;FtjeouSPeaZu8Eek_nG4oe|xOI4a_2Bb@ zsJA7rtnO|%!#%(i^ReVNiKzLCXLu_MzzVAmB#DeH-Pp$dL!qi{gsfI9G^)4iqfe5v zFPwzHdn(5VuZj47HCtI8-fnePA_OUhBHVV=BQctVDLmda+2C9RGW3IR&$OE{TQhXM zi!{A3;o!zowsEdIJuXV_YhH!W5>o6vk2TPkViJ9xBPKLK8u+-;z{_WlO!D?UxO z7Zsj5X*fMByFT*TCQuuntxoXuU-}eubX+Xa+g-undii(Z=#>D~al2YblNe7c?p?K# zj0LUmr7e2Z{GAsH{`wSH73g(^br=6j@N|~`6!~sv=+%~4`ND9R zzVKg@Q^I{sgVGHWxbS~F)trH23;!GX|ByR^PGq3Xn)d7G_y0ctn4$)>O5P&me*pCS B<&*#b From 4a222480c40a088a56c0ff2d00b8952732f8d4d6 Mon Sep 17 00:00:00 2001 From: Danielxs01 Date: Sat, 27 May 2023 01:19:15 +0200 Subject: [PATCH 34/52] [#91] Fixed merge conflicts with develop --- .../landofsignals/contentpacks/ContentPackHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java b/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java index 43035e94..bd42a93e 100644 --- a/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java +++ b/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java @@ -184,7 +184,7 @@ public static void preloadModels(){ // Cache items try{ ItemComplexSignalRender.checkCache(id, base, "/base/", false); - ItemComplexSignalRender.checkCache(id, signalGroups.values(), "/signals/"); + ItemComplexSignalRender.checkCache(id, signalGroups.values()); }catch (Exception e){ throw new ContentPackException(String.format(GENERIC_ITEM_ERRMSG, id), e); } From c6589b7ac6ca1de1e26b0d4d2d0b9142dc920d10 Mon Sep 17 00:00:00 2001 From: Danielxs01 Date: Tue, 30 May 2023 19:17:27 +0200 Subject: [PATCH 35/52] [#103] ItemManipulator - Offset and Translation works ManipualtorOverlay deactivated --- .../landofsignals/LandOfSignals.java | 2 + .../landofsignals/gui/GuiManipualtor.java | 151 +++++++++++++----- .../gui/overlay/ManipualtorOverlay.java | 58 +------ .../landofsignals/items/ItemManipulator.java | 52 +----- .../packet/GuiItemManipulatorToClient.java | 25 +++ .../packet/ManipulatorToClientPacket.java | 10 +- .../packet/ManipulatorToServerPacket.java | 2 +- .../render/block/TileDecoRender.java | 3 +- .../render/block/TileSignPartRender.java | 3 +- .../render/block/TileSignalBoxRender.java | 3 +- .../landofsignals/tile/TileComplexSignal.java | 12 +- .../landofsignals/tile/TileDeco.java | 18 ++- .../landofsignals/tile/TileSignPart.java | 18 ++- .../landofsignals/tile/TileSignalBox.java | 40 ++++- .../landofsignals/tile/TileSignalPart.java | 28 ++-- .../tile/TileSignalPartAnimated.java | 14 +- .../landofsignals/utils/IManipulate.java | 7 +- 17 files changed, 268 insertions(+), 178 deletions(-) create mode 100644 src/main/java/net/landofrails/landofsignals/packet/GuiItemManipulatorToClient.java diff --git a/src/main/java/net/landofrails/landofsignals/LandOfSignals.java b/src/main/java/net/landofrails/landofsignals/LandOfSignals.java index 70f883ec..b683d252 100644 --- a/src/main/java/net/landofrails/landofsignals/LandOfSignals.java +++ b/src/main/java/net/landofrails/landofsignals/LandOfSignals.java @@ -67,6 +67,7 @@ public void commonEvent(final ModEvent event) { Packet.register(ConfigGuiPacket::new, PacketDirection.ServerToClient); Packet.register(GuiSignalPrioritizationToClientPacket::new, PacketDirection.ServerToClient); Packet.register(GuiSignalPrioritizationToServerPacket::new, PacketDirection.ClientToServer); + Packet.register(GuiItemManipulatorToClient::new, PacketDirection.ServerToClient); } else if (event == ModEvent.INITIALIZE) { // LandOfSignals Config ConfigFile.sync(LandOfSignalsConfig.class); @@ -122,6 +123,7 @@ public void clientEvent(final ModEvent event) { if(LandOfSignalsConfig.preloadModels) { ContentPackHandler.preloadModels(); } + break; default: break; diff --git a/src/main/java/net/landofrails/landofsignals/gui/GuiManipualtor.java b/src/main/java/net/landofrails/landofsignals/gui/GuiManipualtor.java index 6be625b7..ff6d06f6 100644 --- a/src/main/java/net/landofrails/landofsignals/gui/GuiManipualtor.java +++ b/src/main/java/net/landofrails/landofsignals/gui/GuiManipualtor.java @@ -1,14 +1,12 @@ package net.landofrails.landofsignals.gui; -import cam72cam.mod.MinecraftClient; import cam72cam.mod.block.BlockEntity; import cam72cam.mod.entity.Player; import cam72cam.mod.gui.screen.*; import cam72cam.mod.math.Vec3d; import cam72cam.mod.math.Vec3i; -import net.landofrails.landofsignals.LOSItems; -import net.landofrails.landofsignals.items.ItemManipulator; import net.landofrails.landofsignals.packet.ManipulatorToClientPacket; +import net.landofrails.landofsignals.packet.ManipulatorToServerPacket; import net.landofrails.landofsignals.utils.IManipulate; import net.landofrails.landofsignals.utils.Static; @@ -19,15 +17,20 @@ public class GuiManipualtor implements IScreen { private CheckBox positionBox; private CheckBox heightBox; private CheckBox rotationBox; - private CheckBox hitboxBox; - - private Button ingameButton; private Slider rotationSlider; + private Button rotationAddition; + private Button rotationSubtraction; private TextField positionXField; + private Button positionXAddition; + private Button positionXSubtraction; private TextField positionZField; + private Button positionZAddition; + private Button positionZSubtraction; private TextField heightYField; + private Button heightYAddition; + private Button heightYSubtraction; private String textXBefore; private String textYBefore; @@ -52,7 +55,9 @@ public class GuiManipualtor implements IScreen { public GuiManipualtor(final BlockEntity be) { final IManipulate manipulate = (IManipulate) be; offset = manipulate.getOffset(); - rotation = manipulate.getRotation(); + rotation = manipulate.getRotation() % 360; + if (rotation < 0) + rotation += 360; blockPos = be.getPos(); } @@ -64,9 +69,11 @@ public void onClick(final Player.Hand hand) { uncheckOtherBoxes(this); setAllInvisible(); positionXField.setVisible(true); + positionXAddition.setVisible(true); + positionXSubtraction.setVisible(true); positionZField.setVisible(true); - ingameButton.setVisible(true); - ItemManipulator.editHeight = false; + positionZAddition.setVisible(true); + positionZSubtraction.setVisible(true); } }; heightBox = new CheckBox(screen, screen.getWidth() / 2 - screen.getWidth() + 50, 110, GuiText.LABEL_EDITPOSITION + " (Y)", false) { @@ -74,9 +81,9 @@ public void onClick(final Player.Hand hand) { public void onClick(final Player.Hand hand) { uncheckOtherBoxes(this); setAllInvisible(); - ingameButton.setVisible(true); heightYField.setVisible(true); - ItemManipulator.editHeight = true; + heightYAddition.setVisible(true); + heightYSubtraction.setVisible(true); } }; rotationBox = new CheckBox(screen, screen.getWidth() / 2 - screen.getWidth() + 50, 130, GuiText.LABEL_EDITROTATION.toString(), false) { @@ -85,37 +92,82 @@ public void onClick(final Player.Hand hand) { uncheckOtherBoxes(this); setAllInvisible(); rotationSlider.setVisible(true); + rotationAddition.setVisible(true); + rotationSubtraction.setVisible(true); } }; - hitboxBox = new CheckBox(screen, screen.getWidth() / 2 - screen.getWidth() + 50, 150, GuiText.LABEL_EDITHITBOX.toString(), false) { + + renewSlider(screen); + rotationSubtraction = new Button(screen,screen.getWidth() / 2 - 220, 100, 20, 20, "-") { @Override - public void onClick(final Player.Hand hand) { - uncheckOtherBoxes(this); - setAllInvisible(); + public void onClick(Player.Hand hand) { + rotation--; + renewSlider(screen); + send(); + } + }; + rotationAddition = new Button(screen, screen.getWidth() / 2 - 50, 100, 20, 20, "+") { + @Override + public void onClick(Player.Hand hand) { + rotation++; + renewSlider(screen); + send(); } }; - ingameButton = new Button(screen, screen.getWidth() / 2 - 120, 90, 100, 20, GuiText.LABEL_EDITINGAME.toString()) { + positionXField = new TextField(screen, screen.getWidth() / 2 - 120, screen.getHeight() / 2 - 120, 40, 20); + positionXAddition = new Button(screen, screen.getWidth() / 2 - 79, screen.getHeight() / 2 - 120, 20, 20, "+") { @Override - public void onClick(final Player.Hand hand) { - ItemManipulator.editIngame = true; - LOSItems.ITEM_MANIPULATOR.setPlayerMainPos(MinecraftClient.getPlayer().getPosition()); - screen.close(); + public void onClick(Player.Hand hand) { + double positionX = Static.round(Double.parseDouble(positionXField.getText()), 3); + positionX += getModifier(hand); + positionXField.setText(String.valueOf(positionX)); + } + }; + positionXSubtraction = new Button(screen, screen.getWidth() / 2 - 141, screen.getHeight() / 2 - 120, 20, 20, "-") { + @Override + public void onClick(Player.Hand hand) { + double positionX = Static.round(Double.parseDouble(positionXField.getText()), 3); + positionX -= getModifier(hand); + positionXField.setText(String.valueOf(positionX)); } }; - rotationSlider = new Slider(screen, screen.getWidth() / 2 - 170, 90, GuiText.LABEL_ROTATIONSLIDER + " : " + rotation, 0, 360, rotation, false) { + positionZField = new TextField(screen, screen.getWidth() / 2 - 120, screen.getHeight() / 2 - 100, 40, 20); + positionZAddition = new Button(screen, screen.getWidth() / 2 - 79, screen.getHeight() / 2 - 100, 20, 20, "+") { @Override - public void onSlider() { - rotation = rotationSlider.getValueInt(); - rotationSlider.setText(GuiText.LABEL_ROTATIONSLIDER + " : " + rotation); - send(); + public void onClick(Player.Hand hand) { + double positionZ = Static.round(Double.parseDouble(positionZField.getText()), 3); + positionZ += getModifier(hand); + positionZField.setText(String.valueOf(positionZ)); + } + }; + positionZSubtraction = new Button(screen, screen.getWidth() / 2 - 141, screen.getHeight() / 2 - 100, 20, 20, "-") { + @Override + public void onClick(Player.Hand hand) { + double positionZ = Static.round(Double.parseDouble(positionZField.getText()), 3); + positionZ -= getModifier(hand); + positionZField.setText(String.valueOf(positionZ)); } }; - positionXField = new TextField(screen, screen.getWidth() / 2 - 120, screen.getHeight() / 2 - 120, 100, 20); - positionZField = new TextField(screen, screen.getWidth() / 2 - 120, screen.getHeight() / 2 - 100, 100, 20); - heightYField = new TextField(screen, screen.getWidth() / 2 - 120, screen.getHeight() / 2 - 120, 100, 20); + heightYField = new TextField(screen, screen.getWidth() / 2 - 120, screen.getHeight() / 2 - 120, 40, 20); + heightYAddition = new Button(screen, screen.getWidth() / 2 - 79, screen.getHeight() / 2 - 120, 20, 20, "+") { + @Override + public void onClick(Player.Hand hand) { + double heightY = Static.round(Double.parseDouble(heightYField.getText()), 3); + heightY += getModifier(hand); + heightYField.setText(String.valueOf(heightY)); + } + }; + heightYSubtraction = new Button(screen, screen.getWidth() / 2 - 141, screen.getHeight() / 2 - 120, 20, 20, "-") { + @Override + public void onClick(Player.Hand hand) { + double heightY = Static.round(Double.parseDouble(heightYField.getText()), 3); + heightY -= getModifier(hand); + heightYField.setText(String.valueOf(heightY)); + } + }; positionXField.setValidator(doubleFilter); positionZField.setValidator(doubleFilter); @@ -123,20 +175,20 @@ public void onSlider() { setAllInvisible(); positionXField.setVisible(true); + positionXAddition.setVisible(true); + positionXSubtraction.setVisible(true); positionZField.setVisible(true); - ingameButton.setVisible(true); + positionZAddition.setVisible(true); + positionZSubtraction.setVisible(true); positionXField.setText(String.valueOf(offset.x)); positionZField.setText(String.valueOf(offset.z)); heightYField.setText(String.valueOf(offset.y)); - ItemManipulator.editHeight = false; - } @Override public void onEnterKey(final IScreenBuilder builder) { - LOSItems.ITEM_MANIPULATOR.clearBlock(); builder.close(); } @@ -145,13 +197,12 @@ public void onEnterKey(final IScreenBuilder builder) { public void onClose() { send(); //Server -// ManipulatorToServerPacket serverPacket = new ManipulatorToServerPacket(new Vec3d(Double.parseDouble(positionXField.getText()), Double.parseDouble(heightYField.getText()), Double.parseDouble(positionZField.getText())), rotation, blockPos); -// serverPacket.sendToServer(); + ManipulatorToServerPacket serverPacket = new ManipulatorToServerPacket(new Vec3d(Double.parseDouble(positionXField.getText()), Double.parseDouble(heightYField.getText()), Double.parseDouble(positionZField.getText())), rotation, blockPos); + serverPacket.sendToServer(); } @Override public void draw(final IScreenBuilder builder) { - final String tempX = positionXField.getText(); final String tempY = heightYField.getText(); final String tempZ = positionZField.getText(); @@ -177,23 +228,47 @@ public void draw(final IScreenBuilder builder) { private void send() { //Client - final ManipulatorToClientPacket clientPacket = new ManipulatorToClientPacket(new Vec3d(Double.parseDouble(positionXField.getText()), Double.parseDouble(heightYField.getText()), Double.parseDouble(positionZField.getText())), rotation, blockPos, ItemManipulator.sneak); + final ManipulatorToClientPacket clientPacket = new ManipulatorToClientPacket(new Vec3d(Double.parseDouble(positionXField.getText()), Double.parseDouble(heightYField.getText()), Double.parseDouble(positionZField.getText())), rotation, blockPos, false); clientPacket.sendToAll(); } private void setAllInvisible() { positionXField.setVisible(false); + positionXAddition.setVisible(false); + positionXSubtraction.setVisible(false); positionZField.setVisible(false); + positionZAddition.setVisible(false); + positionZSubtraction.setVisible(false); heightYField.setVisible(false); - ingameButton.setVisible(false); + heightYAddition.setVisible(false); + heightYSubtraction.setVisible(false); rotationSlider.setVisible(false); + rotationAddition.setVisible(false); + rotationSubtraction.setVisible(false); } private void uncheckOtherBoxes(final CheckBox box) { positionBox.setChecked(false); heightBox.setChecked(false); rotationBox.setChecked(false); - hitboxBox.setChecked(false); box.setChecked(true); } + + private void renewSlider(IScreenBuilder screen){ + if(rotationSlider != null){ + rotationSlider.setVisible(false); + rotationSlider = null; + } + rotationSlider = new Slider(screen, screen.getWidth() / 2 - 200, 100, GuiText.LABEL_ROTATIONSLIDER + ": ", 0, 360, rotation, false) { + @Override + public void onSlider() { + rotation = rotationSlider.getValueInt(); + send(); + } + }; + } + private double getModifier(Player.Hand hand){ + return hand == Player.Hand.PRIMARY ? 1.0 : 0.1; + } + } diff --git a/src/main/java/net/landofrails/landofsignals/gui/overlay/ManipualtorOverlay.java b/src/main/java/net/landofrails/landofsignals/gui/overlay/ManipualtorOverlay.java index f8ebbc04..ea6c9439 100644 --- a/src/main/java/net/landofrails/landofsignals/gui/overlay/ManipualtorOverlay.java +++ b/src/main/java/net/landofrails/landofsignals/gui/overlay/ManipualtorOverlay.java @@ -1,65 +1,9 @@ package net.landofrails.landofsignals.gui.overlay; -import cam72cam.mod.MinecraftClient; -import cam72cam.mod.block.BlockEntity; -import cam72cam.mod.entity.Player; -import cam72cam.mod.gui.helpers.GUIHelpers; -import cam72cam.mod.item.ItemStack; -import cam72cam.mod.math.Vec3d; -import net.landofrails.landofsignals.LOSGuis; -import net.landofrails.landofsignals.LOSItems; -import net.landofrails.landofsignals.gui.GuiText; -import net.landofrails.landofsignals.items.ItemManipulator; -import net.landofrails.landofsignals.packet.ManipulatorToClientPacket; -import net.landofrails.landofsignals.utils.IManipulate; -import net.landofrails.landofsignals.utils.Static; - public class ManipualtorOverlay { - private final int screenWidth; - private final int screenHeight; - - public ManipualtorOverlay() { - screenWidth = GUIHelpers.getScreenWidth(); - screenHeight = GUIHelpers.getScreenHeight(); - } - - Vec3d offset; - public void draw() { - final ItemStack item = MinecraftClient.getPlayer().getHeldItem(Player.Hand.PRIMARY); - if (!item.is(LOSItems.ITEM_MANIPULATOR) || !ItemManipulator.editIngame) return; - final BlockEntity block = LOSItems.ITEM_MANIPULATOR.getBlock(); - if (block instanceof IManipulate) { - final Player player = MinecraftClient.getPlayer(); - if (player.isCrouching()) { - LOSGuis.MANIPULATOR.open(player, block.getPos()); - ItemManipulator.editIngame = false; - return; - } - if (!ItemManipulator.editHeight) { - final Vec3d fastMovement = player.getMovementInput(); - final Vec3d movement = new Vec3d(Static.round(fastMovement.x / 10, 3), 0, Static.round(fastMovement.z / 10, 3)); - handlePacket(block, player, movement); - GUIHelpers.drawCenteredString("X: " + Static.round(offset.x, 3), screenWidth - 50, screenHeight - 50, 0xffffff); - GUIHelpers.drawCenteredString("Z: " + Static.round(offset.z, 3), screenWidth - 50, screenHeight - 70, 0xffffff); - } else { - final Vec3d fastMovement = player.getVelocity(); - final Vec3d movement = new Vec3d(0, Static.round(fastMovement.x / 10, 3), 0); - handlePacket(block, player, movement); - GUIHelpers.drawCenteredString("Y: " + Static.round(offset.y, 3), screenWidth - 50, screenHeight - 50, 0xffffff); - } - } + // Removed - unclear if still needed or not } - private void handlePacket(final BlockEntity block, final Player player, final Vec3d movement) { - final ManipulatorToClientPacket packet = new ManipulatorToClientPacket(LOSItems.ITEM_MANIPULATOR.getPlayerMainPos(), movement, block.getPos(), ItemManipulator.sneak); - packet.sendToAll(); - player.setPosition(LOSItems.ITEM_MANIPULATOR.getPlayerMainPos()); - final IManipulate manipulate = (IManipulate) block; - manipulate.setOffset(manipulate.getOffset().add(movement)); - - GUIHelpers.drawCenteredString(GuiText.LABEL_UNATTACH.toString(), screenWidth - 100, screenHeight - 30, 0xffffff); - offset = manipulate.getOffset(); - } } diff --git a/src/main/java/net/landofrails/landofsignals/items/ItemManipulator.java b/src/main/java/net/landofrails/landofsignals/items/ItemManipulator.java index a1a38f92..859355dd 100644 --- a/src/main/java/net/landofrails/landofsignals/items/ItemManipulator.java +++ b/src/main/java/net/landofrails/landofsignals/items/ItemManipulator.java @@ -1,6 +1,5 @@ package net.landofrails.landofsignals.items; -import cam72cam.mod.MinecraftClient; import cam72cam.mod.block.BlockEntity; import cam72cam.mod.entity.Player; import cam72cam.mod.item.ClickResult; @@ -8,12 +7,10 @@ import cam72cam.mod.item.CustomItem; import cam72cam.mod.math.Vec3d; import cam72cam.mod.math.Vec3i; -import cam72cam.mod.text.PlayerMessage; import cam72cam.mod.util.Facing; import cam72cam.mod.world.World; -import net.landofrails.landofsignals.LOSGuis; import net.landofrails.landofsignals.LOSTabs; -import net.landofrails.landofsignals.LandOfSignals; +import net.landofrails.landofsignals.packet.GuiItemManipulatorToClient; import net.landofrails.landofsignals.utils.IManipulate; import java.util.List; @@ -21,64 +18,25 @@ @SuppressWarnings("java:S1117") public class ItemManipulator extends CustomItem { - private static final boolean DISABLED = true; - - private BlockEntity block; - private Vec3d playerMainPos; - @SuppressWarnings({"java:S1444", "java:S1104"}) - public static boolean editIngame; - @SuppressWarnings({"java:S1444", "java:S1104"}) - public static boolean editHeight; - @SuppressWarnings({"java:S1444", "java:S1104"}) - public static boolean sneak; - public ItemManipulator(final String modID, final String name) { super(modID, name); } @Override public List getCreativeTabs() { - return LOSTabs.getAsList(LOSTabs.SIGNALS_TAB); + return LOSTabs.getAsList(LOSTabs.ASSETS_TAB); } @Override @SuppressWarnings({"java:S2696", "java:S1134"}) public ClickResult onClickBlock(final Player player, final World world, final Vec3i pos, final Player.Hand hand, final Facing facing, final Vec3d inBlockPos) { - sneak = player.isCrouching(); BlockEntity block = world.getBlockEntity(pos, BlockEntity.class); - // CHECK: Implementation for signals and signs - // AFTERWARDS: Enable tool after check - if (DISABLED) { - if (world.isClient) - player.sendMessage(PlayerMessage.translate("message." + LandOfSignals.MODID + ":item.manipulator.disabled")); - block = null; - } - if (block instanceof IManipulate) { - this.block = block; - playerMainPos = MinecraftClient.getPlayer().getPosition(); - if (world.isClient) { - LOSGuis.MANIPULATOR.open(player, block.getPos()); - return ClickResult.ACCEPTED; - } + if (block instanceof IManipulate && world.isServer) { + new GuiItemManipulatorToClient(block).sendToPlayer(player); + return ClickResult.ACCEPTED; } return ClickResult.REJECTED; } - public BlockEntity getBlock() { - return block; - } - - public Vec3d getPlayerMainPos() { - return playerMainPos; - } - - public void setPlayerMainPos(final Vec3d playerMainPos) { - this.playerMainPos = playerMainPos; - } - - public void clearBlock() { - block = null; - playerMainPos = null; - } } diff --git a/src/main/java/net/landofrails/landofsignals/packet/GuiItemManipulatorToClient.java b/src/main/java/net/landofrails/landofsignals/packet/GuiItemManipulatorToClient.java new file mode 100644 index 00000000..4dd05232 --- /dev/null +++ b/src/main/java/net/landofrails/landofsignals/packet/GuiItemManipulatorToClient.java @@ -0,0 +1,25 @@ +package net.landofrails.landofsignals.packet; + +import cam72cam.mod.block.BlockEntity; +import cam72cam.mod.net.Packet; +import cam72cam.mod.serialization.TagField; +import net.landofrails.landofsignals.LOSGuis; + +public class GuiItemManipulatorToClient extends Packet { + + @TagField + BlockEntity block; + + public GuiItemManipulatorToClient(){ + } + + public GuiItemManipulatorToClient(BlockEntity block){ + this.block = block; + } + + @Override + protected void handle() { + LOSGuis.MANIPULATOR.open(getPlayer(), block.getPos()); + } + +} diff --git a/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToClientPacket.java b/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToClientPacket.java index a151941b..13117994 100644 --- a/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToClientPacket.java +++ b/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToClientPacket.java @@ -28,14 +28,6 @@ public ManipulatorToClientPacket() { } - public ManipulatorToClientPacket(final Vec3d mainPos, final Vec3d movement, final Vec3i blockPos, final boolean sneak) { - this.mainPos = mainPos; - this.movement = movement; - this.blockPos = blockPos; - gui = false; - this.sneak = sneak; - } - public ManipulatorToClientPacket(final Vec3d offset, final int rotation, final Vec3i blockPos, final boolean sneak) { movement = offset; this.blockPos = blockPos; @@ -69,7 +61,7 @@ protected void handle() { final BlockEntity block = getWorld().getBlockEntity(bp, BlockEntity.class); if (block instanceof IManipulate) { final IManipulate manipulate = (IManipulate) block; - manipulate.setOffset(manipulate.getOffset().add(movement)); + manipulate.setOffset(movement); } } } else { diff --git a/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToServerPacket.java b/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToServerPacket.java index 8c5646de..b266f2be 100644 --- a/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToServerPacket.java +++ b/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToServerPacket.java @@ -31,7 +31,7 @@ protected void handle() { final BlockEntity block = getWorld().getBlockEntity(blockPos, BlockEntity.class); if (block instanceof IManipulate) { final IManipulate manipulate = (IManipulate) block; - manipulate.setOffset(manipulate.getOffset().add(offset)); + manipulate.setOffset(offset); manipulate.setRotation(rotation); } } diff --git a/src/main/java/net/landofrails/landofsignals/render/block/TileDecoRender.java b/src/main/java/net/landofrails/landofsignals/render/block/TileDecoRender.java index 535c046c..8d6368f8 100644 --- a/src/main/java/net/landofrails/landofsignals/render/block/TileDecoRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/block/TileDecoRender.java @@ -82,6 +82,7 @@ private static void renderStuff(TileDeco tsp) { } private static void renderBase(String blockId, TileDeco tile) { + Vec3d offset = tile.getOffset(); ContentPackDeco contentPackDeco = LOSBlocks.BLOCK_DECO.getContentpackDeco().get(blockId); @@ -98,7 +99,7 @@ private static void renderBase(String blockId, TileDeco tile) { for (ContentPackModel baseModel : baseModels.getValue()) { ContentPackBlock block = baseModel.getBlock(); - Vec3d translate = block.getAsVec3d(block::getTranslation); + Vec3d translate = block.getAsVec3d(block::getTranslation).add(offset); Vec3d scale = block.getAsVec3d(block::getScaling); Vec3d rotation = block.getAsVec3d(block::getRotation); diff --git a/src/main/java/net/landofrails/landofsignals/render/block/TileSignPartRender.java b/src/main/java/net/landofrails/landofsignals/render/block/TileSignPartRender.java index 387d4fdd..feb6b298 100644 --- a/src/main/java/net/landofrails/landofsignals/render/block/TileSignPartRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/block/TileSignPartRender.java @@ -83,6 +83,7 @@ private static void renderStuff(TileSignPart tsp) { private static void renderBase(String blockId, TileSignPart tile) { + Vec3d offset = tile.getOffset(); ContentPackSign contentPackSign = LOSBlocks.BLOCK_SIGN_PART.getContentpackSigns().get(blockId); if(contentPackSign == null) contentPackSign = LOSBlocks.BLOCK_SIGN_PART.getContentpackSigns().get(Static.MISSING); @@ -97,7 +98,7 @@ private static void renderBase(String blockId, TileSignPart tile) { for (ContentPackModel baseModel : baseModels.getValue()) { ContentPackBlock block = baseModel.getBlock(); - Vec3d translate = block.getAsVec3d(block::getTranslation); + Vec3d translate = block.getAsVec3d(block::getTranslation).add(offset); Vec3d scale = block.getAsVec3d(block::getScaling); Vec3d rotation = block.getAsVec3d(block::getRotation); diff --git a/src/main/java/net/landofrails/landofsignals/render/block/TileSignalBoxRender.java b/src/main/java/net/landofrails/landofsignals/render/block/TileSignalBoxRender.java index 491ab5f5..3a64e0ad 100644 --- a/src/main/java/net/landofrails/landofsignals/render/block/TileSignalBoxRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/block/TileSignalBoxRender.java @@ -83,6 +83,7 @@ private static void renderStuff(final TileSignalBox tsp) { private static void renderBase(final String blockId, final TileSignalBox tile) { + final Vec3d offset = tile.getOffset(); ContentPackSignalbox contentPackSignalboxes = LOSBlocks.BLOCK_SIGNAL_BOX.getContentpackSignalboxes().get(blockId); if(contentPackSignalboxes == null) contentPackSignalboxes = LOSBlocks.BLOCK_SIGNAL_BOX.getContentpackSignalboxes().get(Static.MISSING); @@ -97,7 +98,7 @@ private static void renderBase(final String blockId, final TileSignalBox tile) { for (ContentPackModel baseModel : baseModels.getValue()) { final ContentPackBlock block = baseModel.getBlock(); - final Vec3d translate = block.getAsVec3d(block::getTranslation); + final Vec3d translate = block.getAsVec3d(block::getTranslation).add(offset); final Vec3d scale = block.getAsVec3d(block::getScaling); final Vec3d rotation = block.getAsVec3d(block::getRotation); diff --git a/src/main/java/net/landofrails/landofsignals/tile/TileComplexSignal.java b/src/main/java/net/landofrails/landofsignals/tile/TileComplexSignal.java index c7d51d00..ac6cad75 100644 --- a/src/main/java/net/landofrails/landofsignals/tile/TileComplexSignal.java +++ b/src/main/java/net/landofrails/landofsignals/tile/TileComplexSignal.java @@ -73,7 +73,7 @@ public ItemStack onPick() { @Override public IBoundingBox getBoundingBox() { - return IBoundingBox.BLOCK.offset(offset); + return IBoundingBox.BLOCK; } @Override @@ -119,6 +119,16 @@ public int getRotation() { return getBlockRotate(); } + @Override + public void setScaling(Vec3d scaling) { + throw new UnsupportedOperationException("Not yet implemented."); + } + + @Override + public Vec3d getScaling() { + return new Vec3d(1, 1, 1); + } + public Map getOrderedGroupStates() { if (this.orderedGroupStates == null) { Map allGroups = LOSBlocks.BLOCK_COMPLEX_SIGNAL.getAllGroupStates(id); diff --git a/src/main/java/net/landofrails/landofsignals/tile/TileDeco.java b/src/main/java/net/landofrails/landofsignals/tile/TileDeco.java index 246654fa..35b795c0 100644 --- a/src/main/java/net/landofrails/landofsignals/tile/TileDeco.java +++ b/src/main/java/net/landofrails/landofsignals/tile/TileDeco.java @@ -34,7 +34,7 @@ public ItemStack onPick() { @Override public IBoundingBox getBoundingBox() { - return IBoundingBox.BLOCK.offset(offset); + return IBoundingBox.BLOCK; } @Override @@ -57,7 +57,7 @@ public void setOffset(Vec3d vec) { try { save(new TagCompound().setVec3d("offset", vec)); } catch (Exception ignored) { - + // Can be ignored } } @@ -72,7 +72,7 @@ public void setRotation(int rotation) { try { save(new TagCompound().setInteger("blockRotation", rotation)); } catch (Exception ignored) { - + // Can be ignored } } @@ -80,5 +80,15 @@ public void setRotation(int rotation) { public int getRotation() { return getBlockRotate(); } - + + @Override + public void setScaling(Vec3d scaling) { + throw new UnsupportedOperationException("Not yet implemented."); + } + + @Override + public Vec3d getScaling() { + return new Vec3d(1, 1, 1); + } + } diff --git a/src/main/java/net/landofrails/landofsignals/tile/TileSignPart.java b/src/main/java/net/landofrails/landofsignals/tile/TileSignPart.java index 5d8a49c6..159d74e3 100644 --- a/src/main/java/net/landofrails/landofsignals/tile/TileSignPart.java +++ b/src/main/java/net/landofrails/landofsignals/tile/TileSignPart.java @@ -58,7 +58,7 @@ public ItemStack onPick() { @Override public IBoundingBox getBoundingBox() { - return IBoundingBox.BLOCK.offset(offset); + return IBoundingBox.BLOCK; } @Override @@ -81,7 +81,7 @@ public void setOffset(Vec3d vec) { try { save(new TagCompound().setVec3d("offset", vec)); } catch (Exception ignored) { - + // Can be ignored } } @@ -96,7 +96,7 @@ public void setRotation(int rotation) { try { save(new TagCompound().setInteger("blockRotation", rotation)); } catch (Exception ignored) { - + // Can be ignored } } @@ -105,12 +105,22 @@ public int getRotation() { return getBlockRotate(); } + @Override + public void setScaling(Vec3d scaling) { + throw new UnsupportedOperationException("Not yet implemented."); + } + + @Override + public Vec3d getScaling() { + return new Vec3d(1, 1, 1); + } + public void setText(String signText) { this.signText = signText; try { save(getData()); } catch (Exception ignored) { - + // Can be ignored } } diff --git a/src/main/java/net/landofrails/landofsignals/tile/TileSignalBox.java b/src/main/java/net/landofrails/landofsignals/tile/TileSignalBox.java index d28eb0e8..512a2f69 100644 --- a/src/main/java/net/landofrails/landofsignals/tile/TileSignalBox.java +++ b/src/main/java/net/landofrails/landofsignals/tile/TileSignalBox.java @@ -13,6 +13,7 @@ import net.landofrails.landofsignals.LOSBlocks; import net.landofrails.landofsignals.LOSItems; import net.landofrails.landofsignals.packet.SignalBoxTileSignalPartPacket; +import net.landofrails.landofsignals.utils.IManipulate; import net.landofrails.landofsignals.utils.Static; import javax.annotation.Nullable; @@ -20,7 +21,7 @@ import java.util.stream.Collectors; @SuppressWarnings({"java:S116", "java:S1134", "java:S1133"}) -public class TileSignalBox extends BlockEntity { +public class TileSignalBox extends BlockEntity implements IManipulate { @TagField("id") private String id; @@ -32,6 +33,9 @@ public class TileSignalBox extends BlockEntity { @Nullable private Vec3i tileSignalPartPos = Vec3i.ZERO; + @TagField("offset") + private Vec3d offset = Vec3d.ZERO; + @TagField("signalType") @Nullable private Byte signalType; // null = none, 0 = simple (old), 1 = complex @@ -77,6 +81,11 @@ public IBoundingBox getBoundingBox() { return IBoundingBox.BLOCK; } + @Override + public IBoundingBox getRenderBoundingBox() { + return IBoundingBox.BLOCK.offset(getOffset()); + } + @Override public boolean onClick(Player player, Player.Hand hand, Facing facing, Vec3d hit) { if (!player.getHeldItem(hand).is(LOSItems.ITEM_CONNECTOR) && !player.isCrouching() && player.getWorld().isServer) { @@ -393,4 +402,33 @@ private void refreshOldRedstoneVariables() { noRedstone = null; } + @Override + public void setOffset(Vec3d offset) { + this.offset = offset; + } + + @Override + public Vec3d getOffset() { + return offset; + } + + @Override + public void setRotation(int rotation) { + this.blockRotate = rotation; + } + + @Override + public int getRotation() { + return getBlockRotate(); + } + + @Override + public void setScaling(Vec3d scaling) { + throw new UnsupportedOperationException("Not yet implemented."); + } + + @Override + public Vec3d getScaling() { + return new Vec3d(1,1, 1); + } } diff --git a/src/main/java/net/landofrails/landofsignals/tile/TileSignalPart.java b/src/main/java/net/landofrails/landofsignals/tile/TileSignalPart.java index fc5157bd..ab9b1e1d 100644 --- a/src/main/java/net/landofrails/landofsignals/tile/TileSignalPart.java +++ b/src/main/java/net/landofrails/landofsignals/tile/TileSignalPart.java @@ -45,6 +45,8 @@ public class TileSignalPart extends BlockEntity implements IManipulate { @TagField("offset") private Vec3d offset = Vec3d.ZERO; + @TagField("scaling") + private Vec3d scaling = new Vec3d(1, 1, 1); public TileSignalPart(final String id, final int rot) { this.blockRotate = rot; @@ -53,7 +55,7 @@ public TileSignalPart(final String id, final int rot) { @Override public boolean onClick(Player player, Player.Hand hand, Facing facing, Vec3d hit) { - if (player.isCrouching() || LandOfSignalsUtils.isLandOfSignalsItem(player.getHeldItem(hand))) { + if (player.isCrouching() || LandOfSignalsUtils.isLandOfSignalsItem(player.getHeldItem(Player.Hand.PRIMARY))) { return false; } if (!getWorld().isServer) { @@ -76,7 +78,7 @@ public ItemStack onPick() { @Override public IBoundingBox getBoundingBox() { - return IBoundingBox.BLOCK.offset(offset); + return IBoundingBox.BLOCK; } @Override @@ -133,6 +135,16 @@ public int getRotation() { return getBlockRotate(); } + @Override + public void setScaling(Vec3d scaling) { + this.scaling = scaling; + } + + @Override + public Vec3d getScaling() { + return scaling; + } + /** * server-only * @@ -164,14 +176,14 @@ public void updateSignals(Vec3i pos, String state) { senderSignalStates.put(pos, state); - refreshSignals(true); + refreshSignals(); } /** * server-only */ public void updateSignals() { - refreshSignals(true); + refreshSignals(); } /** @@ -181,10 +193,10 @@ public void updateSignals() { */ public void removeSignal(Vec3i pos) { senderSignalStates.remove(pos); - refreshSignals(true); + refreshSignals(); } - private void refreshSignals(boolean updateClients) { + private void refreshSignals() { boolean first = true; String lastState = null; for (String state : getOrderedStates()) { @@ -195,9 +207,7 @@ private void refreshSignals(boolean updateClients) { } this.texturePath = lastState; - if (updateClients) { - new SignalUpdatePacket(getPos(), texturePath).sendToAll(); - } + new SignalUpdatePacket(getPos(), texturePath).sendToAll(); } @Override diff --git a/src/main/java/net/landofrails/landofsignals/tile/TileSignalPartAnimated.java b/src/main/java/net/landofrails/landofsignals/tile/TileSignalPartAnimated.java index 56837b0f..a435c4ef 100644 --- a/src/main/java/net/landofrails/landofsignals/tile/TileSignalPartAnimated.java +++ b/src/main/java/net/landofrails/landofsignals/tile/TileSignalPartAnimated.java @@ -56,7 +56,7 @@ public ItemStack onPick() { @Override public IBoundingBox getBoundingBox() { - return IBoundingBox.BLOCK.offset(offset); + return IBoundingBox.BLOCK; } @Override @@ -77,6 +77,7 @@ public String getId() { return id; } + @SuppressWarnings("unused") public void setAnimationOrStateTexture(final String name) { if (name == null) animationOrTextureName = "null"; else animationOrTextureName = name; @@ -113,6 +114,17 @@ public int getRotation() { return getBlockRotate(); } + @Override + public void setScaling(Vec3d scaling) { + throw new UnsupportedOperationException("Not yet implemented."); + } + + @Override + public Vec3d getScaling() { + return new Vec3d(1, 1, 1); + } + + @SuppressWarnings("unused") public void setActive(final boolean active) { this.active = active; markDirty(); diff --git a/src/main/java/net/landofrails/landofsignals/utils/IManipulate.java b/src/main/java/net/landofrails/landofsignals/utils/IManipulate.java index 921f8fe5..33f5f478 100644 --- a/src/main/java/net/landofrails/landofsignals/utils/IManipulate.java +++ b/src/main/java/net/landofrails/landofsignals/utils/IManipulate.java @@ -4,9 +4,6 @@ public interface IManipulate { - /** - * Provide new Vec3d for offset - */ void setOffset(Vec3d vec); Vec3d getOffset(); @@ -15,4 +12,8 @@ public interface IManipulate { int getRotation(); + void setScaling(Vec3d scaling); + + Vec3d getScaling(); + } From 4f211b241aa9942f3ea9463fab455c10faaf234b Mon Sep 17 00:00:00 2001 From: Danielxs01 Date: Tue, 30 May 2023 23:27:03 +0200 Subject: [PATCH 36/52] [#103] ItemManipulator - Scaling added --- .../landofsignals/gui/GuiManipualtor.java | 151 +++++++++++++++++- .../landofsignals/gui/GuiText.java | 4 +- .../packet/ManipulatorToClientPacket.java | 7 +- .../packet/ManipulatorToServerPacket.java | 6 +- .../render/block/TileComplexSignalRender.java | 6 +- .../render/block/TileDecoRender.java | 3 +- .../render/block/TileSignPartRender.java | 3 +- .../render/block/TileSignalBoxRender.java | 3 +- .../render/block/TileSignalPartRender.java | 12 +- .../landofsignals/tile/TileComplexSignal.java | 7 +- .../landofsignals/tile/TileDeco.java | 6 +- .../landofsignals/tile/TileSignPart.java | 6 +- .../landofsignals/tile/TileSignalBox.java | 7 +- .../landofsignals/utils/Static.java | 6 + .../assets/landofsignals/lang/de_DE.lang | 2 +- .../assets/landofsignals/lang/en_US.lang | 2 +- 16 files changed, 207 insertions(+), 24 deletions(-) diff --git a/src/main/java/net/landofrails/landofsignals/gui/GuiManipualtor.java b/src/main/java/net/landofrails/landofsignals/gui/GuiManipualtor.java index ff6d06f6..e1b62288 100644 --- a/src/main/java/net/landofrails/landofsignals/gui/GuiManipualtor.java +++ b/src/main/java/net/landofrails/landofsignals/gui/GuiManipualtor.java @@ -17,6 +17,7 @@ public class GuiManipualtor implements IScreen { private CheckBox positionBox; private CheckBox heightBox; private CheckBox rotationBox; + private CheckBox scalingBox; private Slider rotationSlider; private Button rotationAddition; @@ -31,12 +32,24 @@ public class GuiManipualtor implements IScreen { private TextField heightYField; private Button heightYAddition; private Button heightYSubtraction; - + private TextField scalingXField; + private Button scalingXAddition; + private Button scalingXSubtraction; + private TextField scalingYField; + private Button scalingYAddition; + private Button scalingYSubtraction; + private TextField scalingZField; + private Button scalingZAddition; + private Button scalingZSubtraction; private String textXBefore; private String textYBefore; private String textZBefore; + private String scalingXBefore; + private String scalingYBefore; + private String scalingZBefore; private final Vec3d offset; + private Vec3d scaling; private int rotation; private final Vec3i blockPos; @@ -55,6 +68,7 @@ public class GuiManipualtor implements IScreen { public GuiManipualtor(final BlockEntity be) { final IManipulate manipulate = (IManipulate) be; offset = manipulate.getOffset(); + scaling = manipulate.getScaling(); rotation = manipulate.getRotation() % 360; if (rotation < 0) rotation += 360; @@ -96,6 +110,22 @@ public void onClick(final Player.Hand hand) { rotationSubtraction.setVisible(true); } }; + scalingBox = new CheckBox(screen, screen.getWidth() / 2 - screen.getWidth() + 50, 150, GuiText.LABEL_EDITSCALING.toString(), false) { + @Override + public void onClick(final Player.Hand hand) { + uncheckOtherBoxes(this); + setAllInvisible(); + scalingXField.setVisible(true); + scalingXAddition.setVisible(true); + scalingXSubtraction.setVisible(true); + scalingYField.setVisible(true); + scalingYAddition.setVisible(true); + scalingYSubtraction.setVisible(true); + scalingZField.setVisible(true); + scalingZAddition.setVisible(true); + scalingZSubtraction.setVisible(true); + } + }; renewSlider(screen); rotationSubtraction = new Button(screen,screen.getWidth() / 2 - 220, 100, 20, 20, "-") { @@ -169,9 +199,64 @@ public void onClick(Player.Hand hand) { } }; + scalingXField = new TextField(screen, screen.getWidth() / 2 - 120, screen.getHeight() / 2 - 120, 40, 20); + scalingXAddition = new Button(screen, screen.getWidth() / 2 - 79, screen.getHeight() / 2 - 120, 20, 20, "+") { + @Override + public void onClick(Player.Hand hand) { + double scalingX = Static.round(Double.parseDouble(scalingXField.getText()), 3); + scalingX += getModifier(hand); + scalingXField.setText(String.valueOf(scalingX)); + } + }; + scalingXSubtraction = new Button(screen, screen.getWidth() / 2 - 141, screen.getHeight() / 2 - 120, 20, 20, "-") { + @Override + public void onClick(Player.Hand hand) { + double scalingX = Static.round(Double.parseDouble(scalingXField.getText()), 3); + scalingX -= getModifier(hand); + scalingXField.setText(String.valueOf(scalingX)); + } + }; + scalingYField = new TextField(screen, screen.getWidth() / 2 - 120, screen.getHeight() / 2 - 100, 40, 20); + scalingYAddition = new Button(screen, screen.getWidth() / 2 - 79, screen.getHeight() / 2 - 100, 20, 20, "+") { + @Override + public void onClick(Player.Hand hand) { + double scalingY = Static.round(Double.parseDouble(scalingYField.getText()), 3); + scalingY += getModifier(hand); + scalingYField.setText(String.valueOf(scalingY)); + } + }; + scalingYSubtraction = new Button(screen, screen.getWidth() / 2 - 141, screen.getHeight() / 2 - 100, 20, 20, "-") { + @Override + public void onClick(Player.Hand hand) { + double scalingY = Static.round(Double.parseDouble(scalingYField.getText()), 3); + scalingY -= getModifier(hand); + scalingYField.setText(String.valueOf(scalingY)); + } + }; + scalingZField = new TextField(screen, screen.getWidth() / 2 - 120, screen.getHeight() / 2 - 80, 40, 20); + scalingZAddition = new Button(screen, screen.getWidth() / 2 - 79, screen.getHeight() / 2 - 80, 20, 20, "+") { + @Override + public void onClick(Player.Hand hand) { + double scalingZ = Static.round(Double.parseDouble(scalingZField.getText()), 3); + scalingZ += getModifier(hand); + scalingZField.setText(String.valueOf(scalingZ)); + } + }; + scalingZSubtraction = new Button(screen, screen.getWidth() / 2 - 141, screen.getHeight() / 2 - 80, 20, 20, "-") { + @Override + public void onClick(Player.Hand hand) { + double scalingZ = Static.round(Double.parseDouble(scalingZField.getText()), 3); + scalingZ -= getModifier(hand); + scalingZField.setText(String.valueOf(scalingZ)); + } + }; + positionXField.setValidator(doubleFilter); positionZField.setValidator(doubleFilter); heightYField.setValidator(doubleFilter); + scalingXField.setValidator(doubleFilter); + scalingYField.setValidator(doubleFilter); + scalingZField.setValidator(doubleFilter); setAllInvisible(); positionXField.setVisible(true); @@ -184,6 +269,9 @@ public void onClick(Player.Hand hand) { positionXField.setText(String.valueOf(offset.x)); positionZField.setText(String.valueOf(offset.z)); heightYField.setText(String.valueOf(offset.y)); + scalingXField.setText(String.valueOf(scaling.x)); + scalingYField.setText(String.valueOf(scaling.y)); + scalingZField.setText(String.valueOf(scaling.z)); } @@ -195,9 +283,19 @@ public void onEnterKey(final IScreenBuilder builder) { @SuppressWarnings("java:S125") @Override public void onClose() { + scaling = new Vec3d( + Double.parseDouble(scalingXField.getText()), + Double.parseDouble(scalingYField.getText()), + Double.parseDouble(scalingZField.getText()) + ); send(); //Server - ManipulatorToServerPacket serverPacket = new ManipulatorToServerPacket(new Vec3d(Double.parseDouble(positionXField.getText()), Double.parseDouble(heightYField.getText()), Double.parseDouble(positionZField.getText())), rotation, blockPos); + ManipulatorToServerPacket serverPacket = new ManipulatorToServerPacket( + new Vec3d(Double.parseDouble(positionXField.getText()), Double.parseDouble(heightYField.getText()), Double.parseDouble(positionZField.getText())), + rotation, + scaling, + blockPos + ); serverPacket.sendToServer(); } @@ -206,6 +304,10 @@ public void draw(final IScreenBuilder builder) { final String tempX = positionXField.getText(); final String tempY = heightYField.getText(); final String tempZ = positionZField.getText(); + final String tempScalingX = scalingXField.getText(); + final String tempScalingY = scalingYField.getText(); + final String tempScalingZ = scalingZField.getText(); + if (!positionXField.getText().isEmpty() && !tempX.equals(textXBefore)) { positionXField.setText(String.valueOf(Static.round(Double.parseDouble(tempX), 3))); textXBefore = tempX; @@ -224,11 +326,44 @@ public void draw(final IScreenBuilder builder) { send(); } + if(!scalingXField.getText().isEmpty() && !tempScalingX.equals(scalingXBefore)){ + scalingXField.setText(String.valueOf(Static.round(Double.parseDouble(tempScalingX), 3))); + scalingXBefore = tempScalingX; + send(); + } + + if(!scalingYField.getText().isEmpty() && !tempScalingY.equals(scalingYBefore)){ + scalingYField.setText(String.valueOf(Static.round(Double.parseDouble(tempScalingY), 3))); + scalingYBefore = tempScalingY; + send(); + } + + if(!scalingZField.getText().isEmpty() && !tempScalingZ.equals(scalingZBefore)){ + scalingZField.setText(String.valueOf(Static.round(Double.parseDouble(tempScalingZ), 3))); + scalingZBefore = tempScalingZ; + send(); + } + } private void send() { //Client - final ManipulatorToClientPacket clientPacket = new ManipulatorToClientPacket(new Vec3d(Double.parseDouble(positionXField.getText()), Double.parseDouble(heightYField.getText()), Double.parseDouble(positionZField.getText())), rotation, blockPos, false); + scaling = new Vec3d( + Double.parseDouble(scalingXField.getText()), + Double.parseDouble(scalingYField.getText()), + Double.parseDouble(scalingZField.getText()) + ); + + final ManipulatorToClientPacket clientPacket = new ManipulatorToClientPacket( + new Vec3d( + Double.parseDouble(positionXField.getText()), + Double.parseDouble(heightYField.getText()), + Double.parseDouble(positionZField.getText())), + rotation, + blockPos, + scaling, + false + ); clientPacket.sendToAll(); } @@ -245,12 +380,22 @@ private void setAllInvisible() { rotationSlider.setVisible(false); rotationAddition.setVisible(false); rotationSubtraction.setVisible(false); + scalingXField.setVisible(false); + scalingXAddition.setVisible(false); + scalingXSubtraction.setVisible(false); + scalingYField.setVisible(false); + scalingYAddition.setVisible(false); + scalingYSubtraction.setVisible(false); + scalingZField.setVisible(false); + scalingZAddition.setVisible(false); + scalingZSubtraction.setVisible(false); } private void uncheckOtherBoxes(final CheckBox box) { positionBox.setChecked(false); heightBox.setChecked(false); rotationBox.setChecked(false); + scalingBox.setChecked(false); box.setChecked(true); } diff --git a/src/main/java/net/landofrails/landofsignals/gui/GuiText.java b/src/main/java/net/landofrails/landofsignals/gui/GuiText.java index c57c5712..a9f2755e 100644 --- a/src/main/java/net/landofrails/landofsignals/gui/GuiText.java +++ b/src/main/java/net/landofrails/landofsignals/gui/GuiText.java @@ -21,9 +21,9 @@ public enum GuiText { LABEL_UNATTACH("manipulator.unattach"), LABEL_EDITINGAME("manipulator.editingame"), LABEL_EDITROTATION("manipulator.editrotation"), - LABEL_EDITHITBOX("manipulator.edithitbox"), LABEL_ROTATIONSLIDER("manipulator.rotationslider"), - LABEL_EDITPOSITION("manipulator.editposition"); + LABEL_EDITPOSITION("manipulator.editposition"), + LABEL_EDITSCALING("manipulator.editscaling"); private final String value; diff --git a/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToClientPacket.java b/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToClientPacket.java index 13117994..73e30744 100644 --- a/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToClientPacket.java +++ b/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToClientPacket.java @@ -21,6 +21,8 @@ public class ManipulatorToClientPacket extends Packet { private boolean gui; @TagField("rotation") private int rotation; + @TagField("scaling") + private Vec3d scaling; @TagField("sneak") private boolean sneak; @@ -28,10 +30,11 @@ public ManipulatorToClientPacket() { } - public ManipulatorToClientPacket(final Vec3d offset, final int rotation, final Vec3i blockPos, final boolean sneak) { + public ManipulatorToClientPacket(final Vec3d offset, final int rotation, final Vec3i blockPos, final Vec3d scaling, final boolean sneak) { movement = offset; this.blockPos = blockPos; this.rotation = rotation; + this.scaling = scaling; gui = true; this.sneak = sneak; } @@ -62,6 +65,7 @@ protected void handle() { if (block instanceof IManipulate) { final IManipulate manipulate = (IManipulate) block; manipulate.setOffset(movement); + manipulate.setScaling(scaling); } } } else { @@ -71,6 +75,7 @@ protected void handle() { final IManipulate manipulate = (IManipulate) block; manipulate.setOffset(movement); manipulate.setRotation(rotation); + manipulate.setScaling(scaling); } } } diff --git a/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToServerPacket.java b/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToServerPacket.java index b266f2be..309ddc2c 100644 --- a/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToServerPacket.java +++ b/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToServerPacket.java @@ -15,14 +15,17 @@ public class ManipulatorToServerPacket extends Packet { private Vec3i blockPos; @TagField("rotation") private int rotation; + @TagField("scaling") + private Vec3d scaling; public ManipulatorToServerPacket() { } - public ManipulatorToServerPacket(final Vec3d offset, final int rotation, final Vec3i blockPos) { + public ManipulatorToServerPacket(final Vec3d offset, final int rotation, final Vec3d scaling, final Vec3i blockPos) { this.offset = offset; this.rotation = rotation; + this.scaling = scaling; this.blockPos = blockPos; } @@ -33,6 +36,7 @@ protected void handle() { final IManipulate manipulate = (IManipulate) block; manipulate.setOffset(offset); manipulate.setRotation(rotation); + manipulate.setScaling(scaling); } } } diff --git a/src/main/java/net/landofrails/landofsignals/render/block/TileComplexSignalRender.java b/src/main/java/net/landofrails/landofsignals/render/block/TileComplexSignalRender.java index 90d8a4e8..f5b3ceb9 100644 --- a/src/main/java/net/landofrails/landofsignals/render/block/TileComplexSignalRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/block/TileComplexSignalRender.java @@ -110,6 +110,7 @@ private static void renderStuff(final TileComplexSignal tsp) { private static void renderBase(String blockId, TileComplexSignal tile) { final Vec3d offset = tile.getOffset(); + final Vec3d customScaling = tile.getScaling(); checkCache(blockId, LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().get(blockId).getBase(), "/base/", true); @@ -124,7 +125,7 @@ private static void renderBase(String blockId, TileComplexSignal tile) { for (ContentPackModel baseModel : baseModels.getValue()) { final ContentPackBlock block = baseModel.getBlock(); final Vec3d translate = block.getAsVec3d(block::getTranslation).add(offset); - final Vec3d scale = block.getAsVec3d(block::getScaling); + final Vec3d scale = Static.multiply(block.getAsVec3d(block::getScaling), customScaling); final Vec3d rotation = block.getAsVec3d(block::getRotation); try (OpenGL.With ignored1 = OpenGL.matrix(); OpenGL.With ignored2 = renderer.bindTexture(baseModel.getTextures())) { @@ -157,6 +158,7 @@ private static void renderBase(String blockId, TileComplexSignal tile) { private static void renderSignals(final String blockId, final TileComplexSignal tile) { final Vec3d offset = tile.getOffset(); + final Vec3d customScaling = tile.getScaling(); final Map signalGroups = LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().get(blockId).getSignals(); @@ -183,7 +185,7 @@ private static void renderSignals(final String blockId, final TileComplexSignal for (ContentPackModel signalModel : signalModels.getValue()) { ContentPackBlock block = signalModel.getBlock(); final Vec3d translate = block.getAsVec3d(block::getTranslation).add(offset); - final Vec3d scale = block.getAsVec3d(block::getScaling); + final Vec3d scale = Static.multiply(block.getAsVec3d(block::getScaling), customScaling); final Vec3d rotation = block.getAsVec3d(block::getRotation); try (OpenGL.With ignored1 = OpenGL.matrix(); OpenGL.With ignored2 = renderer.bindTexture(signalModel.getTextures())) { diff --git a/src/main/java/net/landofrails/landofsignals/render/block/TileDecoRender.java b/src/main/java/net/landofrails/landofsignals/render/block/TileDecoRender.java index 8d6368f8..9b5962a6 100644 --- a/src/main/java/net/landofrails/landofsignals/render/block/TileDecoRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/block/TileDecoRender.java @@ -83,6 +83,7 @@ private static void renderStuff(TileDeco tsp) { private static void renderBase(String blockId, TileDeco tile) { Vec3d offset = tile.getOffset(); + Vec3d customScaling = tile.getScaling(); ContentPackDeco contentPackDeco = LOSBlocks.BLOCK_DECO.getContentpackDeco().get(blockId); @@ -100,7 +101,7 @@ private static void renderBase(String blockId, TileDeco tile) { for (ContentPackModel baseModel : baseModels.getValue()) { ContentPackBlock block = baseModel.getBlock(); Vec3d translate = block.getAsVec3d(block::getTranslation).add(offset); - Vec3d scale = block.getAsVec3d(block::getScaling); + final Vec3d scale = Static.multiply(block.getAsVec3d(block::getScaling), customScaling); Vec3d rotation = block.getAsVec3d(block::getRotation); try (OpenGL.With ignored1 = OpenGL.matrix(); OpenGL.With ignored2 = renderer.bindTexture(baseModel.getTextures())) { diff --git a/src/main/java/net/landofrails/landofsignals/render/block/TileSignPartRender.java b/src/main/java/net/landofrails/landofsignals/render/block/TileSignPartRender.java index feb6b298..603d9577 100644 --- a/src/main/java/net/landofrails/landofsignals/render/block/TileSignPartRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/block/TileSignPartRender.java @@ -84,6 +84,7 @@ private static void renderStuff(TileSignPart tsp) { private static void renderBase(String blockId, TileSignPart tile) { Vec3d offset = tile.getOffset(); + Vec3d customScaling = tile.getScaling(); ContentPackSign contentPackSign = LOSBlocks.BLOCK_SIGN_PART.getContentpackSigns().get(blockId); if(contentPackSign == null) contentPackSign = LOSBlocks.BLOCK_SIGN_PART.getContentpackSigns().get(Static.MISSING); @@ -99,7 +100,7 @@ private static void renderBase(String blockId, TileSignPart tile) { for (ContentPackModel baseModel : baseModels.getValue()) { ContentPackBlock block = baseModel.getBlock(); Vec3d translate = block.getAsVec3d(block::getTranslation).add(offset); - Vec3d scale = block.getAsVec3d(block::getScaling); + Vec3d scale = Static.multiply(block.getAsVec3d(block::getScaling), customScaling); Vec3d rotation = block.getAsVec3d(block::getRotation); try (OpenGL.With ignored1 = OpenGL.matrix(); OpenGL.With ignored2 = renderer.bindTexture(baseModel.getTextures())) { diff --git a/src/main/java/net/landofrails/landofsignals/render/block/TileSignalBoxRender.java b/src/main/java/net/landofrails/landofsignals/render/block/TileSignalBoxRender.java index 3a64e0ad..c29e8a47 100644 --- a/src/main/java/net/landofrails/landofsignals/render/block/TileSignalBoxRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/block/TileSignalBoxRender.java @@ -84,6 +84,7 @@ private static void renderStuff(final TileSignalBox tsp) { private static void renderBase(final String blockId, final TileSignalBox tile) { final Vec3d offset = tile.getOffset(); + final Vec3d customScaling = tile.getScaling(); ContentPackSignalbox contentPackSignalboxes = LOSBlocks.BLOCK_SIGNAL_BOX.getContentpackSignalboxes().get(blockId); if(contentPackSignalboxes == null) contentPackSignalboxes = LOSBlocks.BLOCK_SIGNAL_BOX.getContentpackSignalboxes().get(Static.MISSING); @@ -99,7 +100,7 @@ private static void renderBase(final String blockId, final TileSignalBox tile) { for (ContentPackModel baseModel : baseModels.getValue()) { final ContentPackBlock block = baseModel.getBlock(); final Vec3d translate = block.getAsVec3d(block::getTranslation).add(offset); - final Vec3d scale = block.getAsVec3d(block::getScaling); + final Vec3d scale = Static.multiply(block.getAsVec3d(block::getScaling), customScaling); final Vec3d rotation = block.getAsVec3d(block::getRotation); try (OpenGL.With ignored1 = OpenGL.matrix(); OpenGL.With ignored2 = renderer.bindTexture(baseModel.getTextures())) { diff --git a/src/main/java/net/landofrails/landofsignals/render/block/TileSignalPartRender.java b/src/main/java/net/landofrails/landofsignals/render/block/TileSignalPartRender.java index 537b9084..58267b10 100644 --- a/src/main/java/net/landofrails/landofsignals/render/block/TileSignalPartRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/block/TileSignalPartRender.java @@ -57,6 +57,7 @@ private static void renderStuff(final TileSignalPart tsp) { private static void renderBase(String blockId, ContentPackSignal signal, TileSignalPart tile) { final Vec3d offset = tile.getOffset(); + final Vec3d customScaling = tile.getScaling(); final String base = signal.getBase(); final String objPath = signal.getModel(); @@ -72,7 +73,10 @@ private static void renderBase(String blockId, ContentPackSignal signal, TileSig final float[] originalTranslate = signal.getTranslation(); final Vec3d translate = new Vec3d(originalTranslate[0], originalTranslate[1], originalTranslate[2]).add(offset); - final float[] scale = signal.getScaling(); + final float[] scale = signal.getScaling().clone(); + scale[0] *= customScaling.x; + scale[1] *= customScaling.y; + scale[2] *= customScaling.z; try (OpenGL.With ignored1 = OpenGL.matrix(); OpenGL.With ignored2 = renderer.bindTexture(base)) { @@ -96,6 +100,7 @@ private static void renderBase(String blockId, ContentPackSignal signal, TileSig private static void renderSignals(String blockId, ContentPackSignal signal, TileSignalPart tile) { final Vec3d offset = tile.getOffset(); + final Vec3d customScaling = tile.getScaling(); final String signalState = tile.getState(); final String objPath = signal.getModel(); @@ -111,7 +116,10 @@ private static void renderSignals(String blockId, ContentPackSignal signal, Tile final float[] originalTranslate = signal.getTranslation(); final Vec3d translate = new Vec3d(originalTranslate[0], originalTranslate[1], originalTranslate[2]).add(offset); - final float[] scale = signal.getScaling(); + final float[] scale = signal.getScaling().clone(); + scale[0] *= customScaling.x; + scale[1] *= customScaling.y; + scale[2] *= customScaling.z; try (OpenGL.With ignored1 = OpenGL.matrix(); OpenGL.With ignored2 = renderer.bindTexture(signalState)) { diff --git a/src/main/java/net/landofrails/landofsignals/tile/TileComplexSignal.java b/src/main/java/net/landofrails/landofsignals/tile/TileComplexSignal.java index ac6cad75..8aa764d2 100644 --- a/src/main/java/net/landofrails/landofsignals/tile/TileComplexSignal.java +++ b/src/main/java/net/landofrails/landofsignals/tile/TileComplexSignal.java @@ -42,6 +42,9 @@ public class TileComplexSignal extends BlockEntity implements IManipulate { @TagField("offset") private Vec3d offset = Vec3d.ZERO; + @TagField("scaling") + private Vec3d scaling = new Vec3d(1, 1, 1); + public TileComplexSignal(final String id, final int rot) { blockRotate = rot; this.id = id; @@ -121,12 +124,12 @@ public int getRotation() { @Override public void setScaling(Vec3d scaling) { - throw new UnsupportedOperationException("Not yet implemented."); + this.scaling = scaling; } @Override public Vec3d getScaling() { - return new Vec3d(1, 1, 1); + return scaling; } public Map getOrderedGroupStates() { diff --git a/src/main/java/net/landofrails/landofsignals/tile/TileDeco.java b/src/main/java/net/landofrails/landofsignals/tile/TileDeco.java index 35b795c0..9b5c0d4e 100644 --- a/src/main/java/net/landofrails/landofsignals/tile/TileDeco.java +++ b/src/main/java/net/landofrails/landofsignals/tile/TileDeco.java @@ -17,6 +17,8 @@ public class TileDeco extends BlockEntity implements IManipulate { private String id; @TagField("offset") private Vec3d offset = Vec3d.ZERO; + @TagField("scaling") + private Vec3d scaling = new Vec3d(1,1,1); public TileDeco(String id, int rot) { this.blockRotate = rot; @@ -83,12 +85,12 @@ public int getRotation() { @Override public void setScaling(Vec3d scaling) { - throw new UnsupportedOperationException("Not yet implemented."); + this.scaling = scaling; } @Override public Vec3d getScaling() { - return new Vec3d(1, 1, 1); + return scaling; } } diff --git a/src/main/java/net/landofrails/landofsignals/tile/TileSignPart.java b/src/main/java/net/landofrails/landofsignals/tile/TileSignPart.java index 159d74e3..35a6b361 100644 --- a/src/main/java/net/landofrails/landofsignals/tile/TileSignPart.java +++ b/src/main/java/net/landofrails/landofsignals/tile/TileSignPart.java @@ -30,6 +30,8 @@ public class TileSignPart extends BlockEntity implements IManipulate { private String signText; @TagField("offset") private Vec3d offset = Vec3d.ZERO; + @TagField("scaling") + private Vec3d scaling = new Vec3d(1,1,1); public TileSignPart(String id, int rot) { this.blockRotate = rot; @@ -107,12 +109,12 @@ public int getRotation() { @Override public void setScaling(Vec3d scaling) { - throw new UnsupportedOperationException("Not yet implemented."); + this.scaling = scaling; } @Override public Vec3d getScaling() { - return new Vec3d(1, 1, 1); + return scaling; } public void setText(String signText) { diff --git a/src/main/java/net/landofrails/landofsignals/tile/TileSignalBox.java b/src/main/java/net/landofrails/landofsignals/tile/TileSignalBox.java index 512a2f69..9994484e 100644 --- a/src/main/java/net/landofrails/landofsignals/tile/TileSignalBox.java +++ b/src/main/java/net/landofrails/landofsignals/tile/TileSignalBox.java @@ -36,6 +36,9 @@ public class TileSignalBox extends BlockEntity implements IManipulate { @TagField("offset") private Vec3d offset = Vec3d.ZERO; + @TagField("scaling") + private Vec3d scaling = new Vec3d(1,1,1); + @TagField("signalType") @Nullable private Byte signalType; // null = none, 0 = simple (old), 1 = complex @@ -424,11 +427,11 @@ public int getRotation() { @Override public void setScaling(Vec3d scaling) { - throw new UnsupportedOperationException("Not yet implemented."); + this.scaling = scaling; } @Override public Vec3d getScaling() { - return new Vec3d(1,1, 1); + return scaling; } } diff --git a/src/main/java/net/landofrails/landofsignals/utils/Static.java b/src/main/java/net/landofrails/landofsignals/utils/Static.java index d4de7070..2d5899e5 100644 --- a/src/main/java/net/landofrails/landofsignals/utils/Static.java +++ b/src/main/java/net/landofrails/landofsignals/utils/Static.java @@ -1,5 +1,7 @@ package net.landofrails.landofsignals.utils; +import cam72cam.mod.math.Vec3d; + import java.math.BigDecimal; import java.math.RoundingMode; @@ -17,6 +19,10 @@ public static double round(final double value, final int places) { return bd.doubleValue(); } + public static Vec3d multiply(final Vec3d first, final Vec3d second){ + return new Vec3d(first.x * second.x, first.y * second.y, first.z * second.z); + } + // Missing ID public static final String MISSING = "missing"; // Missing ID Name diff --git a/src/main/resources/assets/landofsignals/lang/de_DE.lang b/src/main/resources/assets/landofsignals/lang/de_DE.lang index 5e325c33..9c709a5b 100644 --- a/src/main/resources/assets/landofsignals/lang/de_DE.lang +++ b/src/main/resources/assets/landofsignals/lang/de_DE.lang @@ -15,7 +15,7 @@ gui.landofsignals:manipulator.unattach=Drücke Shift um zum GUI zurückzukehren gui.landofsignals:manipulator.editingame=Bearbeiten ingame gui.landofsignals:manipulator.editposition=Bearbeite Position gui.landofsignals:manipulator.editrotation=Bearbeite Rotation -gui.landofsignals:manipulator.edithitbox=Bearbeite Hitbox +gui.landofsignals:manipulator.editscaling=Bearbeite Scaling gui.landofsignals:manipulator.rotationslider=Rotation item.landofsignals:item_signal_so12.name=SO12 diff --git a/src/main/resources/assets/landofsignals/lang/en_US.lang b/src/main/resources/assets/landofsignals/lang/en_US.lang index 91bff762..85c7af0d 100644 --- a/src/main/resources/assets/landofsignals/lang/en_US.lang +++ b/src/main/resources/assets/landofsignals/lang/en_US.lang @@ -15,7 +15,7 @@ gui.landofsignals:manipulator.unattach=Press shift to return to GUI gui.landofsignals:manipulator.editingame=Edit ingame gui.landofsignals:manipulator.editposition=Edit position gui.landofsignals:manipulator.editrotation=Edit rotation -gui.landofsignals:manipulator.edithitbox=Edit hitbox +gui.landofsignals:manipulator.editscaling=Edit scaling gui.landofsignals:manipulator.rotationslider=Rotation item.landofsignals:item_signal_so12.name=SO12 From c485a40895901f19deb071113fe97f86335a345b Mon Sep 17 00:00:00 2001 From: Danielxs01 Date: Tue, 30 May 2023 23:31:03 +0200 Subject: [PATCH 37/52] [#103] Fixed issues with GUIs opening after using the manipulator item --- .../net/landofrails/landofsignals/tile/TileComplexSignal.java | 2 +- .../java/net/landofrails/landofsignals/tile/TileSignalBox.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/landofrails/landofsignals/tile/TileComplexSignal.java b/src/main/java/net/landofrails/landofsignals/tile/TileComplexSignal.java index 8aa764d2..e4e59299 100644 --- a/src/main/java/net/landofrails/landofsignals/tile/TileComplexSignal.java +++ b/src/main/java/net/landofrails/landofsignals/tile/TileComplexSignal.java @@ -53,7 +53,7 @@ public TileComplexSignal(final String id, final int rot) { @Override public boolean onClick(Player player, Player.Hand hand, Facing facing, Vec3d hit) { - if (player.isCrouching() || LandOfSignalsUtils.isLandOfSignalsItem(player.getHeldItem(hand))) { + if (player.isCrouching() || LandOfSignalsUtils.isLandOfSignalsItem(player.getHeldItem(Player.Hand.PRIMARY))) { return false; } if (!getWorld().isServer) { diff --git a/src/main/java/net/landofrails/landofsignals/tile/TileSignalBox.java b/src/main/java/net/landofrails/landofsignals/tile/TileSignalBox.java index 9994484e..e806aa6b 100644 --- a/src/main/java/net/landofrails/landofsignals/tile/TileSignalBox.java +++ b/src/main/java/net/landofrails/landofsignals/tile/TileSignalBox.java @@ -14,6 +14,7 @@ import net.landofrails.landofsignals.LOSItems; import net.landofrails.landofsignals.packet.SignalBoxTileSignalPartPacket; import net.landofrails.landofsignals.utils.IManipulate; +import net.landofrails.landofsignals.utils.LandOfSignalsUtils; import net.landofrails.landofsignals.utils.Static; import javax.annotation.Nullable; @@ -91,7 +92,7 @@ public IBoundingBox getRenderBoundingBox() { @Override public boolean onClick(Player player, Player.Hand hand, Facing facing, Vec3d hit) { - if (!player.getHeldItem(hand).is(LOSItems.ITEM_CONNECTOR) && !player.isCrouching() && player.getWorld().isServer) { + if (!LandOfSignalsUtils.isLandOfSignalsItem(player.getHeldItem(Player.Hand.PRIMARY)) && !player.isCrouching() && player.getWorld().isServer) { if(signalType == null) { refreshOldRedstoneVariables(); From e8d6510f1a53534f2c442ab2a63b5ec9cb986b19 Mon Sep 17 00:00:00 2001 From: Danielxs01 Date: Wed, 31 May 2023 22:08:41 +0200 Subject: [PATCH 38/52] [#103] Added "cascade changes" option to manipulator --- .../landofrails/landofsignals/LOSGuis.java | 5 +- ...uiManipualtor.java => GuiManipulator.java} | 19 ++++++-- .../landofsignals/gui/GuiText.java | 3 +- .../packet/GuiItemManipulatorToClient.java | 2 +- .../packet/ManipulatorToClientPacket.java | 46 +++++++------------ .../packet/ManipulatorToServerPacket.java | 39 +++++++++++++--- .../assets/landofsignals/lang/de_DE.lang | 3 +- .../assets/landofsignals/lang/en_US.lang | 1 + 8 files changed, 72 insertions(+), 46 deletions(-) rename src/main/java/net/landofrails/landofsignals/gui/{GuiManipualtor.java => GuiManipulator.java} (96%) diff --git a/src/main/java/net/landofrails/landofsignals/LOSGuis.java b/src/main/java/net/landofrails/landofsignals/LOSGuis.java index f8bf6066..d9422d17 100644 --- a/src/main/java/net/landofrails/landofsignals/LOSGuis.java +++ b/src/main/java/net/landofrails/landofsignals/LOSGuis.java @@ -13,12 +13,14 @@ private LOSGuis() { } + @SuppressWarnings("unused") public static final GuiRegistry.GUI TICKET_MACHINE_DB = GuiRegistry.register(new Identifier(LandOfSignals.MODID, "TICKET_MACHINE_DB"), GuiTicketMachine::new); // INFO: Replace GuiRegistry.BlockGUI with GuiRegistry.GUI to be able to open both on the same block. public static final GuiRegistry.GUI SIGNAL_BOX_COMPLEX_SIGNAL = GuiRegistry.register(new Identifier(LandOfSignals.MODID, "SIGNAL_BOX_COMPLEX_SIGNAL"), GuiSignalBoxComplexSignal::new); public static final GuiRegistry.GUI SIGNAL_BOX_SIGNAL_PART = GuiRegistry.register(new Identifier(LandOfSignals.MODID, "SIGNAL_BOX_SIGNAL_PART"), GuiSignalBoxSignalPart::new); + @SuppressWarnings("unused") public static final GuiRegistry.BlockGUI SIGNAL_ANIMATED_BOX = null; - public static final GuiRegistry.BlockGUI MANIPULATOR = GuiRegistry.registerBlock(BlockEntity.class, GuiManipualtor::new); + public static final GuiRegistry.BlockGUI MANIPULATOR = GuiRegistry.registerBlock(BlockEntity.class, GuiManipulator::new); public static final GuiRegistry.GUI SIGN_TEXTEDITOR = GuiRegistry.register(new Identifier(LandOfSignals.MODID, "SIGN_TEXTEDTIOR"), GuiSignTextEditor::new); public static final GuiRegistry.GUI SIGNAL_PRIORITIZATION = GuiRegistry.register(new Identifier(LandOfSignals.MODID, "SIGNAL_PRIORITIZATION"), GuiSignalPrioritization::new); @@ -27,5 +29,4 @@ private LOSGuis() { public static void register() { // loads static classes and ctrs } - } diff --git a/src/main/java/net/landofrails/landofsignals/gui/GuiManipualtor.java b/src/main/java/net/landofrails/landofsignals/gui/GuiManipulator.java similarity index 96% rename from src/main/java/net/landofrails/landofsignals/gui/GuiManipualtor.java rename to src/main/java/net/landofrails/landofsignals/gui/GuiManipulator.java index e1b62288..5f9eb850 100644 --- a/src/main/java/net/landofrails/landofsignals/gui/GuiManipualtor.java +++ b/src/main/java/net/landofrails/landofsignals/gui/GuiManipulator.java @@ -12,8 +12,9 @@ import java.util.function.Predicate; -public class GuiManipualtor implements IScreen { +public class GuiManipulator implements IScreen { + private CheckBox cascadeBox; private CheckBox positionBox; private CheckBox heightBox; private CheckBox rotationBox; @@ -65,7 +66,7 @@ public class GuiManipualtor implements IScreen { return true; }; - public GuiManipualtor(final BlockEntity be) { + public GuiManipulator(final BlockEntity be) { final IManipulate manipulate = (IManipulate) be; offset = manipulate.getOffset(); scaling = manipulate.getScaling(); @@ -77,6 +78,15 @@ public GuiManipualtor(final BlockEntity be) { @Override public void init(final IScreenBuilder screen) { + + cascadeBox = new CheckBox(screen, screen.getWidth() / 2 - screen.getWidth() + 50, 0, GuiText.LABEL_CASCADE.toString(), true) { + @Override + public void onClick(Player.Hand hand) { + // Nothing to do + } + }; + cascadeBox.setChecked(false); + positionBox = new CheckBox(screen, screen.getWidth() / 2 - screen.getWidth() + 50, 90, GuiText.LABEL_EDITPOSITION + " (X, Z)", true) { @Override public void onClick(final Player.Hand hand) { @@ -294,7 +304,8 @@ public void onClose() { new Vec3d(Double.parseDouble(positionXField.getText()), Double.parseDouble(heightYField.getText()), Double.parseDouble(positionZField.getText())), rotation, scaling, - blockPos + blockPos, + cascadeBox.isChecked() ); serverPacket.sendToServer(); } @@ -362,7 +373,7 @@ private void send() { rotation, blockPos, scaling, - false + cascadeBox.isChecked() ); clientPacket.sendToAll(); } diff --git a/src/main/java/net/landofrails/landofsignals/gui/GuiText.java b/src/main/java/net/landofrails/landofsignals/gui/GuiText.java index a9f2755e..ff39d728 100644 --- a/src/main/java/net/landofrails/landofsignals/gui/GuiText.java +++ b/src/main/java/net/landofrails/landofsignals/gui/GuiText.java @@ -23,7 +23,8 @@ public enum GuiText { LABEL_EDITROTATION("manipulator.editrotation"), LABEL_ROTATIONSLIDER("manipulator.rotationslider"), LABEL_EDITPOSITION("manipulator.editposition"), - LABEL_EDITSCALING("manipulator.editscaling"); + LABEL_EDITSCALING("manipulator.editscaling"), + LABEL_CASCADE("manipulator.cascade"); private final String value; diff --git a/src/main/java/net/landofrails/landofsignals/packet/GuiItemManipulatorToClient.java b/src/main/java/net/landofrails/landofsignals/packet/GuiItemManipulatorToClient.java index 4dd05232..34564378 100644 --- a/src/main/java/net/landofrails/landofsignals/packet/GuiItemManipulatorToClient.java +++ b/src/main/java/net/landofrails/landofsignals/packet/GuiItemManipulatorToClient.java @@ -8,7 +8,7 @@ public class GuiItemManipulatorToClient extends Packet { @TagField - BlockEntity block; + private BlockEntity block; public GuiItemManipulatorToClient(){ } diff --git a/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToClientPacket.java b/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToClientPacket.java index 73e30744..c607da59 100644 --- a/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToClientPacket.java +++ b/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToClientPacket.java @@ -13,37 +13,32 @@ public class ManipulatorToClientPacket extends Packet { @TagField("movement") private Vec3d movement; - @TagField("mainPos") - private Vec3d mainPos; @TagField("blockPos") private Vec3i blockPos; - @TagField("gui") - private boolean gui; @TagField("rotation") private int rotation; @TagField("scaling") private Vec3d scaling; - @TagField("sneak") - private boolean sneak; + @TagField("cascade") + private Boolean cascade; public ManipulatorToClientPacket() { } - public ManipulatorToClientPacket(final Vec3d offset, final int rotation, final Vec3i blockPos, final Vec3d scaling, final boolean sneak) { + public ManipulatorToClientPacket(final Vec3d offset, final int rotation, final Vec3i blockPos, final Vec3d scaling, final boolean cascade) { movement = offset; this.blockPos = blockPos; this.rotation = rotation; this.scaling = scaling; - gui = true; - this.sneak = sneak; + this.cascade = cascade; } @Override protected void handle() { final ArrayList blockPosList = new ArrayList<>(); - if (!sneak) { + if (Boolean.TRUE.equals(cascade)) { //UP int i = 0; while (getWorld().getBlockEntity(blockPos.up(i), BlockEntity.class) instanceof IManipulate) { @@ -56,28 +51,19 @@ protected void handle() { blockPosList.add(blockPos.down(j)); j++; } - } else blockPosList.add(blockPos); - - if (!gui) { - getPlayer().setPosition(mainPos); - for (final Vec3i bp : blockPosList) { - final BlockEntity block = getWorld().getBlockEntity(bp, BlockEntity.class); - if (block instanceof IManipulate) { - final IManipulate manipulate = (IManipulate) block; - manipulate.setOffset(movement); - manipulate.setScaling(scaling); - } - } } else { - for (final Vec3i bp : blockPosList) { - final BlockEntity block = getWorld().getBlockEntity(bp, BlockEntity.class); - if (block instanceof IManipulate) { - final IManipulate manipulate = (IManipulate) block; - manipulate.setOffset(movement); - manipulate.setRotation(rotation); - manipulate.setScaling(scaling); - } + blockPosList.add(blockPos); + } + + for (final Vec3i bp : blockPosList) { + final BlockEntity block = getWorld().getBlockEntity(bp, BlockEntity.class); + if (block instanceof IManipulate) { + final IManipulate manipulate = (IManipulate) block; + manipulate.setOffset(movement); + manipulate.setRotation(rotation); + manipulate.setScaling(scaling); } } + } } diff --git a/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToServerPacket.java b/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToServerPacket.java index 309ddc2c..c69dd82f 100644 --- a/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToServerPacket.java +++ b/src/main/java/net/landofrails/landofsignals/packet/ManipulatorToServerPacket.java @@ -7,6 +7,8 @@ import cam72cam.mod.serialization.TagField; import net.landofrails.landofsignals.utils.IManipulate; +import java.util.ArrayList; + public class ManipulatorToServerPacket extends Packet { @TagField("offset") @@ -17,26 +19,49 @@ public class ManipulatorToServerPacket extends Packet { private int rotation; @TagField("scaling") private Vec3d scaling; + @TagField("cascade") + private Boolean cascade; public ManipulatorToServerPacket() { } - public ManipulatorToServerPacket(final Vec3d offset, final int rotation, final Vec3d scaling, final Vec3i blockPos) { + public ManipulatorToServerPacket(final Vec3d offset, final int rotation, final Vec3d scaling, final Vec3i blockPos, boolean cascade) { this.offset = offset; this.rotation = rotation; this.scaling = scaling; this.blockPos = blockPos; + this.cascade = cascade; } @Override protected void handle() { - final BlockEntity block = getWorld().getBlockEntity(blockPos, BlockEntity.class); - if (block instanceof IManipulate) { - final IManipulate manipulate = (IManipulate) block; - manipulate.setOffset(offset); - manipulate.setRotation(rotation); - manipulate.setScaling(scaling); + final ArrayList blockPosList = new ArrayList<>(); + if (Boolean.TRUE.equals(cascade)) { + //UP + int i = 0; + while (getWorld().getBlockEntity(blockPos.up(i), BlockEntity.class) instanceof IManipulate) { + blockPosList.add(blockPos.up(i)); + i++; + } + //DOWN + int j = 0; + while (getWorld().getBlockEntity(blockPos.down(j), BlockEntity.class) instanceof IManipulate) { + blockPosList.add(blockPos.down(j)); + j++; + } + } else { + blockPosList.add(blockPos); + } + + for (final Vec3i bp : blockPosList) { + final BlockEntity block = getWorld().getBlockEntity(bp, BlockEntity.class); + if (block instanceof IManipulate) { + final IManipulate manipulate = (IManipulate) block; + manipulate.setOffset(offset); + manipulate.setRotation(rotation); + manipulate.setScaling(scaling); + } } } } diff --git a/src/main/resources/assets/landofsignals/lang/de_DE.lang b/src/main/resources/assets/landofsignals/lang/de_DE.lang index 9c709a5b..28e6713c 100644 --- a/src/main/resources/assets/landofsignals/lang/de_DE.lang +++ b/src/main/resources/assets/landofsignals/lang/de_DE.lang @@ -15,8 +15,9 @@ gui.landofsignals:manipulator.unattach=Drücke Shift um zum GUI zurückzukehren gui.landofsignals:manipulator.editingame=Bearbeiten ingame gui.landofsignals:manipulator.editposition=Bearbeite Position gui.landofsignals:manipulator.editrotation=Bearbeite Rotation -gui.landofsignals:manipulator.editscaling=Bearbeite Scaling +gui.landofsignals:manipulator.editscaling=Bearbeite Skalierung gui.landofsignals:manipulator.rotationslider=Rotation +gui.landofsignals:manipulator.cascade=Kaskadiere Änderungen item.landofsignals:item_signal_so12.name=SO12 item.landofsignals:item_signal_lever.name=Signalhebel diff --git a/src/main/resources/assets/landofsignals/lang/en_US.lang b/src/main/resources/assets/landofsignals/lang/en_US.lang index 85c7af0d..ed216884 100644 --- a/src/main/resources/assets/landofsignals/lang/en_US.lang +++ b/src/main/resources/assets/landofsignals/lang/en_US.lang @@ -17,6 +17,7 @@ gui.landofsignals:manipulator.editposition=Edit position gui.landofsignals:manipulator.editrotation=Edit rotation gui.landofsignals:manipulator.editscaling=Edit scaling gui.landofsignals:manipulator.rotationslider=Rotation +gui.landofsignals:manipulator.cascade=Cascade changes item.landofsignals:item_signal_so12.name=SO12 item.landofsignals:item_signal_lever.name=Signal Lever From 7854d267e5f0559c04a05bbde2a2b0667953ef57 Mon Sep 17 00:00:00 2001 From: Danielxs01 Date: Thu, 1 Jun 2023 23:52:12 +0200 Subject: [PATCH 39/52] [#103] Added text hint for leftclick/rightclick behaviour --- .../net/landofrails/landofsignals/gui/GuiManipulator.java | 7 +++++++ .../java/net/landofrails/landofsignals/gui/GuiText.java | 4 +++- src/main/resources/assets/landofsignals/lang/de_DE.lang | 2 ++ src/main/resources/assets/landofsignals/lang/en_US.lang | 2 ++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/landofrails/landofsignals/gui/GuiManipulator.java b/src/main/java/net/landofrails/landofsignals/gui/GuiManipulator.java index 5f9eb850..0637fd95 100644 --- a/src/main/java/net/landofrails/landofsignals/gui/GuiManipulator.java +++ b/src/main/java/net/landofrails/landofsignals/gui/GuiManipulator.java @@ -2,6 +2,7 @@ import cam72cam.mod.block.BlockEntity; import cam72cam.mod.entity.Player; +import cam72cam.mod.gui.helpers.GUIHelpers; import cam72cam.mod.gui.screen.*; import cam72cam.mod.math.Vec3d; import cam72cam.mod.math.Vec3i; @@ -20,6 +21,8 @@ public class GuiManipulator implements IScreen { private CheckBox rotationBox; private CheckBox scalingBox; + + private Slider rotationSlider; private Button rotationAddition; private Button rotationSubtraction; @@ -355,6 +358,10 @@ public void draw(final IScreenBuilder builder) { send(); } + if(!rotationBox.isChecked()){ + GUIHelpers.drawCenteredString(GuiText.LABEL_LEFTCLICK.toString(), builder.getWidth() / 2 + 155, builder.getHeight() / 2 - 80, 0xFFFFFF); + GUIHelpers.drawCenteredString(GuiText.LABEL_RIGHTCLICK.toString(), builder.getWidth() / 2 + 155, builder.getHeight() / 2 - 70, 0xFFFFFF); + } } private void send() { diff --git a/src/main/java/net/landofrails/landofsignals/gui/GuiText.java b/src/main/java/net/landofrails/landofsignals/gui/GuiText.java index ff39d728..d757bc94 100644 --- a/src/main/java/net/landofrails/landofsignals/gui/GuiText.java +++ b/src/main/java/net/landofrails/landofsignals/gui/GuiText.java @@ -24,7 +24,9 @@ public enum GuiText { LABEL_ROTATIONSLIDER("manipulator.rotationslider"), LABEL_EDITPOSITION("manipulator.editposition"), LABEL_EDITSCALING("manipulator.editscaling"), - LABEL_CASCADE("manipulator.cascade"); + LABEL_CASCADE("manipulator.cascade"), + LABEL_LEFTCLICK("manipulator.leftclick"), + LABEL_RIGHTCLICK("manipulator.rightclick"); private final String value; diff --git a/src/main/resources/assets/landofsignals/lang/de_DE.lang b/src/main/resources/assets/landofsignals/lang/de_DE.lang index 28e6713c..36397f2c 100644 --- a/src/main/resources/assets/landofsignals/lang/de_DE.lang +++ b/src/main/resources/assets/landofsignals/lang/de_DE.lang @@ -18,6 +18,8 @@ gui.landofsignals:manipulator.editrotation=Bearbeite Rotation gui.landofsignals:manipulator.editscaling=Bearbeite Skalierung gui.landofsignals:manipulator.rotationslider=Rotation gui.landofsignals:manipulator.cascade=Kaskadiere Änderungen +gui.landofsignals:manipulator.leftclick=Linksklick +/- 1.0 +gui.landofsignals:manipulator.rightclick=Rechtsklick +/- 0.1 item.landofsignals:item_signal_so12.name=SO12 item.landofsignals:item_signal_lever.name=Signalhebel diff --git a/src/main/resources/assets/landofsignals/lang/en_US.lang b/src/main/resources/assets/landofsignals/lang/en_US.lang index ed216884..ab7ea7b4 100644 --- a/src/main/resources/assets/landofsignals/lang/en_US.lang +++ b/src/main/resources/assets/landofsignals/lang/en_US.lang @@ -18,6 +18,8 @@ gui.landofsignals:manipulator.editrotation=Edit rotation gui.landofsignals:manipulator.editscaling=Edit scaling gui.landofsignals:manipulator.rotationslider=Rotation gui.landofsignals:manipulator.cascade=Cascade changes +gui.landofsignals:manipulator.leftclick=Left click +/- 1.0 +gui.landofsignals:manipulator.rightclick=Right click +/- 0.1 item.landofsignals:item_signal_so12.name=SO12 item.landofsignals:item_signal_lever.name=Signal Lever From ea86dfb72269bb16ac013ef550aaacd8839901f0 Mon Sep 17 00:00:00 2001 From: Danielxs01 Date: Mon, 5 Jun 2023 22:16:19 +0200 Subject: [PATCH 40/52] [#103] Added reset-function --- .../landofsignals/gui/GuiManipulator.java | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/landofrails/landofsignals/gui/GuiManipulator.java b/src/main/java/net/landofrails/landofsignals/gui/GuiManipulator.java index 0637fd95..7de1691e 100644 --- a/src/main/java/net/landofrails/landofsignals/gui/GuiManipulator.java +++ b/src/main/java/net/landofrails/landofsignals/gui/GuiManipulator.java @@ -21,8 +21,6 @@ public class GuiManipulator implements IScreen { private CheckBox rotationBox; private CheckBox scalingBox; - - private Slider rotationSlider; private Button rotationAddition; private Button rotationSubtraction; @@ -140,6 +138,13 @@ public void onClick(final Player.Hand hand) { } }; + new Button(screen, screen.getWidth() / 2 - screen.getWidth() + 50, -30, 60, 20, "Reset all") { + @Override + public void onClick(Player.Hand hand) { + resetAll(screen); + } + }; + renewSlider(screen); rotationSubtraction = new Button(screen,screen.getWidth() / 2 - 220, 100, 20, 20, "-") { @Override @@ -434,4 +439,17 @@ private double getModifier(Player.Hand hand){ return hand == Player.Hand.PRIMARY ? 1.0 : 0.1; } + private void resetAll(IScreenBuilder screen){ + + scalingXField.setText("1"); + scalingYField.setText("1"); + scalingZField.setText("1"); + + positionXField.setText("0"); + heightYField.setText("0"); + positionZField.setText("0"); + + screen.close(); + } + } From f8a6dddd78979d9b048d0ad60321c156d9abdb88 Mon Sep 17 00:00:00 2001 From: Danielxs01 Date: Mon, 12 Jun 2023 00:24:27 +0200 Subject: [PATCH 41/52] [#106] Added magnifyingglass (first attempt) --- .../landofrails/landofsignals/LOSItems.java | 2 +- .../landofsignals/LandOfSignals.java | 1 + .../items/ItemMagnifyingGlass.java | 62 + .../render/block/TileComplexSignalRender.java | 5 + .../render/block/TileSignalBoxRender.java | 4 + .../render/block/TileSignalPartRender.java | 5 + .../landofsignals/tile/TileComplexSignal.java | 12 + .../landofsignals/tile/TileSignalBox.java | 22 + .../landofsignals/tile/TileSignalPart.java | 12 + .../landofsignals/utils/HighlightingUtil.java | 102 ++ .../utils/LandOfSignalsUtils.java | 1 + .../connection-box/amber/color.png | Bin 0 -> 140 bytes .../connection-box/black/color.png | Bin 0 -> 140 bytes .../connection-box/blue_light/color.png | Bin 0 -> 140 bytes .../landofsignals/connection-box/color.png | Bin 0 -> 87 bytes .../connection-box/connection-box.mtl | 4 + .../connection-box/connection-box.obj | 1190 +++++++++++++++++ .../connection-box/gray/color.png | Bin 0 -> 140 bytes .../connection-box/gray_dark/color.png | Bin 0 -> 140 bytes .../connection-box/green_dark/color.png | Bin 0 -> 140 bytes .../connection-box/green_light/color.png | Bin 0 -> 140 bytes .../connection-box/orange_light/color.png | Bin 0 -> 134 bytes .../connection-box/red/color.png | Bin 0 -> 140 bytes .../connection-box/yellow_green/color.png | Bin 0 -> 140 bytes .../textures/items/magnifyingglass.png | Bin 0 -> 1032 bytes 25 files changed, 1421 insertions(+), 1 deletion(-) create mode 100644 src/main/java/net/landofrails/landofsignals/items/ItemMagnifyingGlass.java create mode 100644 src/main/java/net/landofrails/landofsignals/utils/HighlightingUtil.java create mode 100644 src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/amber/color.png create mode 100644 src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/black/color.png create mode 100644 src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/blue_light/color.png create mode 100644 src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/color.png create mode 100644 src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/connection-box.mtl create mode 100644 src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/connection-box.obj create mode 100644 src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/gray/color.png create mode 100644 src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/gray_dark/color.png create mode 100644 src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/green_dark/color.png create mode 100644 src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/green_light/color.png create mode 100644 src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/orange_light/color.png create mode 100644 src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/red/color.png create mode 100644 src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/yellow_green/color.png create mode 100644 src/main/resources/assets/landofsignals/textures/items/magnifyingglass.png diff --git a/src/main/java/net/landofrails/landofsignals/LOSItems.java b/src/main/java/net/landofrails/landofsignals/LOSItems.java index c9183d33..49b434f7 100644 --- a/src/main/java/net/landofrails/landofsignals/LOSItems.java +++ b/src/main/java/net/landofrails/landofsignals/LOSItems.java @@ -13,7 +13,7 @@ private LOSItems() { public static final ItemSignalLever ITEM_SIGNAL_LEVER = new ItemSignalLever(LandOfSignals.MODID, "item_signal_lever"); public static final ItemConnector ITEM_CONNECTOR = new ItemConnector(LandOfSignals.MODID, "item_connector"); public static final ItemManipulator ITEM_MANIPULATOR = new ItemManipulator(LandOfSignals.MODID, "item_manipulator"); - + public static final ItemMagnifyingGlass ITEM_MAGNIFYING_GLASS = new ItemMagnifyingGlass(LandOfSignals.MODID, "item_magnifying_glass"); public static final ItemSignalPart ITEM_SIGNAL_PART = new ItemSignalPart(LandOfSignals.MODID, "item_signal_part"); public static final CustomItem ITEM_COMPLEX_SIGNAL = new ItemComplexSignal(LandOfSignals.MODID, "item_complex_signal"); public static final ItemSignalPartAnimated ITEM_SIGNAL_PART_ANIMATED = new ItemSignalPartAnimated(LandOfSignals.MODID, "item_signal_part_animated"); diff --git a/src/main/java/net/landofrails/landofsignals/LandOfSignals.java b/src/main/java/net/landofrails/landofsignals/LandOfSignals.java index b683d252..613231ee 100644 --- a/src/main/java/net/landofrails/landofsignals/LandOfSignals.java +++ b/src/main/java/net/landofrails/landofsignals/LandOfSignals.java @@ -94,6 +94,7 @@ public void clientEvent(final ModEvent event) { ItemRender.register(LOSItems.ITEM_SIGNAL_LEVER, ObjItemRender.getModelFor(new Identifier(LandOfSignals.MODID, "models/block/landofsignals/signalslever/signalslever.obj"), new Vec3d(0.5, 0.6, 0.5), 1)); ItemRender.register(LOSItems.ITEM_CONNECTOR, new Identifier(LandOfSignals.MODID, "items/itemconnector1")); ItemRender.register(LOSItems.ITEM_MANIPULATOR, new Identifier(LandOfSignals.MODID, "items/manipulator")); + ItemRender.register(LOSItems.ITEM_MAGNIFYING_GLASS, new Identifier(LandOfSignals.MODID, "items/magnifyingglass")); //SignalPart : Block BlockRender.register(LOSBlocks.BLOCK_SIGNAL_PART, TileSignalPartRender::render, TileSignalPart.class); diff --git a/src/main/java/net/landofrails/landofsignals/items/ItemMagnifyingGlass.java b/src/main/java/net/landofrails/landofsignals/items/ItemMagnifyingGlass.java new file mode 100644 index 00000000..a86413bf --- /dev/null +++ b/src/main/java/net/landofrails/landofsignals/items/ItemMagnifyingGlass.java @@ -0,0 +1,62 @@ +package net.landofrails.landofsignals.items; + +import cam72cam.mod.entity.Player; +import cam72cam.mod.item.ClickResult; +import cam72cam.mod.item.CreativeTab; +import cam72cam.mod.item.CustomItem; +import cam72cam.mod.math.Vec3d; +import cam72cam.mod.math.Vec3i; +import cam72cam.mod.util.Facing; +import cam72cam.mod.world.World; +import net.landofrails.landofsignals.LOSBlocks; +import net.landofrails.landofsignals.LOSTabs; +import net.landofrails.landofsignals.tile.TileSignalBox; +import net.landofrails.landofsignals.utils.HighlightingUtil; + +import java.util.List; + +public class ItemMagnifyingGlass extends CustomItem { + + public ItemMagnifyingGlass(final String modID, final String name) { + super(modID, name); + } + + @Override + public List getCreativeTabs() { + return LOSTabs.getAsList(LOSTabs.ASSETS_TAB); + } + + @Override + @SuppressWarnings({"java:S2696", "java:S1134"}) + public ClickResult onClickBlock(final Player player, final World world, final Vec3i pos, final Player.Hand hand, final Facing facing, final Vec3d inBlockPos) { + HighlightingUtil.renderHighlighting(); + if (!world.isClient) { + return ClickResult.REJECTED; + } + if(hand.equals(Player.Hand.SECONDARY)){ + return ClickResult.PASS; + } + if(!world.isBlock(pos, LOSBlocks.BLOCK_SIGNAL_BOX)){ + return ClickResult.PASS; + } + + List signalBoxes = world.getBlockEntities(TileSignalBox.class); + signalBoxes.stream().filter(TileSignalBox::isHighlighting).forEach(TileSignalBox::toggleHighlighting); + + TileSignalBox signalBox = world.getBlockEntity(pos, TileSignalBox.class); + signalBox.toggleHighlighting(); + + return ClickResult.ACCEPTED; + } + + @Override + public void onClickAir(Player player, World world, Player.Hand hand) { + + if(!world.isClient || hand.equals(Player.Hand.SECONDARY)){ + return; + } + + List signalBoxes = world.getBlockEntities(TileSignalBox.class); + signalBoxes.stream().filter(TileSignalBox::isHighlighting).forEach(TileSignalBox::toggleHighlighting); + } +} diff --git a/src/main/java/net/landofrails/landofsignals/render/block/TileComplexSignalRender.java b/src/main/java/net/landofrails/landofsignals/render/block/TileComplexSignalRender.java index f5b3ceb9..e05e2a8c 100644 --- a/src/main/java/net/landofrails/landofsignals/render/block/TileComplexSignalRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/block/TileComplexSignalRender.java @@ -14,6 +14,7 @@ import net.landofrails.landofsignals.LOSBlocks; import net.landofrails.landofsignals.LandOfSignals; import net.landofrails.landofsignals.tile.TileComplexSignal; +import net.landofrails.landofsignals.utils.HighlightingUtil; import net.landofrails.landofsignals.utils.Static; import org.lwjgl.opengl.GL11; @@ -104,6 +105,10 @@ private static void renderStuff(final TileComplexSignal tsp) { renderBase(id, tsp); renderSignals(id, tsp); + if(tsp.isHighlighting()){ + HighlightingUtil.renderHighlighting(); + } + } @SuppressWarnings("java:S1134") diff --git a/src/main/java/net/landofrails/landofsignals/render/block/TileSignalBoxRender.java b/src/main/java/net/landofrails/landofsignals/render/block/TileSignalBoxRender.java index c29e8a47..2db2d9b0 100644 --- a/src/main/java/net/landofrails/landofsignals/render/block/TileSignalBoxRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/block/TileSignalBoxRender.java @@ -13,6 +13,7 @@ import net.landofrails.landofsignals.LOSBlocks; import net.landofrails.landofsignals.LandOfSignals; import net.landofrails.landofsignals.tile.TileSignalBox; +import net.landofrails.landofsignals.utils.HighlightingUtil; import net.landofrails.landofsignals.utils.Static; import org.lwjgl.opengl.GL11; @@ -79,6 +80,9 @@ private static void renderStuff(final TileSignalBox tsp) { renderBase(id, tsp); + if(tsp.isHighlighting()){ + HighlightingUtil.renderHighlighting(); + } } private static void renderBase(final String blockId, final TileSignalBox tile) { diff --git a/src/main/java/net/landofrails/landofsignals/render/block/TileSignalPartRender.java b/src/main/java/net/landofrails/landofsignals/render/block/TileSignalPartRender.java index 58267b10..c15385de 100644 --- a/src/main/java/net/landofrails/landofsignals/render/block/TileSignalPartRender.java +++ b/src/main/java/net/landofrails/landofsignals/render/block/TileSignalPartRender.java @@ -12,6 +12,7 @@ import net.landofrails.landofsignals.LandOfSignals; import net.landofrails.landofsignals.render.item.ItemRenderException; import net.landofrails.landofsignals.tile.TileSignalPart; +import net.landofrails.landofsignals.utils.HighlightingUtil; import net.landofrails.landofsignals.utils.Static; import org.lwjgl.opengl.GL11; @@ -51,6 +52,10 @@ private static void renderStuff(final TileSignalPart tsp) { } renderSignals(id, signal, tsp); + if(tsp.isHighlighting()){ + HighlightingUtil.renderHighlighting(); + } + } @SuppressWarnings("java:S1134") diff --git a/src/main/java/net/landofrails/landofsignals/tile/TileComplexSignal.java b/src/main/java/net/landofrails/landofsignals/tile/TileComplexSignal.java index e4e59299..bf59153f 100644 --- a/src/main/java/net/landofrails/landofsignals/tile/TileComplexSignal.java +++ b/src/main/java/net/landofrails/landofsignals/tile/TileComplexSignal.java @@ -45,6 +45,9 @@ public class TileComplexSignal extends BlockEntity implements IManipulate { @TagField("scaling") private Vec3d scaling = new Vec3d(1, 1, 1); + // client-only + private boolean highlighting = false; + public TileComplexSignal(final String id, final int rot) { blockRotate = rot; this.id = id; @@ -240,4 +243,13 @@ public boolean compatible(TileSignalBox tileSignalBox) { return foundActiveState && foundInactiveState; } + + public void setHighlighting(boolean highlighting) { + this.highlighting = highlighting; + } + + public boolean isHighlighting(){ + return this.highlighting; + } + } diff --git a/src/main/java/net/landofrails/landofsignals/tile/TileSignalBox.java b/src/main/java/net/landofrails/landofsignals/tile/TileSignalBox.java index e806aa6b..1f947f72 100644 --- a/src/main/java/net/landofrails/landofsignals/tile/TileSignalBox.java +++ b/src/main/java/net/landofrails/landofsignals/tile/TileSignalBox.java @@ -66,6 +66,9 @@ public class TileSignalBox extends BlockEntity implements IManipulate { private TileSignalPart tileSignalPart; private TileComplexSignal tileComplexSignal; + // client-only + private boolean highlighting = false; + public TileSignalBox(String id, int rot) { this.id = id; this.blockRotate = rot; @@ -435,4 +438,23 @@ public void setScaling(Vec3d scaling) { public Vec3d getScaling() { return scaling; } + + public void toggleHighlighting() { + this.highlighting = !this.highlighting; + if(signalType != null && 0 == signalType){ + TileSignalPart signal = getWorld().getBlockEntity(tileSignalPartPos, TileSignalPart.class); + if(signal != null){ + signal.setHighlighting(this.highlighting); + } + }else if(signalType != null && 1 == signalType){ + TileComplexSignal signal = getWorld().getBlockEntity(tileSignalPartPos, TileComplexSignal.class); + if(signal != null){ + signal.setHighlighting(this.highlighting); + } + } + } + + public boolean isHighlighting(){ + return this.highlighting; + } } diff --git a/src/main/java/net/landofrails/landofsignals/tile/TileSignalPart.java b/src/main/java/net/landofrails/landofsignals/tile/TileSignalPart.java index ab9b1e1d..6a0ddf5b 100644 --- a/src/main/java/net/landofrails/landofsignals/tile/TileSignalPart.java +++ b/src/main/java/net/landofrails/landofsignals/tile/TileSignalPart.java @@ -48,6 +48,9 @@ public class TileSignalPart extends BlockEntity implements IManipulate { @TagField("scaling") private Vec3d scaling = new Vec3d(1, 1, 1); + // client-only + private boolean highlighting = false; + public TileSignalPart(final String id, final int rot) { this.blockRotate = rot; this.id = id; @@ -265,4 +268,13 @@ public boolean compatible(TileSignalBox tileSignalBox) { return foundActiveState && foundInactiveState; } + + public void setHighlighting(boolean highlighting) { + this.highlighting = highlighting; + } + + public boolean isHighlighting(){ + return this.highlighting; + } + } diff --git a/src/main/java/net/landofrails/landofsignals/utils/HighlightingUtil.java b/src/main/java/net/landofrails/landofsignals/utils/HighlightingUtil.java new file mode 100644 index 00000000..49b79e48 --- /dev/null +++ b/src/main/java/net/landofrails/landofsignals/utils/HighlightingUtil.java @@ -0,0 +1,102 @@ +package net.landofrails.landofsignals.utils; + +import cam72cam.mod.model.obj.OBJModel; +import cam72cam.mod.render.OpenGL; +import cam72cam.mod.render.obj.OBJRender; +import cam72cam.mod.resource.Identifier; +import net.landofrails.landofsignals.LandOfSignals; +import org.lwjgl.opengl.GL11; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Random; +import java.util.stream.Collectors; + +public class HighlightingUtil { + + private static OBJRender render; + private static final Random RANDOM = new Random(); + + private static LocalDateTime colortime = LocalDateTime.now(); + private static HighlightingColors color = HighlightingColors.getRandomColor(); + + private HighlightingUtil(){ + } + + @SuppressWarnings("java:S1141") + public static void renderHighlighting() { + try { + OBJRender render = getOBJRender(); + try (OpenGL.With ignored1 = OpenGL.matrix(); OpenGL.With ignored2 = render.bindTexture(getColor())) { + GL11.glTranslated(0.5,0,0.5); + render.draw(); + } catch (Exception e) { + // Not good, not bad enough to fail + } + } catch (Exception e) { + // Not good, not bad enough to fail + } + } + + private static String getColor(){ + LocalDateTime now = LocalDateTime.now(); + if(colortime.plusSeconds(1).isBefore(now)){ + HighlightingColors newColor; + do{ + newColor = HighlightingColors.getRandomColor(); + }while(newColor.equals(color)); + color = newColor; + colortime = LocalDateTime.now(); + } + return color.getFolder(); + } + + private static OBJRender getOBJRender() throws Exception { + if(render == null){ + OBJModel model = new OBJModel(new Identifier(LandOfSignals.MODID, "models/block/landofsignals/connection-box/connection-box.obj"), 0, HighlightingColors.getAllColorsAsStrings()); + render = new OBJRender(model); + } + return render; + } + + private enum HighlightingColors { + + WHITE(null), + AMBER("amber"), + BLACK("black"), + BLUE_LIGHT("blue_light"), + GRAY("gray"), + GRAY_DARK("gray_dark"), + GREEN_DARK("green_dark"), + GREEN_LIGHT("green_light"), + ORANGE_LIGHT("orange_light"), + RED("red"), + YELLOW_GREEN("yellow_green"); + + private final String folder; + + HighlightingColors(String folder){ + this.folder = folder; + } + + private String getFolder(){ + return this.folder; + } + + public static HighlightingColors getRandomColor(){ + + int randomNumber = RANDOM.nextInt(HighlightingColors.values().length); + return HighlightingColors.values()[randomNumber]; + } + + public static List getAllColorsAsStrings(){ + return Arrays.stream(HighlightingColors.values()) + .map(HighlightingColors::getFolder) + .collect(Collectors.toCollection(ArrayList::new)); + } + + } + +} diff --git a/src/main/java/net/landofrails/landofsignals/utils/LandOfSignalsUtils.java b/src/main/java/net/landofrails/landofsignals/utils/LandOfSignalsUtils.java index 6caf13db..9e142b31 100644 --- a/src/main/java/net/landofrails/landofsignals/utils/LandOfSignalsUtils.java +++ b/src/main/java/net/landofrails/landofsignals/utils/LandOfSignalsUtils.java @@ -36,6 +36,7 @@ public static String getUniqueIdOfItemStack(final ItemStack itemStack) { public static boolean isLandOfSignalsItem(final ItemStack itemStack){ return itemStack.is(LOSItems.ITEM_CONNECTOR) || itemStack.is(LOSItems.ITEM_MANIPULATOR) + || itemStack.is(LOSItems.ITEM_MAGNIFYING_GLASS) || itemStack.is(LOSItems.ITEM_COMPLEX_SIGNAL) || itemStack.is(LOSItems.ITEM_DECO) || itemStack.is(LOSItems.ITEM_SIGN_PART) diff --git a/src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/amber/color.png b/src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/amber/color.png new file mode 100644 index 0000000000000000000000000000000000000000..c878e0ad7eaba740e3b7ba0d66b0a2d1fa7ab7a0 GIT binary patch literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1enP|?%HF~q_@`A>QCM|)=022QWZyl%V_rVK1V evVvJcg5gL8)3>56^WFm$GkCiCxvXgTe~DWM4fBR(Mc literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/blue_light/color.png b/src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/blue_light/color.png new file mode 100644 index 0000000000000000000000000000000000000000..f057511dfcb44cd0f924e84bf5a463d0370ffeba GIT binary patch literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sDEfH31!Z9ZwBprWUXV~B-+a><#RAM+cT4zMge$+noSM~Z=I gF&obwMjjr9z9~$rHf+*g1XRr6>FVdQ&MBb@0C^>bP0l+XkKO&KA} literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/green_light/color.png b/src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/green_light/color.png new file mode 100644 index 0000000000000000000000000000000000000000..a916b3955b6bec9caaa5adac26a841c489748563 GIT binary patch literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1enP|?%HF~q_@dCt%4U+kG#8#uit^Sbd$m@=>c e$qHr(35Ln)Ot0iaPuBqzGkCiCxvXAjKR~@&t;ucLK6VB*&^!z literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/red/color.png b/src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/red/color.png new file mode 100644 index 0000000000000000000000000000000000000000..fa4aa1bbedd59fd2f95ef6ce56e75b3433a865fa GIT binary patch literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1enP|?%HF~q_@xkh{Or}>Rc2UwP#WLwPEBgMe9 gn2l!-BM%RQ&?zRL&~@`tfQlJBUHx3vIVCg!09fxLDF6Tf literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/yellow_green/color.png b/src/main/resources/assets/landofsignals/models/block/landofsignals/connection-box/yellow_green/color.png new file mode 100644 index 0000000000000000000000000000000000000000..e73e8a9ac9bfaba4e93a4770d92a39453241d25e GIT binary patch literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1enP|?%HF~q_@c~8akhxW{@4V+$+dEIy=Oc_{! eWCgQ?1cU59rn70kKH35mGkCiCxvXF;%h+d)OMaqJt ze!Sx4?&IWfu_i?nO<6*3xF(gR(}B^jtFC6t7&1b<|AqVZI|xbCTOwWoTtJx5+y<+K zw`tF0)dVKbc+gevzpZ1c=V9{)_bsYkf&fwftss?@5K)BFtph-hNvYw4e&hil0bb2k zF^P}bz;i3ZL6L^;2tQp03P#PPI?oKV3{00XQLL!XrfSlmrJdSAz#tV)Up`E1)&kY>9dYQYJ$4Qmu=yvE4WuE{E^H~UySenjl$qg+bxj0tIR^TDz zrj(=8Y+$oHaI)+bPB*8T21-07?`twKDux_$b2z3KTH~13v{I2&7@35&vp1krxT8-- zm}J{~(nKmu*OELUxmP8MPn4ZCwxA4w@!*CHx81yE$4t)+U4>C7wIjXFWZQ3-={4*{ zwBLAniZ|azNfY`OV}4fz+9~aDt{&|udRAdq=9b`{iv=yvuX($<;&G*=5Hn3NI|3ui zsidM2xfjke^I1B&`OH+PFW6X`$R{A7JNZeO2KWb4tIaf}ZUMId0000 Date: Thu, 15 Jun 2023 17:49:25 +0200 Subject: [PATCH 42/52] [#108] Current state of dynamic scaling --- .../configs/LandOfSignalsConfig.java | 9 ++ .../contentpacks/ContentPackHandler.java | 152 +++++++++++++++++- 2 files changed, 155 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/landofrails/landofsignals/configs/LandOfSignalsConfig.java b/src/main/java/net/landofrails/landofsignals/configs/LandOfSignalsConfig.java index f71758ce..15c4666b 100644 --- a/src/main/java/net/landofrails/landofsignals/configs/LandOfSignalsConfig.java +++ b/src/main/java/net/landofrails/landofsignals/configs/LandOfSignalsConfig.java @@ -11,4 +11,13 @@ public class LandOfSignalsConfig { @ConfigFile.Comment("Enables preloading, slower startup, less lag spikes. If you want to use it, set it to \"true\". | Default: false") public static boolean preloadModels = false; + @ConfigFile.Name("experimental") + @ConfigFile.Comment("Experimental features - activate at own risk") + public static class Experimental { + + @ConfigFile.Comment("Rescale items to slot size") + public static boolean rescaleItems = false; + + } + } diff --git a/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java b/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java index bd42a93e..988bc814 100644 --- a/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java +++ b/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java @@ -2,6 +2,7 @@ import cam72cam.mod.ModCore; import cam72cam.mod.gui.Progress; +import cam72cam.mod.math.Vec3d; import cam72cam.mod.model.obj.OBJModel; import cam72cam.mod.render.obj.OBJRender; import cam72cam.mod.resource.Identifier; @@ -11,18 +12,17 @@ import net.landofrails.api.contentpacks.v2.signal.ContentPackSignal; import net.landofrails.landofsignals.LOSBlocks; import net.landofrails.landofsignals.LandOfSignals; +import net.landofrails.landofsignals.configs.LandOfSignalsConfig; import net.landofrails.landofsignals.render.block.*; import net.landofrails.landofsignals.render.item.*; +import net.landofrails.landofsignals.utils.Static; import net.landofrails.stellwand.utils.exceptions.ContentPackException; import java.io.File; import java.io.IOException; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.Optional; +import java.util.*; import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.zip.ZipEntry; @@ -33,6 +33,8 @@ public class ContentPackHandler { private static final String GENERIC_ITEM_ERRMSG = "Couldn't preload item with id \"%s\". Cause:"; private static final String GENERIC_BLOCK_ERRMSG = "Couldn't preload block with id \"%s\". Cause:"; + private static final String BASE_IDENTIFIER = "/base/"; + private ContentPackHandler() { } @@ -183,7 +185,7 @@ public static void preloadModels(){ // Cache items try{ - ItemComplexSignalRender.checkCache(id, base, "/base/", false); + ItemComplexSignalRender.checkCache(id, base, BASE_IDENTIFIER, false); ItemComplexSignalRender.checkCache(id, signalGroups.values()); }catch (Exception e){ throw new ContentPackException(String.format(GENERIC_ITEM_ERRMSG, id), e); @@ -191,7 +193,7 @@ public static void preloadModels(){ // Cache blocks try { - TileComplexSignalRender.checkCache(id, base, "/base/", true); + TileComplexSignalRender.checkCache(id, base, BASE_IDENTIFIER, true); TileComplexSignalRender.checkCache(id, signalGroups.values(), "/signals/"); }catch (Exception e){ throw new ContentPackException(String.format(GENERIC_BLOCK_ERRMSG, id), e); @@ -278,6 +280,144 @@ public static void preloadModels(){ LandOfSignals.info("Finished preloading models"); + if(LandOfSignalsConfig.Experimental.rescaleItems) + rescaleItemsToSlotSize(); + + } + + private static void rescaleItemsToSlotSize(){ + + LandOfSignals.info("Starting item rescaling"); + + Progress.Bar topProgressBar = Progress.push("LandOfSignals", 2); + topProgressBar.step("Rescaling items"); + + // Signalpart + Progress.Bar progressBar = Progress.push("Signalpart", LOSBlocks.BLOCK_SIGNAL_PART.getContentpackSignals().size()); + for (String id : LOSBlocks.BLOCK_SIGNAL_PART.getContentpackSignals().keySet()) { + ModCore.info("Rescaling signalpart %s", id); + progressBar.step(LOSBlocks.BLOCK_SIGNAL_PART.getContentpackSignals().get(id).getName()); + + final ContentPackSignal signal = LOSBlocks.BLOCK_SIGNAL_PART.getContentpackSignals().get(id); + final String[] states = LOSBlocks.BLOCK_SIGNAL_PART.getAllStates(id); + final String objPath = signal.getModel(); + + // Cache items + try { + OBJModel model = new OBJModel(new Identifier(LandOfSignals.MODID, objPath), 0, Arrays.asList(states)); + float[] scale = rescaleItem(model, signal.getItemScaling()); + float[] translation = retranslateItem(model, scale, signal.getItemScaling(), signal.getItemTranslation()); + signal.setItemScaling(scale); + signal.setItemTranslation(translation); + } catch (Exception e) { + String errmsg = "Couldn't rescale item with id \"%s\" (objPath: %s). Cause:"; + throw new ContentPackException(String.format(errmsg, id, objPath), e); + } + } + Progress.pop(progressBar); + + // Complexsignals + progressBar = Progress.push("Complexsignal", LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().size()); + for(String id : LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().keySet()){ + ModCore.info("Rescaling complexsignal %s", id); + progressBar.step(LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().get(id).getName()); + + final Map signalGroups = LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().get(id).getSignals(); + final Map base = LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().get(id).getBase(); + + // Cache items + try{ + ItemComplexSignalRender.checkCache(id, base, BASE_IDENTIFIER, false); + ItemComplexSignalRender.checkCache(id, signalGroups.values()); + }catch (Exception e){ + throw new ContentPackException(String.format(GENERIC_ITEM_ERRMSG, id), e); + } + } + Progress.pop(progressBar); + + // Blockdeco + progressBar = Progress.push("Deco", LOSBlocks.BLOCK_DECO.getContentpackDeco().size()); + for(String id : LOSBlocks.BLOCK_DECO.getContentpackDeco().keySet()){ + ModCore.info("Rescaling deco %s", id); + progressBar.step(LOSBlocks.BLOCK_DECO.getContentpackDeco().get(id).getName()); + + final Map models = LOSBlocks.BLOCK_DECO.getContentpackDeco().get(id).getBase(); + + // Cache items + try{ + ItemDecoRender.checkCache(id, models); + }catch (Exception e){ + throw new ContentPackException(String.format(GENERIC_ITEM_ERRMSG, id), e); + } + } + Progress.pop(progressBar); + + // Signparts + progressBar = Progress.push("Sign", LOSBlocks.BLOCK_SIGN_PART.getContentpackSigns().size()); + for(String id : LOSBlocks.BLOCK_SIGN_PART.getContentpackSigns().keySet()){ + ModCore.info("Rescaling sign %s", id); + progressBar.step(LOSBlocks.BLOCK_SIGN_PART.getContentpackSigns().get(id).getName()); + + final Map base = LOSBlocks.BLOCK_SIGN_PART.getContentpackSigns().get(id).getBase(); + + // Cache items + try{ + ItemSignPartRender.checkCache(id, base); + }catch (Exception e) { + throw new ContentPackException(String.format(GENERIC_ITEM_ERRMSG, id), e); + } + } + Progress.pop(progressBar); + + // Signalboxes + progressBar = Progress.push("Signalbox", LOSBlocks.BLOCK_SIGNAL_BOX.getContentpackSignalboxes().size()); + for(String id : LOSBlocks.BLOCK_SIGNAL_BOX.getContentpackSignalboxes().keySet()){ + ModCore.info("Rescaling signalbox %s", id); + progressBar.step(LOSBlocks.BLOCK_SIGNAL_BOX.getContentpackSignalboxes().get(id).getName()); + + final Map base = LOSBlocks.BLOCK_SIGNAL_BOX.getContentpackSignalboxes().get(id).getBase(); + + // Cache items + try{ + ItemSignalBoxRender.checkCache(id, base); + }catch (Exception e){ + throw new ContentPackException(String.format(GENERIC_ITEM_ERRMSG, id), e); + } + } + Progress.pop(progressBar); + topProgressBar.step("Finishing"); + Progress.pop(topProgressBar); + + LandOfSignals.info("Finished rescaling items"); + + } + + private static float[] rescaleItem(OBJModel model, float[] itemScaling) { + double height = model.heightOfGroups(model.groups()); + + if(height <= 1 || !(itemScaling[0] == itemScaling[1] && itemScaling[1] == itemScaling[2])){ + return itemScaling; + } + + float rescale = (float) Static.round(1 / height, 4); + + return new float[]{rescale, rescale, rescale}; + } + + private static float[] retranslateItem(OBJModel model, float[] newScale, float[] oldScale, float[] itemTranslation) { + Vec3d center = model.centerOfGroups(model.groups()); + double height = model.heightOfGroups(model.groups()); + float[] newTranslation = Arrays.copyOf(itemTranslation, itemTranslation.length); + + if(Objects.deepEquals(newScale, oldScale)){ + return itemTranslation; + } + + newTranslation[0] = 0.5f; + newTranslation[1] = (float) Static.round(((height / 2) - center.y) * newScale[1], 4); + newTranslation[2] = 0.5f; + + return newTranslation; } // For method references From 4c71a0c2087902cd9054ff4ec7634a5ae5550be2 Mon Sep 17 00:00:00 2001 From: Danielxs01 Date: Thu, 15 Jun 2023 23:11:56 +0200 Subject: [PATCH 43/52] [#108] Removed height limit and added rescale upper bound --- .../landofsignals/contentpacks/ContentPackHandler.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java b/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java index 988bc814..b9afd7fb 100644 --- a/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java +++ b/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java @@ -395,12 +395,16 @@ private static void rescaleItemsToSlotSize(){ private static float[] rescaleItem(OBJModel model, float[] itemScaling) { double height = model.heightOfGroups(model.groups()); - if(height <= 1 || !(itemScaling[0] == itemScaling[1] && itemScaling[1] == itemScaling[2])){ + if(itemScaling[0] != itemScaling[1] || itemScaling[1] != itemScaling[2]){ return itemScaling; } float rescale = (float) Static.round(1 / height, 4); + if(rescale > 4){ + return new float[]{0.5f, 0.5f, 0.5f}; + } + return new float[]{rescale, rescale, rescale}; } From 313d0185e3a437e899a14d9a367a223c15b01dbb Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Sun, 18 Jun 2023 14:02:59 +0200 Subject: [PATCH 44/52] Moved toggleHighlighting to method --- .../items/ItemMagnifyingGlass.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/main/java/net/landofrails/landofsignals/items/ItemMagnifyingGlass.java b/src/main/java/net/landofrails/landofsignals/items/ItemMagnifyingGlass.java index a86413bf..9dda9783 100644 --- a/src/main/java/net/landofrails/landofsignals/items/ItemMagnifyingGlass.java +++ b/src/main/java/net/landofrails/landofsignals/items/ItemMagnifyingGlass.java @@ -33,15 +33,14 @@ public ClickResult onClickBlock(final Player player, final World world, final Ve if (!world.isClient) { return ClickResult.REJECTED; } - if(hand.equals(Player.Hand.SECONDARY)){ + if (hand.equals(Player.Hand.SECONDARY)) { return ClickResult.PASS; } - if(!world.isBlock(pos, LOSBlocks.BLOCK_SIGNAL_BOX)){ + if (!world.isBlock(pos, LOSBlocks.BLOCK_SIGNAL_BOX)) { return ClickResult.PASS; } - List signalBoxes = world.getBlockEntities(TileSignalBox.class); - signalBoxes.stream().filter(TileSignalBox::isHighlighting).forEach(TileSignalBox::toggleHighlighting); + toggleHighlighting(world); TileSignalBox signalBox = world.getBlockEntity(pos, TileSignalBox.class); signalBox.toggleHighlighting(); @@ -50,13 +49,13 @@ public ClickResult onClickBlock(final Player player, final World world, final Ve } @Override - public void onClickAir(Player player, World world, Player.Hand hand) { - - if(!world.isClient || hand.equals(Player.Hand.SECONDARY)){ - return; - } + public void onClickAir(final Player player, final World world, final Player.Hand hand) { + if (!world.isClient || hand.equals(Player.Hand.SECONDARY)) return; + toggleHighlighting(world); + } - List signalBoxes = world.getBlockEntities(TileSignalBox.class); + private void toggleHighlighting(final World world) { + final List signalBoxes = world.getBlockEntities(TileSignalBox.class); signalBoxes.stream().filter(TileSignalBox::isHighlighting).forEach(TileSignalBox::toggleHighlighting); } } From d53aa8e49cae2f2f437a9ee241d9844a71292f8e Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Sun, 18 Jun 2023 14:14:28 +0200 Subject: [PATCH 45/52] Properly formatted changes to trigger build pipeline (and improve code readability) --- .../contentpacks/ContentPackHandler.java | 68 +++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java b/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java index b9afd7fb..95060f68 100644 --- a/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java +++ b/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java @@ -139,7 +139,7 @@ private static void load(ZipFile zip, ZipEntry landofsignalsJson, boolean isUTF8 } } - public static void preloadModels(){ + public static void preloadModels() { LandOfSignals.info("Starting preloading models"); @@ -176,7 +176,7 @@ public static void preloadModels(){ // Complexsignals progressBar = Progress.push("Complexsignal", LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().size()); - for(String id : LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().keySet()){ + for (String id : LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().keySet()) { ModCore.info("Preloading complexsignal %s", id); progressBar.step(LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().get(id).getName()); @@ -184,10 +184,10 @@ public static void preloadModels(){ final Map base = LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().get(id).getBase(); // Cache items - try{ + try { ItemComplexSignalRender.checkCache(id, base, BASE_IDENTIFIER, false); ItemComplexSignalRender.checkCache(id, signalGroups.values()); - }catch (Exception e){ + } catch (Exception e) { throw new ContentPackException(String.format(GENERIC_ITEM_ERRMSG, id), e); } @@ -195,7 +195,7 @@ public static void preloadModels(){ try { TileComplexSignalRender.checkCache(id, base, BASE_IDENTIFIER, true); TileComplexSignalRender.checkCache(id, signalGroups.values(), "/signals/"); - }catch (Exception e){ + } catch (Exception e) { throw new ContentPackException(String.format(GENERIC_BLOCK_ERRMSG, id), e); } @@ -204,23 +204,23 @@ public static void preloadModels(){ // Blockdeco progressBar = Progress.push("Deco", LOSBlocks.BLOCK_DECO.getContentpackDeco().size()); - for(String id : LOSBlocks.BLOCK_DECO.getContentpackDeco().keySet()){ + for (String id : LOSBlocks.BLOCK_DECO.getContentpackDeco().keySet()) { ModCore.info("Preloading deco %s", id); progressBar.step(LOSBlocks.BLOCK_DECO.getContentpackDeco().get(id).getName()); final Map models = LOSBlocks.BLOCK_DECO.getContentpackDeco().get(id).getBase(); // Cache items - try{ + try { ItemDecoRender.checkCache(id, models); - }catch (Exception e){ + } catch (Exception e) { throw new ContentPackException(String.format(GENERIC_ITEM_ERRMSG, id), e); } // Cache blocks try { TileDecoRender.checkCache(id, models); - }catch (Exception e){ + } catch (Exception e) { throw new ContentPackException(String.format(GENERIC_BLOCK_ERRMSG, id), e); } } @@ -228,23 +228,23 @@ public static void preloadModels(){ // Signparts progressBar = Progress.push("Sign", LOSBlocks.BLOCK_SIGN_PART.getContentpackSigns().size()); - for(String id : LOSBlocks.BLOCK_SIGN_PART.getContentpackSigns().keySet()){ + for (String id : LOSBlocks.BLOCK_SIGN_PART.getContentpackSigns().keySet()) { ModCore.info("Preloading sign %s", id); progressBar.step(LOSBlocks.BLOCK_SIGN_PART.getContentpackSigns().get(id).getName()); final Map base = LOSBlocks.BLOCK_SIGN_PART.getContentpackSigns().get(id).getBase(); // Cache items - try{ + try { ItemSignPartRender.checkCache(id, base); - }catch (Exception e){ + } catch (Exception e) { throw new ContentPackException(String.format(GENERIC_ITEM_ERRMSG, id), e); } // Cache blocks try { TileSignPartRender.checkCache(id, base); - }catch (Exception e){ + } catch (Exception e) { throw new ContentPackException(String.format(GENERIC_BLOCK_ERRMSG, id), e); } @@ -253,23 +253,23 @@ public static void preloadModels(){ // Signalboxes progressBar = Progress.push("Signalbox", LOSBlocks.BLOCK_SIGNAL_BOX.getContentpackSignalboxes().size()); - for(String id : LOSBlocks.BLOCK_SIGNAL_BOX.getContentpackSignalboxes().keySet()){ + for (String id : LOSBlocks.BLOCK_SIGNAL_BOX.getContentpackSignalboxes().keySet()) { ModCore.info("Preloading signalbox %s", id); progressBar.step(LOSBlocks.BLOCK_SIGNAL_BOX.getContentpackSignalboxes().get(id).getName()); final Map base = LOSBlocks.BLOCK_SIGNAL_BOX.getContentpackSignalboxes().get(id).getBase(); // Cache items - try{ + try { ItemSignalBoxRender.checkCache(id, base); - }catch (Exception e){ + } catch (Exception e) { throw new ContentPackException(String.format(GENERIC_ITEM_ERRMSG, id), e); } // Cache blocks try { TileSignalBoxRender.checkCache(id, base); - }catch (Exception e){ + } catch (Exception e) { throw new ContentPackException(String.format(GENERIC_BLOCK_ERRMSG, id), e); } @@ -280,12 +280,12 @@ public static void preloadModels(){ LandOfSignals.info("Finished preloading models"); - if(LandOfSignalsConfig.Experimental.rescaleItems) + if (LandOfSignalsConfig.Experimental.rescaleItems) rescaleItemsToSlotSize(); } - private static void rescaleItemsToSlotSize(){ + private static void rescaleItemsToSlotSize() { LandOfSignals.info("Starting item rescaling"); @@ -318,7 +318,7 @@ private static void rescaleItemsToSlotSize(){ // Complexsignals progressBar = Progress.push("Complexsignal", LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().size()); - for(String id : LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().keySet()){ + for (String id : LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().keySet()) { ModCore.info("Rescaling complexsignal %s", id); progressBar.step(LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().get(id).getName()); @@ -326,10 +326,10 @@ private static void rescaleItemsToSlotSize(){ final Map base = LOSBlocks.BLOCK_COMPLEX_SIGNAL.getContentpackComplexSignals().get(id).getBase(); // Cache items - try{ + try { ItemComplexSignalRender.checkCache(id, base, BASE_IDENTIFIER, false); ItemComplexSignalRender.checkCache(id, signalGroups.values()); - }catch (Exception e){ + } catch (Exception e) { throw new ContentPackException(String.format(GENERIC_ITEM_ERRMSG, id), e); } } @@ -337,16 +337,16 @@ private static void rescaleItemsToSlotSize(){ // Blockdeco progressBar = Progress.push("Deco", LOSBlocks.BLOCK_DECO.getContentpackDeco().size()); - for(String id : LOSBlocks.BLOCK_DECO.getContentpackDeco().keySet()){ + for (String id : LOSBlocks.BLOCK_DECO.getContentpackDeco().keySet()) { ModCore.info("Rescaling deco %s", id); progressBar.step(LOSBlocks.BLOCK_DECO.getContentpackDeco().get(id).getName()); final Map models = LOSBlocks.BLOCK_DECO.getContentpackDeco().get(id).getBase(); // Cache items - try{ + try { ItemDecoRender.checkCache(id, models); - }catch (Exception e){ + } catch (Exception e) { throw new ContentPackException(String.format(GENERIC_ITEM_ERRMSG, id), e); } } @@ -354,16 +354,16 @@ private static void rescaleItemsToSlotSize(){ // Signparts progressBar = Progress.push("Sign", LOSBlocks.BLOCK_SIGN_PART.getContentpackSigns().size()); - for(String id : LOSBlocks.BLOCK_SIGN_PART.getContentpackSigns().keySet()){ + for (String id : LOSBlocks.BLOCK_SIGN_PART.getContentpackSigns().keySet()) { ModCore.info("Rescaling sign %s", id); progressBar.step(LOSBlocks.BLOCK_SIGN_PART.getContentpackSigns().get(id).getName()); final Map base = LOSBlocks.BLOCK_SIGN_PART.getContentpackSigns().get(id).getBase(); // Cache items - try{ + try { ItemSignPartRender.checkCache(id, base); - }catch (Exception e) { + } catch (Exception e) { throw new ContentPackException(String.format(GENERIC_ITEM_ERRMSG, id), e); } } @@ -371,16 +371,16 @@ private static void rescaleItemsToSlotSize(){ // Signalboxes progressBar = Progress.push("Signalbox", LOSBlocks.BLOCK_SIGNAL_BOX.getContentpackSignalboxes().size()); - for(String id : LOSBlocks.BLOCK_SIGNAL_BOX.getContentpackSignalboxes().keySet()){ + for (String id : LOSBlocks.BLOCK_SIGNAL_BOX.getContentpackSignalboxes().keySet()) { ModCore.info("Rescaling signalbox %s", id); progressBar.step(LOSBlocks.BLOCK_SIGNAL_BOX.getContentpackSignalboxes().get(id).getName()); final Map base = LOSBlocks.BLOCK_SIGNAL_BOX.getContentpackSignalboxes().get(id).getBase(); // Cache items - try{ + try { ItemSignalBoxRender.checkCache(id, base); - }catch (Exception e){ + } catch (Exception e) { throw new ContentPackException(String.format(GENERIC_ITEM_ERRMSG, id), e); } } @@ -395,13 +395,13 @@ private static void rescaleItemsToSlotSize(){ private static float[] rescaleItem(OBJModel model, float[] itemScaling) { double height = model.heightOfGroups(model.groups()); - if(itemScaling[0] != itemScaling[1] || itemScaling[1] != itemScaling[2]){ + if (itemScaling[0] != itemScaling[1] || itemScaling[1] != itemScaling[2]) { return itemScaling; } float rescale = (float) Static.round(1 / height, 4); - if(rescale > 4){ + if (rescale > 4) { return new float[]{0.5f, 0.5f, 0.5f}; } @@ -413,7 +413,7 @@ private static float[] retranslateItem(OBJModel model, float[] newScale, float[] double height = model.heightOfGroups(model.groups()); float[] newTranslation = Arrays.copyOf(itemTranslation, itemTranslation.length); - if(Objects.deepEquals(newScale, oldScale)){ + if (Objects.deepEquals(newScale, oldScale)) { return itemTranslation; } From 1c3278340534685cfe9457e07ebd356f21672a2f Mon Sep 17 00:00:00 2001 From: MarkenJaden Date: Sun, 18 Jun 2023 14:23:41 +0200 Subject: [PATCH 46/52] Added .editorconfig --- .editorconfig | 1457 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1457 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..b9880e79 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,1457 @@ +[*] +charset = utf-8 +end_of_line = crlf +indent_size = 4 +indent_style = space +insert_final_newline = false +max_line_length = 120 +tab_width = 4 +ij_continuation_indent_size = 8 +ij_formatter_off_tag = @formatter:off +ij_formatter_on_tag = @formatter:on +ij_formatter_tags_enabled = true +ij_smart_tabs = false +ij_visual_guides = none +ij_wrap_on_typing = false + +[*.css] +ij_css_align_closing_brace_with_properties = false +ij_css_blank_lines_around_nested_selector = 1 +ij_css_blank_lines_between_blocks = 1 +ij_css_block_comment_add_space = false +ij_css_brace_placement = end_of_line +ij_css_enforce_quotes_on_format = false +ij_css_hex_color_long_format = false +ij_css_hex_color_lower_case = false +ij_css_hex_color_short_format = false +ij_css_hex_color_upper_case = false +ij_css_keep_blank_lines_in_code = 2 +ij_css_keep_indents_on_empty_lines = false +ij_css_keep_single_line_blocks = false +ij_css_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_css_space_after_colon = true +ij_css_space_before_opening_brace = true +ij_css_use_double_quotes = true +ij_css_value_alignment = do_not_align + +[*.feature] +indent_size = 2 +ij_gherkin_keep_indents_on_empty_lines = false + +[*.java] +ij_java_align_consecutive_assignments = false +ij_java_align_consecutive_variable_declarations = false +ij_java_align_group_field_declarations = false +ij_java_align_multiline_annotation_parameters = false +ij_java_align_multiline_array_initializer_expression = false +ij_java_align_multiline_assignment = false +ij_java_align_multiline_binary_operation = false +ij_java_align_multiline_chained_methods = false +ij_java_align_multiline_deconstruction_list_components = true +ij_java_align_multiline_extends_list = false +ij_java_align_multiline_for = true +ij_java_align_multiline_method_parentheses = false +ij_java_align_multiline_parameters = true +ij_java_align_multiline_parameters_in_calls = false +ij_java_align_multiline_parenthesized_expression = false +ij_java_align_multiline_records = true +ij_java_align_multiline_resources = true +ij_java_align_multiline_ternary_operation = false +ij_java_align_multiline_text_blocks = false +ij_java_align_multiline_throws_list = false +ij_java_align_subsequent_simple_methods = false +ij_java_align_throws_keyword = false +ij_java_align_types_in_multi_catch = true +ij_java_annotation_parameter_wrap = off +ij_java_array_initializer_new_line_after_left_brace = false +ij_java_array_initializer_right_brace_on_new_line = false +ij_java_array_initializer_wrap = off +ij_java_assert_statement_colon_on_next_line = false +ij_java_assert_statement_wrap = off +ij_java_assignment_wrap = off +ij_java_binary_operation_sign_on_next_line = false +ij_java_binary_operation_wrap = off +ij_java_blank_lines_after_anonymous_class_header = 0 +ij_java_blank_lines_after_class_header = 0 +ij_java_blank_lines_after_imports = 1 +ij_java_blank_lines_after_package = 1 +ij_java_blank_lines_around_class = 1 +ij_java_blank_lines_around_field = 0 +ij_java_blank_lines_around_field_in_interface = 0 +ij_java_blank_lines_around_initializer = 1 +ij_java_blank_lines_around_method = 1 +ij_java_blank_lines_around_method_in_interface = 1 +ij_java_blank_lines_before_class_end = 0 +ij_java_blank_lines_before_imports = 1 +ij_java_blank_lines_before_method_body = 0 +ij_java_blank_lines_before_package = 0 +ij_java_block_brace_style = end_of_line +ij_java_block_comment_add_space = false +ij_java_block_comment_at_first_column = true +ij_java_builder_methods = none +ij_java_call_parameters_new_line_after_left_paren = false +ij_java_call_parameters_right_paren_on_new_line = false +ij_java_call_parameters_wrap = off +ij_java_case_statement_on_separate_line = true +ij_java_catch_on_new_line = false +ij_java_class_annotation_wrap = split_into_lines +ij_java_class_brace_style = end_of_line +ij_java_class_count_to_use_import_on_demand = 5 +ij_java_class_names_in_javadoc = 1 +ij_java_deconstruction_list_wrap = normal +ij_java_do_not_indent_top_level_class_members = false +ij_java_do_not_wrap_after_single_annotation = false +ij_java_do_not_wrap_after_single_annotation_in_parameter = false +ij_java_do_while_brace_force = never +ij_java_doc_add_blank_line_after_description = true +ij_java_doc_add_blank_line_after_param_comments = false +ij_java_doc_add_blank_line_after_return = false +ij_java_doc_add_p_tag_on_empty_lines = true +ij_java_doc_align_exception_comments = true +ij_java_doc_align_param_comments = true +ij_java_doc_do_not_wrap_if_one_line = false +ij_java_doc_enable_formatting = true +ij_java_doc_enable_leading_asterisks = true +ij_java_doc_indent_on_continuation = false +ij_java_doc_keep_empty_lines = true +ij_java_doc_keep_empty_parameter_tag = true +ij_java_doc_keep_empty_return_tag = true +ij_java_doc_keep_empty_throws_tag = true +ij_java_doc_keep_invalid_tags = true +ij_java_doc_param_description_on_new_line = false +ij_java_doc_preserve_line_breaks = false +ij_java_doc_use_throws_not_exception_tag = true +ij_java_else_on_new_line = false +ij_java_entity_dd_suffix = EJB +ij_java_entity_eb_suffix = Bean +ij_java_entity_hi_suffix = Home +ij_java_entity_lhi_prefix = Local +ij_java_entity_lhi_suffix = Home +ij_java_entity_li_prefix = Local +ij_java_entity_pk_class = java.lang.String +ij_java_entity_vo_suffix = VO +ij_java_enum_constants_wrap = off +ij_java_extends_keyword_wrap = off +ij_java_extends_list_wrap = off +ij_java_field_annotation_wrap = split_into_lines +ij_java_finally_on_new_line = false +ij_java_for_brace_force = never +ij_java_for_statement_new_line_after_left_paren = false +ij_java_for_statement_right_paren_on_new_line = false +ij_java_for_statement_wrap = off +ij_java_generate_final_locals = false +ij_java_generate_final_parameters = false +ij_java_if_brace_force = never +ij_java_imports_layout = *,|,javax.**,java.**,|,$* +ij_java_indent_case_from_switch = true +ij_java_insert_inner_class_imports = false +ij_java_insert_override_annotation = true +ij_java_keep_blank_lines_before_right_brace = 2 +ij_java_keep_blank_lines_between_package_declaration_and_header = 2 +ij_java_keep_blank_lines_in_code = 2 +ij_java_keep_blank_lines_in_declarations = 2 +ij_java_keep_builder_methods_indents = false +ij_java_keep_control_statement_in_one_line = true +ij_java_keep_first_column_comment = true +ij_java_keep_indents_on_empty_lines = false +ij_java_keep_line_breaks = true +ij_java_keep_multiple_expressions_in_one_line = false +ij_java_keep_simple_blocks_in_one_line = false +ij_java_keep_simple_classes_in_one_line = false +ij_java_keep_simple_lambdas_in_one_line = false +ij_java_keep_simple_methods_in_one_line = false +ij_java_label_indent_absolute = false +ij_java_label_indent_size = 0 +ij_java_lambda_brace_style = end_of_line +ij_java_layout_static_imports_separately = true +ij_java_line_comment_add_space = false +ij_java_line_comment_add_space_on_reformat = false +ij_java_line_comment_at_first_column = true +ij_java_message_dd_suffix = EJB +ij_java_message_eb_suffix = Bean +ij_java_method_annotation_wrap = split_into_lines +ij_java_method_brace_style = end_of_line +ij_java_method_call_chain_wrap = off +ij_java_method_parameters_new_line_after_left_paren = false +ij_java_method_parameters_right_paren_on_new_line = false +ij_java_method_parameters_wrap = off +ij_java_modifier_list_wrap = false +ij_java_multi_catch_types_wrap = normal +ij_java_names_count_to_use_import_on_demand = 3 +ij_java_new_line_after_lparen_in_annotation = false +ij_java_new_line_after_lparen_in_deconstruction_pattern = true +ij_java_new_line_after_lparen_in_record_header = false +ij_java_packages_to_use_import_on_demand = java.awt.*,javax.swing.* +ij_java_parameter_annotation_wrap = off +ij_java_parentheses_expression_new_line_after_left_paren = false +ij_java_parentheses_expression_right_paren_on_new_line = false +ij_java_place_assignment_sign_on_next_line = false +ij_java_prefer_longer_names = true +ij_java_prefer_parameters_wrap = false +ij_java_record_components_wrap = normal +ij_java_repeat_synchronized = true +ij_java_replace_instanceof_and_cast = false +ij_java_replace_null_check = true +ij_java_replace_sum_lambda_with_method_ref = true +ij_java_resource_list_new_line_after_left_paren = false +ij_java_resource_list_right_paren_on_new_line = false +ij_java_resource_list_wrap = off +ij_java_rparen_on_new_line_in_annotation = false +ij_java_rparen_on_new_line_in_deconstruction_pattern = true +ij_java_rparen_on_new_line_in_record_header = false +ij_java_session_dd_suffix = EJB +ij_java_session_eb_suffix = Bean +ij_java_session_hi_suffix = Home +ij_java_session_lhi_prefix = Local +ij_java_session_lhi_suffix = Home +ij_java_session_li_prefix = Local +ij_java_session_si_suffix = Service +ij_java_space_after_closing_angle_bracket_in_type_argument = false +ij_java_space_after_colon = true +ij_java_space_after_comma = true +ij_java_space_after_comma_in_type_arguments = true +ij_java_space_after_for_semicolon = true +ij_java_space_after_quest = true +ij_java_space_after_type_cast = true +ij_java_space_before_annotation_array_initializer_left_brace = false +ij_java_space_before_annotation_parameter_list = false +ij_java_space_before_array_initializer_left_brace = false +ij_java_space_before_catch_keyword = true +ij_java_space_before_catch_left_brace = true +ij_java_space_before_catch_parentheses = true +ij_java_space_before_class_left_brace = true +ij_java_space_before_colon = true +ij_java_space_before_colon_in_foreach = true +ij_java_space_before_comma = false +ij_java_space_before_deconstruction_list = false +ij_java_space_before_do_left_brace = true +ij_java_space_before_else_keyword = true +ij_java_space_before_else_left_brace = true +ij_java_space_before_finally_keyword = true +ij_java_space_before_finally_left_brace = true +ij_java_space_before_for_left_brace = true +ij_java_space_before_for_parentheses = true +ij_java_space_before_for_semicolon = false +ij_java_space_before_if_left_brace = true +ij_java_space_before_if_parentheses = true +ij_java_space_before_method_call_parentheses = false +ij_java_space_before_method_left_brace = true +ij_java_space_before_method_parentheses = false +ij_java_space_before_opening_angle_bracket_in_type_parameter = false +ij_java_space_before_quest = true +ij_java_space_before_switch_left_brace = true +ij_java_space_before_switch_parentheses = true +ij_java_space_before_synchronized_left_brace = true +ij_java_space_before_synchronized_parentheses = true +ij_java_space_before_try_left_brace = true +ij_java_space_before_try_parentheses = true +ij_java_space_before_type_parameter_list = false +ij_java_space_before_while_keyword = true +ij_java_space_before_while_left_brace = true +ij_java_space_before_while_parentheses = true +ij_java_space_inside_one_line_enum_braces = false +ij_java_space_within_empty_array_initializer_braces = false +ij_java_space_within_empty_method_call_parentheses = false +ij_java_space_within_empty_method_parentheses = false +ij_java_spaces_around_additive_operators = true +ij_java_spaces_around_annotation_eq = true +ij_java_spaces_around_assignment_operators = true +ij_java_spaces_around_bitwise_operators = true +ij_java_spaces_around_equality_operators = true +ij_java_spaces_around_lambda_arrow = true +ij_java_spaces_around_logical_operators = true +ij_java_spaces_around_method_ref_dbl_colon = false +ij_java_spaces_around_multiplicative_operators = true +ij_java_spaces_around_relational_operators = true +ij_java_spaces_around_shift_operators = true +ij_java_spaces_around_type_bounds_in_type_parameters = true +ij_java_spaces_around_unary_operator = false +ij_java_spaces_within_angle_brackets = false +ij_java_spaces_within_annotation_parentheses = false +ij_java_spaces_within_array_initializer_braces = false +ij_java_spaces_within_braces = false +ij_java_spaces_within_brackets = false +ij_java_spaces_within_cast_parentheses = false +ij_java_spaces_within_catch_parentheses = false +ij_java_spaces_within_deconstruction_list = false +ij_java_spaces_within_for_parentheses = false +ij_java_spaces_within_if_parentheses = false +ij_java_spaces_within_method_call_parentheses = false +ij_java_spaces_within_method_parentheses = false +ij_java_spaces_within_parentheses = false +ij_java_spaces_within_record_header = false +ij_java_spaces_within_switch_parentheses = false +ij_java_spaces_within_synchronized_parentheses = false +ij_java_spaces_within_try_parentheses = false +ij_java_spaces_within_while_parentheses = false +ij_java_special_else_if_treatment = true +ij_java_subclass_name_suffix = Impl +ij_java_ternary_operation_signs_on_next_line = false +ij_java_ternary_operation_wrap = off +ij_java_test_name_suffix = Test +ij_java_throws_keyword_wrap = off +ij_java_throws_list_wrap = off +ij_java_use_external_annotations = false +ij_java_use_fq_class_names = false +ij_java_use_relative_indents = false +ij_java_use_single_class_imports = true +ij_java_variable_annotation_wrap = off +ij_java_visibility = public +ij_java_while_brace_force = never +ij_java_while_on_new_line = false +ij_java_wrap_comments = false +ij_java_wrap_first_method_in_call_chain = false +ij_java_wrap_long_lines = false + +[*.less] +indent_size = 2 +ij_less_align_closing_brace_with_properties = false +ij_less_blank_lines_around_nested_selector = 1 +ij_less_blank_lines_between_blocks = 1 +ij_less_block_comment_add_space = false +ij_less_brace_placement = 0 +ij_less_enforce_quotes_on_format = false +ij_less_hex_color_long_format = false +ij_less_hex_color_lower_case = false +ij_less_hex_color_short_format = false +ij_less_hex_color_upper_case = false +ij_less_keep_blank_lines_in_code = 2 +ij_less_keep_indents_on_empty_lines = false +ij_less_keep_single_line_blocks = false +ij_less_line_comment_add_space = false +ij_less_line_comment_at_first_column = false +ij_less_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_less_space_after_colon = true +ij_less_space_before_opening_brace = true +ij_less_use_double_quotes = true +ij_less_value_alignment = 0 + +[*.proto] +indent_size = 2 +tab_width = 2 +ij_continuation_indent_size = 4 +ij_protobuf_keep_blank_lines_in_code = 2 +ij_protobuf_keep_indents_on_empty_lines = false +ij_protobuf_keep_line_breaks = true +ij_protobuf_space_after_comma = true +ij_protobuf_space_before_comma = false +ij_protobuf_spaces_around_assignment_operators = true +ij_protobuf_spaces_within_braces = false +ij_protobuf_spaces_within_brackets = false + +[*.sass] +indent_size = 2 +ij_sass_align_closing_brace_with_properties = false +ij_sass_blank_lines_around_nested_selector = 1 +ij_sass_blank_lines_between_blocks = 1 +ij_sass_brace_placement = 0 +ij_sass_enforce_quotes_on_format = false +ij_sass_hex_color_long_format = false +ij_sass_hex_color_lower_case = false +ij_sass_hex_color_short_format = false +ij_sass_hex_color_upper_case = false +ij_sass_keep_blank_lines_in_code = 2 +ij_sass_keep_indents_on_empty_lines = false +ij_sass_keep_single_line_blocks = false +ij_sass_line_comment_add_space = false +ij_sass_line_comment_at_first_column = false +ij_sass_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_sass_space_after_colon = true +ij_sass_space_before_opening_brace = true +ij_sass_use_double_quotes = true +ij_sass_value_alignment = 0 + +[*.scala] +indent_size = 2 +tab_width = 2 +ij_continuation_indent_size = 2 +ij_scala_align_composite_pattern = true +ij_scala_align_extends_with = 0 +ij_scala_align_group_field_declarations = false +ij_scala_align_if_else = false +ij_scala_align_in_columns_case_branch = false +ij_scala_align_multiline_binary_operation = false +ij_scala_align_multiline_chained_methods = false +ij_scala_align_multiline_for = true +ij_scala_align_multiline_parameters = true +ij_scala_align_multiline_parameters_in_calls = false +ij_scala_align_multiline_parenthesized_expression = false +ij_scala_align_parameter_types_in_multiline_declarations = 0 +ij_scala_align_tuple_elements = false +ij_scala_alternate_continuation_indent_for_params = 4 +ij_scala_binary_operation_wrap = off +ij_scala_blank_lines_after_anonymous_class_header = 0 +ij_scala_blank_lines_after_class_header = 0 +ij_scala_blank_lines_after_imports = 1 +ij_scala_blank_lines_after_package = 1 +ij_scala_blank_lines_around_class = 1 +ij_scala_blank_lines_around_class_in_inner_scopes = 0 +ij_scala_blank_lines_around_field = 0 +ij_scala_blank_lines_around_field_in_inner_scopes = 0 +ij_scala_blank_lines_around_field_in_interface = 0 +ij_scala_blank_lines_around_method = 1 +ij_scala_blank_lines_around_method_in_inner_scopes = 1 +ij_scala_blank_lines_around_method_in_interface = 1 +ij_scala_blank_lines_before_class_end = 0 +ij_scala_blank_lines_before_imports = 1 +ij_scala_blank_lines_before_method_body = 0 +ij_scala_blank_lines_before_package = 0 +ij_scala_block_brace_style = end_of_line +ij_scala_block_comment_add_space = false +ij_scala_block_comment_at_first_column = true +ij_scala_call_parameters_new_line_after_lparen = 0 +ij_scala_call_parameters_right_paren_on_new_line = false +ij_scala_call_parameters_wrap = off +ij_scala_case_clause_brace_force = never +ij_scala_catch_on_new_line = false +ij_scala_class_annotation_wrap = split_into_lines +ij_scala_class_brace_style = end_of_line +ij_scala_closure_brace_force = never +ij_scala_do_not_align_block_expr_params = true +ij_scala_do_not_indent_case_clause_body = false +ij_scala_do_not_indent_tuples_close_brace = true +ij_scala_do_while_brace_force = never +ij_scala_else_on_new_line = false +ij_scala_enable_scaladoc_formatting = true +ij_scala_enforce_functional_syntax_for_unit = true +ij_scala_extends_keyword_wrap = off +ij_scala_extends_list_wrap = off +ij_scala_field_annotation_wrap = split_into_lines +ij_scala_finally_brace_force = never +ij_scala_finally_on_new_line = false +ij_scala_for_brace_force = never +ij_scala_for_statement_wrap = off +ij_scala_formatter = 0 +ij_scala_if_brace_force = never +ij_scala_implicit_value_class_suffix = Ops +ij_scala_indent_braced_function_args = true +ij_scala_indent_case_from_switch = true +ij_scala_indent_first_parameter = true +ij_scala_indent_first_parameter_clause = false +ij_scala_indent_type_arguments = true +ij_scala_indent_type_parameters = true +ij_scala_indent_yield_after_one_line_enumerators = true +ij_scala_keep_blank_lines_before_right_brace = 2 +ij_scala_keep_blank_lines_in_code = 2 +ij_scala_keep_blank_lines_in_declarations = 2 +ij_scala_keep_comments_on_same_line = true +ij_scala_keep_first_column_comment = false +ij_scala_keep_indents_on_empty_lines = false +ij_scala_keep_line_breaks = true +ij_scala_keep_one_line_lambdas_in_arg_list = false +ij_scala_keep_simple_blocks_in_one_line = false +ij_scala_keep_simple_methods_in_one_line = false +ij_scala_keep_xml_formatting = false +ij_scala_line_comment_add_space = false +ij_scala_line_comment_at_first_column = true +ij_scala_method_annotation_wrap = split_into_lines +ij_scala_method_brace_force = never +ij_scala_method_brace_style = end_of_line +ij_scala_method_call_chain_wrap = off +ij_scala_method_parameters_new_line_after_left_paren = false +ij_scala_method_parameters_right_paren_on_new_line = false +ij_scala_method_parameters_wrap = off +ij_scala_modifier_list_wrap = false +ij_scala_multiline_string_align_dangling_closing_quotes = false +ij_scala_multiline_string_closing_quotes_on_new_line = true +ij_scala_multiline_string_insert_margin_on_enter = true +ij_scala_multiline_string_margin_char = | +ij_scala_multiline_string_margin_indent = 2 +ij_scala_multiline_string_opening_quotes_on_new_line = true +ij_scala_multiline_string_process_margin_on_copy_paste = true +ij_scala_new_line_after_case_clause_arrow_when_multiline_body = false +ij_scala_newline_after_annotations = false +ij_scala_not_continuation_indent_for_params = false +ij_scala_parameter_annotation_wrap = off +ij_scala_parentheses_expression_new_line_after_left_paren = false +ij_scala_parentheses_expression_right_paren_on_new_line = false +ij_scala_place_closure_parameters_on_new_line = false +ij_scala_place_self_type_on_new_line = true +ij_scala_prefer_parameters_wrap = false +ij_scala_preserve_space_after_method_declaration_name = false +ij_scala_reformat_on_compile = false +ij_scala_replace_case_arrow_with_unicode_char = false +ij_scala_replace_for_generator_arrow_with_unicode_char = false +ij_scala_replace_lambda_with_greek_letter = false +ij_scala_replace_map_arrow_with_unicode_char = false +ij_scala_scalafmt_fallback_to_default_settings = false +ij_scala_scalafmt_reformat_on_files_save = false +ij_scala_scalafmt_show_invalid_code_warnings = true +ij_scala_scalafmt_use_intellij_formatter_for_range_format = true +ij_scala_sd_align_exception_comments = true +ij_scala_sd_align_list_item_content = true +ij_scala_sd_align_other_tags_comments = true +ij_scala_sd_align_parameters_comments = true +ij_scala_sd_align_return_comments = true +ij_scala_sd_blank_line_after_parameters_comments = false +ij_scala_sd_blank_line_after_return_comments = false +ij_scala_sd_blank_line_before_parameters = false +ij_scala_sd_blank_line_before_tags = true +ij_scala_sd_blank_line_between_parameters = false +ij_scala_sd_keep_blank_lines_between_tags = false +ij_scala_sd_preserve_spaces_in_tags = false +ij_scala_space_after_comma = true +ij_scala_space_after_for_semicolon = true +ij_scala_space_after_modifiers_constructor = false +ij_scala_space_after_type_colon = true +ij_scala_space_before_brace_method_call = true +ij_scala_space_before_class_left_brace = true +ij_scala_space_before_for_parentheses = true +ij_scala_space_before_if_parentheses = true +ij_scala_space_before_infix_like_method_parentheses = false +ij_scala_space_before_infix_method_call_parentheses = false +ij_scala_space_before_infix_operator_like_method_call_parentheses = true +ij_scala_space_before_method_call_parentheses = false +ij_scala_space_before_method_left_brace = true +ij_scala_space_before_method_parentheses = false +ij_scala_space_before_type_colon = false +ij_scala_space_before_type_parameter_in_def_list = false +ij_scala_space_before_type_parameter_leading_context_bound_colon = false +ij_scala_space_before_type_parameter_leading_context_bound_colon_hk = true +ij_scala_space_before_type_parameter_list = false +ij_scala_space_before_type_parameter_rest_context_bound_colons = true +ij_scala_space_before_while_parentheses = true +ij_scala_space_inside_closure_braces = true +ij_scala_space_inside_self_type_braces = true +ij_scala_space_within_empty_method_call_parentheses = false +ij_scala_spaces_around_at_in_patterns = false +ij_scala_spaces_in_imports = false +ij_scala_spaces_in_one_line_blocks = false +ij_scala_spaces_within_brackets = false +ij_scala_spaces_within_for_parentheses = false +ij_scala_spaces_within_if_parentheses = false +ij_scala_spaces_within_method_call_parentheses = false +ij_scala_spaces_within_method_parentheses = false +ij_scala_spaces_within_parentheses = false +ij_scala_spaces_within_while_parentheses = false +ij_scala_special_else_if_treatment = true +ij_scala_trailing_comma_arg_list_enabled = true +ij_scala_trailing_comma_import_selector_enabled = false +ij_scala_trailing_comma_mode = trailing_comma_keep +ij_scala_trailing_comma_params_enabled = true +ij_scala_trailing_comma_pattern_arg_list_enabled = false +ij_scala_trailing_comma_tuple_enabled = false +ij_scala_trailing_comma_tuple_type_enabled = false +ij_scala_trailing_comma_type_params_enabled = false +ij_scala_try_brace_force = never +ij_scala_type_annotation_exclude_constant = true +ij_scala_type_annotation_exclude_in_dialect_sources = true +ij_scala_type_annotation_exclude_in_test_sources = false +ij_scala_type_annotation_exclude_member_of_anonymous_class = false +ij_scala_type_annotation_exclude_member_of_private_class = false +ij_scala_type_annotation_exclude_when_type_is_stable = true +ij_scala_type_annotation_function_parameter = false +ij_scala_type_annotation_implicit_modifier = true +ij_scala_type_annotation_local_definition = false +ij_scala_type_annotation_private_member = false +ij_scala_type_annotation_protected_member = true +ij_scala_type_annotation_public_member = true +ij_scala_type_annotation_structural_type = true +ij_scala_type_annotation_underscore_parameter = false +ij_scala_type_annotation_unit_type = true +ij_scala_use_alternate_continuation_indent_for_params = false +ij_scala_use_scala3_indentation_based_syntax = true +ij_scala_use_scaladoc2_formatting = false +ij_scala_variable_annotation_wrap = off +ij_scala_while_brace_force = never +ij_scala_while_on_new_line = false +ij_scala_wrap_before_with_keyword = false +ij_scala_wrap_first_method_in_call_chain = false +ij_scala_wrap_long_lines = false + +[*.scss] +indent_size = 2 +ij_scss_align_closing_brace_with_properties = false +ij_scss_blank_lines_around_nested_selector = 1 +ij_scss_blank_lines_between_blocks = 1 +ij_scss_block_comment_add_space = false +ij_scss_brace_placement = 0 +ij_scss_enforce_quotes_on_format = false +ij_scss_hex_color_long_format = false +ij_scss_hex_color_lower_case = false +ij_scss_hex_color_short_format = false +ij_scss_hex_color_upper_case = false +ij_scss_keep_blank_lines_in_code = 2 +ij_scss_keep_indents_on_empty_lines = false +ij_scss_keep_single_line_blocks = false +ij_scss_line_comment_add_space = false +ij_scss_line_comment_at_first_column = false +ij_scss_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_scss_space_after_colon = true +ij_scss_space_before_opening_brace = true +ij_scss_use_double_quotes = true +ij_scss_value_alignment = 0 + +[*.vue] +indent_size = 2 +tab_width = 2 +ij_continuation_indent_size = 4 +ij_vue_indent_children_of_top_level = template +ij_vue_interpolation_new_line_after_start_delimiter = true +ij_vue_interpolation_new_line_before_end_delimiter = true +ij_vue_interpolation_wrap = off +ij_vue_keep_indents_on_empty_lines = false +ij_vue_spaces_within_interpolation_expressions = true + +[.editorconfig] +ij_editorconfig_align_group_field_declarations = false +ij_editorconfig_space_after_colon = false +ij_editorconfig_space_after_comma = true +ij_editorconfig_space_before_colon = false +ij_editorconfig_space_before_comma = false +ij_editorconfig_spaces_around_assignment_operators = true + +[{*.ant,*.fxml,*.jhm,*.jnlp,*.jrxml,*.pom,*.rng,*.tld,*.wadl,*.wsdl,*.xml,*.xsd,*.xsl,*.xslt,*.xul}] +ij_xml_align_attributes = true +ij_xml_align_text = false +ij_xml_attribute_wrap = normal +ij_xml_block_comment_add_space = false +ij_xml_block_comment_at_first_column = true +ij_xml_keep_blank_lines = 2 +ij_xml_keep_indents_on_empty_lines = false +ij_xml_keep_line_breaks = true +ij_xml_keep_line_breaks_in_text = true +ij_xml_keep_whitespaces = false +ij_xml_keep_whitespaces_around_cdata = preserve +ij_xml_keep_whitespaces_inside_cdata = false +ij_xml_line_comment_at_first_column = true +ij_xml_space_after_tag_name = false +ij_xml_space_around_equals_in_attribute = false +ij_xml_space_inside_empty_tag = false +ij_xml_text_wrap = normal +ij_xml_use_custom_settings = false + +[{*.ats,*.cts,*.mts,*.ts}] +ij_continuation_indent_size = 4 +ij_typescript_align_imports = false +ij_typescript_align_multiline_array_initializer_expression = false +ij_typescript_align_multiline_binary_operation = false +ij_typescript_align_multiline_chained_methods = false +ij_typescript_align_multiline_extends_list = false +ij_typescript_align_multiline_for = true +ij_typescript_align_multiline_parameters = true +ij_typescript_align_multiline_parameters_in_calls = false +ij_typescript_align_multiline_ternary_operation = false +ij_typescript_align_object_properties = 0 +ij_typescript_align_union_types = false +ij_typescript_align_var_statements = 0 +ij_typescript_array_initializer_new_line_after_left_brace = false +ij_typescript_array_initializer_right_brace_on_new_line = false +ij_typescript_array_initializer_wrap = off +ij_typescript_assignment_wrap = off +ij_typescript_binary_operation_sign_on_next_line = false +ij_typescript_binary_operation_wrap = off +ij_typescript_blacklist_imports = rxjs/Rx,node_modules/**,**/node_modules/**,@angular/material,@angular/material/typings/** +ij_typescript_blank_lines_after_imports = 1 +ij_typescript_blank_lines_around_class = 1 +ij_typescript_blank_lines_around_field = 0 +ij_typescript_blank_lines_around_field_in_interface = 0 +ij_typescript_blank_lines_around_function = 1 +ij_typescript_blank_lines_around_method = 1 +ij_typescript_blank_lines_around_method_in_interface = 1 +ij_typescript_block_brace_style = end_of_line +ij_typescript_block_comment_add_space = false +ij_typescript_block_comment_at_first_column = true +ij_typescript_call_parameters_new_line_after_left_paren = false +ij_typescript_call_parameters_right_paren_on_new_line = false +ij_typescript_call_parameters_wrap = off +ij_typescript_catch_on_new_line = false +ij_typescript_chained_call_dot_on_new_line = true +ij_typescript_class_brace_style = end_of_line +ij_typescript_comma_on_new_line = false +ij_typescript_do_while_brace_force = never +ij_typescript_else_on_new_line = false +ij_typescript_enforce_trailing_comma = keep +ij_typescript_enum_constants_wrap = on_every_item +ij_typescript_extends_keyword_wrap = off +ij_typescript_extends_list_wrap = off +ij_typescript_field_prefix = _ +ij_typescript_file_name_style = relaxed +ij_typescript_finally_on_new_line = false +ij_typescript_for_brace_force = never +ij_typescript_for_statement_new_line_after_left_paren = false +ij_typescript_for_statement_right_paren_on_new_line = false +ij_typescript_for_statement_wrap = off +ij_typescript_force_quote_style = false +ij_typescript_force_semicolon_style = false +ij_typescript_function_expression_brace_style = end_of_line +ij_typescript_if_brace_force = never +ij_typescript_import_merge_members = global +ij_typescript_import_prefer_absolute_path = global +ij_typescript_import_sort_members = true +ij_typescript_import_sort_module_name = false +ij_typescript_import_use_node_resolution = true +ij_typescript_imports_wrap = on_every_item +ij_typescript_indent_case_from_switch = true +ij_typescript_indent_chained_calls = true +ij_typescript_indent_package_children = 0 +ij_typescript_jsdoc_include_types = false +ij_typescript_jsx_attribute_value = braces +ij_typescript_keep_blank_lines_in_code = 2 +ij_typescript_keep_first_column_comment = true +ij_typescript_keep_indents_on_empty_lines = false +ij_typescript_keep_line_breaks = true +ij_typescript_keep_simple_blocks_in_one_line = false +ij_typescript_keep_simple_methods_in_one_line = false +ij_typescript_line_comment_add_space = true +ij_typescript_line_comment_at_first_column = false +ij_typescript_method_brace_style = end_of_line +ij_typescript_method_call_chain_wrap = off +ij_typescript_method_parameters_new_line_after_left_paren = false +ij_typescript_method_parameters_right_paren_on_new_line = false +ij_typescript_method_parameters_wrap = off +ij_typescript_object_literal_wrap = on_every_item +ij_typescript_object_types_wrap = on_every_item +ij_typescript_parentheses_expression_new_line_after_left_paren = false +ij_typescript_parentheses_expression_right_paren_on_new_line = false +ij_typescript_place_assignment_sign_on_next_line = false +ij_typescript_prefer_as_type_cast = false +ij_typescript_prefer_explicit_types_function_expression_returns = false +ij_typescript_prefer_explicit_types_function_returns = false +ij_typescript_prefer_explicit_types_vars_fields = false +ij_typescript_prefer_parameters_wrap = false +ij_typescript_reformat_c_style_comments = false +ij_typescript_space_after_colon = true +ij_typescript_space_after_comma = true +ij_typescript_space_after_dots_in_rest_parameter = false +ij_typescript_space_after_generator_mult = true +ij_typescript_space_after_property_colon = true +ij_typescript_space_after_quest = true +ij_typescript_space_after_type_colon = true +ij_typescript_space_after_unary_not = false +ij_typescript_space_before_async_arrow_lparen = true +ij_typescript_space_before_catch_keyword = true +ij_typescript_space_before_catch_left_brace = true +ij_typescript_space_before_catch_parentheses = true +ij_typescript_space_before_class_lbrace = true +ij_typescript_space_before_class_left_brace = true +ij_typescript_space_before_colon = true +ij_typescript_space_before_comma = false +ij_typescript_space_before_do_left_brace = true +ij_typescript_space_before_else_keyword = true +ij_typescript_space_before_else_left_brace = true +ij_typescript_space_before_finally_keyword = true +ij_typescript_space_before_finally_left_brace = true +ij_typescript_space_before_for_left_brace = true +ij_typescript_space_before_for_parentheses = true +ij_typescript_space_before_for_semicolon = false +ij_typescript_space_before_function_left_parenth = true +ij_typescript_space_before_generator_mult = false +ij_typescript_space_before_if_left_brace = true +ij_typescript_space_before_if_parentheses = true +ij_typescript_space_before_method_call_parentheses = false +ij_typescript_space_before_method_left_brace = true +ij_typescript_space_before_method_parentheses = false +ij_typescript_space_before_property_colon = false +ij_typescript_space_before_quest = true +ij_typescript_space_before_switch_left_brace = true +ij_typescript_space_before_switch_parentheses = true +ij_typescript_space_before_try_left_brace = true +ij_typescript_space_before_type_colon = false +ij_typescript_space_before_unary_not = false +ij_typescript_space_before_while_keyword = true +ij_typescript_space_before_while_left_brace = true +ij_typescript_space_before_while_parentheses = true +ij_typescript_spaces_around_additive_operators = true +ij_typescript_spaces_around_arrow_function_operator = true +ij_typescript_spaces_around_assignment_operators = true +ij_typescript_spaces_around_bitwise_operators = true +ij_typescript_spaces_around_equality_operators = true +ij_typescript_spaces_around_logical_operators = true +ij_typescript_spaces_around_multiplicative_operators = true +ij_typescript_spaces_around_relational_operators = true +ij_typescript_spaces_around_shift_operators = true +ij_typescript_spaces_around_unary_operator = false +ij_typescript_spaces_within_array_initializer_brackets = false +ij_typescript_spaces_within_brackets = false +ij_typescript_spaces_within_catch_parentheses = false +ij_typescript_spaces_within_for_parentheses = false +ij_typescript_spaces_within_if_parentheses = false +ij_typescript_spaces_within_imports = false +ij_typescript_spaces_within_interpolation_expressions = false +ij_typescript_spaces_within_method_call_parentheses = false +ij_typescript_spaces_within_method_parentheses = false +ij_typescript_spaces_within_object_literal_braces = false +ij_typescript_spaces_within_object_type_braces = true +ij_typescript_spaces_within_parentheses = false +ij_typescript_spaces_within_switch_parentheses = false +ij_typescript_spaces_within_type_assertion = false +ij_typescript_spaces_within_union_types = true +ij_typescript_spaces_within_while_parentheses = false +ij_typescript_special_else_if_treatment = true +ij_typescript_ternary_operation_signs_on_next_line = false +ij_typescript_ternary_operation_wrap = off +ij_typescript_union_types_wrap = on_every_item +ij_typescript_use_chained_calls_group_indents = false +ij_typescript_use_double_quotes = true +ij_typescript_use_explicit_js_extension = auto +ij_typescript_use_path_mapping = always +ij_typescript_use_public_modifier = false +ij_typescript_use_semicolon_after_statement = true +ij_typescript_var_declaration_wrap = normal +ij_typescript_while_brace_force = never +ij_typescript_while_on_new_line = false +ij_typescript_wrap_comments = false + +[{*.bash,*.sh,*.zsh}] +indent_size = 2 +tab_width = 2 +ij_shell_binary_ops_start_line = false +ij_shell_keep_column_alignment_padding = false +ij_shell_minify_program = false +ij_shell_redirect_followed_by_space = false +ij_shell_switch_cases_indented = false +ij_shell_use_unix_line_separator = true + +[{*.cjs,*.js}] +ij_continuation_indent_size = 4 +ij_javascript_align_imports = false +ij_javascript_align_multiline_array_initializer_expression = false +ij_javascript_align_multiline_binary_operation = false +ij_javascript_align_multiline_chained_methods = false +ij_javascript_align_multiline_extends_list = false +ij_javascript_align_multiline_for = true +ij_javascript_align_multiline_parameters = true +ij_javascript_align_multiline_parameters_in_calls = false +ij_javascript_align_multiline_ternary_operation = false +ij_javascript_align_object_properties = 0 +ij_javascript_align_union_types = false +ij_javascript_align_var_statements = 0 +ij_javascript_array_initializer_new_line_after_left_brace = false +ij_javascript_array_initializer_right_brace_on_new_line = false +ij_javascript_array_initializer_wrap = off +ij_javascript_assignment_wrap = off +ij_javascript_binary_operation_sign_on_next_line = false +ij_javascript_binary_operation_wrap = off +ij_javascript_blacklist_imports = rxjs/Rx,node_modules/**,**/node_modules/**,@angular/material,@angular/material/typings/** +ij_javascript_blank_lines_after_imports = 1 +ij_javascript_blank_lines_around_class = 1 +ij_javascript_blank_lines_around_field = 0 +ij_javascript_blank_lines_around_function = 1 +ij_javascript_blank_lines_around_method = 1 +ij_javascript_block_brace_style = end_of_line +ij_javascript_block_comment_add_space = false +ij_javascript_block_comment_at_first_column = true +ij_javascript_call_parameters_new_line_after_left_paren = false +ij_javascript_call_parameters_right_paren_on_new_line = false +ij_javascript_call_parameters_wrap = off +ij_javascript_catch_on_new_line = false +ij_javascript_chained_call_dot_on_new_line = true +ij_javascript_class_brace_style = end_of_line +ij_javascript_comma_on_new_line = false +ij_javascript_do_while_brace_force = never +ij_javascript_else_on_new_line = false +ij_javascript_enforce_trailing_comma = keep +ij_javascript_extends_keyword_wrap = off +ij_javascript_extends_list_wrap = off +ij_javascript_field_prefix = _ +ij_javascript_file_name_style = relaxed +ij_javascript_finally_on_new_line = false +ij_javascript_for_brace_force = never +ij_javascript_for_statement_new_line_after_left_paren = false +ij_javascript_for_statement_right_paren_on_new_line = false +ij_javascript_for_statement_wrap = off +ij_javascript_force_quote_style = false +ij_javascript_force_semicolon_style = false +ij_javascript_function_expression_brace_style = end_of_line +ij_javascript_if_brace_force = never +ij_javascript_import_merge_members = global +ij_javascript_import_prefer_absolute_path = global +ij_javascript_import_sort_members = true +ij_javascript_import_sort_module_name = false +ij_javascript_import_use_node_resolution = true +ij_javascript_imports_wrap = on_every_item +ij_javascript_indent_case_from_switch = true +ij_javascript_indent_chained_calls = true +ij_javascript_indent_package_children = 0 +ij_javascript_jsx_attribute_value = braces +ij_javascript_keep_blank_lines_in_code = 2 +ij_javascript_keep_first_column_comment = true +ij_javascript_keep_indents_on_empty_lines = false +ij_javascript_keep_line_breaks = true +ij_javascript_keep_simple_blocks_in_one_line = false +ij_javascript_keep_simple_methods_in_one_line = false +ij_javascript_line_comment_add_space = true +ij_javascript_line_comment_at_first_column = false +ij_javascript_method_brace_style = end_of_line +ij_javascript_method_call_chain_wrap = off +ij_javascript_method_parameters_new_line_after_left_paren = false +ij_javascript_method_parameters_right_paren_on_new_line = false +ij_javascript_method_parameters_wrap = off +ij_javascript_object_literal_wrap = on_every_item +ij_javascript_object_types_wrap = on_every_item +ij_javascript_parentheses_expression_new_line_after_left_paren = false +ij_javascript_parentheses_expression_right_paren_on_new_line = false +ij_javascript_place_assignment_sign_on_next_line = false +ij_javascript_prefer_as_type_cast = false +ij_javascript_prefer_explicit_types_function_expression_returns = false +ij_javascript_prefer_explicit_types_function_returns = false +ij_javascript_prefer_explicit_types_vars_fields = false +ij_javascript_prefer_parameters_wrap = false +ij_javascript_reformat_c_style_comments = false +ij_javascript_space_after_colon = true +ij_javascript_space_after_comma = true +ij_javascript_space_after_dots_in_rest_parameter = false +ij_javascript_space_after_generator_mult = true +ij_javascript_space_after_property_colon = true +ij_javascript_space_after_quest = true +ij_javascript_space_after_type_colon = true +ij_javascript_space_after_unary_not = false +ij_javascript_space_before_async_arrow_lparen = true +ij_javascript_space_before_catch_keyword = true +ij_javascript_space_before_catch_left_brace = true +ij_javascript_space_before_catch_parentheses = true +ij_javascript_space_before_class_lbrace = true +ij_javascript_space_before_class_left_brace = true +ij_javascript_space_before_colon = true +ij_javascript_space_before_comma = false +ij_javascript_space_before_do_left_brace = true +ij_javascript_space_before_else_keyword = true +ij_javascript_space_before_else_left_brace = true +ij_javascript_space_before_finally_keyword = true +ij_javascript_space_before_finally_left_brace = true +ij_javascript_space_before_for_left_brace = true +ij_javascript_space_before_for_parentheses = true +ij_javascript_space_before_for_semicolon = false +ij_javascript_space_before_function_left_parenth = true +ij_javascript_space_before_generator_mult = false +ij_javascript_space_before_if_left_brace = true +ij_javascript_space_before_if_parentheses = true +ij_javascript_space_before_method_call_parentheses = false +ij_javascript_space_before_method_left_brace = true +ij_javascript_space_before_method_parentheses = false +ij_javascript_space_before_property_colon = false +ij_javascript_space_before_quest = true +ij_javascript_space_before_switch_left_brace = true +ij_javascript_space_before_switch_parentheses = true +ij_javascript_space_before_try_left_brace = true +ij_javascript_space_before_type_colon = false +ij_javascript_space_before_unary_not = false +ij_javascript_space_before_while_keyword = true +ij_javascript_space_before_while_left_brace = true +ij_javascript_space_before_while_parentheses = true +ij_javascript_spaces_around_additive_operators = true +ij_javascript_spaces_around_arrow_function_operator = true +ij_javascript_spaces_around_assignment_operators = true +ij_javascript_spaces_around_bitwise_operators = true +ij_javascript_spaces_around_equality_operators = true +ij_javascript_spaces_around_logical_operators = true +ij_javascript_spaces_around_multiplicative_operators = true +ij_javascript_spaces_around_relational_operators = true +ij_javascript_spaces_around_shift_operators = true +ij_javascript_spaces_around_unary_operator = false +ij_javascript_spaces_within_array_initializer_brackets = false +ij_javascript_spaces_within_brackets = false +ij_javascript_spaces_within_catch_parentheses = false +ij_javascript_spaces_within_for_parentheses = false +ij_javascript_spaces_within_if_parentheses = false +ij_javascript_spaces_within_imports = false +ij_javascript_spaces_within_interpolation_expressions = false +ij_javascript_spaces_within_method_call_parentheses = false +ij_javascript_spaces_within_method_parentheses = false +ij_javascript_spaces_within_object_literal_braces = false +ij_javascript_spaces_within_object_type_braces = true +ij_javascript_spaces_within_parentheses = false +ij_javascript_spaces_within_switch_parentheses = false +ij_javascript_spaces_within_type_assertion = false +ij_javascript_spaces_within_union_types = true +ij_javascript_spaces_within_while_parentheses = false +ij_javascript_special_else_if_treatment = true +ij_javascript_ternary_operation_signs_on_next_line = false +ij_javascript_ternary_operation_wrap = off +ij_javascript_union_types_wrap = on_every_item +ij_javascript_use_chained_calls_group_indents = false +ij_javascript_use_double_quotes = true +ij_javascript_use_explicit_js_extension = auto +ij_javascript_use_path_mapping = always +ij_javascript_use_public_modifier = false +ij_javascript_use_semicolon_after_statement = true +ij_javascript_var_declaration_wrap = normal +ij_javascript_while_brace_force = never +ij_javascript_while_on_new_line = false +ij_javascript_wrap_comments = false + +[{*.ft,*.vm,*.vsl}] +ij_vtl_keep_indents_on_empty_lines = false + +[{*.gant,*.groovy,*.gy}] +ij_groovy_align_group_field_declarations = false +ij_groovy_align_multiline_array_initializer_expression = false +ij_groovy_align_multiline_assignment = false +ij_groovy_align_multiline_binary_operation = false +ij_groovy_align_multiline_chained_methods = false +ij_groovy_align_multiline_extends_list = false +ij_groovy_align_multiline_for = true +ij_groovy_align_multiline_list_or_map = true +ij_groovy_align_multiline_method_parentheses = false +ij_groovy_align_multiline_parameters = true +ij_groovy_align_multiline_parameters_in_calls = false +ij_groovy_align_multiline_resources = true +ij_groovy_align_multiline_ternary_operation = false +ij_groovy_align_multiline_throws_list = false +ij_groovy_align_named_args_in_map = true +ij_groovy_align_throws_keyword = false +ij_groovy_array_initializer_new_line_after_left_brace = false +ij_groovy_array_initializer_right_brace_on_new_line = false +ij_groovy_array_initializer_wrap = off +ij_groovy_assert_statement_wrap = off +ij_groovy_assignment_wrap = off +ij_groovy_binary_operation_wrap = off +ij_groovy_blank_lines_after_class_header = 0 +ij_groovy_blank_lines_after_imports = 1 +ij_groovy_blank_lines_after_package = 1 +ij_groovy_blank_lines_around_class = 1 +ij_groovy_blank_lines_around_field = 0 +ij_groovy_blank_lines_around_field_in_interface = 0 +ij_groovy_blank_lines_around_method = 1 +ij_groovy_blank_lines_around_method_in_interface = 1 +ij_groovy_blank_lines_before_imports = 1 +ij_groovy_blank_lines_before_method_body = 0 +ij_groovy_blank_lines_before_package = 0 +ij_groovy_block_brace_style = end_of_line +ij_groovy_block_comment_add_space = false +ij_groovy_block_comment_at_first_column = true +ij_groovy_call_parameters_new_line_after_left_paren = false +ij_groovy_call_parameters_right_paren_on_new_line = false +ij_groovy_call_parameters_wrap = off +ij_groovy_catch_on_new_line = false +ij_groovy_class_annotation_wrap = split_into_lines +ij_groovy_class_brace_style = end_of_line +ij_groovy_class_count_to_use_import_on_demand = 5 +ij_groovy_do_while_brace_force = never +ij_groovy_else_on_new_line = false +ij_groovy_enable_groovydoc_formatting = true +ij_groovy_enum_constants_wrap = off +ij_groovy_extends_keyword_wrap = off +ij_groovy_extends_list_wrap = off +ij_groovy_field_annotation_wrap = split_into_lines +ij_groovy_finally_on_new_line = false +ij_groovy_for_brace_force = never +ij_groovy_for_statement_new_line_after_left_paren = false +ij_groovy_for_statement_right_paren_on_new_line = false +ij_groovy_for_statement_wrap = off +ij_groovy_ginq_general_clause_wrap_policy = 2 +ij_groovy_ginq_having_wrap_policy = 1 +ij_groovy_ginq_indent_having_clause = true +ij_groovy_ginq_indent_on_clause = true +ij_groovy_ginq_on_wrap_policy = 1 +ij_groovy_ginq_space_after_keyword = true +ij_groovy_if_brace_force = never +ij_groovy_import_annotation_wrap = 2 +ij_groovy_imports_layout = *,|,javax.**,java.**,|,$* +ij_groovy_indent_case_from_switch = true +ij_groovy_indent_label_blocks = true +ij_groovy_insert_inner_class_imports = false +ij_groovy_keep_blank_lines_before_right_brace = 2 +ij_groovy_keep_blank_lines_in_code = 2 +ij_groovy_keep_blank_lines_in_declarations = 2 +ij_groovy_keep_control_statement_in_one_line = true +ij_groovy_keep_first_column_comment = true +ij_groovy_keep_indents_on_empty_lines = false +ij_groovy_keep_line_breaks = true +ij_groovy_keep_multiple_expressions_in_one_line = false +ij_groovy_keep_simple_blocks_in_one_line = false +ij_groovy_keep_simple_classes_in_one_line = true +ij_groovy_keep_simple_lambdas_in_one_line = true +ij_groovy_keep_simple_methods_in_one_line = true +ij_groovy_label_indent_absolute = false +ij_groovy_label_indent_size = 0 +ij_groovy_lambda_brace_style = end_of_line +ij_groovy_layout_static_imports_separately = true +ij_groovy_line_comment_add_space = false +ij_groovy_line_comment_add_space_on_reformat = false +ij_groovy_line_comment_at_first_column = true +ij_groovy_method_annotation_wrap = split_into_lines +ij_groovy_method_brace_style = end_of_line +ij_groovy_method_call_chain_wrap = off +ij_groovy_method_parameters_new_line_after_left_paren = false +ij_groovy_method_parameters_right_paren_on_new_line = false +ij_groovy_method_parameters_wrap = off +ij_groovy_modifier_list_wrap = false +ij_groovy_names_count_to_use_import_on_demand = 3 +ij_groovy_packages_to_use_import_on_demand = java.awt.*,javax.swing.* +ij_groovy_parameter_annotation_wrap = off +ij_groovy_parentheses_expression_new_line_after_left_paren = false +ij_groovy_parentheses_expression_right_paren_on_new_line = false +ij_groovy_prefer_parameters_wrap = false +ij_groovy_resource_list_new_line_after_left_paren = false +ij_groovy_resource_list_right_paren_on_new_line = false +ij_groovy_resource_list_wrap = off +ij_groovy_space_after_assert_separator = true +ij_groovy_space_after_colon = true +ij_groovy_space_after_comma = true +ij_groovy_space_after_comma_in_type_arguments = true +ij_groovy_space_after_for_semicolon = true +ij_groovy_space_after_quest = true +ij_groovy_space_after_type_cast = true +ij_groovy_space_before_annotation_parameter_list = false +ij_groovy_space_before_array_initializer_left_brace = false +ij_groovy_space_before_assert_separator = false +ij_groovy_space_before_catch_keyword = true +ij_groovy_space_before_catch_left_brace = true +ij_groovy_space_before_catch_parentheses = true +ij_groovy_space_before_class_left_brace = true +ij_groovy_space_before_closure_left_brace = true +ij_groovy_space_before_colon = true +ij_groovy_space_before_comma = false +ij_groovy_space_before_do_left_brace = true +ij_groovy_space_before_else_keyword = true +ij_groovy_space_before_else_left_brace = true +ij_groovy_space_before_finally_keyword = true +ij_groovy_space_before_finally_left_brace = true +ij_groovy_space_before_for_left_brace = true +ij_groovy_space_before_for_parentheses = true +ij_groovy_space_before_for_semicolon = false +ij_groovy_space_before_if_left_brace = true +ij_groovy_space_before_if_parentheses = true +ij_groovy_space_before_method_call_parentheses = false +ij_groovy_space_before_method_left_brace = true +ij_groovy_space_before_method_parentheses = false +ij_groovy_space_before_quest = true +ij_groovy_space_before_record_parentheses = false +ij_groovy_space_before_switch_left_brace = true +ij_groovy_space_before_switch_parentheses = true +ij_groovy_space_before_synchronized_left_brace = true +ij_groovy_space_before_synchronized_parentheses = true +ij_groovy_space_before_try_left_brace = true +ij_groovy_space_before_try_parentheses = true +ij_groovy_space_before_while_keyword = true +ij_groovy_space_before_while_left_brace = true +ij_groovy_space_before_while_parentheses = true +ij_groovy_space_in_named_argument = true +ij_groovy_space_in_named_argument_before_colon = false +ij_groovy_space_within_empty_array_initializer_braces = false +ij_groovy_space_within_empty_method_call_parentheses = false +ij_groovy_spaces_around_additive_operators = true +ij_groovy_spaces_around_assignment_operators = true +ij_groovy_spaces_around_bitwise_operators = true +ij_groovy_spaces_around_equality_operators = true +ij_groovy_spaces_around_lambda_arrow = true +ij_groovy_spaces_around_logical_operators = true +ij_groovy_spaces_around_multiplicative_operators = true +ij_groovy_spaces_around_regex_operators = true +ij_groovy_spaces_around_relational_operators = true +ij_groovy_spaces_around_shift_operators = true +ij_groovy_spaces_within_annotation_parentheses = false +ij_groovy_spaces_within_array_initializer_braces = false +ij_groovy_spaces_within_braces = true +ij_groovy_spaces_within_brackets = false +ij_groovy_spaces_within_cast_parentheses = false +ij_groovy_spaces_within_catch_parentheses = false +ij_groovy_spaces_within_for_parentheses = false +ij_groovy_spaces_within_gstring_injection_braces = false +ij_groovy_spaces_within_if_parentheses = false +ij_groovy_spaces_within_list_or_map = false +ij_groovy_spaces_within_method_call_parentheses = false +ij_groovy_spaces_within_method_parentheses = false +ij_groovy_spaces_within_parentheses = false +ij_groovy_spaces_within_switch_parentheses = false +ij_groovy_spaces_within_synchronized_parentheses = false +ij_groovy_spaces_within_try_parentheses = false +ij_groovy_spaces_within_tuple_expression = false +ij_groovy_spaces_within_while_parentheses = false +ij_groovy_special_else_if_treatment = true +ij_groovy_ternary_operation_wrap = off +ij_groovy_throws_keyword_wrap = off +ij_groovy_throws_list_wrap = off +ij_groovy_use_flying_geese_braces = false +ij_groovy_use_fq_class_names = false +ij_groovy_use_fq_class_names_in_javadoc = true +ij_groovy_use_relative_indents = false +ij_groovy_use_single_class_imports = true +ij_groovy_variable_annotation_wrap = off +ij_groovy_while_brace_force = never +ij_groovy_while_on_new_line = false +ij_groovy_wrap_chain_calls_after_dot = false +ij_groovy_wrap_long_lines = false + +[{*.gradle.kts,*.kt,*.kts,*.main.kts}] +ij_kotlin_align_in_columns_case_branch = false +ij_kotlin_align_multiline_binary_operation = false +ij_kotlin_align_multiline_extends_list = false +ij_kotlin_align_multiline_method_parentheses = false +ij_kotlin_align_multiline_parameters = true +ij_kotlin_align_multiline_parameters_in_calls = false +ij_kotlin_allow_trailing_comma = false +ij_kotlin_allow_trailing_comma_on_call_site = false +ij_kotlin_assignment_wrap = off +ij_kotlin_blank_lines_after_class_header = 0 +ij_kotlin_blank_lines_around_block_when_branches = 0 +ij_kotlin_blank_lines_before_declaration_with_comment_or_annotation_on_separate_line = 1 +ij_kotlin_block_comment_add_space = false +ij_kotlin_block_comment_at_first_column = true +ij_kotlin_call_parameters_new_line_after_left_paren = false +ij_kotlin_call_parameters_right_paren_on_new_line = false +ij_kotlin_call_parameters_wrap = off +ij_kotlin_catch_on_new_line = false +ij_kotlin_class_annotation_wrap = split_into_lines +ij_kotlin_continuation_indent_for_chained_calls = true +ij_kotlin_continuation_indent_for_expression_bodies = true +ij_kotlin_continuation_indent_in_argument_lists = true +ij_kotlin_continuation_indent_in_elvis = true +ij_kotlin_continuation_indent_in_if_conditions = true +ij_kotlin_continuation_indent_in_parameter_lists = true +ij_kotlin_continuation_indent_in_supertype_lists = true +ij_kotlin_else_on_new_line = false +ij_kotlin_enum_constants_wrap = off +ij_kotlin_extends_list_wrap = off +ij_kotlin_field_annotation_wrap = split_into_lines +ij_kotlin_finally_on_new_line = false +ij_kotlin_if_rparen_on_new_line = false +ij_kotlin_import_nested_classes = false +ij_kotlin_imports_layout = *,java.**,javax.**,kotlin.**,^ +ij_kotlin_insert_whitespaces_in_simple_one_line_method = true +ij_kotlin_keep_blank_lines_before_right_brace = 2 +ij_kotlin_keep_blank_lines_in_code = 2 +ij_kotlin_keep_blank_lines_in_declarations = 2 +ij_kotlin_keep_first_column_comment = true +ij_kotlin_keep_indents_on_empty_lines = false +ij_kotlin_keep_line_breaks = true +ij_kotlin_lbrace_on_next_line = false +ij_kotlin_line_break_after_multiline_when_entry = true +ij_kotlin_line_comment_add_space = false +ij_kotlin_line_comment_add_space_on_reformat = false +ij_kotlin_line_comment_at_first_column = true +ij_kotlin_method_annotation_wrap = split_into_lines +ij_kotlin_method_call_chain_wrap = off +ij_kotlin_method_parameters_new_line_after_left_paren = false +ij_kotlin_method_parameters_right_paren_on_new_line = false +ij_kotlin_method_parameters_wrap = off +ij_kotlin_name_count_to_use_star_import = 5 +ij_kotlin_name_count_to_use_star_import_for_members = 3 +ij_kotlin_packages_to_use_import_on_demand = java.util.*,kotlinx.android.synthetic.**,io.ktor.** +ij_kotlin_parameter_annotation_wrap = off +ij_kotlin_space_after_comma = true +ij_kotlin_space_after_extend_colon = true +ij_kotlin_space_after_type_colon = true +ij_kotlin_space_before_catch_parentheses = true +ij_kotlin_space_before_comma = false +ij_kotlin_space_before_extend_colon = true +ij_kotlin_space_before_for_parentheses = true +ij_kotlin_space_before_if_parentheses = true +ij_kotlin_space_before_lambda_arrow = true +ij_kotlin_space_before_type_colon = false +ij_kotlin_space_before_when_parentheses = true +ij_kotlin_space_before_while_parentheses = true +ij_kotlin_spaces_around_additive_operators = true +ij_kotlin_spaces_around_assignment_operators = true +ij_kotlin_spaces_around_equality_operators = true +ij_kotlin_spaces_around_function_type_arrow = true +ij_kotlin_spaces_around_logical_operators = true +ij_kotlin_spaces_around_multiplicative_operators = true +ij_kotlin_spaces_around_range = false +ij_kotlin_spaces_around_relational_operators = true +ij_kotlin_spaces_around_unary_operator = false +ij_kotlin_spaces_around_when_arrow = true +ij_kotlin_variable_annotation_wrap = off +ij_kotlin_while_on_new_line = false +ij_kotlin_wrap_elvis_expressions = 1 +ij_kotlin_wrap_expression_body_functions = 0 +ij_kotlin_wrap_first_method_in_call_chain = false + +[{*.har,*.jsb2,*.jsb3,*.json,*.png.mcmeta,.babelrc,.eslintrc,.prettierrc,.stylelintrc,bowerrc,jest.config,mcmod.info,pack.mcmeta}] +indent_size = 2 +ij_json_array_wrapping = split_into_lines +ij_json_keep_blank_lines_in_code = 0 +ij_json_keep_indents_on_empty_lines = false +ij_json_keep_line_breaks = true +ij_json_keep_trailing_comma = false +ij_json_object_wrapping = split_into_lines +ij_json_property_alignment = do_not_align +ij_json_space_after_colon = true +ij_json_space_after_comma = true +ij_json_space_before_colon = false +ij_json_space_before_comma = false +ij_json_spaces_within_braces = false +ij_json_spaces_within_brackets = false +ij_json_wrap_long_lines = false + +[{*.htm,*.html,*.ng,*.sht,*.shtm,*.shtml}] +ij_html_add_new_line_before_tags = body,div,p,form,h1,h2,h3 +ij_html_align_attributes = true +ij_html_align_text = false +ij_html_attribute_wrap = normal +ij_html_block_comment_add_space = false +ij_html_block_comment_at_first_column = true +ij_html_do_not_align_children_of_min_lines = 0 +ij_html_do_not_break_if_inline_tags = title,h1,h2,h3,h4,h5,h6,p +ij_html_do_not_indent_children_of_tags = html,body,thead,tbody,tfoot +ij_html_enforce_quotes = false +ij_html_inline_tags = a,abbr,acronym,b,basefont,bdo,big,br,cite,cite,code,dfn,em,font,i,img,input,kbd,label,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var +ij_html_keep_blank_lines = 2 +ij_html_keep_indents_on_empty_lines = false +ij_html_keep_line_breaks = true +ij_html_keep_line_breaks_in_text = true +ij_html_keep_whitespaces = false +ij_html_keep_whitespaces_inside = span,pre,textarea +ij_html_line_comment_at_first_column = true +ij_html_new_line_after_last_attribute = never +ij_html_new_line_before_first_attribute = never +ij_html_quote_style = double +ij_html_remove_new_line_before_tags = br +ij_html_space_after_tag_name = false +ij_html_space_around_equality_in_attribute = false +ij_html_space_inside_empty_tag = false +ij_html_text_wrap = normal + +[{*.http,*.rest}] +indent_size = 0 +ij_continuation_indent_size = 4 +ij_http request_call_parameters_wrap = normal + +[{*.jsf,*.jsp,*.jspf,*.tag,*.tagf,*.xjsp}] +ij_jsp_jsp_prefer_comma_separated_import_list = false +ij_jsp_keep_indents_on_empty_lines = false + +[{*.jspx,*.tagx}] +ij_jspx_keep_indents_on_empty_lines = false + +[{*.markdown,*.md}] +ij_markdown_force_one_space_after_blockquote_symbol = true +ij_markdown_force_one_space_after_header_symbol = true +ij_markdown_force_one_space_after_list_bullet = true +ij_markdown_force_one_space_between_words = true +ij_markdown_format_tables = true +ij_markdown_insert_quote_arrows_on_wrap = true +ij_markdown_keep_indents_on_empty_lines = false +ij_markdown_keep_line_breaks_inside_text_blocks = true +ij_markdown_max_lines_around_block_elements = 1 +ij_markdown_max_lines_around_header = 1 +ij_markdown_max_lines_between_paragraphs = 1 +ij_markdown_min_lines_around_block_elements = 1 +ij_markdown_min_lines_around_header = 1 +ij_markdown_min_lines_between_paragraphs = 1 +ij_markdown_wrap_text_if_long = true +ij_markdown_wrap_text_inside_blockquotes = true + +[{*.pb,*.textproto}] +indent_size = 2 +tab_width = 2 +ij_continuation_indent_size = 4 +ij_prototext_keep_blank_lines_in_code = 2 +ij_prototext_keep_indents_on_empty_lines = false +ij_prototext_keep_line_breaks = true +ij_prototext_space_after_colon = true +ij_prototext_space_after_comma = true +ij_prototext_space_before_colon = false +ij_prototext_space_before_comma = false +ij_prototext_spaces_within_braces = true +ij_prototext_spaces_within_brackets = false + +[{*.properties,spring.handlers,spring.schemas}] +ij_properties_align_group_field_declarations = false +ij_properties_keep_blank_lines = false +ij_properties_key_value_delimiter = equals +ij_properties_spaces_around_key_value_delimiter = false + +[{*.ps1,*.psd1,*.psm1}] +max_line_length = 115 +ij_powershell_align_multiline_binary_operation = false +ij_powershell_align_multiline_chained_methods = false +ij_powershell_align_multiline_for = true +ij_powershell_align_multiline_parameters = true +ij_powershell_align_multiline_parameters_in_calls = false +ij_powershell_binary_operation_wrap = off +ij_powershell_block_brace_style = next_line +ij_powershell_call_parameters_new_line_after_left_paren = false +ij_powershell_call_parameters_right_paren_on_new_line = false +ij_powershell_call_parameters_wrap = off +ij_powershell_catch_on_new_line = true +ij_powershell_class_annotation_wrap = split_into_lines +ij_powershell_class_brace_style = next_line +ij_powershell_else_on_new_line = true +ij_powershell_field_annotation_wrap = off +ij_powershell_finally_on_new_line = true +ij_powershell_for_statement_new_line_after_left_paren = false +ij_powershell_for_statement_right_paren_on_new_line = false +ij_powershell_for_statement_wrap = off +ij_powershell_keep_blank_lines_in_code = 2 +ij_powershell_keep_first_column_comment = true +ij_powershell_keep_line_breaks = true +ij_powershell_keep_simple_blocks_in_one_line = false +ij_powershell_keep_simple_classes_in_one_line = false +ij_powershell_keep_simple_lambdas_in_one_line = true +ij_powershell_keep_simple_methods_in_one_line = false +ij_powershell_method_annotation_wrap = split_into_lines +ij_powershell_method_brace_style = next_line +ij_powershell_method_call_chain_wrap = off +ij_powershell_method_parameters_new_line_after_left_paren = false +ij_powershell_method_parameters_right_paren_on_new_line = false +ij_powershell_method_parameters_wrap = off +ij_powershell_parameter_annotation_wrap = off +ij_powershell_parentheses_expression_new_line_after_left_paren = false +ij_powershell_parentheses_expression_right_paren_on_new_line = false +ij_powershell_space_after_colon = true +ij_powershell_space_after_comma = true +ij_powershell_space_after_for_semicolon = true +ij_powershell_space_after_type_cast = false +ij_powershell_space_before_annotation_parameter_list = false +ij_powershell_space_before_array_initializer_left_brace = true +ij_powershell_space_before_catch_keyword = true +ij_powershell_space_before_catch_left_brace = true +ij_powershell_space_before_class_left_brace = true +ij_powershell_space_before_colon = true +ij_powershell_space_before_comma = false +ij_powershell_space_before_do_left_brace = true +ij_powershell_space_before_else_keyword = true +ij_powershell_space_before_else_left_brace = true +ij_powershell_space_before_finally_keyword = true +ij_powershell_space_before_finally_left_brace = true +ij_powershell_space_before_for_left_brace = true +ij_powershell_space_before_for_parentheses = true +ij_powershell_space_before_for_semicolon = false +ij_powershell_space_before_if_left_brace = true +ij_powershell_space_before_if_parentheses = true +ij_powershell_space_before_method_call_parentheses = false +ij_powershell_space_before_method_left_brace = true +ij_powershell_space_before_method_parentheses = false +ij_powershell_space_before_switch_left_brace = true +ij_powershell_space_before_switch_parentheses = true +ij_powershell_space_before_try_left_brace = true +ij_powershell_space_before_while_keyword = true +ij_powershell_space_before_while_left_brace = true +ij_powershell_space_before_while_parentheses = true +ij_powershell_space_within_empty_method_call_parentheses = false +ij_powershell_space_within_empty_method_parentheses = false +ij_powershell_spaces_around_additive_operators = true +ij_powershell_spaces_around_assignment_operators = true +ij_powershell_spaces_around_bitwise_operators = true +ij_powershell_spaces_around_logical_operators = true +ij_powershell_spaces_around_method_ref_dbl_colon = false +ij_powershell_spaces_around_multiplicative_operators = true +ij_powershell_spaces_around_relational_operators = true +ij_powershell_spaces_around_unary_operator = false +ij_powershell_spaces_within_annotation_parentheses = false +ij_powershell_spaces_within_braces = true +ij_powershell_spaces_within_brackets = false +ij_powershell_spaces_within_cast_parentheses = false +ij_powershell_spaces_within_for_parentheses = false +ij_powershell_spaces_within_if_parentheses = false +ij_powershell_spaces_within_method_call_parentheses = false +ij_powershell_spaces_within_method_parentheses = false +ij_powershell_spaces_within_parentheses = false +ij_powershell_spaces_within_switch_parentheses = false +ij_powershell_spaces_within_while_parentheses = false +ij_powershell_special_else_if_treatment = true +ij_powershell_while_on_new_line = false +ij_powershell_wrap_first_method_in_call_chain = false +ij_powershell_wrap_long_lines = false + +[{*.qute.htm,*.qute.html,*.qute.json,*.qute.txt,*.qute.yaml,*.qute.yml}] +ij_qute_keep_indents_on_empty_lines = false + +[{*.toml,Cargo.lock,Cargo.toml.orig,Gopkg.lock,Pipfile,poetry.lock}] +ij_toml_keep_indents_on_empty_lines = false + +[{*.yaml,*.yml}] +indent_size = 2 +ij_yaml_align_values_properties = do_not_align +ij_yaml_autoinsert_sequence_marker = true +ij_yaml_block_mapping_on_new_line = false +ij_yaml_indent_sequence_value = true +ij_yaml_keep_indents_on_empty_lines = false +ij_yaml_keep_line_breaks = true +ij_yaml_sequence_on_new_line = false +ij_yaml_space_before_colon = false +ij_yaml_spaces_within_braces = true +ij_yaml_spaces_within_brackets = true From 7da891af5929ab4cc63f14fb26419ecf487b5c81 Mon Sep 17 00:00:00 2001 From: Danielxs01 Date: Wed, 21 Jun 2023 18:12:02 +0200 Subject: [PATCH 47/52] [#108] Improved ProgressBar usage --- .../contentpacks/ContentPackHandler.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java b/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java index b9afd7fb..6ae05395 100644 --- a/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java +++ b/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandler.java @@ -143,7 +143,8 @@ public static void preloadModels(){ LandOfSignals.info("Starting preloading models"); - Progress.Bar topProgressBar = Progress.push("LandOfSignals", 2); + boolean rescaleItems = LandOfSignalsConfig.Experimental.rescaleItems; + Progress.Bar topProgressBar = Progress.push("LandOfSignals", rescaleItems ? 3 : 2); topProgressBar.step("Preloading models"); // Signalpart @@ -275,23 +276,23 @@ public static void preloadModels(){ } Progress.pop(progressBar); - topProgressBar.step("Finishing"); - Progress.pop(topProgressBar); LandOfSignals.info("Finished preloading models"); - if(LandOfSignalsConfig.Experimental.rescaleItems) + if(rescaleItems) { + topProgressBar.step("Rescaling items"); rescaleItemsToSlotSize(); + } + + topProgressBar.step("Finishing"); + Progress.pop(topProgressBar); } private static void rescaleItemsToSlotSize(){ LandOfSignals.info("Starting item rescaling"); - Progress.Bar topProgressBar = Progress.push("LandOfSignals", 2); - topProgressBar.step("Rescaling items"); - // Signalpart Progress.Bar progressBar = Progress.push("Signalpart", LOSBlocks.BLOCK_SIGNAL_PART.getContentpackSignals().size()); for (String id : LOSBlocks.BLOCK_SIGNAL_PART.getContentpackSignals().keySet()) { @@ -385,8 +386,6 @@ private static void rescaleItemsToSlotSize(){ } } Progress.pop(progressBar); - topProgressBar.step("Finishing"); - Progress.pop(topProgressBar); LandOfSignals.info("Finished rescaling items"); From a83f05d298bcf2daf5baf426ea83fc8419e88ee4 Mon Sep 17 00:00:00 2001 From: Danielxs01 Date: Wed, 21 Jun 2023 19:07:39 +0200 Subject: [PATCH 48/52] [#106] Make signals display their signalboxes --- .../items/ItemMagnifyingGlass.java | 29 ++++++++++++++++--- .../landofsignals/tile/TileSignalBox.java | 5 ++++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/landofrails/landofsignals/items/ItemMagnifyingGlass.java b/src/main/java/net/landofrails/landofsignals/items/ItemMagnifyingGlass.java index 9dda9783..01adedd3 100644 --- a/src/main/java/net/landofrails/landofsignals/items/ItemMagnifyingGlass.java +++ b/src/main/java/net/landofrails/landofsignals/items/ItemMagnifyingGlass.java @@ -36,26 +36,47 @@ public ClickResult onClickBlock(final Player player, final World world, final Ve if (hand.equals(Player.Hand.SECONDARY)) { return ClickResult.PASS; } + if (world.isBlock(pos, LOSBlocks.BLOCK_SIGNAL_PART) || world.isBlock(pos, LOSBlocks.BLOCK_COMPLEX_SIGNAL)) { + onClickSignal(world, pos); + return ClickResult.ACCEPTED; + } if (!world.isBlock(pos, LOSBlocks.BLOCK_SIGNAL_BOX)) { return ClickResult.PASS; } - toggleHighlighting(world); + disableHighlighting(world); TileSignalBox signalBox = world.getBlockEntity(pos, TileSignalBox.class); - signalBox.toggleHighlighting(); + toggleHighlighting(signalBox); return ClickResult.ACCEPTED; } + private void onClickSignal(World world, Vec3i pos) { + + disableHighlighting(world); + + final List signalBoxes = world.getBlockEntities(TileSignalBox.class); + signalBoxes.stream() + .filter(box -> box.getTileSignalPartPos() != null) + .filter(box -> box.getTileSignalPartPos().equals(pos)) + .forEach(this::toggleHighlighting); + + } + @Override public void onClickAir(final Player player, final World world, final Player.Hand hand) { if (!world.isClient || hand.equals(Player.Hand.SECONDARY)) return; - toggleHighlighting(world); + disableHighlighting(world); } - private void toggleHighlighting(final World world) { + private void disableHighlighting(final World world) { final List signalBoxes = world.getBlockEntities(TileSignalBox.class); signalBoxes.stream().filter(TileSignalBox::isHighlighting).forEach(TileSignalBox::toggleHighlighting); } + + private void toggleHighlighting(final TileSignalBox signalBox) { + signalBox.toggleHighlighting(); + } + } diff --git a/src/main/java/net/landofrails/landofsignals/tile/TileSignalBox.java b/src/main/java/net/landofrails/landofsignals/tile/TileSignalBox.java index 1f947f72..986e80fc 100644 --- a/src/main/java/net/landofrails/landofsignals/tile/TileSignalBox.java +++ b/src/main/java/net/landofrails/landofsignals/tile/TileSignalBox.java @@ -237,6 +237,11 @@ public Byte getSignalType() { return this.signalType; } + @Nullable + public Vec3i getTileSignalPartPos() { + return this.tileSignalPartPos; + } + /** * @return old textureIndex for active redstone signal * @deprecated (1.0.0, Only here for backwards compatability) From 75743cc479c0f7d466b7bd98763504199d338296 Mon Sep 17 00:00:00 2001 From: Danielxs01 Date: Sun, 9 Jul 2023 00:47:05 +0200 Subject: [PATCH 49/52] [#109] Fixed issues with ContentPackComplexSignal --- .../v2/complexsignal/ContentPackComplexSignal.java | 4 ++-- .../landofsignals/contentpacks/ContentPackHandlerV2.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/landofrails/api/contentpacks/v2/complexsignal/ContentPackComplexSignal.java b/src/main/java/net/landofrails/api/contentpacks/v2/complexsignal/ContentPackComplexSignal.java index 1bb6b552..50f9210f 100644 --- a/src/main/java/net/landofrails/api/contentpacks/v2/complexsignal/ContentPackComplexSignal.java +++ b/src/main/java/net/landofrails/api/contentpacks/v2/complexsignal/ContentPackComplexSignal.java @@ -152,8 +152,6 @@ public void validate(Consumer invalid, ContentPack contentPack) { Consumer referencesConsumer = text -> invalid.accept("references" + ": [" + text + "]"); references.validate(referencesConsumer); - defaultMissing(); - StringJoiner joiner = new StringJoiner(",", "[", "]"); if (name == null) joiner.add("name"); @@ -167,6 +165,8 @@ public void validate(Consumer invalid, ContentPack contentPack) { invalid.accept(joiner.toString()); } else { + defaultMissing(); + if (!"MISSING".equalsIgnoreCase(id)) { uniqueId = contentPack.getId() + ":" + id; } else { diff --git a/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandlerV2.java b/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandlerV2.java index 4ecc402d..51eaab2a 100644 --- a/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandlerV2.java +++ b/src/main/java/net/landofrails/landofsignals/contentpacks/ContentPackHandlerV2.java @@ -207,7 +207,7 @@ private static void loadSet(ZipFile zip, String path, ContentPack contentPack, b loadSignal(zip, entryPath, contentPack, isUTF8); break; case BLOCKCOMPLEXSIGNAL: - loadComplexSignal(zip, path, contentPack, isUTF8); + loadComplexSignal(zip, entryPath, contentPack, isUTF8); break; case BLOCKSIGN: loadSign(zip, entryPath, contentPack, isUTF8); From 0528b55deb5e07a8445a548518b013526accd858 Mon Sep 17 00:00:00 2001 From: Danielxs01 Date: Sun, 9 Jul 2023 14:32:57 +0200 Subject: [PATCH 50/52] [#108] Improved config-comment --- .../landofrails/landofsignals/configs/LandOfSignalsConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/landofrails/landofsignals/configs/LandOfSignalsConfig.java b/src/main/java/net/landofrails/landofsignals/configs/LandOfSignalsConfig.java index 15c4666b..f8fd0972 100644 --- a/src/main/java/net/landofrails/landofsignals/configs/LandOfSignalsConfig.java +++ b/src/main/java/net/landofrails/landofsignals/configs/LandOfSignalsConfig.java @@ -15,7 +15,7 @@ public class LandOfSignalsConfig { @ConfigFile.Comment("Experimental features - activate at own risk") public static class Experimental { - @ConfigFile.Comment("Rescale items to slot size") + @ConfigFile.Comment("Rescale items to slot size - needs \"preloadModels\" to be activated | Default: false") public static boolean rescaleItems = false; } From 761cd1e5c0948bbcd8feaa4bdb7f624eb62d2a80 Mon Sep 17 00:00:00 2001 From: Daniel Schmidt <60752432+Danielxs01@users.noreply.github.com> Date: Mon, 10 Jul 2023 19:27:38 +0200 Subject: [PATCH 51/52] Issue-112 version set to 1.1.0 issue-112 version set to 1.1.0 --- src/main/java/net/landofrails/landofsignals/LandOfSignals.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/landofrails/landofsignals/LandOfSignals.java b/src/main/java/net/landofrails/landofsignals/LandOfSignals.java index 613231ee..2938846b 100644 --- a/src/main/java/net/landofrails/landofsignals/LandOfSignals.java +++ b/src/main/java/net/landofrails/landofsignals/LandOfSignals.java @@ -29,7 +29,7 @@ public class LandOfSignals extends ModCore.Mod { public static final String MODID = "landofsignals"; // Current version @SuppressWarnings("unused") - public static final String VERSION = "1.0.4"; + public static final String VERSION = "1.1.0"; @Override public String modID() { From 5804e318d8f39964d44cd2e025d54688cca6572d Mon Sep 17 00:00:00 2001 From: Danielxs01 Date: Thu, 27 Jul 2023 19:40:10 +0200 Subject: [PATCH 52/52] [#112] Set version to 1.1.0 and updated CHANGELOG.md --- CHANGELOG.md | 12 ++++++++++++ VERSION | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88f3d751..e15263f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +#### Release 1.1.0 + +Fixed #109 : ContentPackComplexSignal can now be added to a contentpackset + +Improved #88 : Removed redundant cache + +Added #91 : 90 degree variants for stellwand blocks\ +Added #98 : Preloading option for models (see config)\ +Added #103 : Reimplemented ItemManipulator\ +Added #106 : Reimplemented MagnifyingGlass\ +Added #108 : Implemented dynamic scaling (see config) + #### Release 1.0.4 Fixed missing logging parameter in ContentPackHandlerV2#load diff --git a/VERSION b/VERSION index ee90284c..9084fa2f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.4 +1.1.0