From 6fd001dc20049f411dd01681bdc53e044dd5ad38 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sat, 6 Jul 2024 21:13:00 +0200 Subject: [PATCH 1/4] fix: relay model not loading correctly --- .gitignore | 1 + CHANGELOG.md | 4 ++++ .../textures/block/relay/cutouts/.gitignore | 1 + .../textures/block/relay/cutouts/out/black.png | Bin 0 -> 2958 bytes .../textures/block/relay/cutouts/out/blue.png | Bin 0 -> 2957 bytes .../textures/block/relay/cutouts/out/brown.png | Bin 0 -> 2975 bytes .../textures/block/relay/cutouts/out/cyan.png | Bin 0 -> 2985 bytes .../textures/block/relay/cutouts/out/gray.png | Bin 0 -> 2968 bytes .../textures/block/relay/cutouts/out/green.png | Bin 0 -> 2978 bytes .../block/relay/cutouts/out/inactive.png | Bin 0 -> 268 bytes .../block/relay/cutouts/out/light_blue.png | Bin 0 -> 338 bytes .../block/relay/cutouts/out/light_gray.png | Bin 0 -> 2956 bytes .../textures/block/relay/cutouts/out/lime.png | Bin 0 -> 2974 bytes .../textures/block/relay/cutouts/out/magenta.png | Bin 0 -> 2968 bytes .../textures/block/relay/cutouts/out/orange.png | Bin 0 -> 2955 bytes .../textures/block/relay/cutouts/out/pink.png | Bin 0 -> 2930 bytes .../textures/block/relay/cutouts/out/purple.png | Bin 0 -> 2988 bytes .../textures/block/relay/cutouts/out/red.png | Bin 0 -> 2961 bytes .../textures/block/relay/cutouts/out/white.png | Bin 0 -> 2929 bytes .../textures/block/relay/cutouts/out/yellow.png | Bin 0 -> 2955 bytes refinedstorage-platform-fabric/.gitignore | 1 - refinedstorage-platform-neoforge/.gitignore | 1 - 22 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/.gitignore create mode 100644 refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/black.png create mode 100644 refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/blue.png create mode 100644 refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/brown.png create mode 100644 refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/cyan.png create mode 100644 refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/gray.png create mode 100644 refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/green.png create mode 100644 refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/inactive.png create mode 100644 refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/light_blue.png create mode 100644 refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/light_gray.png create mode 100644 refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/lime.png create mode 100644 refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/magenta.png create mode 100644 refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/orange.png create mode 100644 refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/pink.png create mode 100644 refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/purple.png create mode 100644 refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/red.png create mode 100644 refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/white.png create mode 100644 refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/yellow.png delete mode 100644 refinedstorage-platform-fabric/.gitignore delete mode 100644 refinedstorage-platform-neoforge/.gitignore diff --git a/.gitignore b/.gitignore index 0521ad558..766ed11d8 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ out/ /bin/ logs/ .cache/ +run/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 54f138daa..e696c37e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed + +- Fixed Relay model not being able to load correctly. + ## [2.0.0-milestone.4.2] - 2024-07-06 ## [2.0.0-milestone.4.1] - 2024-07-05 diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/.gitignore b/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/.gitignore new file mode 100644 index 000000000..2664d9bf9 --- /dev/null +++ b/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/.gitignore @@ -0,0 +1 @@ +!out/ \ No newline at end of file diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/black.png b/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/black.png new file mode 100644 index 0000000000000000000000000000000000000000..58f7b9244574ba293514af24307de57ddf5cd24a GIT binary patch literal 2958 zcmcImON<^`B>@wH5rTvOK`|y?xDY&u5fkLV$%Ao?5)Q^h4kl{i1*1l*=C!l3%WhCQ=~w+< z{g1Ey|F1gK-?w>r*P5X7ojkQV zmFgPti>0Jg*kWT^Nh6m!Bwee744q1?-%tw?-b)g}AwzzU6@R&OSrmLXEAG?_un_i; zVZV1GBHJhWig;o#wp?+;^TPU?%@kBff`nS79K?1lE7tYe?3)iuqELq)8XjO-)}8^leT7-3Qkg_4|xJfu3%#cf+LmK+GC-!Nna6YnZ%+<~X+q;+ItvMH@iZzD z-*{nb2aVzuAQ-rjDfTaP%L5r%g_jLT%7<}u^i}O&%-Ki z&CgLh%9D!EZ`7AdG1Jjr4I4YifHKQ>NK^CW$P+gONjH}7Ok{$lgT}#zu)pQt#Q+9i3nMMWbGR{>|;Hzyj^~_bo z>nkhD&A}2+)$(X#&{QD1B$+>(^1(UeQ{o+g&nQ+zf#-`|x4)gWF6Mxt>#E)y@Aqq@ zT*~>3wYcGk(J2|6F5#VwSE$|V$1LZ@o4sZ`8EJl%eW6~IHo}b%FwaiHC~XY;Gc54@ zsBFxy4iiS!9kR9oi>a4XQAE0j7{hZ`g*2P$0iIP&NqgES5t$(I9YC-2_I) z!VXjwLS(ZQ`t7c(wyfET+NzAIfQ4p(OvZq~ z#G08QD5D{h%oNOw4dEUKgK02EqK?E0QH0n=N}@O`dJ(M%C=AO!u2+{d7P!s*sa=pl zLWQaJGb?E>iTsWn=(N&yLHHl-&6#oY>xQ=%%ROEsi60OeZ9w{WhiLrg8cc5DYg6BN z?U{PPd~=ZP#5QZ~b2NKbwy@!tIzX1;09ohdiF6Af)l*d6Fm&u8p3z(z{jbfQ=TM!7 zj&oCMh#kiGXZsY$e%j|q60o|B*eTH|JjYI!@Zsv=t4xats z$k7$S5&YeP{Ib)v(qr3>f3$A0dg;QE(|?^k`1z`_RBB}3pIx^;lg`{+pe~FT4j%vE z*TOre9^Wq?8z?<`;KYYZ3SaGe>a`*~FuCU9K8l{Y@!A?z8P zbe24H=%-I!y+8L#>B5R#-*oS|G0{D^`@PEbYulD1&;4=t+c)36dTr~mfm;ukzrTFn z^^dQPoci|XzVp$_Mb7HQxkaP9UOahb^B-@%^yTjleqnF9MxQ*8@Dp=>V_)w43w!qe E1H2W(BLDyZ literal 0 HcmV?d00001 diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/blue.png b/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/blue.png new file mode 100644 index 0000000000000000000000000000000000000000..00d6eb6f0d72f5bd66c1cebbeaae760a55bc9827 GIT binary patch literal 2957 zcmcguTWl3Y7(Nh0tzsY`UZQbb3}Rr;?(BUx9Bw^8YkIILhfov)vpcgrE9dMkyW94( zQ67jS@_^B3Vl48gkU)%>_=1Az15YL;Dj^zTG@2+X2ti^bKIqK3Y)_@7ji{UKZRVT* z|L2?U|7Z4hZ`wGo?ZLK8CNrc^VxmJT>5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I9Qfe1uiEymnZNJMg^_p2eG3-l zlP}L-J9e`0#)3ub=Hs76E@{tR+c;wPetqfULt|raKI(2*I49Hf!zb%TA0GJPfok{F zyTQHR7CNr$M^9f|dS(A(FLnH4YtJlwy}0jt{dV%6+tagU&*+h3=f2TrAL_jP^RkbQ zp9${i+IV*H@#ha7I`v1i^SXBB^s4RBffZdlW*4o2o$DbP>+j`=+CqKWo{OR57 Pz}&fhQ~up`JNNztzaY!8 literal 0 HcmV?d00001 diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/brown.png b/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/brown.png new file mode 100644 index 0000000000000000000000000000000000000000..63204a3af3edf0e1a72070136d08ff2a352fd4e3 GIT binary patch literal 2975 zcmcImU2GIp6kg>g3RaCoKwcaNqN3iNx${30)>^v77P?s4MM@&b-8*;M3A;1Xnc41^ z2NHkyRbKFcgkZ#AFiJFFOhhFj3C0KUNn%VuNfdoR4GAPDyx_h2*R8a)L78O!?)mOH z-#Pc3bMKCxmCv@!S}-e-NVIfyrhDo8eszr(-9hKtD3O>whuwE1_U@aX zNX!~?v;A>@rrW}PA&G21N0Q}2K+%cBlGbv7@J14IIWpjSDgNT;$9c}RQ~Vk=BW8kj zGU#@03Q6Clm07%LBQ|Zm^=WQN*`f*xBt~4hkoO|1oZ>5bE&9!d1)i%w;*BZ3jTz+n zGd*0p9}-SWiU5nE#OY=dYKo$XPjQkciGrvKPy$f1M8$$SSG#y>Ewml0H@&Q8i~gnf z!8i^qK`50<$&#G(!vO)BrYVS$AW48CKs4gTs0_SlVO>L-L^yPV*!4Y*X+$}{7^is3 zwCX}3XsGp~T9|0Sgfa>Qm=u{y6`+k9xS$y3E5>askUS|6FODb{Hn22GnM?yduG&JO zfsW#iVallH+qmc`I}#9~mqdOs#H3@GT3lEs7R9|}G&EC~PT`Ho!Jr@e(V#y;5E|k! zp@>~)0)tF421?5A1W+bvKm)5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ZPZT`@SscKM7*er*$c00X-7i2uba;}O3Uu}!2XRab% zUnvpR2ZuOS3*)uHgd(#`g8W&R4=*8~6+h}aEX9f_aK2bo`-7}?F$WA?SM~aMzf+-w zp|r!Y7Shndq#fhyfIWbwH@50uv<& zQ0$y(+PaOPX)hGaf(_v&2ZKGgM1wiR@=<`;MoNP)CFTOJC?MZ2IJjC}QpqLt{i#`y zLgWdv?Pt-X5gIsiI55{r(*@yww6`SVme&pc&A6MqND@CF)Y^db&kj-hPuDWp#n+~~ z@mdS@g5`3M?Zg&q?MpO!0!?h#2^}EQumRM0c_Q5eNX;p#ZWubwAB)n~-+QXRC1AI(p1r&r&9=451V8adK8GdOeT)#o-&A-M9Mjz7No^P?^8*IwH^ Y6Yu@x@`X2c@>6uruD0#LT=By}Z;C1rt33 zJtM=93Yk-ZifTMv978PpmrlIM)u6!R`d3W!%K!fdu6BwkPA~dekR^BX!0wc^{S$<| zG_O@}zcwrI{P(^oe&>E}lw8uIkjkQ|EHi(5xfaLt|D_!~E4SW~NY+2kxTgEa%J2jR z+biuqKC!%?I9(8;RQ6EQ&HEFDI69X^PJbVx_|$5eS$gjEy}cXdnt<+L@O1TaS?83{ F1OQ&3VJ!dv literal 0 HcmV?d00001 diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/light_blue.png b/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/light_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..a6b017a448d929aeef6bdaa460b18898cd60d3cc GIT binary patch literal 338 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33 zJwr2>%=KS^iVk_YIEGmGC;#~W-`-VXwE~Cx{J)>-&;5P>|FwSo|M`WFlmj?+Tdip_ z$l3PnRsHs@<_$h?J}LBsP7r}%9<`$Lb<9CGL?0Y_nXXWEV9p!k`2V}t>|+yCU}MkU z_qG1r-}??~R~lA+um8LKZUwiF15a60{p0$Br7Fyi^lI3PJq{*{*D+~ku_~zo9iR!s zJl6TU{@$;?TdE+u+lC`ql;vTE_x}IKV}E_!|N7bb|1+Q0F|=-2eOSxG=HGb+2Ag&N VvzjXwDFc1O;OXk;vd$@?2>>j9g(3g| literal 0 HcmV?d00001 diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/light_gray.png b/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/light_gray.png new file mode 100644 index 0000000000000000000000000000000000000000..fca72ba2ef01f6cb84d45a9d2456ef5790cde5fb GIT binary patch literal 2956 zcmcImTWl0n7+w+~wMZhO1`Nh=@S!MY=RUJDVS(B$bk!}TEMZF^a^{>f-AQ+6rZdy- zwu%OVMDg}uGz1JWk@yA=MvO=d-i^d~eZa&Jq9z)H#tUygi0ACBTWx8BGRfS|`Og3U z=R4p3pYy~(|E49Kw{<2Gi6z;-%piT=$nK6s^m)gn%aFdV5Bi3pL}KwWb}vXAesOss z(K+ho3vnU$fQ9^W5@O#b$!a;E=tN@e`f32t2#GnH47*;M|Mm14o^x@U->&7vT+l;` zZr@}`wodlv(c}m+F~5Etx3+3g17#9Ju39d6kyTCeHM+wUv=}8eFQIt8uOiH?{>f#zs7G+ToH9?Yrq+6nDNe0)rciw$kWAAQL|Kq!KoKCC@M2g6UbL!dAwwb*x**~+aHV5JdLzI zg>uj`>qQNkC}Bbs27;6n*_3KPj9R#0EG*TWVz2ns5s%BtOJV>Ufna6MnZw(HLe(Xm@e-;v2-P5Ru zU1t`DtY;dORNYyitfvJHte%j-*bno*UutS+pcxw{OG%mQ+U|PTuSBca#2W)h2F4`K zGa&&n1r#wa%a$lvnskpyKg2pTN2Q5j4BNpb#ph+wl66bbrh$FzIumn3F|r&#EJM0* zZW#^}A@GK4-f}rB>qRm25XolJJPkGJy4ccf!06j*eBM zIX>f~F(xWDzMfy$N7P1ZH7tlEU6TwENVcv5l2RRD8nz8&TZfvVI?%*+)7s|Hr6~?e z?N(V-m|Ap5N>>oJfr1SJQdpIMDcS6yVN+2h#jq)dQ+|8=k{{-LOgUG0j;*#u&C^gJ z%da#qH5v;{s->}dqalm*5+wF)^bgI^Kh?d>b1B6#&oRANHUC>_>7oJXnx<%t_5rs_ zN`;I|S&Qm{=l;JtELYOW12##MlbjeU9QPK%;OhpG8QAJ=YngR5b ziEL4k36ZEaXA51iB-N6YW)59V=ndPb2)$uKHz9$)`pKja)diy4fuU+9a5U8bP&HLx z=$cJL?8qqyXPV561>qV`2KnAN3EPAfz!1`nl!Q^5cS66+!5}EPsFq#AxQ842Q!634 z*ypCo&#a_j61r^~X!p_zf%_l*&8fKgRl|QP?iw$WzzzuYG9di3Le&2=btX5mwW)2q z)=afvz8a)Eu|-S!9K{|>Cem#~1JKlMAZaW;A=Nfi99hwHT|-Vy(af6vUyD7{P>qJR zb5pa49>&;b>l8?TTIWdO(Yy`mDY4^&Eicd$<~!L;cRuy>$>*}2`#0Rs`{=RT-`>&H z_1);&Q|Fd~>$=}B?B1y!e{I>p^Zt>utDfJRxo&fH!G@zh9@%hn?@b5pJhWoZg_qad zzvIluul@|a?itCA?Rv8O&F&v^e{5g4>8bDgK6&`hg%{Pyy%##ZRNqP;yeo@ueY|7k zN2k{OzURSxT;cA4`@a2j-E#E#>%Z{D!;3yV^xl@^D-OV;&n!%A+qSF!ua{1~GW6U2 z%bh#V-SXL`{?iY=advd&;-%fIA3JgJSl7Yx>%RCZI+~bxxBtyYetLEjJ1=K@`!gr* H-M#N`M6$y7 literal 0 HcmV?d00001 diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/lime.png b/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/lime.png new file mode 100644 index 0000000000000000000000000000000000000000..d2dc60135013ec9e10526454befabbc1c13093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/cutouts/out/pink.png b/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/pink.png new file mode 100644 index 0000000000000000000000000000000000000000..7991ef0d9f8fd47e53bb38013906c25abc8d0818 GIT binary patch literal 2930 zcmcImUu+ab7(Y!QSRpFbM2N=CLX1TAc4qe9?aD!Fuh<%|)bI5BynOtN_`p%TqCyWL|PP? zr_B(8C{r6IEt(i%aveu9%mW@$1L!&#E}Dp|4dbpOlPU>Fm?jJhGc04NT+ZMNsttk+ zouqw}%%fIp3!;Q<&q2q4Fpq>McKM-8Ysn@acxwVF;gl3b zo=6fXND8PRWC3Vt@JYZvKoeSKsp;YrcY;lZuOMJ)21~qoVCwqb)RIuwu{;_Fm@S+i z;4vac;aJ03xoi!DNs2><43vr@b2ab#u0>SSaSZ|_L>wYPsOpjpU_ml94D5ogW3QmJ z=a;B6!IO&5Z`PMf9i}5&4a-HU0X^4cI=q4e995OD=DCt$BV?#bff%OO*0v+|S&8Fn zr&jKj%QSkVpev4ROA7N%D!3|?Olb3m=9-EM6~ks6&e`pyRT`J6%Q$D=^3}GOdgdzT z^;HyMYjBjOYIUMHXdu8Y8S-aKzIzGzoOoyGGm4QY@O-fv_D5LjVh-q9bS3Cp>uR<9W$ds|;sUuYDig`H*y4$n^FimhRPfdyV3 zl})v^al**DMbn&QHaU6~jwh77N?FWNx+dxo7lE<@IK`NFoFxd`6 zSgAm}U?9z2D3}Es!W|CAq2VNnI}$6xF=iVniIbw}#WWCb6jgnvQC;$6=(hH!tRRJy z3UlpeQPNxz`yDyZX(e+(_#f>pnQ_bOhBp_>9bP1v9}t>tK>l}!X#SU)Om63E)7W^e zg?hnqbCB)C7HjQGHG60}x@~9@Hg#Kq8ZS?*nG#k!q-eUXIUeR2&9%}0+U$7_HE8HK zH?@b@VT^xfr$F|Tog+!e>NaMl#Qr}n?`J2>V*{n0O5v^Zvprp3fbPZhYyjvQP2&diV7U+-S=RDPyA7}@mc)!>yYzn$Co$$4XS?s)M1;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red.png b/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/red.png new file mode 100644 index 0000000000000000000000000000000000000000..d4b83ce383d473d470eacd5dc95d67ece9a5d8b1 GIT binary patch literal 2961 zcmcguYlsz99KT8USd~QW!4fr$D=0O0&Y9<((d%okx*J|ycW<~W6rDM9W_R-5IpfUi z-n&wXl2Cz?L>l(^R-a4)S%r#P2qXGp1z{hOB*CB$y`&-#>YV$S-OXKhvB$u?&i{A* zkKg(K|K~j4vvd2>w)VD6CbP7=tI*5d%lN%;K6^fR{ZGVRi^8sfIFnhtg5P&!PQ7+t zCeyaxFZCz=#T_=Ll`L|pL$b9>$k3V0`i->^;e8|#95Uz!dGW{hJ`@Gt&5L{VA}EHP zWXSJ25RtwEJ4^V$K5V(-#tp*yn#~kcNP>h~r5wa|Eicyf+U%PT%c4++B>VE>W^PdE zFZKwXG$MkL1ri285lkx!4NWt^!-4`7AOl^7iUbWCXf`y3<|Q&~k?YyLg>6k+>@P14 zB}r(@aMH7ST!wKNn+j3Ylxd>RN`BXa0)k{6k$ zjSwnfsy2w5G%>>D8VY5Y1w5oW(8Vb(9FEF$<1Us-nN&!S#0(2lEMuuyOySe2tyEHU zoNOIo9yMc|79E#HLn8N*m<~snY#m`1SG63AlU_1G%^apPcse;8q6v+M=nN#J;we-l zzBhwGE|~%)HGc*um!#0p?u-aZXjG!K+{&GvmT!Urvx=~0j~}?S8n5MnHz$w+N=RPh zi6nuXq=J&7*Z|r(dJJnUct!A9)Nn_ZF5N*t9Z zYvo?K+$)kZRO~vE>Y7B#xf+x#=~_*Jjf&J|oU5Y1SDUM6t|DGv zc@Z`T`+2IChZ}>Y0@x)({%pzzW|2>b9}Rp)u_6jQU+lX5KGwRJ1BR}vdUL$TuaR

