From 12f17375ddde0f9550f7312832a24810617b0a72 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Thu, 8 Aug 2024 21:15:42 +0200 Subject: [PATCH 01/20] docs: add missing changelog entries for milestone 4.6 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31adb75cf..ac42b3430 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - When a Pattern is created for a recipe, the Pattern will have a different texture and name to differentiate between empty patterns. - The Pattern Grid now has additional support for encoding stonecutter and smithing table recipes. - The Pattern output is now always rendered in the Pattern Grid result slot. +- You can now search in the Pattern Grid alternatives screen. +- In the Pattern Grid alternatives screen, all resources belonging to a tag or no longer shown at once. You can expand or collapse them. +- The tag names in the Pattern Grid alternatives screen will now be translated. +- "Exact mode" in the Pattern Grid has been replaced with "Fuzzy mode" (inverse). ### Fixed From e508ab8c4f9cd6c940f9e5a2c66c54869870c7cd Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Thu, 8 Aug 2024 21:16:58 +0200 Subject: [PATCH 02/20] feat: port to 1.21.1, use new slimeballs tag Enforce usage of correct modloader versions that have the new tag. REI is no longer "suggested" on Fabric as there are more recipe mods now there. --- .github/ISSUE_TEMPLATE/bug-report.yml | 2 +- .github/workflows/build.yml | 2 +- .github/workflows/draft-release.yml | 2 +- .github/workflows/issue-for-unsupported-version.yml | 2 +- .github/workflows/publish-release.yml | 2 +- .github/workflows/resolved-issue-locking.yml | 2 +- .github/workflows/validate-branch-name.yml | 2 +- .github/workflows/validate-changelog.yml | 2 +- .github/workflows/validate-commit-messages.yml | 2 +- CHANGELOG.md | 8 ++++++++ gradle.properties | 2 +- .../data/refinedstorage/recipe/processor_binding.json | 2 +- refinedstorage-fabric/src/main/resources/fabric.mod.json | 5 ++--- .../src/main/resources/META-INF/neoforge.mods.toml | 2 +- 14 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 9216935a1..926f1c39e 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -35,7 +35,7 @@ body: description: | If your Minecraft version isn't listed here, it means that it isn't supported. In that case, don't create an issue. options: - - Minecraft 1.21 + - Minecraft 1.21.1 validations: required: true - type: input diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ed44fdb84..fa24ab46a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ on: types: [ opened, synchronize, reopened ] jobs: build: - uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.16.9 + uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.17.1 with: gametests: true secrets: inherit diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index d1b6a91d4..e21ed0371 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -17,7 +17,7 @@ on: type: string jobs: draft: - uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.16.9 + uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.17.1 with: release-type: ${{ inputs.release-type }} version-number-override: ${{ inputs.version-number-override }} diff --git a/.github/workflows/issue-for-unsupported-version.yml b/.github/workflows/issue-for-unsupported-version.yml index 054bce154..f8ce8650d 100644 --- a/.github/workflows/issue-for-unsupported-version.yml +++ b/.github/workflows/issue-for-unsupported-version.yml @@ -4,4 +4,4 @@ on: types: [ labeled, unlabeled, reopened ] jobs: unsupported-labeler: - uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.16.9 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.17.1 \ No newline at end of file diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 153402dbf..864977bfc 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -7,7 +7,7 @@ on: - closed jobs: publish-release: - uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.16.9 + uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.17.1 secrets: inherit with: project-name: 'Refined Storage' diff --git a/.github/workflows/resolved-issue-locking.yml b/.github/workflows/resolved-issue-locking.yml index fdaa760cc..5c6c04a6f 100644 --- a/.github/workflows/resolved-issue-locking.yml +++ b/.github/workflows/resolved-issue-locking.yml @@ -4,4 +4,4 @@ on: - cron: '0 0 * * 1' jobs: lock: - uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.16.9 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.17.1 \ No newline at end of file diff --git a/.github/workflows/validate-branch-name.yml b/.github/workflows/validate-branch-name.yml index 944aa08bb..ce5e06ea5 100644 --- a/.github/workflows/validate-branch-name.yml +++ b/.github/workflows/validate-branch-name.yml @@ -2,4 +2,4 @@ name: Validate branch name on: [ pull_request ] jobs: validate-branch-name: - uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.16.9 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.17.1 \ No newline at end of file diff --git a/.github/workflows/validate-changelog.yml b/.github/workflows/validate-changelog.yml index 218f86e40..db04af17b 100644 --- a/.github/workflows/validate-changelog.yml +++ b/.github/workflows/validate-changelog.yml @@ -4,4 +4,4 @@ on: types: [ opened, synchronize, reopened, ready_for_review, labeled, unlabeled ] jobs: validate-changelog: - uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.16.9 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.17.1 \ No newline at end of file diff --git a/.github/workflows/validate-commit-messages.yml b/.github/workflows/validate-commit-messages.yml index b70a80db3..043dba24c 100644 --- a/.github/workflows/validate-commit-messages.yml +++ b/.github/workflows/validate-commit-messages.yml @@ -2,4 +2,4 @@ name: Validate commit messages on: [ pull_request ] jobs: validate-commit-messages: - uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.16.9 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.17.1 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ac42b3430..f83689eac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed + +- Updated to Minecraft 1.21.1. + +### Fixed + +- Use new slimeballs convention tag for Processor Binding. + ## [2.0.0-milestone.4.6] - 2024-08-08 ### Added diff --git a/gradle.properties b/gradle.properties index 714a71d9d..4da18d71a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ -refinedarchitectVersion=0.16.9 +refinedarchitectVersion=0.17.1 # Gradle org.gradle.jvmargs=-Xmx1G diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/processor_binding.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/processor_binding.json index f2802cdb8..76a268adc 100644 --- a/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/processor_binding.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/processor_binding.json @@ -10,7 +10,7 @@ "tag": "c:strings" }, "L": { - "tag": "c:slimeballs" + "tag": "c:slime_balls" } }, "result": { diff --git a/refinedstorage-fabric/src/main/resources/fabric.mod.json b/refinedstorage-fabric/src/main/resources/fabric.mod.json index dfc5a06b2..c214d273c 100644 --- a/refinedstorage-fabric/src/main/resources/fabric.mod.json +++ b/refinedstorage-fabric/src/main/resources/fabric.mod.json @@ -38,14 +38,13 @@ ], "depends": { "fabricloader": ">=0.14.6", - "fabric-api": "*", - "minecraft": "1.21", + "fabric-api": ">=0.101.0", + "minecraft": "~1.21", "java": ">=21", "cloth-config2": "*", "team_reborn_energy": "*" }, "suggests": { - "roughlyenoughitems": "*", "modmenu": "*" } } diff --git a/refinedstorage-neoforge/src/main/resources/META-INF/neoforge.mods.toml b/refinedstorage-neoforge/src/main/resources/META-INF/neoforge.mods.toml index 296fa69fb..19353f8ec 100644 --- a/refinedstorage-neoforge/src/main/resources/META-INF/neoforge.mods.toml +++ b/refinedstorage-neoforge/src/main/resources/META-INF/neoforge.mods.toml @@ -15,6 +15,6 @@ Refined Storage is a mass storage mod for Minecraft that offers the player a net [[dependencies.refinedstorage]] modId = "neoforge" type = "required" -versionRange = "[21.0.112-beta,)" +versionRange = "[21.0.153,)" ordering = "NONE" side = "BOTH" From 9d52462db1c53c6f05a04df1b998b06f9a1da0ee Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Thu, 8 Aug 2024 21:33:55 +0200 Subject: [PATCH 03/20] fix: move crafting matrix highlight to sprite Remove crafting.png as it was unused Remove unneeded rows from portable_grid.png --- .../common/grid/screen/CraftingGridScreen.java | 15 ++++++++++----- .../refinedstorage/textures/gui/crafting.png | Bin 8805 -> 0 bytes .../textures/gui/crafting_grid.png | Bin 2277 -> 991 bytes .../textures/gui/portable_grid.png | Bin 1338 -> 930 bytes ...rafting_matrix_filtering_slot_highlight.png | Bin 0 -> 534 bytes 5 files changed, 10 insertions(+), 5 deletions(-) delete mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/crafting.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/crafting_grid/crafting_matrix_filtering_slot_highlight.png diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/CraftingGridScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/CraftingGridScreen.java index ad92e2d24..04d3a11ff 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/CraftingGridScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/CraftingGridScreen.java @@ -38,6 +38,9 @@ public class CraftingGridScreen extends AbstractGridScreen%W6rtG?|JOUaUSRSkz`|KBEToX2LOP8 znJJzKe#Za+2LRy#M^Qgd7lL0Oy$lU)0s@I91^@ud%uRjZ&8aV9)Z=OM$T1tKSXIs< zTzJjro#DuQJDOda8>aoLe1W71gAWyRwryIwQv&!?tPczIRbN9%+io_=Abxn^$ za!%n-51-7X&G9T9EXu1Wew6TBIP`$(x>|iol`p`Qdmf;D;tt1KeonaKAth4FKAD;elj|4=ot( zM)UCU*FntG)Fa?tR2{@IbxUQ-Ktr0RmuX}W%{J1?juPoZ!BP==x^V4q97w>A7EFeR z`}z9Qap5|M-*j={c)`uDV!Xrgh4BBsq`C2rTmQx3<>i6&74Y6qWRMNX#T-;5R3U68|WDj z96_YwzTm{~a`0P3OG})YKRuZ2PobIN zbr7II&|Y3t92tvMQ`N+{quf+9u_!GSHSmv{h9-)P(Zp(LVKFKcvfE$l@d1>OEw}%* zo(isa*HCv;)1WG&Fq-P_C<;}LjB>-0wNMzW8n{-4tV!0Q{k7gY$O}w6vhV+z4wxSQ zSN*@J=z|*3LBG=fOdbQW$Dbo#FWoIQx5QMXYA9pWC=`@CMFWeXQPgNCH%&Dvib__d zs!%CzZWs-$w$fInfQ#UNjQ${`^q)EYj$fRq*OmkkfAY1Zo%~w@`0tR#kttiLsDq$v z#UPD}`17&XzwpTa%%Xpg4fCXdME^r<{sE&0xCe)kgJ}95p!fdU*jM^@!qds2|5^0^ zSup)O(f>=X{BK16)2tLvvcCrntm{gMEoFZD^$({g{a1hep8JPt`4=24!CS+>Yd`qo z@7;su50VZ7_lDgQDxU#BqS6enZx^2P?RaN8rTXNHmdQA3PxM8T%HBa@OZ&l2O#MWz zu7A_}Om(5G5t8SJfGKo3ARM#1i+an{UR}vS(OyU^TR|87T{aMq5k9cXfe;&e`iB1o zz*W@>Kg?FHcVw?FK6BD(KR9{bNv~ng`jaOvdg|u`m}95vRod_+>W)5?ZbvBu0DQ)odIjS%7_2d@L?^i>_5f!{jR1x2Y>p5 zLR%M{*cAJbQlHDf2muYSUA6=gGBfP*gtVBs`1(jfqD8l3#LThPGr#7hTD@m>2I2u9 zKL_+>!ES6B%L<4=%5np}B=cKul1~r`d?4?ewgiQO+j<;Y?3}6r9tyu#i7mlQoKnQR z$#EU-hA!~LTSTJbX!voPq}oAfRqCOL=LS+ zEo&iShzgdkM2_9>ABGtc?(U)FJRE4r_dvWX5ZMOE&u{_p(66C2$6=JuyJDO`!2sZ5 zt6OJs!NUPFWG20v&sFmt@YR@GE}l~^cL295Z5yCzX{*+j${MhKC1OixBT2e3vXc0S zc?^a5;iwq^aAV+4Bw~OA5LbrT04XKWwImq;NYj=ZxlfvWZZjE}bBUfOO6h2eS0V+) zWtmd5qt*o?vbT01A7Qb+vWwkhsg(Gt5#!?glFHK!# zH);B{O3;rOY0lYsWb2UMEO_*I$hypDtRbf& z{1?CxdJfspt>qh`anh&CIjSeTLX*|S0#4NWhhR~!cpE1BZj*L)%M}jbGKs;RpHI$c zeX+z-liDL^Dt*_1uaWfQKP#rvi7JU#7#Oe0Aw@UF8Ve^_6aIK{M|rk)F$>e?DTLV{ zEmwEE|JTCzaSb-3?MjR8_7avHQjg83XqGRdcVA2Fn&sX%`5};ixA)1_$bL~V9D1~t zedeBiNH_LlPJ-eZ`7J5imcS=uNid@a*v(fD;1ZyF8oK*;%(k91#M?i=fO$gXle(FE zhgbK^W^JnIMIu3!Bbi8eboD@=l5f>pBS_=?fZ@dLkwl&#) zMg95dTHo~+SZ>$Pm$M;f-+V}ox^Sb)rL1IqrY?W*eElz7$+*%{+1DgC>=xoCKVU=X z0IpM`B5K~D0l=~7rYm$@Xtw6O$s$IEyfFK6F=W2l<*4wTGwUVC6~(eY2K|I9NXDE} zLX~H@%Er`XDtX_qz=xJWR(pPhj%}{hM*;vlXE*j(U8zZna~-DG!xf*dGl@&O=Lw(V zG8sE>qltvJsQTJWyKl^W*X>kFeHpRC4fm4OOF}G=UKES@Q74K89^bd)38Cqzf|1Sm z6qq@^B*}s%Ld z<+CigWDzV?m2`inko1ky5WO|B$?&0$+U1MH3s3rMgNefS>beggc8aHy6Ng|KR5Mv! zE_P^0%{%|SLOKhKi8s8Q2Zf;q6rV`9vX8P4TUNzNe_+LzU zH3`a1mWCF)>AlDNuN(OdBuOJdNR8#?OpIKq{e1yM6WOtl>P|d;)GSUAsJV-m*m$j) z6R8m@HwC+;+ID-kNwkEi&|Qr>nE&eijBw7qLvv3qtSpLY6+jHYV$dylWOLw9%*cI@ zLjmD-MJB@hQiFvO8`ySFb&Bd|-^tScegObV$rm!w%V|zXZ zUaF&-FUNU(yDzQZNjLL!nr?e*K3+r)m(-|IyT;OJcj0K*ZDeEq5yIi4S+TOj&XQfO zzkV}cl4D*~y0g+X!FFL$DYlT)@LJ@BuY2sRQeO^xV%j=L=F^MAoL`q0vWscrMtS1i zf|4tfs`)x`gFwlBj!WUs1EuvEI=Q=`a@lK+!50e^ z7?}#?nA~sRQ8pquQ6XNr!`KWpHZcQp(J6XjflwJ;OIqMc)b?$x=2;3-?ht}^$bE36 zQIG|<4Iw43VSqh%5;-%fXyvurhuftYWhHK`>e z-q#|r9*mP?ho*m3_lfnt^b;25jWB>*B=UjT+1hT7G@FcxZp*AVL5!TqrFR!Hf4EmV zRxrD=i10SgVpe=&xl7sQoWlm^p~b8$hh6e6ExV7?3z=PDs}Q&Wor!!xAh1`W2x>cS z3eAox89*+bS+k7hc!rI;_u@LNekIN!l64}z-;F;eH~wPO!RKq*%VIzv{-O208?5f> z#Ym)R#XJAq2q?0k2pT7PG6{NsU0k<(NjkZ9#PF$;(%ijwtO}PhR83l;5A^VNS#B}* z&Ns4f1d}MEZ**?&-PUmYOx?n$5`Tjwx0Io9sQ7nlVfW41vyNZ`^GeMqD=LHEadDZ- zT@)1pA-i!A_151geQK`XFwJa;2bOM~cmHXR+WuBD94v)qBIZq6)R6`C>TA|V;_m`A zN88`af2=!E{AN19#X)$f^yQ1(CNm@G{a8d{^byi@Vj|Q)86l8;r=zo+o%1#x%1~43 ztY#1ul1^LO85fTXor89HvxWm#j@@Gz2msou&$hcxp0 ze8{;e(E}wH?b-1kwih)u??-X458p}fPIe~kwF9E6ek2NLH(Y!Ymt+byfwXT*4*-<+ z)#l^)ODYN|e_ALsSp;(+@B(1@-TvuP-{=`xw4aw+NV#NUKPggd@Tm=jTdS?3A=Uic zut`FtOMS?#+swF$@w7qCrTiX+lzgd_&*PMwFGBJ@pQ{rbeQuSe zhsQ4;e0_!U(j4{L<17@RTj09S`7YUOVZ4hxgC+7>1NE%kmz}=Mj44^GZZgHn$qS|3I%{@vOi-3}+r|yS87wom`Qv}{EJ77l8cUQb` z$uEe7*z&welb=_!8V2@sVY0b}zbP2Iic+*{6q79OWgK~kMsB0FWGnjo0@&GIh42*ggjkmZFn}(h}eBH z;^900VS5{8Q;cp7DhYh@-AtxW@w!BP2TMs`^ctEqZ}@_U|uP>j|cJJDx&jq z24Aw}{@l6~7E@>vqaSBwvuj*h+kYix`aR>7vb@!XrqLobI@gFN^TT zy%S6UAgG9m>gy;g)GgTI(sb z*{czR;-5$F*ROwH%VZ6h1KS&Pp$mNj#YN#O4y&ic9^_QckCyp|*ga=SnRGb#=oHqX zgkLuab%sBFhj#jM^mP3FH$8OkcOH%&C5zqIp6%x0Md@nojs~lpSlvZl^3_D}AXPVY z1o_4|glUo6YjCN{@MpbPY58FuLx@KFxXZ26*9;3-176k6r9ThL-`ggA-ebq!eY}%( zVZ}eImI*+KI+pzi>{o1!%q7RA>4~Q1V*SlsU)x}XEIEX?p6`1LXM-4DMiSWc&@b88 z20?&mvw~1Fmx-#Kx{>D@nBXhFfbkWF?B;1%35il?z1_5Jewk4hVL!6GUX}@T6JFZs zr5DZ>ci#2c#wuUEx(Ae1;-7zK4z8R61 z#<Nv#%vA8XI;F5x5zUcuu#q+hEf)Gp=;0xx*J@0)27gg55y9=F^(5iHlO zYo55Vfocx-V(tGlaZ@tz$9G?oRN_6gJ(ctR68p!Ggg(5pkPf&U$ZsrY<`+&&!VKfA z_Pct>*jH~OHF|sI5FEa|}4M%^VqcrO|MyA*sC$mdm-aF0A*VBsTGDWZkAl zJXF@B;&8mm;+)EPtUzLWJT&V~X}&vWQT^uXRoAgoK8Ebx&qu7+_xJBT;L}jQz9H3E zx~7|P^J(dQ!zjf%W45PkgOhUmsLH7224i-%8w2UZ@^Ijuf%hjc?$3M90=X3E_1{UV zAM^JlYdL$&GAFw1@ssiEU^a_7}_KuPRk zG93-0xa}1bEZ>zJh>pD_%{GA8LK>weHoi-a!9WyI;SifMqoMO8M%Wr|(weBoH-0h4 z7d$CC8W&9Fo=Y18NdfF_slJE@m(tihn)7wdK38E`nX1PG(?1KnxxDva=Fj!~EQt7# z*O$QkrWV4%Sk@DtIfGktL>iqey*?z&E=w@e3mc1F=*7o8d6~SdmzKSW_g{T=cP1#E z+cyb5F@lY1{rXbdD;X^8FxQj(xg2 z^07d-eui|B|9a#Pc-Wp9vU$wpa&aUZ3=2b6Gi7QR;Mwh;9<#;XerAs$H z<98z%8o^U@8z@Bbz+|2b+Oe&5D;{OgeZf;)6$)_M$mxsydykaFuI6*AMs zerC1&>@=G=e|ORlaw$=9^W)6)fHK)LeDOmGJ?I<_Gt)jn^O#2Y#wswMvBVd%-PV07u*rs}AcH zwX*Y9;!DBjZyPYqVn~$j++P&lanQ4!g^|?*vP6H^dHSxhBpZUyLczD1%bGeQ|bSM`*i$UpY7eJd8S(FxirGvJ6-osk7dr}Pt5v( z`!AllZ{I%q`7;pmu&>5NW_r4F?1VO-ltcIK-t>;C;|%VR*=ku6m4-{&swVAn&Q#Y# z>-|Ei9)Qq}F<^NKJaH+vrCNwqtlt$j)uZjuKGspDF07`<#nx}{P5pdL^=2*Ku&Dl- z%`3VbkF9}ccN^VB=#8v^NSu6uE7GW+^D13Rqak}A2Y8Rn>ijt0NRkBYmIJ*8Je7}K zF`*(<(tlhnYw){V36afr)x_ zhw1vjfm^BxJcxkzodh$K*hP4AJyAh#!Cdg*GI*dqzT-uYO>T&?Z4*58QK z%heM5R3u!xysIpPt-Ntu?df=RGx}*z?o;YE%=Q<}jIM7ef7hR}1zi%dV@{LPJ94n? z$e^)OA^EqBsG8XFwb-!S7g%<2V*B&?$D4K0#)x^Iv_4XXugF~31Ln;W%{w0_0<|qy zUl4u#dPy}=Rvg*%fv>Zx_QI5bgHja!qxYo`x3p~T0tTlz29JdHi#8f@!x5FFl21#U zr$`Pi>`__XM{mDXFynk>OqOhYtu~R5x zq!Q5{ysHU{WY^+yo6;yF-eMwZJrUqgPnOk$cGT)@9!j6_Vro- zGj*>>CIEmSRA>U_dQ%7IJl3KD567oZV>QN0`x^uHe!Bp_30|&7L!=b7tf5R|OmlXs z?2&XOQ;x41sbBW!V~h)dQi)ZyS?z1QF=u|RaWy_&%k$ZxjpH*;zUAt_vz8Jt(jX3- r{vY-L|6FRfy7+%+5dOcNT-VELbQ@w)cY1C8Uxb;F6~5HKHSYfaK@U2S diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/crafting_grid.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/crafting_grid.png index f27b0beac89bb3ee63a68f9cdbe6d3d408fc582c..99e3f38741da55bde4566818a3e8ff9382361d28 100644 GIT binary patch literal 991 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K58911MRQ8&P5D>38$lZxy-8q?;Kn_c~qpu?a z!^VE@KZ&eBzC?geh%1o(|NsB7W5+^6L%X}X&CShk-@XkL?AfqU2uN|11o;I66@UQ4 zz2?1_FD!9W*biz$B>G+w|9E;<`@XLCYt4({=L7D`Oem# z!AECFrWik8F=?f6$4{5dQQDd2Jh6v)r@wA{ceUU;>#k+*|9>rxOknzvxozKmEd!<( zNxEUy4*A!kr^kfb9=N^caVQhe(p?iT0Z9gi62o?e3$J*ygdf=MPdD}isf)MDRUup~`{y+y@a0JF+$pj_`b?dJl414?Ulz%w)X(oeJ>GgwK z8FmOK?Dwxpb5pMm-0Oe9Y`N^hD#k5+Qx4iUD$kE#U}rkW@QvvrLmAUUhHXqA8O)gY z*)RODs?E_;I^d`!y`Z7=v-(SYExCq1`&Q-)iCR((eMJWuN;YVSH5^M_$k4Y+ ztU-2R?i-G|GcTTuXKC=eE6SSizxK&wyTpsijQco&F1@hpEGPmPE?hNdTu|-B$k4zS z#9$-!V4dv3{9U38j)COX-qrz846%C~K@^0Wz;uD%;)&m1iwQ*|-yxsjo=6jjRGrzMH%r88>E$z;v8pBjIT+0=Mu^Aff z`}JMzF>d%4Thv!=EmgccZ4cv@B}--GpKSugI~X{;Hsgk|84l#DAI~}_xu6#$vi9~G z{)TUH#eKhbL$zj2E~;_Vo{imgf69v2rp;lz#lgUk#Qa5%;cmsamTiT*94cJFPX3{r>L8jfvXTws{PkijEOh}&$&^Pl0`{Nr}s(T(;}?WSVGkb(WbU8N!0FGw}|d~ z6e(_P8yoScM-*Gq+Lg8_Q__@p)FZ-@rrw$&H@Y+TcIMidz5m=ZbLO1yeCG50e$VH8 zzvra;c)6;n=&Jw#)ZE=%&Hw-@wh%z=R4nJ>%Okd|OJ`g^1y#=sW)uc8()qMA0Qcys z>!CXo_O3X$z)Jw^ezY|q9n;Tg0H6}xU7UTt4v`FZd+nWtc%e%B_Dz-t`#ngR`@4UX z_K(CvWIiE&pWDz$W0KZDO8;rTUn8xyGloGZ`UctMDsJFO(u*?MyIyu|!t|rO^KUHe z7dLO}&Drful{Zz!?t56hx)JaL`ccfCR@K?qu(0}Bo-4j?(33LGC@#(`TKl+7`%ML4 z+`7eI#V3DkXqZK$XJtJ-J$D0(L9AK*fUZp3hxQ> zO6QUYya-NeYHHJ5KEis1e-LD!1V%Rj)*7PW5#S*bT-ybZS^#ANG`bw1{8y8c;Y+*i zC>aTeXLO+94mubJY)!|0+Q!C)%+Q?InQtYR_R(TiI%h}*P)7G(xWdNRS=XAcy-S=n zrYM0XOTnI0md|_IHX%I!DE9vyIL4B2Y!c(HTshW!%N~Q#GcYjdr{giQK`W}`v$3(U z>6Pi}@}Zoo8b2KdHC0G_*TF5B#yu(TCbVffe8DGI)bJ4Wa&)v>+OWDH>U=mqPueJd z;KUmc3MC-cm#l2&kR1)eMBlM`)=*eW0r2-t2bcc_ z%si3Pp96mes`p#KhBQkppa3mn>|R8T3*k9upp`jeyS4`kIAY8VMsW-0dvZy-TTtzP zAT1L(2F2C4ejDYXaP!1lfj{!3H2;;RLs;ljh60>T;N-x^i9pnSP_+0eI8c!iTRA&A zRQ1|rzbigwi0(8n`9%O|evKz6*BbXGy-&{Q=6+hYfYwmd7#C1&(>*>~Sv?Zj1wWO8bySqY(owZ=Xk9Z@gD_WsC1v>BoyoDq?n6?U@p zElKUqpGJ{W9Kn%xV|CHaK0HyRW5z$K5URDKV8p5t)nC%F!}*m{t&!UY!bDiA4EhCXKW8E@{CXeQ8jPpmm(k|tjYyR23^gmH9SZYSKizq2!YU?QQFCa0N?GwgydS1N7pde;i@kBuonkTHbLi)HEpZ1%@3qv;Z$3$dU(jE> z0DL-SQ#2~&$YtV89vxi*CoWCLhlNcv4-z~5sZSnDB$CNX4t9LbRWiB3)?jyIERo1@ z+LWM$QtE1vSTy_kDK90ofTef8sp;zCtB0u-3Pxv|IyxjzBd78NE=Itg6^Ka7vR@}T zNihQ~L0a(Ldw?51OpJ*c_7#$C|C#0oP6d(W7b7FZx4&v>Y0)Lz#;vyHU~?*ue`$Jn z?M!QxAyWsU-5E4@1!bcP1e^TIUrI+#g_ckF6r+E=-F&{dh1JSr96FbPxuFXJS~G15 zX5Yc#wb`-D$z?(g66CQxr)I8G>O3t~{2OmsPO5?-C4oRtWM?Nr$iLhL%mbH&RG(*( z&f)nZb$)4^WwT0U7lvkDjzuGYhrbu}R1@3eK#Aa79FN_d*3N>01pI-|W|1f`q{Y9% z4W0@sSgL}!`li$oGbvafyADLZQ8)5ae}nlL7mqC$RZu@}S^6VGj$`iT+X=kujX+Jf z$hx(#D?w%vVnQV&eMaE8iA-$GIBRq=NLN=^h{NGTsZQ#wn3fZ`SW(l$;7Xjmd37$V zm)C6z0;2ezRGBQdFFa|rI^Q~%w7xda>?whzzQQtfw9^R;3|sX${=^xMm-jKfTSU<; z;Q>*!rIi(0jVNrRmY#K_5jWp-wvDK5E--lx4h|)a98Q&q6vY_wKZSe8OW-k8MI0x@ z%R{bEdz*Z5WkX7hb_4;o1m|oay`)2nv`CCqHXQ0tlf#aB^+6ip)@$nH3>(BZJC5Dm Psyp|SUM^Li;;;P+kiWQg diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/portable_grid.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/portable_grid.png index 5e9695c5521f95b0c1e0bbec128c549df1a1d7cc..150d439208376caf627d310b8ced649caf394e4e 100644 GIT binary patch literal 930 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K58911MRQ8&P5D>38$lZxy-8q?;Kn_c~qpu?a z!^VE@KZ&eBzC?geh%1o(|NsB7W5+^6L(R?2ySuw@-@XkL{BrrbA&}xI3GxdDDgXh7 zd(C?zfnuBm9+AZi419+{nDKc2iWCM0rvIKUjv*CsZ}0TxEjAEvO$_p?{BN#TwvI_v zWogQ?qkErcY!$9lX0P|!&h`6pZ}Rnm$Lqd4>D8N_H>WOZdn}W`e}sV4yWDmM%ZIlQ zYc zemhSQW%$N?=l{2uuwDi^mIMFUC3e5eOqAV#wSnbHCVc zKEpe!xPDI%{~kR7hwn4@vd?ilyl>rkkat1Mi%r}hQych-Ou+P}@O!Q9YeCGf zSGpNESa$rER!WaPS;xM{d(Za8mfN#i^?_EcSRTg$QiDUE662?LPh8ff>}S5Fdhhnd zIk&eSnhsQaC0HNge+PC;DUfc5o7(RWEe->jQ}xPqB12_)(W0wu>V=Jz3F-U*cJ)A5fquhJ-1yu z*G=5xG(B_nr&anB7SF6=d@u3T>do)x?U`}*Wq&6x&YTtWOuX^p`on2m?5!(h`;Tvm zTkk#7pXFb%tX%)`K)Elz49BVxW?U-Ut-Ex}rrU45X1cTd+sk)+4_p4fKL?KTf8KmE zhwc1|t<$#U-v9ISY-jyx^}RLX538n~etJ?pZ&uXn1?S)IdiTV9!4XN=$87Wub( z)%B)-%znkna9NOnLybYehe2TmgM$HMLjn`SK^BH4P6n3GlN*?Irk}o4diTod27TcM z##`IICaCkE+jsWY z?c2$BLn~(4GR)W+_4=yWY*vP}ce7@nHDgqq5zb)1?|a$g@52I#uPZDW8-8Y7d;L`- z{mcFP_ov^@yUxLI=Cp?Ul>c^ocjXvVgmJl$-Vz&T7uQE->vkVaTC?@Q@+(o^*Gq%- zAG=#fH*Cv2{jowOTla(Jyy?>)>oTyA;NG5iSIcKhvu^YLrL;sXC1 zR8t_%;tiY2nXiGI-zc*f_V|Nqi9@4WH$fPQh= z?pV$9*Bw>VnPwXQwtRPgzg#ue^n%mN#XuuB&p-UtLh!_#o97FaE+DaPFe9ZnoF*V7 zgd5My{42BW`I}A$19d-^T{iiQu!Ng#&N!DV=bX&5J#)CuJhc?P0kmwRWvwkRy`rRR zgkfk2{`ZGGhZ)^b*^z6*K+!75u&;Mp?p>*xL_b!u^l!yGlHiE| diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/crafting_grid/crafting_matrix_filtering_slot_highlight.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/crafting_grid/crafting_matrix_filtering_slot_highlight.png new file mode 100644 index 0000000000000000000000000000000000000000..a740a03c22be406e90cf3fc9cba582e9cf3a9e9a GIT binary patch literal 534 zcmV+x0_pvUP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0jo(wK~y+Tl~hYo z!!Qi>C(gHbp(kL&3@h%+hGE48dXz4q`6sq{&v8nDMH9`uNS16_ezGHv&3qDVD}+>D z?3HyznM-**f1S+BlPrp&&9ZEiQd+Bh!j5Vad^1!T!BI%6wCIM$bW8I?pq4O`f_hcm> znhm&CB&@Xx9f+g-5)z>r!L!rkc#Ggjfxoah&T>5(E27Eq7C{1qdxTsX_ij1oRZ!Wl z@g3o&|2Se>d80Rz#BRk-;}a_&N3jdLg#3UKEdJq0!nv7f3X`BB-amJHA(>eZ!(i|j z`5+U(&=)};V+I5>#;ZcyaD)MZDPMBm_jz5{hpy{#AiG>HRok}oRX|C*X_}IApexQ9 z$1xKgMLnE9PvZHpz=P~S_`KfmRYO8|7IUG2I##4v)%5n^!;j6^%`#K%dnUpyNyVWO Y-x^IB%lbOEYybcN07*qoM6N<$g2b-p!2kdN literal 0 HcmV?d00001 From 332d0ea9c9e8e61d120b271672e9cb65547e0cd8 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Thu, 8 Aug 2024 22:22:30 +0200 Subject: [PATCH 04/20] chore: remove side button sprite sheet Switch to sprites --- .../common/api/grid/GridSynchronizer.java | 6 +-- .../resource/AbstractResourceType.java | 51 ------------------ .../api/support/resource/ResourceType.java | 6 +-- .../autocrafting/AlternativesScreen.java | 10 ++-- ...CraftingPatternClientTooltipComponent.java | 8 +-- ...ocessingPatternClientTooltipComponent.java | 8 +-- ...ingTablePatternClientTooltipComponent.java | 16 +++--- ...necutterPatternClientTooltipComponent.java | 8 +-- .../ConstructorDropItemsSideButtonWidget.java | 20 ++++--- ...DestructorPickupItemsSideButtonWidget.java | 20 ++++--- .../DetectorModeSideButtonWidget.java | 18 +++---- .../common/grid/AbstractGridSynchronizer.java | 18 ------- .../common/grid/NoopGridSynchronizer.java | 21 ++++++-- .../grid/screen/AbstractGridScreen.java | 12 ++--- .../screen/AutoSelectedSideButtonWidget.java | 18 +++---- .../screen/ResourceTypeSideButtonWidget.java | 27 ++-------- .../SortingDirectionSideButtonWidget.java | 15 +++--- .../screen/SortingTypeSideButtonWidget.java | 22 ++++---- ... SynchronizationModeSideButtonWidget.java} | 20 ++----- .../networking/NetworkTransmitterScreen.java | 4 +- .../RelayPassEnergySideButtonWidget.java | 16 ++---- .../RelayPassSecuritySideButtonWidget.java | 16 ++---- .../RelayPassStorageSideButtonWidget.java | 16 ++---- .../RelayPassThroughSideButtonWidget.java | 16 ++---- .../storage/AccessModeSideButtonWidget.java | 19 +++---- .../storage/FilterModeSideButtonWidget.java | 13 +++-- .../storage/PrioritySideButtonWidget.java | 12 ++--- .../storage/VoidExcessSideButtonWidget.java | 18 +++---- .../TransferModeSideButtonWidget.java | 17 +++--- .../support/{TextureIds.java => Sprites.java} | 5 +- .../support/resource/FluidResourceType.java | 29 +++++----- .../support/resource/ItemResourceType.java | 34 +++++++----- .../ScreenSizeSideButtonWidget.java | 22 ++++---- .../tooltip/HelpClientTooltipComponent.java | 4 +- .../tooltip/MouseClientTooltipComponent.java | 6 +-- .../widget/AbstractSideButtonWidget.java | 43 ++++++--------- .../widget/AbstractYesNoSideButtonWidget.java | 17 +++++- .../widget/FuzzyModeSideButtonWidget.java | 13 +++-- .../common/support/widget/ProgressWidget.java | 4 +- .../widget/RedstoneModeSideButtonWidget.java | 18 +++---- .../SchedulingModeSideButtonWidget.java | 19 +++---- .../assets/refinedstorage/lang/en_us.json | 6 +-- .../{side_button.png => side_button/base.png} | Bin .../side_button/constructor_drop_items/no.png | Bin 0 -> 956 bytes .../constructor_drop_items/yes.png | Bin 0 -> 945 bytes .../destructor_pickup_items/no.png | Bin 0 -> 948 bytes .../destructor_pickup_items/yes.png | Bin 0 -> 947 bytes .../side_button/detector_mode/above.png | Bin 0 -> 953 bytes .../side_button/detector_mode/equal.png | Bin 0 -> 933 bytes .../side_button/detector_mode/under.png | Bin 0 -> 954 bytes .../extract_from_network.png | Bin 0 -> 950 bytes .../insert_into_network.png | Bin 0 -> 953 bytes .../widget/side_button/fuzzy_mode/off.png | Bin 0 -> 952 bytes .../widget/side_button/fuzzy_mode/on.png | Bin 0 -> 965 bytes .../side_button/grid/autoselected/no.png | Bin 0 -> 944 bytes .../side_button/grid/autoselected/yes.png | Bin 0 -> 959 bytes .../grid/sorting_direction/ascending.png | Bin 0 -> 943 bytes .../grid/sorting_direction/descending.png | Bin 0 -> 944 bytes .../side_button/grid/sorting_type/id.png | Bin 0 -> 935 bytes .../grid/sorting_type/last_modified.png | Bin 0 -> 956 bytes .../side_button/grid/sorting_type/name.png | Bin 0 -> 947 bytes .../grid/sorting_type/quantity.png | Bin 0 -> 937 bytes .../grid/synchronization_mode/off.png | Bin 0 -> 975 bytes .../grid/synchronization_mode/on.png | Bin 0 -> 944 bytes .../grid/synchronization_mode/on_two_way.png | Bin 0 -> 949 bytes .../hover_overlay.png} | Bin .../hovered.png} | Bin .../sprites/widget/side_button/priority.png | Bin 0 -> 954 bytes .../widget/side_button/redstone_mode/high.png | Bin 0 -> 986 bytes .../side_button/redstone_mode/ignore.png | Bin 0 -> 990 bytes .../widget/side_button/redstone_mode/low.png | Bin 0 -> 978 bytes .../side_button/relay/pass_energy/no.png | Bin 0 -> 977 bytes .../side_button/relay/pass_energy/yes.png | Bin 0 -> 959 bytes .../side_button/relay/pass_security/no.png | Bin 0 -> 976 bytes .../side_button/relay/pass_security/yes.png | Bin 0 -> 959 bytes .../side_button/relay/pass_storage/no.png | Bin 0 -> 978 bytes .../side_button/relay/pass_storage/yes.png | Bin 0 -> 959 bytes .../side_button/relay/pass_through/no.png | Bin 0 -> 949 bytes .../side_button/relay/pass_through/yes.png | Bin 0 -> 975 bytes .../widget/side_button/resource_type/all.png | Bin 0 -> 955 bytes .../side_button/resource_type/fluid.png | Bin 0 -> 955 bytes .../widget/side_button/resource_type/item.png | Bin 0 -> 959 bytes .../side_button/scheduling_mode/default.png | Bin 0 -> 962 bytes .../side_button/scheduling_mode/random.png | Bin 0 -> 957 bytes .../scheduling_mode/round_robin.png | Bin 0 -> 956 bytes .../side_button/screen_size/extra_large.png | Bin 0 -> 944 bytes .../widget/side_button/screen_size/medium.png | Bin 0 -> 944 bytes .../widget/side_button/screen_size/small.png | Bin 0 -> 941 bytes .../side_button/screen_size/stretch.png | Bin 0 -> 955 bytes .../storage/access_mode/extract.png | Bin 0 -> 965 bytes .../storage/access_mode/insert.png | Bin 0 -> 961 bytes .../storage/access_mode/insert_extract.png | Bin 0 -> 956 bytes .../side_button/storage/filter_mode/allow.png | Bin 0 -> 931 bytes .../side_button/storage/filter_mode/block.png | Bin 0 -> 931 bytes .../side_button/storage/void_excess/no.png | Bin 0 -> 214 bytes .../side_button/storage/void_excess/yes.png | Bin 0 -> 179 bytes .../textures/side_button_icons.png | Bin 3561 -> 0 bytes 97 files changed, 292 insertions(+), 399 deletions(-) delete mode 100644 refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/AbstractResourceType.java delete mode 100644 refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/AbstractGridSynchronizer.java rename refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/{SynchronizationSideButtonWidget.java => SynchronizationModeSideButtonWidget.java} (68%) rename refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/{TextureIds.java => Sprites.java} (80%) rename refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/{side_button.png => side_button/base.png} (100%) create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/constructor_drop_items/no.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/constructor_drop_items/yes.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/destructor_pickup_items/no.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/destructor_pickup_items/yes.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/detector_mode/above.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/detector_mode/equal.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/detector_mode/under.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/disk_interface_transfer_mode/extract_from_network.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/disk_interface_transfer_mode/insert_into_network.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/fuzzy_mode/off.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/fuzzy_mode/on.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/autoselected/no.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/autoselected/yes.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/sorting_direction/ascending.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/sorting_direction/descending.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/sorting_type/id.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/sorting_type/last_modified.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/sorting_type/name.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/sorting_type/quantity.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/synchronization_mode/off.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/synchronization_mode/on.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/synchronization_mode/on_two_way.png rename refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/{side_button_hover_overlay.png => side_button/hover_overlay.png} (100%) rename refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/{side_button_hovered.png => side_button/hovered.png} (100%) create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/priority.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/redstone_mode/high.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/redstone_mode/ignore.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/redstone_mode/low.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/relay/pass_energy/no.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/relay/pass_energy/yes.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/relay/pass_security/no.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/relay/pass_security/yes.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/relay/pass_storage/no.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/relay/pass_storage/yes.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/relay/pass_through/no.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/relay/pass_through/yes.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/resource_type/all.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/resource_type/fluid.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/resource_type/item.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/scheduling_mode/default.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/scheduling_mode/random.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/scheduling_mode/round_robin.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/screen_size/extra_large.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/screen_size/medium.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/screen_size/small.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/screen_size/stretch.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/storage/access_mode/extract.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/storage/access_mode/insert.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/storage/access_mode/insert_extract.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/storage/filter_mode/allow.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/storage/filter_mode/block.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/storage/void_excess/no.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/storage/void_excess/yes.png delete mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/side_button_icons.png diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/GridSynchronizer.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/GridSynchronizer.java index f3caa76fc..f20c54e6e 100644 --- a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/GridSynchronizer.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/GridSynchronizer.java @@ -18,9 +18,5 @@ public interface GridSynchronizer { @Nullable String getTextToSynchronizeToGrid(); - ResourceLocation getTextureIdentifier(); - - int getXTexture(); - - int getYTexture(); + ResourceLocation getSprite(); } diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/AbstractResourceType.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/AbstractResourceType.java deleted file mode 100644 index 6bd422fd7..000000000 --- a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/AbstractResourceType.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.refinedmods.refinedstorage.common.api.support.resource; - -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.resources.ResourceLocation; -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.4") -public abstract class AbstractResourceType implements ResourceType { - private final String name; - private final MutableComponent title; - private final ResourceLocation textureIdentifier; - private final int textureX; - private final int textureY; - - protected AbstractResourceType(final String name, - final MutableComponent title, - final ResourceLocation textureIdentifier, - final int textureX, - final int textureY) { - this.name = name; - this.title = title; - this.textureIdentifier = textureIdentifier; - this.textureX = textureX; - this.textureY = textureY; - } - - @Override - public MutableComponent getTitle() { - return title; - } - - @Override - public ResourceLocation getTextureIdentifier() { - return textureIdentifier; - } - - @Override - public int getXTexture() { - return textureX; - } - - @Override - public int getYTexture() { - return textureY; - } - - @Override - public String toString() { - return name; - } -} diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceType.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceType.java index 1e8d34bfa..4f02ddefa 100644 --- a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceType.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceType.java @@ -23,11 +23,7 @@ public interface ResourceType { MutableComponent getTitle(); - ResourceLocation getTextureIdentifier(); - - int getXTexture(); - - int getYTexture(); + ResourceLocation getSprite(); long normalizeAmount(double amount); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AlternativesScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AlternativesScreen.java index 7661de56f..e23aa3dcc 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AlternativesScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/AlternativesScreen.java @@ -2,7 +2,7 @@ import com.refinedmods.refinedstorage.common.Platform; import com.refinedmods.refinedstorage.common.support.ResourceSlotRendering; -import com.refinedmods.refinedstorage.common.support.TextureIds; +import com.refinedmods.refinedstorage.common.support.Sprites; import com.refinedmods.refinedstorage.common.support.amount.AbstractAmountScreen; import com.refinedmods.refinedstorage.common.support.amount.AmountScreenConfiguration; import com.refinedmods.refinedstorage.common.support.amount.DoubleAmountOperations; @@ -30,7 +30,7 @@ import net.minecraft.world.entity.player.Inventory; import org.joml.Vector3f; -import static com.refinedmods.refinedstorage.common.support.TextureIds.SEARCH_SIZE; +import static com.refinedmods.refinedstorage.common.support.Sprites.SEARCH_SIZE; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; @@ -300,7 +300,7 @@ public void render(final GuiGraphics graphics, final int mouseX, final int mouse @Override protected void renderBg(final GuiGraphics graphics, final float delta, final int mouseX, final int mouseY) { super.renderBg(graphics, delta, mouseX, mouseY); - graphics.blitSprite(TextureIds.SEARCH, leftPos + 7, topPos + 107, SEARCH_SIZE, SEARCH_SIZE); + graphics.blitSprite(Sprites.SEARCH, leftPos + 7, topPos + 107, SEARCH_SIZE, SEARCH_SIZE); final int x = getInsetX(); final int y = getInsetY(); graphics.enableScissor(x, y, x + INSET_WIDTH, y + INSET_HEIGHT); @@ -365,7 +365,7 @@ private void renderMainSlotsBackground( if (y >= startY - ALTERNATIVE_ROW_HEIGHT && y < startY + INSET_HEIGHT) { for (int col = 0; col < Math.min(alternative.getResources().size(), RESOURCES_PER_ROW); ++col) { final int slotX = x + 1 + (col * 18); - graphics.blitSprite(TextureIds.SLOT, slotX, y, 18, 18); + graphics.blitSprite(Sprites.SLOT, slotX, y, 18, 18); } } } @@ -395,7 +395,7 @@ private int renderOverflowSlotsBackground(final GuiGraphics graphics, break; } final int slotX = x + 1 + (col * 18); - graphics.blitSprite(TextureIds.SLOT, slotX, rowY, 18, 18); + graphics.blitSprite(Sprites.SLOT, slotX, rowY, 18, 18); } } renderSlots(alternative.getOverflowSlots(), graphics, mouseX, mouseY); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/CraftingPatternClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/CraftingPatternClientTooltipComponent.java index d9e0e869e..9b32a4425 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/CraftingPatternClientTooltipComponent.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/CraftingPatternClientTooltipComponent.java @@ -15,10 +15,10 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; -import static com.refinedmods.refinedstorage.common.support.TextureIds.LIGHT_ARROW; -import static com.refinedmods.refinedstorage.common.support.TextureIds.LIGHT_ARROW_HEIGHT; -import static com.refinedmods.refinedstorage.common.support.TextureIds.LIGHT_ARROW_WIDTH; -import static com.refinedmods.refinedstorage.common.support.TextureIds.SLOT; +import static com.refinedmods.refinedstorage.common.support.Sprites.LIGHT_ARROW; +import static com.refinedmods.refinedstorage.common.support.Sprites.LIGHT_ARROW_HEIGHT; +import static com.refinedmods.refinedstorage.common.support.Sprites.LIGHT_ARROW_WIDTH; +import static com.refinedmods.refinedstorage.common.support.Sprites.SLOT; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static java.util.Objects.requireNonNullElse; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingPatternClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingPatternClientTooltipComponent.java index 2a5d22278..32850c518 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingPatternClientTooltipComponent.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingPatternClientTooltipComponent.java @@ -15,10 +15,10 @@ import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; import net.minecraft.network.chat.Component; -import static com.refinedmods.refinedstorage.common.support.TextureIds.LIGHT_ARROW; -import static com.refinedmods.refinedstorage.common.support.TextureIds.LIGHT_ARROW_HEIGHT; -import static com.refinedmods.refinedstorage.common.support.TextureIds.LIGHT_ARROW_WIDTH; -import static com.refinedmods.refinedstorage.common.support.TextureIds.SLOT; +import static com.refinedmods.refinedstorage.common.support.Sprites.LIGHT_ARROW; +import static com.refinedmods.refinedstorage.common.support.Sprites.LIGHT_ARROW_HEIGHT; +import static com.refinedmods.refinedstorage.common.support.Sprites.LIGHT_ARROW_WIDTH; +import static com.refinedmods.refinedstorage.common.support.Sprites.SLOT; import static java.util.Objects.requireNonNullElse; class ProcessingPatternClientTooltipComponent implements ClientTooltipComponent { diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePatternClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePatternClientTooltipComponent.java index 67fbdcf70..2c248bd9b 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePatternClientTooltipComponent.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePatternClientTooltipComponent.java @@ -3,7 +3,7 @@ import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; import com.refinedmods.refinedstorage.common.api.support.resource.ResourceRendering; -import com.refinedmods.refinedstorage.common.support.TextureIds; +import com.refinedmods.refinedstorage.common.support.Sprites; import net.minecraft.ChatFormatting; import net.minecraft.client.gui.Font; @@ -11,9 +11,9 @@ import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; import net.minecraft.network.chat.Component; -import static com.refinedmods.refinedstorage.common.support.TextureIds.LIGHT_ARROW; -import static com.refinedmods.refinedstorage.common.support.TextureIds.LIGHT_ARROW_HEIGHT; -import static com.refinedmods.refinedstorage.common.support.TextureIds.LIGHT_ARROW_WIDTH; +import static com.refinedmods.refinedstorage.common.support.Sprites.LIGHT_ARROW; +import static com.refinedmods.refinedstorage.common.support.Sprites.LIGHT_ARROW_HEIGHT; +import static com.refinedmods.refinedstorage.common.support.Sprites.LIGHT_ARROW_WIDTH; import static java.util.Objects.requireNonNullElse; class SmithingTablePatternClientTooltipComponent implements ClientTooltipComponent { @@ -31,13 +31,13 @@ class SmithingTablePatternClientTooltipComponent implements ClientTooltipCompone public void renderImage(final Font font, final int x, final int y, final GuiGraphics graphics) { graphics.drawString(font, outputText, x, y, requireNonNullElse(ChatFormatting.GRAY.getColor(), 15)); final int slotsY = y + 9 + 2; - graphics.blitSprite(TextureIds.SLOT, x, slotsY, 18, 18); + graphics.blitSprite(Sprites.SLOT, x, slotsY, 18, 18); RefinedStorageApi.INSTANCE.getResourceRendering(pattern.template()) .render(pattern.template(), graphics, x + 1, slotsY + 1); - graphics.blitSprite(TextureIds.SLOT, x + 18, slotsY, 18, 18); + graphics.blitSprite(Sprites.SLOT, x + 18, slotsY, 18, 18); RefinedStorageApi.INSTANCE.getResourceRendering(pattern.base()) .render(pattern.base(), graphics, x + 18 + 1, slotsY + 1); - graphics.blitSprite(TextureIds.SLOT, x + 18 + 18, slotsY, 18, 18); + graphics.blitSprite(Sprites.SLOT, x + 18 + 18, slotsY, 18, 18); RefinedStorageApi.INSTANCE.getResourceRendering(pattern.addition()) .render(pattern.addition(), graphics, x + 18 + 18 + 1, slotsY + 1); graphics.blitSprite( @@ -48,7 +48,7 @@ public void renderImage(final Font font, final int x, final int y, final GuiGrap LIGHT_ARROW_HEIGHT ); final int lastSlotX = x + (18 * 3) + ARROW_SPACING + LIGHT_ARROW_WIDTH + ARROW_SPACING; - graphics.blitSprite(TextureIds.SLOT, lastSlotX, slotsY, 18, 18); + graphics.blitSprite(Sprites.SLOT, lastSlotX, slotsY, 18, 18); RefinedStorageApi.INSTANCE.getResourceRendering(pattern.output()) .render(pattern.output(), graphics, lastSlotX + 1, slotsY + 1); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPatternClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPatternClientTooltipComponent.java index 80e0452c1..90756883f 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPatternClientTooltipComponent.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPatternClientTooltipComponent.java @@ -10,10 +10,10 @@ import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; import net.minecraft.network.chat.Component; -import static com.refinedmods.refinedstorage.common.support.TextureIds.LIGHT_ARROW; -import static com.refinedmods.refinedstorage.common.support.TextureIds.LIGHT_ARROW_HEIGHT; -import static com.refinedmods.refinedstorage.common.support.TextureIds.LIGHT_ARROW_WIDTH; -import static com.refinedmods.refinedstorage.common.support.TextureIds.SLOT; +import static com.refinedmods.refinedstorage.common.support.Sprites.LIGHT_ARROW; +import static com.refinedmods.refinedstorage.common.support.Sprites.LIGHT_ARROW_HEIGHT; +import static com.refinedmods.refinedstorage.common.support.Sprites.LIGHT_ARROW_WIDTH; +import static com.refinedmods.refinedstorage.common.support.Sprites.SLOT; import static java.util.Objects.requireNonNullElse; class StonecutterPatternClientTooltipComponent implements ClientTooltipComponent { diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorDropItemsSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorDropItemsSideButtonWidget.java index f27231ee6..33127f356 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorDropItemsSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorDropItemsSideButtonWidget.java @@ -3,20 +3,18 @@ import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; import com.refinedmods.refinedstorage.common.support.widget.AbstractYesNoSideButtonWidget; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; class ConstructorDropItemsSideButtonWidget extends AbstractYesNoSideButtonWidget { - ConstructorDropItemsSideButtonWidget(final ClientProperty property) { - super(property, createTranslation("gui", "constructor.drop_items")); - } + private static final MutableComponent TITLE = createTranslation("gui", "constructor.drop_items"); + private static final ResourceLocation YES = createIdentifier("widget/side_button/constructor_drop_items/yes"); + private static final ResourceLocation NO = createIdentifier("widget/side_button/constructor_drop_items/no"); - @Override - protected int getXTexture() { - return Boolean.TRUE.equals(property.getValue()) ? 80 : 64; - } - - @Override - protected int getYTexture() { - return 16; + ConstructorDropItemsSideButtonWidget(final ClientProperty property) { + super(property, TITLE, YES, NO); } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorPickupItemsSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorPickupItemsSideButtonWidget.java index 3c80a1fc1..40f929a85 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorPickupItemsSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorPickupItemsSideButtonWidget.java @@ -3,20 +3,18 @@ import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; import com.refinedmods.refinedstorage.common.support.widget.AbstractYesNoSideButtonWidget; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; class DestructorPickupItemsSideButtonWidget extends AbstractYesNoSideButtonWidget { - DestructorPickupItemsSideButtonWidget(final ClientProperty property) { - super(property, createTranslation("gui", "destructor.pickup_items")); - } + private static final MutableComponent TITLE = createTranslation("gui", "destructor.pickup_items"); + private static final ResourceLocation YES = createIdentifier("widget/side_button/destructor_pickup_items/yes"); + private static final ResourceLocation NO = createIdentifier("widget/side_button/destructor_pickup_items/no"); - @Override - protected int getXTexture() { - return Boolean.TRUE.equals(property.getValue()) ? 64 : 80; - } - - @Override - protected int getYTexture() { - return 0; + DestructorPickupItemsSideButtonWidget(final ClientProperty property) { + super(property, TITLE, YES, NO); } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorModeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorModeSideButtonWidget.java index 8e9da9084..c8bb167ad 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorModeSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorModeSideButtonWidget.java @@ -5,7 +5,9 @@ import com.refinedmods.refinedstorage.common.support.widget.AbstractSideButtonWidget; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; class DetectorModeSideButtonWidget extends AbstractSideButtonWidget { @@ -13,6 +15,9 @@ class DetectorModeSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent SUBTEXT_EQUAL = createTranslation("gui", "detector.mode.equal"); private static final MutableComponent SUBTEXT_ABOVE = createTranslation("gui", "detector.mode.above"); private static final MutableComponent SUBTEXT_UNDER = createTranslation("gui", "detector.mode.under"); + private static final ResourceLocation EQUAL = createIdentifier("widget/side_button/detector_mode/equal"); + private static final ResourceLocation ABOVE = createIdentifier("widget/side_button/detector_mode/above"); + private static final ResourceLocation UNDER = createIdentifier("widget/side_button/detector_mode/under"); private final ClientProperty property; @@ -34,19 +39,14 @@ private static DetectorMode toggle(final DetectorMode detectorMode) { } @Override - protected int getXTexture() { + protected ResourceLocation getSprite() { return switch (property.getValue()) { - case UNDER -> 0; - case EQUAL -> 16; - case ABOVE -> 32; + case UNDER -> UNDER; + case EQUAL -> EQUAL; + case ABOVE -> ABOVE; }; } - @Override - protected int getYTexture() { - return 176; - } - @Override protected MutableComponent getTitle() { return TITLE; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/AbstractGridSynchronizer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/AbstractGridSynchronizer.java deleted file mode 100644 index 92cfb70f8..000000000 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/AbstractGridSynchronizer.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.refinedmods.refinedstorage.common.grid; - -import com.refinedmods.refinedstorage.common.api.grid.GridSynchronizer; -import com.refinedmods.refinedstorage.common.support.TextureIds; - -import net.minecraft.resources.ResourceLocation; - -public abstract class AbstractGridSynchronizer implements GridSynchronizer { - @Override - public ResourceLocation getTextureIdentifier() { - return TextureIds.SIDE_BUTTON_ICONS; - } - - @Override - public int getYTexture() { - return 96; - } -} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/NoopGridSynchronizer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/NoopGridSynchronizer.java index 92accb73c..556b9f591 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/NoopGridSynchronizer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/NoopGridSynchronizer.java @@ -1,17 +1,28 @@ package com.refinedmods.refinedstorage.common.grid; +import com.refinedmods.refinedstorage.common.api.grid.GridSynchronizer; + import javax.annotation.Nullable; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; +import org.apiguardian.api.API; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; -public class NoopGridSynchronizer extends AbstractGridSynchronizer { +public class NoopGridSynchronizer implements GridSynchronizer { public static final NoopGridSynchronizer INSTANCE = new NoopGridSynchronizer(); + @API(status = API.Status.INTERNAL) + public static final ResourceLocation ON = createIdentifier("widget/side_button/grid/synchronization_mode/on"); + @API(status = API.Status.INTERNAL) + public static final ResourceLocation ON_TWO_WAY = + createIdentifier("widget/side_button/grid/synchronization_mode/on_two_way"); - private static final MutableComponent TITLE = createTranslation("gui", "grid.synchronizer.off"); - private static final Component HELP = createTranslation("gui", "grid.synchronizer.off.help"); + private static final MutableComponent TITLE = createTranslation("gui", "grid.synchronization_mode.off"); + private static final Component HELP = createTranslation("gui", "grid.synchronization_mode.off.help"); + private static final ResourceLocation OFF = createIdentifier("widget/side_button/grid/synchronization_mode/off"); private NoopGridSynchronizer() { } @@ -38,7 +49,7 @@ public String getTextToSynchronizeToGrid() { } @Override - public int getXTexture() { - return 64; + public ResourceLocation getSprite() { + return OFF; } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/AbstractGridScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/AbstractGridScreen.java index 27556d7d2..d6330c212 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/AbstractGridScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/AbstractGridScreen.java @@ -13,7 +13,7 @@ import com.refinedmods.refinedstorage.common.grid.NoopGridSynchronizer; import com.refinedmods.refinedstorage.common.grid.view.ItemGridResource; import com.refinedmods.refinedstorage.common.support.ResourceSlotRendering; -import com.refinedmods.refinedstorage.common.support.TextureIds; +import com.refinedmods.refinedstorage.common.support.Sprites; import com.refinedmods.refinedstorage.common.support.containermenu.DisabledSlot; import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; import com.refinedmods.refinedstorage.common.support.resource.ItemResource; @@ -45,7 +45,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static com.refinedmods.refinedstorage.common.support.TextureIds.SEARCH_SIZE; +import static com.refinedmods.refinedstorage.common.support.Sprites.SEARCH_SIZE; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; import static java.util.Objects.requireNonNullElse; @@ -55,7 +55,7 @@ public abstract class AbstractGridScreen ex private static final Logger LOGGER = LoggerFactory.getLogger(AbstractGridScreen.class); - private static final ResourceLocation ROW_TEXTURE = createIdentifier("grid_row"); + private static final ResourceLocation ROW_SPRITE = createIdentifier("grid_row"); private static final int MODIFIED_JUST_NOW_MAX_SECONDS = 10; private static final int COLUMNS = 9; private static final int DISABLED_SLOT_COLOR = 0xFF5B5B5B; @@ -116,7 +116,7 @@ protected void init(final int rows) { .stream() .allMatch(synchronizer -> synchronizer == NoopGridSynchronizer.INSTANCE); if (!onlyHasNoopSynchronizer) { - addSideButton(new SynchronizationSideButtonWidget(getMenu())); + addSideButton(new SynchronizationModeSideButtonWidget(getMenu())); searchField.addListener(this::trySynchronizeFromGrid); } } @@ -158,7 +158,7 @@ private boolean isOverStorageArea(final int mouseX, final int mouseY) { @Override protected void renderBg(final GuiGraphics graphics, final float delta, final int mouseX, final int mouseY) { super.renderBg(graphics, delta, mouseX, mouseY); - graphics.blitSprite(TextureIds.SEARCH, leftPos + 79, topPos + 5, SEARCH_SIZE, SEARCH_SIZE); + graphics.blitSprite(Sprites.SEARCH, leftPos + 79, topPos + 5, SEARCH_SIZE, SEARCH_SIZE); } @Override @@ -228,7 +228,7 @@ private void renderRow(final GuiGraphics graphics, final int rowX, final int rowY, final int row) { - graphics.blitSprite(ROW_TEXTURE, rowX, rowY, 162, ROW_SIZE); + graphics.blitSprite(ROW_SPRITE, rowX, rowY, 162, ROW_SIZE); for (int column = 0; column < COLUMNS; ++column) { renderCell(graphics, mouseX, mouseY, rowX, rowY, (row * COLUMNS) + column, column); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/AutoSelectedSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/AutoSelectedSideButtonWidget.java index 754bb73e2..43796c69a 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/AutoSelectedSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/AutoSelectedSideButtonWidget.java @@ -2,16 +2,19 @@ import com.refinedmods.refinedstorage.common.grid.AbstractGridContainerMenu; import com.refinedmods.refinedstorage.common.support.widget.AbstractSideButtonWidget; +import com.refinedmods.refinedstorage.common.util.IdentifierUtil; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; -import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.NO; -import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.YES; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; class AutoSelectedSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "grid.auto_selected"); + private static final ResourceLocation YES = createIdentifier("widget/side_button/grid/autoselected/yes"); + private static final ResourceLocation NO = createIdentifier("widget/side_button/grid/autoselected/no"); private static final Component HELP = createTranslation("gui", "grid.auto_selected.help"); private final AbstractGridContainerMenu menu; @@ -26,13 +29,8 @@ private static OnPress createPressAction(final AbstractGridContainerMenu menu) { } @Override - protected int getXTexture() { - return menu.isAutoSelected() ? 16 : 0; - } - - @Override - protected int getYTexture() { - return 96; + protected ResourceLocation getSprite() { + return menu.isAutoSelected() ? YES : NO; } @Override @@ -42,7 +40,7 @@ protected MutableComponent getTitle() { @Override protected MutableComponent getSubText() { - return menu.isAutoSelected() ? YES : NO; + return menu.isAutoSelected() ? IdentifierUtil.YES : IdentifierUtil.NO; } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/ResourceTypeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/ResourceTypeSideButtonWidget.java index 66740f31d..ec3c078c0 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/ResourceTypeSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/ResourceTypeSideButtonWidget.java @@ -2,19 +2,20 @@ import com.refinedmods.refinedstorage.common.api.support.resource.ResourceType; import com.refinedmods.refinedstorage.common.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage.common.support.TextureIds; import com.refinedmods.refinedstorage.common.support.widget.AbstractSideButtonWidget; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.resources.ResourceLocation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; class ResourceTypeSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "grid.resource_type"); private static final MutableComponent SUBTEXT_ALL = createTranslation("gui", "grid.resource_type.all"); private static final Component HELP = createTranslation("gui", "grid.resource_type.help"); + private static final ResourceLocation ALL = createIdentifier("widget/side_button/resource_type/all"); private final AbstractGridContainerMenu menu; @@ -28,12 +29,12 @@ private static OnPress createPressAction(final AbstractGridContainerMenu menu) { } @Override - protected ResourceLocation getTextureIdentifier() { + protected ResourceLocation getSprite() { final ResourceType resourceType = menu.getResourceType(); if (resourceType == null) { - return TextureIds.SIDE_BUTTON_ICONS; + return ALL; } - return resourceType.getTextureIdentifier(); + return resourceType.getSprite(); } @Override @@ -54,22 +55,4 @@ protected MutableComponent getSubText() { protected Component getHelpText() { return HELP; } - - @Override - protected int getXTexture() { - final ResourceType resourceType = menu.getResourceType(); - if (resourceType == null) { - return 32; - } - return resourceType.getXTexture(); - } - - @Override - protected int getYTexture() { - final ResourceType resourceType = menu.getResourceType(); - if (resourceType == null) { - return 128; - } - return resourceType.getYTexture(); - } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SortingDirectionSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SortingDirectionSideButtonWidget.java index d51967514..ccf8999da 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SortingDirectionSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SortingDirectionSideButtonWidget.java @@ -5,7 +5,9 @@ import com.refinedmods.refinedstorage.common.support.widget.AbstractSideButtonWidget; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; class SortingDirectionSideButtonWidget extends AbstractSideButtonWidget { @@ -14,6 +16,10 @@ class SortingDirectionSideButtonWidget extends AbstractSideButtonWidget { createTranslation("gui", "grid.sorting.direction.ascending"); private static final MutableComponent SUBTEXT_DESCENDING = createTranslation("gui", "grid.sorting.direction.descending"); + private static final ResourceLocation ASCENDING = + createIdentifier("widget/side_button/grid/sorting_direction/ascending"); + private static final ResourceLocation DESCENDING = + createIdentifier("widget/side_button/grid/sorting_direction/descending"); private final AbstractGridContainerMenu menu; @@ -33,13 +39,8 @@ private static GridSortingDirection toggle(final GridSortingDirection sortingDir } @Override - protected int getXTexture() { - return menu.getSortingDirection() == GridSortingDirection.ASCENDING ? 0 : 16; - } - - @Override - protected int getYTexture() { - return 16; + protected ResourceLocation getSprite() { + return menu.getSortingDirection() == GridSortingDirection.ASCENDING ? ASCENDING : DESCENDING; } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SortingTypeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SortingTypeSideButtonWidget.java index b3bfe2f28..8337db028 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SortingTypeSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SortingTypeSideButtonWidget.java @@ -5,7 +5,9 @@ import com.refinedmods.refinedstorage.common.support.widget.AbstractSideButtonWidget; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; class SortingTypeSideButtonWidget extends AbstractSideButtonWidget { @@ -15,6 +17,11 @@ class SortingTypeSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent SUBTEXT_ID = createTranslation("gui", "grid.sorting.type.id"); private static final MutableComponent SUBTEXT_LAST_MODIFIED = createTranslation("gui", "grid.sorting.type.last_modified"); + private static final ResourceLocation QUANTITY = createIdentifier("widget/side_button/grid/sorting_type/quantity"); + private static final ResourceLocation NAME = createIdentifier("widget/side_button/grid/sorting_type/name"); + private static final ResourceLocation ID = createIdentifier("widget/side_button/grid/sorting_type/id"); + private static final ResourceLocation LAST_MODIFIED = + createIdentifier("widget/side_button/grid/sorting_type/last_modified"); private final AbstractGridContainerMenu menu; @@ -37,20 +44,15 @@ private static GridSortingTypes toggle(final GridSortingTypes sortingType) { } @Override - protected int getXTexture() { + protected ResourceLocation getSprite() { return switch (menu.getSortingType()) { - case QUANTITY -> 0; - case NAME -> 16; - case ID -> 32; - case LAST_MODIFIED -> 48; + case QUANTITY -> QUANTITY; + case NAME -> NAME; + case ID -> ID; + case LAST_MODIFIED -> LAST_MODIFIED; }; } - @Override - protected int getYTexture() { - return menu.getSortingType() == GridSortingTypes.LAST_MODIFIED ? 48 : 32; - } - @Override protected MutableComponent getTitle() { return TITLE; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SynchronizationSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SynchronizationModeSideButtonWidget.java similarity index 68% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SynchronizationSideButtonWidget.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SynchronizationModeSideButtonWidget.java index e1a1b2522..3f811f5ca 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SynchronizationSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/SynchronizationModeSideButtonWidget.java @@ -9,12 +9,12 @@ import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; -class SynchronizationSideButtonWidget extends AbstractSideButtonWidget { - private static final MutableComponent TITLE = createTranslation("gui", "grid.synchronizer"); +class SynchronizationModeSideButtonWidget extends AbstractSideButtonWidget { + private static final MutableComponent TITLE = createTranslation("gui", "grid.synchronization_mode"); private final AbstractGridContainerMenu menu; - SynchronizationSideButtonWidget(final AbstractGridContainerMenu menu) { + SynchronizationModeSideButtonWidget(final AbstractGridContainerMenu menu) { super(createPressAction(menu)); this.menu = menu; } @@ -24,8 +24,8 @@ private static OnPress createPressAction(final AbstractGridContainerMenu menu) { } @Override - protected ResourceLocation getTextureIdentifier() { - return menu.getSynchronizer().getTextureIdentifier(); + protected ResourceLocation getSprite() { + return menu.getSynchronizer().getSprite(); } @Override @@ -42,14 +42,4 @@ protected MutableComponent getSubText() { protected Component getHelpText() { return menu.getSynchronizer().getHelpText(); } - - @Override - protected int getXTexture() { - return menu.getSynchronizer().getXTexture(); - } - - @Override - protected int getYTexture() { - return menu.getSynchronizer().getYTexture(); - } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterScreen.java index cbdcf1a19..0d18b7603 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterScreen.java @@ -9,8 +9,8 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -import static com.refinedmods.refinedstorage.common.support.TextureIds.WARNING; -import static com.refinedmods.refinedstorage.common.support.TextureIds.WARNING_SIZE; +import static com.refinedmods.refinedstorage.common.support.Sprites.WARNING; +import static com.refinedmods.refinedstorage.common.support.Sprites.WARNING_SIZE; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public class NetworkTransmitterScreen extends AbstractBaseScreen { diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassEnergySideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassEnergySideButtonWidget.java index 177a22d92..ff223bb27 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassEnergySideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassEnergySideButtonWidget.java @@ -7,25 +7,19 @@ import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; class RelayPassEnergySideButtonWidget extends AbstractYesNoSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "relay.pass_energy"); private static final MutableComponent HELP = createTranslation("gui", "relay.pass_energy.help"); + private static final ResourceLocation YES = createIdentifier("widget/side_button/relay/pass_energy/yes"); + private static final ResourceLocation NO = createIdentifier("widget/side_button/relay/pass_energy/no"); RelayPassEnergySideButtonWidget(final ClientProperty property) { - super(property, TITLE); - } - - @Override - protected int getXTexture() { - return Boolean.TRUE.equals(property.getValue()) ? 128 : 144; - } - - @Override - protected int getYTexture() { - return 0; + super(property, TITLE, YES, NO); } @Nullable diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassSecuritySideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassSecuritySideButtonWidget.java index 0c920d309..475d1b10e 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassSecuritySideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassSecuritySideButtonWidget.java @@ -7,25 +7,19 @@ import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; class RelayPassSecuritySideButtonWidget extends AbstractYesNoSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "relay.pass_security"); private static final MutableComponent HELP = createTranslation("gui", "relay.pass_security.help"); + private static final ResourceLocation YES = createIdentifier("widget/side_button/relay/pass_security/yes"); + private static final ResourceLocation NO = createIdentifier("widget/side_button/relay/pass_security/no"); RelayPassSecuritySideButtonWidget(final ClientProperty property) { - super(property, TITLE); - } - - @Override - protected int getXTexture() { - return Boolean.TRUE.equals(property.getValue()) ? 128 : 144; - } - - @Override - protected int getYTexture() { - return 32; + super(property, TITLE, YES, NO); } @Nullable diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassStorageSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassStorageSideButtonWidget.java index a472a33a0..4213785c3 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassStorageSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassStorageSideButtonWidget.java @@ -7,25 +7,19 @@ import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; class RelayPassStorageSideButtonWidget extends AbstractYesNoSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "relay.pass_storage"); private static final MutableComponent HELP = createTranslation("gui", "relay.pass_storage.help"); + private static final ResourceLocation YES = createIdentifier("widget/side_button/relay/pass_storage/yes"); + private static final ResourceLocation NO = createIdentifier("widget/side_button/relay/pass_storage/no"); RelayPassStorageSideButtonWidget(final ClientProperty property) { - super(property, TITLE); - } - - @Override - protected int getXTexture() { - return Boolean.TRUE.equals(property.getValue()) ? 128 : 144; - } - - @Override - protected int getYTexture() { - return 16; + super(property, TITLE, YES, NO); } @Nullable diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassThroughSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassThroughSideButtonWidget.java index dde6d2149..ef6ae923a 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassThroughSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayPassThroughSideButtonWidget.java @@ -7,25 +7,19 @@ import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; class RelayPassThroughSideButtonWidget extends AbstractYesNoSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "relay.pass_through"); private static final MutableComponent HELP = createTranslation("gui", "relay.pass_through.help"); + private static final ResourceLocation YES = createIdentifier("widget/side_button/relay/pass_through/yes"); + private static final ResourceLocation NO = createIdentifier("widget/side_button/relay/pass_through/no"); RelayPassThroughSideButtonWidget(final ClientProperty property) { - super(property, TITLE); - } - - @Override - protected int getXTexture() { - return Boolean.TRUE.equals(property.getValue()) ? 96 : 112; - } - - @Override - protected int getYTexture() { - return 0; + super(property, TITLE, YES, NO); } @Nullable diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AccessModeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AccessModeSideButtonWidget.java index 3692dde22..54ea2f77b 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AccessModeSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AccessModeSideButtonWidget.java @@ -6,7 +6,9 @@ import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class AccessModeSideButtonWidget extends AbstractSideButtonWidget { @@ -21,6 +23,10 @@ public class AccessModeSideButtonWidget extends AbstractSideButtonWidget { createTranslation("gui", "access_mode.extract.help"); private static final Component HELP_INSERT_EXTRACT = createTranslation("gui", "access_mode.insert_extract.help"); + private static final ResourceLocation INSERT = createIdentifier("widget/side_button/storage/access_mode/insert"); + private static final ResourceLocation EXTRACT = createIdentifier("widget/side_button/storage/access_mode/extract"); + private static final ResourceLocation INSERT_EXTRACT = + createIdentifier("widget/side_button/storage/access_mode/insert_extract"); private final ClientProperty property; @@ -42,19 +48,14 @@ private static AccessMode toggle(final AccessMode accessMode) { } @Override - protected int getXTexture() { + protected ResourceLocation getSprite() { return switch (property.getValue()) { - case INSERT_EXTRACT -> 0; - case INSERT -> 16; - case EXTRACT -> 32; + case INSERT_EXTRACT -> INSERT_EXTRACT; + case INSERT -> INSERT; + case EXTRACT -> EXTRACT; }; } - @Override - protected int getYTexture() { - return 240; - } - @Override protected MutableComponent getTitle() { return TITLE; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/FilterModeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/FilterModeSideButtonWidget.java index c67ebc4ae..3fe64c6fe 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/FilterModeSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/FilterModeSideButtonWidget.java @@ -6,7 +6,9 @@ import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class FilterModeSideButtonWidget extends AbstractSideButtonWidget { @@ -14,6 +16,8 @@ public class FilterModeSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent SUBTEXT_BLOCK = createTranslation("gui", "filter_mode.block"); private static final MutableComponent SUBTEXT_ALLOW = createTranslation("gui", "filter_mode.allow"); private static final Component FILTER_MODE_WARNING = createTranslation("gui", "storage.filter_mode.empty_warning"); + private static final ResourceLocation ALLOW = createIdentifier("widget/side_button/storage/filter_mode/allow"); + private static final ResourceLocation BLOCK = createIdentifier("widget/side_button/storage/filter_mode/block"); private final ClientProperty property; private final Component helpAllow; @@ -45,13 +49,8 @@ private static FilterMode toggle(final FilterMode filterMode) { } @Override - protected int getXTexture() { - return property.getValue() == FilterMode.BLOCK ? 16 : 0; - } - - @Override - protected int getYTexture() { - return 64; + protected ResourceLocation getSprite() { + return property.getValue() == FilterMode.BLOCK ? BLOCK : ALLOW; } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/PrioritySideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/PrioritySideButtonWidget.java index b8be92e20..f55e3874e 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/PrioritySideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/PrioritySideButtonWidget.java @@ -8,13 +8,16 @@ import net.minecraft.client.gui.screens.Screen; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class PrioritySideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "priority"); private static final Component HELP = createTranslation("gui", "priority.storage_help"); + private static final ResourceLocation SPRITE = createIdentifier("widget/side_button/priority"); private final ClientProperty property; @@ -32,13 +35,8 @@ private static OnPress createPressAction(final ClientProperty property, } @Override - protected int getXTexture() { - return 0; - } - - @Override - protected int getYTexture() { - return 208; + protected ResourceLocation getSprite() { + return SPRITE; } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/VoidExcessSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/VoidExcessSideButtonWidget.java index 20a3174b6..294a06ae6 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/VoidExcessSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/VoidExcessSideButtonWidget.java @@ -6,7 +6,10 @@ import javax.annotation.Nullable; import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class VoidExcessSideButtonWidget extends AbstractYesNoSideButtonWidget { @@ -15,9 +18,12 @@ public class VoidExcessSideButtonWidget extends AbstractYesNoSideButtonWidget { "gui", "void_excess.allowlist_warning" ); + private static final MutableComponent TITLE = createTranslation("gui", "void_excess"); + private static final ResourceLocation YES = createIdentifier("widget/side_button/storage/void_excess/yes"); + private static final ResourceLocation NO = createIdentifier("widget/side_button/storage/void_excess/no"); public VoidExcessSideButtonWidget(final ClientProperty property) { - super(property, createTranslation("gui", "void_excess")); + super(property, TITLE, YES, NO); } public void setWarningVisible(final boolean visible) { @@ -28,16 +34,6 @@ public void setWarningVisible(final boolean visible) { } } - @Override - protected int getXTexture() { - return Boolean.TRUE.equals(property.getValue()) ? 16 : 0; - } - - @Override - protected int getYTexture() { - return 240 - 15; - } - @Override @Nullable protected Component getHelpText() { diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/TransferModeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/TransferModeSideButtonWidget.java index f497c1db6..c7de37a81 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/TransferModeSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/TransferModeSideButtonWidget.java @@ -6,7 +6,9 @@ import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; class TransferModeSideButtonWidget extends AbstractSideButtonWidget { @@ -19,6 +21,10 @@ class TransferModeSideButtonWidget extends AbstractSideButtonWidget { createTranslation("gui", "disk_interface.transfer_mode.insert_into_network.help"); private static final Component HELP_EXTRACT_FROM_NETWORK = createTranslation("gui", "disk_interface.transfer_mode.extract_from_network.help"); + private static final ResourceLocation INSERT_INTO_NETWORK = + createIdentifier("widget/side_button/disk_interface_transfer_mode/insert_into_network"); + private static final ResourceLocation EXTRACT_FROM_NETWORK = + createIdentifier("widget/side_button/disk_interface_transfer_mode/extract_from_network"); private final ClientProperty property; @@ -39,18 +45,13 @@ private static StorageTransferMode toggle(final StorageTransferMode accessMode) } @Override - protected int getXTexture() { + protected ResourceLocation getSprite() { return switch (property.getValue()) { - case INSERT_INTO_NETWORK -> 16; - case EXTRACT_FROM_NETWORK -> 0; + case INSERT_INTO_NETWORK -> INSERT_INTO_NETWORK; + case EXTRACT_FROM_NETWORK -> EXTRACT_FROM_NETWORK; }; } - @Override - protected int getYTexture() { - return 160; - } - @Override protected MutableComponent getTitle() { return TITLE; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/TextureIds.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/Sprites.java similarity index 80% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/TextureIds.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/Sprites.java index 00a2bb383..0acc1419b 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/TextureIds.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/Sprites.java @@ -4,8 +4,7 @@ import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; -public final class TextureIds { - public static final ResourceLocation SIDE_BUTTON_ICONS = createIdentifier("textures/side_button_icons.png"); +public final class Sprites { public static final ResourceLocation LIGHT_ARROW = createIdentifier("light_arrow"); public static final ResourceLocation SLOT = createIdentifier("slot"); public static final int LIGHT_ARROW_WIDTH = 22; @@ -15,6 +14,6 @@ public final class TextureIds { public static final ResourceLocation SEARCH = createIdentifier("search"); public static final int SEARCH_SIZE = 12; - private TextureIds() { + private Sprites() { } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceType.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceType.java index acfbf46b4..dc1bb66c3 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceType.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceType.java @@ -7,28 +7,23 @@ import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.root.RootStorage; import com.refinedmods.refinedstorage.common.Platform; -import com.refinedmods.refinedstorage.common.api.support.resource.AbstractResourceType; import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.common.support.TextureIds; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceType; import java.util.Optional; import com.mojang.serialization.MapCodec; import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.chat.MutableComponent; import net.minecraft.network.codec.StreamCodec; +import net.minecraft.resources.ResourceLocation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; -class FluidResourceType extends AbstractResourceType { - FluidResourceType() { - super( - "FLUID", - createTranslation("misc", "resource_type.fluid"), - TextureIds.SIDE_BUTTON_ICONS, - 16, - 128 - ); - } +class FluidResourceType implements ResourceType { + private static final MutableComponent TITLE = createTranslation("misc", "resource_type.fluid"); + private static final ResourceLocation SPRITE = createIdentifier("widget/side_button/resource_type/fluid"); @Override public Optional toGridResource(final ResourceKey resource) { @@ -71,4 +66,14 @@ public MapCodec getMapCodec() { public StreamCodec getStreamCodec() { return (StreamCodec) ResourceCodecs.FLUID_STREAM_CODEC; } + + @Override + public MutableComponent getTitle() { + return TITLE; + } + + @Override + public ResourceLocation getSprite() { + return SPRITE; + } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResourceType.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResourceType.java index be6006f86..6c32328e0 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResourceType.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResourceType.java @@ -7,28 +7,23 @@ import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.root.RootStorage; import com.refinedmods.refinedstorage.common.Platform; -import com.refinedmods.refinedstorage.common.api.support.resource.AbstractResourceType; import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.common.support.TextureIds; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceType; import java.util.Optional; import com.mojang.serialization.MapCodec; import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.chat.MutableComponent; import net.minecraft.network.codec.StreamCodec; +import net.minecraft.resources.ResourceLocation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; -class ItemResourceType extends AbstractResourceType { - ItemResourceType() { - super( - "ITEM", - createTranslation("misc", "resource_type.item"), - TextureIds.SIDE_BUTTON_ICONS, - 0, - 128 - ); - } +class ItemResourceType implements ResourceType { + private static final MutableComponent TITLE = createTranslation("misc", "resource_type.item"); + private static final ResourceLocation SPRITE = createIdentifier("widget/side_button/resource_type/item"); @Override public Optional toGridResource(final ResourceKey resource) { @@ -73,4 +68,19 @@ public MapCodec getMapCodec() { public StreamCodec getStreamCodec() { return (StreamCodec) ResourceCodecs.ITEM_STREAM_CODEC; } + + @Override + public MutableComponent getTitle() { + return TITLE; + } + + @Override + public ResourceLocation getSprite() { + return SPRITE; + } + + @Override + public String toString() { + return "ITEM"; + } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/ScreenSizeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/ScreenSizeSideButtonWidget.java index dccbbeb9c..168e523d8 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/ScreenSizeSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/stretching/ScreenSizeSideButtonWidget.java @@ -4,17 +4,22 @@ import com.refinedmods.refinedstorage.common.support.widget.AbstractSideButtonWidget; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class ScreenSizeSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "screen_size"); - private static final MutableComponent SUBTEXT_STRETCH = createTranslation("gui", "screen_size.stretch"); private static final MutableComponent SUBTEXT_SMALL = createTranslation("gui", "screen_size.small"); private static final MutableComponent SUBTEXT_MEDIUM = createTranslation("gui", "screen_size.medium"); private static final MutableComponent SUBTEXT_LARGE = createTranslation("gui", "screen_size.large"); private static final MutableComponent SUBTEXT_EXTRA_LARGE = createTranslation("gui", "screen_size.extra_large"); + private static final ResourceLocation STRETCH = createIdentifier("widget/side_button/screen_size/stretch"); + private static final ResourceLocation SMALL = createIdentifier("widget/side_button/screen_size/small"); + private static final ResourceLocation MEDIUM = createIdentifier("widget/side_button/screen_size/medium"); + private static final ResourceLocation EXTRA_LARGE = createIdentifier("widget/side_button/screen_size/extra_large"); public ScreenSizeSideButtonWidget(final AbstractStretchingScreen stretchingScreen) { super(createPressAction(stretchingScreen)); @@ -28,21 +33,16 @@ private static OnPress createPressAction(final AbstractStretchingScreen stret } @Override - protected int getXTexture() { + protected ResourceLocation getSprite() { final ScreenSize screenSize = Platform.INSTANCE.getConfig().getScreenSize(); return switch (screenSize) { - case STRETCH -> 64 + 48; - case SMALL -> 64; - case MEDIUM -> 64 + 16; - case LARGE, EXTRA_LARGE -> 64 + 32; + case STRETCH -> STRETCH; + case SMALL -> SMALL; + case MEDIUM -> MEDIUM; + case LARGE, EXTRA_LARGE -> EXTRA_LARGE; }; } - @Override - protected int getYTexture() { - return 64; - } - @Override protected MutableComponent getTitle() { return TITLE; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/HelpClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/HelpClientTooltipComponent.java index e6f13f107..4fde25b56 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/HelpClientTooltipComponent.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/HelpClientTooltipComponent.java @@ -19,7 +19,7 @@ import static net.minecraft.client.gui.screens.Screen.hasShiftDown; public class HelpClientTooltipComponent implements ClientTooltipComponent { - private static final ResourceLocation TEXTURE = createIdentifier("help"); + private static final ResourceLocation SPRITE = createIdentifier("help"); private static final ClientTooltipComponent PRESS_SHIFT_FOR_HELP = new SmallTextClientTooltipComponent( createTranslationAsHeading("misc", "press_shift_for_help") ); @@ -77,7 +77,7 @@ public void renderText(final Font font, @Override public void renderImage(final Font font, final int x, final int y, final GuiGraphics graphics) { - graphics.blitSprite(TEXTURE, x, y + 2, 20, 20); + graphics.blitSprite(SPRITE, x, y + 2, 20, 20); } public static ClientTooltipComponent create(final Component text) { diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/MouseClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/MouseClientTooltipComponent.java index a835b7643..bdcd74adb 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/MouseClientTooltipComponent.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/MouseClientTooltipComponent.java @@ -15,9 +15,9 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; -import static com.refinedmods.refinedstorage.common.support.TextureIds.LIGHT_ARROW; -import static com.refinedmods.refinedstorage.common.support.TextureIds.LIGHT_ARROW_HEIGHT; -import static com.refinedmods.refinedstorage.common.support.TextureIds.LIGHT_ARROW_WIDTH; +import static com.refinedmods.refinedstorage.common.support.Sprites.LIGHT_ARROW; +import static com.refinedmods.refinedstorage.common.support.Sprites.LIGHT_ARROW_HEIGHT; +import static com.refinedmods.refinedstorage.common.support.Sprites.LIGHT_ARROW_WIDTH; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public class MouseClientTooltipComponent implements ClientTooltipComponent { diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/AbstractSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/AbstractSideButtonWidget.java index 4eae21cc4..55b159c29 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/AbstractSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/AbstractSideButtonWidget.java @@ -1,7 +1,6 @@ package com.refinedmods.refinedstorage.common.support.widget; import com.refinedmods.refinedstorage.common.support.AbstractBaseScreen; -import com.refinedmods.refinedstorage.common.support.TextureIds; import com.refinedmods.refinedstorage.common.support.tooltip.HelpClientTooltipComponent; import com.refinedmods.refinedstorage.common.support.tooltip.SmallTextClientTooltipComponent; @@ -21,32 +20,26 @@ import net.minecraft.resources.ResourceLocation; import org.lwjgl.opengl.GL11; -import static com.refinedmods.refinedstorage.common.support.TextureIds.WARNING; -import static com.refinedmods.refinedstorage.common.support.TextureIds.WARNING_SIZE; +import static com.refinedmods.refinedstorage.common.support.Sprites.WARNING; +import static com.refinedmods.refinedstorage.common.support.Sprites.WARNING_SIZE; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public abstract class AbstractSideButtonWidget extends Button { - private static final ResourceLocation TEXTURE = createIdentifier("widget/side_button"); - private static final ResourceLocation HOVERED_TEXTURE = createIdentifier("widget/side_button_hovered"); - private static final ResourceLocation HOVER_OVERLAY_TEXTURE = createIdentifier("widget/side_button_hover_overlay"); + private static final ResourceLocation SPRITE = createIdentifier("widget/side_button/base"); + private static final ResourceLocation HOVERED_SPRITE = createIdentifier("widget/side_button/hovered"); + private static final ResourceLocation HOVER_OVERLAY_SPRITE = createIdentifier("widget/side_button/hover_overlay"); - private static final int WIDTH = 18; - private static final int HEIGHT = 18; + private static final int SIZE = 18; + private static final int ICON_SIZE = 16; @Nullable private ClientTooltipComponent warning; protected AbstractSideButtonWidget(final OnPress pressAction) { - super(-1, -1, WIDTH, HEIGHT, Component.empty(), pressAction, DEFAULT_NARRATION); + super(-1, -1, SIZE, SIZE, Component.empty(), pressAction, DEFAULT_NARRATION); } - protected abstract int getXTexture(); - - protected abstract int getYTexture(); - - protected ResourceLocation getTextureIdentifier() { - return TextureIds.SIDE_BUTTON_ICONS; - } + protected abstract ResourceLocation getSprite(); public void setWarning(@Nullable final Component text) { if (text == null) { @@ -58,21 +51,19 @@ public void setWarning(@Nullable final Component text) { @Override public void renderWidget(final GuiGraphics graphics, final int mouseX, final int mouseY, final float partialTicks) { - graphics.blitSprite(isHovered ? HOVERED_TEXTURE : TEXTURE, getX(), getY(), WIDTH, HEIGHT); - graphics.blit( - getTextureIdentifier(), + graphics.blitSprite(isHovered ? HOVERED_SPRITE : SPRITE, getX(), getY(), SIZE, SIZE); + graphics.blitSprite( + getSprite(), getX() + 1, getY() + 1, - getXTexture(), - getYTexture(), - WIDTH - 2, - HEIGHT - 2 + ICON_SIZE, + ICON_SIZE ); if (isHovered) { RenderSystem.enableBlend(); RenderSystem.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); RenderSystem.setShaderColor(1.0f, 1.0f, 1.0f, 0.5f); - graphics.blitSprite(HOVER_OVERLAY_TEXTURE, getX(), getY(), WIDTH, HEIGHT); + graphics.blitSprite(HOVER_OVERLAY_SPRITE, getX(), getY(), SIZE, SIZE); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.disableBlend(); final Screen screen = Minecraft.getInstance().screen; @@ -90,8 +81,8 @@ private void renderWarning(final GuiGraphics graphics) { graphics.pose().translate(0, 0, 200); graphics.blitSprite( WARNING, - getX() + WIDTH - WARNING_SIZE + 2, - getY() + HEIGHT - WARNING_SIZE + 2, + getX() + SIZE - WARNING_SIZE + 2, + getY() + SIZE - WARNING_SIZE + 2, WARNING_SIZE, WARNING_SIZE ); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/AbstractYesNoSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/AbstractYesNoSideButtonWidget.java index 8aa44b9be..eb1d5ee19 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/AbstractYesNoSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/AbstractYesNoSideButtonWidget.java @@ -3,24 +3,37 @@ import com.refinedmods.refinedstorage.common.support.containermenu.ClientProperty; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.NO; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.YES; public abstract class AbstractYesNoSideButtonWidget extends AbstractSideButtonWidget { - protected final ClientProperty property; + private final ClientProperty property; private final MutableComponent title; + private final ResourceLocation yesSprite; + private final ResourceLocation noSprite; - protected AbstractYesNoSideButtonWidget(final ClientProperty property, final MutableComponent title) { + protected AbstractYesNoSideButtonWidget(final ClientProperty property, + final MutableComponent title, + final ResourceLocation yesSprite, + final ResourceLocation noSprite) { super(createPressAction(property)); this.property = property; this.title = title; + this.yesSprite = yesSprite; + this.noSprite = noSprite; } private static OnPress createPressAction(final ClientProperty property) { return btn -> property.setValue(!property.getValue()); } + @Override + protected ResourceLocation getSprite() { + return Boolean.TRUE.equals(property.getValue()) ? yesSprite : noSprite; + } + @Override protected MutableComponent getTitle() { return title; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/FuzzyModeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/FuzzyModeSideButtonWidget.java index 5beb1160e..f8ed65a81 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/FuzzyModeSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/FuzzyModeSideButtonWidget.java @@ -6,13 +6,17 @@ import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class FuzzyModeSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "fuzzy_mode"); private static final MutableComponent SUBTEXT_ON = createTranslation("gui", "fuzzy_mode.on"); private static final MutableComponent SUBTEXT_OFF = createTranslation("gui", "fuzzy_mode.off"); + private static final ResourceLocation ON = createIdentifier("widget/side_button/fuzzy_mode/on"); + private static final ResourceLocation OFF = createIdentifier("widget/side_button/fuzzy_mode/off"); private final ClientProperty property; private final Supplier typeSupplier; @@ -28,13 +32,8 @@ private static OnPress createPressAction(final ClientProperty property) } @Override - protected int getXTexture() { - return Boolean.TRUE.equals(property.getValue()) ? 16 : 0; - } - - @Override - protected int getYTexture() { - return 192; + protected ResourceLocation getSprite() { + return Boolean.TRUE.equals(property.getValue()) ? ON : OFF; } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/ProgressWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/ProgressWidget.java index 59937b74f..aa50a0374 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/ProgressWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/ProgressWidget.java @@ -15,7 +15,7 @@ import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; public class ProgressWidget extends AbstractWidget { - private static final ResourceLocation TEXTURE = createIdentifier("widget/progress_bar"); + private static final ResourceLocation SPRITE = createIdentifier("widget/progress_bar"); private final DoubleSupplier progressSupplier; private final Supplier> tooltipSupplier; @@ -42,7 +42,7 @@ public void renderWidget(final GuiGraphics graphics, final int mouseX, final int final int correctedY = getY() + height - correctedHeight; final int u = 0; final int v = height - correctedHeight; - graphics.blitSprite(TEXTURE, 16, 70, u, v, getX(), correctedY, width, correctedHeight); + graphics.blitSprite(SPRITE, 16, 70, u, v, getX(), correctedY, width, correctedHeight); if (isHovered) { graphics.renderComponentTooltip(Minecraft.getInstance().font, tooltipSupplier.get(), mouseX, mouseY); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/RedstoneModeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/RedstoneModeSideButtonWidget.java index ebe96e777..d24739d26 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/RedstoneModeSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/RedstoneModeSideButtonWidget.java @@ -7,7 +7,9 @@ import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class RedstoneModeSideButtonWidget extends AbstractSideButtonWidget { @@ -18,6 +20,9 @@ public class RedstoneModeSideButtonWidget extends AbstractSideButtonWidget { private static final Component HELP_IGNORE = createTranslation("gui", "redstone_mode.ignore.help"); private static final Component HELP_HIGH = createTranslation("gui", "redstone_mode.high.help"); private static final Component HELP_LOW = createTranslation("gui", "redstone_mode.low.help"); + private static final ResourceLocation IGNORE = createIdentifier("widget/side_button/redstone_mode/ignore"); + private static final ResourceLocation HIGH = createIdentifier("widget/side_button/redstone_mode/high"); + private static final ResourceLocation LOW = createIdentifier("widget/side_button/redstone_mode/low"); private final ClientProperty property; private final Component helpIgnore; @@ -42,19 +47,14 @@ private static OnPress createPressAction(final ClientProperty prop } @Override - protected int getXTexture() { + protected ResourceLocation getSprite() { return switch (property.getValue()) { - case IGNORE -> 0; - case HIGH -> 16; - case LOW -> 32; + case IGNORE -> IGNORE; + case HIGH -> HIGH; + case LOW -> LOW; }; } - @Override - protected int getYTexture() { - return 0; - } - @Override protected MutableComponent getTitle() { return TITLE; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/SchedulingModeSideButtonWidget.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/SchedulingModeSideButtonWidget.java index ae54ec655..4127b10c3 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/SchedulingModeSideButtonWidget.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/widget/SchedulingModeSideButtonWidget.java @@ -5,11 +5,17 @@ import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class SchedulingModeSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "scheduling_mode"); + private static final ResourceLocation DEFAULT = createIdentifier("widget/side_button/scheduling_mode/default"); + private static final ResourceLocation ROUND_ROBIN = + createIdentifier("widget/side_button/scheduling_mode/round_robin"); + private static final ResourceLocation RANDOM = createIdentifier("widget/side_button/scheduling_mode/random"); private final ClientProperty property; @@ -31,19 +37,14 @@ private static SchedulingModeType toggle(final SchedulingModeType modeSettings) } @Override - protected int getXTexture() { + protected ResourceLocation getSprite() { return switch (property.getValue()) { - case DEFAULT -> 0; - case ROUND_ROBIN -> 16; - case RANDOM -> 32; + case DEFAULT -> DEFAULT; + case ROUND_ROBIN -> ROUND_ROBIN; + case RANDOM -> RANDOM; }; } - @Override - protected int getYTexture() { - return 144; - } - @Override protected MutableComponent getTitle() { return TITLE; diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json index bc6c34463..0b27c5da6 100644 --- a/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json +++ b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json @@ -54,9 +54,9 @@ "gui.refinedstorage.grid.sorting.type.last_modified": "Last modified", "gui.refinedstorage.grid.auto_selected": "Auto-selected", "gui.refinedstorage.grid.auto_selected.help": "Whether to auto-select the search box when opening the Grid.", - "gui.refinedstorage.grid.synchronizer": "Synchronization mode", - "gui.refinedstorage.grid.synchronizer.off": "Off", - "gui.refinedstorage.grid.synchronizer.off.help": "Don't sync the search box text.", + "gui.refinedstorage.grid.synchronization_mode": "Synchronization mode", + "gui.refinedstorage.grid.synchronization_mode.off": "Off", + "gui.refinedstorage.grid.synchronization_mode.off.help": "Don't sync the search box text.", "gui.refinedstorage.grid.resource_type": "Resource type", "gui.refinedstorage.grid.resource_type.all": "All", "gui.refinedstorage.grid.resource_type.help": "Filter specific resource types.", diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/base.png similarity index 100% rename from refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/base.png diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/constructor_drop_items/no.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/constructor_drop_items/no.png new file mode 100644 index 0000000000000000000000000000000000000000..bcd2dde8315a0701d13bdb411582cc1e84a58d12 GIT binary patch literal 956 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*A8)5S4FBe=K6k&i)vNSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q$nT)5S4FBRDz1g?R^S0#A&Vghx2z5&<0!hj7O0%?mg<85pOqE)-~( bz@V(m&|t{$&RLq%1Qe*Au6{1-oD!Mu literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/destructor_pickup_items/no.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/destructor_pickup_items/no.png new file mode 100644 index 0000000000000000000000000000000000000000..5f770f86b26fc49178ec2ba5e1374bde24ea614a GIT binary patch literal 948 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q$nr)5S4FBRDz1h1rGMfPrxe>v9gx1=)@aGZ=gr^%y4z1}LsznbUup f$3j8nzzGh9s%Z>Q6W*v^0EMfktDnm{r-UW|PAM(* literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/destructor_pickup_items/yes.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/destructor_pickup_items/yes.png new file mode 100644 index 0000000000000000000000000000000000000000..a483d31d76cdba31d150defa2736f3eee7d887a9 GIT binary patch literal 947 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q$nb)5S4FBRDz1g?R^S0#6JR&kQDm1_6huhXfoLW>^R~L>6>SVAv(b eqM&l%1P4RiZiY9z6UtVBg4NU2&t;ucLK6T`%r1}s literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/detector_mode/above.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/detector_mode/above.png new file mode 100644 index 0000000000000000000000000000000000000000..bcd48687653e3460a17bb22312356352a55132d9 GIT binary patch literal 953 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*9*)5S4FBRDz1h4~1Vfx?kQrUF3?W<{puiAo$x0|e(Vy@-ym# kQvw%@fR2WO%7GIc3{@HoPn-AhZvh3ar>mdKI;Vst0CQR}2mk;8 literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/detector_mode/equal.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/detector_mode/equal.png new file mode 100644 index 0000000000000000000000000000000000000000..3d69127bcb2890234ea79acb2ff4e929022661cf GIT binary patch literal 933 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q$nN)5S4FBRDz1h53q5LIdL*CJlzw3?a;}X$u&fn0k5`O7Ah;oyKHo P4GKt4S3j3^P6NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*A0)5S4FBRDz1g?R~wfy0afMm7^h33)Y!=gzDGH8D&QQ4?GQycQ}I lFfQO|VVdmGFo8i?nW4&p;c0i&?}?z$^>p=fS?83{1OQLoF3A7@ literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/disk_interface_transfer_mode/extract_from_network.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/disk_interface_transfer_mode/extract_from_network.png new file mode 100644 index 0000000000000000000000000000000000000000..b723e78b979566223e224e1bfba38ab24b7421da GIT binary patch literal 950 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*9{)5S4FBRDz1h4~1#!2!ttE{+8{9Gq+dYEArtjao+xno}4x*blZv hHR*IRw6I7>GM0Q~xUFk-W)di5Jzf1=);T3K0RXVfE%pEa literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/disk_interface_transfer_mode/insert_into_network.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/disk_interface_transfer_mode/insert_into_network.png new file mode 100644 index 0000000000000000000000000000000000000000..74abcfa07151e0e0de0cbe273a3eb20dc263b21e GIT binary patch literal 953 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*9*)5S4FBRDz1h4~1#!2wBwSuTuh8V%eIt_nT|oMMfe6hwAOCa4KX k=P(HzV4c9I$mr(APFVdQ&MBb@05&f!=Kufz literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/fuzzy_mode/off.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/fuzzy_mode/off.png new file mode 100644 index 0000000000000000000000000000000000000000..7536ac3f1ba67f956334b74a9f1c06555b1ef595 GIT binary patch literal 952 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*A4)5S4FBRDz1h4~1l!2w1&#uW-a415cj1Q=2m201WNSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*9&)5S4FBe=IKT8Ke`gX#0X>3!`pzXn@0Z!&sxNnTNSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q$nn)5S4FBRDz1h1rGEK!LG?A%u@9fOW-6rYz-25(F{an^LB{Ts5Z8IwY literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/autoselected/yes.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/autoselected/yes.png new file mode 100644 index 0000000000000000000000000000000000000000..b7916189ba125ec0a0f34a22455153e2c9873fca GIT binary patch literal 959 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*9>)5S4FBe=KsA{T=K2lL(k|4TOPoVE9gCfD+ehmX8N6fPPUx)?f@ s%uib0n#G|m|7pqGm%Rx+N4*)i3xXIfiX^U20Gh(!>FVdQ&MBb@04k3;#sB~S literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/sorting_direction/ascending.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/sorting_direction/ascending.png new file mode 100644 index 0000000000000000000000000000000000000000..36c49fee0a20eb4ac21aef6e5951fdc4f136fdd4 GIT binary patch literal 943 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q$nX)5S4FBRDz1h4~1#!2!ttE{+8{9Gq+dYEArtjao+xn$4IB96TB( Z3Nn<1F+7w_IKL1Sq@J#RF6*2UngDTtE3g0n literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/sorting_direction/descending.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/sorting_direction/descending.png new file mode 100644 index 0000000000000000000000000000000000000000..45df9be63b12b03797a6a2a56956a3ab8f191b94 GIT binary patch literal 944 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q$nn)5S4FBRDz1h4~1#!2wBwS+AIQ0vN;_x*TRC2gTe~DWM4f^9nAZ literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/sorting_type/id.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/sorting_type/id.png new file mode 100644 index 0000000000000000000000000000000000000000..3c71ea5868a9874ab159497c1897d3f5035a6ef0 GIT binary patch literal 935 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q$nV)5S4FBRDz1g*ikxAt8Ywc?UyBi^3;X1726ADclA|Obj&v3@^3o RpZ9@+($m$?Wt~$(696*DDa8N) literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/sorting_type/last_modified.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/sorting_type/last_modified.png new file mode 100644 index 0000000000000000000000000000000000000000..072b35811b320a991f2a558a30c255eda5dfdd7d GIT binary patch literal 956 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*A8)5S4FBRDz1h1rGMfPryJt3u#R1u4Crsm+QFhZwmVJVF>18j2Sv mdE}I+O>ipK6mk$wNMT{9^k#VUnaijE6uzFWelF{r5}E+#H!t`A literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/sorting_type/name.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/sorting_type/name.png new file mode 100644 index 0000000000000000000000000000000000000000..3c8a25d3cb44dd3721c1f0f13002d5dfa3158ec1 GIT binary patch literal 947 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q$nb)5S4FBRDz1h53qb0z(jw1A{O_;X;!xh8TfWQfFGajU0ZSVDe~F eVm`$xA<0-B$?*KPE~7dqSUp|+T-G@yGywonRV|nR literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/sorting_type/quantity.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/sorting_type/quantity.png new file mode 100644 index 0000000000000000000000000000000000000000..db0e873a64c75da845a9e76cc6d9a95938a0118a GIT binary patch literal 937 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q$nR)5S4FBRDz1g*iloA&5h)gN2zx*e7Yl0RaUkZl(ae11C5b>IxX% TDjhw22o#u}u6{1-oD!MNSs56Z83KGlT&=9El9H0j%gccZM!{$ZjIc8pssIKS5B4MLGV$ zY=-rMWo$J%cC#5|6@>0GCf2MDiNSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q$nn)5S4FBRDz1g;|8d;DDsTEEh&LjRtN9R|OvfPO-*K3L?uE7C3BT bP*!HBmScEowB*!DP?&nU`njxgN@xNAlU^(s literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/synchronization_mode/on_two_way.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/grid/synchronization_mode/on_two_way.png new file mode 100644 index 0000000000000000000000000000000000000000..30d1523236b9e03c8ec0249a61fc2b588d785059 GIT binary patch literal 949 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*9%)5S4FBRDz1h4~3LgC+~N%OXyL1)K~&S1<{1DfMVEq&jMH$VW1q gb7EEDHZWphs4`%9`XgtV4JcqeUHx3vIVCg!08?Eo0{{R3 literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button_hover_overlay.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/hover_overlay.png similarity index 100% rename from refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button_hover_overlay.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/hover_overlay.png diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button_hovered.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/hovered.png similarity index 100% rename from refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button_hovered.png rename to refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/hovered.png diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/priority.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/priority.png new file mode 100644 index 0000000000000000000000000000000000000000..87a8ab9fdf3571d82f4c503e7e6053e827c13b6d GIT binary patch literal 954 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*A0)5S4FBRDz1h4~1lfdhvD17|~~1p`+j6VD99+x9 l_JGO2F~!qBLFK>+4uhU*hc1=fH<*VEO{Wt~$(699NSs56Z83KGlT&?w_ZS-Yq4P+gR6`V|!(t`}wGcf#RV3=I&GPTrgdb!7p3eWlV z0ss3M{@-Bu|9|@b|NntTje^k-7#<;Tykr3<&?iDAL4Lu&w2cZF9_`;R1eE10@Q5sC zVBk9p!i>lBSEK+1T|HeKLo|YWPkZt;7zi*sZacDu^Yj1nMVanO;vZ6@RL=_B{nzZm zpe3HP;=8odOoKJbi8sU!6`X5Hd>?uY*F<)78&qol`;+ E0Hp_F1ONa4 literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/redstone_mode/ignore.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/redstone_mode/ignore.png new file mode 100644 index 0000000000000000000000000000000000000000..92321bdd2a02e14ba0fefcea51f9178ed23b89a9 GIT binary patch literal 990 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlTs4)I^|iH3)YT32v<>xjY%Gi&EloU}Z9H9Uz1{4~%gccpN5NNSs56Z83KGlTs0UNES1Hq^`vd|Wo!*(BN!PSj1`!9 zF{8qBetiJYkWnxi0>dc;=FYLZ0Q8SQNswRge^kKmKsiuVc04mBLSZPRo?xygX5 oX@hZ-!Tag61X@G|SZ;HN@ULR$%dFd}1j?}tp00i_>zopr0BY7xGXMYp literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/relay/pass_energy/no.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/relay/pass_energy/no.png new file mode 100644 index 0000000000000000000000000000000000000000..bf8a591e323d4acab8db21ad882ede153b6025eb GIT binary patch literal 977 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9E%FD}vvZG)$1V&&8oaA{g0rWO=NswRg|NjivPw@h?2m@z< zM`SSr1K(i~W;~w1A_XYu?djqeq7j^XE?TTXfrBMr#$Wwil`1n$?GJ?ZiS_+)@@HD7 z!S;q_-7NMCGvzh9zKMOXC^y@{^JC(^?acc&H>R0#8*S#U+4t`p;{n#=2N=tHGxd@| OA@1qw=d#Wzp$P!&U_rD1 literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/relay/pass_energy/yes.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/relay/pass_energy/yes.png new file mode 100644 index 0000000000000000000000000000000000000000..09a73762cf42862d57c868a3f38a72681f4315fc GIT binary patch literal 959 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*9>)5S4FBY0|$BOikT$Kf0Q?RAA`w7CdZNxo%tek^?EVarL;Q`#qt rW%?b|-yiUuZ*%wAhaIv0uG|NhvI7`S22WaR3JPLRS3j3^P6NSs56Z83KGlT&=9E%FD}vvZG)$1V&&8oaA{g0rWO=NswRg|NjivPw@h?2m@z< zM`SSr1K(i~W;~w1A_XYu<>}%Wq7j^X&XJEnfrHuc#eaESZMW4M#V2#RI{ELLV9h&o z<02sk%Wk%VZ&-u*0^ZxQ>9YNmNyyxLokjP)qs7#RrRA;XGppq$ux-;}^l#Chr40&j MPgg&ebxsLQ0NDyX8~^|S literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/relay/pass_security/yes.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/relay/pass_security/yes.png new file mode 100644 index 0000000000000000000000000000000000000000..12320e47ef3e3bbf5e5f9e68da6ad9214f12def8 GIT binary patch literal 959 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*9>)5S4FBe=H5QHVi-gX!!4`F$*>3yt`=-#LDs<`~iP`JRbTYw9^C s`3dtqmNA41X?*(oc*YHBQ{Nr>aj^`mC*HPH0Gh(!>FVdQ&MBb@0Kh9ahX4Qo literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/relay/pass_storage/no.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/relay/pass_storage/no.png new file mode 100644 index 0000000000000000000000000000000000000000..8f69c275eafba1ea38eda5b526fe7136fa6e9ece GIT binary patch literal 978 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9E%FD}vvZG)$1V&&8oaA{g0rWO=NswRg|NjivPw@h?2m@z< zM`SSr1K(i~W;~w1A_XYug PK|${6>gTe~DWM4fCxk*~ literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/relay/pass_storage/yes.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/relay/pass_storage/yes.png new file mode 100644 index 0000000000000000000000000000000000000000..f3b3d6ac2cdb124e5807232d5f63328374260c1b GIT binary patch literal 959 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*9>)5S4FBe=BZA{T=J2h;2S^;HX&1?Z%e|J?A(^!_3px14Vmcf6DN rtaxI9qKG}qy4kNa1eA3brHkI>ub9E`P$jKM0u;oau6{1-oD!MNSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*9%)5S4FBRDz1h4~3LgC+~N%OXyL1)K~&S1<{1DfMVEq&jMH$VW1q gb7EEDHZWphs4`%9`XgtV4JcqeUHx3vIVCg!08?Eo0{{R3 literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/relay/pass_through/yes.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/relay/pass_through/yes.png new file mode 100644 index 0000000000000000000000000000000000000000..255123522dd04ed9b1d03abadf2d99eb81816a29 GIT binary patch literal 975 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9El9H0j%gccZM!{$ZjIc8pssIKS5B4MLGV$ zY=-rMWo$J%cC#5|6@>0GCf2MDiNSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*9@)5S4FBe=Gkk&D5AgX!!4`S(^Vy>f$Pw=;)KCEo;&ZM&x5T0BXo o?4NV}$;&la2c}Jt(MnbjFa5x9*P!*^Tu|_Oy85}Sb4q9e03&ZX0RR91 literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/resource_type/fluid.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/resource_type/fluid.png new file mode 100644 index 0000000000000000000000000000000000000000..501a3621e2ac617b72cbeee8b518db98dbcc029f GIT binary patch literal 955 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*9@)5S4FBe=E0k&i)vO4#Dy+w_~M+KAz)se(2qD0n?x{an^LB{Ts5!cjF* literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/resource_type/item.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/resource_type/item.png new file mode 100644 index 0000000000000000000000000000000000000000..f3b3d6ac2cdb124e5807232d5f63328374260c1b GIT binary patch literal 959 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*9>)5S4FBe=BZA{T=J2h;2S^;HX&1?Z%e|J?A(^!_3px14Vmcf6DN rtaxI9qKG}qy4kNa1eA3brHkI>ub9E`P$jKM0u;oau6{1-oD!MNSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*A2)5S4FBRIF$QHVi-gX!!4`R6zdO)MX5dzxamiQ{#i;2NF?o{eJ3 uaUl!2_tgC`H(>L#Y|Pk~v40EC!#akV42EZH6Z?5Uq3r4E=d#Wzp$PytqBto4 literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/scheduling_mode/random.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/scheduling_mode/random.png new file mode 100644 index 0000000000000000000000000000000000000000..e33c06fcfd8b21fa142fc66458620b7d57d1e68c GIT binary patch literal 957 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*9()5S4FBRDz1h1r5dqJiN|16RWj1Hlyx5dxtMP7bUG7-AV*xjWiE oO=L;nk?7T9U>C_~WO8$3DCT6i*E%8i6DWW^UHx3vIVCg!01Wjo5dZ)H literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/scheduling_mode/round_robin.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/scheduling_mode/round_robin.png new file mode 100644 index 0000000000000000000000000000000000000000..9a99e542707842b217ddeb50b4f6ca96efde5e12 GIT binary patch literal 956 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*A8)5S4FBe=BNk&i)v=Yzu6)78&qol`;+07#xVNSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q$nn)5S4FBRDz1h4~1l!2!h(1~v(WO&(eaOa=^Ti&r#sJ29GuG%%iI b>gi!9cVl=Yy-a92C`>(F{an^LB{Ts5!tyN1 literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/screen_size/medium.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/screen_size/medium.png new file mode 100644 index 0000000000000000000000000000000000000000..a9f8a08acc5a6da2840e6da8a313fa70c9ad18c7 GIT binary patch literal 944 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q$nn)5S4FBRDz1g*k=G;DBNX1Dk}xCJ(IyCIg1F#VZ=Rofs2E6C8Fj aC@V8monm-lY3a@l3R6#4KbLh*2~7Z<NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q$nP)5S4FBRDz1h53q5LWA=P1|9>4l!+k+SP~e{xCJtbyRw-GB&4t~ Y)cG;IyE4;wDJVcaUHx3vIVCg!08EW6761SM literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/screen_size/stretch.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/screen_size/stretch.png new file mode 100644 index 0000000000000000000000000000000000000000..c63f2bf80e103ed5607f11060b1988641d40b3c7 GIT binary patch literal 955 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*9@)5S4FBRDz1h4~1l!2!h(1~v(WO&(eaOa=^Ti&r#sJ247sIV@YW mqM<;5;f$LY1G5uTPY*+xD8s$3Gl?Fc;PrI%b6Mw<&;$U;z%V!f literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/storage/access_mode/extract.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/storage/access_mode/extract.png new file mode 100644 index 0000000000000000000000000000000000000000..5e4674fc5adc9f8f2747c72ed05993039efdc52d GIT binary patch literal 965 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9E%FD}vvZG)$1V&&8oaA{g0rWO=NswRg|NjivPw@h?2m@z< zM`SSr1K(i~W;~w1A_XXD@9E+gq7mHN<0!;nz{33Tzx(tP8SQd!8dHu7WWQ+*c~CT? zsHtcB@`n$9d=y>9u|jcATjPO%NSs56Z83KGlT&=9E%FD}vvZG)$1V&&8oaA{g0rWO=NswRg|NjivPw@h?2m@z< zM`SSr1K(i~W;~w1A_XXD?djqeq7gjx^g%ub0~Y3hKmXnPUwOPSvJKEzH2cIK^z@x7 xN3g@mF3v#L!?KUkJ^rs;u3#@Ufqe#J8v82;#NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q*A8)5S4FBRDz1h1rFhL6e2sWf7;r0#1gXE0_ehlzOxnQXMrpI>3xRVbx$YG0EMrotDnm{r-UW|t#~jY literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/storage/filter_mode/allow.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/storage/filter_mode/allow.png new file mode 100644 index 0000000000000000000000000000000000000000..4b72e7d04b340bf30a2a21c6edb6f1276c3dca5a GIT binary patch literal 931 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT+7SLfl{MjGz3Ow2v~i3JQ?V7rjj7P;QtIyw;Ol?d7K3vk;M!Q ze1}1p@p%4<6riA-r;B5VMsRY13-b|90|O%m#t;Tp9yL*oh6xPH$_)9t8Lq_EZ9D=B NMo(8imvv4FO#sdDC}{uy literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/storage/filter_mode/block.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/storage/filter_mode/block.png new file mode 100644 index 0000000000000000000000000000000000000000..7e8195ea6e27c2f551522fc760ac11817f23004c GIT binary patch literal 931 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT&=9EfKsDiGz3Ow2t15=TnqF$Q%R6t@PCG<+YP*cJkA1-$YKTt zzQZ8Qcszea3Q$na)5S4FBRDz1h4~1lfq{_&V+aE)kD91P!vqFpWrqCS3|C_7HXZ>5 Nqo=E%%Q~loCIDs@C#?Vg literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/storage/void_excess/no.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/storage/void_excess/no.png new file mode 100644 index 0000000000000000000000000000000000000000..1237cd20b4a72a82704a103fe26990c0a5ccc5bf GIT binary patch literal 214 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}c0G|-o^73*kD=Q$+Q+Dl5AjMn~8JhBzl^`>j`I!4f?%4Eo`xGQkwqr96T+sQdIK%t8)Sem=0cN%x5&sSqU_f!PC{xWt~$(697I~ BL9+k= literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/storage/void_excess/yes.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/widget/side_button/storage/void_excess/yes.png new file mode 100644 index 0000000000000000000000000000000000000000..4c185541cde920073c7de0c461f52ba54bc4fb57 GIT binary patch literal 179 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1en(8JTkF~q_@S>jiNpjR@3w)X1(0csL5)@3}a zqeL7_e0MPD9quqL`@utD1r$JioXhqIK%-$zy;ZaLD?ZRj06xzaBu)o zmQh9=H=^SVsAPeNf;j95C}dHTB}gDF0RrTO#8+=#)vJ1c{aw|4?>YA@-}&yjx2m%b zd+bB28mj^TfZp%!>IDFxYzhJ>NH&DsCwi|)=e+jq1|GJo9+3&k!7hhf0N_!s+F~F= zCQ}X{^mda1{nFGgadB}=0O088Xm4X9?FFQ{01*Ty0l?PEN-8asN~P-ofC~UFJM1xb z8>#>R_Sn3`N}mq^9RPscY?pt|)d{n@69C-zIQa^;*2#73JNNU-@kLSi3~z%y}i3^*l^y<x4^0L8`bJ*$+#b|4OxXT&{*)V)6dK(A*`Rdvmb+T1j;UHV-M96zua^e#JjD>Pc0pTLQzF+*giqx zTrKGeSNz<-NEXwcH#0xPBuC6mA5dN#?LmEVU`VTpX@qOv<~0s(TOJ( zM_N(C^SB19yJsM;-TtnRe-C#4<>JmTIEH*0S{C`xZ&~o4GuM=VEEMt2LVf~E%bAS< zZ|yY5CVxWKY{<&OfhXjSE_t=#zw=DH+ylG2ee~Ycw$voB9BrO?&HpQ4Vrd1G$%JPD znkF`%>tSlQO&X&@uBKg$W+J-EhNKlUclnRo>D{`rT0a?CY|xutSl~)!8Sg2-eqFFJ zr($NbZ`qg}>H(cBx$tmdnO4MOv@qY9uh0$eS@AM22Zd;XeIQYnic@@gC3TL65-YXX z#kJzaOlN`ph$$TCP*M12-F)|Z!rp_C%WO_hZNmH4j5vV$U?}+I=jO3w;P0Ody01%V zVz(ZltFH;Il$ngj+H;YWMxuF}`4Dv5f{)720#g=ppr!TFn_%lWk&An4%FG|eycr*r zzi{P-!f;1OGq?0T0G+JDj|zcpb*F2hU+`CbZf;z(n#lO|0#~R`n`8VI2betZ z*32=#R&}e;XrcFB;odRvH;wa^_N-U8q2WDMV$qzi2W}8+@NN}QcjVe1_WC$ub!4Sh zgNV+Z0J~Vd1tWPiM0QcsA1>E@C5V6XkqWyQdw=CKwnQ!oEYe42M%2^9KgLkAcOiC! z=MT@EbrPuS`opH)T>FAT7ZQlr(k>W?4>)&YSZTVb6d%LuqlDdlv$z_2@I07!Ft^l% zY)<{VH4MJrD5Aa%(sX$&YBw|Rhs{%;b|Z&z@Cv20kQA4zg(p2G(5G*y(b$sEjg?HJ z4vjbAgv&#`f=!INWLc=`OPkBNtL7qK1yjuPKJ0iFOAj>C_J_@!Z>hyYwb1ij2>oUx zS4XB9c-x{!JkNYTW1FY;_}v(O-7`Rg*?&BGdaQ34 zt(Yc95VV&&&~5L-90)a`kk_iQvw}tT`~%&BVGdOhkJeQvT}!0JEb|w?Yb*(zdX=&I zkm1`4fdT57eVU_ZI(B9l&NhVaI;A~PQ+e5%4q?Y~`uwm;;|Yu-dV60UK)22(5v!U~ zZEt3cn6fHsvzH5+qyv)!O4?W+&cR9ZQuWWAa#`#D;ti^a#2joF@5}P>df7w1wx$qq!qu15BCp1mzFlsw7kT9X)YQ8%;2I)PEWxll}|HszwF z1?Q;PY64whVO>j5evu?ua@{*+fu3>hsM1wF!bix~r)HAt=v|K=aQvn}A76eXWjnCe za#E9i)IXxGdly+NN|nYu-b(H}+nSL`>;@#}^P|+GC19ekBS5|5bY(a^UL9N)(h78P zka0W@uV%`-sMlKwhy9&~jkozm!m&JdDR}C};LK%odSlRq;)V_&Wv(>_i8>xis5tt> z3dfR?2=QsCEOGHE7if(P*%RDoBBh>z zO}OSHKItDO7(3^fb@PNk^c z?z$O0d$mm}k6c!-CoX*w3J2H@7s&Jb5|k<%`weEt&_s&*^D4;?qm?l7fF><4D1@LB zYap+9-S;iNh;0{__y`L!quSf}Y_=~Vwm>0@i48kpJ|+>-M>T-q`BE9$uVa*Uf>|R@ zy|V>+N>#xlw6WZ(faP+|_qEn?OG*V;jE_LAV5C!@g``Cg{|cS!N>hNkdu$ag;od2H z3>01KusssmNNk7Q3jB9W9WBrLy+4AbM^g4lxzj{fxc~Nj3~(fNa1fn$Umx3W{zSB5 z`AgLH(55k~W#qSk`Fu4?a%!Y)51OV?qZ*(EN|JJ) zo@ISt8@RHTNqcm*iOZ)ICi`9fOs9K597{!(|IXGYJIYhLTLOz>WlSBMv(5S^feW0> znmvy&wSe*)@nDCT(q($FM7{$yKGy>9kWqZ#7P%-U3Z7_?nl{S~3+`$p722;=%tuA& zJ3B32*4g!Ctn3Nr#4%Iager-6P~MD9$6|QYpkT%Pw>8>v>u2R=|JcI+pRjeeD4&0D z+PYUumtmnaD;BUuXUYb$RODQs?}y|diBSSrOTJd%uymkk7A+@4n4PhX;x?C#>g6WA z*+9onhb!nqj|?$~V#_`qBPq`yuuN13I?`Qk6~?>tsi*($02Px3FVT@LXFmL*DNoYc zZ~cFAs(!r+db*WgX{dC0sHsFH003W2{oKbH?=T6NQ$lSo6%WtyO!#URy!g`0(m9`0 zRllcT_5?yJ$_aCgxecyl{b`biQh3dWL1VV$$*Mm1qTIl9{GdF9O&m4ng@7<_t-cd8 z7_LKky@s6X*SqmJhP-(SyD+nvoqCbL-kN_wqOz`= zV62_rZBW!Ev7)qZC76XQO{I%4B`OQO5=eyG8 zgX7KK!bYYShOn+jwa1ehcl`6L<%h{`KH2?}v@xk0v)_lEJ@)mgu;*Myy9-rpBH-VW z?t#T+n-o1I)6(YBM-|6!cM{s-S4Y-{K6wLhP9#8nY7X;N?LZ;*a}{H40exH%Z1O(% zki{^wbIePTx6!5&&NrK|M@Xwj(7WU Date: Thu, 8 Aug 2024 23:16:15 +0200 Subject: [PATCH 05/20] fix: search bar being positioned wrongly on portable grid --- CHANGELOG.md | 1 + .../common/grid/screen/CraftingGridScreen.java | 2 +- .../textures/gui/portable_grid.png | Bin 930 -> 929 bytes 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f83689eac..08eb67105 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Fixed - Use new slimeballs convention tag for Processor Binding. +- Portable Grid search bar texture being positioned in the wrong way. ## [2.0.0-milestone.4.6] - 2024-08-08 diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/CraftingGridScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/CraftingGridScreen.java index 04d3a11ff..0f6bd9878 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/CraftingGridScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/CraftingGridScreen.java @@ -70,7 +70,7 @@ protected void init() { } private int getClearButtonX(final int i) { - return leftPos + 82 + ((CLEAR_BUTTON_SIZE + 3) * i); + return leftPos + 81 + ((CLEAR_BUTTON_SIZE + 2) * i); } @Override diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/portable_grid.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/portable_grid.png index 150d439208376caf627d310b8ced649caf394e4e..63c67373ae089a4d82f3548dfb1d645cd55be927 100644 GIT binary patch literal 929 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K58911MRQ8&P5D>38$lZxy-8q?;Kn_c~qpu?a z!^VE@KZ&eBzC?geh%1o(|NsB7W5+^6L(R?2ySuw@-@XkL{BrrbA&}xI3GxdDDgXh7 zd(C?zfnuBm9+AZi419+`m{C;2tAT-m>7S>IV@O5Z+dI8^iwy)^6N9`e|C{TTtz%ME zQB83>y7zg;R^duz_Ij`FT)!{(CSNajyza}BUcKpgbLz6T$1?f*M+iv0OKx|te0cn@ zR)d^*#Qpzz26F?>-&@7-BC&ff!-t)DE3BU|eJPC9FTbnJaCp`0os${AL^0;Zs{)<0 zAlZ%&NNM=9I!NDTTJVm+LF+(({idT!bnDB?8omI-#Dg+q*%O|{9w%qm%M9G>j|aQfvxEoVk4UZB7Q$3C$B1!tppkhlS5 zm;RqIGS4{o_oJ8Xhg}W~chh&3THXe-t@Ii8ia%pBZzx)LS`TC-gVl+PVER;CrMTQy zCLsGtus)N5z=MDJ9dmM3f6H#r`*^SK*`0Nw`&fX1Gp|YztQ@<(E|wF!Ckt<#^p`JU zdPTl_ao%;Vc%YF1{(Ctfx@4bZfElUl_i*<|fxPuE+%4Af@GxwGAb`Gy9c z!mE3^_dve3XmA6DXMTen(*o_=TYw4iGJo#XlvoCbN^z6hUq$l2{Nw9oZ&;Sgka3G` euu#t!9{=D?f1CBfL}G>;$akKuelF{r5}E+v>`wy# literal 930 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K58911MRQ8&P5D>38$lZxy-8q?;Kn_c~qpu?a z!^VE@KZ&eBzC?geh%1o(|NsB7W5+^6L(R?2ySuw@-@XkL{BrrbA&}xI3GxdDDgXh7 zd(C?zfnuBm9+AZi419+{nDKc2iWCM0rvIKUjv*CsZ}0TxEjAEvO$_p?{BN#TwvI_v zWogQ?qkErcY!$9lX0P|!&h`6pZ}Rnm$Lqd4>D8N_H>WOZdn}W`e}sV4yWDmM%ZIlQ zYc zemhSQW%$N?=l{2uuwDi^mIMFUC3e5eOqAV#wSnbHCVc zKEpe!xPDI%{~kR7hwn4@vd?ilyl>rkkat1Mi%r}hQych-Ou+P}@O!Q9YeCGf zSGpNESa$rER!WaPS;xM{d(Za8mfN#i^?_EcSRTg$QiDUE662?LPh8ff>}S5Fdhhnd zIk&eSnhsQaC0HNge+PC;DUfc5o7(RWEe->jQ}xPqB12_)(W0wu>V=Jz3F-U*cJ)A5fquhJ Date: Thu, 8 Aug 2024 23:20:59 +0200 Subject: [PATCH 06/20] fix: external storage screen showing upgrade slots --- CHANGELOG.md | 1 + .../common/storage/externalstorage/ExternalStorageScreen.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08eb67105..b5835a3dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Use new slimeballs convention tag for Processor Binding. - Portable Grid search bar texture being positioned in the wrong way. +- External Storage screen unnecessarily showing upgrade slots. ## [2.0.0-milestone.4.6] - 2024-08-08 diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageScreen.java index abb6475ac..bd1399d87 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageScreen.java @@ -13,7 +13,7 @@ public ExternalStorageScreen(final ExternalStorageContainerMenu menu, final Component title) { super(menu, inventory, title); this.inventoryLabelY = 42; - this.imageWidth = 210; + this.imageWidth = 176; this.imageHeight = 137; } From cc70d4442b03defa471fac635310056dfd2a81f2 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Fri, 9 Aug 2024 01:21:53 +0200 Subject: [PATCH 07/20] fix: grid setting changes not persisting after restart Fixes #645 --- CHANGELOG.md | 1 + .../refinedstorage/neoforge/ConfigImpl.java | 40 +++++++++++++++---- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5835a3dc..666786808 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Use new slimeballs convention tag for Processor Binding. - Portable Grid search bar texture being positioned in the wrong way. - External Storage screen unnecessarily showing upgrade slots. +- Grid setting changes not persisting after restarting Minecraft. ## [2.0.0-milestone.4.6] - 2024-08-08 diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ConfigImpl.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ConfigImpl.java index 1fe2b5685..504c04be9 100644 --- a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ConfigImpl.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ConfigImpl.java @@ -119,7 +119,10 @@ public int getMaxRowsStretch() { @Override public void setScreenSize(final ScreenSize screenSize) { - this.screenSize.set(screenSize); + if (screenSize != this.screenSize.get()) { + this.screenSize.set(screenSize); + this.spec.save(); + } } @Override @@ -427,7 +430,10 @@ public boolean isAutoSelected() { @Override public void setAutoSelected(final boolean autoSelected) { - this.autoSelected.set(autoSelected); + if (autoSelected != this.autoSelected.get()) { + this.autoSelected.set(autoSelected); + ConfigImpl.this.spec.save(); + } } @Override @@ -440,12 +446,18 @@ public Optional getSynchronizer() { @Override public void setSynchronizer(final ResourceLocation synchronizerId) { - this.synchronizer.set(synchronizerId.toString()); + if (!synchronizerId.toString().equals(this.synchronizer.get())) { + this.synchronizer.set(synchronizerId.toString()); + ConfigImpl.this.spec.save(); + } } @Override public void clearSynchronizer() { - this.synchronizer.set(""); + if (!synchronizer.get().isEmpty()) { + this.synchronizer.set(""); + ConfigImpl.this.spec.save(); + } } @Override @@ -455,7 +467,10 @@ public GridSortingDirection getSortingDirection() { @Override public void setSortingDirection(final GridSortingDirection sortingDirection) { - this.sortingDirection.set(sortingDirection); + if (sortingDirection != this.sortingDirection.get()) { + this.sortingDirection.set(sortingDirection); + ConfigImpl.this.spec.save(); + } } @Override @@ -465,7 +480,10 @@ public GridSortingTypes getSortingType() { @Override public void setSortingType(final GridSortingTypes sortingType) { - this.sortingType.set(sortingType); + if (sortingType != this.sortingType.get()) { + this.sortingType.set(sortingType); + ConfigImpl.this.spec.save(); + } } @Override @@ -478,12 +496,18 @@ public Optional getResourceType() { @Override public void setResourceType(final ResourceLocation resourceTypeId) { - this.resourceType.set(resourceTypeId.toString()); + if (!resourceTypeId.toString().equals(this.resourceType.get())) { + this.resourceType.set(resourceTypeId.toString()); + ConfigImpl.this.spec.save(); + } } @Override public void clearResourceType() { - this.resourceType.set(""); + if (!resourceType.get().isEmpty()) { + this.resourceType.set(""); + ConfigImpl.this.spec.save(); + } } } From f5f8322c5c92157133c2eea5d651368be94c5488 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sat, 10 Aug 2024 13:20:58 +0200 Subject: [PATCH 08/20] refactor: fluid amount formatting is no longer static --- .../common/api/RefinedStorageApi.java | 2 +- .../common/api/RefinedStorageApiProxy.java | 4 +- .../support/resource/ResourceRendering.java | 6 +- .../common/AbstractClientModInitializer.java | 4 +- .../common/RefinedStorageApiImpl.java | 4 +- ...CraftingPatternClientTooltipComponent.java | 2 +- .../autocrafting/PatternTooltipCache.java | 3 +- ...singMatrixInputClientTooltipComponent.java | 2 +- ...ocessingPatternClientTooltipComponent.java | 6 +- .../autocrafting/SmithingTablePattern.java | 8 +- ...ingTablePatternClientTooltipComponent.java | 21 +- .../autocrafting/StonecutterPattern.java | 4 +- ...necutterPatternClientTooltipComponent.java | 20 +- .../screen/hint/FluidGridInsertionHint.java | 4 +- .../common/grid/view/FluidGridResource.java | 9 +- .../AbstractProgressStorageScreen.java | 4 +- .../common/storage/AbstractStorageScreen.java | 2 +- .../FluidStorageBlockBlockItem.java | 4 +- .../storageblock/FluidStorageBlockScreen.java | 7 +- .../storagedisk/FluidStorageDiskItem.java | 4 +- .../StorageMonitorBlockEntityRenderer.java | 6 +- .../common/support/AbstractBaseScreen.java | 2 +- .../common/support/ResourceSlotRendering.java | 4 +- .../resource/FluidResourceRendering.java | 24 +- .../resource/ItemResourceRendering.java | 5 +- .../tooltip/MouseClientTooltipComponent.java | 2 +- .../ResourceClientTooltipComponent.java | 6 +- .../refinedstorage/common/TestPlatform.java | 241 ------------------ .../resource/FluidResourceRenderingTest.java | 35 +-- 29 files changed, 103 insertions(+), 342 deletions(-) delete mode 100644 refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/TestPlatform.java diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/RefinedStorageApi.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/RefinedStorageApi.java index 7d2ac7548..1894a2642 100644 --- a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/RefinedStorageApi.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/RefinedStorageApi.java @@ -160,7 +160,7 @@ GridScrollingStrategy createGridScrollingStrategy(AbstractContainerMenu containe void registerResourceRendering(Class resourceClass, ResourceRendering rendering); - ResourceRendering getResourceRendering(ResourceKey resource); + ResourceRendering getResourceRendering(Class resourceClass); void addIngredientConverter(RecipeModIngredientConverter converter); diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/RefinedStorageApiProxy.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/RefinedStorageApiProxy.java index d30707043..0d8e2e3d5 100644 --- a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/RefinedStorageApiProxy.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/RefinedStorageApiProxy.java @@ -297,8 +297,8 @@ public void registerResourceRendering(final Class res } @Override - public ResourceRendering getResourceRendering(final ResourceKey resource) { - return ensureLoaded().getResourceRendering(resource); + public ResourceRendering getResourceRendering(final Class resourceClass) { + return ensureLoaded().getResourceRendering(resourceClass); } @Override diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceRendering.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceRendering.java index 1c50428d7..63722f40b 100644 --- a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceRendering.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceRendering.java @@ -13,7 +13,11 @@ @API(status = API.Status.STABLE, since = "2.0.0-milestone.2.13") public interface ResourceRendering { - String getDisplayedAmount(long amount, boolean withUnits); + default String formatAmount(long amount) { + return formatAmount(amount, false); + } + + String formatAmount(long amount, boolean withUnits); Component getDisplayName(ResourceKey resource); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractClientModInitializer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractClientModInitializer.java index b9d9c997b..c5cbe6ccd 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractClientModInitializer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractClientModInitializer.java @@ -87,7 +87,9 @@ protected static void registerAlternativeGridHints() { protected static void registerResourceRendering() { RefinedStorageApi.INSTANCE.registerResourceRendering(ItemResource.class, new ItemResourceRendering()); - RefinedStorageApi.INSTANCE.registerResourceRendering(FluidResource.class, new FluidResourceRendering()); + RefinedStorageApi.INSTANCE.registerResourceRendering(FluidResource.class, new FluidResourceRendering( + Platform.INSTANCE.getBucketAmount() + )); } protected static void handleInputEvents() { diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/RefinedStorageApiImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/RefinedStorageApiImpl.java index 6e0c4ebc5..93cd3a5e4 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/RefinedStorageApiImpl.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/RefinedStorageApiImpl.java @@ -456,8 +456,8 @@ public void registerResourceRendering(final Class res } @Override - public ResourceRendering getResourceRendering(final ResourceKey resource) { - return resourceRenderingMap.get(resource.getClass()); + public ResourceRendering getResourceRendering(final Class resourceClass) { + return resourceRenderingMap.get(resourceClass); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/CraftingPatternClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/CraftingPatternClientTooltipComponent.java index 9b32a4425..934acb854 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/CraftingPatternClientTooltipComponent.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/CraftingPatternClientTooltipComponent.java @@ -100,7 +100,7 @@ private void renderInputSlot(final int x, final int y, final GuiGraphics graphic if (!inputs.isEmpty()) { final int idx = currentCycle % inputs.size(); final PlatformResourceKey resource = inputs.get(idx); - RefinedStorageApi.INSTANCE.getResourceRendering(resource).render( + RefinedStorageApi.INSTANCE.getResourceRendering(resource.getClass()).render( resource, graphics, x + sx * 18 + 1, diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternTooltipCache.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternTooltipCache.java index ca8602462..969a65217 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternTooltipCache.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternTooltipCache.java @@ -35,8 +35,7 @@ public static ClientTooltipComponent getComponent(final PatternItem.StonecutterP CACHE.clear(); } return CACHE.computeIfAbsent(key.id(), id -> new StonecutterPatternClientTooltipComponent( - key.stonecutterPattern().input(), - key.stonecutterPattern().output() + key.stonecutterPattern() )); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingMatrixInputClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingMatrixInputClientTooltipComponent.java index da3289b08..982a56aba 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingMatrixInputClientTooltipComponent.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingMatrixInputClientTooltipComponent.java @@ -69,7 +69,7 @@ public void renderImage(final Font font, final int x, final int y, final GuiGrap final PlatformResourceKey resource = alternative.resources().get( currentCycle % alternative.resources().size() ); - final ResourceRendering rendering = RefinedStorageApi.INSTANCE.getResourceRendering(resource); + final ResourceRendering rendering = RefinedStorageApi.INSTANCE.getResourceRendering(resource.getClass()); rendering.render(resource, graphics, x, y + 9 + PADDING + i * 18); graphics.drawString( font, diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingPatternClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingPatternClientTooltipComponent.java index 32850c518..41a447f3e 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingPatternClientTooltipComponent.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingPatternClientTooltipComponent.java @@ -77,9 +77,9 @@ private static List getOutputText(final ProcessingPatternState state) private static Component getOutputText(final ResourceAmount resourceAmount) { final ResourceRendering rendering = RefinedStorageApi.INSTANCE.getResourceRendering( - resourceAmount.resource() + resourceAmount.resource().getClass() ); - final String displayAmount = rendering.getDisplayedAmount( + final String displayAmount = rendering.formatAmount( resourceAmount.amount(), false ); @@ -152,7 +152,7 @@ private void renderMatrixSlot( } final ResourceAmount resourceAmount = possibilities.get(currentCycle % possibilities.size()); final ResourceRendering rendering = RefinedStorageApi.INSTANCE.getResourceRendering( - resourceAmount.resource() + resourceAmount.resource().getClass() ); rendering.render(resourceAmount.resource(), graphics, slotX + 1, slotY + 1); ResourceSlotRendering.render(graphics, slotX + 1, slotY + 1, resourceAmount.amount(), rendering); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePattern.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePattern.java index 48b5de368..97a1c4520 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePattern.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePattern.java @@ -1,10 +1,8 @@ package com.refinedmods.refinedstorage.common.autocrafting; import com.refinedmods.refinedstorage.common.api.autocrafting.Pattern; -import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; -record SmithingTablePattern(PlatformResourceKey template, - PlatformResourceKey base, - PlatformResourceKey addition, - PlatformResourceKey output) implements Pattern { +record SmithingTablePattern(ItemResource template, ItemResource base, ItemResource addition, ItemResource output) + implements Pattern { } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePatternClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePatternClientTooltipComponent.java index 2c248bd9b..312cc58e2 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePatternClientTooltipComponent.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePatternClientTooltipComponent.java @@ -1,9 +1,9 @@ package com.refinedmods.refinedstorage.common.autocrafting; import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; -import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; import com.refinedmods.refinedstorage.common.api.support.resource.ResourceRendering; import com.refinedmods.refinedstorage.common.support.Sprites; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import net.minecraft.ChatFormatting; import net.minecraft.client.gui.Font; @@ -32,14 +32,12 @@ public void renderImage(final Font font, final int x, final int y, final GuiGrap graphics.drawString(font, outputText, x, y, requireNonNullElse(ChatFormatting.GRAY.getColor(), 15)); final int slotsY = y + 9 + 2; graphics.blitSprite(Sprites.SLOT, x, slotsY, 18, 18); - RefinedStorageApi.INSTANCE.getResourceRendering(pattern.template()) - .render(pattern.template(), graphics, x + 1, slotsY + 1); + final ResourceRendering rendering = RefinedStorageApi.INSTANCE.getResourceRendering(ItemResource.class); + rendering.render(pattern.template(), graphics, x + 1, slotsY + 1); graphics.blitSprite(Sprites.SLOT, x + 18, slotsY, 18, 18); - RefinedStorageApi.INSTANCE.getResourceRendering(pattern.base()) - .render(pattern.base(), graphics, x + 18 + 1, slotsY + 1); + rendering.render(pattern.base(), graphics, x + 18 + 1, slotsY + 1); graphics.blitSprite(Sprites.SLOT, x + 18 + 18, slotsY, 18, 18); - RefinedStorageApi.INSTANCE.getResourceRendering(pattern.addition()) - .render(pattern.addition(), graphics, x + 18 + 18 + 1, slotsY + 1); + rendering.render(pattern.addition(), graphics, x + 18 + 18 + 1, slotsY + 1); graphics.blitSprite( LIGHT_ARROW, x + (18 * 3) + ARROW_SPACING, @@ -49,8 +47,7 @@ public void renderImage(final Font font, final int x, final int y, final GuiGrap ); final int lastSlotX = x + (18 * 3) + ARROW_SPACING + LIGHT_ARROW_WIDTH + ARROW_SPACING; graphics.blitSprite(Sprites.SLOT, lastSlotX, slotsY, 18, 18); - RefinedStorageApi.INSTANCE.getResourceRendering(pattern.output()) - .render(pattern.output(), graphics, lastSlotX + 1, slotsY + 1); + rendering.render(pattern.output(), graphics, lastSlotX + 1, slotsY + 1); } @Override @@ -66,10 +63,10 @@ public int getWidth(final Font font) { ); } - private static Component getOutputText(final PlatformResourceKey resource) { - final ResourceRendering rendering = RefinedStorageApi.INSTANCE.getResourceRendering(resource); + private static Component getOutputText(final ItemResource output) { + final ResourceRendering rendering = RefinedStorageApi.INSTANCE.getResourceRendering(ItemResource.class); return Component.literal("1x ") - .append(rendering.getDisplayName(resource)) + .append(rendering.getDisplayName(output)) .withStyle(ChatFormatting.GRAY); } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPattern.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPattern.java index 3b39fb08f..e325ac647 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPattern.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPattern.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage.common.autocrafting; import com.refinedmods.refinedstorage.common.api.autocrafting.Pattern; -import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; -record StonecutterPattern(PlatformResourceKey input, PlatformResourceKey output) implements Pattern { +record StonecutterPattern(ItemResource input, ItemResource output) implements Pattern { } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPatternClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPatternClientTooltipComponent.java index 90756883f..eeff7d187 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPatternClientTooltipComponent.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPatternClientTooltipComponent.java @@ -3,6 +3,7 @@ import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; import com.refinedmods.refinedstorage.common.api.support.resource.PlatformResourceKey; import com.refinedmods.refinedstorage.common.api.support.resource.ResourceRendering; +import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import net.minecraft.ChatFormatting; import net.minecraft.client.gui.Font; @@ -23,17 +24,18 @@ class StonecutterPatternClientTooltipComponent implements ClientTooltipComponent private final PlatformResourceKey input; private final PlatformResourceKey output; - StonecutterPatternClientTooltipComponent(final PlatformResourceKey input, final PlatformResourceKey output) { - this.outputText = getOutputText(output); - this.input = input; - this.output = output; + StonecutterPatternClientTooltipComponent(final StonecutterPattern pattern) { + this.outputText = getOutputText(pattern.output()); + this.input = pattern.input(); + this.output = pattern.output(); } @Override public void renderImage(final Font font, final int x, final int y, final GuiGraphics graphics) { graphics.drawString(font, outputText, x, y, requireNonNullElse(ChatFormatting.GRAY.getColor(), 15)); graphics.blitSprite(SLOT, x, y + 9 + 2, 18, 18); - RefinedStorageApi.INSTANCE.getResourceRendering(input).render(input, graphics, x + 1, y + 9 + 2 + 1); + final ResourceRendering rendering = RefinedStorageApi.INSTANCE.getResourceRendering(ItemResource.class); + rendering.render(input, graphics, x + 1, y + 9 + 2 + 1); graphics.blitSprite( LIGHT_ARROW, x + 18 + ARROW_SPACING, @@ -48,7 +50,7 @@ public void renderImage(final Font font, final int x, final int y, final GuiGrap 16, 18 ); - RefinedStorageApi.INSTANCE.getResourceRendering(output).render( + rendering.render( output, graphics, x + 18 + ARROW_SPACING + LIGHT_ARROW_WIDTH + ARROW_SPACING, @@ -56,10 +58,10 @@ public void renderImage(final Font font, final int x, final int y, final GuiGrap ); } - private static Component getOutputText(final PlatformResourceKey resource) { - final ResourceRendering rendering = RefinedStorageApi.INSTANCE.getResourceRendering(resource); + private static Component getOutputText(final ItemResource output) { + final ResourceRendering rendering = RefinedStorageApi.INSTANCE.getResourceRendering(ItemResource.class); return Component.literal("1x ") - .append(rendering.getDisplayName(resource)) + .append(rendering.getDisplayName(output)) .withStyle(ChatFormatting.GRAY); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/FluidGridInsertionHint.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/FluidGridInsertionHint.java index 8eaa8d5de..e0f04b3e7 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/FluidGridInsertionHint.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/FluidGridInsertionHint.java @@ -1,10 +1,10 @@ package com.refinedmods.refinedstorage.common.grid.screen.hint; import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; import com.refinedmods.refinedstorage.common.api.grid.GridInsertionHint; import com.refinedmods.refinedstorage.common.api.support.resource.FluidOperationResult; import com.refinedmods.refinedstorage.common.support.resource.FluidResource; -import com.refinedmods.refinedstorage.common.support.resource.FluidResourceRendering; import com.refinedmods.refinedstorage.common.support.tooltip.MouseClientTooltipComponent; import java.util.Optional; @@ -24,7 +24,7 @@ private ClientTooltipComponent createComponent(final FluidOperationResult result (FluidResource) result.fluid(), result.amount() == Platform.INSTANCE.getBucketAmount() ? null - : FluidResourceRendering.format(result.amount()) + : RefinedStorageApi.INSTANCE.getResourceRendering(FluidResource.class).formatAmount(result.amount()) ); } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/FluidGridResource.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/FluidGridResource.java index 9571ec6dc..5f8b956ba 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/FluidGridResource.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/FluidGridResource.java @@ -3,14 +3,15 @@ import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; import com.refinedmods.refinedstorage.api.grid.view.GridView; import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; import com.refinedmods.refinedstorage.common.api.grid.GridResourceAttributeKeys; import com.refinedmods.refinedstorage.common.api.grid.GridScrollMode; import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategy; import com.refinedmods.refinedstorage.common.api.grid.strategy.GridScrollingStrategy; import com.refinedmods.refinedstorage.common.api.grid.view.AbstractPlatformGridResource; +import com.refinedmods.refinedstorage.common.api.support.resource.ResourceRendering; import com.refinedmods.refinedstorage.common.api.support.resource.ResourceType; import com.refinedmods.refinedstorage.common.support.resource.FluidResource; -import com.refinedmods.refinedstorage.common.support.resource.FluidResourceRendering; import com.refinedmods.refinedstorage.common.support.resource.ResourceTypes; import com.refinedmods.refinedstorage.common.support.tooltip.MouseClientTooltipComponent; @@ -27,6 +28,7 @@ public class FluidGridResource extends AbstractPlatformGridResource { private final int id; + private final ResourceRendering rendering; public FluidGridResource(final FluidResource resource, final String name, @@ -41,6 +43,7 @@ public FluidGridResource(final FluidResource resource, GridResourceAttributeKeys.TOOLTIP, Set.of(tooltip) )); this.id = BuiltInRegistries.FLUID.getId(resource.fluid()); + this.rendering = RefinedStorageApi.INSTANCE.getResourceRendering(FluidResource.class); } @Override @@ -76,12 +79,12 @@ public void render(final GuiGraphics graphics, final int x, final int y) { @Override public String getDisplayedAmount(final GridView view) { - return FluidResourceRendering.formatWithUnits(getAmount(view)); + return rendering.formatAmount(getAmount(view), true); } @Override public String getAmountInTooltip(final GridView view) { - return FluidResourceRendering.format(getAmount(view)); + return rendering.formatAmount(getAmount(view)); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractProgressStorageScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractProgressStorageScreen.java index ab13cec1c..8019428f9 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractProgressStorageScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractProgressStorageScreen.java @@ -39,10 +39,10 @@ private List createProgressTooltip() { tooltip, menu.getStored(), menu.getCapacity(), - this::formatQuantity + this::formatAmount ); } else { - StorageTooltipHelper.addAmountStoredWithoutCapacity(tooltip, menu.getStored(), this::formatQuantity); + StorageTooltipHelper.addAmountStoredWithoutCapacity(tooltip, menu.getStored(), this::formatAmount); } return tooltip; } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractStorageScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractStorageScreen.java index 3ea7a7ea6..a069a87cb 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractStorageScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractStorageScreen.java @@ -69,7 +69,7 @@ protected void containerTick() { } } - protected String formatQuantity(final long qty) { + protected String formatAmount(final long qty) { return AmountFormatting.format(qty); } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockItem.java index 7c334447c..afbba908c 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockItem.java @@ -7,7 +7,7 @@ import com.refinedmods.refinedstorage.common.content.Blocks; import com.refinedmods.refinedstorage.common.content.Items; import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; -import com.refinedmods.refinedstorage.common.support.resource.FluidResourceRendering; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; import java.util.Optional; import javax.annotation.Nullable; @@ -57,7 +57,7 @@ protected boolean hasCapacity() { @Override protected String formatAmount(final long amount) { - return FluidResourceRendering.format(amount); + return RefinedStorageApi.INSTANCE.getResourceRendering(FluidResource.class).formatAmount(amount); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockScreen.java index e9e9e344d..75493ff6c 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockScreen.java @@ -1,6 +1,7 @@ package com.refinedmods.refinedstorage.common.storage.storageblock; -import com.refinedmods.refinedstorage.common.support.resource.FluidResourceRendering; +import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; @@ -13,7 +14,7 @@ public FluidStorageBlockScreen(final AbstractStorageBlockContainerMenu menu, } @Override - protected String formatQuantity(final long qty) { - return FluidResourceRendering.format(qty); + protected String formatAmount(final long amount) { + return RefinedStorageApi.INSTANCE.getResourceRendering(FluidResource.class).formatAmount(amount); } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/FluidStorageDiskItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/FluidStorageDiskItem.java index 7a76aa02a..01bc98ae4 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/FluidStorageDiskItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/FluidStorageDiskItem.java @@ -9,7 +9,7 @@ import com.refinedmods.refinedstorage.common.content.Items; import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; import com.refinedmods.refinedstorage.common.storage.StorageTypes; -import com.refinedmods.refinedstorage.common.support.resource.FluidResourceRendering; +import com.refinedmods.refinedstorage.common.support.resource.FluidResource; import java.util.Optional; import javax.annotation.Nullable; @@ -54,7 +54,7 @@ protected boolean hasCapacity() { @Override protected String formatAmount(final long amount) { - return FluidResourceRendering.format(amount); + return RefinedStorageApi.INSTANCE.getResourceRendering(FluidResource.class).formatAmount(amount); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorBlockEntityRenderer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorBlockEntityRenderer.java index 519001ddf..2f2ac2506 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorBlockEntityRenderer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorBlockEntityRenderer.java @@ -61,14 +61,14 @@ private void doRender(final Level level, final BiDirection direction, final ResourceKey resource, final long amount) { - final ResourceRendering resourceRendering = RefinedStorageApi.INSTANCE.getResourceRendering(resource); + final ResourceRendering rendering = RefinedStorageApi.INSTANCE.getResourceRendering(resource.getClass()); doRender( poseStack, vertexConsumers, direction.getQuaternion(), - resourceRendering.getDisplayedAmount(amount, false), + rendering.formatAmount(amount, false), level, - resourceRendering, + rendering, resource ); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBaseScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBaseScreen.java index 5cf47b3a0..b9379a411 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBaseScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBaseScreen.java @@ -209,7 +209,7 @@ private List getResourceSlotHelpTooltip(final ItemStack private List getTooltipForResource(final ResourceKey resource, final ResourceSlot resourceSlot) { final List tooltip = RefinedStorageApi.INSTANCE - .getResourceRendering(resource) + .getResourceRendering(resource.getClass()) .getTooltip(resource) .stream() .map(Component::getVisualOrderText) diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/ResourceSlotRendering.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/ResourceSlotRendering.java index f351c64c3..8981eff74 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/ResourceSlotRendering.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/ResourceSlotRendering.java @@ -41,7 +41,7 @@ private static void render(final GuiGraphics graphics, final ResourceKey resource, final long amount, final boolean renderAmount) { - final ResourceRendering rendering = RefinedStorageApi.INSTANCE.getResourceRendering(resource); + final ResourceRendering rendering = RefinedStorageApi.INSTANCE.getResourceRendering(resource.getClass()); rendering.render(resource, graphics, x, y); if (renderAmount) { render(graphics, x, y, amount, rendering); @@ -57,7 +57,7 @@ public static void render(final GuiGraphics graphics, graphics, x, y, - rendering.getDisplayedAmount(amount, true), + rendering.formatAmount(amount, true), requireNonNullElse(ChatFormatting.WHITE.getColor(), 15), true ); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceRendering.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceRendering.java index 7086a8d1f..2bfdc45a3 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceRendering.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceRendering.java @@ -23,12 +23,18 @@ public class FluidResourceRendering implements ResourceRendering { private static final DecimalFormat FORMATTER = new DecimalFormat("#,###.#", DecimalFormatSymbols.getInstance(Locale.US)); + private final long bucketAmount; + + public FluidResourceRendering(final long bucketAmount) { + this.bucketAmount = bucketAmount; + } + @Override - public String getDisplayedAmount(final long amount, final boolean withUnits) { + public String formatAmount(final long amount, final boolean withUnits) { if (!withUnits) { - return format(amount); + return format(amount, bucketAmount); } - return formatWithUnits(amount); + return formatWithUnits(amount, bucketAmount); } @Override @@ -67,8 +73,8 @@ public void render(final ResourceKey resource, Platform.INSTANCE.getFluidRenderer().render(poseStack, renderTypeBuffer, light, fluidResource); } - public static String formatWithUnits(final long droplets) { - final double buckets = convertToBuckets(droplets); + private static String formatWithUnits(final long droplets, final long bucketAmount) { + final double buckets = convertToBuckets(droplets, bucketAmount); if (buckets >= 1) { return AmountFormatting.formatWithUnits((long) Math.floor(buckets)); } else { @@ -76,12 +82,12 @@ public static String formatWithUnits(final long droplets) { } } - public static String format(final long droplets) { - final double buckets = convertToBuckets(droplets); + private static String format(final long droplets, final long bucketAmount) { + final double buckets = convertToBuckets(droplets, bucketAmount); return FORMATTER.format(buckets); } - private static double convertToBuckets(final long droplets) { - return droplets / (double) Platform.INSTANCE.getBucketAmount(); + private static double convertToBuckets(final long droplets, final long bucketAmount) { + return droplets / (double) bucketAmount; } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResourceRendering.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResourceRendering.java index 7ea0b9e85..544025429 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResourceRendering.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResourceRendering.java @@ -32,13 +32,10 @@ private ItemStack getStack(final ItemResource itemResource) { } @Override - public String getDisplayedAmount(final long amount, final boolean withUnits) { + public String formatAmount(final long amount, final boolean withUnits) { if (!withUnits) { return AmountFormatting.format(amount); } - if (amount == 1) { - return ""; - } return AmountFormatting.formatWithUnits(amount); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/MouseClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/MouseClientTooltipComponent.java index bdcd74adb..8ddf14d05 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/MouseClientTooltipComponent.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/MouseClientTooltipComponent.java @@ -102,7 +102,7 @@ public static ClientTooltipComponent resource(final Type type, @Nullable final String amount) { return new MouseClientTooltipComponent( type, - (graphics, x, y) -> RefinedStorageApi.INSTANCE.getResourceRendering(resource) + (graphics, x, y) -> RefinedStorageApi.INSTANCE.getResourceRendering(resource.getClass()) .render(resource, graphics, x, y), amount ); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/ResourceClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/ResourceClientTooltipComponent.java index 4a43b83f1..f39158f6f 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/ResourceClientTooltipComponent.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/ResourceClientTooltipComponent.java @@ -33,7 +33,7 @@ public int getWidth(final Font font) { @Override public void renderImage(final Font font, final int x, final int y, final GuiGraphics graphics) { - RefinedStorageApi.INSTANCE.getResourceRendering(resourceAmount.resource()).render( + RefinedStorageApi.INSTANCE.getResourceRendering(resourceAmount.resource().getClass()).render( resourceAmount.resource(), graphics, x, @@ -50,9 +50,9 @@ public void renderImage(final Font font, final int x, final int y, final GuiGrap private static Component getNameWithAmount(final ResourceAmount resourceAmount) { final ResourceRendering rendering = RefinedStorageApi.INSTANCE.getResourceRendering( - resourceAmount.resource() + resourceAmount.resource().getClass() ); - final String amount = rendering.getDisplayedAmount(resourceAmount.amount(), true); + final String amount = rendering.formatAmount(resourceAmount.amount(), true); final Component displayName = rendering.getDisplayName(resourceAmount.resource()); if (amount.isEmpty()) { return displayName; diff --git a/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/TestPlatform.java b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/TestPlatform.java deleted file mode 100644 index e15c86a2f..000000000 --- a/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/TestPlatform.java +++ /dev/null @@ -1,241 +0,0 @@ -package com.refinedmods.refinedstorage.common; - -import com.refinedmods.refinedstorage.api.core.Action; -import com.refinedmods.refinedstorage.api.grid.view.GridResourceFactory; -import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; -import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.common.api.grid.strategy.GridInsertionStrategyFactory; -import com.refinedmods.refinedstorage.common.api.support.network.NetworkNodeContainerProvider; -import com.refinedmods.refinedstorage.common.api.support.resource.FluidOperationResult; -import com.refinedmods.refinedstorage.common.support.containermenu.MenuOpener; -import com.refinedmods.refinedstorage.common.support.containermenu.TransferManager; -import com.refinedmods.refinedstorage.common.support.render.FluidRenderer; -import com.refinedmods.refinedstorage.common.support.resource.FluidResource; -import com.refinedmods.refinedstorage.common.support.resource.ItemResource; - -import java.io.File; -import java.util.List; -import java.util.Optional; -import java.util.UUID; -import java.util.function.BiConsumer; -import javax.annotation.Nullable; - -import net.minecraft.client.KeyMapping; -import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.gui.components.EditBox; -import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.core.HolderLookup; -import net.minecraft.core.NonNullList; -import net.minecraft.network.chat.Component; -import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import net.minecraft.server.level.ServerLevel; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.sounds.SoundEvent; -import net.minecraft.world.Container; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.inventory.CraftingContainer; -import net.minecraft.world.inventory.Slot; -import net.minecraft.world.inventory.tooltip.TooltipComponent; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.CraftingInput; -import net.minecraft.world.item.crafting.CraftingRecipe; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.LevelReader; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.LiquidBlock; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.saveddata.SavedData; -import net.minecraft.world.phys.BlockHitResult; - -public class TestPlatform implements Platform { - private final long bucketAmount; - - public TestPlatform(final long bucketAmount) { - this.bucketAmount = bucketAmount; - } - - @Override - public MenuOpener getMenuOpener() { - throw new UnsupportedOperationException(); - } - - @Override - public long getBucketAmount() { - return bucketAmount; - } - - @Override - public Config getConfig() { - throw new UnsupportedOperationException(); - } - - @Override - public boolean canEditBoxLoseFocus(final EditBox editBox) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isKeyDown(final KeyMapping keyMapping) { - throw new UnsupportedOperationException(); - } - - @Override - public GridResourceFactory getItemGridResourceFactory() { - throw new UnsupportedOperationException(); - } - - @Override - public GridResourceFactory getFluidGridResourceFactory() { - throw new UnsupportedOperationException(); - } - - @Override - public GridInsertionStrategyFactory getDefaultGridInsertionStrategyFactory() { - throw new UnsupportedOperationException(); - } - - @Override - public FluidRenderer getFluidRenderer() { - throw new UnsupportedOperationException(); - } - - @Override - public Optional drainContainer(final ItemStack container) { - throw new UnsupportedOperationException(); - } - - @Override - public Optional fillContainer(final ItemStack container, - final ResourceAmount resourceAmount) { - throw new UnsupportedOperationException(); - } - - @Override - public Optional getFilledBucket(final FluidResource fluidResource) { - throw new UnsupportedOperationException(); - } - - @Override - public TransferManager createTransferManager(final AbstractContainerMenu containerMenu) { - throw new UnsupportedOperationException(); - } - - @Override - public long insertIntoContainer(final Container container, final ItemResource itemResource, final long amount, - final Action action) { - throw new UnsupportedOperationException(); - } - - @Override - public ItemStack getCloneItemStack(final BlockState state, final Level level, final BlockHitResult hitResult, - final Player player) { - throw new UnsupportedOperationException(); - } - - @Override - public NonNullList getRemainingCraftingItems(final Player player, final CraftingRecipe craftingRecipe, - final CraftingInput input) { - throw new UnsupportedOperationException(); - } - - @Override - public void onItemCrafted(final Player player, final ItemStack craftedStack, final CraftingContainer container) { - throw new UnsupportedOperationException(); - } - - @Override - public Player getFakePlayer(final ServerLevel level, @Nullable final UUID playerId) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean canBreakBlock(final Level level, final BlockPos pos, final BlockState state, final Player player) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean placeBlock(final Level level, final BlockPos pos, final Direction direction, final Player player, - final ItemStack stack) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean placeFluid(final Level level, final BlockPos pos, final Direction direction, final Player player, - final FluidResource fluidResource) { - throw new UnsupportedOperationException(); - } - - @Override - public ItemStack getBlockAsItemStack(final Block block, final BlockState state, final Direction direction, - final LevelReader level, - final BlockPos pos, final Player player) { - throw new UnsupportedOperationException(); - } - - @Override - public Optional getBucketPickupSound(final LiquidBlock liquidBlock, final BlockState state) { - throw new UnsupportedOperationException(); - } - - @Override - public List processTooltipComponents(final ItemStack stack, final GuiGraphics graphics, - final int mouseX, - final Optional imageComponent, - final List components) { - throw new UnsupportedOperationException(); - } - - @Override - public void renderTooltip(final GuiGraphics graphics, final List components, final int x, - final int y) { - throw new UnsupportedOperationException(); - } - - @Override - public Optional getEnergyStorage(final ItemStack stack) { - throw new UnsupportedOperationException(); - } - - @Override - public void sendPacketToServer(final T packet) { - throw new UnsupportedOperationException(); - } - - @Override - public void sendPacketToClient(final ServerPlayer player, final T packet) { - throw new UnsupportedOperationException(); - } - - @Override - public void saveSavedData(final SavedData savedData, final File file, final HolderLookup.Provider provider, - final BiConsumer defaultSaveFunction) { - throw new UnsupportedOperationException(); - } - - @Nullable - @Override - public NetworkNodeContainerProvider getContainerProvider(final Level level, final BlockPos pos, - @Nullable final Direction direction) { - throw new UnsupportedOperationException(); - } - - @Nullable - @Override - public NetworkNodeContainerProvider getContainerProviderSafely(final Level level, final BlockPos pos, - @Nullable final Direction direction) { - throw new UnsupportedOperationException(); - } - - @Override - public int getItemColor(final ItemStack stack, final int tintIndex) { - throw new UnsupportedOperationException(); - } - - @Override - public void setSlotY(final Slot slot, final int y) { - throw new UnsupportedOperationException(); - } -} diff --git a/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceRenderingTest.java b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceRenderingTest.java index e72d9b78a..29a6295ad 100644 --- a/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceRenderingTest.java +++ b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceRenderingTest.java @@ -1,9 +1,5 @@ package com.refinedmods.refinedstorage.common.support.resource; -import com.refinedmods.refinedstorage.common.PlatformProxy; -import com.refinedmods.refinedstorage.common.TestPlatform; - -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; @@ -11,37 +7,34 @@ class FluidResourceRenderingTest { private static final long BUCKET_AMOUNT = 1000; - @BeforeAll - static void setUp() { - PlatformProxy.loadPlatform(new TestPlatform(BUCKET_AMOUNT)); - } + private final FluidResourceRendering sut = new FluidResourceRendering(BUCKET_AMOUNT); @Test void shouldFormatWithUnitsForCompleteBuckets() { - assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT)).isEqualTo("1"); - assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT * 2)).isEqualTo("2"); - assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT * 3)).isEqualTo("3"); - assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT * 1000)).isEqualTo("1K"); + assertThat(sut.formatAmount(BUCKET_AMOUNT, true)).isEqualTo("1"); + assertThat(sut.formatAmount(BUCKET_AMOUNT * 2, true)).isEqualTo("2"); + assertThat(sut.formatAmount(BUCKET_AMOUNT * 3, true)).isEqualTo("3"); + assertThat(sut.formatAmount(BUCKET_AMOUNT * 1000, true)).isEqualTo("1K"); } @Test void shouldFormatWithUnitsForPartialBuckets() { - assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT + (BUCKET_AMOUNT / 2))).isEqualTo("1"); - assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT + 1)).isEqualTo("1"); + assertThat(sut.formatAmount(BUCKET_AMOUNT + (BUCKET_AMOUNT / 2), true)).isEqualTo("1"); + assertThat(sut.formatAmount(BUCKET_AMOUNT + 1, true)).isEqualTo("1"); } @Test void shouldFormatWithUnitsForLessThan1Bucket() { - assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT / 2)).isEqualTo("0.5"); - assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT / 3)).isEqualTo("0.3"); + assertThat(sut.formatAmount(BUCKET_AMOUNT / 2, true)).isEqualTo("0.5"); + assertThat(sut.formatAmount(BUCKET_AMOUNT / 3, true)).isEqualTo("0.3"); } @Test void shouldFormatWithoutUnits() { - assertThat(FluidResourceRendering.format(BUCKET_AMOUNT)).isEqualTo("1"); - assertThat(FluidResourceRendering.format(BUCKET_AMOUNT + (BUCKET_AMOUNT / 2))).isEqualTo("1.5"); - assertThat(FluidResourceRendering.format(BUCKET_AMOUNT + (BUCKET_AMOUNT / 3))).isEqualTo("1.3"); - assertThat(FluidResourceRendering.format(BUCKET_AMOUNT * 1000)).isEqualTo("1,000"); - assertThat(FluidResourceRendering.format((BUCKET_AMOUNT * 1000) + (BUCKET_AMOUNT / 3))).isEqualTo("1,000.3"); + assertThat(sut.formatAmount(BUCKET_AMOUNT)).isEqualTo("1"); + assertThat(sut.formatAmount(BUCKET_AMOUNT + (BUCKET_AMOUNT / 2))).isEqualTo("1.5"); + assertThat(sut.formatAmount(BUCKET_AMOUNT + (BUCKET_AMOUNT / 3))).isEqualTo("1.3"); + assertThat(sut.formatAmount(BUCKET_AMOUNT * 1000)).isEqualTo("1,000"); + assertThat(sut.formatAmount((BUCKET_AMOUNT * 1000) + (BUCKET_AMOUNT / 3))).isEqualTo("1,000.3"); } } From a78224c8a02c4781e426e4cd9480ff81a3d68d24 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sat, 10 Aug 2024 13:31:07 +0200 Subject: [PATCH 09/20] refactor: move amount formatting from api to common In IdentifierUtil --- refinedstorage-common-api/build.gradle.kts | 6 -- .../common/api/support/AmountFormatting.java | 60 ------------- .../api/support/AmountFormattingTest.java | 77 ---------------- .../screen/hint/ItemGridInsertionHint.java | 5 +- .../common/grid/view/ItemGridResource.java | 12 +-- .../common/storage/AbstractStorageScreen.java | 4 +- .../FluidStorageBlockBlockItem.java | 8 +- .../ItemStorageBlockBlockItem.java | 12 ++- .../storagedisk/FluidStorageDiskItem.java | 8 +- .../storagedisk/ItemStorageDiskItem.java | 12 ++- .../resource/FluidResourceRendering.java | 4 +- .../resource/ItemResourceRendering.java | 8 +- .../common/util/IdentifierUtil.java | 57 ++++++++++-- .../common/util/IdentifierUtilTest.java | 90 +++++++++++++++++++ 14 files changed, 181 insertions(+), 182 deletions(-) delete mode 100644 refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/AmountFormatting.java delete mode 100644 refinedstorage-common-api/src/test/java/com/refinedmods/refinedstorage/common/api/support/AmountFormattingTest.java create mode 100644 refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/util/IdentifierUtilTest.java diff --git a/refinedstorage-common-api/build.gradle.kts b/refinedstorage-common-api/build.gradle.kts index 14141ebd5..a0ab6c7e1 100644 --- a/refinedstorage-common-api/build.gradle.kts +++ b/refinedstorage-common-api/build.gradle.kts @@ -4,7 +4,6 @@ plugins { refinedarchitect { common() - testing() javadoc() publishing { maven = true @@ -22,9 +21,4 @@ dependencies { api(project(":refinedstorage-resource-api")) api(project(":refinedstorage-network-api")) api(project(":refinedstorage-grid-api")) - testImplementation(libs.junit.api) - testImplementation(libs.junit.params) - testImplementation(libs.assertj) - testImplementation(libs.equalsverifier) - testRuntimeOnly(libs.junit.engine) } diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/AmountFormatting.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/AmountFormatting.java deleted file mode 100644 index 6997df638..000000000 --- a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/AmountFormatting.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.refinedmods.refinedstorage.common.api.support; - -import java.math.RoundingMode; -import java.text.DecimalFormat; -import java.text.DecimalFormatSymbols; -import java.util.Locale; - -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.0") -public final class AmountFormatting { - private static final DecimalFormat FORMATTER_WITH_UNITS = new DecimalFormat( - "####0.#", - DecimalFormatSymbols.getInstance(Locale.US) - ); - private static final DecimalFormat FORMATTER = new DecimalFormat( - "#,###", - DecimalFormatSymbols.getInstance(Locale.US) - ); - - static { - FORMATTER_WITH_UNITS.setRoundingMode(RoundingMode.FLOOR); - } - - private AmountFormatting() { - } - - public static String formatWithUnits(final long qty) { - if (qty >= 1_000_000_000) { - return formatBillion(qty); - } else if (qty >= 1_000_000) { - return formatMillion(qty); - } else if (qty >= 1000) { - return formatThousand(qty); - } - return String.valueOf(qty); - } - - private static String formatBillion(final long qty) { - return FORMATTER_WITH_UNITS.format(qty / 1_000_000_000D) + "B"; - } - - private static String formatMillion(final long qty) { - if (qty >= 100_000_000) { - return FORMATTER_WITH_UNITS.format(Math.floor(qty / 1_000_000D)) + "M"; - } - return FORMATTER_WITH_UNITS.format(qty / 1_000_000D) + "M"; - } - - private static String formatThousand(final long qty) { - if (qty >= 100_000) { - return FORMATTER_WITH_UNITS.format(Math.floor(qty / 1000D)) + "K"; - } - return FORMATTER_WITH_UNITS.format(qty / 1000D) + "K"; - } - - public static String format(final long qty) { - return FORMATTER.format(qty); - } -} diff --git a/refinedstorage-common-api/src/test/java/com/refinedmods/refinedstorage/common/api/support/AmountFormattingTest.java b/refinedstorage-common-api/src/test/java/com/refinedmods/refinedstorage/common/api/support/AmountFormattingTest.java deleted file mode 100644 index faefd7d76..000000000 --- a/refinedstorage-common-api/src/test/java/com/refinedmods/refinedstorage/common/api/support/AmountFormattingTest.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.refinedmods.refinedstorage.common.api.support; - -import org.junit.jupiter.api.Test; - -import static org.assertj.core.api.Assertions.assertThat; - -class AmountFormattingTest { - @Test - void shouldFormatWithUnitsForSmallNumber() { - // Act & assert - assertThat(AmountFormatting.formatWithUnits(0)).isEqualTo("0"); - assertThat(AmountFormatting.formatWithUnits(1)).isEqualTo("1"); - assertThat(AmountFormatting.formatWithUnits(10)).isEqualTo("10"); - assertThat(AmountFormatting.formatWithUnits(105)).isEqualTo("105"); - } - - @Test - void shouldFormatWithUnitsForThousands() { - // Act & assert - assertThat(AmountFormatting.formatWithUnits(1000)).isEqualTo("1K"); - assertThat(AmountFormatting.formatWithUnits(1510)).isEqualTo("1.5K"); - - assertThat(AmountFormatting.formatWithUnits(10_000)).isEqualTo("10K"); - assertThat(AmountFormatting.formatWithUnits(10_510)).isEqualTo("10.5K"); - assertThat(AmountFormatting.formatWithUnits(99_999)).isEqualTo("99.9K"); - - assertThat(AmountFormatting.formatWithUnits(100_000)).isEqualTo("100K"); - assertThat(AmountFormatting.formatWithUnits(100_500)).isEqualTo("100K"); - assertThat(AmountFormatting.formatWithUnits(100_999)).isEqualTo("100K"); - - assertThat(AmountFormatting.formatWithUnits(101_000)).isEqualTo("101K"); - assertThat(AmountFormatting.formatWithUnits(101_500)).isEqualTo("101K"); - assertThat(AmountFormatting.formatWithUnits(101_999)).isEqualTo("101K"); - } - - @Test - void shouldFormatWithUnitsForMillions() { - // Act & assert - assertThat(AmountFormatting.formatWithUnits(1_000_000)).isEqualTo("1M"); - assertThat(AmountFormatting.formatWithUnits(1_510_000)).isEqualTo("1.5M"); - - assertThat(AmountFormatting.formatWithUnits(10_000_000)).isEqualTo("10M"); - assertThat(AmountFormatting.formatWithUnits(10_510_000)).isEqualTo("10.5M"); - assertThat(AmountFormatting.formatWithUnits(99_999_999)).isEqualTo("99.9M"); - - assertThat(AmountFormatting.formatWithUnits(100_000_000)).isEqualTo("100M"); - assertThat(AmountFormatting.formatWithUnits(100_510_000)).isEqualTo("100M"); - assertThat(AmountFormatting.formatWithUnits(100_999_000)).isEqualTo("100M"); - - assertThat(AmountFormatting.formatWithUnits(101_000_000)).isEqualTo("101M"); - assertThat(AmountFormatting.formatWithUnits(101_510_000)).isEqualTo("101M"); - assertThat(AmountFormatting.formatWithUnits(101_999_000)).isEqualTo("101M"); - } - - @Test - void shouldFormatWithUnitsForBillions() { - // Act & assert - assertThat(AmountFormatting.formatWithUnits(1_000_000_000)).isEqualTo("1B"); - assertThat(AmountFormatting.formatWithUnits(1_010_000_000)).isEqualTo("1B"); - assertThat(AmountFormatting.formatWithUnits(1_100_000_000)).isEqualTo("1.1B"); - assertThat(AmountFormatting.formatWithUnits(1_100_001_000)).isEqualTo("1.1B"); - assertThat(AmountFormatting.formatWithUnits(1_920_001_000)).isEqualTo("1.9B"); - } - - @Test - void shouldFormatWithoutUnits() { - // Act & assert - assertThat(AmountFormatting.format(0)).isEqualTo("0"); - assertThat(AmountFormatting.format(1)).isEqualTo("1"); - assertThat(AmountFormatting.format(10)).isEqualTo("10"); - assertThat(AmountFormatting.format(105)).isEqualTo("105"); - assertThat(AmountFormatting.format(1050)).isEqualTo("1,050"); - assertThat(AmountFormatting.format(10500)).isEqualTo("10,500"); - assertThat(AmountFormatting.format(100500)).isEqualTo("100,500"); - assertThat(AmountFormatting.format(1000500)).isEqualTo("1,000,500"); - } -} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/ItemGridInsertionHint.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/ItemGridInsertionHint.java index 819e6f36a..d405ff1b2 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/ItemGridInsertionHint.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/hint/ItemGridInsertionHint.java @@ -1,7 +1,6 @@ package com.refinedmods.refinedstorage.common.grid.screen.hint; import com.refinedmods.refinedstorage.common.api.grid.GridInsertionHint; -import com.refinedmods.refinedstorage.common.api.support.AmountFormatting; import com.refinedmods.refinedstorage.common.support.tooltip.MouseClientTooltipComponent; import java.util.Optional; @@ -9,13 +8,15 @@ import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; import net.minecraft.world.item.ItemStack; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.format; + public class ItemGridInsertionHint implements GridInsertionHint { @Override public Optional getHint(final ItemStack carried) { return Optional.of(MouseClientTooltipComponent.item( MouseClientTooltipComponent.Type.LEFT, carried, - carried.getCount() == 1 ? null : AmountFormatting.format(carried.getCount()) + carried.getCount() == 1 ? null : format(carried.getCount()) )); } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/ItemGridResource.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/ItemGridResource.java index 25912cab7..dbf43035e 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/ItemGridResource.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/ItemGridResource.java @@ -7,7 +7,6 @@ import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategy; import com.refinedmods.refinedstorage.common.api.grid.strategy.GridScrollingStrategy; import com.refinedmods.refinedstorage.common.api.grid.view.AbstractPlatformGridResource; -import com.refinedmods.refinedstorage.common.api.support.AmountFormatting; import com.refinedmods.refinedstorage.common.api.support.resource.ResourceType; import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import com.refinedmods.refinedstorage.common.support.resource.ResourceTypes; @@ -28,6 +27,9 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.format; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.formatWithUnits; + public class ItemGridResource extends AbstractPlatformGridResource { private final int id; private final ItemStack itemStack; @@ -73,12 +75,12 @@ public List getExtractionHints(final GridView view) { MouseClientTooltipComponent.itemWithDecorations( MouseClientTooltipComponent.Type.LEFT, itemStack, - extractableAmount == 1 ? null : AmountFormatting.format(extractableAmount) + extractableAmount == 1 ? null : format(extractableAmount) ), MouseClientTooltipComponent.itemWithDecorations( MouseClientTooltipComponent.Type.RIGHT, itemStack, - halfExtractionAmount == 1 ? null : AmountFormatting.format(halfExtractionAmount) + halfExtractionAmount == 1 ? null : format(halfExtractionAmount) ) ); } @@ -104,12 +106,12 @@ public void render(final GuiGraphics graphics, final int x, final int y) { @Override public String getDisplayedAmount(final GridView view) { - return AmountFormatting.formatWithUnits(getAmount(view)); + return formatWithUnits(getAmount(view)); } @Override public String getAmountInTooltip(final GridView view) { - return AmountFormatting.format(getAmount(view)); + return format(getAmount(view)); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractStorageScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractStorageScreen.java index a069a87cb..6b5fa984d 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractStorageScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/AbstractStorageScreen.java @@ -1,6 +1,5 @@ package com.refinedmods.refinedstorage.common.storage; -import com.refinedmods.refinedstorage.common.api.support.AmountFormatting; import com.refinedmods.refinedstorage.common.support.AbstractBaseScreen; import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; import com.refinedmods.refinedstorage.common.support.widget.FuzzyModeSideButtonWidget; @@ -12,6 +11,7 @@ import net.minecraft.world.entity.player.Inventory; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.format; public abstract class AbstractStorageScreen extends AbstractBaseScreen { private static final Component ALLOW_FILTER_MODE_HELP = createTranslation("gui", "storage.filter_mode.allow.help"); @@ -70,6 +70,6 @@ protected void containerTick() { } protected String formatAmount(final long qty) { - return AmountFormatting.format(qty); + return format(qty); } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockItem.java index afbba908c..f46eb4e6b 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockItem.java @@ -2,7 +2,6 @@ import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; import com.refinedmods.refinedstorage.common.api.storage.AbstractStorageContainerBlockItem; -import com.refinedmods.refinedstorage.common.api.support.AmountFormatting; import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; import com.refinedmods.refinedstorage.common.content.Blocks; import com.refinedmods.refinedstorage.common.content.Items; @@ -22,6 +21,7 @@ import net.minecraft.world.level.block.state.BlockState; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.format; public class FluidStorageBlockBlockItem extends AbstractStorageContainerBlockItem { private static final Component CREATIVE_HELP = createTranslation("item", "creative_fluid_storage_block.help"); @@ -43,11 +43,7 @@ private static Component getHelpText(final FluidStorageVariant variant) { if (variant.getCapacityInBuckets() == null) { return CREATIVE_HELP; } - return createTranslation( - "item", - "fluid_storage_block.help", - AmountFormatting.format(variant.getCapacityInBuckets()) - ); + return createTranslation("item", "fluid_storage_block.help", format(variant.getCapacityInBuckets())); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockBlockItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockBlockItem.java index 99cdb125a..c19cab55a 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockBlockItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockBlockItem.java @@ -2,7 +2,6 @@ import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; import com.refinedmods.refinedstorage.common.api.storage.AbstractStorageContainerBlockItem; -import com.refinedmods.refinedstorage.common.api.support.AmountFormatting; import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; import com.refinedmods.refinedstorage.common.content.Blocks; import com.refinedmods.refinedstorage.common.content.Items; @@ -21,6 +20,7 @@ import net.minecraft.world.level.block.state.BlockState; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.format; public class ItemStorageBlockBlockItem extends AbstractStorageContainerBlockItem { private static final Component CREATIVE_HELP = createTranslation("item", "creative_storage_block.help"); @@ -35,9 +35,13 @@ public ItemStorageBlockBlockItem(final Block block, final ItemStorageVariant var RefinedStorageApi.INSTANCE.getStorageContainerItemHelper() ); this.variant = variant; - this.helpText = variant.getCapacity() == null + this.helpText = getHelpText(variant); + } + + private static Component getHelpText(final ItemStorageVariant variant) { + return variant.getCapacity() == null ? CREATIVE_HELP - : createTranslation("item", "storage_block.help", AmountFormatting.format(variant.getCapacity())); + : createTranslation("item", "storage_block.help", format(variant.getCapacity())); } @Override @@ -47,7 +51,7 @@ protected boolean hasCapacity() { @Override protected String formatAmount(final long amount) { - return AmountFormatting.format(amount); + return format(amount); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/FluidStorageDiskItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/FluidStorageDiskItem.java index 01bc98ae4..eb5f9b939 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/FluidStorageDiskItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/FluidStorageDiskItem.java @@ -4,7 +4,6 @@ import com.refinedmods.refinedstorage.common.api.storage.AbstractStorageContainerItem; import com.refinedmods.refinedstorage.common.api.storage.SerializableStorage; import com.refinedmods.refinedstorage.common.api.storage.StorageRepository; -import com.refinedmods.refinedstorage.common.api.support.AmountFormatting; import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; import com.refinedmods.refinedstorage.common.content.Items; import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; @@ -20,6 +19,7 @@ import net.minecraft.world.item.ItemStack; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.format; public class FluidStorageDiskItem extends AbstractStorageContainerItem { private static final Component CREATIVE_HELP = createTranslation("item", "creative_fluid_storage_disk.help"); @@ -40,11 +40,7 @@ private static Component getHelpText(final FluidStorageVariant variant) { if (variant.getCapacityInBuckets() == null) { return CREATIVE_HELP; } - return createTranslation( - "item", - "fluid_storage_disk.help", - AmountFormatting.format(variant.getCapacityInBuckets()) - ); + return createTranslation("item", "fluid_storage_disk.help", format(variant.getCapacityInBuckets())); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/ItemStorageDiskItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/ItemStorageDiskItem.java index 8b72454ee..7ba29e021 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/ItemStorageDiskItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/ItemStorageDiskItem.java @@ -4,7 +4,6 @@ import com.refinedmods.refinedstorage.common.api.storage.AbstractStorageContainerItem; import com.refinedmods.refinedstorage.common.api.storage.SerializableStorage; import com.refinedmods.refinedstorage.common.api.storage.StorageRepository; -import com.refinedmods.refinedstorage.common.api.support.AmountFormatting; import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; import com.refinedmods.refinedstorage.common.content.Items; import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; @@ -19,6 +18,7 @@ import net.minecraft.world.item.ItemStack; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.format; public class ItemStorageDiskItem extends AbstractStorageContainerItem { private static final Component CREATIVE_HELP = createTranslation("item", "creative_storage_disk.help"); @@ -32,9 +32,13 @@ public ItemStorageDiskItem(final ItemStorageVariant variant) { RefinedStorageApi.INSTANCE.getStorageContainerItemHelper() ); this.variant = variant; - this.helpText = variant.getCapacity() == null + this.helpText = getHelpText(variant); + } + + private static Component getHelpText(final ItemStorageVariant variant) { + return variant.getCapacity() == null ? CREATIVE_HELP - : createTranslation("item", "storage_disk.help", AmountFormatting.format(variant.getCapacity())); + : createTranslation("item", "storage_disk.help", format(variant.getCapacity())); } @Override @@ -44,7 +48,7 @@ protected boolean hasCapacity() { @Override protected String formatAmount(final long amount) { - return AmountFormatting.format(amount); + return format(amount); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceRendering.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceRendering.java index 2bfdc45a3..57506c10b 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceRendering.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceRendering.java @@ -2,8 +2,8 @@ import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.common.Platform; -import com.refinedmods.refinedstorage.common.api.support.AmountFormatting; import com.refinedmods.refinedstorage.common.api.support.resource.ResourceRendering; +import com.refinedmods.refinedstorage.common.util.IdentifierUtil; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; @@ -76,7 +76,7 @@ public void render(final ResourceKey resource, private static String formatWithUnits(final long droplets, final long bucketAmount) { final double buckets = convertToBuckets(droplets, bucketAmount); if (buckets >= 1) { - return AmountFormatting.formatWithUnits((long) Math.floor(buckets)); + return IdentifierUtil.formatWithUnits((long) Math.floor(buckets)); } else { return LESS_THAN_1_BUCKET_FORMATTER.format(buckets); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResourceRendering.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResourceRendering.java index 544025429..d4b107f7c 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResourceRendering.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/ItemResourceRendering.java @@ -1,7 +1,6 @@ package com.refinedmods.refinedstorage.common.support.resource; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.common.api.support.AmountFormatting; import com.refinedmods.refinedstorage.common.api.support.resource.ResourceRendering; import java.util.Collections; @@ -23,6 +22,9 @@ import net.minecraft.world.level.Level; import org.joml.Matrix4f; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.format; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.formatWithUnits; + public class ItemResourceRendering implements ResourceRendering { public static final Matrix4f IN_WORLD_SCALE = new Matrix4f().scale(0.3F, 0.3F, 0.001f); private final Map stackCache = new HashMap<>(); @@ -34,9 +36,9 @@ private ItemStack getStack(final ItemResource itemResource) { @Override public String formatAmount(final long amount, final boolean withUnits) { if (!withUnits) { - return AmountFormatting.format(amount); + return format(amount); } - return AmountFormatting.formatWithUnits(amount); + return formatWithUnits(amount); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/IdentifierUtil.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/IdentifierUtil.java index f9fcd40ae..2c074cd29 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/IdentifierUtil.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/IdentifierUtil.java @@ -1,6 +1,9 @@ package com.refinedmods.refinedstorage.common.util; -import com.refinedmods.refinedstorage.common.api.support.AmountFormatting; +import java.math.RoundingMode; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.util.Locale; import net.minecraft.ChatFormatting; import net.minecraft.network.chat.Component; @@ -14,6 +17,19 @@ public final class IdentifierUtil { public static final MutableComponent YES = Component.translatable("gui.yes"); public static final MutableComponent NO = Component.translatable("gui.no"); + private static final DecimalFormat FORMATTER_WITH_UNITS = new DecimalFormat( + "####0.#", + DecimalFormatSymbols.getInstance(Locale.US) + ); + private static final DecimalFormat FORMATTER = new DecimalFormat( + "#,###", + DecimalFormatSymbols.getInstance(Locale.US) + ); + + static { + FORMATTER_WITH_UNITS.setRoundingMode(RoundingMode.FLOOR); + } + private IdentifierUtil() { } @@ -41,10 +57,8 @@ public static MutableComponent createStoredWithCapacityTranslation( return createTranslation( "misc", "stored_with_capacity", - Component.literal(stored == Long.MAX_VALUE ? "∞" : AmountFormatting.format(stored)) - .withStyle(ChatFormatting.WHITE), - Component.literal(capacity == Long.MAX_VALUE ? "∞" : AmountFormatting.format(capacity)) - .withStyle(ChatFormatting.WHITE), + Component.literal(stored == Long.MAX_VALUE ? "∞" : format(stored)).withStyle(ChatFormatting.WHITE), + Component.literal(capacity == Long.MAX_VALUE ? "∞" : format(capacity)).withStyle(ChatFormatting.WHITE), Component.literal(String.valueOf((int) (pct * 100D))) ).withStyle(ChatFormatting.GRAY); } @@ -73,4 +87,37 @@ private static String getTagTranslationKey(final String prefix, final ResourceLo final String fixedPath = id.getPath().replace('/', '.'); return prefix + id.getNamespace() + "." + fixedPath; } + + public static String formatWithUnits(final long qty) { + if (qty >= 1_000_000_000) { + return formatBillion(qty); + } else if (qty >= 1_000_000) { + return formatMillion(qty); + } else if (qty >= 1000) { + return formatThousand(qty); + } + return String.valueOf(qty); + } + + private static String formatBillion(final long qty) { + return FORMATTER_WITH_UNITS.format(qty / 1_000_000_000D) + "B"; + } + + private static String formatMillion(final long qty) { + if (qty >= 100_000_000) { + return FORMATTER_WITH_UNITS.format(Math.floor(qty / 1_000_000D)) + "M"; + } + return FORMATTER_WITH_UNITS.format(qty / 1_000_000D) + "M"; + } + + private static String formatThousand(final long qty) { + if (qty >= 100_000) { + return FORMATTER_WITH_UNITS.format(Math.floor(qty / 1000D)) + "K"; + } + return FORMATTER_WITH_UNITS.format(qty / 1000D) + "K"; + } + + public static String format(final long qty) { + return FORMATTER.format(qty); + } } diff --git a/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/util/IdentifierUtilTest.java b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/util/IdentifierUtilTest.java new file mode 100644 index 000000000..27c5c828a --- /dev/null +++ b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/util/IdentifierUtilTest.java @@ -0,0 +1,90 @@ +package com.refinedmods.refinedstorage.common.util; + +import net.minecraft.resources.ResourceLocation; +import org.junit.jupiter.api.Test; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.MOD_ID; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.format; +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.formatWithUnits; +import static org.assertj.core.api.Assertions.assertThat; + +class IdentifierUtilTest { + @Test + void verifyModId() { + assertThat(MOD_ID).isEqualTo("refinedstorage"); + assertThat(createIdentifier("test")).isEqualTo( + ResourceLocation.fromNamespaceAndPath("refinedstorage", "test") + ); + } + + @Test + void shouldFormatWithUnitsForSmallNumber() { + // Act & assert + assertThat(formatWithUnits(0)).isEqualTo("0"); + assertThat(formatWithUnits(1)).isEqualTo("1"); + assertThat(formatWithUnits(10)).isEqualTo("10"); + assertThat(formatWithUnits(105)).isEqualTo("105"); + } + + @Test + void shouldFormatWithUnitsForThousands() { + // Act & assert + assertThat(formatWithUnits(1000)).isEqualTo("1K"); + assertThat(formatWithUnits(1510)).isEqualTo("1.5K"); + + assertThat(formatWithUnits(10_000)).isEqualTo("10K"); + assertThat(formatWithUnits(10_510)).isEqualTo("10.5K"); + assertThat(formatWithUnits(99_999)).isEqualTo("99.9K"); + + assertThat(formatWithUnits(100_000)).isEqualTo("100K"); + assertThat(formatWithUnits(100_500)).isEqualTo("100K"); + assertThat(formatWithUnits(100_999)).isEqualTo("100K"); + + assertThat(formatWithUnits(101_000)).isEqualTo("101K"); + assertThat(formatWithUnits(101_500)).isEqualTo("101K"); + assertThat(formatWithUnits(101_999)).isEqualTo("101K"); + } + + @Test + void shouldFormatWithUnitsForMillions() { + // Act & assert + assertThat(formatWithUnits(1_000_000)).isEqualTo("1M"); + assertThat(formatWithUnits(1_510_000)).isEqualTo("1.5M"); + + assertThat(formatWithUnits(10_000_000)).isEqualTo("10M"); + assertThat(formatWithUnits(10_510_000)).isEqualTo("10.5M"); + assertThat(formatWithUnits(99_999_999)).isEqualTo("99.9M"); + + assertThat(formatWithUnits(100_000_000)).isEqualTo("100M"); + assertThat(formatWithUnits(100_510_000)).isEqualTo("100M"); + assertThat(formatWithUnits(100_999_000)).isEqualTo("100M"); + + assertThat(formatWithUnits(101_000_000)).isEqualTo("101M"); + assertThat(formatWithUnits(101_510_000)).isEqualTo("101M"); + assertThat(formatWithUnits(101_999_000)).isEqualTo("101M"); + } + + @Test + void shouldFormatWithUnitsForBillions() { + // Act & assert + assertThat(formatWithUnits(1_000_000_000)).isEqualTo("1B"); + assertThat(formatWithUnits(1_010_000_000)).isEqualTo("1B"); + assertThat(formatWithUnits(1_100_000_000)).isEqualTo("1.1B"); + assertThat(formatWithUnits(1_100_001_000)).isEqualTo("1.1B"); + assertThat(formatWithUnits(1_920_001_000)).isEqualTo("1.9B"); + } + + @Test + void shouldFormatWithoutUnits() { + // Act & assert + assertThat(format(0)).isEqualTo("0"); + assertThat(format(1)).isEqualTo("1"); + assertThat(format(10)).isEqualTo("10"); + assertThat(format(105)).isEqualTo("105"); + assertThat(format(1050)).isEqualTo("1,050"); + assertThat(format(10500)).isEqualTo("10,500"); + assertThat(format(100500)).isEqualTo("100,500"); + assertThat(format(1000500)).isEqualTo("1,000,500"); + } +} From 400bd30251c5524262b7d6ea9f6550f3520ba574 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sat, 10 Aug 2024 13:34:09 +0200 Subject: [PATCH 10/20] refactor: move security toast helper to client helper Rename PlatformUtil to ClientPlatformUtil as that's what it does. --- .../common/autocrafting/PatternItem.java | 4 ++-- .../common/autocrafting/PatternRendering.java | 4 ++-- .../SmithingTablePatternGridRenderer.java | 4 ++-- .../StonecutterPatternGridRenderer.java | 6 +++--- .../support/packet/s2c/NoPermissionPacket.java | 4 ++-- ...ityToastUtil.java => ClientPlatformUtil.java} | 16 +++++++++++++--- .../refinedstorage/common/util/PlatformUtil.java | 16 ---------------- .../portablegrid/PortableGridBakedModel.java | 4 ++-- 8 files changed, 26 insertions(+), 32 deletions(-) rename refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/{SecurityToastUtil.java => ClientPlatformUtil.java} (57%) delete mode 100644 refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/PlatformUtil.java diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternItem.java index 522a54053..dbb5295d8 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternItem.java @@ -10,7 +10,7 @@ import com.refinedmods.refinedstorage.common.content.Items; import com.refinedmods.refinedstorage.common.support.RecipeMatrixContainer; import com.refinedmods.refinedstorage.common.support.resource.ItemResource; -import com.refinedmods.refinedstorage.common.util.PlatformUtil; +import com.refinedmods.refinedstorage.common.util.ClientPlatformUtil; import java.util.ArrayList; import java.util.Arrays; @@ -86,7 +86,7 @@ public Optional getTooltipImage(final ItemStack stack) { if (state == null) { return Optional.of(new HelpTooltipComponent(HELP)); } - final Level level = PlatformUtil.getClientLevel(); + final Level level = ClientPlatformUtil.getClientLevel(); return switch (state.type()) { case CRAFTING -> { final CraftingPatternState craftingState = stack.get(DataComponents.INSTANCE.getCraftingPatternState()); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternRendering.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternRendering.java index 3c8108885..8f4ccc83e 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternRendering.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternRendering.java @@ -3,7 +3,7 @@ import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; import com.refinedmods.refinedstorage.common.api.autocrafting.PatternProviderItem; import com.refinedmods.refinedstorage.common.support.resource.ItemResource; -import com.refinedmods.refinedstorage.common.util.PlatformUtil; +import com.refinedmods.refinedstorage.common.util.ClientPlatformUtil; import java.util.Optional; @@ -32,7 +32,7 @@ public static boolean canDisplayOutput(final ItemStack stack) { } public static Optional getOutput(final ItemStack stack) { - final Level level = PlatformUtil.getClientLevel(); + final Level level = ClientPlatformUtil.getClientLevel(); if (level == null) { return Optional.empty(); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePatternGridRenderer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePatternGridRenderer.java index 9628d7568..9008c9790 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePatternGridRenderer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/SmithingTablePatternGridRenderer.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage.common.autocrafting; -import com.refinedmods.refinedstorage.common.util.PlatformUtil; +import com.refinedmods.refinedstorage.common.util.ClientPlatformUtil; import java.util.List; import java.util.Optional; @@ -62,7 +62,7 @@ class SmithingTablePatternGridRenderer implements PatternGridRenderer { @Override public void addWidgets(final Consumer widgets, final Consumer renderables) { - final Level level = PlatformUtil.getClientLevel(); + final Level level = ClientPlatformUtil.getClientLevel(); if (level == null) { return; } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPatternGridRenderer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPatternGridRenderer.java index cb7551b3c..b7b5beb04 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPatternGridRenderer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/StonecutterPatternGridRenderer.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage.common.autocrafting; import com.refinedmods.refinedstorage.common.support.widget.ScrollbarWidget; -import com.refinedmods.refinedstorage.common.util.PlatformUtil; +import com.refinedmods.refinedstorage.common.util.ClientPlatformUtil; import java.util.function.Consumer; import javax.annotation.Nullable; @@ -125,7 +125,7 @@ public void renderBackground(final GuiGraphics graphics, } graphics.blitSprite(buttonSprite, xx, yy, 16, 18); graphics.renderItem( - recipe.value().getResultItem(requireNonNull(PlatformUtil.getClientLevel()).registryAccess()), + recipe.value().getResultItem(requireNonNull(ClientPlatformUtil.getClientLevel()).registryAccess()), xx, yy + 1 ); @@ -145,7 +145,7 @@ public void renderTooltip(final Font font, for (int i = 0; i < menu.getStonecutterRecipes().size(); ++i) { final RecipeHolder recipe = menu.getStonecutterRecipes().get(i); final ItemStack result = recipe.value().getResultItem( - requireNonNull(PlatformUtil.getClientLevel()).registryAccess() + requireNonNull(ClientPlatformUtil.getClientLevel()).registryAccess() ); final int xx = getRecipeX(x, i); final int row = i / VanillaConstants.STONECUTTER_RECIPES_PER_ROW; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/NoPermissionPacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/NoPermissionPacket.java index 0e2908da0..3c63a0f49 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/NoPermissionPacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/NoPermissionPacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage.common.support.packet.s2c; -import com.refinedmods.refinedstorage.common.util.SecurityToastUtil; +import com.refinedmods.refinedstorage.common.util.ClientPlatformUtil; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.chat.Component; @@ -18,7 +18,7 @@ public record NoPermissionPacket(Component component) implements CustomPacketPay ); public static void handle(final NoPermissionPacket packet) { - SecurityToastUtil.addNoPermissionToast(packet.component); + ClientPlatformUtil.addNoPermissionToast(packet.component); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/SecurityToastUtil.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/ClientPlatformUtil.java similarity index 57% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/SecurityToastUtil.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/ClientPlatformUtil.java index a92ef1557..72bf0d0dd 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/SecurityToastUtil.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/ClientPlatformUtil.java @@ -1,22 +1,32 @@ package com.refinedmods.refinedstorage.common.util; +import javax.annotation.Nullable; + import net.minecraft.client.Minecraft; import net.minecraft.client.gui.components.toasts.SystemToast; import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.level.Level; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; -public final class SecurityToastUtil { +public final class ClientPlatformUtil { private static final SystemToast.SystemToastId NO_PERMISSION_TOAST_ID = new SystemToast.SystemToastId(); + private static final MutableComponent NO_PERMISSION = createTranslation("misc", "no_permission"); + + private ClientPlatformUtil() { + } - private SecurityToastUtil() { + @Nullable + public static Level getClientLevel() { // avoids classloading issues + return Minecraft.getInstance().level; } public static void addNoPermissionToast(final Component message) { SystemToast.add( Minecraft.getInstance().getToasts(), NO_PERMISSION_TOAST_ID, - createTranslation("misc", "no_permission"), + NO_PERMISSION, message ); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/PlatformUtil.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/PlatformUtil.java deleted file mode 100644 index 24072c78e..000000000 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/util/PlatformUtil.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.refinedmods.refinedstorage.common.util; - -import javax.annotation.Nullable; - -import net.minecraft.client.Minecraft; -import net.minecraft.world.level.Level; - -public final class PlatformUtil { - private PlatformUtil() { - } - - @Nullable - public static Level getClientLevel() { // avoids classloading issues - return Minecraft.getInstance().level; - } -} diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/portablegrid/PortableGridBakedModel.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/portablegrid/PortableGridBakedModel.java index 2c490a217..e0e3658d9 100644 --- a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/portablegrid/PortableGridBakedModel.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/portablegrid/PortableGridBakedModel.java @@ -6,7 +6,7 @@ import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridBlockItem; import com.refinedmods.refinedstorage.common.storage.portablegrid.PortableGridBlockItemRenderInfo; import com.refinedmods.refinedstorage.common.support.direction.BiDirection; -import com.refinedmods.refinedstorage.common.util.PlatformUtil; +import com.refinedmods.refinedstorage.common.util.ClientPlatformUtil; import com.refinedmods.refinedstorage.fabric.support.render.QuadRotators; import com.refinedmods.refinedstorage.fabric.support.render.QuadTranslator; @@ -56,7 +56,7 @@ public boolean isVanillaAdapter() { public void emitItemQuads(final ItemStack stack, final Supplier randomSupplier, final RenderContext context) { - final Level level = PlatformUtil.getClientLevel(); + final Level level = ClientPlatformUtil.getClientLevel(); if (level == null) { return; } From 6a7783ef4a100a1c3677abdbe3ebd4fcd94a87f2 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sat, 10 Aug 2024 13:34:37 +0200 Subject: [PATCH 11/20] chore: remove useless test --- .../storage/ClientStorageRepositoryTest.java | 57 ------------------- 1 file changed, 57 deletions(-) delete mode 100644 refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/storage/ClientStorageRepositoryTest.java diff --git a/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/storage/ClientStorageRepositoryTest.java b/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/storage/ClientStorageRepositoryTest.java deleted file mode 100644 index 548c59d95..000000000 --- a/refinedstorage-common/src/test/java/com/refinedmods/refinedstorage/common/storage/ClientStorageRepositoryTest.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.refinedmods.refinedstorage.common.storage; - -import com.refinedmods.refinedstorage.common.api.storage.StorageInfo; - -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.assertj.core.api.Assertions.assertThat; - -class ClientStorageRepositoryTest { - private List uuidsRequested; - private ClientStorageRepository sut; - - @BeforeEach - void setup() { - uuidsRequested = new ArrayList<>(); - sut = new ClientStorageRepository(uuidsRequested::add); - } - - @Test - void shouldSendRequestWhenRetrievingInfo() { - // Arrange - final UUID a = UUID.randomUUID(); - final UUID b = UUID.randomUUID(); - - // Act - final StorageInfo aInfo = sut.getInfo(a); - final StorageInfo bInfo = sut.getInfo(b); - - // Assert - assertThat(uuidsRequested).containsExactly(a); - assertThat(aInfo).usingRecursiveComparison().isEqualTo(StorageInfo.UNKNOWN); - assertThat(bInfo).usingRecursiveComparison().isEqualTo(StorageInfo.UNKNOWN); - } - - @Test - void shouldRetrieveInfo() { - // Arrange - final UUID a = UUID.randomUUID(); - sut.setInfo(a, 10, 100); - - final UUID b = UUID.randomUUID(); - - // Act - final StorageInfo aInfo = sut.getInfo(a); - final StorageInfo bInfo = sut.getInfo(b); - - // Assert - assertThat(uuidsRequested).containsExactly(a); - assertThat(aInfo).usingRecursiveComparison().isEqualTo(new StorageInfo(10, 100)); - assertThat(bInfo).usingRecursiveComparison().isEqualTo(StorageInfo.UNKNOWN); - } -} From 0b9469884b2d2b6341d4a0e1993950be112acac2 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sat, 10 Aug 2024 13:49:01 +0200 Subject: [PATCH 12/20] fix: game tests should now detect duplicate resources --- .../refinedstorage/common/GameTestUtil.java | 122 ++++++++---------- 1 file changed, 54 insertions(+), 68 deletions(-) diff --git a/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/GameTestUtil.java b/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/GameTestUtil.java index 2c68b9160..d822d237a 100644 --- a/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/GameTestUtil.java +++ b/refinedstorage-neoforge/src/test/java/com/refinedmods/refinedstorage/common/GameTestUtil.java @@ -6,6 +6,8 @@ import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.api.resource.list.ResourceList; +import com.refinedmods.refinedstorage.api.resource.list.ResourceListImpl; import com.refinedmods.refinedstorage.api.storage.EmptyActor; import com.refinedmods.refinedstorage.common.api.support.network.AbstractNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage.common.api.support.resource.ResourceContainer; @@ -16,9 +18,9 @@ import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import java.util.Arrays; +import java.util.Collection; import java.util.Iterator; import java.util.function.Consumer; -import java.util.stream.IntStream; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; @@ -129,7 +131,6 @@ public static void assertItemEntityPresentExactly(final GameTestHelper helper, throw new GameTestAssertException("Expected " + itemStack.getItem().getDescription().getString() + " item at: " + blockpos + " with count: " + itemStack.getCount()); } - itemEntity = entityIterator.next(); } while (!itemEntity.getItem().getItem().equals(itemStack.getItem()) || itemEntity.getItem().getCount() != itemStack.getCount()); @@ -138,18 +139,17 @@ public static void assertItemEntityPresentExactly(final GameTestHelper helper, public static Runnable assertInterfaceEmpty(final GameTestHelper helper, final BlockPos pos) { final var interfaceBlockEntity = requireBlockEntity(helper, pos, InterfaceBlockEntity.class); - - return assertResourceContainerEmpty(interfaceBlockEntity.getDisplayName(), - interfaceBlockEntity.getExportedResources()); + return assertResourceContainerEmpty( + interfaceBlockEntity.getDisplayName(), + interfaceBlockEntity.getExportedResources() + ); } private static Runnable assertResourceContainerEmpty(final Component displayName, final ResourceContainer container) { return () -> { - for (int i = 0; i < container.size(); i++) { - if (!container.isEmpty(i)) { - throw new GameTestAssertException(displayName.getString() + " should be empty"); - } + if (!container.isEmpty()) { + throw new GameTestAssertException(displayName.getString() + " should be empty"); } }; } @@ -158,41 +158,21 @@ public static Runnable interfaceContainsExactly(final GameTestHelper helper, final BlockPos pos, final ResourceAmount... expected) { final var interfaceBlockEntity = requireBlockEntity(helper, pos, InterfaceBlockEntity.class); - - return resourceContainerContainsExactly(helper, interfaceBlockEntity.getDisplayName(), - interfaceBlockEntity.getExportedResources(), expected); + return resourceContainerContainsExactly(interfaceBlockEntity.getExportedResources(), expected); } - private static Runnable resourceContainerContainsExactly(final GameTestHelper helper, - final Component displayName, - final ResourceContainer container, + private static Runnable resourceContainerContainsExactly(final ResourceContainer container, final ResourceAmount... expected) { + final ResourceList expectedList = toResourceList(expected); return () -> { - // todo: investigate issue with EnderIO integration - // TODO: This does not take duplicate ResourceAmount into account - for (final ResourceAmount expectedStack : expected) { - final boolean contains = IntStream.range(0, container.size()) - .mapToObj(container::get) - .anyMatch(resource -> resource != null - && resource.resource().equals(expectedStack.resource()) - && resource.amount() == expectedStack.amount()); - - helper.assertTrue(contains, "Expected resource is missing from " + displayName.getString() + ": " - + expectedStack + " with count: " + expectedStack.amount()); - } - + final ResourceList given = ResourceListImpl.create(); for (int i = 0; i < container.size(); i++) { - final ResourceAmount resource = container.get(i); - if (resource != null) { - final boolean wasExpected = Arrays.stream(expected).anyMatch( - expectedResource -> expectedResource.resource().equals(resource.resource()) - && expectedResource.amount() == resource.amount() - ); - - helper.assertTrue(wasExpected, "Unexpected resource found in " + displayName.getString() + ": " - + resource.resource() + " with count: " + resource.amount()); + final ResourceAmount item = container.get(i); + if (item != null) { + given.add(item); } } + listContainsExactly(given, expectedList); }; } @@ -200,52 +180,58 @@ public static Runnable containerContainsExactly(final GameTestHelper helper, final BlockPos pos, final ResourceAmount... expected) { final var containerBlockEntity = requireBlockEntity(helper, pos, BaseContainerBlockEntity.class); - + final ResourceList expectedList = toResourceList(expected); return () -> { - // TODO: This does not take duplicate ResourceAmount into account - for (final ResourceAmount expectedStack : expected) { - final boolean contains = IntStream.range(0, containerBlockEntity.getContainerSize()) - .mapToObj(containerBlockEntity::getItem) - .anyMatch(inContainer -> asResource(inContainer).equals(expectedStack.resource()) - && inContainer.getCount() == expectedStack.amount()); - helper.assertTrue(contains, "Expected resource is missing from container: " - + expectedStack + " with count: " + expectedStack.amount()); - } + final ResourceList given = ResourceListImpl.create(); for (int i = 0; i < containerBlockEntity.getContainerSize(); i++) { - final ItemStack inContainer = containerBlockEntity.getItem(i); - - if (!inContainer.isEmpty()) { - final boolean wasExpected = Arrays.stream(expected).anyMatch( - expectedStack -> expectedStack.resource().equals(asResource(inContainer)) - && expectedStack.amount() == inContainer.getCount() - ); - helper.assertTrue(wasExpected, "Unexpected resource found in container: " - + inContainer.getDescriptionId() + " with count: " + inContainer.getCount()); + final ItemStack itemStack = containerBlockEntity.getItem(i); + if (!itemStack.isEmpty()) { + given.add(asResource(itemStack), itemStack.getCount()); } } + listContainsExactly(given, expectedList); }; } public static Runnable storageContainsExactly(final GameTestHelper helper, final BlockPos networkPos, final ResourceAmount... expected) { + final ResourceList expectedList = toResourceList(expected); return networkIsAvailable(helper, networkPos, network -> { final StorageNetworkComponent storage = network.getComponent(StorageNetworkComponent.class); - for (final ResourceAmount expectedResource : expected) { - final boolean contains = storage.getAll() - .stream() - .anyMatch(inStorage -> inStorage.resource().equals(expectedResource.resource()) - && inStorage.amount() == expectedResource.amount()); - helper.assertTrue(contains, "Expected resource is missing from storage: " + expectedResource); + listContainsExactly(toResourceList(storage.getAll()), expectedList); + }); + } + + private static ResourceList toResourceList(final ResourceAmount... resources) { + return toResourceList(Arrays.asList(resources)); + } + + private static ResourceList toResourceList(final Collection resources) { + final ResourceList list = ResourceListImpl.create(); + for (final ResourceAmount resource : resources) { + list.add(resource); + } + return list; + } + + private static void listContainsExactly(final ResourceList given, final ResourceList expected) { + for (final ResourceAmount expectedItem : expected.copyState()) { + final long givenAmount = given.get(expectedItem.resource()); + if (givenAmount != expectedItem.amount()) { + throw new GameTestAssertException( + "Expected " + expectedItem.amount() + " of " + expectedItem.resource() + ", but was " + givenAmount + ); } - for (final ResourceAmount inStorage : storage.getAll()) { - final boolean wasExpected = Arrays.stream(expected).anyMatch( - expectedResource -> expectedResource.resource().equals(inStorage.resource()) - && expectedResource.amount() == inStorage.amount() + } + for (final ResourceAmount givenItem : given.copyState()) { + final long expectedAmount = expected.get(givenItem.resource()); + if (expectedAmount != givenItem.amount()) { + throw new GameTestAssertException( + "Expected " + expectedAmount + " of " + givenItem.resource() + ", but was " + givenItem.amount() ); - helper.assertTrue(wasExpected, "Unexpected resource found in storage: " + inStorage); } - }); + } } public static ItemResource asResource(final Item item) { From 42bd96727cfc8b1f6d9d00dbe008cba755c6293a Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sat, 10 Aug 2024 14:00:02 +0200 Subject: [PATCH 13/20] fix: regulator upgrade tooltip shouldn't use unit in tooltip --- .../ProcessingPatternClientTooltipComponent.java | 7 ++----- .../StorageMonitorBlockEntityRenderer.java | 2 +- .../common/support/ResourceSlotRendering.java | 12 ++++++------ .../tooltip/ResourceClientTooltipComponent.java | 5 +---- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingPatternClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingPatternClientTooltipComponent.java index 41a447f3e..742cefdf6 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingPatternClientTooltipComponent.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/ProcessingPatternClientTooltipComponent.java @@ -79,10 +79,7 @@ private static Component getOutputText(final ResourceAmount resourceAmount) { final ResourceRendering rendering = RefinedStorageApi.INSTANCE.getResourceRendering( resourceAmount.resource().getClass() ); - final String displayAmount = rendering.formatAmount( - resourceAmount.amount(), - false - ); + final String displayAmount = rendering.formatAmount(resourceAmount.amount()); return Component.literal(String.format("%sx ", displayAmount)) .append(rendering.getDisplayName(resourceAmount.resource())) .withStyle(ChatFormatting.GRAY); @@ -155,7 +152,7 @@ private void renderMatrixSlot( resourceAmount.resource().getClass() ); rendering.render(resourceAmount.resource(), graphics, slotX + 1, slotY + 1); - ResourceSlotRendering.render(graphics, slotX + 1, slotY + 1, resourceAmount.amount(), rendering); + ResourceSlotRendering.renderAmount(graphics, slotX + 1, slotY + 1, resourceAmount.amount(), rendering); } private void renderOutputText(final Font font, final int x, final int y, final GuiGraphics graphics) { diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorBlockEntityRenderer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorBlockEntityRenderer.java index 2f2ac2506..582990291 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorBlockEntityRenderer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorBlockEntityRenderer.java @@ -66,7 +66,7 @@ private void doRender(final Level level, poseStack, vertexConsumers, direction.getQuaternion(), - rendering.formatAmount(amount, false), + rendering.formatAmount(amount), level, rendering, resource diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/ResourceSlotRendering.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/ResourceSlotRendering.java index 8981eff74..96a3c1420 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/ResourceSlotRendering.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/ResourceSlotRendering.java @@ -44,15 +44,15 @@ private static void render(final GuiGraphics graphics, final ResourceRendering rendering = RefinedStorageApi.INSTANCE.getResourceRendering(resource.getClass()); rendering.render(resource, graphics, x, y); if (renderAmount) { - render(graphics, x, y, amount, rendering); + renderAmount(graphics, x, y, amount, rendering); } } - public static void render(final GuiGraphics graphics, - final int x, - final int y, - final long amount, - final ResourceRendering rendering) { + public static void renderAmount(final GuiGraphics graphics, + final int x, + final int y, + final long amount, + final ResourceRendering rendering) { renderAmount( graphics, x, diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/ResourceClientTooltipComponent.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/ResourceClientTooltipComponent.java index f39158f6f..ecff0219d 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/ResourceClientTooltipComponent.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/tooltip/ResourceClientTooltipComponent.java @@ -52,11 +52,8 @@ private static Component getNameWithAmount(final ResourceAmount resourceAmount) final ResourceRendering rendering = RefinedStorageApi.INSTANCE.getResourceRendering( resourceAmount.resource().getClass() ); - final String amount = rendering.formatAmount(resourceAmount.amount(), true); + final String amount = rendering.formatAmount(resourceAmount.amount()); final Component displayName = rendering.getDisplayName(resourceAmount.resource()); - if (amount.isEmpty()) { - return displayName; - } return displayName.copy().append(" (").append(amount).append(")"); } } From 50f35234cef50e28372552b3553342464df61470 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sat, 10 Aug 2024 14:07:55 +0200 Subject: [PATCH 14/20] refactor: rename InMemoryStorageImpl to StorageImpl --- .../common/storage/SameTypeStorageType.java | 4 +- .../watcher/GridWatcherManagerImplTest.java | 4 +- .../impl/PriorityNetworkBuilderImplTest.java | 4 +- .../detector/DetectorNetworkNodeTest.java | 4 +- .../AbstractExporterNetworkNodeTest.java | 32 +++---- ...FirstAvailableExporterNetworkNodeTest.java | 14 +-- .../RandomExporterNetworkNodeTest.java | 10 +- .../RoundRobinExporterNetworkNodeTest.java | 16 ++-- .../ExternalStorageNetworkNodeTest.java | 28 +++--- .../impl/node/grid/GridNetworkNodeTest.java | 4 +- .../ClearSlotInterfaceNetworkNodeTest.java | 4 +- ...rtToEmptySlotInterfaceNetworkNodeTest.java | 10 +- .../node/iface/InterfaceNetworkNodeTest.java | 10 +- ...KeepExportingInterfaceNetworkNodeTest.java | 14 +-- ...erfaceExternalStorageProviderImplTest.java | 6 +- .../node/importer/FakeImporterSource.java | 4 +- .../importer/ImporterNetworkNodeTest.java | 30 +++--- .../impl/node/relay/RelayNetworkNodeTest.java | 8 +- .../relay/RelayStorageNetworkNodeTest.java | 34 +++---- .../node/storage/StorageNetworkNodeTest.java | 4 +- .../StorageTransferNetworkNodeTest.java | 92 +++++++++---------- ...emoryStorageImpl.java => StorageImpl.java} | 8 +- .../storage/limited/LimitedStorageImpl.java | 6 +- .../api/storage/LimitedStorageImplTest.java | 2 +- .../api/storage/ProxyStorageTest.java | 2 +- .../api/storage/StateTrackedStorageTest.java | 2 +- ...rageImplTest.java => StorageImplTest.java} | 4 +- .../api/storage/TransferHelperTest.java | 2 +- .../composite/CompositeStorageImplTest.java | 6 +- .../SubCompositeCompositeStorageImplTest.java | 16 ++-- .../storage/external/TransformingStorage.java | 4 +- 31 files changed, 194 insertions(+), 194 deletions(-) rename refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/{InMemoryStorageImpl.java => StorageImpl.java} (88%) rename refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/{InMemoryStorageImplTest.java => StorageImplTest.java} (98%) diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/SameTypeStorageType.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/SameTypeStorageType.java index f571efe2a..37e3083fe 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/SameTypeStorageType.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/SameTypeStorageType.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage.common.storage; import com.refinedmods.refinedstorage.api.resource.ResourceKey; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl; import com.refinedmods.refinedstorage.api.storage.tracked.InMemoryTrackedStorageRepository; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorageImpl; @@ -64,7 +64,7 @@ public long getDiskInterfaceTransferQuota(final boolean stackUpgrade) { private SerializableStorage createStorage(final StorageCodecs.StorageData data, final Runnable listener) { final TrackedStorageRepository trackingRepository = new InMemoryTrackedStorageRepository(); final TrackedStorageImpl tracked = new TrackedStorageImpl( - new InMemoryStorageImpl(), + new StorageImpl(), trackingRepository, System::currentTimeMillis ); diff --git a/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManagerImplTest.java b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManagerImplTest.java index 77e0b2814..c7c8ecb91 100644 --- a/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManagerImplTest.java +++ b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManagerImplTest.java @@ -2,7 +2,7 @@ import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import com.refinedmods.refinedstorage.api.storage.root.RootStorage; import com.refinedmods.refinedstorage.api.storage.root.RootStorageImpl; @@ -30,7 +30,7 @@ class GridWatcherManagerImplTest { void setUp() { sut = new GridWatcherManagerImpl(); rootStorage = new RootStorageImpl(); - rootStorage.addSource(new InMemoryStorageImpl()); + rootStorage.addSource(new StorageImpl()); } @Test diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/PriorityNetworkBuilderImplTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/PriorityNetworkBuilderImplTest.java index 7920bfef2..7b1ef3c53 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/PriorityNetworkBuilderImplTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/PriorityNetworkBuilderImplTest.java @@ -10,7 +10,7 @@ import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import com.refinedmods.refinedstorage.network.test.fake.FakeActor; import java.util.Optional; @@ -117,7 +117,7 @@ void shouldRespectPriorityWhenMerging() { private NetworkSide createNetworkSide(final MasterSlave side, final Supplier networkFactory) { final StorageNetworkNode nodeA = new StorageNetworkNode(0, 0, 1); - final InMemoryStorageImpl storage = new InMemoryStorageImpl(); + final StorageImpl storage = new StorageImpl(); storage.insert(side, 10, Action.EXECUTE, FakeActor.INSTANCE); nodeA.setProvider(index -> Optional.of(storage)); final NetworkNodeContainer a = createContainerWithNetwork( diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorNetworkNodeTest.java index b2e1d165a..bce2d6535 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorNetworkNodeTest.java @@ -3,7 +3,7 @@ import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent; import com.refinedmods.refinedstorage.network.test.NetworkTest; @@ -34,7 +34,7 @@ class DetectorNetworkNodeTest { @BeforeEach void setUp(@InjectNetworkStorageComponent final StorageNetworkComponent storage) { - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); sut.setAmountStrategy(new DetectorAmountStrategyImpl()); } diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/AbstractExporterNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/AbstractExporterNetworkNodeTest.java index fa57ebdce..6d82477d0 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/AbstractExporterNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/AbstractExporterNetworkNodeTest.java @@ -9,9 +9,9 @@ import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; import com.refinedmods.refinedstorage.api.storage.InsertableStorage; import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl; import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import com.refinedmods.refinedstorage.network.test.InjectNetworkEnergyComponent; @@ -58,7 +58,7 @@ void shouldUseFirstSuccessfulStrategy( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); storage.insert(B, 100, Action.EXECUTE, EmptyActor.INSTANCE); @@ -90,7 +90,7 @@ void shouldUseFirstSuccessfulResourceInTheStrategy( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); storage.insert(B, 100, Action.EXECUTE, EmptyActor.INSTANCE); @@ -145,11 +145,11 @@ void shouldNotTransferWithoutTaskExecutor( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); storage.insert(B, 100, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage destination = new InMemoryStorageImpl(); + final Storage destination = new StorageImpl(); sut.setFilters(List.of(A, B)); sut.setTransferStrategy(createTransferStrategy(destination, 1)); @@ -169,11 +169,11 @@ void shouldNotTransferWithoutTaskExecutor( @Test void shouldNotTransferWithoutStrategy(@InjectNetworkStorageComponent final StorageNetworkComponent storage) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); storage.insert(B, 100, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage destination = new InMemoryStorageImpl(); + final Storage destination = new StorageImpl(); sut.setFilters(List.of(A, B)); @@ -191,11 +191,11 @@ void shouldNotTransferWithoutStrategy(@InjectNetworkStorageComponent final Stora @Test void shouldNotTransferIfInactive(@InjectNetworkStorageComponent final StorageNetworkComponent storage) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); storage.insert(B, 100, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage destination = new InMemoryStorageImpl(); + final Storage destination = new StorageImpl(); final ExporterTransferStrategy strategy = createTransferStrategy(destination, 1); sut.setTransferStrategy(strategy); @@ -216,11 +216,11 @@ void shouldNotTransferIfInactive(@InjectNetworkStorageComponent final StorageNet @Test void shouldNotTransferWithoutFilters(@InjectNetworkStorageComponent final StorageNetworkComponent storage) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); storage.insert(B, 100, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage destination = new InMemoryStorageImpl(); + final Storage destination = new StorageImpl(); final ExporterTransferStrategy strategy = createTransferStrategy(destination, 1); sut.setTransferStrategy(strategy); @@ -242,7 +242,7 @@ void shouldNotTransferIfNoResourcesAreAvailable( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - final Storage destination = new InMemoryStorageImpl(); + final Storage destination = new StorageImpl(); final ExporterTransferStrategy strategy = createTransferStrategy(destination, 10); sut.setTransferStrategy(strategy); @@ -263,7 +263,7 @@ void shouldTransferWithLimitedSpaceInDestination( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); storage.insert(B, 100, Action.EXECUTE, EmptyActor.INSTANCE); storage.insert(C, 100, Action.EXECUTE, EmptyActor.INSTANCE); @@ -308,7 +308,7 @@ void shouldNotTransferIfThereIsNoSpaceInTheDestination( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); storage.insert(B, 100, Action.EXECUTE, EmptyActor.INSTANCE); @@ -338,11 +338,11 @@ void shouldTransferSingleResourceEvenIfTransferQuotaHasNotBeenMet( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, 6, Action.EXECUTE, EmptyActor.INSTANCE); storage.insert(B, 7, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage destination = new InMemoryStorageImpl(); + final Storage destination = new StorageImpl(); final ExporterTransferStrategy strategy = createTransferStrategy(destination, 10); sut.setTransferStrategy(strategy); diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/FirstAvailableExporterNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/FirstAvailableExporterNetworkNodeTest.java index ea89e9214..db9bf6b7f 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/FirstAvailableExporterNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/FirstAvailableExporterNetworkNodeTest.java @@ -10,8 +10,8 @@ import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorageImpl; import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent; @@ -35,11 +35,11 @@ protected TaskExecutor createTaskExecutor() { @Test void shouldTransfer(@InjectNetworkStorageComponent final StorageNetworkComponent storage) { // Arrange - storage.addSource(new TrackedStorageImpl(new InMemoryStorageImpl(), () -> 1L)); + storage.addSource(new TrackedStorageImpl(new StorageImpl(), () -> 1L)); storage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); storage.insert(B, 100, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage destination = new InMemoryStorageImpl(); + final Storage destination = new StorageImpl(); final ExporterTransferStrategy strategy = createTransferStrategy(destination, 1); sut.setTransferStrategy(strategy); @@ -68,10 +68,10 @@ void shouldUseNextResourceIfFirstOneIsNotAvailableInSameCycle( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(B, 7, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage destination = new InMemoryStorageImpl(); + final Storage destination = new StorageImpl(); final ExporterTransferStrategy strategy = createTransferStrategy(destination, 10); sut.setTransferStrategy(strategy); @@ -92,12 +92,12 @@ void shouldUseNextResourceIfFirstOneIsNotAcceptedInSameCycle( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); storage.insert(B, 10, Action.EXECUTE, EmptyActor.INSTANCE); storage.insert(C, 10, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage destination = new InMemoryStorageImpl() { + final Storage destination = new StorageImpl() { @Override public long insert(final ResourceKey resource, final long amount, final Action action, final Actor actor) { if (A.equals(resource)) { diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/RandomExporterNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/RandomExporterNetworkNodeTest.java index 57c7d9446..e357f7218 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/RandomExporterNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/RandomExporterNetworkNodeTest.java @@ -7,8 +7,8 @@ import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent; import java.util.List; @@ -32,11 +32,11 @@ protected TaskExecutor createTaskExecutor() { @Test void shouldTransfer(@InjectNetworkStorageComponent final StorageNetworkComponent storage) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); storage.insert(B, 100, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage destination = new InMemoryStorageImpl(); + final Storage destination = new StorageImpl(); final ExporterTransferStrategy strategy = createTransferStrategy(destination, 5); sut.setTransferStrategy(strategy); @@ -69,10 +69,10 @@ void shouldUseNextResourceIfFirstOneIsNotAvailableInSameCycle( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(B, 7, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage destination = new InMemoryStorageImpl(); + final Storage destination = new StorageImpl(); final ExporterTransferStrategy strategy = createTransferStrategy(destination, 10); sut.setTransferStrategy(strategy); diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/RoundRobinExporterNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/RoundRobinExporterNetworkNodeTest.java index 8b0f7cc98..5dbdb29c3 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/RoundRobinExporterNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/RoundRobinExporterNetworkNodeTest.java @@ -7,8 +7,8 @@ import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent; import java.util.List; @@ -44,11 +44,11 @@ protected TaskExecutor createTaskExecutor() { @Test void shouldTransfer(@InjectNetworkStorageComponent final StorageNetworkComponent storage) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); storage.insert(B, 100, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage destination = new InMemoryStorageImpl(); + final Storage destination = new StorageImpl(); final ExporterTransferStrategy strategy = createTransferStrategy(destination, 5); sut.setTransferStrategy(strategy); @@ -97,7 +97,7 @@ void shouldTransfer(@InjectNetworkStorageComponent final StorageNetworkComponent @Test void shouldNotTransferIfThereAreNoResourcesInSource() { // Arrange - final Storage destination = new InMemoryStorageImpl(); + final Storage destination = new StorageImpl(); final ExporterTransferStrategy strategy = createTransferStrategy(destination, 5); sut.setTransferStrategy(strategy); @@ -113,11 +113,11 @@ void shouldUseNextResourceIfFirstOneIsNotAvailableInSameCycle( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(C, 8, Action.EXECUTE, EmptyActor.INSTANCE); storage.insert(D, 9, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage destination = new InMemoryStorageImpl(); + final Storage destination = new StorageImpl(); final ExporterTransferStrategy strategy = createTransferStrategy(destination, 10); sut.setTransferStrategy(strategy); @@ -189,12 +189,12 @@ void shouldResetRoundRobinStateAfterChangingFilters( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); storage.insert(B, 100, Action.EXECUTE, EmptyActor.INSTANCE); storage.insert(C, 100, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage destination = new InMemoryStorageImpl(); + final Storage destination = new StorageImpl(); final ExporterTransferStrategy strategy = createTransferStrategy(destination, 5); sut.setTransferStrategy(strategy); diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExternalStorageNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExternalStorageNetworkNodeTest.java index 89489c30e..1f52e431f 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExternalStorageNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExternalStorageNetworkNodeTest.java @@ -7,8 +7,8 @@ import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; import com.refinedmods.refinedstorage.api.storage.AccessMode; import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import com.refinedmods.refinedstorage.api.storage.external.ExternalStorageProvider; import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource; @@ -68,7 +68,7 @@ void testInitialState(@InjectNetworkStorageComponent final StorageNetworkCompone @Test void shouldInitialize(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) { // Arrange - final Storage storage = new InMemoryStorageImpl(); + final Storage storage = new StorageImpl(); final ExternalStorageProvider provider = new StorageExternalStorageProvider(storage); // Act @@ -84,10 +84,10 @@ void shouldBeAbleToInitializeMultipleTimes( @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage ) { // Arrange - final Storage storage1 = new InMemoryStorageImpl(); + final Storage storage1 = new StorageImpl(); final ExternalStorageProvider provider1 = new StorageExternalStorageProvider(storage1); - final Storage storage2 = new InMemoryStorageImpl(); + final Storage storage2 = new StorageImpl(); final ExternalStorageProvider provider2 = new StorageExternalStorageProvider(storage2); // Act @@ -113,7 +113,7 @@ void shouldBeAbleToInitializeMultipleTimes( @Test void shouldInsert(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) { // Arrange - final Storage storage = new InMemoryStorageImpl(); + final Storage storage = new StorageImpl(); final ExternalStorageProvider provider = new StorageExternalStorageProvider(storage); sut.initialize(new ExternalStorageProviderFactoryImpl(provider)); @@ -134,7 +134,7 @@ void shouldInsert(@InjectNetworkStorageComponent final StorageNetworkComponent n @Test void shouldExtract(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) { // Arrange - final Storage storage = new InMemoryStorageImpl(); + final Storage storage = new StorageImpl(); storage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); final ExternalStorageProvider provider = new StorageExternalStorageProvider(storage); sut.initialize(new ExternalStorageProviderFactoryImpl(provider)); @@ -160,7 +160,7 @@ void shouldRespectAllowlistWhenInserting( sut.getStorageConfiguration().setFilterMode(FilterMode.ALLOW); sut.getStorageConfiguration().setFilters(Set.of(A, B)); - final Storage storage = new InMemoryStorageImpl(); + final Storage storage = new StorageImpl(); final ExternalStorageProvider provider = new StorageExternalStorageProvider(storage); sut.initialize(new ExternalStorageProviderFactoryImpl(provider)); @@ -183,7 +183,7 @@ void shouldRespectEmptyAllowlistWhenInserting( sut.getStorageConfiguration().setFilterMode(FilterMode.ALLOW); sut.getStorageConfiguration().setFilters(Set.of()); - final Storage storage = new InMemoryStorageImpl(); + final Storage storage = new StorageImpl(); final ExternalStorageProvider provider = new StorageExternalStorageProvider(storage); sut.initialize(new ExternalStorageProviderFactoryImpl(provider)); @@ -205,7 +205,7 @@ void shouldRespectBlocklistWhenInserting( sut.getStorageConfiguration().setFilterMode(FilterMode.BLOCK); sut.getStorageConfiguration().setFilters(Set.of(A, B)); - final Storage storage = new InMemoryStorageImpl(); + final Storage storage = new StorageImpl(); final ExternalStorageProvider provider = new StorageExternalStorageProvider(storage); sut.initialize(new ExternalStorageProviderFactoryImpl(provider)); @@ -227,7 +227,7 @@ void shouldRespectEmptyBlocklistWhenInserting( sut.getStorageConfiguration().setFilterMode(FilterMode.BLOCK); sut.getStorageConfiguration().setFilters(Set.of()); - final Storage storage = new InMemoryStorageImpl(); + final Storage storage = new StorageImpl(); final ExternalStorageProvider provider = new StorageExternalStorageProvider(storage); sut.initialize(new ExternalStorageProviderFactoryImpl(provider)); @@ -251,7 +251,7 @@ void shouldRespectAccessModeWhenInserting(final AccessMode accessMode, // Arrange sut.getStorageConfiguration().setAccessMode(accessMode); - final Storage storage = new InMemoryStorageImpl(); + final Storage storage = new StorageImpl(); final ExternalStorageProvider provider = new StorageExternalStorageProvider(storage); sut.initialize(new ExternalStorageProviderFactoryImpl(provider)); @@ -274,7 +274,7 @@ void shouldRespectAccessModeWhenExtracting(final AccessMode accessMode, // Arrange sut.getStorageConfiguration().setAccessMode(accessMode); - final Storage storage = new InMemoryStorageImpl(); + final Storage storage = new StorageImpl(); storage.insert(A, 20, Action.EXECUTE, EmptyActor.INSTANCE); final ExternalStorageProvider provider = new StorageExternalStorageProvider(storage); @@ -293,7 +293,7 @@ void shouldRespectAccessModeWhenExtracting(final AccessMode accessMode, @Test void shouldNotInsertWhenInactive(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) { // Arrange - final Storage storage = new InMemoryStorageImpl(); + final Storage storage = new StorageImpl(); final ExternalStorageProvider provider = new StorageExternalStorageProvider(storage); sut.initialize(new ExternalStorageProviderFactoryImpl(provider)); @@ -309,7 +309,7 @@ void shouldNotInsertWhenInactive(@InjectNetworkStorageComponent final StorageNet @Test void shouldNotExtractWhenInactive(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) { // Arrange - final Storage storage = new InMemoryStorageImpl(); + final Storage storage = new StorageImpl(); storage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); final ExternalStorageProvider provider = new StorageExternalStorageProvider(storage); diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/grid/GridNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/grid/GridNetworkNodeTest.java index b8407205c..9223a2105 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/grid/GridNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/grid/GridNetworkNodeTest.java @@ -7,7 +7,7 @@ import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorageImpl; @@ -55,7 +55,7 @@ void setUp( storage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); storage.insert(B, 200, Action.EXECUTE, EmptyActor.INSTANCE); - otherStorage.addSource(new TrackedStorageImpl(new InMemoryStorageImpl(), () -> 3L)); + otherStorage.addSource(new TrackedStorageImpl(new StorageImpl(), () -> 3L)); } @Test diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/ClearSlotInterfaceNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/ClearSlotInterfaceNetworkNodeTest.java index e99fa2e1a..39c114372 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/ClearSlotInterfaceNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/ClearSlotInterfaceNetworkNodeTest.java @@ -2,7 +2,7 @@ import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl; import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent; @@ -37,7 +37,7 @@ void shouldClearSlotWhenNoLongerRequestingAnything( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); exportState.setCurrentlyExported(1, A, 7); exportState.setCurrentlyExported(2, B, 2); diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/ExportToEmptySlotInterfaceNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/ExportToEmptySlotInterfaceNetworkNodeTest.java index e8e52f5e4..73200d251 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/ExportToEmptySlotInterfaceNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/ExportToEmptySlotInterfaceNetworkNodeTest.java @@ -4,7 +4,7 @@ import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent; import com.refinedmods.refinedstorage.network.test.NetworkTest; @@ -58,7 +58,7 @@ void shouldExportToEmptySlotWhenRequestedIsNotEntirelyAvailable( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, 2, Action.EXECUTE, EmptyActor.INSTANCE); exportState.setRequestedResource(1, A, 10); @@ -82,7 +82,7 @@ void shouldExportToEmptySlotWhenRequestedIsLessThanTransferQuota( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); exportState.setRequestedResource(1, A, 1); @@ -106,7 +106,7 @@ void shouldExportToEmptySlot( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); storage.insert(B, 10, Action.EXECUTE, EmptyActor.INSTANCE); @@ -136,7 +136,7 @@ void shouldExportResourceFuzzilyToEmptySlot( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A_ALTERNATIVE, 10, Action.EXECUTE, EmptyActor.INSTANCE); storage.insert(A_ALTERNATIVE2, 10, Action.EXECUTE, EmptyActor.INSTANCE); diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceNetworkNodeTest.java index 421a724a6..365c23c95 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceNetworkNodeTest.java @@ -5,7 +5,7 @@ import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import com.refinedmods.refinedstorage.network.test.InjectNetworkEnergyComponent; import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent; @@ -50,7 +50,7 @@ void shouldExportAllWithDefaultTransferQuota( @InjectNetworkEnergyComponent final EnergyNetworkComponent energy ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, Long.MAX_VALUE, Action.EXECUTE, EmptyActor.INSTANCE); exportState.setRequestedResource(1, A, Long.MAX_VALUE); @@ -72,7 +72,7 @@ void shouldNotExportAnythingWithoutBeingActive( @InjectNetworkEnergyComponent final EnergyNetworkComponent energy ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); exportState.setRequestedResource(1, A, 1); @@ -98,7 +98,7 @@ void shouldNotExportAnythingWithoutNetwork( @InjectNetworkEnergyComponent final EnergyNetworkComponent energy ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); exportState.setRequestedResource(1, A, 1); @@ -124,7 +124,7 @@ void shouldNotExportAnythingWithoutExportState( @InjectNetworkEnergyComponent final EnergyNetworkComponent energy ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); sut.setExportState(null); diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/KeepExportingInterfaceNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/KeepExportingInterfaceNetworkNodeTest.java index a8b780434..f9f4b7540 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/KeepExportingInterfaceNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/KeepExportingInterfaceNetworkNodeTest.java @@ -4,7 +4,7 @@ import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl; import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent; @@ -41,7 +41,7 @@ void shouldKeepExportingResourceUntilWantedAmountIsReached( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); exportState.setRequestedResource(1, A, 7); @@ -95,7 +95,7 @@ void shouldKeepExportingResourceUntilWantedAmountIsReachedAndNetworkHasEnoughRes @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, 7, Action.EXECUTE, EmptyActor.INSTANCE); exportState.setRequestedResource(1, A, 10); @@ -145,7 +145,7 @@ void shouldKeepExportingResourceFuzzilyUntilWantedAmountIsReached( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A_ALTERNATIVE, 10, Action.EXECUTE, EmptyActor.INSTANCE); storage.insert(A_ALTERNATIVE2, 10, Action.EXECUTE, EmptyActor.INSTANCE); @@ -180,7 +180,7 @@ void shouldKeepExportingResourceFuzzilyUntilWantedAmountIsReachedEvenIfTheResour @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A_ALTERNATIVE, 1, Action.EXECUTE, EmptyActor.INSTANCE); exportState.setRequestedResource(1, A, 1); @@ -204,7 +204,7 @@ void shouldReturnResourceToNetworkUntilWantedAmountIsReached( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); exportState.setRequestedResource(1, A, 7); exportState.setCurrentlyExported(1, A, 10); @@ -280,7 +280,7 @@ void shouldReturnResourceToNetworkAndExportOtherResourceIfSpecified( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(B, 10, Action.EXECUTE, EmptyActor.INSTANCE); exportState.setRequestedResource(1, B, 3); diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/externalstorage/IoLoopInterfaceExternalStorageProviderImplTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/externalstorage/IoLoopInterfaceExternalStorageProviderImplTest.java index 08c862be6..2119d07e7 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/externalstorage/IoLoopInterfaceExternalStorageProviderImplTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/externalstorage/IoLoopInterfaceExternalStorageProviderImplTest.java @@ -10,8 +10,8 @@ import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import com.refinedmods.refinedstorage.network.test.InjectNetwork; import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent; @@ -76,12 +76,12 @@ void setUp(@InjectNetworkStorageComponent final StorageNetworkComponent networkS regularInterface.setExportState(regularInterfaceState); regularInterface.setTransferQuotaProvider(resource -> 100); - regularStorageInNetwork = new InMemoryStorageImpl(); + regularStorageInNetwork = new StorageImpl(); regularStorageInNetwork.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); networkStorage.addSource(regularStorageInNetwork); externalStorageWithNonInterfaceConnection.initialize(new ExternalStorageProviderFactoryImpl( - new StorageExternalStorageProvider(new InMemoryStorageImpl()) + new StorageExternalStorageProvider(new StorageImpl()) )); } diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/FakeImporterSource.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/FakeImporterSource.java index 5c89ea603..4a2f4419b 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/FakeImporterSource.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/FakeImporterSource.java @@ -5,7 +5,7 @@ import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import java.util.Arrays; import java.util.Collection; @@ -14,7 +14,7 @@ public class FakeImporterSource implements ImporterSource { private final List resources; - private final InMemoryStorageImpl storage = new InMemoryStorageImpl(); + private final StorageImpl storage = new StorageImpl(); public FakeImporterSource(final ResourceKey... resources) { this.resources = Arrays.stream(resources).toList(); diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/ImporterNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/ImporterNetworkNodeTest.java index 9bb000da5..c37a31d61 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/ImporterNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/ImporterNetworkNodeTest.java @@ -9,7 +9,7 @@ import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl; import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import com.refinedmods.refinedstorage.network.test.InjectNetworkEnergyComponent; @@ -89,7 +89,7 @@ void shouldNotWorkOrExtractEnergyWithoutBeingActive( @InjectNetworkEnergyComponent final EnergyNetworkComponent energy ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); final FakeImporterSource source = new FakeImporterSource(A, B) .add(A, 100) @@ -113,7 +113,7 @@ void shouldNotWorkOrExtractEnergyWithoutBeingActive( @Test void testTransfer(@InjectNetworkStorageComponent final StorageNetworkComponent storage) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); final FakeImporterSource source = new FakeImporterSource(A, B, A) .add(A, 100) @@ -139,7 +139,7 @@ void shouldUseFirstSuccessfulTransferStrategy( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); final FakeImporterSource emptySource = new FakeImporterSource(); final FakeImporterSource outdatedSource = new FakeImporterSource(C) @@ -202,7 +202,7 @@ void testTransferDifferentResourceOverMultipleSlots( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); final FakeImporterSource source = new FakeImporterSource(A, B, A, B) .add(A, 11) @@ -228,7 +228,7 @@ void testTransferSameResourceOverMultipleSlots( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); final FakeImporterSource source = new FakeImporterSource(A, A, A, B) .add(A, 20) @@ -255,7 +255,7 @@ void testTransferWhereResourceIsNotAccepted( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl() { + storage.addSource(new StorageImpl() { @Override public long insert(final ResourceKey resource, final long amount, final Action action, final Actor actor) { if (A.equals(resource)) { @@ -289,7 +289,7 @@ void testTransferWithoutAnyResourcesInSource( @InjectNetworkStorageComponent final StorageNetworkComponent storage ) { // Arrange - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); final FakeImporterSource source = new FakeImporterSource(); final ImporterTransferStrategy strategy = new ImporterTransferStrategyImpl(source, 10); @@ -309,7 +309,7 @@ void shouldRespectAllowlist(@InjectNetworkStorageComponent final StorageNetworkC sut.setFilterMode(FilterMode.ALLOW); sut.setFilters(Set.of(A)); - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); final FakeImporterSource source = new FakeImporterSource(B, A) .add(B, 10) @@ -345,7 +345,7 @@ void shouldRespectAllowlistWithNormalizer( return resource; }); - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); final FakeImporterSource source = new FakeImporterSource(B, A_ALTERNATIVE, A_ALTERNATIVE2) .add(B, 10) @@ -377,7 +377,7 @@ void shouldRespectAllowlistWithoutAlternative( sut.setFilterMode(FilterMode.ALLOW); sut.setFilters(Set.of(A)); - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); final FakeImporterSource source = new FakeImporterSource(B) .add(B, 10); @@ -401,7 +401,7 @@ void shouldRespectEmptyAllowlist(@InjectNetworkStorageComponent final StorageNet sut.setFilterMode(FilterMode.ALLOW); sut.setFilters(Set.of()); - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); final FakeImporterSource source = new FakeImporterSource(B, A) .add(B, 10) @@ -427,7 +427,7 @@ void shouldRespectBlocklist(@InjectNetworkStorageComponent final StorageNetworkC sut.setFilterMode(FilterMode.BLOCK); sut.setFilters(Set.of(A)); - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); final FakeImporterSource source = new FakeImporterSource(A, B) .add(A, 10) @@ -457,7 +457,7 @@ void shouldRespectBlocklistWithoutAlternative( sut.setFilterMode(FilterMode.BLOCK); sut.setFilters(Set.of(A)); - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); final FakeImporterSource source = new FakeImporterSource(A) .add(A, 10); @@ -481,7 +481,7 @@ void shouldRespectEmptyBlocklist(@InjectNetworkStorageComponent final StorageNet sut.setFilterMode(FilterMode.BLOCK); sut.setFilters(Set.of()); - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); final FakeImporterSource source = new FakeImporterSource(A, B) .add(A, 10) diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayNetworkNodeTest.java index 3c766ecf3..7a396353a 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayNetworkNodeTest.java @@ -10,7 +10,7 @@ import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.storage.AccessMode; import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import com.refinedmods.refinedstorage.network.test.InjectNetwork; import com.refinedmods.refinedstorage.network.test.InjectNetworkEnergyComponent; @@ -259,12 +259,12 @@ void shouldResetComponentsIfNetworkIsChanged( RelayComponentType.STORAGE )); - inputStorage.addSource(new InMemoryStorageImpl()); + inputStorage.addSource(new StorageImpl()); inputStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); inputStorage.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE); inputStorage.extract(B, 3, Action.EXECUTE, EmptyActor.INSTANCE); - inputAlternativeStorage.addSource(new InMemoryStorageImpl()); + inputAlternativeStorage.addSource(new StorageImpl()); inputAlternativeStorage.insert(A, 33, Action.EXECUTE, EmptyActor.INSTANCE); addSecurityPolicy(inputSecurity, FakePermissions.OTHER); @@ -400,7 +400,7 @@ static void addSecurityPolicy(final SecurityNetworkComponent security, final Fak } static void addStorageSource(final StorageNetworkComponent storage) { - storage.addSource(new InMemoryStorageImpl()); + storage.addSource(new StorageImpl()); storage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); } } diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayStorageNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayStorageNetworkNodeTest.java index 12464d396..f7f095ff8 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayStorageNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayStorageNetworkNodeTest.java @@ -9,8 +9,8 @@ import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; import com.refinedmods.refinedstorage.api.storage.AccessMode; import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import com.refinedmods.refinedstorage.api.storage.composite.PriorityStorage; import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl; import com.refinedmods.refinedstorage.network.test.AddNetworkNode; @@ -62,7 +62,7 @@ void shouldPassStorageComponent( addSecurityPolicy(inputSecurity, FakePermissions.OTHER); - inputStorage.addSource(new InMemoryStorageImpl()); + inputStorage.addSource(new StorageImpl()); inputStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); // Act @@ -100,7 +100,7 @@ void shouldRemoveStorageWhenNetworkIsRemoved( input.setActive(true); input.setOutputNode(output); - inputStorage.addSource(new InMemoryStorageImpl()); + inputStorage.addSource(new StorageImpl()); inputStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); input.setComponentTypes(Set.of(RelayComponentType.STORAGE)); inputStorage.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE); @@ -136,7 +136,7 @@ void shouldNotNotifyOldOutputNetworkWhenOutputNetworkHasChanged( input.setActive(true); input.setOutputNode(output); - inputStorage.addSource(new InMemoryStorageImpl()); + inputStorage.addSource(new StorageImpl()); inputStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); input.setComponentTypes(Set.of(RelayComponentType.STORAGE)); @@ -165,7 +165,7 @@ void shouldInsertResourcesIntoInputStorageFromOutputStorage( input.setOutputNode(output); input.setComponentTypes(Set.of(RelayComponentType.STORAGE)); - inputStorage.addSource(new InMemoryStorageImpl()); + inputStorage.addSource(new StorageImpl()); inputStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); // Act @@ -195,7 +195,7 @@ void shouldExtractResourcesFromInputStorageIntoOutputStorage( input.setOutputNode(output); input.setComponentTypes(Set.of(RelayComponentType.STORAGE)); - inputStorage.addSource(new InMemoryStorageImpl()); + inputStorage.addSource(new StorageImpl()); inputStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); // Act @@ -224,7 +224,7 @@ void shouldNotInsertInExtractOnlyMode( input.setAccessMode(AccessMode.EXTRACT); input.setComponentTypes(Set.of(RelayComponentType.STORAGE)); - inputStorage.addSource(new InMemoryStorageImpl()); + inputStorage.addSource(new StorageImpl()); inputStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); // Act @@ -255,7 +255,7 @@ void shouldNotExtractInInsertOnlyMode( input.setAccessMode(AccessMode.INSERT); input.setComponentTypes(Set.of(RelayComponentType.STORAGE)); - inputStorage.addSource(new InMemoryStorageImpl()); + inputStorage.addSource(new StorageImpl()); inputStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); // Act @@ -287,14 +287,14 @@ void shouldRespectPriorityOfOutput( input.setOutputNode(output); input.setPriority(3); input.setComponentTypes(Set.of(RelayComponentType.STORAGE)); - inputStorage.addSource(new InMemoryStorageImpl()); + inputStorage.addSource(new StorageImpl()); inputStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage fallbackStorage1 = PriorityStorage.of(new InMemoryStorageImpl(), 2); + final Storage fallbackStorage1 = PriorityStorage.of(new StorageImpl(), 2); fallbackStorage1.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); outputStorage.addSource(fallbackStorage1); - final Storage fallbackStorage2 = PriorityStorage.of(new InMemoryStorageImpl(), 1); + final Storage fallbackStorage2 = PriorityStorage.of(new StorageImpl(), 1); fallbackStorage2.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); outputStorage.addSource(fallbackStorage2); @@ -364,7 +364,7 @@ void shouldRespectBlocklistFilter( input.setOutputNode(output); input.setFilters(Set.of(A, B)); - inputStorage.addSource(new InMemoryStorageImpl()); + inputStorage.addSource(new StorageImpl()); inputStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); inputStorage.insert(B, 9, Action.EXECUTE, EmptyActor.INSTANCE); inputStorage.insert(C, 8, Action.EXECUTE, EmptyActor.INSTANCE); @@ -414,7 +414,7 @@ void shouldRespectAllowlistFilter( input.setFilters(Set.of(A, B)); input.setFilterMode(FilterMode.ALLOW); - inputStorage.addSource(new InMemoryStorageImpl()); + inputStorage.addSource(new StorageImpl()); inputStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); inputStorage.insert(B, 9, Action.EXECUTE, EmptyActor.INSTANCE); inputStorage.insert(C, 8, Action.EXECUTE, EmptyActor.INSTANCE); @@ -471,7 +471,7 @@ void shouldRespectFilterNormalizer( return resource; }); - inputStorage.addSource(new InMemoryStorageImpl()); + inputStorage.addSource(new StorageImpl()); inputStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); inputStorage.insert(A_ALTERNATIVE, 3, Action.EXECUTE, EmptyActor.INSTANCE); inputStorage.insert(B, 9, Action.EXECUTE, EmptyActor.INSTANCE); @@ -530,7 +530,7 @@ void shouldUpdateOutputStorageWhenFiltersAreChanged( input.setFilters(Set.of(A)); input.setFilterMode(FilterMode.BLOCK); - inputStorage.addSource(new InMemoryStorageImpl()); + inputStorage.addSource(new StorageImpl()); inputStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); inputStorage.insert(B, 9, Action.EXECUTE, EmptyActor.INSTANCE); inputStorage.insert(C, 8, Action.EXECUTE, EmptyActor.INSTANCE); @@ -565,7 +565,7 @@ void shouldUpdateOutputStorageWhenFilterModeIsChanged( input.setFilters(Set.of(A)); input.setFilterMode(FilterMode.BLOCK); - inputStorage.addSource(new InMemoryStorageImpl()); + inputStorage.addSource(new StorageImpl()); inputStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); inputStorage.insert(B, 9, Action.EXECUTE, EmptyActor.INSTANCE); inputStorage.insert(C, 8, Action.EXECUTE, EmptyActor.INSTANCE); @@ -609,7 +609,7 @@ void shouldDetectStorageCycles( cycleOutputAlternative.setNetwork(inputAlternativeNetwork); inputAlternativeNetwork.addContainer(() -> cycleOutputAlternative); - inputStorage.addSource(new InMemoryStorageImpl()); + inputStorage.addSource(new StorageImpl()); // Assert final long inserted1 = inputStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/StorageNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/StorageNetworkNodeTest.java index b7045a0e6..7e21a3da7 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/StorageNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/StorageNetworkNodeTest.java @@ -8,9 +8,9 @@ import com.refinedmods.refinedstorage.api.resource.filter.FilterMode; import com.refinedmods.refinedstorage.api.storage.AccessMode; import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; import com.refinedmods.refinedstorage.api.storage.StateTrackedStorage; import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import com.refinedmods.refinedstorage.api.storage.StorageState; import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorageImpl; @@ -153,7 +153,7 @@ void testState(final boolean active) { final Storage fullStorage = new LimitedStorageImpl(100); fullStorage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage unlimitedStorage = new InMemoryStorageImpl(); + final Storage unlimitedStorage = new StorageImpl(); provider.set(2, unlimitedStorage); provider.set(3, normalStorage); diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storagetransfer/StorageTransferNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storagetransfer/StorageTransferNetworkNodeTest.java index 9ee64fdf1..685591a0d 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storagetransfer/StorageTransferNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storagetransfer/StorageTransferNetworkNodeTest.java @@ -9,8 +9,8 @@ import com.refinedmods.refinedstorage.api.resource.list.ResourceListImpl; import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl; import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent; @@ -54,9 +54,9 @@ void setUp() { @Test void shouldNotTransferWithoutNetwork(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) { // Arrange - networkStorage.addSource(new InMemoryStorageImpl()); + networkStorage.addSource(new StorageImpl()); - final Storage source = new InMemoryStorageImpl(ResourceListImpl.orderPreserving()); + final Storage source = new StorageImpl(ResourceListImpl.orderPreserving()); source.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE); provider.set(0, source); @@ -75,9 +75,9 @@ void shouldNotTransferWithoutNetwork(@InjectNetworkStorageComponent final Storag @Test void shouldNotTransferWhenInactive(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) { // Arrange - networkStorage.addSource(new InMemoryStorageImpl()); + networkStorage.addSource(new StorageImpl()); - final Storage source = new InMemoryStorageImpl(ResourceListImpl.orderPreserving()); + final Storage source = new StorageImpl(ResourceListImpl.orderPreserving()); source.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE); provider.set(0, source); @@ -100,10 +100,10 @@ void shouldNotTransferWithoutTransferQuotaProvider( @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage ) { // Arrange - networkStorage.addSource(new InMemoryStorageImpl()); + networkStorage.addSource(new StorageImpl()); networkStorage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage source = new InMemoryStorageImpl(); + final Storage source = new StorageImpl(); source.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE); provider.set(0, source); @@ -125,7 +125,7 @@ void shouldNotTransferWithoutTransferQuotaProvider( @Test void shouldInsert(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) { // Arrange - networkStorage.addSource(new InMemoryStorageImpl()); + networkStorage.addSource(new StorageImpl()); final Storage source0 = new LimitedStorageImpl(1) { @Override @@ -139,14 +139,14 @@ public long extract(final ResourceKey resource, source0.insert(A, 1, Action.EXECUTE, EmptyActor.INSTANCE); provider.set(0, source0); - final Storage source1 = new InMemoryStorageImpl(ResourceListImpl.orderPreserving()); + final Storage source1 = new StorageImpl(ResourceListImpl.orderPreserving()); source1.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); source1.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE); source1.insert(C, 35, Action.EXECUTE, EmptyActor.INSTANCE); source1.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE); provider.set(1, source1); - final Storage source2 = new InMemoryStorageImpl(ResourceListImpl.orderPreserving()); + final Storage source2 = new StorageImpl(ResourceListImpl.orderPreserving()); source2.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE); provider.set(2, source2); @@ -178,16 +178,16 @@ public long extract(final ResourceKey resource, @Test void shouldInsertAllowlist(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) { // Arrange - networkStorage.addSource(new InMemoryStorageImpl()); + networkStorage.addSource(new StorageImpl()); - final Storage source1 = new InMemoryStorageImpl(ResourceListImpl.orderPreserving()); + final Storage source1 = new StorageImpl(ResourceListImpl.orderPreserving()); source1.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); source1.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE); source1.insert(C, 35, Action.EXECUTE, EmptyActor.INSTANCE); source1.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE); provider.set((sut.getSize() / 2) - 2, source1); - final Storage source2 = new InMemoryStorageImpl(ResourceListImpl.orderPreserving()); + final Storage source2 = new StorageImpl(ResourceListImpl.orderPreserving()); source2.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE); provider.set((sut.getSize() / 2) - 1, source2); @@ -217,16 +217,16 @@ void shouldInsertAllowlist(@InjectNetworkStorageComponent final StorageNetworkCo @Test void shouldInsertBlocklist(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) { // Arrange - networkStorage.addSource(new InMemoryStorageImpl()); + networkStorage.addSource(new StorageImpl()); - final Storage source1 = new InMemoryStorageImpl(ResourceListImpl.orderPreserving()); + final Storage source1 = new StorageImpl(ResourceListImpl.orderPreserving()); source1.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); source1.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE); source1.insert(C, 35, Action.EXECUTE, EmptyActor.INSTANCE); source1.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE); provider.set(0, source1); - final Storage source2 = new InMemoryStorageImpl(ResourceListImpl.orderPreserving()); + final Storage source2 = new StorageImpl(ResourceListImpl.orderPreserving()); source2.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE); provider.set(1, source2); @@ -257,7 +257,7 @@ void shouldInsertBlocklist(@InjectNetworkStorageComponent final StorageNetworkCo @Test void shouldNotifyListenerWhenReadyInsertingBecauseStorageWasAlreadyEmpty() { // Arrange - final Storage source = new InMemoryStorageImpl(); + final Storage source = new StorageImpl(); provider.set(0, source); sut.setProvider(provider); @@ -275,9 +275,9 @@ void shouldNotifyListenerWhenReadyInsertingAllResources( @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage ) { // Arrange - networkStorage.addSource(new InMemoryStorageImpl()); + networkStorage.addSource(new StorageImpl()); - final Storage source = new InMemoryStorageImpl(ResourceListImpl.orderPreserving()); + final Storage source = new StorageImpl(ResourceListImpl.orderPreserving()); source.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); source.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE); source.insert(C, 5, Action.EXECUTE, EmptyActor.INSTANCE); @@ -297,12 +297,12 @@ void shouldNotifyListenerWhenReadyInsertingAllResources( @Test void shouldNotifyListenerWhenReadyInsertingAllResourcesAndUsingFilterButInsertedNothing() { // Arrange - final Storage source1 = new InMemoryStorageImpl(ResourceListImpl.orderPreserving()); + final Storage source1 = new StorageImpl(ResourceListImpl.orderPreserving()); source1.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE); source1.insert(C, 5, Action.EXECUTE, EmptyActor.INSTANCE); provider.set(0, source1); - final Storage source2 = new InMemoryStorageImpl(ResourceListImpl.orderPreserving()); + final Storage source2 = new StorageImpl(ResourceListImpl.orderPreserving()); source2.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE); provider.set(1, source2); @@ -330,15 +330,15 @@ void shouldNotifyListenerWhenReadyInsertingAllResourcesAndUsingFilterButStillIns @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage ) { // Arrange - networkStorage.addSource(new InMemoryStorageImpl()); + networkStorage.addSource(new StorageImpl()); - final Storage source1 = new InMemoryStorageImpl(ResourceListImpl.orderPreserving()); + final Storage source1 = new StorageImpl(ResourceListImpl.orderPreserving()); source1.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); source1.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE); source1.insert(C, 5, Action.EXECUTE, EmptyActor.INSTANCE); provider.set(0, source1); - final Storage source2 = new InMemoryStorageImpl(ResourceListImpl.orderPreserving()); + final Storage source2 = new StorageImpl(ResourceListImpl.orderPreserving()); source2.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE); provider.set(1, source2); @@ -368,14 +368,14 @@ void shouldNotNotifyListenerWhenReadyInsertingAllResourcesAndNetworkIsFull( // Arrange networkStorage.addSource(new LimitedStorageImpl(15)); - final Storage source1 = new InMemoryStorageImpl(ResourceListImpl.orderPreserving()); + final Storage source1 = new StorageImpl(ResourceListImpl.orderPreserving()); source1.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); source1.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE); source1.insert(C, 5, Action.EXECUTE, EmptyActor.INSTANCE); source1.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE); provider.set(0, source1); - final Storage source2 = new InMemoryStorageImpl(ResourceListImpl.orderPreserving()); + final Storage source2 = new StorageImpl(ResourceListImpl.orderPreserving()); source2.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); provider.set(1, source2); @@ -404,7 +404,7 @@ void shouldNotNotifyListenerWhenReadyInsertingAllResourcesAndNetworkIsFull( @Test void shouldExtract(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) { // Arrange - networkStorage.addSource(new InMemoryStorageImpl()); + networkStorage.addSource(new StorageImpl()); networkStorage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); networkStorage.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE); networkStorage.insert(C, 35, Action.EXECUTE, EmptyActor.INSTANCE); @@ -413,7 +413,7 @@ void shouldExtract(@InjectNetworkStorageComponent final StorageNetworkComponent final Storage source1 = new LimitedStorageImpl(0); provider.set(0, source1); - final Storage source2 = new InMemoryStorageImpl(); + final Storage source2 = new StorageImpl(); provider.set(1, source2); sut.setProvider(provider); @@ -440,16 +440,16 @@ void shouldExtract(@InjectNetworkStorageComponent final StorageNetworkComponent @Test void shouldExtractAllowlist(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) { // Arrange - networkStorage.addSource(new InMemoryStorageImpl()); + networkStorage.addSource(new StorageImpl()); networkStorage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); networkStorage.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE); networkStorage.insert(C, 35, Action.EXECUTE, EmptyActor.INSTANCE); networkStorage.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage source1 = new InMemoryStorageImpl(); + final Storage source1 = new StorageImpl(); provider.set(0, source1); - final Storage source2 = new InMemoryStorageImpl(); + final Storage source2 = new StorageImpl(); provider.set(1, source2); sut.setProvider(provider); @@ -477,16 +477,16 @@ void shouldExtractAllowlist(@InjectNetworkStorageComponent final StorageNetworkC @Test void shouldExtractBlocklist(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) { // Arrange - networkStorage.addSource(new InMemoryStorageImpl()); + networkStorage.addSource(new StorageImpl()); networkStorage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); networkStorage.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE); networkStorage.insert(C, 35, Action.EXECUTE, EmptyActor.INSTANCE); networkStorage.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage source1 = new InMemoryStorageImpl(); + final Storage source1 = new StorageImpl(); provider.set(0, source1); - final Storage source2 = new InMemoryStorageImpl(); + final Storage source2 = new StorageImpl(); provider.set(1, source2); sut.setProvider(provider); @@ -515,7 +515,7 @@ void shouldExtractBlocklist(@InjectNetworkStorageComponent final StorageNetworkC @Test void shouldNotifyListenerWhenReadyExtractingBecauseStorageWasAlreadyEmpty() { // Arrange - final Storage source = new InMemoryStorageImpl(); + final Storage source = new StorageImpl(); provider.set(0, source); sut.setProvider(provider); @@ -534,12 +534,12 @@ void shouldNotifyListenerWhenReadyExtractingAllResources( @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage ) { // Arrange - networkStorage.addSource(new InMemoryStorageImpl()); + networkStorage.addSource(new StorageImpl()); networkStorage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); networkStorage.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE); networkStorage.insert(C, 5, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage source = new InMemoryStorageImpl(); + final Storage source = new StorageImpl(); provider.set(0, source); sut.setProvider(provider); @@ -564,12 +564,12 @@ void shouldNotifyListenerWhenReadyExtractingAllResourcesAndUsingFilterButInserte @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage ) { // Arrange - networkStorage.addSource(new InMemoryStorageImpl()); + networkStorage.addSource(new StorageImpl()); networkStorage.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE); networkStorage.insert(C, 5, Action.EXECUTE, EmptyActor.INSTANCE); networkStorage.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage source = new InMemoryStorageImpl(); + final Storage source = new StorageImpl(); provider.set(0, source); sut.setProvider(provider); @@ -596,12 +596,12 @@ void shouldNotifyListenerWhenReadyExtractingAllResourcesAndUsingFilterButStillEx @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage ) { // Arrange - networkStorage.addSource(new InMemoryStorageImpl(ResourceListImpl.orderPreserving())); + networkStorage.addSource(new StorageImpl(ResourceListImpl.orderPreserving())); networkStorage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); networkStorage.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE); networkStorage.insert(C, 5, Action.EXECUTE, EmptyActor.INSTANCE); - final Storage source = new InMemoryStorageImpl(ResourceListImpl.orderPreserving()); + final Storage source = new StorageImpl(ResourceListImpl.orderPreserving()); provider.set(0, source); sut.setProvider(provider); @@ -629,7 +629,7 @@ void shouldNotifyListenerWhenExtractingAllResourcesAndReachingCapacity( @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage ) { // Arrange - networkStorage.addSource(new InMemoryStorageImpl()); + networkStorage.addSource(new StorageImpl()); networkStorage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); networkStorage.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE); networkStorage.insert(C, 5, Action.EXECUTE, EmptyActor.INSTANCE); @@ -660,9 +660,9 @@ void shouldRespectNormalizer( @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage ) { // Arrange - networkStorage.addSource(new InMemoryStorageImpl()); + networkStorage.addSource(new StorageImpl()); - final Storage source = new InMemoryStorageImpl(ResourceListImpl.orderPreserving()); + final Storage source = new StorageImpl(ResourceListImpl.orderPreserving()); source.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); source.insert(A_ALTERNATIVE, 5, Action.EXECUTE, EmptyActor.INSTANCE); source.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE); @@ -695,9 +695,9 @@ void shouldNotTransferAtIndexHigherThanHalf( @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage ) { // Arrange - networkStorage.addSource(new InMemoryStorageImpl()); + networkStorage.addSource(new StorageImpl()); - final Storage source = new InMemoryStorageImpl(); + final Storage source = new StorageImpl(); source.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE); provider.set(sut.getSize() / 2, source); diff --git a/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/InMemoryStorageImpl.java b/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/StorageImpl.java similarity index 88% rename from refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/InMemoryStorageImpl.java rename to refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/StorageImpl.java index e21e42836..d82909000 100644 --- a/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/InMemoryStorageImpl.java +++ b/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/StorageImpl.java @@ -11,18 +11,18 @@ import org.apiguardian.api.API; /** - * An implementation of a {@link Storage} which has an in-memory resource list as a backing list. + * An implementation of a {@link Storage} which has a resource list as a backing list. */ @API(status = API.Status.STABLE, since = "2.0.0-milestone.1.0") -public class InMemoryStorageImpl implements Storage { +public class StorageImpl implements Storage { private final ResourceList list; private long stored; - public InMemoryStorageImpl(final ResourceList list) { + public StorageImpl(final ResourceList list) { this.list = list; } - public InMemoryStorageImpl() { + public StorageImpl() { this(ResourceListImpl.create()); } diff --git a/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/limited/LimitedStorageImpl.java b/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/limited/LimitedStorageImpl.java index c14b1a5cc..d03f7e58f 100644 --- a/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/limited/LimitedStorageImpl.java +++ b/refinedstorage-storage-api/src/main/java/com/refinedmods/refinedstorage/api/storage/limited/LimitedStorageImpl.java @@ -5,9 +5,9 @@ import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.AbstractProxyStorage; import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; import com.refinedmods.refinedstorage.api.storage.InsertableStorage; import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import org.apiguardian.api.API; @@ -30,12 +30,12 @@ public LimitedStorageImpl(final Storage delegate, final long capacity) { } /** - * Constructs the limited storage with a {@link InMemoryStorageImpl} storage. + * Constructs the limited storage with a {@link StorageImpl} storage. * * @param capacity the capacity, must be 0 or larger than 0 */ public LimitedStorageImpl(final long capacity) { - this(new InMemoryStorageImpl(), capacity); + this(new StorageImpl(), capacity); } @Override diff --git a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/LimitedStorageImplTest.java b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/LimitedStorageImplTest.java index 810f793a3..7aa757696 100644 --- a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/LimitedStorageImplTest.java +++ b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/LimitedStorageImplTest.java @@ -20,7 +20,7 @@ class LimitedStorageImplTest { @BeforeEach void setUp() { - backed = new ActorCapturingStorage(new InMemoryStorageImpl()); + backed = new ActorCapturingStorage(new StorageImpl()); sut = new LimitedStorageImpl(backed, 100); } diff --git a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/ProxyStorageTest.java b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/ProxyStorageTest.java index cfb314432..7fe11e2c1 100644 --- a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/ProxyStorageTest.java +++ b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/ProxyStorageTest.java @@ -18,7 +18,7 @@ class ProxyStorageTest { @BeforeEach void setUp() { - backed = new ActorCapturingStorage(new InMemoryStorageImpl()); + backed = new ActorCapturingStorage(new StorageImpl()); sut = new AbstractProxyStorage(backed) { }; } diff --git a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/StateTrackedStorageTest.java b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/StateTrackedStorageTest.java index 243556d66..bdfe2e6c0 100644 --- a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/StateTrackedStorageTest.java +++ b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/StateTrackedStorageTest.java @@ -51,7 +51,7 @@ private static Stream states() { void shouldSetInitialState() { // Arrange final StateTrackedStorage.Listener listener = mock(StateTrackedStorage.Listener.class); - final Storage underlyingStorage = new InMemoryStorageImpl(); + final Storage underlyingStorage = new StorageImpl(); underlyingStorage.insert(TestResource.A, 75, Action.EXECUTE, EmptyActor.INSTANCE); final StateTrackedStorage sut = new StateTrackedStorage(underlyingStorage, listener); diff --git a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/InMemoryStorageImplTest.java b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/StorageImplTest.java similarity index 98% rename from refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/InMemoryStorageImplTest.java rename to refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/StorageImplTest.java index 0f7447f95..1221c742e 100644 --- a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/InMemoryStorageImplTest.java +++ b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/StorageImplTest.java @@ -11,8 +11,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -class InMemoryStorageImplTest { - private final Storage sut = new InMemoryStorageImpl(); +class StorageImplTest { + private final Storage sut = new StorageImpl(); @ParameterizedTest @EnumSource(Action.class) diff --git a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/TransferHelperTest.java b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/TransferHelperTest.java index d25d33057..395abc09f 100644 --- a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/TransferHelperTest.java +++ b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/TransferHelperTest.java @@ -199,7 +199,7 @@ public long insert(final ResourceKey resource, final long amount, final Action a @Test void shouldRefundLeftoversToFallbackWhenEventualExecutedInsertToDestinationFailedEvenIfFallbackDoesNotAcceptAll() { // Arrange - final InMemoryStorageImpl underlyingSource = new InMemoryStorageImpl(); + final StorageImpl underlyingSource = new StorageImpl(); final Storage source = new LimitedStorageImpl(underlyingSource, 100) { @Override public long insert(final ResourceKey resource, final long amount, final Action action, final Actor actor) { diff --git a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/composite/CompositeStorageImplTest.java b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/composite/CompositeStorageImplTest.java index f956e531d..985ca196a 100644 --- a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/composite/CompositeStorageImplTest.java +++ b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/composite/CompositeStorageImplTest.java @@ -5,8 +5,8 @@ import com.refinedmods.refinedstorage.api.resource.list.ResourceListImpl; import com.refinedmods.refinedstorage.api.storage.EmptyActor; import com.refinedmods.refinedstorage.api.storage.FakeActors; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorage; @@ -210,8 +210,8 @@ void shouldFindMostRecentChange() { // Arrange final AtomicLong clock = new AtomicLong(0L); - final TrackedStorage a = new TrackedStorageImpl(new InMemoryStorageImpl(), clock::get); - final TrackedStorage b = new TrackedStorageImpl(new InMemoryStorageImpl(), clock::get); + final TrackedStorage a = new TrackedStorageImpl(new StorageImpl(), clock::get); + final TrackedStorage b = new TrackedStorageImpl(new StorageImpl(), clock::get); // Test if it uses the latest across 2 different storages a.insert(A, 1, Action.EXECUTE, FakeActors.FakeActor1.INSTANCE); diff --git a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/composite/SubCompositeCompositeStorageImplTest.java b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/composite/SubCompositeCompositeStorageImplTest.java index 9e3cd603d..fc051b6b1 100644 --- a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/composite/SubCompositeCompositeStorageImplTest.java +++ b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/composite/SubCompositeCompositeStorageImplTest.java @@ -4,8 +4,8 @@ import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.list.ResourceListImpl; import com.refinedmods.refinedstorage.api.storage.EmptyActor; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; import com.refinedmods.refinedstorage.api.storage.Storage; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -26,7 +26,7 @@ void setUp() { void testAddingSubCompositeShouldAddAllResourcesToParent() { // Arrange final CompositeStorage subComposite = new CompositeStorageImpl(ResourceListImpl.create()); - subComposite.addSource(new InMemoryStorageImpl()); + subComposite.addSource(new StorageImpl()); subComposite.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); // Act @@ -42,12 +42,12 @@ void testAddingSubCompositeShouldAddAllResourcesToParent() { void testRemovingSubCompositeShouldRemoveAllResourcesFromParent() { // Arrange final CompositeStorage subComposite = new CompositeStorageImpl(ResourceListImpl.create()); - subComposite.addSource(new InMemoryStorageImpl()); + subComposite.addSource(new StorageImpl()); subComposite.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); sut.addSource(subComposite); - final Storage subCompositeStorage = new InMemoryStorageImpl(); + final Storage subCompositeStorage = new StorageImpl(); subCompositeStorage.insert(B, 10, Action.EXECUTE, EmptyActor.INSTANCE); // Act @@ -63,13 +63,13 @@ void testRemovingSubCompositeShouldRemoveAllResourcesFromParent() { void testAddingSourceToSubCompositeShouldNotifyParent() { // Arrange final CompositeStorage subComposite = new CompositeStorageImpl(ResourceListImpl.create()); - final Storage subStorage = new InMemoryStorageImpl(); + final Storage subStorage = new StorageImpl(); subStorage.insert(B, 10, Action.EXECUTE, EmptyActor.INSTANCE); sut.addSource(subComposite); sut.addSource(subStorage); - final Storage subCompositeStorage = new InMemoryStorageImpl(); + final Storage subCompositeStorage = new StorageImpl(); subCompositeStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); // Act @@ -90,13 +90,13 @@ void testAddingSourceToSubCompositeShouldNotifyParent() { void testRemovingSourceFromSubCompositeShouldNotifyParent() { // Arrange final CompositeStorage subComposite = new CompositeStorageImpl(ResourceListImpl.create()); - final Storage subStorage = new InMemoryStorageImpl(); + final Storage subStorage = new StorageImpl(); subStorage.insert(B, 10, Action.EXECUTE, EmptyActor.INSTANCE); sut.addSource(subComposite); sut.addSource(subStorage); - final Storage subCompositeStorage = new InMemoryStorageImpl(); + final Storage subCompositeStorage = new StorageImpl(); subCompositeStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE); subComposite.addSource(subCompositeStorage); diff --git a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/external/TransformingStorage.java b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/external/TransformingStorage.java index 54301376d..2b57dac0f 100644 --- a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/external/TransformingStorage.java +++ b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/external/TransformingStorage.java @@ -4,14 +4,14 @@ import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.AbstractProxyStorage; import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl; +import com.refinedmods.refinedstorage.api.storage.StorageImpl; import static com.refinedmods.refinedstorage.api.storage.external.ExternalTestResource.A_ALTERNATIVE; import static com.refinedmods.refinedstorage.api.storage.external.ExternalTestResource.A_TRANSFORMED; class TransformingStorage extends AbstractProxyStorage { TransformingStorage() { - super(new InMemoryStorageImpl()); + super(new StorageImpl()); } private ResourceKey transform(final ResourceKey resource) { From 71d332b9e340d17a16958f2a114799edccd46fda Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sat, 10 Aug 2024 14:09:25 +0200 Subject: [PATCH 15/20] build: manually update name as intellij failed to refactor See 400bd302 --- .../fabric/storage/AbstractDiskContainerBakedModel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/AbstractDiskContainerBakedModel.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/AbstractDiskContainerBakedModel.java index 03d3c9728..ee6ac9069 100644 --- a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/AbstractDiskContainerBakedModel.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/storage/AbstractDiskContainerBakedModel.java @@ -3,7 +3,7 @@ import com.refinedmods.refinedstorage.api.storage.StorageState; import com.refinedmods.refinedstorage.common.storage.AbstractDiskContainerBlockEntity; import com.refinedmods.refinedstorage.common.storage.Disk; -import com.refinedmods.refinedstorage.common.util.PlatformUtil; +import com.refinedmods.refinedstorage.common.util.ClientPlatformUtil; import com.refinedmods.refinedstorage.fabric.support.render.QuadTranslator; import java.util.Map; @@ -58,7 +58,7 @@ public void emitBlockQuads(final BlockAndTintGetter blockView, public void emitItemQuads(final ItemStack stack, final Supplier randomSupplier, final RenderContext context) { - final Level level = PlatformUtil.getClientLevel(); + final Level level = ClientPlatformUtil.getClientLevel(); final CustomData customData = stack.get(DataComponents.BLOCK_ENTITY_DATA); if (customData == null || level == null) { return; From 8e3b1f2d33ffa5ed8ddf2147ce08f8156dc361ea Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sat, 10 Aug 2024 17:35:37 +0200 Subject: [PATCH 16/20] feat: add transmitting icon for wireless transmitter and network transmitter The wireless transmitter can now also display "inactive". --- CHANGELOG.md | 2 + .../common/AbstractClientModInitializer.java | 2 +- .../common/AbstractModInitializer.java | 12 ++-- .../common/RefinedStorageApiImpl.java | 2 +- .../common/content/BlockEntities.java | 2 +- .../refinedstorage/common/content/Blocks.java | 2 +- .../refinedstorage/common/content/Menus.java | 2 +- .../BaseWirelessTransmitterRangeModifier.java | 2 +- ...ositeWirelessTransmitterRangeModifier.java | 2 +- ...gradeWirelessTransmitterRangeModifier.java | 2 +- .../NetworkTransmitterBlockEntity.java | 3 +- .../NetworkTransmitterContainerMenu.java | 2 +- .../networking/NetworkTransmitterData.java | 9 +-- .../networking/NetworkTransmitterScreen.java | 25 ++++++- ...gradeWirelessTransmitterRangeModifier.java | 2 +- .../common/networking/TransmittingIcon.java | 65 ++++++++++++++++++ .../WirelessTransmitterBlock.java | 2 +- .../WirelessTransmitterBlockEntity.java | 8 ++- ...WirelessTransmitterConnectionStrategy.java | 2 +- .../WirelessTransmitterContainerMenu.java | 22 ++++-- .../WirelessTransmitterData.java | 5 +- ...relessTransmitterNetworkNodeContainer.java | 2 +- .../WirelessTransmitterScreen.java | 26 ++++++- .../s2c/NetworkTransmitterStatusPacket.java | 6 +- .../common/support/packet/s2c/S2CPackets.java | 6 +- ...ava => WirelessTransmitterDataPacket.java} | 18 ++--- .../wirelesstransmitter/package-info.java | 7 -- .../assets/refinedstorage/lang/en_us.json | 1 + .../textures/gui/network_transmitter.png | Bin 1899 -> 787 bytes .../textures/gui/sprites/transmitting/0.png | Bin 0 -> 210 bytes .../textures/gui/sprites/transmitting/1.png | Bin 0 -> 227 bytes .../textures/gui/sprites/transmitting/2.png | Bin 0 -> 243 bytes .../textures/gui/sprites/transmitting/3.png | Bin 0 -> 275 bytes .../textures/gui/wireless_transmitter.png | Bin 2161 -> 1777 bytes .../fabric/ClientModInitializerImpl.java | 6 +- .../fabric/ModInitializerImpl.java | 6 +- .../neoforge/ModInitializer.java | 8 +-- .../datagen/ItemModelProviderImpl.java | 2 +- 38 files changed, 195 insertions(+), 68 deletions(-) rename refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/{wirelesstransmitter => networking}/BaseWirelessTransmitterRangeModifier.java (88%) rename refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/{wirelesstransmitter => networking}/CompositeWirelessTransmitterRangeModifier.java (93%) rename refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/{wirelesstransmitter => networking}/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java (91%) rename refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/{wirelesstransmitter => networking}/RangeUpgradeWirelessTransmitterRangeModifier.java (91%) create mode 100644 refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/TransmittingIcon.java rename refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/{wirelesstransmitter => networking}/WirelessTransmitterBlock.java (98%) rename refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/{wirelesstransmitter => networking}/WirelessTransmitterBlockEntity.java (96%) rename refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/{wirelesstransmitter => networking}/WirelessTransmitterConnectionStrategy.java (95%) rename refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/{wirelesstransmitter => networking}/WirelessTransmitterContainerMenu.java (86%) rename refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/{wirelesstransmitter => networking}/WirelessTransmitterData.java (67%) rename refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/{wirelesstransmitter => networking}/WirelessTransmitterNetworkNodeContainer.java (96%) rename refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/{wirelesstransmitter => networking}/WirelessTransmitterScreen.java (67%) rename refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/{WirelessTransmitterRangePacket.java => WirelessTransmitterDataPacket.java} (54%) delete mode 100644 refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/package-info.java create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/transmitting/0.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/transmitting/1.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/transmitting/2.png create mode 100644 refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/transmitting/3.png diff --git a/CHANGELOG.md b/CHANGELOG.md index 666786808..0972b19ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Changed - Updated to Minecraft 1.21.1. +- The Network Transmitter and Wireless Transmitter GUI now has an inactive and active GUI animation. +- The Wireless Transmitter now shows whether it's inactive in GUI instead of always showing the range. ### Fixed diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractClientModInitializer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractClientModInitializer.java index c5cbe6ccd..d673c87fd 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractClientModInitializer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractClientModInitializer.java @@ -19,6 +19,7 @@ import com.refinedmods.refinedstorage.common.importer.ImporterScreen; import com.refinedmods.refinedstorage.common.networking.NetworkTransmitterScreen; import com.refinedmods.refinedstorage.common.networking.RelayScreen; +import com.refinedmods.refinedstorage.common.networking.WirelessTransmitterScreen; import com.refinedmods.refinedstorage.common.security.FallbackSecurityCardScreen; import com.refinedmods.refinedstorage.common.security.SecurityCardScreen; import com.refinedmods.refinedstorage.common.security.SecurityManagerScreen; @@ -36,7 +37,6 @@ import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import com.refinedmods.refinedstorage.common.support.resource.ItemResourceRendering; import com.refinedmods.refinedstorage.common.upgrade.RegulatorUpgradeScreen; -import com.refinedmods.refinedstorage.common.wirelesstransmitter.WirelessTransmitterScreen; import net.minecraft.client.KeyMapping; import net.minecraft.client.Minecraft; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractModInitializer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractModInitializer.java index 771447fdd..2e4819340 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractModInitializer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractModInitializer.java @@ -70,13 +70,19 @@ import com.refinedmods.refinedstorage.common.importer.ImporterContainerMenu; import com.refinedmods.refinedstorage.common.misc.ProcessorItem; import com.refinedmods.refinedstorage.common.misc.WrenchItem; +import com.refinedmods.refinedstorage.common.networking.BaseWirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage.common.networking.CreativeRangeUpgradeWirelessTransmitterRangeModifier; import com.refinedmods.refinedstorage.common.networking.NetworkCardItem; import com.refinedmods.refinedstorage.common.networking.NetworkReceiverBlockEntity; import com.refinedmods.refinedstorage.common.networking.NetworkTransmitterBlockEntity; import com.refinedmods.refinedstorage.common.networking.NetworkTransmitterContainerMenu; import com.refinedmods.refinedstorage.common.networking.NetworkTransmitterData; +import com.refinedmods.refinedstorage.common.networking.RangeUpgradeWirelessTransmitterRangeModifier; import com.refinedmods.refinedstorage.common.networking.RelayBlockEntity; import com.refinedmods.refinedstorage.common.networking.RelayContainerMenu; +import com.refinedmods.refinedstorage.common.networking.WirelessTransmitterBlockEntity; +import com.refinedmods.refinedstorage.common.networking.WirelessTransmitterContainerMenu; +import com.refinedmods.refinedstorage.common.networking.WirelessTransmitterData; import com.refinedmods.refinedstorage.common.security.BuiltinPermission; import com.refinedmods.refinedstorage.common.security.FallbackSecurityCardContainerMenu; import com.refinedmods.refinedstorage.common.security.PlatformSecurityNetworkComponentImpl; @@ -141,12 +147,6 @@ import com.refinedmods.refinedstorage.common.upgrade.SimpleUpgradeItem; import com.refinedmods.refinedstorage.common.upgrade.UpgradeDestinations; import com.refinedmods.refinedstorage.common.upgrade.UpgradeWithEnchantedBookRecipeSerializer; -import com.refinedmods.refinedstorage.common.wirelesstransmitter.BaseWirelessTransmitterRangeModifier; -import com.refinedmods.refinedstorage.common.wirelesstransmitter.CreativeRangeUpgradeWirelessTransmitterRangeModifier; -import com.refinedmods.refinedstorage.common.wirelesstransmitter.RangeUpgradeWirelessTransmitterRangeModifier; -import com.refinedmods.refinedstorage.common.wirelesstransmitter.WirelessTransmitterBlockEntity; -import com.refinedmods.refinedstorage.common.wirelesstransmitter.WirelessTransmitterContainerMenu; -import com.refinedmods.refinedstorage.common.wirelesstransmitter.WirelessTransmitterData; import java.util.Optional; import java.util.UUID; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/RefinedStorageApiImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/RefinedStorageApiImpl.java index 93cd3a5e4..6b75e9080 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/RefinedStorageApiImpl.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/RefinedStorageApiImpl.java @@ -56,6 +56,7 @@ import com.refinedmods.refinedstorage.common.grid.strategy.CompositeGridExtractionStrategy; import com.refinedmods.refinedstorage.common.grid.strategy.CompositeGridInsertionStrategy; import com.refinedmods.refinedstorage.common.grid.strategy.CompositeGridScrollingStrategy; +import com.refinedmods.refinedstorage.common.networking.CompositeWirelessTransmitterRangeModifier; import com.refinedmods.refinedstorage.common.storage.ClientStorageRepository; import com.refinedmods.refinedstorage.common.storage.StorageContainerItemHelperImpl; import com.refinedmods.refinedstorage.common.storage.StorageRepositoryImpl; @@ -80,7 +81,6 @@ import com.refinedmods.refinedstorage.common.upgrade.UpgradeRegistryImpl; import com.refinedmods.refinedstorage.common.util.IdentifierUtil; import com.refinedmods.refinedstorage.common.util.ServerEventQueue; -import com.refinedmods.refinedstorage.common.wirelesstransmitter.CompositeWirelessTransmitterRangeModifier; import java.util.ArrayList; import java.util.Arrays; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockEntities.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockEntities.java index 52cbb5070..edf871ffa 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockEntities.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/BlockEntities.java @@ -14,6 +14,7 @@ import com.refinedmods.refinedstorage.common.networking.NetworkReceiverBlockEntity; import com.refinedmods.refinedstorage.common.networking.NetworkTransmitterBlockEntity; import com.refinedmods.refinedstorage.common.networking.RelayBlockEntity; +import com.refinedmods.refinedstorage.common.networking.WirelessTransmitterBlockEntity; import com.refinedmods.refinedstorage.common.security.SecurityManagerBlockEntity; import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; @@ -25,7 +26,6 @@ import com.refinedmods.refinedstorage.common.storage.storageblock.ItemStorageBlockBlockEntity; import com.refinedmods.refinedstorage.common.storagemonitor.StorageMonitorBlockEntity; import com.refinedmods.refinedstorage.common.support.network.BaseNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.common.wirelesstransmitter.WirelessTransmitterBlockEntity; import java.util.EnumMap; import java.util.Map; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Blocks.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Blocks.java index 2f9eaf37f..ee4512331 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Blocks.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Blocks.java @@ -19,6 +19,7 @@ import com.refinedmods.refinedstorage.common.networking.NetworkReceiverBlock; import com.refinedmods.refinedstorage.common.networking.NetworkTransmitterBlock; import com.refinedmods.refinedstorage.common.networking.RelayBlock; +import com.refinedmods.refinedstorage.common.networking.WirelessTransmitterBlock; import com.refinedmods.refinedstorage.common.security.SecurityManagerBlock; import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; @@ -32,7 +33,6 @@ import com.refinedmods.refinedstorage.common.storagemonitor.StorageMonitorBlock; import com.refinedmods.refinedstorage.common.support.BaseBlockItem; import com.refinedmods.refinedstorage.common.support.SimpleBlock; -import com.refinedmods.refinedstorage.common.wirelesstransmitter.WirelessTransmitterBlock; import java.util.EnumMap; import java.util.Map; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Menus.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Menus.java index b4c7642a2..328a7615c 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Menus.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/Menus.java @@ -13,6 +13,7 @@ import com.refinedmods.refinedstorage.common.importer.ImporterContainerMenu; import com.refinedmods.refinedstorage.common.networking.NetworkTransmitterContainerMenu; import com.refinedmods.refinedstorage.common.networking.RelayContainerMenu; +import com.refinedmods.refinedstorage.common.networking.WirelessTransmitterContainerMenu; import com.refinedmods.refinedstorage.common.security.FallbackSecurityCardContainerMenu; import com.refinedmods.refinedstorage.common.security.SecurityCardContainerMenu; import com.refinedmods.refinedstorage.common.security.SecurityManagerContainerMenu; @@ -25,7 +26,6 @@ import com.refinedmods.refinedstorage.common.storage.storageblock.ItemStorageBlockContainerMenu; import com.refinedmods.refinedstorage.common.storagemonitor.StorageMonitorContainerMenu; import com.refinedmods.refinedstorage.common.upgrade.RegulatorUpgradeContainerMenu; -import com.refinedmods.refinedstorage.common.wirelesstransmitter.WirelessTransmitterContainerMenu; import java.util.function.Supplier; import javax.annotation.Nullable; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/BaseWirelessTransmitterRangeModifier.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/BaseWirelessTransmitterRangeModifier.java similarity index 88% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/BaseWirelessTransmitterRangeModifier.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/BaseWirelessTransmitterRangeModifier.java index 76b6cc3a4..e85aced1f 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/BaseWirelessTransmitterRangeModifier.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/BaseWirelessTransmitterRangeModifier.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.wirelesstransmitter; +package com.refinedmods.refinedstorage.common.networking; import com.refinedmods.refinedstorage.common.Platform; import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/CompositeWirelessTransmitterRangeModifier.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/CompositeWirelessTransmitterRangeModifier.java similarity index 93% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/CompositeWirelessTransmitterRangeModifier.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/CompositeWirelessTransmitterRangeModifier.java index 1ac68976c..e2a89ea04 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/CompositeWirelessTransmitterRangeModifier.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/CompositeWirelessTransmitterRangeModifier.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.wirelesstransmitter; +package com.refinedmods.refinedstorage.common.networking; import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; import com.refinedmods.refinedstorage.common.api.wirelesstransmitter.WirelessTransmitterRangeModifier; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java similarity index 91% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java index 5c1e8e8b7..8e8764fa4 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.wirelesstransmitter; +package com.refinedmods.refinedstorage.common.networking; import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; import com.refinedmods.refinedstorage.common.api.wirelesstransmitter.WirelessTransmitterRangeModifier; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterBlockEntity.java index 5f32d3502..2235d07e4 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterBlockEntity.java @@ -44,6 +44,7 @@ public class NetworkTransmitterBlockEntity private static final Logger LOGGER = LoggerFactory.getLogger(NetworkTransmitterBlockEntity.class); private static final NetworkTransmitterData INACTIVE = NetworkTransmitterData.message( + false, createTranslation("gui", "network_transmitter.status.inactive") ); private static final NetworkTransmitterData MISSING_NETWORK_CARD = NetworkTransmitterData.error( @@ -138,7 +139,7 @@ NetworkTransmitterData getStatus() { "gui", "network_transmitter.status.transmitting", receiverKey.getDistance(worldPosition)) : receiverKey.getDimensionName(); - return NetworkTransmitterData.message(message); + return NetworkTransmitterData.message(true, message); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterContainerMenu.java index 33538c0eb..b14de4e46 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterContainerMenu.java @@ -60,7 +60,7 @@ public void broadcastChanges() { return; } final NetworkTransmitterData newStatus = blockEntity.getStatus(); - if (newStatus.message().equals(status.message())) { + if (newStatus.equals(status)) { return; } updateStatus(serverPlayer, newStatus); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterData.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterData.java index 3211a3423..79039c5af 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterData.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterData.java @@ -6,19 +6,20 @@ import net.minecraft.network.codec.ByteBufCodecs; import net.minecraft.network.codec.StreamCodec; -public record NetworkTransmitterData(boolean error, Component message) { +public record NetworkTransmitterData(boolean error, boolean transmitting, Component message) { public static final StreamCodec STREAM_CODEC = StreamCodec.composite( ByteBufCodecs.BOOL, NetworkTransmitterData::error, + ByteBufCodecs.BOOL, NetworkTransmitterData::transmitting, ComponentSerialization.STREAM_CODEC, NetworkTransmitterData::message, NetworkTransmitterData::new ); static NetworkTransmitterData error(final Component message) { - return new NetworkTransmitterData(true, message); + return new NetworkTransmitterData(true, false, message); } - static NetworkTransmitterData message(final Component message) { - return new NetworkTransmitterData(false, message); + static NetworkTransmitterData message(final boolean transmitting, final Component message) { + return new NetworkTransmitterData(false, transmitting, message); } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterScreen.java index 0d18b7603..84bd79eab 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterScreen.java @@ -16,6 +16,8 @@ public class NetworkTransmitterScreen extends AbstractBaseScreen { private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/network_transmitter.png"); + private final TransmittingIcon icon; + public NetworkTransmitterScreen(final NetworkTransmitterContainerMenu menu, final Inventory playerInventory, final Component text) { @@ -23,6 +25,7 @@ public NetworkTransmitterScreen(final NetworkTransmitterContainerMenu menu, this.inventoryLabelY = 42; this.imageWidth = 176; this.imageHeight = 137; + this.icon = new TransmittingIcon(isIconActive()); } @Override @@ -31,15 +34,31 @@ protected void init() { addSideButton(new RedstoneModeSideButtonWidget(getMenu().getProperty(PropertyTypes.REDSTONE_MODE))); } + @Override + protected void containerTick() { + super.containerTick(); + icon.tick(isIconActive()); + } + + private boolean isIconActive() { + return !getMenu().getStatus().error() && getMenu().getStatus().transmitting(); + } + + @Override + protected void renderBg(final GuiGraphics graphics, final float delta, final int mouseX, final int mouseY) { + super.renderBg(graphics, delta, mouseX, mouseY); + icon.render(graphics, leftPos + 29, topPos + 22); + } + @Override protected void renderLabels(final GuiGraphics graphics, final int mouseX, final int mouseY) { super.renderLabels(graphics, mouseX, mouseY); final NetworkTransmitterData status = getMenu().getStatus(); - final int displayTextX = 51; + final int x = 25 + 4 + icon.getWidth() + 4; if (status.error()) { - graphics.blitSprite(WARNING, displayTextX, 23, WARNING_SIZE, WARNING_SIZE); + graphics.blitSprite(WARNING, x, 23, WARNING_SIZE, WARNING_SIZE); } - graphics.drawString(font, status.message(), displayTextX + (status.error() ? (10 + 4) : 0), 25, 4210752, false); + graphics.drawString(font, status.message(), x + (status.error() ? (10 + 4) : 0), 25, 4210752, false); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/RangeUpgradeWirelessTransmitterRangeModifier.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RangeUpgradeWirelessTransmitterRangeModifier.java similarity index 91% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/RangeUpgradeWirelessTransmitterRangeModifier.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RangeUpgradeWirelessTransmitterRangeModifier.java index cf18efaaa..1686e6300 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/RangeUpgradeWirelessTransmitterRangeModifier.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RangeUpgradeWirelessTransmitterRangeModifier.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.wirelesstransmitter; +package com.refinedmods.refinedstorage.common.networking; import com.refinedmods.refinedstorage.common.Platform; import com.refinedmods.refinedstorage.common.api.upgrade.UpgradeState; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/TransmittingIcon.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/TransmittingIcon.java new file mode 100644 index 000000000..db062c2b2 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/TransmittingIcon.java @@ -0,0 +1,65 @@ +package com.refinedmods.refinedstorage.common.networking; + +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.resources.ResourceLocation; + +import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; + +class TransmittingIcon { + private static final int WIDTH_0 = 11; + private static final int WIDTH_3 = 20; + private static final int TRANSMITTING_FRAMES = 20; + private static final ResourceLocation NOT_TRANSMITTING = createIdentifier("transmitting/0"); + private static final ResourceLocation TRANSMITTING_1 = createIdentifier("transmitting/1"); + private static final ResourceLocation TRANSMITTING_2 = createIdentifier("transmitting/2"); + private static final ResourceLocation TRANSMITTING_3 = createIdentifier("transmitting/3"); + + private int frames; + private int cycle; + private boolean active; + + TransmittingIcon(final boolean active) { + this.active = active; + } + + void tick(final boolean newActive) { + this.active = newActive; + doTick(); + } + + private void doTick() { + if (!active) { + frames = 0; + cycle = 0; + return; + } + ++frames; + if (frames == TRANSMITTING_FRAMES) { + frames = 0; + cycle++; + } + } + + void render(final GuiGraphics graphics, final int x3, final int y3) { + if (!active) { + graphics.blitSprite(NOT_TRANSMITTING, x3, y3 + 4, WIDTH_0, 4); + return; + } + final int frame = cycle % 3; + switch (frame) { + case 0: + graphics.blitSprite(TRANSMITTING_1, x3, y3 + 3, 14, 6); + break; + case 1: + graphics.blitSprite(TRANSMITTING_2, x3, y3 + 1, 17, 10); + break; + case 2: + graphics.blitSprite(TRANSMITTING_3, x3, y3, WIDTH_3, 12); + break; + } + } + + int getWidth() { + return active ? WIDTH_3 : WIDTH_0; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterBlock.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterBlock.java similarity index 98% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterBlock.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterBlock.java index 30603c483..9d3de8b2c 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterBlock.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterBlock.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.wirelesstransmitter; +package com.refinedmods.refinedstorage.common.networking; import com.refinedmods.refinedstorage.common.content.BlockColorMap; import com.refinedmods.refinedstorage.common.content.BlockConstants; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterBlockEntity.java similarity index 96% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterBlockEntity.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterBlockEntity.java index bdd78012a..fc9803aa0 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterBlockEntity.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.wirelesstransmitter; +package com.refinedmods.refinedstorage.common.networking; import com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode; import com.refinedmods.refinedstorage.common.Platform; @@ -95,7 +95,7 @@ public AbstractContainerMenu createMenu(final int syncId, final Inventory invent @Override public WirelessTransmitterData getMenuData() { - return new WirelessTransmitterData(getRange()); + return new WirelessTransmitterData(getRange(), isActive()); } @Override @@ -127,4 +127,8 @@ protected boolean doesBlockStateChangeWarrantNetworkNodeUpdate(final BlockState final BlockState newBlockState) { return AbstractDirectionalBlock.doesBlockStateChangeWarrantNetworkNodeUpdate(oldBlockState, newBlockState); } + + boolean isActive() { + return mainNetworkNode.isActive(); + } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterConnectionStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterConnectionStrategy.java similarity index 95% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterConnectionStrategy.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterConnectionStrategy.java index fbdc388d8..edceb9d8c 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterConnectionStrategy.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterConnectionStrategy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.wirelesstransmitter; +package com.refinedmods.refinedstorage.common.networking; import com.refinedmods.refinedstorage.common.api.support.network.ConnectionSink; import com.refinedmods.refinedstorage.common.support.network.ColoredConnectionStrategy; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterContainerMenu.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterContainerMenu.java similarity index 86% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterContainerMenu.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterContainerMenu.java index 5bf934a6f..b853d3487 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterContainerMenu.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterContainerMenu.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.wirelesstransmitter; +package com.refinedmods.refinedstorage.common.networking; import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; import com.refinedmods.refinedstorage.common.content.Menus; @@ -22,11 +22,13 @@ public class WirelessTransmitterContainerMenu extends AbstractBaseContainerMenu { private final RateLimiter rangeRateLimiter = RateLimiter.create(4); - private int range; @Nullable private final WirelessTransmitterBlockEntity wirelessTransmitter; private final Player player; + private int range; + private boolean active; + public WirelessTransmitterContainerMenu(final int syncId, final Inventory playerInventory, final WirelessTransmitterData data) { @@ -37,6 +39,7 @@ public WirelessTransmitterContainerMenu(final int syncId, )); registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); this.range = data.range(); + this.active = data.active(); this.wirelessTransmitter = null; this.player = playerInventory.player; } @@ -53,6 +56,7 @@ public WirelessTransmitterContainerMenu(final int syncId, wirelessTransmitter::setRedstoneMode )); this.range = wirelessTransmitter.getRange(); + this.active = wirelessTransmitter.isActive(); this.wirelessTransmitter = wirelessTransmitter; this.player = playerInventory.player; } @@ -72,10 +76,12 @@ public void broadcastChanges() { return; } final int newRange = wirelessTransmitter.getRange(); - final boolean changed = range != newRange; + final boolean newActive = wirelessTransmitter.isActive(); + final boolean changed = range != newRange || active != newActive; if (changed && rangeRateLimiter.tryAcquire()) { this.range = newRange; - S2CPackets.sendWirelessTransmitterRange((ServerPlayer) player, range); + this.active = newActive; + S2CPackets.sendWirelessTransmitterData((ServerPlayer) player, range, active); } } @@ -83,7 +89,15 @@ int getRange() { return range; } + boolean isActive() { + return active; + } + public void setRange(final int range) { this.range = range; } + + public void setActive(final boolean active) { + this.active = active; + } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterData.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterData.java similarity index 67% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterData.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterData.java index a0e60942b..374d274a5 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterData.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterData.java @@ -1,13 +1,14 @@ -package com.refinedmods.refinedstorage.common.wirelesstransmitter; +package com.refinedmods.refinedstorage.common.networking; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.ByteBufCodecs; import net.minecraft.network.codec.StreamCodec; -public record WirelessTransmitterData(int range) { +public record WirelessTransmitterData(int range, boolean active) { public static final StreamCodec STREAM_CODEC = StreamCodec.composite( ByteBufCodecs.INT, WirelessTransmitterData::range, + ByteBufCodecs.BOOL, WirelessTransmitterData::active, WirelessTransmitterData::new ); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterNetworkNodeContainer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterNetworkNodeContainer.java similarity index 96% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterNetworkNodeContainer.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterNetworkNodeContainer.java index 4e211ab69..5d2ab78d7 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterNetworkNodeContainer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterNetworkNodeContainer.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.wirelesstransmitter; +package com.refinedmods.refinedstorage.common.networking; import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.common.api.support.network.item.NetworkItemPlayerValidator; diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterScreen.java similarity index 67% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterScreen.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterScreen.java index 85ba735f4..a65823bfd 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/WirelessTransmitterScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterScreen.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.common.wirelesstransmitter; +package com.refinedmods.refinedstorage.common.networking; import com.refinedmods.refinedstorage.common.support.AbstractBaseScreen; import com.refinedmods.refinedstorage.common.support.containermenu.PropertyTypes; @@ -6,6 +6,7 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; @@ -13,8 +14,11 @@ import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; public class WirelessTransmitterScreen extends AbstractBaseScreen { + private static final MutableComponent INACTIVE = createTranslation("gui", "wireless_transmitter.inactive"); private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/wireless_transmitter.png"); + private final TransmittingIcon icon; + public WirelessTransmitterScreen(final WirelessTransmitterContainerMenu containerMenu, final Inventory inventory, final Component title) { @@ -22,6 +26,7 @@ public WirelessTransmitterScreen(final WirelessTransmitterContainerMenu containe this.inventoryLabelY = 43; this.imageWidth = 211; this.imageHeight = 137; + this.icon = new TransmittingIcon(getMenu().isActive()); } @Override @@ -30,18 +35,35 @@ protected void init() { addSideButton(new RedstoneModeSideButtonWidget(getMenu().getProperty(PropertyTypes.REDSTONE_MODE))); } + @Override + protected void containerTick() { + super.containerTick(); + icon.tick(getMenu().isActive()); + } + @Override protected ResourceLocation getTexture() { return TEXTURE; } + @Override + protected void renderBg(final GuiGraphics graphics, final float delta, final int mouseX, final int mouseY) { + super.renderBg(graphics, delta, mouseX, mouseY); + + icon.render(graphics, leftPos + 7, topPos + 22); + } + @Override protected void renderLabels(final GuiGraphics graphics, final int mouseX, final int mouseY) { super.renderLabels(graphics, mouseX, mouseY); + if (!getMenu().isActive()) { + graphics.drawString(font, INACTIVE, 7 + icon.getWidth() + 4, 25, 4210752, false); + return; + } graphics.drawString( font, createTranslation("gui", "wireless_transmitter.distance", getMenu().getRange()), - 28, + 7 + icon.getWidth() + 4, 25, 4210752, false diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/NetworkTransmitterStatusPacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/NetworkTransmitterStatusPacket.java index e38accfb6..7a6a65925 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/NetworkTransmitterStatusPacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/NetworkTransmitterStatusPacket.java @@ -14,13 +14,15 @@ import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; -public record NetworkTransmitterStatusPacket(boolean error, Component message) implements CustomPacketPayload { +public record NetworkTransmitterStatusPacket(boolean error, boolean transmitting, Component message) + implements CustomPacketPayload { public static final Type PACKET_TYPE = new Type<>( createIdentifier("network_transmitter_status") ); public static final StreamCodec STREAM_CODEC = StreamCodec.composite( ByteBufCodecs.BOOL, NetworkTransmitterStatusPacket::error, + ByteBufCodecs.BOOL, NetworkTransmitterStatusPacket::transmitting, ComponentSerialization.STREAM_CODEC, NetworkTransmitterStatusPacket::message, NetworkTransmitterStatusPacket::new ); @@ -28,7 +30,7 @@ public record NetworkTransmitterStatusPacket(boolean error, Component message) i public static void handle(final NetworkTransmitterStatusPacket packet, final PacketContext ctx) { final AbstractContainerMenu menu = ctx.getPlayer().containerMenu; if (menu instanceof NetworkTransmitterContainerMenu containerMenu) { - containerMenu.setStatus(new NetworkTransmitterData(packet.error, packet.message)); + containerMenu.setStatus(new NetworkTransmitterData(packet.error, packet.transmitting, packet.message)); } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/S2CPackets.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/S2CPackets.java index c293ca956..1059b66c2 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/S2CPackets.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/S2CPackets.java @@ -24,8 +24,8 @@ public static void sendEnergyInfo(final ServerPlayer player, final long stored, Platform.INSTANCE.sendPacketToClient(player, new EnergyInfoPacket(stored, capacity)); } - public static void sendWirelessTransmitterRange(final ServerPlayer player, final int range) { - Platform.INSTANCE.sendPacketToClient(player, new WirelessTransmitterRangePacket(range)); + public static void sendWirelessTransmitterData(final ServerPlayer player, final int range, final boolean active) { + Platform.INSTANCE.sendPacketToClient(player, new WirelessTransmitterDataPacket(range, active)); } public static void sendGridActiveness(final ServerPlayer player, final boolean active) { @@ -68,7 +68,7 @@ public static void sendStorageInfoResponse(final ServerPlayer player, public static void sendNetworkTransmitterStatus(final ServerPlayer player, final NetworkTransmitterData status) { Platform.INSTANCE.sendPacketToClient( player, - new NetworkTransmitterStatusPacket(status.error(), status.message()) + new NetworkTransmitterStatusPacket(status.error(), status.transmitting(), status.message()) ); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/WirelessTransmitterRangePacket.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/WirelessTransmitterDataPacket.java similarity index 54% rename from refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/WirelessTransmitterRangePacket.java rename to refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/WirelessTransmitterDataPacket.java index 993a67aa9..a02cd501d 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/WirelessTransmitterRangePacket.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/packet/s2c/WirelessTransmitterDataPacket.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage.common.support.packet.s2c; +import com.refinedmods.refinedstorage.common.networking.WirelessTransmitterContainerMenu; import com.refinedmods.refinedstorage.common.support.packet.PacketContext; -import com.refinedmods.refinedstorage.common.wirelesstransmitter.WirelessTransmitterContainerMenu; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.ByteBufCodecs; @@ -10,20 +10,22 @@ import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createIdentifier; -public record WirelessTransmitterRangePacket(int range) implements CustomPacketPayload { - public static final Type PACKET_TYPE = new Type<>( - createIdentifier("wireless_transmitter_range") +public record WirelessTransmitterDataPacket(int range, boolean active) implements CustomPacketPayload { + public static final Type PACKET_TYPE = new Type<>( + createIdentifier("wireless_transmitter_data") ); - public static final StreamCodec STREAM_CODEC = + public static final StreamCodec STREAM_CODEC = StreamCodec.composite( - ByteBufCodecs.INT, WirelessTransmitterRangePacket::range, - WirelessTransmitterRangePacket::new + ByteBufCodecs.INT, WirelessTransmitterDataPacket::range, + ByteBufCodecs.BOOL, WirelessTransmitterDataPacket::active, + WirelessTransmitterDataPacket::new ); - public static void handle(final WirelessTransmitterRangePacket packet, final PacketContext ctx) { + public static void handle(final WirelessTransmitterDataPacket packet, final PacketContext ctx) { if (ctx.getPlayer().containerMenu instanceof WirelessTransmitterContainerMenu containerMenu) { containerMenu.setRange(packet.range); + containerMenu.setActive(packet.active); } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/package-info.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/package-info.java deleted file mode 100644 index dff267fde..000000000 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/wirelesstransmitter/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage.common.wirelesstransmitter; - -import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json index 0b27c5da6..155d1e882 100644 --- a/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json +++ b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json @@ -98,6 +98,7 @@ "gui.refinedstorage.importer.filter_mode.allow.help": "Only allow resources into the storage network that are configured in the filters.", "gui.refinedstorage.importer.filter_mode.block.help": "Disallow resources into the storage network that are configured in the filters.", "gui.refinedstorage.wireless_transmitter.distance": "%d block(s)", + "gui.refinedstorage.wireless_transmitter.inactive": "Inactive", "gui.refinedstorage.storage_monitor.filter_help": "The resource to display.", "gui.refinedstorage.redstone_mode": "Redstone mode", "gui.refinedstorage.redstone_mode.ignore": "Ignore", diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/network_transmitter.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/network_transmitter.png index 1d25ea190e1bc3c3a884f280e3b46999cbe8d012..f1cb4e781ea76f35e921cd0cddb785b8d3ac77d4 100644 GIT binary patch literal 787 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K58911MRQ8&P5D>38$lZxy-8q?;Kn_c~qpu?a z!^VE@KZ&eBzG#3?h%1o(|NsB7W5+^6L(R?2ySuxABB`6FO9LtPk|4iepeztDNO?26 z0fjgVJR*x382I*pFyqucMV<@{OeLN!jv*CsZ*N`nI_x0gdhyDvKmXOUFXg(u^49#G z)VA6DP-A7s<3$QBdbhWoxg2(XlkWD)EP;r$U%&I^zcR5OIIeT|{Zl4u2LJgAj4T2T z)zeiQ7??N?TvqpBU}Sl4FO^fFfr0(N^WxVZrS-$q5B$2KYA?>jp}_E6&l{*fAfbK> z!=Jn9OfvgFCV`aR*{#FKQo*pMe|^HAS3i2iR|_Weu?RRYyo;R%G*$uAniYZ#`p0_0 z%D$Xezssg5vY2LD@;kK2Fl6^7aX_b|u?jtk$_mcLpe33Kr^ zeunpP?!E8JZ(j5UI_}SQ%j`ex-|lsSJOU1+y{Cmh&IG&lMfL3H(n~xB?o1pLcnk6w zBfdTN3${J*o&Ws2g-e+e{)?Qs^!U=ES4z)+>iz|hdl!0_`w zkbcR)P-?)y@G60U!Dy(Fq9&nVFdk*Um6Jxz6zBF~g^q3_sp8{Qt@D|1ZP;|J~i) z$BrHQ{~u`EC>RZap%em_jxLe`WulTGzhGbj9?5_q_&YnW++g4=@Q5sCVBp&e!i?^} zC#(euN|d-plmzFem6RtIr7{#GX6BXX<)xM=nCKbm876DZ@n&FP+Un`z7*Y}U_SWsJ z+YS=0iCca7S615{`S{y@g_fmum`8rk%=s5LTwhdjI7Z`B`>lo#Cg(3(oP9g{*-H~Y zR;J4y^Z$Rj5%+-SgN0YSb8(|+!)pEs3``scYR$bF7+C~RxfaZOD(`;$BU~P)df;Q| z?ixK7fd$$Q|No0s*)!f{-Nm$K{=V%F<_+!bPuD-ae4O!4ZO#9u|6Xt3Z(py=)X9+l z{$A~`4?q8X|1Q6f;rw6Ezv>@0eLd{Xtn>BXpS_H`>i@m-clZu8k>|mWFQPr-bL$_S z(_)cO2D##Q-ZY@26d1zg6;QbgoEY{=Y%WdNZZ$uI`GeMnOPTrVK!pup)!*;x098AH z{Nd2>f4|b^?UR!j?(NPI-FG{2`#P(YY!5tlhx{;b!1@J z*w6hZkrl}2EbxddW?4EB2cb zbRo*wi__38z-wZ$8wX>{gxy~{x0YqEy)S)$`Qsb?ZGWd6n+~*+!PC{xWt~$(698f6 BM=$^Y literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/transmitting/1.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/transmitting/1.png new file mode 100644 index 0000000000000000000000000000000000000000..04448e774e4f6de76bbe3fa437e08c47facbf26f GIT binary patch literal 227 zcmeAS@N?(olHy`uVBq!ia0vp^d_c^`!3HEhORwJpq!^2X+?^QKos)S9a~60+76UaM24TkI`72U@f)$=Fjv*SsQ~P#vF&PTD`nyb9;x*O()b*vJ ze;vCuG6YYo=1_jUY=b}vf6R`fwud)N7ic>3i&?Ppd2^^;)qB@$-}kc5WtNJp*(#B| zV~+oa9fvmMuuloP{PaRp@>z-IImTPVg1nAMEL7idU%~cy4gaP6`>bC7&k@?gaKqM~ Uh4rIHG|&wUp00i_>zopr0EB5#IsgCw literal 0 HcmV?d00001 diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/transmitting/2.png b/refinedstorage-common/src/main/resources/assets/refinedstorage/textures/gui/sprites/transmitting/2.png new file mode 100644 index 0000000000000000000000000000000000000000..822413dfc601c2af298b3fda73df757ded9aa06f GIT binary patch literal 243 zcmeAS@N?(olHy`uVBq!ia0vp^fNn{1`ISV`@iy0XB4ude`@%$AjK*0`A7sn8d;I;i5xeghKxca+zS*M;-fBJe? z*S`hMA|)J4Jlj4kF>`*C)G4>4puL>mCQ9;npx58tw2Ngs{8g0Rhg>Nn{1`ISV`@iy0XB4ude`@%$AjK*1HBE{-7<{%0rpavd@dXpQf>QZ_ZT?~3wM zk(*s{7hFY31T*Ty5>>1gutkMz`q12HKB4l=o&~JOB$9qwZ$0^c#=4mzcQ?khb-X*8 zvG(XKwb_}oG9=iROj$6c>APHzSI^^)!*%R2eGd2Sds+o-wtI*tyR4jJ{H)TAgYleY zM0VqohR>V@;dS?zyzU)_nQo3Zdl*Y)7j0VgNk-gaev@b~zOSJphsWV^#~!X|CX U+2pFWincaXwoCO|{#S9F5he4R} zc>anM1_oxw%#etZ2wxwom(KO)W_T@+K!T z3)esRca8&SH>;s7ZguIPgqu$5)Rwd%tTl z{Ik7iwYh%n|C*(9iqshLH+}z<6MjmQ6{PG%)w7NMEze|Yu1qaDb$)(B^8P9%llKo6 zubUEF$M(Rw`spH&q3>5)gWd7z+TuRT_g?oh@yRge#W!P9LkD0TB6+*Bj!2LD_4j_`j@4hMP-7;Zq~oUIO+20N?L zzsN0iCeH>ppl*iea@VXG&c{Uy&wsyZ?KObDoF8S}@`girGwtV~iZ7%ukayMJH z$7nO&xWST;EZorR%V1_k45yw*b+l5Zj_Oq2w?#j>oAhoPe!aOT6_`&MJYD@<);T3K F0RZ&Tl@R~{ delta 1430 zcmey!`%z$mq#+vv14B&FiZmc4S>hT|5}cn_Ql40p%HWuipOmWLnVXoN8kCxtQdxL1 z)rNtAS#4ssKcm9LJGqm67@amxW{hW?{FAA>Uf)i^M!zT}&B`UUIJqdZpd>Rt4<;1k z;s# zV~^6`H#dHqJZsgeYkLosZ?ns>(7i6TGR9zo>kRZaU3{$^yq^$KgHbV&!4~5HB(AsscJ}5>}06D z!`+eSwt#)lr}b_O5*Z9`@9%9jm$v2kAn@SJ7n3({>)*EC%n{?`=Rf@QYpI2W1;_8- zzaL&c&ae3AkJzDidD4xiM9vtjVYqYW&X)N6{QSdLuZC9d|5@rWefo68Gj**W9#?a$ zk8k_%s#lfMnft)an>X$Mzxz9V{paw1+dtdCt@_%o$d)iU>(|eFwdwy9b)##=6Dl8z zGoR35Fsl<_khXtPFN5sE1~~&|fk*@82@DeqjhQ$ZzA-J@cfZG>fq{XEfrCMT0hRIP z$gOO~Q=5AJF`j+CK3V^ef#1EyGg7|IWZF={lw=|vV4~er*z@^D;j+5VQ=Ea;H0bd& zCUBhLP+>?p)8oL@u(x5w`+9R_0d#XgHaYBH^H<};HoXM~eT5zd47YbR9I`mpDS5od z;k-!0QDK3@J?6(cWr5stj6k=QRB#e2fX&#~yFAWq7f8k%m)f zX!A{vw~PnsbN-*rHIXX)bXaY2Cr~b#&Oha}YB7lx&?MAaPm{w}y;Z^iohjl8^B{0Sdf zju<@dElfIIC_29wEwoU=Pk}*8rUu2^v5X&-wqwwb2f173BdL96W zikM!?j(YYBb6hmt7EfI2X!OpHK`8SpPgd^42`_g2UK3O+zQE&aBQv(B=V0JySc)}K zpm-BCyQR&v;{XCidSFS{*xU)V_s;j|21bVKbC16`UAruo0SG)@{an^L HB{Ts5YGUJs diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ClientModInitializerImpl.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ClientModInitializerImpl.java index 976d51f7a..9dbd105d8 100644 --- a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ClientModInitializerImpl.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ClientModInitializerImpl.java @@ -29,7 +29,7 @@ import com.refinedmods.refinedstorage.common.support.packet.s2c.PatternGridAllowedAlternativesUpdatePacket; import com.refinedmods.refinedstorage.common.support.packet.s2c.ResourceSlotUpdatePacket; import com.refinedmods.refinedstorage.common.support.packet.s2c.StorageInfoResponsePacket; -import com.refinedmods.refinedstorage.common.support.packet.s2c.WirelessTransmitterRangePacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.WirelessTransmitterDataPacket; import com.refinedmods.refinedstorage.common.support.tooltip.CompositeClientTooltipComponent; import com.refinedmods.refinedstorage.common.support.tooltip.HelpClientTooltipComponent; import com.refinedmods.refinedstorage.common.support.tooltip.ResourceClientTooltipComponent; @@ -255,8 +255,8 @@ private void registerPacketHandlers() { wrapHandler(EnergyInfoPacket::handle) ); ClientPlayNetworking.registerGlobalReceiver( - WirelessTransmitterRangePacket.PACKET_TYPE, - wrapHandler(WirelessTransmitterRangePacket::handle) + WirelessTransmitterDataPacket.PACKET_TYPE, + wrapHandler(WirelessTransmitterDataPacket::handle) ); ClientPlayNetworking.registerGlobalReceiver( ResourceSlotUpdatePacket.PACKET_TYPE, diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ModInitializerImpl.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ModInitializerImpl.java index 49a6866f2..d0608612f 100644 --- a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ModInitializerImpl.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/ModInitializerImpl.java @@ -59,7 +59,7 @@ import com.refinedmods.refinedstorage.common.support.packet.s2c.PatternGridAllowedAlternativesUpdatePacket; import com.refinedmods.refinedstorage.common.support.packet.s2c.ResourceSlotUpdatePacket; import com.refinedmods.refinedstorage.common.support.packet.s2c.StorageInfoResponsePacket; -import com.refinedmods.refinedstorage.common.support.packet.s2c.WirelessTransmitterRangePacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.WirelessTransmitterDataPacket; import com.refinedmods.refinedstorage.common.support.resource.FluidResource; import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import com.refinedmods.refinedstorage.common.upgrade.RegulatorUpgradeItem; @@ -400,8 +400,8 @@ private void registerPackets() { private void registerServerToClientPackets() { PayloadTypeRegistry.playS2C().register(EnergyInfoPacket.PACKET_TYPE, EnergyInfoPacket.STREAM_CODEC); PayloadTypeRegistry.playS2C().register( - WirelessTransmitterRangePacket.PACKET_TYPE, - WirelessTransmitterRangePacket.STREAM_CODEC + WirelessTransmitterDataPacket.PACKET_TYPE, + WirelessTransmitterDataPacket.STREAM_CODEC ); PayloadTypeRegistry.playS2C().register(GridActivePacket.PACKET_TYPE, GridActivePacket.STREAM_CODEC); PayloadTypeRegistry.playS2C().register(GridClearPacket.PACKET_TYPE, GridClearPacket.STREAM_CODEC); diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ModInitializer.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ModInitializer.java index 176b5a7d0..78cd28929 100644 --- a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ModInitializer.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/ModInitializer.java @@ -59,7 +59,7 @@ import com.refinedmods.refinedstorage.common.support.packet.s2c.PatternGridAllowedAlternativesUpdatePacket; import com.refinedmods.refinedstorage.common.support.packet.s2c.ResourceSlotUpdatePacket; import com.refinedmods.refinedstorage.common.support.packet.s2c.StorageInfoResponsePacket; -import com.refinedmods.refinedstorage.common.support.packet.s2c.WirelessTransmitterRangePacket; +import com.refinedmods.refinedstorage.common.support.packet.s2c.WirelessTransmitterDataPacket; import com.refinedmods.refinedstorage.common.upgrade.RegulatorUpgradeItem; import com.refinedmods.refinedstorage.common.util.IdentifierUtil; import com.refinedmods.refinedstorage.common.util.ServerEventQueue; @@ -597,9 +597,9 @@ private static void registerServerToClientPackets(final PayloadRegistrar registr wrapHandler((packet, ctx) -> StorageInfoResponsePacket.handle(packet)) ); registrar.playToClient( - WirelessTransmitterRangePacket.PACKET_TYPE, - WirelessTransmitterRangePacket.STREAM_CODEC, - wrapHandler(WirelessTransmitterRangePacket::handle) + WirelessTransmitterDataPacket.PACKET_TYPE, + WirelessTransmitterDataPacket.STREAM_CODEC, + wrapHandler(WirelessTransmitterDataPacket::handle) ); registrar.playToClient( NoPermissionPacket.PACKET_TYPE, diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/ItemModelProviderImpl.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/ItemModelProviderImpl.java index 3eb2074d0..72ae46e81 100644 --- a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/ItemModelProviderImpl.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/ItemModelProviderImpl.java @@ -9,8 +9,8 @@ import com.refinedmods.refinedstorage.common.networking.CableBlock; import com.refinedmods.refinedstorage.common.networking.NetworkReceiverBlock; import com.refinedmods.refinedstorage.common.networking.NetworkTransmitterBlock; +import com.refinedmods.refinedstorage.common.networking.WirelessTransmitterBlock; import com.refinedmods.refinedstorage.common.storage.externalstorage.ExternalStorageBlock; -import com.refinedmods.refinedstorage.common.wirelesstransmitter.WirelessTransmitterBlock; import net.minecraft.data.PackOutput; import net.minecraft.resources.ResourceLocation; From 6e76079a4442925c71ddbaf4027f70d190b74e6e Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sat, 10 Aug 2024 18:52:46 +0200 Subject: [PATCH 17/20] feat: upgrading storage disks and storage blocks --- CHANGELOG.md | 4 + .../AbstractStorageContainerBlockItem.java | 18 ++- .../storage/AbstractStorageContainerItem.java | 11 +- .../storage/StorageContainerItemHelper.java | 16 ++- .../common/api/storage/StorageRepository.java | 7 ++ .../common/AbstractModInitializer.java | 44 +++++++ .../common/content/DataComponents.java | 10 ++ .../storage/ClientStorageRepository.java | 5 + .../common/storage/FluidStorageVariant.java | 21 +++- .../common/storage/ItemStorageVariant.java | 22 +++- .../StorageContainerItemHelperImpl.java | 89 +++++++++++--- .../StorageContainerUpgradeRecipe.java | 112 ++++++++++++++++++ ...orageContainerUpgradeRecipeSerializer.java | 44 +++++++ .../common/storage/StorageRepositoryImpl.java | 9 +- .../common/storage/StorageVariant.java | 13 ++ .../storage/UpgradeableStorageContainer.java | 9 ++ .../FluidStorageBlockBlockEntity.java | 3 +- .../FluidStorageBlockBlockItem.java | 32 ++++- .../ItemStorageBlockBlockEntity.java | 3 +- .../ItemStorageBlockBlockItem.java | 32 ++++- .../storagedisk/FluidStorageDiskItem.java | 19 ++- .../storagedisk/ItemStorageDiskItem.java | 19 ++- .../assets/refinedstorage/lang/en_us.json | 4 +- .../1024b_fluid_storage_block_upgrade.json | 4 + .../1024b_fluid_storage_disk_upgrade.json | 4 + .../recipe/16k_storage_block_upgrade.json | 4 + .../recipe/16k_storage_disk_upgrade.json | 4 + .../256b_fluid_storage_block_upgrade.json | 4 + .../256b_fluid_storage_disk_upgrade.json | 4 + .../4096b_fluid_storage_block_upgrade.json | 4 + .../4096b_fluid_storage_disk_upgrade.json | 4 + .../recipe/4k_storage_block_upgrade.json | 4 + .../recipe/4k_storage_disk_upgrade.json | 4 + .../recipe/64k_storage_block_upgrade.json | 4 + .../recipe/64k_storage_disk_upgrade.json | 4 + 35 files changed, 543 insertions(+), 51 deletions(-) create mode 100644 refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageContainerUpgradeRecipe.java create mode 100644 refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageContainerUpgradeRecipeSerializer.java create mode 100644 refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageVariant.java create mode 100644 refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/UpgradeableStorageContainer.java create mode 100644 refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_block_upgrade.json create mode 100644 refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_disk_upgrade.json create mode 100644 refinedstorage-common/src/main/resources/data/refinedstorage/recipe/16k_storage_block_upgrade.json create mode 100644 refinedstorage-common/src/main/resources/data/refinedstorage/recipe/16k_storage_disk_upgrade.json create mode 100644 refinedstorage-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_block_upgrade.json create mode 100644 refinedstorage-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_disk_upgrade.json create mode 100644 refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_block_upgrade.json create mode 100644 refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_disk_upgrade.json create mode 100644 refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4k_storage_block_upgrade.json create mode 100644 refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4k_storage_disk_upgrade.json create mode 100644 refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64k_storage_block_upgrade.json create mode 100644 refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64k_storage_disk_upgrade.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 0972b19ff..48a4de402 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added + +- You can now upgrade Storage Disks and Storage Blocks to a higher tier by combining with a higher tier Storage Part. The original Storage Part will be returned. + ### Changed - Updated to Minecraft 1.21.1. diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/AbstractStorageContainerBlockItem.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/AbstractStorageContainerBlockItem.java index b913b0651..a2307429f 100644 --- a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/AbstractStorageContainerBlockItem.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/AbstractStorageContainerBlockItem.java @@ -9,6 +9,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResultHolder; +import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.ItemStack; @@ -35,6 +36,16 @@ protected AbstractStorageContainerBlockItem( this.helper = helper; } + @Override + public void inventoryTick(final ItemStack stack, + final Level level, + final Entity entity, + final int slotId, + final boolean isSelected) { + super.inventoryTick(stack, level, entity, slotId, isSelected); + helper.transferStorageIfNecessary(stack, level, entity, this::createStorage); + } + @Override public InteractionResultHolder use(final Level level, final Player player, final InteractionHand hand) { final ItemStack stack = player.getItemInHand(hand); @@ -76,13 +87,16 @@ public void appendHoverText(final ItemStack stack, final TooltipFlag flag) { super.appendHoverText(stack, context, tooltip, flag); final StorageRepository storageRepository = RefinedStorageApi.INSTANCE.getClientStorageRepository(); - helper.appendToTooltip(stack, storageRepository, tooltip, flag, this::formatAmount, hasCapacity()); + helper.appendToTooltip(stack, storageRepository, tooltip, flag, this::formatAmount, getCapacity()); } - protected abstract boolean hasCapacity(); + @Nullable + protected abstract Long getCapacity(); protected abstract String formatAmount(long amount); + protected abstract SerializableStorage createStorage(StorageRepository storageRepository); + protected abstract ItemStack createPrimaryDisassemblyByproduct(int count); @Nullable diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/AbstractStorageContainerItem.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/AbstractStorageContainerItem.java index e1a45b760..efbd55d78 100644 --- a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/AbstractStorageContainerItem.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/AbstractStorageContainerItem.java @@ -51,10 +51,8 @@ public void inventoryTick(final ItemStack stack, final int slot, final boolean selected) { super.inventoryTick(stack, level, entity, slot, selected); - if (!level.isClientSide() && !helper.hasStorage(stack) && entity instanceof Player) { - final StorageRepository storageRepository = RefinedStorageApi.INSTANCE.getStorageRepository(level); - helper.setStorage(storageRepository, stack, createStorage(storageRepository)); - } + helper.transferStorageIfNecessary(stack, level, entity, this::createStorage); + helper.loadStorageIfNecessary(stack, level, entity, this::createStorage); } @Override @@ -64,10 +62,11 @@ public void appendHoverText(final ItemStack stack, final TooltipFlag flag) { super.appendHoverText(stack, context, tooltip, flag); final StorageRepository storageRepository = RefinedStorageApi.INSTANCE.getClientStorageRepository(); - helper.appendToTooltip(stack, storageRepository, tooltip, flag, this::formatAmount, hasCapacity()); + helper.appendToTooltip(stack, storageRepository, tooltip, flag, this::formatAmount, getCapacity()); } - protected abstract boolean hasCapacity(); + @Nullable + protected abstract Long getCapacity(); protected abstract String formatAmount(long amount); diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageContainerItemHelper.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageContainerItemHelper.java index 0ac5f8798..ff50d513d 100644 --- a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageContainerItemHelper.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageContainerItemHelper.java @@ -4,12 +4,14 @@ import java.util.Map; import java.util.Optional; import java.util.Set; +import java.util.function.Function; import java.util.function.LongFunction; import javax.annotation.Nullable; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.InteractionResultHolder; +import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; @@ -21,9 +23,15 @@ public interface StorageContainerItemHelper { Optional resolveStorage(StorageRepository storageRepository, ItemStack stack); - void setStorage(StorageRepository storageRepository, ItemStack stack, SerializableStorage storage); + void loadStorageIfNecessary(ItemStack stack, + Level level, + Entity entity, + Function factory); - boolean hasStorage(ItemStack stack); + void transferStorageIfNecessary(ItemStack stack, + Level level, + Entity entity, + Function factory); Optional getInfo(StorageRepository storageRepository, ItemStack stack); @@ -38,7 +46,7 @@ void appendToTooltip(ItemStack stack, List tooltip, TooltipFlag context, LongFunction amountFormatter, - boolean hasCapacity); + @Nullable Long capacity); void transferToBlockEntity(ItemStack stack, StorageBlockEntity blockEntity); @@ -49,4 +57,6 @@ void appendToTooltip(ItemStack stack, Set getDiskModels(); Map getDiskModelsByItem(); + + void markAsToTransfer(ItemStack from, ItemStack to); } diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageRepository.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageRepository.java index e66e6823a..0b4c6b218 100644 --- a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageRepository.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/storage/StorageRepository.java @@ -31,6 +31,13 @@ public interface StorageRepository { */ Optional removeIfEmpty(UUID id); + /** + * Removes a storage by ID. + * + * @param id the id + */ + void remove(UUID id); + /** * Retrieves info for a given storage ID. * diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractModInitializer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractModInitializer.java index 2e4819340..c548d7ce8 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractModInitializer.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/AbstractModInitializer.java @@ -95,6 +95,8 @@ import com.refinedmods.refinedstorage.common.security.SecurityManagerContainerMenu; import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; +import com.refinedmods.refinedstorage.common.storage.StorageContainerUpgradeRecipe; +import com.refinedmods.refinedstorage.common.storage.StorageContainerUpgradeRecipeSerializer; import com.refinedmods.refinedstorage.common.storage.StorageTypes; import com.refinedmods.refinedstorage.common.storage.diskdrive.AbstractDiskDriveBlockEntity; import com.refinedmods.refinedstorage.common.storage.diskdrive.DiskDriveBlock; @@ -815,6 +817,42 @@ protected final void registerRecipeSerializers(final RegistryCallback new StorageContainerUpgradeRecipeSerializer<>( + ItemStorageVariant.values(), + to -> new StorageContainerUpgradeRecipe<>( + ItemStorageVariant.values(), to, Items.INSTANCE::getItemStorageDisk + ) + ) + ); + callback.register( + createIdentifier("fluid_storage_disk_upgrade"), + () -> new StorageContainerUpgradeRecipeSerializer<>( + FluidStorageVariant.values(), + to -> new StorageContainerUpgradeRecipe<>( + FluidStorageVariant.values(), to, Items.INSTANCE::getFluidStorageDisk + ) + ) + ); + callback.register( + createIdentifier("storage_block_upgrade"), + () -> new StorageContainerUpgradeRecipeSerializer<>( + ItemStorageVariant.values(), + to -> new StorageContainerUpgradeRecipe<>( + ItemStorageVariant.values(), to, Blocks.INSTANCE::getItemStorageBlock + ) + ) + ); + callback.register( + createIdentifier("fluid_storage_block_upgrade"), + () -> new StorageContainerUpgradeRecipeSerializer<>( + FluidStorageVariant.values(), + to -> new StorageContainerUpgradeRecipe<>( + FluidStorageVariant.values(), to, Blocks.INSTANCE::getFluidStorageBlock + ) + ) + ); } protected final void registerDataComponents(final RegistryCallback> callback) { @@ -833,6 +871,12 @@ protected final void registerDataComponents(final RegistryCallback DataComponentType.builder() + .persistent(UUIDUtil.CODEC) + .networkSynchronized(UUIDUtil.STREAM_CODEC) + .build())); DataComponents.INSTANCE.setRegulatorUpgradeState( callback.register(createIdentifier("regulator_upgrade_state"), () -> DataComponentType.builder() diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/DataComponents.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/DataComponents.java index ca50bba6f..09bf3c6d3 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/DataComponents.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/content/DataComponents.java @@ -29,6 +29,8 @@ public final class DataComponents { @Nullable private Supplier> storageReference; @Nullable + private Supplier> storageReferenceToBeTransferred; + @Nullable private Supplier> regulatorUpgradeState; @Nullable private Supplier> securityCardBoundPlayer; @@ -74,6 +76,14 @@ public void setStorageReference(@Nullable final Supplier this.storageReference = supplier; } + public DataComponentType getStorageReferenceToBeTransferred() { + return requireNonNull(storageReferenceToBeTransferred).get(); + } + + public void setStorageReferenceToBeTransferred(@Nullable final Supplier> supplier) { + this.storageReferenceToBeTransferred = supplier; + } + public DataComponentType getRegulatorUpgradeState() { return requireNonNull(regulatorUpgradeState).get(); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/ClientStorageRepository.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/ClientStorageRepository.java index 5eaf0826d..1ee18a51c 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/ClientStorageRepository.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/ClientStorageRepository.java @@ -44,6 +44,11 @@ public Optional removeIfEmpty(final UUID id) { throw new UnsupportedOperationException(); } + @Override + public void remove(final UUID id) { + throw new UnsupportedOperationException(); + } + public void setInfo(final UUID id, final long stored, final long capacity) { info.put(id, new StorageInfo(stored, capacity)); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/FluidStorageVariant.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/FluidStorageVariant.java index 91b7698b0..55a292f27 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/FluidStorageVariant.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/FluidStorageVariant.java @@ -1,10 +1,14 @@ package com.refinedmods.refinedstorage.common.storage; import com.refinedmods.refinedstorage.common.Platform; +import com.refinedmods.refinedstorage.common.content.Items; import javax.annotation.Nullable; -public enum FluidStorageVariant { +import net.minecraft.util.StringRepresentable; +import net.minecraft.world.item.Item; + +public enum FluidStorageVariant implements StringRepresentable, StorageVariant { SIXTY_FOUR_B("64b", 64L), TWO_HUNDRED_FIFTY_SIX_B("256b", 256L), THOUSAND_TWENTY_FOUR_B("1024b", 1024L), @@ -29,6 +33,7 @@ public Long getCapacityInBuckets() { return capacityInBuckets; } + @Override @Nullable public Long getCapacity() { if (capacityInBuckets == null) { @@ -37,7 +42,17 @@ public Long getCapacity() { return capacityInBuckets * Platform.INSTANCE.getBucketAmount(); } - public boolean hasCapacity() { - return capacityInBuckets != null; + @Nullable + @Override + public Item getStoragePart() { + if (this == CREATIVE) { + return null; + } + return Items.INSTANCE.getFluidStoragePart(this); + } + + @Override + public String getSerializedName() { + return name; } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/ItemStorageVariant.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/ItemStorageVariant.java index ae0d5a8b1..6bacf5b65 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/ItemStorageVariant.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/ItemStorageVariant.java @@ -1,8 +1,13 @@ package com.refinedmods.refinedstorage.common.storage; +import com.refinedmods.refinedstorage.common.content.Items; + import javax.annotation.Nullable; -public enum ItemStorageVariant { +import net.minecraft.util.StringRepresentable; +import net.minecraft.world.item.Item; + +public enum ItemStorageVariant implements StringRepresentable, StorageVariant { ONE_K("1k", 1024L), FOUR_K("4k", 1024 * 4L), SIXTEEN_K("16k", 1024 * 4 * 4L), @@ -22,12 +27,23 @@ public String getName() { return name; } + @Override @Nullable public Long getCapacity() { return capacity; } - public boolean hasCapacity() { - return capacity != null; + @Nullable + @Override + public Item getStoragePart() { + if (this == CREATIVE) { + return null; + } + return Items.INSTANCE.getItemStoragePart(this); + } + + @Override + public String getSerializedName() { + return name; } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageContainerItemHelperImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageContainerItemHelperImpl.java index 891288483..85d8f9fc3 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageContainerItemHelperImpl.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageContainerItemHelperImpl.java @@ -1,6 +1,8 @@ package com.refinedmods.refinedstorage.common.storage; +import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.storage.PlayerActor; import com.refinedmods.refinedstorage.common.api.storage.SerializableStorage; import com.refinedmods.refinedstorage.common.api.storage.StorageBlockEntity; import com.refinedmods.refinedstorage.common.api.storage.StorageContainerItemHelper; @@ -16,6 +18,7 @@ import java.util.Optional; import java.util.Set; import java.util.UUID; +import java.util.function.Function; import java.util.function.LongFunction; import javax.annotation.Nullable; @@ -25,6 +28,7 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.InteractionResultHolder; +import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; @@ -47,19 +51,63 @@ public Optional resolveStorage(final StorageRepository stor } @Override - public void setStorage(final StorageRepository storageRepository, - final ItemStack stack, - final SerializableStorage storage) { + public void loadStorageIfNecessary(final ItemStack stack, + final Level level, + final Entity entity, + final Function factory) { + if (!level.isClientSide() && !hasStorage(stack) && entity instanceof Player) { + final StorageRepository storageRepository = RefinedStorageApi.INSTANCE.getStorageRepository(level); + setStorage(storageRepository, stack, factory.apply(storageRepository)); + } + } + + @Override + public void transferStorageIfNecessary(final ItemStack stack, + final Level level, + final Entity entity, + final Function factory) { + if (!level.isClientSide() + && !hasStorage(stack) + && hasStorageToBeTransferred(stack) + && entity instanceof Player player) { + getIdToBeTransferred(stack).ifPresent(id -> doTransfer(level, factory, player, id, stack)); + } + } + + private void doTransfer(final Level level, + final Function factory, + final Player player, + final UUID originalId, + final ItemStack stack) { + final StorageRepository storageRepository = RefinedStorageApi.INSTANCE.getStorageRepository(level); + final PlayerActor actor = new PlayerActor(player); + storageRepository.get(originalId).ifPresent(originalStorage -> { + final SerializableStorage transferStorage = factory.apply(storageRepository); + originalStorage.getAll().forEach( + original -> transferStorage.insert(original.resource(), original.amount(), Action.EXECUTE, actor) + ); + setStorage(storageRepository, stack, transferStorage); + storageRepository.remove(originalId); + markAsTransferred(stack); + }); + } + + private void setStorage(final StorageRepository storageRepository, + final ItemStack stack, + final SerializableStorage storage) { final UUID id = UUID.randomUUID(); setId(stack, id); storageRepository.set(id, storage); } - @Override - public boolean hasStorage(final ItemStack stack) { + private boolean hasStorage(final ItemStack stack) { return stack.has(DataComponents.INSTANCE.getStorageReference()); } + private boolean hasStorageToBeTransferred(final ItemStack stack) { + return stack.has(DataComponents.INSTANCE.getStorageReferenceToBeTransferred()); + } + @Override public Optional getInfo(final StorageRepository storageRepository, final ItemStack stack) { return getId(stack).map(storageRepository::getInfo); @@ -108,13 +156,15 @@ public void appendToTooltip(final ItemStack stack, final List tooltip, final TooltipFlag context, final LongFunction amountFormatter, - final boolean hasCapacity) { - getInfo(storageRepository, stack).ifPresent(info -> { - if (hasCapacity) { + @Nullable final Long capacity) { + final boolean transferring = hasStorageToBeTransferred(stack); + getId(stack).or(() -> getIdToBeTransferred(stack)).ifPresent(id -> { + final StorageInfo info = storageRepository.getInfo(id); + if (capacity != null) { StorageTooltipHelper.addAmountStoredWithCapacity( tooltip, info.stored(), - info.capacity(), + transferring ? capacity : info.capacity(), amountFormatter ); } else { @@ -124,13 +174,11 @@ public void appendToTooltip(final ItemStack stack, amountFormatter ); } - }); - if (context.isAdvanced()) { - getId(stack).ifPresent(id -> { + if (context.isAdvanced()) { final MutableComponent idComponent = Component.literal(id.toString()).withStyle(ChatFormatting.GRAY); tooltip.add(idComponent); - }); - } + } + }); } @Override @@ -168,10 +216,23 @@ public Map getDiskModelsByItem() { return Collections.unmodifiableMap(diskModelsByItem); } + @Override + public void markAsToTransfer(final ItemStack from, final ItemStack to) { + getId(from).ifPresent(id -> to.set(DataComponents.INSTANCE.getStorageReferenceToBeTransferred(), id)); + } + private Optional getId(final ItemStack stack) { return Optional.ofNullable(stack.get(DataComponents.INSTANCE.getStorageReference())); } + private Optional getIdToBeTransferred(final ItemStack stack) { + return Optional.ofNullable(stack.get(DataComponents.INSTANCE.getStorageReferenceToBeTransferred())); + } + + private void markAsTransferred(final ItemStack stack) { + stack.remove(DataComponents.INSTANCE.getStorageReferenceToBeTransferred()); + } + private void setId(final ItemStack stack, final UUID id) { stack.set(DataComponents.INSTANCE.getStorageReference(), id); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageContainerUpgradeRecipe.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageContainerUpgradeRecipe.java new file mode 100644 index 000000000..de1c4ab58 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageContainerUpgradeRecipe.java @@ -0,0 +1,112 @@ +package com.refinedmods.refinedstorage.common.storage; + +import java.util.Arrays; +import java.util.Set; +import java.util.function.Function; +import java.util.stream.Collectors; + +import net.minecraft.core.HolderLookup; +import net.minecraft.core.NonNullList; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.CraftingBookCategory; +import net.minecraft.world.item.crafting.CraftingInput; +import net.minecraft.world.item.crafting.Ingredient; +import net.minecraft.world.item.crafting.ShapelessRecipe; +import net.minecraft.world.level.ItemLike; +import net.minecraft.world.level.Level; + +public class StorageContainerUpgradeRecipe extends ShapelessRecipe { + private final Set validSourceContainers; + private final T[] variants; + private final T to; + + public StorageContainerUpgradeRecipe(final T[] variants, + final T to, + final Function containerProvider) { + super( + "", + CraftingBookCategory.MISC, + containerProvider.apply(to).asItem().getDefaultInstance(), + NonNullList.of( + Ingredient.of(getValidSourceContainers(to, variants, containerProvider) + .stream().map(ItemLike::asItem).map(Item::getDefaultInstance)), + Ingredient.of(to.getStoragePart()) + ) + ); + this.validSourceContainers = getValidSourceContainers(to, variants, containerProvider); + this.variants = variants; + this.to = to; + } + + public T[] getVariants() { + return variants; + } + + public T getTo() { + return to; + } + + private static Set getValidSourceContainers( + final T destination, + final T[] variants, + final Function containerProvider + ) { + if (destination.getCapacity() == null) { + return Set.of(); + } + return Arrays.stream(variants) + .filter(variant -> variant.getCapacity() != null && variant.getCapacity() < destination.getCapacity()) + .map(containerProvider) + .map(ItemLike::asItem) + .collect(Collectors.toSet()); + } + + @Override + public ItemStack assemble(final CraftingInput input, final HolderLookup.Provider provider) { + for (int i = 0; i < input.size(); ++i) { + final ItemStack fromDisk = input.getItem(i); + if (fromDisk.getItem() instanceof UpgradeableStorageContainer from + && validSourceContainers.contains(fromDisk.getItem())) { + final ItemStack toDisk = getResultItem(provider).copy(); + from.transferTo(fromDisk, toDisk); + return toDisk; + } + } + return ItemStack.EMPTY; + } + + @Override + public boolean matches(final CraftingInput input, final Level level) { + int diskCount = 0; + int partCount = 0; + for (int i = 0; i < input.size(); ++i) { + final ItemStack inputStack = input.getItem(i); + if (validSourceContainers.contains(inputStack.getItem())) { + diskCount++; + } else if (inputStack.getItem() == to.getStoragePart()) { + partCount++; + } + if (diskCount == 1 && partCount == 1) { + return true; + } + } + return false; + } + + @Override + public NonNullList getRemainingItems(final CraftingInput input) { + final NonNullList remainingItems = NonNullList.withSize(input.size(), ItemStack.EMPTY); + for (int i = 0; i < input.size(); ++i) { + final ItemStack stack = input.getItem(i); + if (stack.getItem() instanceof UpgradeableStorageContainer from + && validSourceContainers.contains(stack.getItem())) { + final Item storagePart = from.getVariant().getStoragePart(); + if (storagePart != null) { + remainingItems.set(i, storagePart.getDefaultInstance()); + } + } + } + return remainingItems; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageContainerUpgradeRecipeSerializer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageContainerUpgradeRecipeSerializer.java new file mode 100644 index 000000000..0f0af81d0 --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageContainerUpgradeRecipeSerializer.java @@ -0,0 +1,44 @@ +package com.refinedmods.refinedstorage.common.storage; + +import java.util.function.Function; + +import com.mojang.serialization.MapCodec; +import com.mojang.serialization.codecs.RecordCodecBuilder; +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.StreamCodec; +import net.minecraft.util.StringRepresentable; +import net.minecraft.world.item.crafting.RecipeSerializer; + +import static com.refinedmods.refinedstorage.common.util.PacketUtil.enumStreamCodec; + +public class StorageContainerUpgradeRecipeSerializer & StorageVariant & StringRepresentable> + implements RecipeSerializer> { + private final MapCodec> codec; + private final StreamCodec> streamCodec; + + public StorageContainerUpgradeRecipeSerializer( + final T[] variants, + final Function> instanceFactory + ) { + this.codec = RecordCodecBuilder.mapCodec( + instance -> instance.group( + StringRepresentable.fromValues(() -> variants).fieldOf("to") + .forGetter(StorageContainerUpgradeRecipe::getTo) + ).apply(instance, instanceFactory) + ); + this.streamCodec = StreamCodec.composite( + enumStreamCodec(variants), StorageContainerUpgradeRecipe::getTo, + instanceFactory + ); + } + + @Override + public MapCodec> codec() { + return codec; + } + + @Override + public StreamCodec> streamCodec() { + return streamCodec; + } +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageRepositoryImpl.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageRepositoryImpl.java index 5a1d50769..102d1248a 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageRepositoryImpl.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageRepositoryImpl.java @@ -57,14 +57,19 @@ public void set(final UUID id, final SerializableStorage storage) { public Optional removeIfEmpty(final UUID id) { return get(id).map(storage -> { if (storage.getStored() == 0) { - entries.remove(id); - setDirty(); + remove(id); return storage; } return null; }); } + @Override + public void remove(final UUID id) { + entries.remove(id); + setDirty(); + } + @Override public StorageInfo getInfo(final UUID id) { return get(id).map(StorageInfo::of).orElse(StorageInfo.UNKNOWN); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageVariant.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageVariant.java new file mode 100644 index 000000000..28864d17b --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/StorageVariant.java @@ -0,0 +1,13 @@ +package com.refinedmods.refinedstorage.common.storage; + +import javax.annotation.Nullable; + +import net.minecraft.world.item.Item; + +public interface StorageVariant { + @Nullable + Long getCapacity(); + + @Nullable + Item getStoragePart(); +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/UpgradeableStorageContainer.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/UpgradeableStorageContainer.java new file mode 100644 index 000000000..4253b580a --- /dev/null +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/UpgradeableStorageContainer.java @@ -0,0 +1,9 @@ +package com.refinedmods.refinedstorage.common.storage; + +import net.minecraft.world.item.ItemStack; + +public interface UpgradeableStorageContainer { + StorageVariant getVariant(); + + void transferTo(ItemStack from, ItemStack to); +} diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockEntity.java index 675d27996..68cb63b5c 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockEntity.java @@ -6,7 +6,6 @@ import com.refinedmods.refinedstorage.common.api.storage.SerializableStorage; import com.refinedmods.refinedstorage.common.content.BlockEntities; import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; -import com.refinedmods.refinedstorage.common.storage.StorageTypes; import net.minecraft.core.BlockPos; import net.minecraft.network.chat.Component; @@ -51,7 +50,7 @@ private static long getEnergyUsage(final FluidStorageVariant variant) { @Override protected SerializableStorage createStorage(final Runnable listener) { - return StorageTypes.FLUID.create(variant.getCapacity(), listener); + return FluidStorageBlockBlockItem.createStorage(variant, listener); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockItem.java index f46eb4e6b..253ede466 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockItem.java @@ -2,10 +2,15 @@ import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; import com.refinedmods.refinedstorage.common.api.storage.AbstractStorageContainerBlockItem; +import com.refinedmods.refinedstorage.common.api.storage.SerializableStorage; +import com.refinedmods.refinedstorage.common.api.storage.StorageRepository; import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; import com.refinedmods.refinedstorage.common.content.Blocks; import com.refinedmods.refinedstorage.common.content.Items; import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; +import com.refinedmods.refinedstorage.common.storage.StorageTypes; +import com.refinedmods.refinedstorage.common.storage.StorageVariant; +import com.refinedmods.refinedstorage.common.storage.UpgradeableStorageContainer; import com.refinedmods.refinedstorage.common.support.resource.FluidResource; import java.util.Optional; @@ -23,7 +28,8 @@ import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.format; -public class FluidStorageBlockBlockItem extends AbstractStorageContainerBlockItem { +public class FluidStorageBlockBlockItem extends AbstractStorageContainerBlockItem + implements UpgradeableStorageContainer { private static final Component CREATIVE_HELP = createTranslation("item", "creative_fluid_storage_block.help"); private final FluidStorageVariant variant; @@ -46,9 +52,10 @@ private static Component getHelpText(final FluidStorageVariant variant) { return createTranslation("item", "fluid_storage_block.help", format(variant.getCapacityInBuckets())); } + @Nullable @Override - protected boolean hasCapacity() { - return variant.hasCapacity(); + protected Long getCapacity() { + return variant.getCapacity(); } @Override @@ -56,6 +63,15 @@ protected String formatAmount(final long amount) { return RefinedStorageApi.INSTANCE.getResourceRendering(FluidResource.class).formatAmount(amount); } + @Override + protected SerializableStorage createStorage(final StorageRepository storageRepository) { + return createStorage(variant, storageRepository::markAsChanged); + } + + static SerializableStorage createStorage(final FluidStorageVariant variant, final Runnable listener) { + return StorageTypes.FLUID.create(variant.getCapacity(), listener); + } + @Override protected ItemStack createPrimaryDisassemblyByproduct(final int count) { return new ItemStack(Blocks.INSTANCE.getMachineCasing(), count); @@ -86,4 +102,14 @@ protected boolean placeBlock(final BlockPlaceContext ctx, final BlockState state public Optional getTooltipImage(final ItemStack stack) { return Optional.of(new HelpTooltipComponent(helpText)); } + + @Override + public StorageVariant getVariant() { + return variant; + } + + @Override + public void transferTo(final ItemStack from, final ItemStack to) { + helper.markAsToTransfer(from, to); + } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockBlockEntity.java index 4c2507d88..55409495d 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockBlockEntity.java @@ -6,7 +6,6 @@ import com.refinedmods.refinedstorage.common.api.storage.SerializableStorage; import com.refinedmods.refinedstorage.common.content.BlockEntities; import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; -import com.refinedmods.refinedstorage.common.storage.StorageTypes; import net.minecraft.core.BlockPos; import net.minecraft.network.chat.Component; @@ -47,7 +46,7 @@ private static long getEnergyUsage(final ItemStorageVariant variant) { @Override protected SerializableStorage createStorage(final Runnable listener) { - return StorageTypes.ITEM.create(variant.getCapacity(), listener); + return ItemStorageBlockBlockItem.createStorage(variant, listener); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockBlockItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockBlockItem.java index c19cab55a..42ce05c54 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockBlockItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockBlockItem.java @@ -2,10 +2,15 @@ import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; import com.refinedmods.refinedstorage.common.api.storage.AbstractStorageContainerBlockItem; +import com.refinedmods.refinedstorage.common.api.storage.SerializableStorage; +import com.refinedmods.refinedstorage.common.api.storage.StorageRepository; import com.refinedmods.refinedstorage.common.api.support.HelpTooltipComponent; import com.refinedmods.refinedstorage.common.content.Blocks; import com.refinedmods.refinedstorage.common.content.Items; import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; +import com.refinedmods.refinedstorage.common.storage.StorageTypes; +import com.refinedmods.refinedstorage.common.storage.StorageVariant; +import com.refinedmods.refinedstorage.common.storage.UpgradeableStorageContainer; import java.util.Optional; import javax.annotation.Nullable; @@ -22,7 +27,8 @@ import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.format; -public class ItemStorageBlockBlockItem extends AbstractStorageContainerBlockItem { +public class ItemStorageBlockBlockItem extends AbstractStorageContainerBlockItem + implements UpgradeableStorageContainer { private static final Component CREATIVE_HELP = createTranslation("item", "creative_storage_block.help"); private final ItemStorageVariant variant; @@ -44,9 +50,10 @@ private static Component getHelpText(final ItemStorageVariant variant) { : createTranslation("item", "storage_block.help", format(variant.getCapacity())); } + @Nullable @Override - protected boolean hasCapacity() { - return variant.hasCapacity(); + protected Long getCapacity() { + return variant.getCapacity(); } @Override @@ -54,6 +61,15 @@ protected String formatAmount(final long amount) { return format(amount); } + @Override + protected SerializableStorage createStorage(final StorageRepository storageRepository) { + return createStorage(variant, storageRepository::markAsChanged); + } + + static SerializableStorage createStorage(final ItemStorageVariant variant, final Runnable listener) { + return StorageTypes.ITEM.create(variant.getCapacity(), listener); + } + @Override protected ItemStack createPrimaryDisassemblyByproduct(final int count) { return new ItemStack(Blocks.INSTANCE.getMachineCasing(), count); @@ -85,4 +101,14 @@ protected boolean placeBlock(final BlockPlaceContext ctx, final BlockState state public Optional getTooltipImage(final ItemStack stack) { return Optional.of(new HelpTooltipComponent(helpText)); } + + @Override + public StorageVariant getVariant() { + return variant; + } + + @Override + public void transferTo(final ItemStack from, final ItemStack to) { + helper.markAsToTransfer(from, to); + } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/FluidStorageDiskItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/FluidStorageDiskItem.java index eb5f9b939..c26266938 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/FluidStorageDiskItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/FluidStorageDiskItem.java @@ -8,6 +8,8 @@ import com.refinedmods.refinedstorage.common.content.Items; import com.refinedmods.refinedstorage.common.storage.FluidStorageVariant; import com.refinedmods.refinedstorage.common.storage.StorageTypes; +import com.refinedmods.refinedstorage.common.storage.StorageVariant; +import com.refinedmods.refinedstorage.common.storage.UpgradeableStorageContainer; import com.refinedmods.refinedstorage.common.support.resource.FluidResource; import java.util.Optional; @@ -21,7 +23,7 @@ import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.format; -public class FluidStorageDiskItem extends AbstractStorageContainerItem { +public class FluidStorageDiskItem extends AbstractStorageContainerItem implements UpgradeableStorageContainer { private static final Component CREATIVE_HELP = createTranslation("item", "creative_fluid_storage_disk.help"); private final FluidStorageVariant variant; @@ -43,9 +45,10 @@ private static Component getHelpText(final FluidStorageVariant variant) { return createTranslation("item", "fluid_storage_disk.help", format(variant.getCapacityInBuckets())); } + @Nullable @Override - protected boolean hasCapacity() { - return variant.hasCapacity(); + protected Long getCapacity() { + return variant.getCapacity(); } @Override @@ -76,4 +79,14 @@ protected ItemStack createSecondaryDisassemblyByproduct(final int count) { public Optional getTooltipImage(final ItemStack stack) { return Optional.of(new HelpTooltipComponent(helpText)); } + + @Override + public StorageVariant getVariant() { + return variant; + } + + @Override + public void transferTo(final ItemStack from, final ItemStack to) { + helper.markAsToTransfer(from, to); + } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/ItemStorageDiskItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/ItemStorageDiskItem.java index 7ba29e021..f6ebba444 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/ItemStorageDiskItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storagedisk/ItemStorageDiskItem.java @@ -8,6 +8,8 @@ import com.refinedmods.refinedstorage.common.content.Items; import com.refinedmods.refinedstorage.common.storage.ItemStorageVariant; import com.refinedmods.refinedstorage.common.storage.StorageTypes; +import com.refinedmods.refinedstorage.common.storage.StorageVariant; +import com.refinedmods.refinedstorage.common.storage.UpgradeableStorageContainer; import java.util.Optional; import javax.annotation.Nullable; @@ -20,7 +22,7 @@ import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.createTranslation; import static com.refinedmods.refinedstorage.common.util.IdentifierUtil.format; -public class ItemStorageDiskItem extends AbstractStorageContainerItem { +public class ItemStorageDiskItem extends AbstractStorageContainerItem implements UpgradeableStorageContainer { private static final Component CREATIVE_HELP = createTranslation("item", "creative_storage_disk.help"); private final ItemStorageVariant variant; @@ -41,9 +43,10 @@ private static Component getHelpText(final ItemStorageVariant variant) { : createTranslation("item", "storage_disk.help", format(variant.getCapacity())); } + @Nullable @Override - protected boolean hasCapacity() { - return variant.hasCapacity(); + protected Long getCapacity() { + return variant.getCapacity(); } @Override @@ -74,4 +77,14 @@ protected ItemStack createSecondaryDisassemblyByproduct(final int count) { public Optional getTooltipImage(final ItemStack stack) { return Optional.of(new HelpTooltipComponent(helpText)); } + + @Override + public StorageVariant getVariant() { + return variant; + } + + @Override + public void transferTo(final ItemStack from, final ItemStack to) { + helper.markAsToTransfer(from, to); + } } diff --git a/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json index 155d1e882..bd293288c 100644 --- a/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json +++ b/refinedstorage-common/src/main/resources/assets/refinedstorage/lang/en_us.json @@ -214,8 +214,8 @@ "item.refinedstorage.4k_storage_disk": "4K Storage Disk", "item.refinedstorage.16k_storage_disk": "16K Storage Disk", "item.refinedstorage.64k_storage_disk": "64K Storage Disk", - "item.refinedstorage.storage_disk.help": "Stores %s items.", - "item.refinedstorage.storage_block.help": "Stores %s items.", + "item.refinedstorage.storage_disk.help": "Stores %s items. When empty, use while holding to return the Storage Part. Upgradeable to a higher tier by combining with a Storage Part.", + "item.refinedstorage.storage_block.help": "Stores %s items. When empty, use while holding to return the Storage Part and Machine Casing. Upgradeable to a higher tier by combining with a Storage Part.", "item.refinedstorage.creative_storage_disk": "Creative Storage Disk", "item.refinedstorage.creative_storage_disk.help": "Stores an infinite amount of items.", "item.refinedstorage.creative_storage_block.help": "Stores an infinite amount of items.", diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_block_upgrade.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_block_upgrade.json new file mode 100644 index 000000000..34170c281 --- /dev/null +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_block_upgrade.json @@ -0,0 +1,4 @@ +{ + "type": "refinedstorage:fluid_storage_block_upgrade", + "to": "1024b" +} \ No newline at end of file diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_disk_upgrade.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_disk_upgrade.json new file mode 100644 index 000000000..16c64c2da --- /dev/null +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/1024b_fluid_storage_disk_upgrade.json @@ -0,0 +1,4 @@ +{ + "type": "refinedstorage:fluid_storage_disk_upgrade", + "to": "1024b" +} \ No newline at end of file diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/16k_storage_block_upgrade.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/16k_storage_block_upgrade.json new file mode 100644 index 000000000..7706f28b0 --- /dev/null +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/16k_storage_block_upgrade.json @@ -0,0 +1,4 @@ +{ + "type": "refinedstorage:storage_block_upgrade", + "to": "16k" +} \ No newline at end of file diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/16k_storage_disk_upgrade.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/16k_storage_disk_upgrade.json new file mode 100644 index 000000000..0aef38c37 --- /dev/null +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/16k_storage_disk_upgrade.json @@ -0,0 +1,4 @@ +{ + "type": "refinedstorage:storage_disk_upgrade", + "to": "16k" +} \ No newline at end of file diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_block_upgrade.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_block_upgrade.json new file mode 100644 index 000000000..1180d3724 --- /dev/null +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_block_upgrade.json @@ -0,0 +1,4 @@ +{ + "type": "refinedstorage:fluid_storage_block_upgrade", + "to": "256b" +} \ No newline at end of file diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_disk_upgrade.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_disk_upgrade.json new file mode 100644 index 000000000..5ed429e0d --- /dev/null +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/256b_fluid_storage_disk_upgrade.json @@ -0,0 +1,4 @@ +{ + "type": "refinedstorage:fluid_storage_disk_upgrade", + "to": "256b" +} \ No newline at end of file diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_block_upgrade.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_block_upgrade.json new file mode 100644 index 000000000..873908785 --- /dev/null +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_block_upgrade.json @@ -0,0 +1,4 @@ +{ + "type": "refinedstorage:fluid_storage_block_upgrade", + "to": "4096b" +} \ No newline at end of file diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_disk_upgrade.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_disk_upgrade.json new file mode 100644 index 000000000..e917eeee7 --- /dev/null +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4096b_fluid_storage_disk_upgrade.json @@ -0,0 +1,4 @@ +{ + "type": "refinedstorage:fluid_storage_disk_upgrade", + "to": "4096b" +} \ No newline at end of file diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4k_storage_block_upgrade.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4k_storage_block_upgrade.json new file mode 100644 index 000000000..1decc2cc6 --- /dev/null +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4k_storage_block_upgrade.json @@ -0,0 +1,4 @@ +{ + "type": "refinedstorage:storage_block_upgrade", + "to": "4k" +} \ No newline at end of file diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4k_storage_disk_upgrade.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4k_storage_disk_upgrade.json new file mode 100644 index 000000000..9c2ba3627 --- /dev/null +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/4k_storage_disk_upgrade.json @@ -0,0 +1,4 @@ +{ + "type": "refinedstorage:storage_disk_upgrade", + "to": "4k" +} \ No newline at end of file diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64k_storage_block_upgrade.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64k_storage_block_upgrade.json new file mode 100644 index 000000000..2df69d790 --- /dev/null +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64k_storage_block_upgrade.json @@ -0,0 +1,4 @@ +{ + "type": "refinedstorage:storage_block_upgrade", + "to": "64k" +} \ No newline at end of file diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64k_storage_disk_upgrade.json b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64k_storage_disk_upgrade.json new file mode 100644 index 000000000..1cead442a --- /dev/null +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/recipe/64k_storage_disk_upgrade.json @@ -0,0 +1,4 @@ +{ + "type": "refinedstorage:storage_disk_upgrade", + "to": "64k" +} \ No newline at end of file From abff958472bf879ebbd04ab3621611fb020b8a14 Mon Sep 17 00:00:00 2001 From: Starforcraft Date: Sun, 14 Jul 2024 17:11:21 +0200 Subject: [PATCH 18/20] fix: can't extract fluids in grid if using an empty fluid container --- CHANGELOG.md | 1 + .../api/grid/view/PlatformGridResource.java | 5 +- .../ResourceContainerInsertStrategy.java | 2 +- .../refinedstorage/common/Platform.java | 2 - .../refinedstorage/common/PlatformProxy.java | 5 -- .../grid/screen/AbstractGridScreen.java | 4 +- .../common/grid/view/FluidGridResource.java | 38 ++++++++-- .../common/grid/view/ItemGridResource.java | 7 +- ...ucketPlayerInventoryInsertableStorage.java | 8 ++- .../common/support/AbstractBaseScreen.java | 2 +- .../FluidResourceContainerInsertStrategy.java | 11 +-- .../refinedstorage/fabric/PlatformImpl.java | 5 +- .../strategy/FluidGridExtractionStrategy.java | 69 +++++++++++++++++-- .../fabric/util/SimpleSingleStackStorage.java | 6 +- .../refinedstorage/neoforge/PlatformImpl.java | 14 ---- .../strategy/FluidGridExtractionStrategy.java | 27 +++++++- 16 files changed, 154 insertions(+), 52 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48a4de402..446bd0d3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Portable Grid search bar texture being positioned in the wrong way. - External Storage screen unnecessarily showing upgrade slots. - Grid setting changes not persisting after restarting Minecraft. +- Fixed not being able to extract fluids from the Grid with an empty bucket or other empty fluid container. ## [2.0.0-milestone.4.6] - 2024-08-08 diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/view/PlatformGridResource.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/view/PlatformGridResource.java index 40e9a03cd..0b062d6fd 100644 --- a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/view/PlatformGridResource.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/grid/view/PlatformGridResource.java @@ -17,10 +17,13 @@ import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; import net.minecraft.network.chat.Component; import net.minecraft.world.inventory.tooltip.TooltipComponent; +import net.minecraft.world.item.ItemStack; import org.apiguardian.api.API; @API(status = API.Status.STABLE, since = "2.0.0-milestone.2.6") public interface PlatformGridResource extends GridResource { + boolean canExtract(ItemStack carriedStack, GridView view); + void onExtract(GridExtractMode extractMode, boolean cursor, GridExtractionStrategy extractionStrategy); @@ -42,7 +45,7 @@ void onScroll(GridScrollMode scrollMode, int getRegistryId(); - List getExtractionHints(GridView view); + List getExtractionHints(ItemStack carriedStack, GridView view); @Nullable @API(status = API.Status.INTERNAL) diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceContainerInsertStrategy.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceContainerInsertStrategy.java index 139039666..007d8f8c2 100644 --- a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceContainerInsertStrategy.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/resource/ResourceContainerInsertStrategy.java @@ -21,7 +21,7 @@ public interface ResourceContainerInsertStrategy { */ Optional insert(ItemStack container, ResourceAmount resourceAmount); - Optional getConversionInfo(ResourceKey resource); + Optional getConversionInfo(ResourceKey resource, ItemStack carriedStack); record InsertResult(ItemStack container, long inserted) { } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/Platform.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/Platform.java index d7c8baaa7..67245d029 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/Platform.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/Platform.java @@ -75,8 +75,6 @@ public interface Platform { Optional fillContainer(ItemStack container, ResourceAmount resourceAmount); - Optional getFilledBucket(FluidResource fluidResource); - TransferManager createTransferManager(AbstractContainerMenu containerMenu); long insertIntoContainer(Container container, ItemResource itemResource, long amount, Action action); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/PlatformProxy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/PlatformProxy.java index 51e7a2660..ac5c84766 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/PlatformProxy.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/PlatformProxy.java @@ -118,11 +118,6 @@ public Optional fillContainer(final ItemStack container, return ensureLoaded().fillContainer(container, resourceAmount); } - @Override - public Optional getFilledBucket(final FluidResource fluidResource) { - return ensureLoaded().getFilledBucket(fluidResource); - } - @Override public TransferManager createTransferManager(final AbstractContainerMenu containerMenu) { return ensureLoaded().createTransferManager(containerMenu); diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/AbstractGridScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/AbstractGridScreen.java index d6330c212..503a2926b 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/AbstractGridScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/screen/AbstractGridScreen.java @@ -349,7 +349,7 @@ private void renderHoveredResourceTooltip(final GuiGraphics graphics, addDetailedTooltip(view, platformResource, processedLines); } if (!platformResource.isZeroed()) { - processedLines.addAll(platformResource.getExtractionHints(getMenu().getView())); + processedLines.addAll(platformResource.getExtractionHints(getMenu().getCarried(), getMenu().getView())); } Platform.INSTANCE.renderTooltip(graphics, processedLines, mouseX, mouseY); } @@ -419,7 +419,7 @@ public boolean mouseClicked(final double mouseX, final double mouseY, final int final ItemStack carriedStack = getMenu().getCarried(); final PlatformGridResource resource = getCurrentGridResource(); - if (resource != null && carriedStack.isEmpty()) { + if (resource != null && resource.canExtract(carriedStack, getMenu().getView())) { mouseClickedInGrid(clickedButton, resource); return true; } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/FluidGridResource.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/FluidGridResource.java index 5f8b956ba..63dae70de 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/FluidGridResource.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/FluidGridResource.java @@ -2,6 +2,7 @@ import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode; import com.refinedmods.refinedstorage.api.grid.view.GridView; +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.common.Platform; import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; import com.refinedmods.refinedstorage.common.api.grid.GridResourceAttributeKeys; @@ -9,6 +10,7 @@ import com.refinedmods.refinedstorage.common.api.grid.strategy.GridExtractionStrategy; import com.refinedmods.refinedstorage.common.api.grid.strategy.GridScrollingStrategy; import com.refinedmods.refinedstorage.common.api.grid.view.AbstractPlatformGridResource; +import com.refinedmods.refinedstorage.common.api.support.resource.FluidOperationResult; import com.refinedmods.refinedstorage.common.api.support.resource.ResourceRendering; import com.refinedmods.refinedstorage.common.api.support.resource.ResourceType; import com.refinedmods.refinedstorage.common.support.resource.FluidResource; @@ -25,8 +27,12 @@ import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.network.chat.Component; import net.minecraft.world.inventory.tooltip.TooltipComponent; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; public class FluidGridResource extends AbstractPlatformGridResource { + private static final ItemStack EMPTY_BUCKET = new ItemStack(Items.BUCKET); + private final int id; private final ResourceRendering rendering; @@ -52,12 +58,32 @@ public int getRegistryId() { } @Override - public List getExtractionHints(final GridView view) { - return Platform.INSTANCE.getFilledBucket(resource).map(bucket -> MouseClientTooltipComponent.item( - MouseClientTooltipComponent.Type.LEFT, - bucket, - null - )).stream().toList(); + public List getExtractionHints(final ItemStack carriedStack, final GridView view) { + return tryFillFluidContainer(carriedStack) + .filter(result -> result.amount() > 0) + .map(result -> MouseClientTooltipComponent.item( + MouseClientTooltipComponent.Type.LEFT, + result.container(), + null + )).stream().toList(); + } + + private Optional tryFillFluidContainer(final ItemStack carriedStack) { + final ResourceAmount toFill = new ResourceAmount(resource, Platform.INSTANCE.getBucketAmount()); + return carriedStack.isEmpty() + ? Platform.INSTANCE.fillContainer(EMPTY_BUCKET, toFill) + : Platform.INSTANCE.fillContainer(carriedStack, toFill); + } + + @Override + public boolean canExtract(final ItemStack carriedStack, final GridView view) { + if (carriedStack.isEmpty()) { + return true; + } + final ResourceAmount toFill = new ResourceAmount(resource, view.getAmount(resource)); + return Platform.INSTANCE.fillContainer(carriedStack, toFill) + .map(result -> result.amount() > 0) + .orElse(false); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/ItemGridResource.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/ItemGridResource.java index dbf43035e..6abbfedfc 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/ItemGridResource.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/view/ItemGridResource.java @@ -67,7 +67,7 @@ public int getRegistryId() { } @Override - public List getExtractionHints(final GridView view) { + public List getExtractionHints(final ItemStack carriedStack, final GridView view) { final long amount = getAmount(view); final long extractableAmount = Math.min(amount, itemStack.getMaxStackSize()); final long halfExtractionAmount = extractableAmount == 1 ? 1 : extractableAmount / 2; @@ -85,6 +85,11 @@ public List getExtractionHints(final GridView view) { ); } + @Override + public boolean canExtract(final ItemStack carriedStack, final GridView view) { + return carriedStack.isEmpty(); + } + @Override public void onExtract(final GridExtractMode extractMode, final boolean cursor, diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/BucketPlayerInventoryInsertableStorage.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/BucketPlayerInventoryInsertableStorage.java index 48fab8ce3..5410e0773 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/BucketPlayerInventoryInsertableStorage.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/BucketPlayerInventoryInsertableStorage.java @@ -1,6 +1,7 @@ package com.refinedmods.refinedstorage.common.storage; import com.refinedmods.refinedstorage.api.core.Action; +import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.api.storage.InsertableStorage; @@ -37,9 +38,10 @@ public long insert(final ResourceKey resource, final long amount, final Action a if (amount != Platform.INSTANCE.getBucketAmount()) { return 0; } - return Platform.INSTANCE.getFilledBucket(fluidResource).map( - filledBucketStack -> insert(filledBucketStack, amount, action, actor) - ).orElse(0L); + final ResourceAmount toFill = new ResourceAmount(fluidResource, amount); + return Platform.INSTANCE.fillContainer(EMPTY_BUCKET_STACK, toFill) + .map(result -> insert(result.container(), amount, action, actor)) + .orElse(0L); } private long insert(final ItemStack filledBucketStack, final long amount, final Action action, final Actor actor) { diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBaseScreen.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBaseScreen.java index b9379a411..743bfa0b0 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBaseScreen.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/AbstractBaseScreen.java @@ -221,7 +221,7 @@ private List getTooltipForResource(final ResourceKey res if (resourceSlot.supportsItemSlotInteractions()) { RefinedStorageApi.INSTANCE.getResourceContainerInsertStrategies() .stream() - .flatMap(strategy -> strategy.getConversionInfo(resource).stream()) + .flatMap(strategy -> strategy.getConversionInfo(resource, getMenu().getCarried()).stream()) .map(conversionInfo -> MouseClientTooltipComponent.itemConversion( MouseClientTooltipComponent.Type.LEFT, conversionInfo.from(), diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceContainerInsertStrategy.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceContainerInsertStrategy.java index 06582a71c..56bd74479 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceContainerInsertStrategy.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/resource/FluidResourceContainerInsertStrategy.java @@ -21,13 +21,14 @@ public Optional insert(final ItemStack container, final ResourceAm } @Override - public Optional getConversionInfo(final ResourceKey resource) { + public Optional getConversionInfo(final ResourceKey resource, final ItemStack carriedStack) { if (!(resource instanceof FluidResource fluidResource)) { return Optional.empty(); } - return Platform.INSTANCE.getFilledBucket(fluidResource).map(filledBucket -> new ConversionInfo( - EMPTY_BUCKET, - filledBucket - )); + final ItemStack container = carriedStack.isEmpty() ? EMPTY_BUCKET : carriedStack; + final ResourceAmount toFill = new ResourceAmount(fluidResource, Platform.INSTANCE.getBucketAmount()); + return Platform.INSTANCE.fillContainer(container, toFill) + .filter(result -> result.amount() > 0) + .map(result -> new ConversionInfo(container, result.container())); } } diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/PlatformImpl.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/PlatformImpl.java index 840267efc..421083629 100644 --- a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/PlatformImpl.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/PlatformImpl.java @@ -195,9 +195,8 @@ public Optional fillContainer(final ItemStack container, } } - @Override - public Optional getFilledBucket(final FluidResource fluidResource) { - final SimpleSingleStackStorage interceptingStorage = SimpleSingleStackStorage.forEmptyBucket(); + private Optional getFilledItemStack(final FluidResource fluidResource, + final SimpleSingleStackStorage interceptingStorage) { final Storage destination = FluidStorage.ITEM.find( interceptingStorage.getStack(), ContainerItemContext.ofSingleSlot(interceptingStorage) diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/strategy/FluidGridExtractionStrategy.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/strategy/FluidGridExtractionStrategy.java index fab9c3b53..c03d12a42 100644 --- a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/strategy/FluidGridExtractionStrategy.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/grid/strategy/FluidGridExtractionStrategy.java @@ -18,9 +18,11 @@ import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; import net.fabricmc.fabric.api.transfer.v1.item.PlayerInventoryStorage; +import net.fabricmc.fabric.api.transfer.v1.storage.StorageView; import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import static com.refinedmods.refinedstorage.fabric.support.resource.VariantUtil.toFluidVariant; @@ -48,9 +50,12 @@ public boolean onExtract(final PlatformResourceKey resource, final GridExtractMode extractMode, final boolean cursor) { if (resource instanceof FluidResource fluidResource) { + final boolean containerOnCursor = isFluidContainerOnCursor(); final boolean bucketInInventory = hasBucketInInventory(); final boolean bucketInStorage = hasBucketInStorage(); - if (bucketInInventory) { + if (containerOnCursor) { + extractWithContainerOnCursor(fluidResource, extractMode); + } else if (bucketInInventory) { extractWithBucketInInventory(fluidResource, extractMode, cursor); } else if (bucketInStorage) { extractWithBucketInStorage(fluidResource, extractMode, cursor); @@ -60,6 +65,49 @@ public boolean onExtract(final PlatformResourceKey resource, return false; } + private void extractWithContainerOnCursor(final FluidResource fluidResource, final GridExtractMode mode) { + try (Transaction tx = Transaction.openOuter()) { + final ItemStack stack = extractContainerFromCursor(tx); + final SimpleSingleStackStorage interceptingStorage = SimpleSingleStackStorage.forStack(stack); + final net.fabricmc.fabric.api.transfer.v1.storage.Storage dest = FluidStorage.ITEM.find( + interceptingStorage.getStack(), + ContainerItemContext.ofSingleSlot(interceptingStorage) + ); + if (dest == null) { + return; + } + gridOperations.extract(fluidResource, mode, (resource2, amount, action, source) -> { + if (!(resource2 instanceof FluidResource fluidResource2)) { + return 0; + } + try (Transaction innerTx = tx.openNested()) { + final long inserted = dest.insert(toFluidVariant(fluidResource2), amount, innerTx); + final boolean couldInsertContainer = insertResultingContainerIntoInventory( + interceptingStorage, + true, + innerTx + ); + if (!couldInsertContainer) { + return 0; + } + if (action == Action.EXECUTE) { + innerTx.commit(); + tx.commit(); + } + return inserted; + } + }); + } + } + + private ItemStack extractContainerFromCursor(final Transaction tx) { + final StorageView view = playerCursorStorage.iterator().next(); + final ItemVariant variant = view.getResource(); + final ItemStack stack = variant.toStack((int) view.getAmount()); + playerCursorStorage.extract(variant, 1, tx); + return stack; + } + private void extractWithBucketInStorage(final FluidResource fluidResource, final GridExtractMode mode, final boolean cursor) { @@ -77,7 +125,8 @@ private void extractWithBucketInStorage(final FluidResource fluidResource, } try (Transaction tx = Transaction.openOuter()) { final long inserted = destination.insert(toFluidVariant(fluidResource2), amount, tx); - final boolean couldInsertBucket = insertResultingBucketIntoInventory(interceptingStorage, cursor, tx); + final boolean couldInsertBucket = + insertResultingContainerIntoInventory(interceptingStorage, cursor, tx); if (!couldInsertBucket) { return 0; } @@ -109,7 +158,7 @@ private void extractWithBucketInInventory(final FluidResource fluidResource, } try (Transaction innerTx = tx.openNested()) { final long inserted = dest.insert(toFluidVariant(fluidResource2), amount, innerTx); - final boolean couldInsertBucket = insertResultingBucketIntoInventory( + final boolean couldInsertBucket = insertResultingContainerIntoInventory( interceptingStorage, cursor, innerTx @@ -127,9 +176,9 @@ private void extractWithBucketInInventory(final FluidResource fluidResource, } } - private boolean insertResultingBucketIntoInventory(final SimpleSingleStackStorage interceptingStorage, - final boolean cursor, - final Transaction innerTx) { + private boolean insertResultingContainerIntoInventory(final SimpleSingleStackStorage interceptingStorage, + final boolean cursor, + final Transaction innerTx) { final net.fabricmc.fabric.api.transfer.v1.storage.Storage relevantStorage = cursor ? playerCursorStorage : playerInventoryStorage; @@ -137,6 +186,14 @@ private boolean insertResultingBucketIntoInventory(final SimpleSingleStackStorag return relevantStorage.insert(itemVariant, 1, innerTx) != 0; } + private boolean isFluidContainerOnCursor() { + final StorageView view = playerCursorStorage.iterator().next(); + final ItemVariant variant = view.getResource(); + final ItemStack stack = variant.toStack((int) view.getAmount()); + final ContainerItemContext ctx = ContainerItemContext.withConstant(stack); + return FluidStorage.ITEM.find(stack, ctx) != null; + } + private boolean hasBucketInInventory() { try (Transaction tx = Transaction.openOuter()) { return playerInventoryStorage.extract(BUCKET_ITEM_VARIANT, 1, tx) == 1; diff --git a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/util/SimpleSingleStackStorage.java b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/util/SimpleSingleStackStorage.java index 73b1513a7..3372127c5 100644 --- a/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/util/SimpleSingleStackStorage.java +++ b/refinedstorage-fabric/src/main/java/com/refinedmods/refinedstorage/fabric/util/SimpleSingleStackStorage.java @@ -12,7 +12,11 @@ public SimpleSingleStackStorage(final ItemStack stack) { } public static SimpleSingleStackStorage forEmptyBucket() { - return new SimpleSingleStackStorage(new ItemStack(Items.BUCKET)); + return forStack(new ItemStack(Items.BUCKET)); + } + + public static SimpleSingleStackStorage forStack(final ItemStack stack) { + return new SimpleSingleStackStorage(stack); } @Override diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/PlatformImpl.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/PlatformImpl.java index 1e91d7032..a533b9629 100644 --- a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/PlatformImpl.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/PlatformImpl.java @@ -54,7 +54,6 @@ import net.minecraft.world.inventory.Slot; import net.minecraft.world.inventory.tooltip.TooltipComponent; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.item.crafting.CraftingInput; import net.minecraft.world.item.crafting.CraftingRecipe; @@ -165,19 +164,6 @@ public Optional fillContainer(final ItemStack container, }); } - @Override - public Optional getFilledBucket(final FluidResource fluidResource) { - return Optional.ofNullable( - new ItemStack(Items.BUCKET).getCapability(Capabilities.FluidHandler.ITEM) - ).map(dest -> { - dest.fill( - toFluidStack(fluidResource, FluidType.BUCKET_VOLUME), - IFluidHandler.FluidAction.EXECUTE - ); - return dest.getContainer(); - }); - } - @Override public TransferManager createTransferManager(final AbstractContainerMenu containerMenu) { return new TransferManager(containerMenu, ContainerTransferDestination::new); diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/FluidGridExtractionStrategy.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/FluidGridExtractionStrategy.java index f73c3eb51..c12bb4721 100644 --- a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/FluidGridExtractionStrategy.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/grid/strategy/FluidGridExtractionStrategy.java @@ -50,9 +50,12 @@ public boolean onExtract(final PlatformResourceKey resource, final GridExtractMode extractMode, final boolean cursor) { if (resource instanceof FluidResource fluidResource) { + final boolean containerOnCursor = isFluidContainerOnCursor(); final boolean bucketInInventory = hasBucketInInventory(); final boolean bucketInStorage = hasBucketInStorage(); - if (bucketInInventory) { + if (containerOnCursor) { + extractWithContainerOnCursor(fluidResource, extractMode); + } else if (bucketInInventory) { extract(fluidResource, extractMode, cursor, true); } else if (bucketInStorage) { extract(fluidResource, extractMode, cursor, false); @@ -67,6 +70,24 @@ private IFluidHandlerItem getFluidStorage(final ItemStack stack) { return stack.getCapability(Capabilities.FluidHandler.ITEM); } + private void extractWithContainerOnCursor(final FluidResource fluidResource, + final GridExtractMode mode) { + gridOperations.extract(fluidResource, mode, (resource, amount, action, source) -> { + if (!(resource instanceof FluidResource fluidResource2)) { + return 0; + } + final IFluidHandlerItem destination = getFluidStorage(menu.getCarried()); + if (destination == null) { + return 0; + } + final int inserted = destination.fill(toFluidStack(fluidResource2, amount), toFluidAction(action)); + if (inserted > 0 && action == Action.EXECUTE) { + menu.setCarried(destination.getContainer()); + } + return inserted; + }); + } + private void extract(final FluidResource fluidResource, final GridExtractMode mode, final boolean cursor, @@ -121,6 +142,10 @@ private boolean insertResultingBucket(final boolean cursor, final IFluidHandlerI } } + private boolean isFluidContainerOnCursor() { + return getFluidStorage(menu.getCarried()) != null; + } + private boolean hasBucketInStorage() { return itemStorage.extract(BUCKET_ITEM_RESOURCE, 1, Action.SIMULATE, EmptyActor.INSTANCE) == 1; } From 4b1869063431014f7b4fce428df44fd29bd029a1 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 11 Aug 2024 16:52:24 +0200 Subject: [PATCH 19/20] fix: retain and use custom names --- CHANGELOG.md | 1 + .../energy/AbstractNetworkEnergyItem.java | 9 ++- .../loot_table/blocks/black_cable.json | 9 +++ .../loot_table/blocks/black_constructor.json | 9 +++ .../loot_table/blocks/black_controller.json | 7 +++ .../blocks/black_crafting_grid.json | 9 +++ .../blocks/black_creative_controller.json | 9 +++ .../loot_table/blocks/black_destructor.json | 9 +++ .../loot_table/blocks/black_detector.json | 9 +++ .../blocks/black_disk_interface.json | 9 +++ .../loot_table/blocks/black_grid.json | 9 +++ .../blocks/black_network_receiver.json | 9 +++ .../blocks/black_network_transmitter.json | 9 +++ .../loot_table/blocks/black_pattern_grid.json | 9 +++ .../loot_table/blocks/black_relay.json | 9 +++ .../blocks/black_security_manager.json | 9 +++ .../blocks/black_wireless_transmitter.json | 9 +++ .../loot_table/blocks/blue_cable.json | 9 +++ .../loot_table/blocks/blue_constructor.json | 9 +++ .../loot_table/blocks/blue_controller.json | 7 +++ .../loot_table/blocks/blue_crafting_grid.json | 9 +++ .../blocks/blue_creative_controller.json | 9 +++ .../loot_table/blocks/blue_destructor.json | 9 +++ .../loot_table/blocks/blue_detector.json | 9 +++ .../blocks/blue_disk_interface.json | 9 +++ .../loot_table/blocks/blue_grid.json | 9 +++ .../blocks/blue_network_receiver.json | 9 +++ .../blocks/blue_network_transmitter.json | 9 +++ .../loot_table/blocks/blue_pattern_grid.json | 9 +++ .../loot_table/blocks/blue_relay.json | 9 +++ .../blocks/blue_security_manager.json | 9 +++ .../blocks/blue_wireless_transmitter.json | 9 +++ .../loot_table/blocks/brown_cable.json | 9 +++ .../loot_table/blocks/brown_constructor.json | 9 +++ .../loot_table/blocks/brown_controller.json | 7 +++ .../blocks/brown_crafting_grid.json | 9 +++ .../blocks/brown_creative_controller.json | 9 +++ .../loot_table/blocks/brown_destructor.json | 9 +++ .../loot_table/blocks/brown_detector.json | 9 +++ .../blocks/brown_disk_interface.json | 9 +++ .../loot_table/blocks/brown_grid.json | 9 +++ .../blocks/brown_network_receiver.json | 9 +++ .../blocks/brown_network_transmitter.json | 9 +++ .../loot_table/blocks/brown_pattern_grid.json | 9 +++ .../loot_table/blocks/brown_relay.json | 9 +++ .../blocks/brown_security_manager.json | 9 +++ .../blocks/brown_wireless_transmitter.json | 9 +++ .../loot_table/blocks/cable.json | 9 +++ .../loot_table/blocks/constructor.json | 9 +++ .../loot_table/blocks/controller.json | 7 +++ .../loot_table/blocks/crafting_grid.json | 9 +++ .../blocks/creative_controller.json | 9 +++ .../loot_table/blocks/cyan_cable.json | 9 +++ .../loot_table/blocks/cyan_constructor.json | 9 +++ .../loot_table/blocks/cyan_controller.json | 7 +++ .../loot_table/blocks/cyan_crafting_grid.json | 9 +++ .../blocks/cyan_creative_controller.json | 9 +++ .../loot_table/blocks/cyan_destructor.json | 9 +++ .../loot_table/blocks/cyan_detector.json | 9 +++ .../blocks/cyan_disk_interface.json | 9 +++ .../loot_table/blocks/cyan_grid.json | 9 +++ .../blocks/cyan_network_receiver.json | 9 +++ .../blocks/cyan_network_transmitter.json | 9 +++ .../loot_table/blocks/cyan_pattern_grid.json | 9 +++ .../loot_table/blocks/cyan_relay.json | 9 +++ .../blocks/cyan_security_manager.json | 9 +++ .../blocks/cyan_wireless_transmitter.json | 9 +++ .../loot_table/blocks/destructor.json | 9 +++ .../loot_table/blocks/detector.json | 9 +++ .../loot_table/blocks/disk_interface.json | 9 +++ .../loot_table/blocks/gray_controller.json | 7 +++ .../loot_table/blocks/gray_crafting_grid.json | 9 +++ .../blocks/gray_creative_controller.json | 9 +++ .../loot_table/blocks/gray_detector.json | 9 +++ .../blocks/gray_disk_interface.json | 9 +++ .../loot_table/blocks/gray_grid.json | 9 +++ .../blocks/gray_network_receiver.json | 9 +++ .../blocks/gray_network_transmitter.json | 9 +++ .../loot_table/blocks/gray_pattern_grid.json | 9 +++ .../loot_table/blocks/gray_relay.json | 9 +++ .../blocks/gray_security_manager.json | 9 +++ .../blocks/gray_wireless_transmitter.json | 9 +++ .../loot_table/blocks/green_cable.json | 9 +++ .../loot_table/blocks/green_constructor.json | 9 +++ .../loot_table/blocks/green_controller.json | 7 +++ .../blocks/green_crafting_grid.json | 9 +++ .../blocks/green_creative_controller.json | 9 +++ .../loot_table/blocks/green_destructor.json | 9 +++ .../loot_table/blocks/green_detector.json | 9 +++ .../blocks/green_disk_interface.json | 9 +++ .../loot_table/blocks/green_grid.json | 9 +++ .../blocks/green_network_receiver.json | 9 +++ .../blocks/green_network_transmitter.json | 9 +++ .../loot_table/blocks/green_pattern_grid.json | 9 +++ .../loot_table/blocks/green_relay.json | 9 +++ .../blocks/green_security_manager.json | 9 +++ .../blocks/green_wireless_transmitter.json | 9 +++ .../loot_table/blocks/grid.json | 9 +++ .../loot_table/blocks/light_blue_cable.json | 9 +++ .../blocks/light_blue_constructor.json | 9 +++ .../blocks/light_blue_destructor.json | 9 +++ .../loot_table/blocks/light_gray_cable.json | 9 +++ .../blocks/light_gray_constructor.json | 9 +++ .../blocks/light_gray_controller.json | 7 +++ .../blocks/light_gray_crafting_grid.json | 9 +++ .../light_gray_creative_controller.json | 9 +++ .../blocks/light_gray_destructor.json | 9 +++ .../blocks/light_gray_detector.json | 9 +++ .../blocks/light_gray_disk_interface.json | 9 +++ .../loot_table/blocks/light_gray_grid.json | 9 +++ .../blocks/light_gray_network_receiver.json | 9 +++ .../light_gray_network_transmitter.json | 9 +++ .../blocks/light_gray_pattern_grid.json | 9 +++ .../loot_table/blocks/light_gray_relay.json | 9 +++ .../blocks/light_gray_security_manager.json | 9 +++ .../light_gray_wireless_transmitter.json | 9 +++ .../loot_table/blocks/lime_cable.json | 9 +++ .../loot_table/blocks/lime_constructor.json | 9 +++ .../loot_table/blocks/lime_controller.json | 7 +++ .../loot_table/blocks/lime_crafting_grid.json | 9 +++ .../blocks/lime_creative_controller.json | 9 +++ .../loot_table/blocks/lime_destructor.json | 9 +++ .../loot_table/blocks/lime_detector.json | 9 +++ .../blocks/lime_disk_interface.json | 9 +++ .../loot_table/blocks/lime_grid.json | 9 +++ .../blocks/lime_network_receiver.json | 9 +++ .../blocks/lime_network_transmitter.json | 9 +++ .../loot_table/blocks/lime_pattern_grid.json | 9 +++ .../loot_table/blocks/lime_relay.json | 9 +++ .../blocks/lime_security_manager.json | 9 +++ .../blocks/lime_wireless_transmitter.json | 9 +++ .../loot_table/blocks/magenta_cable.json | 9 +++ .../blocks/magenta_constructor.json | 9 +++ .../loot_table/blocks/magenta_controller.json | 7 +++ .../blocks/magenta_crafting_grid.json | 9 +++ .../blocks/magenta_creative_controller.json | 9 +++ .../loot_table/blocks/magenta_destructor.json | 9 +++ .../loot_table/blocks/magenta_detector.json | 9 +++ .../blocks/magenta_disk_interface.json | 9 +++ .../loot_table/blocks/magenta_grid.json | 9 +++ .../blocks/magenta_network_receiver.json | 9 +++ .../blocks/magenta_network_transmitter.json | 9 +++ .../blocks/magenta_pattern_grid.json | 9 +++ .../loot_table/blocks/magenta_relay.json | 9 +++ .../blocks/magenta_security_manager.json | 9 +++ .../blocks/magenta_wireless_transmitter.json | 9 +++ .../loot_table/blocks/network_receiver.json | 9 +++ .../blocks/network_transmitter.json | 9 +++ .../loot_table/blocks/orange_cable.json | 9 +++ .../loot_table/blocks/orange_constructor.json | 9 +++ .../loot_table/blocks/orange_controller.json | 7 +++ .../blocks/orange_crafting_grid.json | 9 +++ .../blocks/orange_creative_controller.json | 9 +++ .../loot_table/blocks/orange_destructor.json | 9 +++ .../loot_table/blocks/orange_detector.json | 9 +++ .../blocks/orange_disk_interface.json | 9 +++ .../loot_table/blocks/orange_grid.json | 9 +++ .../blocks/orange_network_receiver.json | 9 +++ .../blocks/orange_network_transmitter.json | 9 +++ .../blocks/orange_pattern_grid.json | 9 +++ .../loot_table/blocks/orange_relay.json | 9 +++ .../blocks/orange_security_manager.json | 9 +++ .../blocks/orange_wireless_transmitter.json | 9 +++ .../loot_table/blocks/pattern_grid.json | 9 +++ .../loot_table/blocks/pink_cable.json | 9 +++ .../loot_table/blocks/pink_constructor.json | 9 +++ .../loot_table/blocks/pink_controller.json | 7 +++ .../loot_table/blocks/pink_crafting_grid.json | 9 +++ .../blocks/pink_creative_controller.json | 9 +++ .../loot_table/blocks/pink_destructor.json | 9 +++ .../loot_table/blocks/pink_detector.json | 9 +++ .../blocks/pink_disk_interface.json | 9 +++ .../loot_table/blocks/pink_grid.json | 9 +++ .../blocks/pink_network_receiver.json | 9 +++ .../blocks/pink_network_transmitter.json | 9 +++ .../loot_table/blocks/pink_pattern_grid.json | 9 +++ .../loot_table/blocks/pink_relay.json | 9 +++ .../blocks/pink_security_manager.json | 9 +++ .../blocks/pink_wireless_transmitter.json | 9 +++ .../loot_table/blocks/purple_cable.json | 9 +++ .../loot_table/blocks/purple_constructor.json | 9 +++ .../loot_table/blocks/purple_controller.json | 7 +++ .../blocks/purple_crafting_grid.json | 9 +++ .../blocks/purple_creative_controller.json | 9 +++ .../loot_table/blocks/purple_destructor.json | 9 +++ .../loot_table/blocks/purple_detector.json | 9 +++ .../blocks/purple_disk_interface.json | 9 +++ .../loot_table/blocks/purple_grid.json | 9 +++ .../blocks/purple_network_receiver.json | 9 +++ .../blocks/purple_network_transmitter.json | 9 +++ .../blocks/purple_pattern_grid.json | 9 +++ .../loot_table/blocks/purple_relay.json | 9 +++ .../blocks/purple_security_manager.json | 9 +++ .../blocks/purple_wireless_transmitter.json | 9 +++ .../loot_table/blocks/red_cable.json | 9 +++ .../loot_table/blocks/red_constructor.json | 9 +++ .../loot_table/blocks/red_controller.json | 7 +++ .../loot_table/blocks/red_crafting_grid.json | 9 +++ .../blocks/red_creative_controller.json | 9 +++ .../loot_table/blocks/red_destructor.json | 9 +++ .../loot_table/blocks/red_detector.json | 9 +++ .../loot_table/blocks/red_disk_interface.json | 9 +++ .../loot_table/blocks/red_grid.json | 9 +++ .../blocks/red_network_receiver.json | 9 +++ .../blocks/red_network_transmitter.json | 9 +++ .../loot_table/blocks/red_pattern_grid.json | 9 +++ .../loot_table/blocks/red_relay.json | 9 +++ .../blocks/red_security_manager.json | 9 +++ .../blocks/red_wireless_transmitter.json | 9 +++ .../loot_table/blocks/relay.json | 9 +++ .../loot_table/blocks/security_manager.json | 9 +++ .../loot_table/blocks/white_cable.json | 9 +++ .../loot_table/blocks/white_constructor.json | 9 +++ .../loot_table/blocks/white_controller.json | 7 +++ .../blocks/white_crafting_grid.json | 9 +++ .../blocks/white_creative_controller.json | 9 +++ .../loot_table/blocks/white_destructor.json | 9 +++ .../loot_table/blocks/white_detector.json | 9 +++ .../blocks/white_disk_interface.json | 9 +++ .../loot_table/blocks/white_grid.json | 9 +++ .../blocks/white_network_receiver.json | 9 +++ .../blocks/white_network_transmitter.json | 9 +++ .../loot_table/blocks/white_pattern_grid.json | 9 +++ .../loot_table/blocks/white_relay.json | 9 +++ .../blocks/white_security_manager.json | 9 +++ .../blocks/white_wireless_transmitter.json | 9 +++ .../blocks/wireless_transmitter.json | 9 +++ .../loot_table/blocks/yellow_cable.json | 9 +++ .../loot_table/blocks/yellow_constructor.json | 9 +++ .../loot_table/blocks/yellow_controller.json | 7 +++ .../blocks/yellow_crafting_grid.json | 9 +++ .../blocks/yellow_creative_controller.json | 9 +++ .../loot_table/blocks/yellow_destructor.json | 9 +++ .../loot_table/blocks/yellow_detector.json | 9 +++ .../blocks/yellow_disk_interface.json | 9 +++ .../loot_table/blocks/yellow_grid.json | 9 +++ .../blocks/yellow_network_receiver.json | 9 +++ .../blocks/yellow_network_transmitter.json | 9 +++ .../blocks/yellow_pattern_grid.json | 9 +++ .../loot_table/blocks/yellow_relay.json | 9 +++ .../blocks/yellow_security_manager.json | 9 +++ .../blocks/yellow_wireless_transmitter.json | 9 +++ .../autocrafting/PatternGridBlockEntity.java | 2 +- .../ConstructorBlockEntity.java | 2 +- .../DestructorBlockEntity.java | 2 +- .../controller/ControllerBlockEntity.java | 6 +- .../common/detector/DetectorBlockEntity.java | 2 +- .../common/exporter/ExporterBlockEntity.java | 2 +- .../common/grid/CraftingGridBlockEntity.java | 2 +- .../common/grid/GridBlockEntity.java | 2 +- .../WirelessGridExtendedMenuProvider.java | 11 +++- .../common/grid/WirelessGridItem.java | 9 ++- .../common/iface/InterfaceBlockEntity.java | 2 +- .../common/importer/ImporterBlockEntity.java | 2 +- .../NetworkTransmitterBlockEntity.java | 2 +- .../common/networking/RelayBlockEntity.java | 2 +- .../WirelessTransmitterBlockEntity.java | 2 +- ...lbackSecurityCardExtendedMenuProvider.java | 14 +++-- .../security/FallbackSecurityCardItem.java | 8 ++- .../SecurityCardExtendedMenuProvider.java | 18 ++++-- .../common/security/SecurityCardItem.java | 1 + .../security/SecurityManagerBlockEntity.java | 2 +- .../AbstractDiskDriveBlockEntity.java | 2 +- .../AbstractDiskInterfaceBlockEntity.java | 2 +- .../ExternalStorageBlockEntity.java | 2 +- .../AbstractPortableGridBlockEntity.java | 25 +++++++- .../portablegrid/PortableGridBlockItem.java | 1 + .../PortableGridItemExtendedMenuProvider.java | 16 ++++-- .../FluidStorageBlockBlockEntity.java | 2 +- .../ItemStorageBlockBlockEntity.java | 2 +- .../StorageMonitorBlockEntity.java | 2 +- ...neModeNetworkNodeContainerBlockEntity.java | 7 +-- .../BaseNetworkNodeContainerBlockEntity.java | 57 ++++++++++++++++++- .../common/upgrade/RegulatorUpgradeItem.java | 6 +- .../blocks/1024b_fluid_storage_block.json | 11 +++- .../loot_table/blocks/16k_storage_block.json | 17 ++++-- .../loot_table/blocks/1k_storage_block.json | 17 ++++-- .../blocks/256b_fluid_storage_block.json | 11 +++- .../blocks/4096b_fluid_storage_block.json | 11 +++- .../loot_table/blocks/4k_storage_block.json | 17 ++++-- .../blocks/64b_fluid_storage_block.json | 11 +++- .../loot_table/blocks/64k_storage_block.json | 17 ++++-- .../blocks/creative_fluid_storage_block.json | 11 +++- .../blocks/creative_portable_grid.json | 11 +++- .../blocks/creative_storage_block.json | 9 +++ .../loot_table/blocks/disk_drive.json | 9 +++ .../loot_table/blocks/exporter.json | 9 +++ .../loot_table/blocks/external_storage.json | 9 +++ .../loot_table/blocks/importer.json | 9 +++ .../loot_table/blocks/interface.json | 9 +++ .../loot_table/blocks/portable_grid.json | 11 +++- .../loot_table/blocks/storage_monitor.json | 9 +++ .../datagen/loot/BlockDropProvider.java | 44 +++++++++----- 293 files changed, 2508 insertions(+), 99 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 446bd0d3a..a18012a9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - External Storage screen unnecessarily showing upgrade slots. - Grid setting changes not persisting after restarting Minecraft. - Fixed not being able to extract fluids from the Grid with an empty bucket or other empty fluid container. +- All blocks and items now correctly retain their custom name. ## [2.0.0-milestone.4.6] - 2024-08-08 diff --git a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/energy/AbstractNetworkEnergyItem.java b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/energy/AbstractNetworkEnergyItem.java index f9646e79d..171c7d7fd 100644 --- a/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/energy/AbstractNetworkEnergyItem.java +++ b/refinedstorage-common-api/src/main/java/com/refinedmods/refinedstorage/common/api/support/energy/AbstractNetworkEnergyItem.java @@ -8,7 +8,9 @@ import java.util.List; import java.util.Optional; +import javax.annotation.Nullable; +import net.minecraft.core.component.DataComponents; import net.minecraft.network.chat.Component; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.InteractionHand; @@ -69,10 +71,13 @@ public void use(final ServerPlayer player, final ItemStack stack, final SlotRefe player, slotReference ); - use(player, slotReference, context); + use(stack.get(DataComponents.CUSTOM_NAME), player, slotReference, context); } - protected abstract void use(ServerPlayer player, SlotReference slotReference, NetworkItemContext context); + protected abstract void use(@Nullable Component name, + ServerPlayer player, + SlotReference slotReference, + NetworkItemContext context); public boolean isBound(final ItemStack stack) { return networkItemHelper.isBound(stack); diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_cable.json index 648334b11..cff2dcaf0 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_cable.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_cable.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_constructor.json index 8be210c46..d58175384 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_constructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_constructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_controller.json index 8123a56fc..57f51d01a 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_controller.json @@ -3,6 +3,13 @@ "functions": [ { "function": "refinedstorage:energy" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } ], "pools": [ diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_crafting_grid.json index 8f0b69498..4ccc243cd 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_crafting_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_crafting_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_creative_controller.json index 5ec03bd97..0b2407503 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_creative_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_creative_controller.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_destructor.json index a9a83086b..d37d81a3e 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_destructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_destructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_detector.json index 52898b736..8de1c722e 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_detector.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_detector.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_disk_interface.json index 24c802142..ac1f6222d 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_disk_interface.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_disk_interface.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_grid.json index e574c4fdd..417539c4d 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_network_receiver.json index c4384836c..23450acea 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_network_receiver.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_network_receiver.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_network_transmitter.json index a9ed752ae..ac3570184 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_network_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_network_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_pattern_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_pattern_grid.json index 1bbbc9cf6..4c1716fb9 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_pattern_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_pattern_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_relay.json index 8d07fbbd0..8c273d43e 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_relay.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_relay.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_security_manager.json index defbf005a..b02501bfe 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_security_manager.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_security_manager.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_wireless_transmitter.json index 3933a7c36..4f58d61be 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_wireless_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/black_wireless_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_cable.json index a58ea2e45..ef5e0dc34 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_cable.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_cable.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_constructor.json index 64d2af459..d1e4f8fed 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_constructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_constructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_controller.json index 56885102f..99625ac33 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_controller.json @@ -3,6 +3,13 @@ "functions": [ { "function": "refinedstorage:energy" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } ], "pools": [ diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_crafting_grid.json index 1bb7d29e5..a1c86a75d 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_crafting_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_crafting_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_creative_controller.json index 12da65050..c33d112a4 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_creative_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_creative_controller.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_destructor.json index d274f5fd8..0299f4905 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_destructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_destructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_detector.json index 0809791cb..8b81ed4cd 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_detector.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_detector.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_disk_interface.json index 18a317a93..8f7ea70cd 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_disk_interface.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_disk_interface.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_grid.json index a44f903cf..10d11d097 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_network_receiver.json index 217df93e6..78ec1a7f6 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_network_receiver.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_network_receiver.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_network_transmitter.json index 2cc41cc84..e0733074d 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_network_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_network_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_pattern_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_pattern_grid.json index 1158b0064..77567bfce 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_pattern_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_pattern_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_relay.json index 96b197d1b..047bb9285 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_relay.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_relay.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_security_manager.json index e75eaaab8..2c674b682 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_security_manager.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_security_manager.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_wireless_transmitter.json index 984dcc955..97d86a90c 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_wireless_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/blue_wireless_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_cable.json index 8a0b39f6a..4a937d211 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_cable.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_cable.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_constructor.json index 1ad80947f..baf5f28ef 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_constructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_constructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_controller.json index 9eae82c39..8df740050 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_controller.json @@ -3,6 +3,13 @@ "functions": [ { "function": "refinedstorage:energy" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } ], "pools": [ diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_crafting_grid.json index 428bae5fe..7bb8667fe 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_crafting_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_crafting_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_creative_controller.json index bd406e189..4cbb38ab1 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_creative_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_creative_controller.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_destructor.json index 208ca71b7..99f1644ad 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_destructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_destructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_detector.json index c27e729d3..d49d59b87 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_detector.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_detector.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_disk_interface.json index 080a5f622..efd0a64b9 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_disk_interface.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_disk_interface.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_grid.json index a4f3fdc25..c7be84a60 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_network_receiver.json index 772cc7a3a..5a9f2e3aa 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_network_receiver.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_network_receiver.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_network_transmitter.json index 1e2dc8f4e..d576bf397 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_network_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_network_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_pattern_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_pattern_grid.json index 684d5e8c9..6c7e60827 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_pattern_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_pattern_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_relay.json index 866982400..f192c2d89 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_relay.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_relay.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_security_manager.json index efaa86333..8509f56ba 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_security_manager.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_security_manager.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_wireless_transmitter.json index 3312f0440..fe131ab2b 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_wireless_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/brown_wireless_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cable.json index f9956450f..9de758211 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cable.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cable.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/constructor.json index 04230b181..a1c6a199b 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/constructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/constructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/controller.json index 6316da1bd..2c0663d27 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/controller.json @@ -3,6 +3,13 @@ "functions": [ { "function": "refinedstorage:energy" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } ], "pools": [ diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/crafting_grid.json index 757bac51c..5a184f330 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/crafting_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/crafting_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/creative_controller.json index c76ba2f3a..a2a00584c 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/creative_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/creative_controller.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_cable.json index fd572122f..ddc65c136 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_cable.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_cable.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_constructor.json index 2a5f8ed8d..e53bdea0f 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_constructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_constructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_controller.json index efa1911f4..086edc8ad 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_controller.json @@ -3,6 +3,13 @@ "functions": [ { "function": "refinedstorage:energy" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } ], "pools": [ diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_crafting_grid.json index e412b1d4d..3b7b8e5d3 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_crafting_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_crafting_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_creative_controller.json index c105f081c..f53cd7d82 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_creative_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_creative_controller.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_destructor.json index 9c36b7308..701bf64d2 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_destructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_destructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_detector.json index 5f9ae121e..661b2cf01 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_detector.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_detector.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_disk_interface.json index 1ae5ce2ee..9eb4a7244 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_disk_interface.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_disk_interface.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_grid.json index 7954e6cf2..80dae33d9 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_network_receiver.json index 3731c0cfb..0c67be32d 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_network_receiver.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_network_receiver.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_network_transmitter.json index f8126882b..2ba0d682f 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_network_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_network_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_pattern_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_pattern_grid.json index 1e3e94404..6262e75af 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_pattern_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_pattern_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_relay.json index 0bb33a77e..7fecc7e70 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_relay.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_relay.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_security_manager.json index ccd1d4309..5158422a4 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_security_manager.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_security_manager.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_wireless_transmitter.json index d6e57fea8..3342c8af7 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_wireless_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/cyan_wireless_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/destructor.json index 5aefe9504..667f0bc63 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/destructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/destructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/detector.json index 158f38e5e..2dbbfe44c 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/detector.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/detector.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/disk_interface.json index 05c0639bd..f74c4e015 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/disk_interface.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/disk_interface.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_controller.json index a2e7791ea..a28157f14 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_controller.json @@ -3,6 +3,13 @@ "functions": [ { "function": "refinedstorage:energy" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } ], "pools": [ diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_crafting_grid.json index 30b2c0f42..87dae7822 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_crafting_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_crafting_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_creative_controller.json index c09227605..aaef02567 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_creative_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_creative_controller.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_detector.json index 91ad54b1f..91c3b84e4 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_detector.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_detector.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_disk_interface.json index 8f2ae3499..e21985760 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_disk_interface.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_disk_interface.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_grid.json index 6ee8c592e..03ac5621b 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_network_receiver.json index ea905f0f9..b44cfe627 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_network_receiver.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_network_receiver.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_network_transmitter.json index 83b00cd87..efc4e740b 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_network_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_network_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_pattern_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_pattern_grid.json index 8d9660d5a..74107f8aa 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_pattern_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_pattern_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_relay.json index 635106c6a..aa973e181 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_relay.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_relay.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_security_manager.json index c48615268..3c3fc36c8 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_security_manager.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_security_manager.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_wireless_transmitter.json index 244be7449..8336d76e9 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_wireless_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/gray_wireless_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_cable.json index 49a2b9a72..5f427d6e7 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_cable.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_cable.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_constructor.json index 75609629f..912f36bcb 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_constructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_constructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_controller.json index c8463fe0a..2707cceb7 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_controller.json @@ -3,6 +3,13 @@ "functions": [ { "function": "refinedstorage:energy" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } ], "pools": [ diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_crafting_grid.json index 36d2e970e..d60e874c0 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_crafting_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_crafting_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_creative_controller.json index ca4cdc980..e807d7b32 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_creative_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_creative_controller.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_destructor.json index 3adcf929a..fb5cf3e5c 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_destructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_destructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_detector.json index b0ce29372..283d00b40 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_detector.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_detector.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_disk_interface.json index efda445ca..9e03648c1 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_disk_interface.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_disk_interface.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_grid.json index 0c3640b49..f708ceffb 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_network_receiver.json index 3396f152f..1e1260028 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_network_receiver.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_network_receiver.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_network_transmitter.json index aeb7ec831..7c99588d7 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_network_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_network_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_pattern_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_pattern_grid.json index 25e15cb87..da86ab6d7 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_pattern_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_pattern_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_relay.json index effbee11b..d7f2f3be3 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_relay.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_relay.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_security_manager.json index 477a5def5..3d922ff62 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_security_manager.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_security_manager.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_wireless_transmitter.json index facfa38a7..85c96b81a 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_wireless_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/green_wireless_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/grid.json index 1d872c7a7..db92cf22e 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_cable.json index 0bf3d6281..e4f463207 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_cable.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_cable.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_constructor.json index 6ee100f09..bf53d4095 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_constructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_constructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_destructor.json index bf974dec0..0c4c29537 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_destructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_blue_destructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_cable.json index c02e7952f..cdbf59291 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_cable.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_cable.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_constructor.json index 1d8abc1d3..1a31e4852 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_constructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_constructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_controller.json index 73318448f..49da85264 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_controller.json @@ -3,6 +3,13 @@ "functions": [ { "function": "refinedstorage:energy" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } ], "pools": [ diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_crafting_grid.json index e923a22c8..1a6d9847c 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_crafting_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_crafting_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_creative_controller.json index fed9b9a50..baa00eff0 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_creative_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_creative_controller.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_destructor.json index b560cf89d..56d16f0c7 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_destructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_destructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_detector.json index d0ab4ca69..ab9611123 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_detector.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_detector.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_disk_interface.json index 36a02aace..f731a8306 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_disk_interface.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_disk_interface.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_grid.json index dbdf999f9..331fd5506 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_network_receiver.json index 2d160c49b..ea21ec792 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_network_receiver.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_network_receiver.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_network_transmitter.json index c650f9b12..d85e5fc30 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_network_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_network_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_pattern_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_pattern_grid.json index 9346120a7..08df7cc29 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_pattern_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_pattern_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_relay.json index 48a5e7f03..b00c24eeb 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_relay.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_relay.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_security_manager.json index 48e4e6b02..99bb7ac43 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_security_manager.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_security_manager.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_wireless_transmitter.json index ddf3e5d0a..ecbabafb3 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_wireless_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/light_gray_wireless_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_cable.json index 9585b32c5..7b0c164b7 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_cable.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_cable.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_constructor.json index 492673796..4cd4cbef9 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_constructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_constructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_controller.json index 1a2782e67..9a1ae5682 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_controller.json @@ -3,6 +3,13 @@ "functions": [ { "function": "refinedstorage:energy" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } ], "pools": [ diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_crafting_grid.json index 57cc8b57c..500445c85 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_crafting_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_crafting_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_creative_controller.json index fdd127086..fe43115a0 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_creative_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_creative_controller.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_destructor.json index 258475a29..aa79f5191 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_destructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_destructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_detector.json index b56c8ee45..c1abb84bc 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_detector.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_detector.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_disk_interface.json index 50029864d..c2db65b4b 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_disk_interface.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_disk_interface.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_grid.json index e3244476e..f401bfea7 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_network_receiver.json index bb87854ee..51b360210 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_network_receiver.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_network_receiver.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_network_transmitter.json index 98678ab6d..1a691ebc3 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_network_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_network_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_pattern_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_pattern_grid.json index 4c5fd5b37..140079619 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_pattern_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_pattern_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_relay.json index 23d4b416b..cd66741f4 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_relay.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_relay.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_security_manager.json index 5a276b206..935b7cf5d 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_security_manager.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_security_manager.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_wireless_transmitter.json index 7fa08e6be..fb710751d 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_wireless_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/lime_wireless_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_cable.json index 4518d8e9c..d55135e83 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_cable.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_cable.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_constructor.json index b9f46f2f0..82a724338 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_constructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_constructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_controller.json index 220e8f226..5607183c4 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_controller.json @@ -3,6 +3,13 @@ "functions": [ { "function": "refinedstorage:energy" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } ], "pools": [ diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_crafting_grid.json index 213e7070f..c23a6cb7a 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_crafting_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_crafting_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_creative_controller.json index 3386023c0..1becc21b3 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_creative_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_creative_controller.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_destructor.json index 1e14318b7..aa222cef6 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_destructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_destructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_detector.json index 75cbfb2df..62f8a6725 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_detector.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_detector.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_disk_interface.json index ea4c18868..b5dee629e 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_disk_interface.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_disk_interface.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_grid.json index a3b9967da..cdd717286 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_network_receiver.json index 20c7c3fc7..8993c6fc4 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_network_receiver.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_network_receiver.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_network_transmitter.json index 519cc93c5..50cbf8a5b 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_network_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_network_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_pattern_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_pattern_grid.json index d6da01e5b..ed4785574 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_pattern_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_pattern_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_relay.json index 9d5ae07c8..b289f16bf 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_relay.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_relay.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_security_manager.json index e99c042f4..dc682d150 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_security_manager.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_security_manager.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_wireless_transmitter.json index 98150a16a..1b69f90fd 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_wireless_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/magenta_wireless_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/network_receiver.json index a2b0583de..46604ffe0 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/network_receiver.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/network_receiver.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/network_transmitter.json index 54bd2e7c4..f248db369 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/network_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/network_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_cable.json index ec66f74f5..57f8e5760 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_cable.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_cable.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_constructor.json index 91775c6e6..53b95aaba 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_constructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_constructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_controller.json index bb1c56a6a..1852afc31 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_controller.json @@ -3,6 +3,13 @@ "functions": [ { "function": "refinedstorage:energy" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } ], "pools": [ diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_crafting_grid.json index 2d58ffded..719934716 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_crafting_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_crafting_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_creative_controller.json index d3288c66e..bd2050211 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_creative_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_creative_controller.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_destructor.json index 3316fc948..09d5acb8a 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_destructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_destructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_detector.json index f606197b6..38bcb3bd0 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_detector.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_detector.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_disk_interface.json index d822a7f76..4fcca5dd7 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_disk_interface.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_disk_interface.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_grid.json index 2f8450762..e748399bf 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_network_receiver.json index 06e007fd4..42dd39a14 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_network_receiver.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_network_receiver.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_network_transmitter.json index 66a257655..ad9f0777e 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_network_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_network_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_pattern_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_pattern_grid.json index 964916d38..d638e5327 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_pattern_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_pattern_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_relay.json index b39a4057a..b973a8456 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_relay.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_relay.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_security_manager.json index d38d3f6ae..8c4dfa5b8 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_security_manager.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_security_manager.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_wireless_transmitter.json index 45ebec51f..2366631ec 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_wireless_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/orange_wireless_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pattern_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pattern_grid.json index f395323e7..18266c1d1 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pattern_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pattern_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_cable.json index b64de0634..35bc6f384 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_cable.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_cable.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_constructor.json index b13ff1611..c44ac8e92 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_constructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_constructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_controller.json index cbbcd5491..92615ed53 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_controller.json @@ -3,6 +3,13 @@ "functions": [ { "function": "refinedstorage:energy" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } ], "pools": [ diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_crafting_grid.json index 56e94f59e..645ff2141 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_crafting_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_crafting_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_creative_controller.json index 614cbbfa5..b8487b1f2 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_creative_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_creative_controller.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_destructor.json index 5372cc420..0d1753e6f 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_destructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_destructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_detector.json index cc9ef919e..20b43fba1 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_detector.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_detector.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_disk_interface.json index a4d9c7132..07aeba55b 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_disk_interface.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_disk_interface.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_grid.json index 98a1a6cfe..233283357 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_network_receiver.json index 524b6f77d..2aaf630a4 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_network_receiver.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_network_receiver.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_network_transmitter.json index adfe359a8..e52d3b413 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_network_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_network_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_pattern_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_pattern_grid.json index 6bb450999..8581c6794 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_pattern_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_pattern_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_relay.json index f6287c8f7..31c251a8f 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_relay.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_relay.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_security_manager.json index 2b94afa0f..0a00660fd 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_security_manager.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_security_manager.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_wireless_transmitter.json index 732b922c0..fe614b525 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_wireless_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/pink_wireless_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_cable.json index a60b36871..0fd1d1728 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_cable.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_cable.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_constructor.json index cfd9ff8a3..be70f60d9 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_constructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_constructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_controller.json index 312380c02..b46e03507 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_controller.json @@ -3,6 +3,13 @@ "functions": [ { "function": "refinedstorage:energy" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } ], "pools": [ diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_crafting_grid.json index 3c43045fd..4dce9422b 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_crafting_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_crafting_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_creative_controller.json index 589ee2382..0e0c21dbd 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_creative_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_creative_controller.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_destructor.json index 73d247b5a..04f550b5a 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_destructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_destructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_detector.json index 4ddd7f527..e02a40a65 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_detector.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_detector.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_disk_interface.json index e84dbb325..1e9de3dd5 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_disk_interface.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_disk_interface.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_grid.json index b4682e83f..765f18eef 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_network_receiver.json index bec3c2667..4f3c4902b 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_network_receiver.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_network_receiver.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_network_transmitter.json index 482dfb63e..2ba2217f6 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_network_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_network_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_pattern_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_pattern_grid.json index 42404be9c..1ff9d8b8d 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_pattern_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_pattern_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_relay.json index 6b816941d..e843dabe7 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_relay.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_relay.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_security_manager.json index e15d8cbe6..b99e6affc 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_security_manager.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_security_manager.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_wireless_transmitter.json index dc392f9d6..686d97323 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_wireless_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/purple_wireless_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_cable.json index 1ccc97a34..e1eb6ff46 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_cable.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_cable.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_constructor.json index af687b3fd..514d23cf3 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_constructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_constructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_controller.json index ef8ab7d65..85282ec98 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_controller.json @@ -3,6 +3,13 @@ "functions": [ { "function": "refinedstorage:energy" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } ], "pools": [ diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_crafting_grid.json index 89def9c61..7d7afddbe 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_crafting_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_crafting_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_creative_controller.json index 421a8ed51..fe7f36243 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_creative_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_creative_controller.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_destructor.json index 11226a220..98de66f73 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_destructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_destructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_detector.json index 56df24da6..f69cf07ce 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_detector.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_detector.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_disk_interface.json index 926cb0bc3..d08717af0 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_disk_interface.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_disk_interface.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_grid.json index c65e393fe..ace9a15e5 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_network_receiver.json index 5310dfc53..9807be0d2 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_network_receiver.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_network_receiver.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_network_transmitter.json index 3355b6793..250ec8938 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_network_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_network_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_pattern_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_pattern_grid.json index 25237dce7..3d3f603dd 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_pattern_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_pattern_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_relay.json index af0e1bf53..4ee4693b8 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_relay.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_relay.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_security_manager.json index dd4ffddcb..596c78385 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_security_manager.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_security_manager.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_wireless_transmitter.json index cb659bbb9..28c8eb932 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_wireless_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/red_wireless_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/relay.json index 2c727c13b..3dac491db 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/relay.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/relay.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/security_manager.json index af5ebe762..837b33925 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/security_manager.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/security_manager.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_cable.json index 8a7f09c24..b9fa781aa 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_cable.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_cable.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_constructor.json index dbe524878..5733edd79 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_constructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_constructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_controller.json index 56638f889..7cd7112ec 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_controller.json @@ -3,6 +3,13 @@ "functions": [ { "function": "refinedstorage:energy" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } ], "pools": [ diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_crafting_grid.json index 166c3a42b..b012f243d 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_crafting_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_crafting_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_creative_controller.json index e8168fbc1..7212be8fe 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_creative_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_creative_controller.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_destructor.json index 806585694..fd99115b1 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_destructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_destructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_detector.json index 44c0b1e6f..6932830ef 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_detector.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_detector.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_disk_interface.json index 1a39b9de4..307a75fb4 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_disk_interface.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_disk_interface.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_grid.json index 61361a837..bba29ff3a 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_network_receiver.json index 101a7f9f5..44ab9953a 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_network_receiver.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_network_receiver.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_network_transmitter.json index 34a4aeee6..89e7be9bd 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_network_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_network_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_pattern_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_pattern_grid.json index c059207d4..6179b0691 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_pattern_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_pattern_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_relay.json index d23e95892..6a1bd2c96 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_relay.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_relay.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_security_manager.json index 889a472bf..548f2af32 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_security_manager.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_security_manager.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_wireless_transmitter.json index 32a02bb65..bf1e7e4bd 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_wireless_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/white_wireless_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/wireless_transmitter.json index 968302c6f..d5d802148 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/wireless_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/wireless_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_cable.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_cable.json index 8f351c21d..589c38b0e 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_cable.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_cable.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_constructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_constructor.json index f91438fb8..9f4cfd260 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_constructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_constructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_controller.json index e4b17e966..bb51f0369 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_controller.json @@ -3,6 +3,13 @@ "functions": [ { "function": "refinedstorage:energy" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } ], "pools": [ diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_crafting_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_crafting_grid.json index a42021818..a629e836f 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_crafting_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_crafting_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_creative_controller.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_creative_controller.json index b280fb198..0a4585bcf 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_creative_controller.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_creative_controller.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_destructor.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_destructor.json index 473874387..a896c6b55 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_destructor.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_destructor.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_detector.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_detector.json index 4a969ba1e..345761b87 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_detector.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_detector.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_disk_interface.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_disk_interface.json index e67828299..394b00d00 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_disk_interface.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_disk_interface.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_grid.json index beea41b1d..22bfa898b 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_network_receiver.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_network_receiver.json index 1587bc1e1..689aab7fb 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_network_receiver.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_network_receiver.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_network_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_network_transmitter.json index 62262ec75..ff0dd2d84 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_network_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_network_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_pattern_grid.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_pattern_grid.json index d2f5ce5e4..a1f9453a0 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_pattern_grid.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_pattern_grid.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_relay.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_relay.json index ee66221db..7a3e86c0d 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_relay.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_relay.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_security_manager.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_security_manager.json index 621bd69a4..e3077b1c4 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_security_manager.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_security_manager.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_wireless_transmitter.json b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_wireless_transmitter.json index 7ba60d977..02fc5f478 100644 --- a/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_wireless_transmitter.json +++ b/refinedstorage-common/src/generated/resources/data/refinedstorage/loot_table/blocks/yellow_wireless_transmitter.json @@ -1,5 +1,14 @@ { "type": "minecraft:block", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "pools": [ { "bonus_rolls": 0.0, diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridBlockEntity.java index 601aa36e3..6594c0590 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/autocrafting/PatternGridBlockEntity.java @@ -215,7 +215,7 @@ void setPatternType(final PatternType patternType) { @Override public Component getDisplayName() { - return ContentNames.PATTERN_GRID; + return getName(ContentNames.PATTERN_GRID); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorBlockEntity.java index d27776517..9f7acea16 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/ConstructorBlockEntity.java @@ -129,7 +129,7 @@ void setDropItems(final boolean dropItems) { @Override public Component getDisplayName() { - return ContentNames.CONSTRUCTOR; + return getName(ContentNames.CONSTRUCTOR); } @Nullable diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorBlockEntity.java index 0381141d7..40b5c1833 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/constructordestructor/DestructorBlockEntity.java @@ -128,7 +128,7 @@ public StreamEncoder getMenuCode @Override public Component getDisplayName() { - return ContentNames.DESTRUCTOR; + return getName(ContentNames.DESTRUCTOR); } @Nullable diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerBlockEntity.java index 455822a92..436e74356 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/controller/ControllerBlockEntity.java @@ -19,6 +19,7 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; import net.minecraft.network.codec.StreamEncoder; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; @@ -95,7 +96,10 @@ public void loadAdditional(final CompoundTag tag, final HolderLookup.Provider pr @Override public Component getDisplayName() { - return type == ControllerType.CREATIVE ? ContentNames.CREATIVE_CONTROLLER : ContentNames.CONTROLLER; + final MutableComponent defaultName = type == ControllerType.CREATIVE + ? ContentNames.CREATIVE_CONTROLLER + : ContentNames.CONTROLLER; + return getName(defaultName); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorBlockEntity.java index f3e5606be..f78a38032 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/detector/DetectorBlockEntity.java @@ -151,7 +151,7 @@ public StreamEncoder getMenuCodec() { @Override public Component getDisplayName() { - return ContentNames.DETECTOR; + return getName(ContentNames.DETECTOR); } @Nullable diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/ExporterBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/ExporterBlockEntity.java index f4f69e761..7de0bd47e 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/ExporterBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/exporter/ExporterBlockEntity.java @@ -80,7 +80,7 @@ protected void setEnergyUsage(final long upgradeEnergyUsage) { @Override public Component getDisplayName() { - return ContentNames.EXPORTER; + return getName(ContentNames.EXPORTER); } @Nullable diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridBlockEntity.java index 1b00ec83d..fd5257c2c 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/CraftingGridBlockEntity.java @@ -75,7 +75,7 @@ public StreamEncoder getMenuCodec() { @Override public Component getDisplayName() { - return ContentNames.CRAFTING_GRID; + return getName(ContentNames.CRAFTING_GRID); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/GridBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/GridBlockEntity.java index 4f20e964f..32d2039b2 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/GridBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/GridBlockEntity.java @@ -32,7 +32,7 @@ public StreamEncoder getMenuCodec() { @Override public Component getDisplayName() { - return ContentNames.GRID; + return getName(ContentNames.GRID); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridExtendedMenuProvider.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridExtendedMenuProvider.java index f66f2720c..74a8eb3c1 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridExtendedMenuProvider.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridExtendedMenuProvider.java @@ -15,10 +15,17 @@ import net.minecraft.world.inventory.AbstractContainerMenu; class WirelessGridExtendedMenuProvider implements ExtendedMenuProvider { + @Nullable + private final Component name; private final Grid grid; private final SlotReference slotReference; - WirelessGridExtendedMenuProvider(final Grid grid, final SlotReference slotReference) { + WirelessGridExtendedMenuProvider( + @Nullable final Component name, + final Grid grid, + final SlotReference slotReference + ) { + this.name = name; this.grid = grid; this.slotReference = slotReference; } @@ -38,7 +45,7 @@ public StreamEncoder getMenuCodec() { @Override public Component getDisplayName() { - return ContentNames.WIRELESS_GRID; + return name == null ? ContentNames.WIRELESS_GRID : name; } @Nullable diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridItem.java index 16f203208..340059e20 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/grid/WirelessGridItem.java @@ -12,6 +12,9 @@ import com.refinedmods.refinedstorage.common.content.ContentNames; import com.refinedmods.refinedstorage.common.security.BuiltinPermission; +import javax.annotation.Nullable; + +import net.minecraft.network.chat.Component; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; @@ -33,7 +36,8 @@ public EnergyStorage createEnergyStorage(final ItemStack stack) { } @Override - protected void use(final ServerPlayer player, + protected void use(@Nullable final Component name, + final ServerPlayer player, final SlotReference slotReference, final NetworkItemContext context) { final boolean isAllowed = context.resolveNetwork() @@ -44,6 +48,7 @@ protected void use(final ServerPlayer player, return; } final Grid grid = new WirelessGrid(context); - Platform.INSTANCE.getMenuOpener().openMenu(player, new WirelessGridExtendedMenuProvider(grid, slotReference)); + final var provider = new WirelessGridExtendedMenuProvider(name, grid, slotReference); + Platform.INSTANCE.getMenuOpener().openMenu(player, provider); } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfaceBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfaceBlockEntity.java index ddb9fde06..f9422b231 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfaceBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/iface/InterfaceBlockEntity.java @@ -173,7 +173,7 @@ public StreamEncoder getMenuCodec() { @Override public Component getDisplayName() { - return ContentNames.INTERFACE; + return getName(ContentNames.INTERFACE); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/ImporterBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/ImporterBlockEntity.java index 38ee56e23..d2f922a5c 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/ImporterBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/importer/ImporterBlockEntity.java @@ -138,7 +138,7 @@ public StreamEncoder getMenuCode @Override public Component getDisplayName() { - return ContentNames.IMPORTER; + return getName(ContentNames.IMPORTER); } @Nullable diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterBlockEntity.java index 2235d07e4..131ad3861 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/NetworkTransmitterBlockEntity.java @@ -208,7 +208,7 @@ public StreamEncoder getMenuCod @Override public Component getDisplayName() { - return ContentNames.NETWORK_TRANSMITTER; + return getName(ContentNames.NETWORK_TRANSMITTER); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayBlockEntity.java index 6d8ff6b94..cacf099e2 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/RelayBlockEntity.java @@ -203,7 +203,7 @@ public StreamEncoder getMenuCode @Override public Component getDisplayName() { - return ContentNames.RELAY; + return getName(ContentNames.RELAY); } @Nullable diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterBlockEntity.java index fc9803aa0..ebc62600d 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/networking/WirelessTransmitterBlockEntity.java @@ -84,7 +84,7 @@ public boolean addUpgradeItem(final Item upgradeItem) { @Override public Component getDisplayName() { - return ContentNames.WIRELESS_TRANSMITTER; + return getName(ContentNames.WIRELESS_TRANSMITTER); } @Nullable diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/FallbackSecurityCardExtendedMenuProvider.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/FallbackSecurityCardExtendedMenuProvider.java index 6559f4408..9b9bad6f2 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/FallbackSecurityCardExtendedMenuProvider.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/FallbackSecurityCardExtendedMenuProvider.java @@ -16,12 +16,18 @@ import net.minecraft.world.inventory.AbstractContainerMenu; class FallbackSecurityCardExtendedMenuProvider extends AbstractSecurityCardExtendedMenuProvider { + @Nullable + private final Component name; private final SlotReference slotReference; - FallbackSecurityCardExtendedMenuProvider(final SlotReference slotReference, - final SecurityPolicy securityPolicy, - final Set dirtyPermissions) { + FallbackSecurityCardExtendedMenuProvider( + @Nullable final Component name, + final SlotReference slotReference, + final SecurityPolicy securityPolicy, + final Set dirtyPermissions + ) { super(securityPolicy, dirtyPermissions); + this.name = name; this.slotReference = slotReference; } @@ -37,7 +43,7 @@ public StreamEncoder getMenuCodec() { @Override public Component getDisplayName() { - return ContentNames.FALLBACK_SECURITY_CARD; + return name == null ? ContentNames.FALLBACK_SECURITY_CARD : name; } @Nullable diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/FallbackSecurityCardItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/FallbackSecurityCardItem.java index 05d452800..dc2438d8b 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/FallbackSecurityCardItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/FallbackSecurityCardItem.java @@ -10,6 +10,7 @@ import java.util.Optional; import java.util.Set; +import net.minecraft.core.component.DataComponents; import net.minecraft.network.chat.Component; import net.minecraft.server.MinecraftServer; import net.minecraft.world.inventory.tooltip.TooltipComponent; @@ -33,7 +34,12 @@ AbstractSecurityCardExtendedMenuProvider createMenuProvider( final Set dirtyPermissions, final ItemStack stack ) { - return new FallbackSecurityCardExtendedMenuProvider(slotReference, policy, dirtyPermissions); + return new FallbackSecurityCardExtendedMenuProvider( + stack.get(DataComponents.CUSTOM_NAME), + slotReference, + policy, + dirtyPermissions + ); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardExtendedMenuProvider.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardExtendedMenuProvider.java index 20c98b8a3..d79933035 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardExtendedMenuProvider.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardExtendedMenuProvider.java @@ -17,16 +17,22 @@ import net.minecraft.world.inventory.AbstractContainerMenu; class SecurityCardExtendedMenuProvider extends AbstractSecurityCardExtendedMenuProvider { + @Nullable + private final Component name; private final MinecraftServer server; private final SlotReference slotReference; private final SecurityCardBoundPlayer boundPlayer; - SecurityCardExtendedMenuProvider(final MinecraftServer server, - final SlotReference slotReference, - final SecurityPolicy securityPolicy, - final Set dirtyPermissions, - final SecurityCardBoundPlayer boundPlayer) { + SecurityCardExtendedMenuProvider( + @Nullable final Component name, + final MinecraftServer server, + final SlotReference slotReference, + final SecurityPolicy securityPolicy, + final Set dirtyPermissions, + final SecurityCardBoundPlayer boundPlayer + ) { super(securityPolicy, dirtyPermissions); + this.name = name; this.server = server; this.slotReference = slotReference; this.boundPlayer = boundPlayer; @@ -48,7 +54,7 @@ public StreamEncoder getMe @Override public Component getDisplayName() { - return ContentNames.SECURITY_CARD; + return name == null ? ContentNames.SECURITY_CARD : name; } @Nullable diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardItem.java index 2feabe88b..cb3c1bba9 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityCardItem.java @@ -78,6 +78,7 @@ AbstractSecurityCardExtendedMenuProvider createMenu final ItemStack stack ) { return new SecurityCardExtendedMenuProvider( + stack.get(net.minecraft.core.component.DataComponents.CUSTOM_NAME), server, slotReference, policy, diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityManagerBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityManagerBlockEntity.java index 0efa12921..b546d1bc5 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityManagerBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/security/SecurityManagerBlockEntity.java @@ -163,7 +163,7 @@ static boolean isValidFallbackSecurityCard(final ItemStack stack) { @Override public Component getDisplayName() { - return ContentNames.SECURITY_MANAGER; + return getName(ContentNames.SECURITY_MANAGER); } @Nullable diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/AbstractDiskDriveBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/AbstractDiskDriveBlockEntity.java index d315ff0e7..1f90f44fa 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/AbstractDiskDriveBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskdrive/AbstractDiskDriveBlockEntity.java @@ -64,7 +64,7 @@ public void writeConfiguration(final CompoundTag tag, final HolderLookup.Provide @Override public Component getDisplayName() { - return ContentNames.DISK_DRIVE; + return getName(ContentNames.DISK_DRIVE); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/AbstractDiskInterfaceBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/AbstractDiskInterfaceBlockEntity.java index 29e6cada4..666161d25 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/AbstractDiskInterfaceBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/diskinterface/AbstractDiskInterfaceBlockEntity.java @@ -137,7 +137,7 @@ public boolean addUpgradeItem(final Item upgradeItem) { @Override public Component getDisplayName() { - return ContentNames.DISK_INTERFACE; + return getName(ContentNames.DISK_INTERFACE); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageBlockEntity.java index 580c8ea61..0ff1d8cdc 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/externalstorage/ExternalStorageBlockEntity.java @@ -157,7 +157,7 @@ public StreamEncoder getMenuCode @Override public Component getDisplayName() { - return ContentNames.EXTERNAL_STORAGE; + return getName(ContentNames.EXTERNAL_STORAGE); } @Nullable diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/AbstractPortableGridBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/AbstractPortableGridBlockEntity.java index b00adf832..1e406e393 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/AbstractPortableGridBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/AbstractPortableGridBlockEntity.java @@ -29,6 +29,8 @@ import com.google.common.util.concurrent.RateLimiter; import net.minecraft.core.BlockPos; import net.minecraft.core.HolderLookup; +import net.minecraft.core.component.DataComponentMap; +import net.minecraft.core.component.DataComponents; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; import net.minecraft.network.RegistryFriendlyByteBuf; @@ -55,9 +57,12 @@ public abstract class AbstractPortableGridBlockEntity extends BlockEntity private static final String TAG_DISK_INVENTORY = "inv"; private static final String TAG_DISKS = "disks"; private static final String TAG_REDSTONE_MODE = "rm"; + private static final String TAG_CUSTOM_NAME = "CustomName"; @Nullable protected Disk disk; + @Nullable + private Component name; private final DiskInventory diskInventory; private final DiskStateChangeListener diskStateListener = new DiskStateChangeListener(this); @@ -169,6 +174,9 @@ public void readConfiguration(final CompoundTag tag, final HolderLookup.Provider if (tag.contains(TAG_REDSTONE_MODE)) { redstoneMode = RedstoneModeSettings.getRedstoneMode(tag.getInt(TAG_REDSTONE_MODE)); } + if (tag.contains(TAG_CUSTOM_NAME, Tag.TAG_STRING)) { + this.name = parseCustomNameSafe(tag.getString(TAG_CUSTOM_NAME), provider); + } } private void fromClientTag(final CompoundTag tag) { @@ -194,6 +202,21 @@ public void saveAdditional(final CompoundTag tag, final HolderLookup.Provider pr @Override public void writeConfiguration(final CompoundTag tag, final HolderLookup.Provider provider) { tag.putInt(TAG_REDSTONE_MODE, RedstoneModeSettings.getRedstoneMode(redstoneMode)); + if (name != null) { + tag.putString(TAG_CUSTOM_NAME, Component.Serializer.toJson(name, provider)); + } + } + + @Override + protected void applyImplicitComponents(final BlockEntity.DataComponentInput componentInput) { + super.applyImplicitComponents(componentInput); + this.name = componentInput.get(DataComponents.CUSTOM_NAME); + } + + @Override + protected void collectImplicitComponents(final DataComponentMap.Builder components) { + super.collectImplicitComponents(components); + components.set(DataComponents.CUSTOM_NAME, name); } @Override @@ -219,7 +242,7 @@ public void setRedstoneMode(final RedstoneMode redstoneMode) { @Override public Component getDisplayName() { - return ContentNames.PORTABLE_GRID; + return name == null ? ContentNames.PORTABLE_GRID : name; } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridBlockItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridBlockItem.java index 5ce20f07b..3c0bd225a 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridBlockItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridBlockItem.java @@ -139,6 +139,7 @@ public void use(final ServerPlayer player, final ItemStack stack, final SlotRefe energyStorage.portableGrid = portableGrid; portableGrid.updateStorage(); Platform.INSTANCE.getMenuOpener().openMenu(player, new PortableGridItemExtendedMenuProvider( + stack.get(DataComponents.CUSTOM_NAME), portableGrid, energyStorage, diskInventory, diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridItemExtendedMenuProvider.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridItemExtendedMenuProvider.java index 362cb3939..89f6c70d7 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridItemExtendedMenuProvider.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/portablegrid/PortableGridItemExtendedMenuProvider.java @@ -20,15 +20,21 @@ import net.minecraft.world.inventory.AbstractContainerMenu; class PortableGridItemExtendedMenuProvider implements ExtendedMenuProvider { + @Nullable + private final Component name; private final Grid grid; private final EnergyStorage energyStorage; private final DiskInventory diskInventory; private final SlotReference slotReference; - PortableGridItemExtendedMenuProvider(final Grid grid, - final EnergyStorage energyStorage, - final DiskInventory diskInventory, - final SlotReference slotReference) { + PortableGridItemExtendedMenuProvider( + @Nullable final Component name, + final Grid grid, + final EnergyStorage energyStorage, + final DiskInventory diskInventory, + final SlotReference slotReference + ) { + this.name = name; this.grid = grid; this.energyStorage = energyStorage; this.diskInventory = diskInventory; @@ -52,7 +58,7 @@ public StreamEncoder getMenuCodec() { @Override public Component getDisplayName() { - return ContentNames.PORTABLE_GRID; + return name == null ? ContentNames.PORTABLE_GRID : name; } @Nullable diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockEntity.java index 68cb63b5c..33034dbf4 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/FluidStorageBlockBlockEntity.java @@ -55,7 +55,7 @@ protected SerializableStorage createStorage(final Runnable listener) { @Override public Component getDisplayName() { - return displayName; + return getName(displayName); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockBlockEntity.java index 55409495d..8f6147b83 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storage/storageblock/ItemStorageBlockBlockEntity.java @@ -51,7 +51,7 @@ protected SerializableStorage createStorage(final Runnable listener) { @Override public Component getDisplayName() { - return displayName; + return getName(displayName); } @Override diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorBlockEntity.java index 052685ee9..3d7d2700b 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/storagemonitor/StorageMonitorBlockEntity.java @@ -295,7 +295,7 @@ public StreamEncoder getMenuCode @Override public Component getDisplayName() { - return ContentNames.STORAGE_MONITOR; + return getName(ContentNames.STORAGE_MONITOR); } @Nullable diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/AbstractRedstoneModeNetworkNodeContainerBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/AbstractRedstoneModeNetworkNodeContainerBlockEntity.java index 10a83f4e3..941729598 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/AbstractRedstoneModeNetworkNodeContainerBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/AbstractRedstoneModeNetworkNodeContainerBlockEntity.java @@ -2,7 +2,6 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.common.Platform; -import com.refinedmods.refinedstorage.common.api.configurationcard.ConfigurationCardTarget; import com.refinedmods.refinedstorage.common.support.PlayerAwareBlockEntity; import com.refinedmods.refinedstorage.common.support.RedstoneMode; import com.refinedmods.refinedstorage.common.support.RedstoneModeSettings; @@ -20,7 +19,7 @@ import net.minecraft.world.level.block.state.BlockState; public abstract class AbstractRedstoneModeNetworkNodeContainerBlockEntity - extends BaseNetworkNodeContainerBlockEntity implements PlayerAwareBlockEntity, ConfigurationCardTarget { + extends BaseNetworkNodeContainerBlockEntity implements PlayerAwareBlockEntity { private static final String TAG_REDSTONE_MODE = "rm"; private static final String TAG_PLACED_BY_PLAYER_ID = "pbpid"; @@ -45,7 +44,6 @@ protected boolean calculateActive() { @Override public void saveAdditional(final CompoundTag tag, final HolderLookup.Provider provider) { super.saveAdditional(tag, provider); - writeConfiguration(tag, provider); if (placedByPlayerId != null) { tag.putUUID(TAG_PLACED_BY_PLAYER_ID, placedByPlayerId); } @@ -53,13 +51,13 @@ public void saveAdditional(final CompoundTag tag, final HolderLookup.Provider pr @Override public void writeConfiguration(final CompoundTag tag, final HolderLookup.Provider provider) { + super.writeConfiguration(tag, provider); tag.putInt(TAG_REDSTONE_MODE, RedstoneModeSettings.getRedstoneMode(getRedstoneMode())); } @Override public void loadAdditional(final CompoundTag tag, final HolderLookup.Provider provider) { super.loadAdditional(tag, provider); - readConfiguration(tag, provider); if (tag.hasUUID(TAG_PLACED_BY_PLAYER_ID)) { placedByPlayerId = tag.getUUID(TAG_PLACED_BY_PLAYER_ID); } @@ -67,6 +65,7 @@ public void loadAdditional(final CompoundTag tag, final HolderLookup.Provider pr @Override public void readConfiguration(final CompoundTag tag, final HolderLookup.Provider provider) { + super.readConfiguration(tag, provider); if (tag.contains(TAG_REDSTONE_MODE)) { redstoneMode = RedstoneModeSettings.getRedstoneMode(tag.getInt(TAG_REDSTONE_MODE)); } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/BaseNetworkNodeContainerBlockEntity.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/BaseNetworkNodeContainerBlockEntity.java index 1149a0177..b58d133d1 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/BaseNetworkNodeContainerBlockEntity.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/support/network/BaseNetworkNodeContainerBlockEntity.java @@ -4,6 +4,7 @@ import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent; import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.common.api.RefinedStorageApi; +import com.refinedmods.refinedstorage.common.api.configurationcard.ConfigurationCardTarget; import com.refinedmods.refinedstorage.common.api.support.network.AbstractNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage.common.api.support.network.InWorldNetworkNodeContainer; import com.refinedmods.refinedstorage.common.api.support.network.item.NetworkItemTargetBlockEntity; @@ -12,6 +13,13 @@ import com.google.common.util.concurrent.RateLimiter; import net.minecraft.core.BlockPos; +import net.minecraft.core.HolderLookup; +import net.minecraft.core.component.DataComponentMap; +import net.minecraft.core.component.DataComponents; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.Tag; +import net.minecraft.network.chat.Component; +import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.properties.BooleanProperty; @@ -19,11 +27,16 @@ import org.slf4j.LoggerFactory; public class BaseNetworkNodeContainerBlockEntity - extends AbstractNetworkNodeContainerBlockEntity implements NetworkItemTargetBlockEntity { + extends AbstractNetworkNodeContainerBlockEntity + implements NetworkItemTargetBlockEntity, ConfigurationCardTarget { + private static final String TAG_CUSTOM_NAME = "CustomName"; private static final Logger LOGGER = LoggerFactory.getLogger(BaseNetworkNodeContainerBlockEntity.class); private final RateLimiter activenessChangeRateLimiter = RateLimiter.create(1); + @Nullable + private Component name; + public BaseNetworkNodeContainerBlockEntity(final BlockEntityType type, final BlockPos pos, final BlockState state, @@ -113,4 +126,46 @@ public void setBlockState(final BlockState newBlockState) { public Network getNetworkForItem() { return mainNetworkNode.getNetwork(); } + + @Override + public void saveAdditional(final CompoundTag tag, final HolderLookup.Provider provider) { + super.saveAdditional(tag, provider); + writeConfiguration(tag, provider); + } + + @Override + public void loadAdditional(final CompoundTag tag, final HolderLookup.Provider provider) { + super.loadAdditional(tag, provider); + readConfiguration(tag, provider); + } + + @Override + public void writeConfiguration(final CompoundTag tag, final HolderLookup.Provider provider) { + if (name != null) { + tag.putString(TAG_CUSTOM_NAME, Component.Serializer.toJson(name, provider)); + } + } + + @Override + public void readConfiguration(final CompoundTag tag, final HolderLookup.Provider provider) { + if (tag.contains(TAG_CUSTOM_NAME, Tag.TAG_STRING)) { + this.name = parseCustomNameSafe(tag.getString(TAG_CUSTOM_NAME), provider); + } + } + + @Override + protected void applyImplicitComponents(final BlockEntity.DataComponentInput componentInput) { + super.applyImplicitComponents(componentInput); + this.name = componentInput.get(DataComponents.CUSTOM_NAME); + } + + @Override + protected void collectImplicitComponents(final DataComponentMap.Builder components) { + super.collectImplicitComponents(components); + components.set(DataComponents.CUSTOM_NAME, name); + } + + protected final Component getName(final Component defaultName) { + return name == null ? defaultName : name; + } } diff --git a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/RegulatorUpgradeItem.java b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/RegulatorUpgradeItem.java index 8f93f191f..64987928b 100644 --- a/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/RegulatorUpgradeItem.java +++ b/refinedstorage-common/src/main/java/com/refinedmods/refinedstorage/common/upgrade/RegulatorUpgradeItem.java @@ -53,6 +53,7 @@ public InteractionResultHolder use(final Level level, final Player pl RegulatorUpgradeState.EMPTY ); Platform.INSTANCE.getMenuOpener().openMenu(serverPlayer, new ExtendedMenuProviderImpl( + stack.get(net.minecraft.core.component.DataComponents.CUSTOM_NAME), createResourceFilterContainer(stack, initialState), initialState.amount(), newAmount -> setAmount(stack, newAmount), @@ -130,7 +131,8 @@ public record RegulatorTooltipComponent(Component helpText, @Nullable ResourceAm implements TooltipComponent { } - private record ExtendedMenuProviderImpl(ResourceContainer resourceContainer, + private record ExtendedMenuProviderImpl(@Nullable Component name, + ResourceContainer resourceContainer, double amount, Consumer amountAcceptor, SlotReference slotReference) @@ -151,7 +153,7 @@ public StreamEncoder getMenuCodec() { @Override public Component getDisplayName() { - return ContentNames.REGULATOR_UPGRADE; + return name == null ? ContentNames.REGULATOR_UPGRADE : name; } @Override diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/1024b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/1024b_fluid_storage_block.json index e1249ca23..ff654b764 100644 --- a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/1024b_fluid_storage_block.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/1024b_fluid_storage_block.json @@ -6,12 +6,19 @@ "entries": [ { "type": "minecraft:item", - "name": "refinedstorage:1024b_fluid_storage_block", "functions": [ { "function": "refinedstorage:storage_block" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } - ] + ], + "name": "refinedstorage:1024b_fluid_storage_block" } ] } diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/16k_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/16k_storage_block.json index f1382ec5f..2d2244772 100644 --- a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/16k_storage_block.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/16k_storage_block.json @@ -6,13 +6,20 @@ "entries": [ { "type": "minecraft:item", + "functions": [ + { + "function": "refinedstorage:storage_block" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "name": "refinedstorage:16k_storage_block" } - ], - "functions": [ - { - "function": "refinedstorage:storage_block" - } ] } ] diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/1k_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/1k_storage_block.json index a29c5192d..108660613 100644 --- a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/1k_storage_block.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/1k_storage_block.json @@ -6,13 +6,20 @@ "entries": [ { "type": "minecraft:item", + "functions": [ + { + "function": "refinedstorage:storage_block" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "name": "refinedstorage:1k_storage_block" } - ], - "functions": [ - { - "function": "refinedstorage:storage_block" - } ] } ] diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/256b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/256b_fluid_storage_block.json index a5424a30f..1dc789be1 100644 --- a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/256b_fluid_storage_block.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/256b_fluid_storage_block.json @@ -6,12 +6,19 @@ "entries": [ { "type": "minecraft:item", - "name": "refinedstorage:256b_fluid_storage_block", "functions": [ { "function": "refinedstorage:storage_block" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } - ] + ], + "name": "refinedstorage:256b_fluid_storage_block" } ] } diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/4096b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/4096b_fluid_storage_block.json index 2ff734543..37f043124 100644 --- a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/4096b_fluid_storage_block.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/4096b_fluid_storage_block.json @@ -6,12 +6,19 @@ "entries": [ { "type": "minecraft:item", - "name": "refinedstorage:4096b_fluid_storage_block", "functions": [ { "function": "refinedstorage:storage_block" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } - ] + ], + "name": "refinedstorage:4096b_fluid_storage_block" } ] } diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/4k_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/4k_storage_block.json index c30f61de3..d11a6a1ce 100644 --- a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/4k_storage_block.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/4k_storage_block.json @@ -6,13 +6,20 @@ "entries": [ { "type": "minecraft:item", + "functions": [ + { + "function": "refinedstorage:storage_block" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "name": "refinedstorage:4k_storage_block" } - ], - "functions": [ - { - "function": "refinedstorage:storage_block" - } ] } ] diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/64b_fluid_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/64b_fluid_storage_block.json index 3912817f5..d66c49028 100644 --- a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/64b_fluid_storage_block.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/64b_fluid_storage_block.json @@ -6,12 +6,19 @@ "entries": [ { "type": "minecraft:item", - "name": "refinedstorage:64b_fluid_storage_block", "functions": [ { "function": "refinedstorage:storage_block" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } - ] + ], + "name": "refinedstorage:64b_fluid_storage_block" } ] } diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/64k_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/64k_storage_block.json index aa8bbd677..2933388f5 100644 --- a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/64k_storage_block.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/64k_storage_block.json @@ -6,13 +6,20 @@ "entries": [ { "type": "minecraft:item", + "functions": [ + { + "function": "refinedstorage:storage_block" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "name": "refinedstorage:64k_storage_block" } - ], - "functions": [ - { - "function": "refinedstorage:storage_block" - } ] } ] diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_fluid_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_fluid_storage_block.json index 829e9de35..821d302aa 100644 --- a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_fluid_storage_block.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_fluid_storage_block.json @@ -6,12 +6,19 @@ "entries": [ { "type": "minecraft:item", - "name": "refinedstorage:creative_fluid_storage_block", "functions": [ { "function": "refinedstorage:storage_block" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } - ] + ], + "name": "refinedstorage:creative_fluid_storage_block" } ] } diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_portable_grid.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_portable_grid.json index 8847a0627..522276677 100644 --- a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_portable_grid.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_portable_grid.json @@ -6,12 +6,19 @@ "entries": [ { "type": "minecraft:item", - "name": "refinedstorage:creative_portable_grid", "functions": [ { "function": "refinedstorage:portable_grid" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } - ] + ], + "name": "refinedstorage:creative_portable_grid" } ] } diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_storage_block.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_storage_block.json index 1472b7692..f0a6e5c36 100644 --- a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_storage_block.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/creative_storage_block.json @@ -6,6 +6,15 @@ "entries": [ { "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "name": "refinedstorage:creative_storage_block" } ], diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/disk_drive.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/disk_drive.json index 99c8c6f34..36e190a89 100644 --- a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/disk_drive.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/disk_drive.json @@ -6,6 +6,15 @@ "entries": [ { "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "name": "refinedstorage:disk_drive" } ], diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/exporter.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/exporter.json index b27651dc7..dd36f78e9 100644 --- a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/exporter.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/exporter.json @@ -6,6 +6,15 @@ "entries": [ { "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "name": "refinedstorage:exporter" } ], diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/external_storage.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/external_storage.json index 3b8bb9058..51ba468e4 100644 --- a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/external_storage.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/external_storage.json @@ -6,6 +6,15 @@ "entries": [ { "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "name": "refinedstorage:external_storage" } ], diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/importer.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/importer.json index 0b7e38e4f..ed6ba2686 100644 --- a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/importer.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/importer.json @@ -6,6 +6,15 @@ "entries": [ { "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "name": "refinedstorage:importer" } ], diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/interface.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/interface.json index 123a5f704..b87c07cbd 100644 --- a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/interface.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/interface.json @@ -6,6 +6,15 @@ "entries": [ { "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "name": "refinedstorage:interface" } ], diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/portable_grid.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/portable_grid.json index 3970f8e98..83b268878 100644 --- a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/portable_grid.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/portable_grid.json @@ -6,12 +6,19 @@ "entries": [ { "type": "minecraft:item", - "name": "refinedstorage:portable_grid", "functions": [ { "function": "refinedstorage:portable_grid" + }, + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" } - ] + ], + "name": "refinedstorage:portable_grid" } ] } diff --git a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/storage_monitor.json b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/storage_monitor.json index 6e79b8f3c..2d589a4bb 100644 --- a/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/storage_monitor.json +++ b/refinedstorage-common/src/main/resources/data/refinedstorage/loot_table/blocks/storage_monitor.json @@ -6,6 +6,15 @@ "entries": [ { "type": "minecraft:item", + "functions": [ + { + "function": "minecraft:copy_components", + "include": [ + "minecraft:custom_name" + ], + "source": "block_entity" + } + ], "name": "refinedstorage:storage_monitor" } ], diff --git a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/loot/BlockDropProvider.java b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/loot/BlockDropProvider.java index 801c31c73..ebff81162 100644 --- a/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/loot/BlockDropProvider.java +++ b/refinedstorage-neoforge/src/main/java/com/refinedmods/refinedstorage/neoforge/datagen/loot/BlockDropProvider.java @@ -8,9 +8,11 @@ import java.util.Set; import net.minecraft.core.HolderLookup; +import net.minecraft.core.component.DataComponents; import net.minecraft.data.loot.BlockLootSubProvider; import net.minecraft.world.flag.FeatureFlags; import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.storage.loot.functions.CopyComponentsFunction; public class BlockDropProvider extends BlockLootSubProvider { public BlockDropProvider(final HolderLookup.Provider provider) { @@ -19,24 +21,36 @@ public BlockDropProvider(final HolderLookup.Provider provider) { @Override protected void generate() { - Blocks.INSTANCE.getCable().forEach((color, id, block) -> dropSelf(block.get())); - Blocks.INSTANCE.getGrid().forEach((color, id, block) -> dropSelf(block.get())); - Blocks.INSTANCE.getCraftingGrid().forEach((color, id, block) -> dropSelf(block.get())); - Blocks.INSTANCE.getPatternGrid().forEach((color, id, block) -> dropSelf(block.get())); + Blocks.INSTANCE.getCable().forEach((color, id, block) -> drop(block.get())); + Blocks.INSTANCE.getGrid().forEach((color, id, block) -> drop(block.get())); + Blocks.INSTANCE.getCraftingGrid().forEach((color, id, block) -> drop(block.get())); + Blocks.INSTANCE.getPatternGrid().forEach((color, id, block) -> drop(block.get())); Blocks.INSTANCE.getController().forEach((color, id, block) -> add( block.get(), - createSingleItemTable(block.get()).apply(EnergyLootItemFunction::new) + createSingleItemTable(block.get()) + .apply(EnergyLootItemFunction::new) + .apply(copyName()) )); - Blocks.INSTANCE.getCreativeController().forEach((color, id, block) -> dropSelf(block.get())); - Blocks.INSTANCE.getDetector().forEach((color, id, block) -> dropSelf(block.get())); - Blocks.INSTANCE.getConstructor().forEach((color, id, block) -> dropSelf(block.get())); - Blocks.INSTANCE.getDestructor().forEach((color, id, block) -> dropSelf(block.get())); - Blocks.INSTANCE.getWirelessTransmitter().forEach((color, id, block) -> dropSelf(block.get())); - Blocks.INSTANCE.getNetworkReceiver().forEach((color, id, block) -> dropSelf(block.get())); - Blocks.INSTANCE.getNetworkTransmitter().forEach((color, id, block) -> dropSelf(block.get())); - Blocks.INSTANCE.getSecurityManager().forEach((color, id, block) -> dropSelf(block.get())); - Blocks.INSTANCE.getRelay().forEach((color, id, block) -> dropSelf(block.get())); - Blocks.INSTANCE.getDiskInterface().forEach((color, id, block) -> dropSelf(block.get())); + Blocks.INSTANCE.getCreativeController().forEach((color, id, block) -> drop(block.get())); + Blocks.INSTANCE.getDetector().forEach((color, id, block) -> drop(block.get())); + Blocks.INSTANCE.getConstructor().forEach((color, id, block) -> drop(block.get())); + Blocks.INSTANCE.getDestructor().forEach((color, id, block) -> drop(block.get())); + Blocks.INSTANCE.getWirelessTransmitter().forEach((color, id, block) -> drop(block.get())); + Blocks.INSTANCE.getNetworkReceiver().forEach((color, id, block) -> drop(block.get())); + Blocks.INSTANCE.getNetworkTransmitter().forEach((color, id, block) -> drop(block.get())); + Blocks.INSTANCE.getSecurityManager().forEach((color, id, block) -> drop(block.get())); + Blocks.INSTANCE.getRelay().forEach((color, id, block) -> drop(block.get())); + Blocks.INSTANCE.getDiskInterface().forEach((color, id, block) -> drop(block.get())); + } + + private void drop(final Block block) { + add(block, createSingleItemTable(block) + .apply(copyName())); + } + + private static CopyComponentsFunction.Builder copyName() { + return CopyComponentsFunction.copyComponents(CopyComponentsFunction.Source.BLOCK_ENTITY) + .include(DataComponents.CUSTOM_NAME); } @Override From fcd24af32496a5d0e59b72c8b0b695ae19ab49ea Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 11 Aug 2024 15:22:43 +0000 Subject: [PATCH 20/20] chore: prepare release v2.0.0-milestone.4.7 --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a18012a9d..1d316c5e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [2.0.0-milestone.4.7] - 2024-08-11 + ### Added - You can now upgrade Storage Disks and Storage Blocks to a higher tier by combining with a higher tier Storage Part. The original Storage Part will be returned. @@ -735,7 +737,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - The Grid can now use smooth scrolling. - The Grid now has syntax highlighting for the search query. -[Unreleased]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.4.6...HEAD +[Unreleased]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.4.7...HEAD + +[2.0.0-milestone.4.7]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.4.6...v2.0.0-milestone.4.7 [2.0.0-milestone.4.6]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.4.5...v2.0.0-milestone.4.6