v`_nD( zoTzN5tqu`J)-AHO0gI`ZR8d4W4>E>ltqOT2=VLT-YuBNvK>!URd6sHOI?;gSsJbZ` zISV^LRS1D*EA*RPS8b@-irOl;+i|@~D;`3@AYq%3E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z3Q%&w?5Aa2(7cz-%jR7r6h?-lB9{S}VM^Qf}rBiR@C)YyjfFdqeZvX{NE4ZA{~^ zwdd;sOJyHDeQny*7isgJWFg%(Gyz(=D@YnEOsH7`RD4;{bX`L}Jv5r$kpJ4|8G#yU zm~~fbP0$2$sKYrAC_Q=$_moC`mp5xojf4;#xael?0y`QR|T-tc?^iMpueC!hLfBEOmv+<=P z8#})F^4WuTy9eIbb?Cw42Uj2a>gZIj^Z4|4FFd_|@2-2M*ZjTd)EA#wHT&B$J5EmR o|M2kOf#;vOaQWQFU4NYuJMS2{vaI9vGP@M_Zy9h-KC)}iKTfs1W&i*H literal 0 HcmV?d00001 diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/yellow.png b/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/textures/block/relay/cutouts/out/yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..b6fcecf4b17229ac8d7617a79e9b1e19396e6395 GIT binary patch literal 2955 zcmcImZD<@t7(Su2n%G*jN-3i27W}}@?aY4OF1?nRYnl|Vrs+v9DA?KAx!iJhyPMrj z?h@*c)>14Qu(m(M5Be)0Es8~2!J@4QrJyLbRFLWqp=y6rDk?=pj5GI@#3oIsc45Ef zedhgm=6&Cp{ry`vFYj2>kw_$#_w{B5*n1_vZ(quu5B@fV+3Sv=cQ8sMI`854ZHd?4 zT%AaC47<5}oXiIzfgql%OUd86e$)s)Y=pd5O$g=oGAhOi$Am`%8<( zI1VgHs#dGXs*?1>AqknLDM4A1Wxx<18uMaY175VYr6EHj61qX``kufwV%r~y(<1Y< z5ke(stM#HLO^h(9h64#DArGkzbVwT)jD+R7afe8>Oe@rjBZft7EMqB~ZNukOTdB0s zQM_rCdDM(;PIQzT3#c?eBYz|$bkiuaxVGh36c5m8Y8Ek_!P}FAq96NF(VvHews;m5 zv0IqOAeYR7(waLDluO#s!0HYuj{Pv_`{h>d^tXHyWR#SJM|ZfM<5#1{c;L+mG=pQB z7I`88m;wsS$+88JrJ=_m`+yB-mZheHV>}aVGJH;kmXfj*Wfs_X+``y`P={CrKdfN3 zaBc+;Q7Q0->ejMZtIvyK>=D|RNsG+Yr0Y5sLWmLtQXtDR0j8o7fQ^&}4Ba+tRdrADY8_M2cZE4yWyQ`(;1O`VQk<5e2^57E{k$ z#k{`KB5Drid8(F28iR%m*(D+VY{~~0kWY)B_FP7>EDAhdth)W}taUL5bWKyV=6Jtb zqvd?YWvoRFM_Bmv8Fk6vYzgmVyh5#BH)1(A*6cOg>2UL_>ptHgP`n^dUZ*op3~f) z+65`ZzA)W><|WOcp*tf7W?E^xApDQ^7S6aub;Ik6^GbmdYL#}8gyu?OC{@0su9 zSB7hyWY^SYbmoJVuPwRU^AQ|AaB$`CCx5;+S(%K3P49iVxh|d2E@u=Gnh5@9g+-#r_Y!dE`prXy+dj!e{3$9PK^7_xWX? z3w!hHwrv?+weRB>g#Py)zUvF~?KjSJ9yzk~r*AJE`7>WSaCW?F+luaAC(fEF_I@x-n#U;4`Y{_CrMEt$BIy>#u^hU5IW+_!0K=G`ZD G?)e8~62-Fs literal 0 HcmV?d00001 diff --git a/refinedstorage-platform-fabric/.gitignore b/refinedstorage-platform-fabric/.gitignore deleted file mode 100644 index 737e26b00..000000000 --- a/refinedstorage-platform-fabric/.gitignore +++ /dev/null @@ -1 +0,0 @@ -run/ \ No newline at end of file diff --git a/refinedstorage-platform-neoforge/.gitignore b/refinedstorage-platform-neoforge/.gitignore deleted file mode 100644 index 737e26b00..000000000 --- a/refinedstorage-platform-neoforge/.gitignore +++ /dev/null @@ -1 +0,0 @@ -run/ \ No newline at end of file From 2ddf0e925279b851976fd1ee8c47a9c5dbb3a5a7 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sat, 6 Jul 2024 21:16:14 +0200 Subject: [PATCH 2/4] fix: not being able to ghost drag resources from recipe viewsers --- CHANGELOG.md | 1 + .../refinedstorage/platform/neoforge/ModInitializer.java | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e696c37e1..f298c6727 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Fixed - Fixed Relay model not being able to load correctly. +- Fixed not being able to ghost drag resources from recipe viewers into filter slots. ## [2.0.0-milestone.4.2] - 2024-07-06 diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ModInitializer.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ModInitializer.java index ee6a5f8b2..0ce029cb5 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ModInitializer.java +++ b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ModInitializer.java @@ -29,6 +29,7 @@ import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.GridInsertPacket; import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.GridScrollPacket; import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.PropertyChangePacket; +import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.ResourceFilterSlotChangePacket; import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.ResourceSlotAmountChangePacket; import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.ResourceSlotChangePacket; import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.SecurityCardBoundPlayerPacket; @@ -573,6 +574,11 @@ private static void registerClientToServerPackets(final PayloadRegistrar registr PropertyChangePacket.STREAM_CODEC, wrapHandler(PropertyChangePacket::handle) ); + registrar.playToServer( + ResourceFilterSlotChangePacket.PACKET_TYPE, + ResourceFilterSlotChangePacket.STREAM_CODEC, + wrapHandler(ResourceFilterSlotChangePacket::handle) + ); registrar.playToServer( ResourceSlotAmountChangePacket.PACKET_TYPE, ResourceSlotAmountChangePacket.STREAM_CODEC, From 262375210f481a06e5ab29e3b2ede6ec6aea9df8 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sat, 6 Jul 2024 21:48:48 +0200 Subject: [PATCH 3/4] feat: ability to open portable grid with a keybinding --- CHANGELOG.md | 6 ++- .../platform/api/PlatformApi.java | 8 +-- .../platform/api/PlatformApiProxy.java | 10 ++-- .../AbstractNetworkBoundEnergyItem.java | 24 +++++---- .../bounditem/NetworkBoundItemHelper.java | 2 + .../SlotReference.java | 2 +- .../SlotReferenceFactory.java | 2 +- .../SlotReferenceHandlerItem.java | 11 +++++ .../SlotReferenceProvider.java | 2 +- .../support/slotreference/package-info.java | 7 +++ .../common/AbstractClientModInitializer.java | 10 +++- .../common/AbstractModInitializer.java | 2 +- .../platform/common/PlatformApiImpl.java | 14 +++--- .../platform/common/content/ContentNames.java | 10 ++++ .../platform/common/content/KeyMappings.java | 11 +++++ .../common/grid/PortableGridData.java | 4 +- .../grid/WirelessGridContainerMenu.java | 2 +- .../common/grid/WirelessGridData.java | 4 +- .../WirelessGridExtendedMenuProvider.java | 2 +- .../common/grid/WirelessGridItem.java | 8 +-- .../AbstractSecurityCardContainerMenu.java | 2 +- .../security/AbstractSecurityCardItem.java | 2 +- .../FallbackSecurityCardContainerMenu.java | 2 +- ...lbackSecurityCardExtendedMenuProvider.java | 2 +- .../security/FallbackSecurityCardItem.java | 2 +- .../security/SecurityCardContainerMenu.java | 2 +- .../common/security/SecurityCardData.java | 4 +- .../SecurityCardExtendedMenuProvider.java | 2 +- .../common/security/SecurityCardItem.java | 2 +- .../portablegrid/PortableGridBlockItem.java | 49 +++++++++++-------- .../PortableGridItemContainerMenu.java | 2 +- .../PortableGridItemExtendedMenuProvider.java | 2 +- .../support/AbstractBaseContainerMenu.java | 2 +- .../support/ClientToServerCommunications.java | 2 +- .../AbstractSingleAmountContainerMenu.java | 2 +- .../containermenu/SingleAmountData.java | 4 +- .../bounditem/NetworkBoundItemHelperImpl.java | 2 +- .../NetworkBoundItemSessionImpl.java | 2 +- .../common/support/packet/c2s/C2SPackets.java | 6 +-- .../packet/c2s/UseNetworkBoundItemPacket.java | 47 ------------------ .../c2s/UseSlotReferencedItemPacket.java | 40 +++++++++++++++ .../CompositeSlotReferenceProvider.java | 8 +-- .../InventorySlotReference.java | 6 +-- .../InventorySlotReferenceFactory.java | 6 +-- .../InventorySlotReferenceProvider.java | 6 +-- .../support/slotreference/package-info.java | 7 +++ .../RegulatorUpgradeContainerMenu.java | 2 +- .../common/upgrade/RegulatorUpgradeItem.java | 2 +- .../assets/refinedstorage/lang/en_us.json | 1 + .../fabric/ClientModInitializerImpl.java | 11 +++-- .../platform/fabric/ModInitializerImpl.java | 10 ++-- .../neoforge/ClientModInitializer.java | 18 +++++-- .../platform/neoforge/ModInitializer.java | 8 +-- 53 files changed, 243 insertions(+), 163 deletions(-) rename refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/{network/bounditem => slotreference}/SlotReference.java (83%) rename refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/{network/bounditem => slotreference}/SlotReferenceFactory.java (93%) create mode 100644 refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReferenceHandlerItem.java rename refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/{network/bounditem => slotreference}/SlotReferenceProvider.java (81%) create mode 100644 refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/package-info.java delete mode 100644 refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/UseNetworkBoundItemPacket.java create mode 100644 refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/UseSlotReferencedItemPacket.java rename refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/{network/bounditem => slotreference}/CompositeSlotReferenceProvider.java (84%) rename refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/{network/bounditem => slotreference}/InventorySlotReference.java (81%) rename refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/{network/bounditem => slotreference}/InventorySlotReferenceFactory.java (75%) rename refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/{network/bounditem => slotreference}/InventorySlotReferenceProvider.java (74%) create mode 100644 refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/package-info.java diff --git a/CHANGELOG.md b/CHANGELOG.md index f298c6727..d8bae29a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,10 +7,14 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added + +- Ability to open Portable Grid with a keybinding. + ### Fixed - Fixed Relay model not being able to load correctly. -- Fixed not being able to ghost drag resources from recipe viewers into filter slots. +- Fixed not being able to ghost drag resources from recipe viewers into filter slots on NeoForge. ## [2.0.0-milestone.4.2] - 2024-07-06 diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApi.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApi.java index f9a49ed50..7a31b58f2 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApi.java +++ b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApi.java @@ -33,14 +33,14 @@ import com.refinedmods.refinedstorage.platform.api.support.network.ConnectionLogic; import com.refinedmods.refinedstorage.platform.api.support.network.InWorldNetworkNodeContainer; import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemHelper; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReferenceFactory; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReferenceProvider; import com.refinedmods.refinedstorage.platform.api.support.registry.PlatformRegistry; import com.refinedmods.refinedstorage.platform.api.support.resource.RecipeModIngredientConverter; import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceFactory; import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceRendering; import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceType; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceProvider; import com.refinedmods.refinedstorage.platform.api.upgrade.BuiltinUpgradeDestinations; import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeRegistry; import com.refinedmods.refinedstorage.platform.api.wirelesstransmitter.WirelessTransmitterRangeModifier; @@ -192,7 +192,7 @@ EnergyStorage asBlockItemEnergyStorage( SlotReference createInventorySlotReference(Player player, InteractionHand hand); - void useNetworkBoundItem(Player player, Item... items); + void useSlotReferencedItem(Player player, Item... items); BuiltinPermissions getBuiltinPermissions(); diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApiProxy.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApiProxy.java index 10365398d..1d7b23193 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApiProxy.java +++ b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApiProxy.java @@ -33,14 +33,14 @@ import com.refinedmods.refinedstorage.platform.api.support.network.ConnectionLogic; import com.refinedmods.refinedstorage.platform.api.support.network.InWorldNetworkNodeContainer; import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemHelper; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReferenceFactory; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReferenceProvider; import com.refinedmods.refinedstorage.platform.api.support.registry.PlatformRegistry; import com.refinedmods.refinedstorage.platform.api.support.resource.RecipeModIngredientConverter; import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceFactory; import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceRendering; import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceType; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceProvider; import com.refinedmods.refinedstorage.platform.api.upgrade.BuiltinUpgradeDestinations; import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeRegistry; import com.refinedmods.refinedstorage.platform.api.wirelesstransmitter.WirelessTransmitterRangeModifier; @@ -368,8 +368,8 @@ public SlotReference createInventorySlotReference(final Player player, final Int } @Override - public void useNetworkBoundItem(final Player player, final Item... items) { - ensureLoaded().useNetworkBoundItem(player, items); + public void useSlotReferencedItem(final Player player, final Item... items) { + ensureLoaded().useSlotReferencedItem(player, items); } @Override diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/energy/AbstractNetworkBoundEnergyItem.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/energy/AbstractNetworkBoundEnergyItem.java index 683af95e9..94fe2078b 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/energy/AbstractNetworkBoundEnergyItem.java +++ b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/energy/AbstractNetworkBoundEnergyItem.java @@ -3,7 +3,8 @@ import com.refinedmods.refinedstorage.platform.api.PlatformApi; import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemHelper; import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemSession; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceHandlerItem; import java.util.List; import java.util.Optional; @@ -22,7 +23,7 @@ import org.apiguardian.api.API; @API(status = API.Status.STABLE, since = "2.0.0-milestone.3.1") -public abstract class AbstractNetworkBoundEnergyItem extends AbstractEnergyItem { +public abstract class AbstractNetworkBoundEnergyItem extends AbstractEnergyItem implements SlotReferenceHandlerItem { protected final NetworkBoundItemHelper networkBoundItemHelper; protected AbstractNetworkBoundEnergyItem(final Properties properties, @@ -56,17 +57,22 @@ public InteractionResultHolder use(final Level level, final Player pl final ItemStack stack = player.getItemInHand(hand); if (player instanceof ServerPlayer serverPlayer && level.getServer() != null) { final SlotReference slotReference = PlatformApi.INSTANCE.createInventorySlotReference(player, hand); - final NetworkBoundItemSession session = networkBoundItemHelper.openSession( - stack, - serverPlayer, - slotReference - ); - use(serverPlayer, slotReference, session); + slotReference.resolve(player).ifPresent(s -> use(serverPlayer, s, slotReference)); } return InteractionResultHolder.consume(stack); } - public abstract void use(ServerPlayer player, SlotReference slotReference, NetworkBoundItemSession session); + @Override + public void use(final ServerPlayer player, final ItemStack stack, final SlotReference slotReference) { + final NetworkBoundItemSession session = PlatformApi.INSTANCE.getNetworkBoundItemHelper().openSession( + stack, + player, + slotReference + ); + use(player, slotReference, session); + } + + protected abstract void use(ServerPlayer player, SlotReference slotReference, NetworkBoundItemSession session); public boolean isBound(final ItemStack stack) { return networkBoundItemHelper.isBound(stack); diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/NetworkBoundItemHelper.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/NetworkBoundItemHelper.java index 5870ffe23..a1082b94b 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/NetworkBoundItemHelper.java +++ b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/NetworkBoundItemHelper.java @@ -1,5 +1,7 @@ package com.refinedmods.refinedstorage.platform.api.support.network.bounditem; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; + import java.util.List; import java.util.Optional; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/SlotReference.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReference.java similarity index 83% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/SlotReference.java rename to refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReference.java index 539506ef6..903495ad3 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/SlotReference.java +++ b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReference.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.support.network.bounditem; +package com.refinedmods.refinedstorage.platform.api.support.slotreference; import java.util.Optional; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/SlotReferenceFactory.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReferenceFactory.java similarity index 93% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/SlotReferenceFactory.java rename to refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReferenceFactory.java index f515774a7..aab1c8c84 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/SlotReferenceFactory.java +++ b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReferenceFactory.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.support.network.bounditem; +package com.refinedmods.refinedstorage.platform.api.support.slotreference; import com.refinedmods.refinedstorage.platform.api.PlatformApi; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReferenceHandlerItem.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReferenceHandlerItem.java new file mode 100644 index 000000000..edeeabe5c --- /dev/null +++ b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReferenceHandlerItem.java @@ -0,0 +1,11 @@ +package com.refinedmods.refinedstorage.platform.api.support.slotreference; + +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.item.ItemStack; +import org.apiguardian.api.API; + +@FunctionalInterface +@API(status = API.Status.STABLE, since = "2.0.0-milestone.4.3") +public interface SlotReferenceHandlerItem { + void use(ServerPlayer player, ItemStack stack, SlotReference slotReference); +} diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/SlotReferenceProvider.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReferenceProvider.java similarity index 81% rename from refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/SlotReferenceProvider.java rename to refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReferenceProvider.java index 760a30987..c86829255 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/network/bounditem/SlotReferenceProvider.java +++ b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/SlotReferenceProvider.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage.platform.api.support.network.bounditem; +package com.refinedmods.refinedstorage.platform.api.support.slotreference; import java.util.List; import java.util.Set; diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/package-info.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/package-info.java new file mode 100644 index 000000000..44928fbd8 --- /dev/null +++ b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/slotreference/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.platform.api.support.slotreference; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/AbstractClientModInitializer.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/AbstractClientModInitializer.java index d984184de..4cebb7e41 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/AbstractClientModInitializer.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/AbstractClientModInitializer.java @@ -95,12 +95,20 @@ protected static void handleInputEvents() { } final KeyMapping openWirelessGrid = KeyMappings.INSTANCE.getOpenWirelessGrid(); while (openWirelessGrid != null && openWirelessGrid.consumeClick()) { - PlatformApi.INSTANCE.useNetworkBoundItem( + PlatformApi.INSTANCE.useSlotReferencedItem( player, Items.INSTANCE.getWirelessGrid(), Items.INSTANCE.getCreativeWirelessGrid() ); } + final KeyMapping openPortableGrid = KeyMappings.INSTANCE.getOpenPortableGrid(); + while (openPortableGrid != null && openPortableGrid.consumeClick()) { + PlatformApi.INSTANCE.useSlotReferencedItem( + player, + Items.INSTANCE.getPortableGrid(), + Items.INSTANCE.getCreativePortableGrid() + ); + } } protected static void registerDiskModels() { diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/AbstractModInitializer.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/AbstractModInitializer.java index 4f68e9153..c16987a07 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/AbstractModInitializer.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/AbstractModInitializer.java @@ -119,11 +119,11 @@ import com.refinedmods.refinedstorage.platform.common.support.containermenu.SingleAmountData; import com.refinedmods.refinedstorage.platform.common.support.energy.EnergyLootItemFunction; import com.refinedmods.refinedstorage.platform.common.support.network.BaseNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage.platform.common.support.network.bounditem.InventorySlotReferenceFactory; import com.refinedmods.refinedstorage.platform.common.support.network.component.PlatformStorageNetworkComponent; import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResourceFactory; import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceTypes; +import com.refinedmods.refinedstorage.platform.common.support.slotreference.InventorySlotReferenceFactory; import com.refinedmods.refinedstorage.platform.common.upgrade.FortuneUpgradeItem; import com.refinedmods.refinedstorage.platform.common.upgrade.RangeUpgradeItem; import com.refinedmods.refinedstorage.platform.common.upgrade.RegulatorUpgradeContainerMenu; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/PlatformApiImpl.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/PlatformApiImpl.java index 1509064ff..8cf2c9d94 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/PlatformApiImpl.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/PlatformApiImpl.java @@ -38,14 +38,14 @@ import com.refinedmods.refinedstorage.platform.api.support.network.InWorldNetworkNodeContainer; import com.refinedmods.refinedstorage.platform.api.support.network.NetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemHelper; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReferenceFactory; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReferenceProvider; import com.refinedmods.refinedstorage.platform.api.support.registry.PlatformRegistry; import com.refinedmods.refinedstorage.platform.api.support.resource.RecipeModIngredientConverter; import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceFactory; import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceRendering; import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceType; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceProvider; import com.refinedmods.refinedstorage.platform.api.upgrade.BuiltinUpgradeDestinations; import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeRegistry; import com.refinedmods.refinedstorage.platform.api.wirelesstransmitter.WirelessTransmitterRangeModifier; @@ -68,8 +68,6 @@ import com.refinedmods.refinedstorage.platform.common.support.energy.ItemEnergyStorage; import com.refinedmods.refinedstorage.platform.common.support.network.ConnectionProviderImpl; import com.refinedmods.refinedstorage.platform.common.support.network.InWorldNetworkNodeContainerImpl; -import com.refinedmods.refinedstorage.platform.common.support.network.bounditem.CompositeSlotReferenceProvider; -import com.refinedmods.refinedstorage.platform.common.support.network.bounditem.InventorySlotReference; import com.refinedmods.refinedstorage.platform.common.support.network.bounditem.NetworkBoundItemHelperImpl; import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.C2SPackets; import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.S2CPackets; @@ -77,6 +75,8 @@ import com.refinedmods.refinedstorage.platform.common.support.resource.CompositeRecipeModIngredientConverter; import com.refinedmods.refinedstorage.platform.common.support.resource.FluidResourceFactory; import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResourceFactory; +import com.refinedmods.refinedstorage.platform.common.support.slotreference.CompositeSlotReferenceProvider; +import com.refinedmods.refinedstorage.platform.common.support.slotreference.InventorySlotReference; import com.refinedmods.refinedstorage.platform.common.upgrade.BuiltinUpgradeDestinationsImpl; import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeRegistryImpl; import com.refinedmods.refinedstorage.platform.common.util.ServerEventQueue; @@ -519,9 +519,9 @@ public SlotReference createInventorySlotReference(final Player player, final Int } @Override - public void useNetworkBoundItem(final Player player, final Item... items) { + public void useSlotReferencedItem(final Player player, final Item... items) { final Set validItems = new HashSet<>(Arrays.asList(items)); - slotReferenceProvider.findForUse(player, items[0], validItems).ifPresent(C2SPackets::sendUseNetworkBoundItem); + slotReferenceProvider.findForUse(player, items[0], validItems).ifPresent(C2SPackets::sendUseSlotReferencedItem); } @Override diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/ContentNames.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/ContentNames.java index e4ed7de26..ec4706e4f 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/ContentNames.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/ContentNames.java @@ -5,10 +5,12 @@ import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.MOD_ID; import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; +import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslationKey; public final class ContentNames { public static final String MOD_TRANSLATION_KEY = "mod." + MOD_ID; public static final MutableComponent MOD = Component.translatable(MOD_TRANSLATION_KEY); + public static final MutableComponent CABLE = name("cable"); public static final MutableComponent GRID = name("grid"); public static final MutableComponent CRAFTING_GRID = name("crafting_grid"); @@ -35,6 +37,14 @@ public final class ContentNames { public static final MutableComponent RELAY = name("relay"); public static final MutableComponent DISK_INTERFACE = name("disk_interface"); + public static final String CLEAR_CRAFTING_MATRIX_TO_NETWORK_TRANSLATION_KEY = + createTranslationKey("key", "clear_crafting_grid_matrix_to_network"); + public static final String CLEAR_CRAFTING_MATRIX_TO_INVENTORY_TRANSLATION_KEY = + createTranslationKey("key", "clear_crafting_grid_matrix_to_inventory"); + public static final String FOCUS_SEARCH_BAR_TRANSLATION_KEY = createTranslationKey("key", "focus_search_bar"); + public static final String OPEN_WIRELESS_GRID_TRANSLATION_KEY = createTranslationKey("key", "open_wireless_grid"); + public static final String OPEN_PORTABLE_GRID_TRANSLATION_KEY = createTranslationKey("key", "open_portable_grid"); + private ContentNames() { } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/KeyMappings.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/KeyMappings.java index e4235a948..897727fda 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/KeyMappings.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/content/KeyMappings.java @@ -16,6 +16,8 @@ public final class KeyMappings { private KeyMapping clearCraftingGridMatrixToInventory; @Nullable private KeyMapping openWirelessGrid; + @Nullable + private KeyMapping openPortableGrid; private KeyMappings() { } @@ -54,4 +56,13 @@ public KeyMapping getOpenWirelessGrid() { public void setOpenWirelessGrid(final KeyMapping openWirelessGrid) { this.openWirelessGrid = openWirelessGrid; } + + @Nullable + public KeyMapping getOpenPortableGrid() { + return openPortableGrid; + } + + public void setOpenPortableGrid(final KeyMapping openPortableGrid) { + this.openPortableGrid = openPortableGrid; + } } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/PortableGridData.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/PortableGridData.java index eaf7de47b..c64433452 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/PortableGridData.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/PortableGridData.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage.platform.common.grid; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReferenceFactory; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; import java.util.Optional; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridContainerMenu.java index 845ab69c5..a7a75ef40 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridContainerMenu.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridContainerMenu.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage.platform.common.grid; import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.common.content.Menus; import net.minecraft.world.entity.player.Inventory; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridData.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridData.java index 60c17531f..b547e00e3 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridData.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridData.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage.platform.common.grid; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReferenceFactory; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.StreamCodec; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridExtendedMenuProvider.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridExtendedMenuProvider.java index 90e3fa1b0..e8881f5a0 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridExtendedMenuProvider.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridExtendedMenuProvider.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage.platform.common.grid; import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.common.content.ContentNames; import com.refinedmods.refinedstorage.platform.common.support.containermenu.ExtendedMenuProvider; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridItem.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridItem.java index 5fcdd9351..e27de441d 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridItem.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/WirelessGridItem.java @@ -7,7 +7,7 @@ import com.refinedmods.refinedstorage.platform.api.security.SecurityHelper; import com.refinedmods.refinedstorage.platform.api.support.energy.AbstractNetworkBoundEnergyItem; import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemSession; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.common.Platform; import com.refinedmods.refinedstorage.platform.common.content.ContentNames; import com.refinedmods.refinedstorage.platform.common.security.BuiltinPermission; @@ -33,9 +33,9 @@ public EnergyStorage createEnergyStorage(final ItemStack stack) { } @Override - public void use(final ServerPlayer player, - final SlotReference slotReference, - final NetworkBoundItemSession session) { + protected void use(final ServerPlayer player, + final SlotReference slotReference, + final NetworkBoundItemSession session) { final boolean isAllowed = session.resolveNetwork() .map(network -> SecurityHelper.isAllowed(player, BuiltinPermission.OPEN, network)) .orElse(true); // if the network can't be resolved that will be apparent later in the UI. diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/AbstractSecurityCardContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/AbstractSecurityCardContainerMenu.java index 3904a8acb..8c1e864d4 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/AbstractSecurityCardContainerMenu.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/AbstractSecurityCardContainerMenu.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage.platform.common.security; import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.common.support.AbstractBaseContainerMenu; import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.C2SPackets; import com.refinedmods.refinedstorage.platform.common.support.stretching.ScreenSizeListener; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/AbstractSecurityCardItem.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/AbstractSecurityCardItem.java index 9994efd51..4431ace77 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/AbstractSecurityCardItem.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/AbstractSecurityCardItem.java @@ -5,7 +5,7 @@ import com.refinedmods.refinedstorage.platform.api.PlatformApi; import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; import com.refinedmods.refinedstorage.platform.api.security.SecurityPolicyContainerItem; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.common.Platform; import com.refinedmods.refinedstorage.platform.common.content.DataComponents; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardContainerMenu.java index f1d57ba2c..436114180 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardContainerMenu.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardContainerMenu.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage.platform.common.security; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.common.content.Menus; import net.minecraft.world.entity.player.Inventory; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardExtendedMenuProvider.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardExtendedMenuProvider.java index 598eb288a..bd8270107 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardExtendedMenuProvider.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardExtendedMenuProvider.java @@ -2,7 +2,7 @@ import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy; import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.common.content.ContentNames; import java.util.Set; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardItem.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardItem.java index 7034cb6e8..dcb4dcb8a 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardItem.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/FallbackSecurityCardItem.java @@ -4,7 +4,7 @@ import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy; import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; import com.refinedmods.refinedstorage.platform.api.support.HelpTooltipComponent; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.common.Platform; import java.util.Optional; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardContainerMenu.java index 438d716a9..a16f66548 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardContainerMenu.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardContainerMenu.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage.platform.common.security; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.common.content.Menus; import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.C2SPackets; import com.refinedmods.refinedstorage.platform.common.support.stretching.ScreenSizeListener; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardData.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardData.java index f1a5a0a88..2f1358792 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardData.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardData.java @@ -2,8 +2,8 @@ import com.refinedmods.refinedstorage.platform.api.PlatformApi; import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReferenceFactory; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardExtendedMenuProvider.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardExtendedMenuProvider.java index 54dab1eb5..04800ccca 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardExtendedMenuProvider.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardExtendedMenuProvider.java @@ -2,7 +2,7 @@ import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy; import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.common.content.ContentNames; import java.util.Set; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardItem.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardItem.java index 04574364c..b0de34657 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardItem.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/security/SecurityCardItem.java @@ -4,7 +4,7 @@ import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy; import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; import com.refinedmods.refinedstorage.platform.api.support.HelpTooltipComponent; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.common.Platform; import com.refinedmods.refinedstorage.platform.common.content.DataComponents; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlockItem.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlockItem.java index 7bd6fe81a..1d72f81c1 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlockItem.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlockItem.java @@ -11,7 +11,8 @@ import com.refinedmods.refinedstorage.platform.api.storage.StorageRepository; import com.refinedmods.refinedstorage.platform.api.support.HelpTooltipComponent; import com.refinedmods.refinedstorage.platform.api.support.energy.AbstractEnergyBlockItem; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceHandlerItem; import com.refinedmods.refinedstorage.platform.common.Platform; import com.refinedmods.refinedstorage.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage.platform.common.storage.Disk; @@ -38,7 +39,7 @@ import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslation; -public class PortableGridBlockItem extends AbstractEnergyBlockItem { +public class PortableGridBlockItem extends AbstractEnergyBlockItem implements SlotReferenceHandlerItem { private static final Component HELP = createTranslation("item", "portable_grid.help"); private final PortableGridType type; @@ -116,29 +117,35 @@ public InteractionResultHolder use(final Level level, final Player pl final ItemStack stack = player.getItemInHand(hand); if (player instanceof ServerPlayer serverPlayer && level.getServer() != null) { final SlotReference slotReference = PlatformApi.INSTANCE.createInventorySlotReference(player, hand); - final PortableGridEnergyStorage energyStorage = createEnergyStorageInternal(stack); - final DiskInventoryListenerImpl listener = new DiskInventoryListenerImpl(stack, level.registryAccess()); - final DiskInventory diskInventory = createDiskInventory(stack, listener, level.registryAccess()); - diskInventory.setStorageRepository(PlatformApi.INSTANCE.getStorageRepository(level)); - final PortableGrid portableGrid = new PortableGrid( - energyStorage, - diskInventory, - () -> { - } - ); - listener.portableGrid = portableGrid; - energyStorage.portableGrid = portableGrid; - portableGrid.updateStorage(); - Platform.INSTANCE.getMenuOpener().openMenu(serverPlayer, new PortableGridItemExtendedMenuProvider( - portableGrid, - energyStorage, - diskInventory, - slotReference - )); + slotReference.resolve(player).ifPresent(s -> use(serverPlayer, s, slotReference)); } return InteractionResultHolder.consume(stack); } + @Override + public void use(final ServerPlayer player, final ItemStack stack, final SlotReference slotReference) { + final PortableGridEnergyStorage energyStorage = createEnergyStorageInternal(stack); + final Level level = player.serverLevel(); + final DiskInventoryListenerImpl listener = new DiskInventoryListenerImpl(stack, level.registryAccess()); + final DiskInventory diskInventory = createDiskInventory(stack, listener, level.registryAccess()); + diskInventory.setStorageRepository(PlatformApi.INSTANCE.getStorageRepository(level)); + final PortableGrid portableGrid = new PortableGrid( + energyStorage, + diskInventory, + () -> { + } + ); + listener.portableGrid = portableGrid; + energyStorage.portableGrid = portableGrid; + portableGrid.updateStorage(); + Platform.INSTANCE.getMenuOpener().openMenu(player, new PortableGridItemExtendedMenuProvider( + portableGrid, + energyStorage, + diskInventory, + slotReference + )); + } + private PortableGridEnergyStorage createEnergyStorageInternal(final ItemStack stack) { if (type == PortableGridType.CREATIVE) { return new PortableGridEnergyStorage(CreativeEnergyStorage.INSTANCE); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridItemContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridItemContainerMenu.java index 60870ed25..4b38368e8 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridItemContainerMenu.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridItemContainerMenu.java @@ -2,7 +2,7 @@ import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.common.content.Menus; import com.refinedmods.refinedstorage.platform.common.grid.PortableGridData; import com.refinedmods.refinedstorage.platform.common.storage.DiskInventory; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridItemExtendedMenuProvider.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridItemExtendedMenuProvider.java index 97a2bd0da..3ec8e8479 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridItemExtendedMenuProvider.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridItemExtendedMenuProvider.java @@ -2,7 +2,7 @@ import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage; import com.refinedmods.refinedstorage.platform.api.grid.Grid; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.common.content.ContentNames; import com.refinedmods.refinedstorage.platform.common.grid.GridData; import com.refinedmods.refinedstorage.platform.common.grid.PortableGridData; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseContainerMenu.java index 6f2ccad79..544bf430f 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseContainerMenu.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseContainerMenu.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage.platform.common.support; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.common.Platform; import com.refinedmods.refinedstorage.platform.common.support.containermenu.ClientProperty; import com.refinedmods.refinedstorage.platform.common.support.containermenu.DisabledSlot; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/ClientToServerCommunications.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/ClientToServerCommunications.java index e438a253b..708fb6eb3 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/ClientToServerCommunications.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/ClientToServerCommunications.java @@ -4,8 +4,8 @@ import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; import com.refinedmods.refinedstorage.platform.api.grid.GridScrollMode; import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyType; import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/AbstractSingleAmountContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/AbstractSingleAmountContainerMenu.java index 4fff5e509..22c7a0c44 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/AbstractSingleAmountContainerMenu.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/AbstractSingleAmountContainerMenu.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage.platform.common.support.containermenu; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.C2SPackets; import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerImpl; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/SingleAmountData.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/SingleAmountData.java index bd4a34de5..448f3e9d1 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/SingleAmountData.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/containermenu/SingleAmountData.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage.platform.common.support.containermenu; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReferenceFactory; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; import com.refinedmods.refinedstorage.platform.common.support.resource.ResourceContainerData; import java.util.Optional; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/NetworkBoundItemHelperImpl.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/NetworkBoundItemHelperImpl.java index a9a9458bc..493f1ab44 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/NetworkBoundItemHelperImpl.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/NetworkBoundItemHelperImpl.java @@ -4,7 +4,7 @@ import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemHelper; import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemSession; import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemTargetBlockEntity; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.common.content.DataComponents; import java.util.List; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/NetworkBoundItemSessionImpl.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/NetworkBoundItemSessionImpl.java index b1afe9bb6..d8fc7e9a1 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/NetworkBoundItemSessionImpl.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/NetworkBoundItemSessionImpl.java @@ -5,7 +5,7 @@ import com.refinedmods.refinedstorage.api.network.node.GraphNetworkComponent; import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemSession; import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemTargetBlockEntity; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.api.wirelesstransmitter.WirelessTransmitter; import com.refinedmods.refinedstorage.platform.common.Platform; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/C2SPackets.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/C2SPackets.java index 03dd0d8a2..7575266e7 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/C2SPackets.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/C2SPackets.java @@ -4,8 +4,8 @@ import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode; import com.refinedmods.refinedstorage.platform.api.grid.GridScrollMode; import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.common.Platform; import com.refinedmods.refinedstorage.platform.common.support.containermenu.PropertyType; import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; @@ -65,8 +65,8 @@ public static void sendSingleAmountChange(final double amount) { Platform.INSTANCE.sendPacketToServer(new SingleAmountChangePacket(amount)); } - public static void sendUseNetworkBoundItem(final SlotReference slotReference) { - Platform.INSTANCE.sendPacketToServer(new UseNetworkBoundItemPacket(slotReference)); + public static void sendUseSlotReferencedItem(final SlotReference slotReference) { + Platform.INSTANCE.sendPacketToServer(new UseSlotReferencedItemPacket(slotReference)); } public static void sendSecurityCardPermission(final PlatformPermission permission, final boolean allowed) { diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/UseNetworkBoundItemPacket.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/UseNetworkBoundItemPacket.java deleted file mode 100644 index 36cf611cf..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/UseNetworkBoundItemPacket.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.support.packet.c2s; - -import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.support.energy.AbstractNetworkBoundEnergyItem; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemSession; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReferenceFactory; -import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; - -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.codec.StreamCodec; -import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.entity.player.Player; - -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; - -public record UseNetworkBoundItemPacket(SlotReference slotReference) implements CustomPacketPayload { - public static final Type PACKET_TYPE = new Type<>( - createIdentifier("use_network_bound_item") - ); - public static final StreamCodec STREAM_CODEC = StreamCodec - .composite( - SlotReferenceFactory.STREAM_CODEC, UseNetworkBoundItemPacket::slotReference, - UseNetworkBoundItemPacket::new - ); - - public static void handle(final UseNetworkBoundItemPacket packet, final PacketContext ctx) { - final Player player = ctx.getPlayer(); - packet.slotReference.resolve(player).ifPresent(stack -> { - if (!(stack.getItem() instanceof AbstractNetworkBoundEnergyItem networkBoundItem)) { - return; - } - final NetworkBoundItemSession sess = PlatformApi.INSTANCE.getNetworkBoundItemHelper().openSession( - stack, - (ServerPlayer) player, - packet.slotReference - ); - networkBoundItem.use((ServerPlayer) player, packet.slotReference, sess); - }); - } - - @Override - public Type type() { - return PACKET_TYPE; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/UseSlotReferencedItemPacket.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/UseSlotReferencedItemPacket.java new file mode 100644 index 000000000..7d1d65720 --- /dev/null +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/UseSlotReferencedItemPacket.java @@ -0,0 +1,40 @@ +package com.refinedmods.refinedstorage.platform.common.support.packet.c2s; + +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceHandlerItem; +import com.refinedmods.refinedstorage.platform.common.support.packet.PacketContext; + +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.StreamCodec; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.player.Player; + +import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; + +public record UseSlotReferencedItemPacket(SlotReference slotReference) implements CustomPacketPayload { + public static final Type PACKET_TYPE = new Type<>( + createIdentifier("use_slot_referenced_item") + ); + public static final StreamCodec STREAM_CODEC = StreamCodec + .composite( + SlotReferenceFactory.STREAM_CODEC, UseSlotReferencedItemPacket::slotReference, + UseSlotReferencedItemPacket::new + ); + + public static void handle(final UseSlotReferencedItemPacket packet, final PacketContext ctx) { + final Player player = ctx.getPlayer(); + packet.slotReference.resolve(player).ifPresent(stack -> { + if (!(stack.getItem() instanceof SlotReferenceHandlerItem handlerItem)) { + return; + } + handlerItem.use((ServerPlayer) player, stack, packet.slotReference); + }); + } + + @Override + public Type type() { + return PACKET_TYPE; + } +} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/CompositeSlotReferenceProvider.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/CompositeSlotReferenceProvider.java similarity index 84% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/CompositeSlotReferenceProvider.java rename to refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/CompositeSlotReferenceProvider.java index e19b32165..f01a8cf60 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/CompositeSlotReferenceProvider.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/CompositeSlotReferenceProvider.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.support.network.bounditem; +package com.refinedmods.refinedstorage.platform.common.support.slotreference; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReferenceProvider; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceProvider; import java.util.ArrayList; import java.util.List; @@ -48,6 +48,6 @@ public Optional findForUse(final Player player, ).withStyle(ChatFormatting.RED)); return Optional.empty(); } - return Optional.of(foundReferences.get(0)); + return Optional.of(foundReferences.getFirst()); } } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/InventorySlotReference.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/InventorySlotReference.java similarity index 81% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/InventorySlotReference.java rename to refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/InventorySlotReference.java index 9ad2f5d61..5af624b67 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/InventorySlotReference.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/InventorySlotReference.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.support.network.bounditem; +package com.refinedmods.refinedstorage.platform.common.support.slotreference; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReferenceFactory; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; import java.util.Optional; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/InventorySlotReferenceFactory.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/InventorySlotReferenceFactory.java similarity index 75% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/InventorySlotReferenceFactory.java rename to refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/InventorySlotReferenceFactory.java index 3e81c6aa0..ec6f5660b 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/InventorySlotReferenceFactory.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/InventorySlotReferenceFactory.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.support.network.bounditem; +package com.refinedmods.refinedstorage.platform.common.support.slotreference; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReferenceFactory; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.ByteBufCodecs; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/InventorySlotReferenceProvider.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/InventorySlotReferenceProvider.java similarity index 74% rename from refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/InventorySlotReferenceProvider.java rename to refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/InventorySlotReferenceProvider.java index bb7ab5a9a..d5ec557e1 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/InventorySlotReferenceProvider.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/InventorySlotReferenceProvider.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage.platform.common.support.network.bounditem; +package com.refinedmods.refinedstorage.platform.common.support.slotreference; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReferenceProvider; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceProvider; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/package-info.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/package-info.java new file mode 100644 index 000000000..e88132e07 --- /dev/null +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/slotreference/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.platform.common.support.slotreference; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeContainerMenu.java index 66b9eedb6..a0a0feb62 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeContainerMenu.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeContainerMenu.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage.platform.common.upgrade; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.common.content.Menus; import com.refinedmods.refinedstorage.platform.common.support.containermenu.AbstractSingleAmountContainerMenu; import com.refinedmods.refinedstorage.platform.common.support.containermenu.SingleAmountData; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeItem.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeItem.java index cf77de199..a11139476 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeItem.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeItem.java @@ -3,9 +3,9 @@ import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.platform.api.PlatformApi; -import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference; import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.api.upgrade.AbstractUpgradeItem; import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeRegistry; import com.refinedmods.refinedstorage.platform.common.Platform; diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/en_us.json b/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/en_us.json index f08f87e3b..828ac42e9 100644 --- a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/en_us.json +++ b/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/en_us.json @@ -302,6 +302,7 @@ "key.refinedstorage.clear_crafting_grid_matrix_to_network": "Clear Crafting Grid matrix to network", "key.refinedstorage.clear_crafting_grid_matrix_to_inventory": "Clear Crafting Grid matrix to inventory", "key.refinedstorage.open_wireless_grid": "Open Wireless Grid", + "key.refinedstorage.open_portable_grid": "Open Portable Grid", "refinedstorage.subtitle.wrench": "Wrench used", "permission.refinedstorage.insert": "Insert", "permission.refinedstorage.insert.description": "Whether the player can insert resources in a network.", diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ClientModInitializerImpl.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ClientModInitializerImpl.java index e393957b5..e8d34a1b1 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ClientModInitializerImpl.java +++ b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ClientModInitializerImpl.java @@ -69,7 +69,6 @@ import org.lwjgl.glfw.GLFW; import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslationKey; public class ClientModInitializerImpl extends AbstractClientModInitializer implements ClientModInitializer { private static final String BLOCK_PREFIX = "block"; @@ -393,13 +392,19 @@ private CompositeClientTooltipComponent createRegulatorUpgradeClientTooltipCompo private void registerKeyBindings() { KeyMappings.INSTANCE.setFocusSearchBar(KeyBindingHelper.registerKeyBinding(new KeyMapping( - createTranslationKey("key", "focus_search_bar"), + ContentNames.FOCUS_SEARCH_BAR_TRANSLATION_KEY, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_TAB, ContentNames.MOD_TRANSLATION_KEY ))); KeyMappings.INSTANCE.setOpenWirelessGrid(KeyBindingHelper.registerKeyBinding(new KeyMapping( - createTranslationKey("key", "open_wireless_grid"), + ContentNames.OPEN_WIRELESS_GRID_TRANSLATION_KEY, + InputConstants.Type.KEYSYM, + InputConstants.UNKNOWN.getValue(), + ContentNames.MOD_TRANSLATION_KEY + ))); + KeyMappings.INSTANCE.setOpenPortableGrid(KeyBindingHelper.registerKeyBinding(new KeyMapping( + ContentNames.OPEN_PORTABLE_GRID_TRANSLATION_KEY, InputConstants.Type.KEYSYM, InputConstants.UNKNOWN.getValue(), ContentNames.MOD_TRANSLATION_KEY diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ModInitializerImpl.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ModInitializerImpl.java index 640f5c6b8..fb864b9a3 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ModInitializerImpl.java +++ b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ModInitializerImpl.java @@ -39,7 +39,7 @@ import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.SecurityCardResetPermissionPacket; import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.SingleAmountChangePacket; import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.StorageInfoRequestPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.UseNetworkBoundItemPacket; +import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.UseSlotReferencedItemPacket; import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.EnergyInfoPacket; import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.GridActivePacket; import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.GridClearPacket; @@ -447,8 +447,8 @@ private void registerClientToServerPackets() { StorageInfoRequestPacket.STREAM_CODEC ); PayloadTypeRegistry.playC2S().register( - UseNetworkBoundItemPacket.PACKET_TYPE, - UseNetworkBoundItemPacket.STREAM_CODEC + UseSlotReferencedItemPacket.PACKET_TYPE, + UseSlotReferencedItemPacket.STREAM_CODEC ); } @@ -498,8 +498,8 @@ private void registerPacketHandlers() { wrapHandler(SingleAmountChangePacket::handle) ); ServerPlayNetworking.registerGlobalReceiver( - UseNetworkBoundItemPacket.PACKET_TYPE, - wrapHandler(UseNetworkBoundItemPacket::handle) + UseSlotReferencedItemPacket.PACKET_TYPE, + wrapHandler(UseSlotReferencedItemPacket::handle) ); ServerPlayNetworking.registerGlobalReceiver( SecurityCardPermissionPacket.PACKET_TYPE, diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ClientModInitializer.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ClientModInitializer.java index 08f60497a..8ddc97359 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ClientModInitializer.java +++ b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ClientModInitializer.java @@ -53,7 +53,6 @@ import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.DISK_DRIVE; import static com.refinedmods.refinedstorage.platform.common.content.ContentIds.PORTABLE_GRID; import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createIdentifier; -import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslationKey; public final class ClientModInitializer extends AbstractClientModInitializer { private ClientModInitializer() { @@ -109,7 +108,7 @@ public > void @SubscribeEvent public static void onRegisterKeyMappings(final RegisterKeyMappingsEvent e) { final KeyMapping focusSearchBarKeyBinding = new KeyMapping( - createTranslationKey("key", "focus_search_bar"), + ContentNames.FOCUS_SEARCH_BAR_TRANSLATION_KEY, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_TAB, ContentNames.MOD_TRANSLATION_KEY @@ -118,7 +117,7 @@ public static void onRegisterKeyMappings(final RegisterKeyMappingsEvent e) { KeyMappings.INSTANCE.setFocusSearchBar(focusSearchBarKeyBinding); final KeyMapping clearCraftingGridMatrixToNetwork = new KeyMapping( - createTranslationKey("key", "clear_crafting_grid_matrix_to_network"), + ContentNames.CLEAR_CRAFTING_MATRIX_TO_NETWORK_TRANSLATION_KEY, KeyConflictContext.GUI, KeyModifier.CONTROL, InputConstants.Type.KEYSYM, @@ -129,7 +128,7 @@ public static void onRegisterKeyMappings(final RegisterKeyMappingsEvent e) { KeyMappings.INSTANCE.setClearCraftingGridMatrixToNetwork(clearCraftingGridMatrixToNetwork); final KeyMapping clearCraftingGridMatrixToInventory = new KeyMapping( - createTranslationKey("key", "clear_crafting_grid_matrix_to_inventory"), + ContentNames.CLEAR_CRAFTING_MATRIX_TO_INVENTORY_TRANSLATION_KEY, InputConstants.UNKNOWN.getValue(), ContentNames.MOD_TRANSLATION_KEY ); @@ -137,13 +136,22 @@ public static void onRegisterKeyMappings(final RegisterKeyMappingsEvent e) { KeyMappings.INSTANCE.setClearCraftingGridMatrixToInventory(clearCraftingGridMatrixToInventory); final KeyMapping openWirelessGrid = new KeyMapping( - createTranslationKey("key", "open_wireless_grid"), + ContentNames.OPEN_WIRELESS_GRID_TRANSLATION_KEY, KeyConflictContext.IN_GAME, InputConstants.UNKNOWN, ContentNames.MOD_TRANSLATION_KEY ); e.register(openWirelessGrid); KeyMappings.INSTANCE.setOpenWirelessGrid(openWirelessGrid); + + final KeyMapping openPortableGrid = new KeyMapping( + ContentNames.OPEN_PORTABLE_GRID_TRANSLATION_KEY, + KeyConflictContext.IN_GAME, + InputConstants.UNKNOWN, + ContentNames.MOD_TRANSLATION_KEY + ); + e.register(openPortableGrid); + KeyMappings.INSTANCE.setOpenPortableGrid(openPortableGrid); } private static void registerBlockEntityRenderer() { diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ModInitializer.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ModInitializer.java index 0ce029cb5..97d07acf3 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ModInitializer.java +++ b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ModInitializer.java @@ -37,7 +37,7 @@ import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.SecurityCardResetPermissionPacket; import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.SingleAmountChangePacket; import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.StorageInfoRequestPacket; -import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.UseNetworkBoundItemPacket; +import com.refinedmods.refinedstorage.platform.common.support.packet.c2s.UseSlotReferencedItemPacket; import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.EnergyInfoPacket; import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.GridActivePacket; import com.refinedmods.refinedstorage.platform.common.support.packet.s2c.GridClearPacket; @@ -600,9 +600,9 @@ private static void registerClientToServerPackets(final PayloadRegistrar registr wrapHandler(StorageInfoRequestPacket::handle) ); registrar.playToServer( - UseNetworkBoundItemPacket.PACKET_TYPE, - UseNetworkBoundItemPacket.STREAM_CODEC, - wrapHandler(UseNetworkBoundItemPacket::handle) + UseSlotReferencedItemPacket.PACKET_TYPE, + UseSlotReferencedItemPacket.STREAM_CODEC, + wrapHandler(UseSlotReferencedItemPacket::handle) ); registrar.playToServer( SecurityCardPermissionPacket.PACKET_TYPE, From 6e779a1000a9fe2c1d0d4183aeeedb9978f78e87 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sat, 6 Jul 2024 22:08:03 +0200 Subject: [PATCH 4/4] fix: extra dark backgrounds due to rendering bgs too much --- CHANGELOG.md | 1 + .../platform/common/support/AbstractBaseScreen.java | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8bae29a2..75604f94f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Fixed Relay model not being able to load correctly. - Fixed not being able to ghost drag resources from recipe viewers into filter slots on NeoForge. +- Fixed extra dark backgrounds due to drawing background on GUIs twice. ## [2.0.0-milestone.4.2] - 2024-07-06 diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseScreen.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseScreen.java index 1057a1ba4..d4ae30e09 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseScreen.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseScreen.java @@ -90,7 +90,6 @@ protected void renderBg(final GuiGraphics graphics, final float delta, final int @Override public void render(final GuiGraphics graphics, final int mouseX, final int mouseY, final float delta) { - renderBackground(graphics, mouseX, mouseY, delta); super.render(graphics, mouseX, mouseY, delta); renderTooltip(graphics, mouseX, mouseY); }