z+1;C6V8)U%acJ5kX#q)|nKLuCEeVPL)6+H$rPR?I+vl9GuYWJ7L|aR;fRiNfaA`NO
zEGqk)0~KoXT#(N0X7?Gd?R#yH1<0N`ptdiKqH}jQ1?=bIv19v3b0ol0+Piy_?ru^E
z+cVP{C|D0!@>^SyBZ-o>soR1?BpW>il4Xh1^0CL$L7Q!9n)1ol9{*G+L}Z^iQ_0iG
z?ncj0@4J}~KVWUqC%QAELXvxL8~ase>75XCH}BG!Ir2QFyLazG$3MhKGSnuC?Q>>4
z$2KrKJ2x9BkY>Z%ADPgRus#u5BeC3Mn{1k8CD4aL`Um@&@Z1252Iv3)002ovPDHLk
FV1jCmt^@!8
delta 539
zcmV+$0_6RI1GEH?B!Bx!L_t(|+9gs=v)dpHL?AHOaoXhl|3hbb=%329oym04_}Py6
zrc0hKHXyB5yW(Fze>71ZkH5~j>*Y$M*7Y;^<2YU^hEj?o60L`ns+10wDHB`xzxI?8-FWRVgm4B2l)=ptrDx6
za;|xv=kt7?rfFT5ZQBNf(Migj^E5g@#1z?R-GqAVYdAdMot*}2Q2AV*W-thJP9aM4
zCs9DshmcZ0uX#S9&7b>kN%G^0_zG~^;jN`KPEXvKWH-9Wle!zrc$qLUkajCJ2|DQdG0wX-oCV~|2}N~zYmEGq(5
zfV3dWB~v04l-zw7t%ab_5J$dTE=bxoRm2QxR+^v;$~lnNFS|KM`G4j#v`7Z?jYu(u!pRs!>p1S^sX)^vVV
dV07!;e-r|+PT>v(Y!Lte002ovPDHLkV1iEm1&ROw
diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Ore/Silver.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Ore/Silver.png
index 56a298978727714d052ed06f6d0bde0c22c3e89d..4975a85814128ca685a31234523daafb605e87f7 100644
GIT binary patch
delta 371
zcmV-(0gV3S1dRibBYy!@Nkl(V);sGc$W#x1_{C0Q7&6T#YEc?V8o>NF)*f
zC5Tr=3jq5w3jPQrz_$!kgrurSobEX%NdZZY&+$y`6I%oTQGYuia1NZaiEWec=sb@I
zn@NarM1UeokRXe`mJ&NY_VYY_;mk-9g@4SF;Qk5KHugb9Q6%)!1C?ya0N5F!Ly<($
zwj9pP?92!x0iaWvl(hGC9q|oEP~=FvJ2Lsaya6
delta 588
zcmV-S0<-;%1LOpdBYy%bNklJEEcDnK+o8JFUNt>jk
zXo)1ggTBY#zWqH|Glg*q{{8)Ju=c*LTJz;H5<*J3EBgK4a$nXtgs*>n<&Te#l21@#
zG!v2cqZ{1kwn}RVsI^({n^Jh0FNg}H@!R{Gg7B&N*pf?SDXswdNELH@H$8D(WrO
zT8-vy+xU4LUDEaCONxnzMTD8OHs^U9XJjHxI9M|nlTyqj@xTB4FdA#g&Uw~cYLPB6
zr(7!%)R?T%%nV97KkUzqTdR9YQnPn%+wR2JMb>rEOkKo#7h_aNr3pw6A@Fe?qcg_P
zc|5{A$NhQ6^M5?gruFErrB-e1eS1iUVKB~n&N(}Sy=$d_6z=<;QUm~ICSuKers&5h
zrA$b*3SXwt8X}}=499s&@5GEq-g{y#UEJV}v5&`N-=9(o|M~g?y=lX>HD-OBhjYX2
z^=7TjDM@SAVl5dFwbs%qU$3F$)S*jjr55MhD%>21Mkf?XC)}U%k+T_v%6n2nS6?AC=(0_dYj)V#+%;D$H
zUyS4jW0?8Z??n+0-ZN4cIgZ^JE;(uDJ;rGY&*vkA2?3^Y4D-aFk4MhwkJlUY-fKYx
z=W%rCpha*F*V?N0W2^Pc_38#2Q|2R{2(Yd9+sl=mmEP@OV@!ag&2YQSIh`p+1xlKv
a6#oZ`ic_Ge6#Os%0000WIDwb-|Rt}3sNh3!maZusIes?P8IX)Dhutb`%ow@2z5_$BQu00000NkvXXu0mjf
D7+aC|
delta 406
zcmV;H0crls0yL8huz)Bc+GTBAu#TiFp_qJbOVEGX4%~{Yjv;LLs22S&%+sOO>OV?WR)^uKEEU(
z9IUm@wGI)Pr4C!J%Wk{mL{XWW?T86-a;@X{{eBPUxAz}gZ4go`kc=8skP;Hw%5&l4
z4OLa;W}s)Tj(^D9!A36FpD{~T=6;K9Uzl05R#$Fw8KaI+BK?;%gd}MLDV^1TB9FiK
zHP`L?9z=n@E};5MeVUBvg*`K`Db@2H(3eJFGXm(IetUnLnWu~KR0tAyN!8F1k{lUz
z+X<~cJtyu0pdex31YROOQ9X;t{n7o{mX!4m>tOjEfDcahs{jB107*qoM6N<$f)8H8
A1ONa4
diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Ore/Tin.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Ore/Tin.png
index 6fc9a24023b35736fe0fddc63985d1daddb10b55..8977a97b3bc9c0d3672f798915521cbb5d61481f 100644
GIT binary patch
delta 356
zcmV-q0h|7^1pfk%B!5OpL_t(2kwsELmL)L=0yO{r$DQs(m_@37yYt0>0>mwHtyNW$
zN<}Hj-uvh0U+i}V2>NM~a|R$;pd{G_Kr(nM0HD9tMnbYmRYj6SNfiGW@MQp0q=*+W
z2>?k;%O2Y#lhl2#uFqQCr3WuFgFs@hCPflJg1$R^KA-NUXn)%tdty*3vAQIEIlHP>
zcXwAQNfO%tNl65sx%Ub+NtGlenFrpaNCBDg%(gQ#i9vK=Aix8D@kokDJhR6W+YSPd
z4a9MB-3bY)R=28bj}InEK=8_{A_)ir9V)DUu6E
z5uws`nn@5KL|yoPxUwTjjPGHWfn-TtRRQe*=;X|tGkfoIc4Dz_3OczskMv9u%<+Nu
z-oL;5oSQ;-$3`W#6Ci=@I0zirIWv3j8`2~sX8a#e#SmIfrt8T70000<{h4k3oP1R*9`)|b590RQ#*QNEw2!Kz|Ip^)=e!uj7Jioq#$pHe0u;%>sxHA9(n12bFfYnykby?Hu6Lb1d
z-L@QK6bUIU%aQ~D5rq(L*W0p05uQ^=AEoTaah%TQbxkow)j=%14+$YHF>YJFUe4G1
zt@l=2J&tPAS>${^|9F3xna){{<2Vk<`4j`)ZkKh<&*zt#n&}uC<9dI6xLa#=d)aEM
zIwpf?+fJ`<*MBHs^s(2Y^`>gfe7W3NxYgZE;qG82GMz!KjiEt8*-Ptzc^}ef`
zs*cg-bY@{#X+K7M}07@0@{=bTbXLPY<(uBm+QA|fJ7ln{dH1b;|}Iw&o?M7iHCJm;Ja8}#Q{
zr?ILoNz4Yh3A5RBCpXh>1k9-c029ByKHT}Yf1Ts{shMDU0X(BKKm_rPu
b9De}?UlKySlZ2Zb00000NkvXXu0mjf;>`f&
diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Other/Clay.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Other/Clay.png
index 204944247193b91f0e8384aa3c4b8bff5b95df0e..f77e2b59111fd5ef4548d3a88c08ecff27f602d5 100644
GIT binary patch
delta 312
zcmV-80muH11k(bLB!3!7L_t(2kv)>ju^2H7!vL*YOi?K%J!XX*ye~dzJR|By(m%g{
z%`k&L@x)W??iL6{_R2!Qndupx$FXQ>7lGv>whf9g<%~YlGmJkNO`ZV?$d(Y*PMQW`
z853fVtfVe(kg@08L4X}=mf428@pl4vQ?GIUE&(x#bQixpQh!m&XbU*+QWb}t5nd{U
z{+GvxDbC(6jOeRyCqyRuP2*D70m`qcFA>AflO1{tTR5ZP4ScOGohqR0GfC2$=NUIf
z=K@d!!4lEczU$ZX+!2?Xt5s`+s^&04z8IcoV55j7QS#efY1lEK@riTOU383}<;KrE
zARi@#=W>b^=rJ<>=mr)q*M0jgTc^Ell6#ADRoiOaguNEIiv0tUsrjsCkbrFf0000<
KMNUMnLSTXdCy{Ib
delta 500
zcmVm1<-kslw=!e&;UVyvz+XuYj4`vmMPBM
z+jHXYpFjS*eZBnyHAXS$_#5!o&jtq0H2G#X^IA
zlo!=huyTKBYnnuy(lR5&RseqKKl@+8?R7jO_yt>uy)kDI4D3^zfND;rvu5=;P
zVzEzp)9jvKHoCDHVv8zTI6ayf0X6Fi6Kd-HL`D4GM}bNzh}a@UI9!`Ik#fVZmFXA4
zgF?Du3qsq>AT;hnkR@XCT6DUmQ>{!9q33Pjh}8nclx;A@7LQiX^4FBN)NnioO|=Jt
z^EP}7nkuP+s;VrBZg4a8c3l@~>TU1MqK0P=hwmp=;Ipd!J?*(9y32h)^rPf!^{U6h
q)@_k5fwOkAeX!=LU#I-@ss91iNMPudCDxn(0000@X_BVSx9`>uT6Mqz$K}Y=VWprVRTMO{sAu2Sb2I+Tn*j;0000dsGu
z7>beiRM$ZgT3b>TdyKX%tz;_K*?1bRA*A~6OJF$PZ{DbC<2&fq1^;0+`t
z7`!DIe1N1RgD;Q)BqbUAfJlnLUy30BNJ=vVNHYXVGn_ja^$BR^JWm(LkcwNZ2N|21
z9XOZ|FgU)B{r^9-RNN!I;#p>+SbaiX=xm4CD+C1^If7XEYRs6L48OkW%)XF*-|a$+
zqtjROY$5aI_H68T9tC{aAoQuNRYB8FZQhHrq`uix1f{tJ^XE@p`E?V+(WPA$DXU#1
zkDk?Mi->iM+IYYy`u%~~ugX3+Zs_7DdMy>j)#0x)Y1bU(g-@pWeYnq5y_oy$uUT~>
Xi_fI@a?jNP1p|YptDnm{r-UW|LwsMU
diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Other/Gravel.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Other/Gravel.png
index 76d786f1efceaf7466f4f942963d00c9295864b3..07f5382ea0b39353db29845983aa23f815dfe0d7 100644
GIT binary patch
delta 148
zcmV;F0Biq<065H74%}>TltiCugd1wM!0^w!hA+{3!;(+*-cmVQD6(&{`P&r{s9u{Q^!^EooEY3vDQ~WM)X-NwccDA+AP)DfayT}j
zpu}Hlx{#U(Uy|vhrcroBkJ*Q?@mh&W{~8*%LWb+1@vsnU|CR+ccT0MONCOq|iA<(a)Fv|};ech{FxG)DeY*zpP002ovPDHLkV1gB@aBBbn
delta 364
zcmZo+`olCqvYwfNfk8u;KNv_g2Ka=ycG}r>IXHAVI(9ocb~!n91Cg_HkF#^Pi%XA-
zOSh|QkE?4hkaTnF1tNF%UJs8xAoBF=_w?-Z^6Cd7Z|@1--u*s46M)FqccQQF1V6ut
zK;-W~$=`osK)|GcfXRV@lY@dL2M54B1NgF7uFVFX&Hdr&}s>m*>j%{uo
zk}vn2%6Z#1(RjygCllVc*E?nX>;80XsebmUsphGD;Gw2xAG~h(0KLHA>FVdQ&MBb@
E0B-`AsQ>@~
diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Other/Regolite.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Other/Regolite.png
index ca97a0db44114570a9270a31534494ddb39dd168..eda23e8e0448597db13df5d85524cf635b255a32 100644
GIT binary patch
delta 226
zcmV<803H9G0`mco8Gix*005AYXf^-<0J=#;K~yM_g_2PY!!QU#?I`!Z!ajP?w+|p8
zskEW0LV%5d_<25(Y&CO4Tv0#>Nn%P!21!V=91iIeCVprH&FX-l(!m1h1bnpWB@2~;
z7RmhB!c%m7fe7x-)d2r2iKg3v7U8Nmwvo2s-#x2AqI^~
zwCzopr
E06O`G761SM
diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Other/Sand.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Other/Sand.png
index d5612c913743e4bdff28efc96f417601d71c8607..35fade543fe2d2f12fec39a0363ae882d15dc556 100644
GIT binary patch
delta 225
zcmV<703QF%0{j7xBYyzHNklG|9SkQN|I4uGDfcqg$h~~J+X&jL?!^s?N!o#NDz{OYOr%Q
z&`qgphHdepb6{}3O=HEP!6~IAf!y@df=qa!@+uv&3RbxO}@1h^vDnj31=r{MO>U$K6^2%ZC?1DWspqJ@pxn
b3QX${6`f%4<$VEk00000NkvXXu0mjfh%aTx
delta 307
zcmV-30nGmV0nGxCBYy!DNklX=+L$eBXaTdn(0oU$0NXFQId@$z
zx`m*;bSiu1Z?8>^ZV;lUr7GAXN%qVKs;ftGKDvnzc+pULDu3C@KI|X>v>&_sqVvih
zlP0=QP<(@e_JOv*s2YtD&6M`^uaoMf6b5Kp25X|-_)|tJ+%&481D3+a27^7ZE{zTp
zYL=!Q3_y>Ak!30F1N9|41N08l68hY7f&K00fhe41eF7jBYy#0NklFyL}k8?6~BcLKW%Rb5?C;_Xj=0*xED0Z`@k=70T;T`s#CgSWd{ilG!I
zAW-bsvM)lC1OivlR!GRQl9D3|cZRZcNpic#D^i{3k%Bqq#*rjll$`F8yWK3hb2X^<
z`^QMuiAa$o3nV4U?#{ED9d|WW&-17KwxUQ8c2N!7MY)~%ejm_wSGjk-E=vX^Ud3%=
zZ!}2B?cD9{d~~{ccT8hRmISe>GPaUlcezaN&7Kwn-G6GLNWg!aR8@DsyoRp+&?ShJ
zylvj>0<*ijm$T_^A)|J`>mcuWveDcnnrCKa=PvI$h25%Fe*{GA>F)3bNt?{+qJNA?
Z_%FWB1wZ$Edd~m=002ovPDHLkV1ghAyW9W(
delta 572
zcmV-C0>k~41JneNBYy%LNkl~gS&ydHr<{p0vwNr
z)9H}1Y}+P8)V4m3E`^7jh9T#I*LQ#3KYZ(B9RLxTQXN3};6bl1FSV4+GKyrx#F$I2
zV{J{>bw$8&tf^!TkCcvIexqM6m;Es0fXY-EP+MU-@AscyUxrdd7$Ptt9C99zvy4P6
z5^mTw5DEnE2!C$-TJz=QexJ9d^L;)NcVM89`FblQC+4=yx;{LhnR!GKF>_&B-P&sF
z<3T`6d&v56$6m1H*88$Gvk2rsOey7@mvyzSt*H>XgIY)t2y1Osb9YsDOr=WB%uEn9
zr?wBq&j`VUh>@58Fy(wc9d}c8bARg^9^cF;BI)>G`mOFu*`U
z*&Pl#}Lnx7$xM
z?`Gg$k~LIGO}of2xjRv^)-W0qm!Wz<4{)G)S=^nF0K-B1rvC%$_FgUTbOAL00000<
KMNUMnLSTY>y%eJW
diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Basalt.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Basalt.png
index c57cf1aafc0db298c3e5829b4d3edec5129ef87e..e4ace661b962216a2f744b282b6a528ed252dd5a 100644
GIT binary patch
delta 259
zcmV+e0sQ`x1D*nqBYyzpNkl``_2jfP`kz6S2ie?()+|F|SP;zJlWT!NOv-8+O^!~VoOwSVB+v5mR~C{6$X002ov
JPDHLkV1g<$d~E;#
delta 377
zcmV-<0fzpb0+R!fBYy!}Nkl;5;Ye`9B&&=~Y
zPV7`w0+Il2lOzcez}Q9doD;$`okNP`*Vpbo_jlqXT1t|MW`732%#7VLAV^9ANHPf!
z03IU&qH|6X0suar4+s!91ptsFw?KC%F5BlEiX^o}^7;F(yKjf@Atwen6W!@^`j)#8
zNnVuFnz3yXwqr;V2#KEQZUB4lz4uy6Qi3ETNLCez0!b*bZFH~CUiDI+dAB9ldy}-M
z93zMWz;P&1a{~sDaVh@RdNfM+8
zijro0A^;Nrz1BLFkVKLMU?YVB0D`0>kljtO-|zQ*-}mPpZ+}WvMNl?CktC~&B&F-R
zy1QSmm&c!czTYpv=j&2{gMegrSJic0YpsV5h&%&GDvC~E>)flVx~r?IZ6^`c-Ktva
z>TVFRJ!6|B0FopV^nKs6N7D6rt+jex-IZkTy%T$E@9$1PQZpxEldMu#m2}8<71#0z
zNE~}+X6*J10Dtk>+RRQw5=a$G4Pf>-C)~DA(ZqZ21E(Ys5=8+3U>lgkO|q(z%%1TM
zAhNr3FRlb{&G$=FFkO22Z*&Ov0yNrNOsxwCn9nf&xb5F%wA#aSWil
ofPQqSDk;g#%6E~GR7PpqEs}_00000NkvXXt^-0~g1A+<;Q#;t
delta 594
zcmV-Y0I~Hm1ob
zF3VFXWvz96-)NI_uBC#6T=KSUj5DE$Kmrj3?{m(zlo(=8`F}hN=kq{BA^4ONC>3H{
z=0!L+gb*LMM+lxV=G=gY`>`M1lhzWT)XD@0rAQMI!LQHX_uFlKKG#?7ofAUFnAUCO
zLgZ42&{|uT$~bF`xxQcF9n#kg_?Q+O|E9W7l=Ll-u9$ZC&?u
z>-!!RnZ^hKjB|PYd7bCEl+yS8c^dm+u(kt$oO23+)w*rlzV9(6g-ArwjjrTuwEq92
zlsbIyJ`kZMr2r&Y
zdr}Iwb>H`+Fy=#e%nxwAGi?(?@FDmRUfU*xK!9l+t?jg?7?Uw3*BVoJy*!MUQ7KhQ
zA*}@fB1_g%K?pYt#uy>Eb54_fEX%UY{_rqeE{s+0eb;r}+gq(Hc>iX*w$&*`O;j1%
gkDUll?TMB855cNLFH?^4cK`qY07*qoM6N<$f-dSJMgRZ+
diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Dolomite.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Dolomite.png
index fcdb3f3cda67a358675e433b81438764d7469902..3ae0dacf31d3cf357e87c99bef0dba503a617ba9 100644
GIT binary patch
delta 352
zcmV-m0iXWN1o{GyBYy!wNklFEObP(5LefGPo%{`~%(
zIZ1%-wkyf*CXpn`c9kUoyJ?s0pUskVwadE!c6WCJ-rd-GH7#&eQAx_SEd>O#NoEFi
z_pQjCCC1X5kt`7)8)uUpfLv8NB)hm|fh2)sl-OP`+@~cZsedIUcTa$gBy*)wx%e)f
za1YZ-1OQ1uiX>Z=l5FV;Hc8Ueon4YIDgygLoWy0@LYwSv^Tk`b47<7ud3Te&RgiXp
zcOJ`CMk29Y-I8WBli3CS6L!XS6uxmuyP28K^PJ}-xi^0W$tLFg3m`V^%;$NY&vWJw
zs@rywK65yc-C0$3Nq7UCb3V^AXCQW2l1S3oJ##=?RaLUANtl_P+wJb^ZUjm5HEuwX
y@nJ}^L0JBVK(YHens80H?j#8AB)2^PLHq+Ak{L4SK0&Mi0000N
zO_{+AAgxxPM8DtPb4pyB5Yiv~>+!gSFkfd)Ms=MOJPb}7jcZw!S}M8TosOs5?Vk4C
z8l#kwEM8w;?vEwa%(a%Bpn_LxwCyb^A^YB`j{ePatql>zn16Ly4+p<)+m=%6x_O?7
zbQS_$sN|Az7R=K$S!)_{S{uiy)Y4n4q>LfdoQ&_%9$RB-fzs=af`2-irqMaqT0@^H2LM(C7~Xp#Dz)VrlqN!>^z1ZrT>1E2fj=EU_dOe_5(l?2uxrQ
zY&f+ATm>bFOPV5mNE`?XP?5va+7XY+@5xav3&8p9H-YibL+H51UpmM-qw93lK6lR*
fM-Vmd&u;PsrdcD2>8W-A00000NkvXXu0mjfW<@k9
delta 138
zcmV;50CoSG0j2?vB!6v5L_t(|+C`4RZ3ICK!$_a2OaJ8r!+Xqb@-jd}68Gmbo|6(n
zE1&=(vGcrMz9lmKfnU*a08I8M6!X;VpmHXKbmwLZMBTXxh
ze}!h}oO9063~5qC;D|-
zCvghLF_5H*MpktCs!e+@C`s(c1|2^}Tr*qUI)SA3=fN$(wtMZ$EDLdvDuytvRnTh7bv}6i!4$6k#A(YY_l2v)TfLNPj$T2@VjRF0}xX
zh_v2WBs>X;YAGHT;pf*YGmh5|5N69vmnk4*CIBE3BC47YqkpQInpIrxbGio-yV*F;?RFz3B61Ju(t2Z&j0C_rFE^*-ctu3-t=3vw14PIK0Dz1P
z_Yf`-c^rFYMucQUX7<)gtB9DHX727HRn?B;7-Q5@-Q7%Yw@n_;XRXa6HW2`r*EQ#e
z03so#*KzdT0e_%~Fp;^@uit;9Rzzar%!JHLV5Zg@B9tN#jtGEot$FObFqPg}*R}7j
zwpCS?BKP|P0o&HUUN2_WwK8*@=a?rEi7vgab*=U9^PjnwQcM>yU2|^R2AO6$#)*hb
zM49nzonwSYs}&$K;n?@cFgGbBGc!|FYiX46Jrcu1b$dZ30=hdQ&M_lGL`ta<5gtpI
zj4=|zO*2Edm>Ch782}RVJO=@0MrO`yx`n7NGgC7}lu~PJx)uP4NO&OPaqMnB#>h-0
zR07*qoM6N<$
Eg0ptw(*OVf
diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Gneiss.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Gneiss.png
index 99657b4d810fdb7e99585282f2ca378609d37397..363870c1401b4b02e62f6c2553891ba8c3b16967 100644
GIT binary patch
delta 257
zcmV+c0sj7v1DpboBYyznNklxN6NNAcE00NxXe3**pyK$Q}^0?NuO06B$(RyJ_XqX%E3Zu?hR|&2k
zYQT1KU=T>1^SI%vAkU<|y_|{GIYD|A&ChjbI~&_Ql4^dyyXY=6i+=L$rn+W_e$OqjEd0mQi?LH*w{(vrl^wrR00000NkvXX
Hu0mjfXRdp^
delta 373
zcmV-*0gC>d0*?cbBYy!_Nkl8^_Z6o~`kc_|d_An^`E-=6U
z`!zTea>;WSP&yuDNYe{{;K?>4@*$9cqdp*MQn=YrC}JMS!<6QDE_ZOLwVN9vhb}@D
zDQnncLIPa&*znc*vW6?}U^6R`!Y>Bq`Cbns$4uqLj)6coV1I$Q#4ek;@1wA+wklN~
zdDdFrFRJwj8H|=p;w{L$6mrR?V!eJe5bB^Xcns==#`LIQ#n{J2~p5iJ~
z(4>P*v@TdTxo%C084C%yJWDrKmaxe&5LB>yhe)kTz_K?NtK{G>ROVm)(8~Z1=nW}$
z^90dw>n^hlPj2&Sh{#Em1Jn_-{ljRh^uv4k*^GwftE=#TkO%9)
Tn%x_u00000NkvXXu0mjfg0!-R
diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Limestone.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Limestone.png
index f798fdfc0ef0c86c05d78b9730c36dd654b5c794..bb262497288d84bcbb875194e25d5c0d7a76aa10 100644
GIT binary patch
delta 319
zcmV-F0l@yb1KI+RB!3}EL_t(2kwub0b|oH{g;5g}5G9086+}F9e@K!@bab|tuqPB5M?mN3#TZ~|w}Px}NK$|b9=$qB5>_ik
zDgi2a3V?C$nYnYnb&^VT)k$h$Nk82w&;dB;%+CYB5L2O(N`F<-sm}W$QzzA{7?SnH
z(Gl}bxD5r<=Tv>FuX72@r0U?{NQdY5RH{Cw`qPeeVM%4BRE(mJV@Xw?>W_{#?#n(_
zQi#s_9w0^PR2_Qf7Ul(n)c*;Yu{MyLq^s96)nCBtOdfm)F(=hABJeInLO@a1t4$`7
z^QO3+%bN%6PB^$X1(k4ce6}*eZ$@t*Phx8ooO{1tnpZ`VP2)NPB&CxK@DGuP-jJXf
RfPMe~002ovPDHLkV1moIk`e#_
delta 415
zcmV;Q0bu^x0=WZ_B!7TOL_t(|+BK3vk`zf01Lcay>K+VuFF)eWzqqXJ4op{NXb%N<
z$z*b=e|-P8j?e4y1!|w~uaAFbE_+oUk}_M^F7V8reRkEuZZHU!y(CFWA_**v8*GtG
z_jV3Utwoash!oB)2bKN;$Tz{@Z0?ASTe*Xy;fU6(t
z@l|y9TNFSNv|YLtu0CJ?;)1dlc%Q$(lwAi#0*ny03f$FCf!+2Jp1H2qe>x&44(uBP
zfZOg~$7e~ntCpmho!R^P00V`EZjarr)xF-5!Bur65ohL7GIKEnCauJ7yP>-JnQXAV
zq7jPA6j+(rXMdv9Rs9q$-0S$1BpFGHOv!yOB_)~ckIZ$qm(q9{B$8|P70T7P5m7Qb
zGuTox*JK*(T43oIpMS?{Ny?13qMOy9gsO!Lmm=3fKuJmV-WQ21`+kSPjZ4y8rzBUq
z4qVA(ayh>%ngA?}V#Kxp>l+*vmC
zE(fJ~x+JjM7K7NXFKoh?xSp*6AFbJzCb45lNdr2Ca3F5+FL**)YV|ck_;kbJ9p!93
zi%WV_jvc$(p5K(DJRGiNCSa}%CUh07<=QPIA4YXX_ob#u>Lco;FWG4xKnFkup!OcE
z8G&a<+)f>9LT#4U70(%7W`ST>rJkO=FX4Q%+}>jd@gMj@ul-2eDpvpi002ovPDHLk
FV1n+ZKxOIO%33opTOA`}zKyncYP|$0MsGO%lYJu`S8nbl2kZ`7X^y
zNJ7ZAP?KydSyDM;L6e=CBtRNtDFjksXf~8hJY!3enn*y~zJE$dZ7If}q!im@8$ci-
zXeCKbA_M?uW^CK%bsA4-+ZNfSyAQBQ8_+KA7q7r2q_jfG%1*n_(-ufeL9{)zn?SR>
z*=*(8F!xrh{!-gv8is{^wZM
zxvop1l=AiU^=qQM?^`e)#NfVksjBnqI<&i6du*iL{dJwBW6N%vW_JPTQ3JAM*;d-T
zlN$=}B8A3&c^=WWW4%|U%-cv_`@-15NWe)d(K2J9u_PsFU8?a9B#V;f9{|S}+p@KH
Qw*UYD07*qoM6N<$g0Hx>O#lD@
diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Rhyolite.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Rhyolite.png
index fdfcfdec9309c403e0911f5eca29e160b154d86d..4d4041496c73a4b14c7673cf733b2b5530ec3556 100644
GIT binary patch
delta 317
zcmV-D0mA;{1K0wPB!3@CL_t(2ku{Rh4P`k9L(d^8XRFy(ru~UMAKXVIqC~gB
zUth$TIrp4L6gj8Bgz=
zQ#EC2Y!VQLvB)oG=Ki`$8M9k)pxn1oOoyl4Xfsv{#QcHw#=a?eu>bO2~EiS)K()f~pBg)=H+#4Ss
P00000NkvXXu0mjf0neB{
delta 457
zcmV;)0XF{F0^GWFQybEFjalZW39!^wkc<%(pVAG<5LVGO$lt?^Xh(tt6JwE4kJrmNo
zpXc-Z`Tg}
zxpNV!n)`l#{d~Vq-}enVq&_E*VRJfD=RN-dw-{5(@-WY300000NkvXXu0mjf0FmQW
diff --git a/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Sandstone.png b/rabcrClient/Default/Textures/Blocks/BlockBackgrounds/Stone/Sandstone.png
index 120819b7f3aee8a65ceb062b3ef7e6260239b8f7..7fa2574608b613b83f4fbda57c2837d45ce771d4 100644
GIT binary patch
delta 363
zcmV-x0hIox1cn2UB!5jwL_t(2kv)<@j$J_r1Ivb)oF=EswQ|CF-F6o5D+q}V;Icq}
z|NI7KXLh{fUC&66Hfd9YM7cNj=VyaK)>JNPo7}hb-U>-*KtR#91yYPaO`C9U?#X!&
zp3$r{Ei~Jkg2!}t!#-3EYHf@gyy3yA=}=sU*FhxB#9z79Kg2S9DysJU&czD=_A+80Zs@)9B;6{Vz=RjgUh0_4!Uy$_LQ
z!Sd&NqM~iZ8)TAH+?>txKs#r?Rx{XYMAed}5v~TgZSURtJT%?qUHKpP&9pk4!ER2@
z+50NM$JLB&FroxXQl7@mz31#rDHzh;zCI-*Fub4BOOtzZ^A8{y4%ag2X2Jjf002ov
JPDHLkV1mA1wt4^n
delta 525
zcmV+o0`mQa1EvI!B!BHmL_t(|+6BQ2veP&a1MNzN^R>r2-;miXP+p=2S
zch0e2KYu*#+qSA!we2CbnK2_dBcVyjDwH5r0O`Y&K~lIb#2)8MIASm&kdZOi3Y&>q
z1_5A9OP?{Pk69}T(>zZCF{>Xh@4Il8?QZK0R0zp54Uy-^zkiaq_T?#}Gn_^Jc>BJO
z;~@CFyp7R5eU{S5VY8oFB(bs;X-&rw=WAZqIL?>>wj7iBU6!UQU^NxBrLNDXZl77f
znDf65cP^%;QWipxxc8k&z{MWVr{0Q|mfi^^t^p7zw=ds_$@jl%3-d&{kIR;7&+lJT
z#JvY0j^F8ni+?Tme{@+X!8w5_%ct~9nXN5WZ?`0}wZ-|SQdpR%m30NlJP%ebZ6h%y
z5n@(0klS*nOjH92faotmGF+9QE7z)8!H&3CU>S!_R%=Nrrc4>B{q;d&s>Wr5Euw{V
zk^^wde#9Ky?xaj$wMNRO;$wgf*UoGxo0SThew>y^AAiE>qdgu3%Xx98mBJ+6_n1lD
z>(>ps1SC^zzJJ3i@lCE#NP>augebF6Cj25by7mN!Nb1c--*uswH$TTXd#Md#oWx>c
z1wI8d-yhmekjybGNhN~9XUFJ!Z_DlZ&6Wo5R9AtG_a7BP-)G=D&i?_nuUqQCvc`4*
P0000kK$I&VLVfl=mTEhX{h8sh3Ld
z_urqH0oq>Yx~`T2fh37BA)1-_{QR8jDkM3?R`=CQ?Y-+ys?`
za(WfjB&)gV&l`_v?i7b7t0u;`b2$Y5x
zqk4P^cM-Q`X0`|h3t^>S0#8c6t^h5ufv9>m$W!+{kK?#2bJEmxH)($1Pc?aq_3QN3
zy(0L4&wHfLuA%#|bo5*W{PQyO@xGT&=G)qe%xoMT&|lw?EXJ=a8p
zNJcCekYlUDTA7(NVa(X@z1Q$(
ze+&SguWomW>hA8&wJ<$Bim0lYnKnrnnak5NGj?`&WOR*jC9Y?AT-Du8(qq^FNZu;j
zNpWV@lc6*Qz<+g3w|mA=YG$fB^o^mEC`lAxfcM_6jtJW@Jj1mBj2$6KB58XthR;4Q
zp4UTC5wIg7G9n`)49rZP&jAsc3O%o7KqQ#;*_5OZ8PfNX#60`jrtZ)0AKMXOIHb&&
zail_V_W6Q5&Z-6w)c$M$-Mw;+Cn6#ljOwB!qPu4-5-rbbMMhWOeZ{!9_C5eIqPk{=
ef?<#EKK}ugTuJ$=1meX20000pA=KtIOIUitSd-GubmH+ww|Nr0rW4>(U6wZSwHODq|H#R2fKK7U4l8}&?
z=WOW5x?WO3BJN@E2d-5d>zk%ataESp|LXtz|LI2-H#9!nFCO>uAveQH55;iVZ)+uh
P)-ZUw`njxgN@xNA#vndr
literal 0
HcmV?d00001
diff --git a/rabcrClient/Default/Textures/Blocks/Stalactite/stalactite1.png b/rabcrClient/Default/Textures/Blocks/Stalactite/stalactite1.png
new file mode 100644
index 0000000000000000000000000000000000000000..36abb3266a37ef9b104dbe11f32e9990273b9f77
GIT binary patch
literal 207
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6I14-?iy0XB6G519h5hnOpkSk?
zi(`n!#H)RVT!$P4T<=#g6iZ3#Pjp_gb;GtV0pH{fIB_sady1AEJjDEBbAhlE&+Xr{
zB>&a(Ff;53_hu-si!?meyNhkZhoyGE(k7;{ykmHHl5@rKLo=nXZ;?-LDOkw0Yz^zI
zm#l{pD>Rty_8TPqP**=PbIc|B10x$}rHZ!gX{b0CQIfJh^6gzbbzTPAlFqpwp+Ru?m56g;2*jbXjGLJLFabdVJcp00i_
I>zopr0Kg_SEC2ui
literal 0
HcmV?d00001
diff --git a/rabcrClient/Default/Textures/Blocks/Stalactite/stalactite3.png b/rabcrClient/Default/Textures/Blocks/Stalactite/stalactite3.png
new file mode 100644
index 0000000000000000000000000000000000000000..aa13a74f477e6324422ea74aaae713ab84287086
GIT binary patch
literal 202
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6I14-?iy0XB6G519h5hnOpkR%s
zi(`n!#I@%(@*Z;FaeFAfVBz9ZL6NN+gDwVca%FSy6rG_Eq~g&3OyEgTxoCar&H1{{
z9qj4$mXo`d8`MQCcN9LLYRR_!UWo0#GV}YJsxC4WoMl+R{9qpYUn!maE3PgN6>FIM
xc+=+YBL`yGYHNylzolL<6p3Sb+-m=X_nxKQ`@}$hpfea4JYD@<);T3K0RY*sNIU=l
literal 0
HcmV?d00001
diff --git a/rabcrClient/Default/Textures/Blocks/Stalactite/stalactite4.png b/rabcrClient/Default/Textures/Blocks/Stalactite/stalactite4.png
new file mode 100644
index 0000000000000000000000000000000000000000..eb9320c1f0ce1d5c7e8078daf6018d87d8e25d80
GIT binary patch
literal 233
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6I14-?iy0XB6G519h5hnOpx|sz
z7sn8diA#G7xehsqu&N6QSg#g|JD^>`#{V>yMO*vmu~WuJ;(SyOMrbom-FVYwv0^VX
z_wW1Cat|(C>e{ND|LUGyeoWi1Jf?M5BCmdBn9-gsF6tn6uYCjWLAD0&0F#y%Cz%?U
zTRvTiX%Kn!kjdimkoULoKmXr&QJ3Mu4__ozB&K}O6i7};5Kv#@ATpmRaD~zwE|rB6
x)<5*W{=fbI|9|~|>BpBoxK__`qd|v@!S}cLqmG*|&H_zk@O1TaS?83{1OOi+HX#52
literal 0
HcmV?d00001
diff --git a/rabcrClient/Default/Textures/Blocks/Stalagmite/stalagmite1.png b/rabcrClient/Default/Textures/Blocks/Stalagmite/stalagmite1.png
new file mode 100644
index 0000000000000000000000000000000000000000..36abb3266a37ef9b104dbe11f32e9990273b9f77
GIT binary patch
literal 207
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6I14-?iy0XB6G519h5hnOpkSk?
zi(`n!#H)RVT!$P4T<=#g6iZ3#Pjp_gb;GtV0pH{fIB_sady1AEJjDEBbAhlE&+Xr{
zB>&a(Ff;53_hu-si!?meyNhkZhoyGE(k7;{ykmHHl5@rKLo=nXZ;?-LDOkw0Yz^zI
zm#l{pD>Rty_8TPqP**=PbIc|B10x$}rHZ!gX{b0CQIfJh^6gzbbzTPAlFqpwp+Ru?m56g;2*jbXjGLJLFabdVJcp00i_
I>zopr0Kg_SEC2ui
literal 0
HcmV?d00001
diff --git a/rabcrClient/Default/Textures/Blocks/Stalagmite/stalagmite3.png b/rabcrClient/Default/Textures/Blocks/Stalagmite/stalagmite3.png
new file mode 100644
index 0000000000000000000000000000000000000000..eb9320c1f0ce1d5c7e8078daf6018d87d8e25d80
GIT binary patch
literal 233
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6I14-?iy0XB6G519h5hnOpx|sz
z7sn8diA#G7xehsqu&N6QSg#g|JD^>`#{V>yMO*vmu~WuJ;(SyOMrbom-FVYwv0^VX
z_wW1Cat|(C>e{ND|LUGyeoWi1Jf?M5BCmdBn9-gsF6tn6uYCjWLAD0&0F#y%Cz%?U
zTRvTiX%Kn!kjdimkFIM
xc+=+YBL`yGYHNylzolL<6p3Sb+-m=X_nxKQ`@}$hpfea4JYD@<);T3K0RY*sNIU=l
literal 0
HcmV?d00001
diff --git a/rabcrClient/Functions/FastMath.cs b/rabcrClient/Functions/FastMath.cs
index 7614d0a..bebef93 100644
--- a/rabcrClient/Functions/FastMath.cs
+++ b/rabcrClient/Functions/FastMath.cs
@@ -52,6 +52,11 @@ static class FastMath {
float dx=x1-x2, dy=y1-y2;
return (float)System.Math.Sqrt(dx*dx+dy*dy);
}
+
+ public static int Distance(int x1, int y1, float x2, float y2) {
+ float dx=x1-x2, dy=y1-y2;
+ return (int)System.Math.Sqrt(dx*dx+dy*dy);
+ }
///
/// Smooth linear function
///
@@ -72,7 +77,7 @@ static class FastMath {
return (int)System.Math.Sqrt(dx*dx+dy*dy);
}
- public static Color Lerp(Color value1, Color value2, float amount) {
+ public static Color Lerp(Color value1, Color value2, float amount) {
float _amount=1-amount;
return new Color(
(byte)(value1.R*_amount + value2.R*amount),
@@ -91,12 +96,12 @@ static class FastMath {
//---┘ -╯
/// Smooth linear function
/// From 0 to 1
- public static float Smooth(float input) {
+ public static float Smooth(float input) {
if (input<0.5f) return 2*input*input;
else return -2*(input-1)*(input-1)+1;
}
- public unsafe static float InvSqrt3 (float x) {
+ public unsafe static float InvSqrt3(float x) {
float xhalf = 0.5f*x;
int i = *(int*)&x;
i = 0x5f3759df - (i>>1);
@@ -104,7 +109,7 @@ static class FastMath {
x *= (1.5f - xhalf*x*x);
return x;
}
-
+
public static int Abs(int input) => input>=0 ? input: -input;
public static float Abs(float input) => input>=0f ? input: -input;
diff --git a/rabcrClient/Functions/FastRandom.cs b/rabcrClient/Functions/FastRandom.cs
index b767fa8..5a99f8e 100644
--- a/rabcrClient/Functions/FastRandom.cs
+++ b/rabcrClient/Functions/FastRandom.cs
@@ -3,32 +3,34 @@
using System.Collections.Generic;
namespace rabcrClient {
- public class FastRandom {
+ public static class FastRandom {
#region Data Members
// Constants
const double DOUBLE_UNIT = 1.0 / ( int.MaxValue + 1.0 );
// State Fields
- ulong x_, y_;
+ static ulong
+ x_ = (ulong)Guid.NewGuid().GetHashCode(),
+ y_ = (ulong)Guid.NewGuid().GetHashCode();
// Buffer for optimized bit generation
- ulong buffer;
+ static ulong buffer;
- int freeBuffer;
+ static int freeBuffer;
#endregion
#region Constructor
/// Constructs a new generator using two random Guid hash codes as a seed.
- public FastRandom() {
- y_ = (ulong)Guid.NewGuid().GetHashCode();
- x_ = (ulong)Guid.NewGuid().GetHashCode();
- }
+ //public static FastRandom() {
+ // y_;
+ // x_
+ //}
/// Constructs a new generator with the supplied seed.
/// The seed value.
- public FastRandom(ulong seed) {
+ public static void SetSeed(ulong seed) {
x_=seed<<3;
x_=seed>>3;
}
@@ -37,14 +39,16 @@ public class FastRandom {
#region Public Methods
/// Generates a pseudorandom boolean.
/// A pseudorandom boolean.
- public bool Bool() {
+ public static bool Bool() {
if (freeBuffer > 0) {
freeBuffer--;
return ((buffer>>=1) & 1) == 0;
}
+ x_ ^= x_ << 23;
+
ulong temp_x = y_;
- x_ ^= x_ << 23;
+
y_ = x_ ^ y_ ^ ( x_ >> 17 ) ^ ( y_ >> 26 );
x_ = temp_x;
@@ -54,33 +58,59 @@ public class FastRandom {
return (buffer & 1) == 0;
}
- public int Int2() {
+ public static int Int2() {
if (freeBuffer > 0) {
freeBuffer--;
return (int)((buffer>>=1) & 1);
}
+ x_ ^= x_ << 23;
+
ulong temp_x = y_;
- x_ ^= x_ << 23;
y_ = x_ ^ y_ ^ ( x_ >> 17 ) ^ ( y_ >> 26 );
x_ = temp_x;
-
+
buffer = y_ + temp_x;
freeBuffer=64-1;
return (int)(buffer & 1);
}
- public int Int4() {
+ public static int IntPlusMinusOne() {
+ if (freeBuffer > 0) {
+ freeBuffer--;
+ return (int)((buffer>>=1) & 1);
+ }
+
+ x_ ^= x_ << 23;
+
+ ulong temp_x = y_;
+
+ y_ = x_ ^ y_ ^ ( x_ >> 17 ) ^ ( y_ >> 26 );
+ x_ = temp_x;
+
+ buffer = y_ + temp_x;
+
+ freeBuffer=64-1;
+ int z=(int)(buffer & 2);
+ #if DEBUG
+ if (z!=2 && z!=0) throw new Exception();
+ #endif
+
+ return z-1;
+ }
+
+ public static int Int4() {
if (freeBuffer > 1) {
freeBuffer-=2;
return (int)((buffer>>=2) & 0x00000000000003);
}
+ x_ ^= x_ << 23;
+
ulong temp_x = y_;
- x_ ^= x_ << 23;
y_ = x_ ^ y_ ^ ( x_ >> 17 ) ^ ( y_ >> 26 );
x_ = temp_x;
@@ -90,34 +120,34 @@ public class FastRandom {
return (int)(buffer & 0x00000000000003);
}
- public int Int8() {
+ public static int Int8() {
if (freeBuffer > 2) {
freeBuffer-=3;
return (int)((buffer>>=3) & 0x00000000000007);
}
+ x_ ^= x_ << 23;
+
ulong temp_x = y_;
- x_ ^= x_ << 23;
y_ = x_ ^ y_ ^ ( x_ >> 17 ) ^ ( y_ >> 26 );
x_ = temp_x;
buffer = y_ + temp_x;
-
+
freeBuffer=64-3;
return (int)(buffer & 0x00000000000007);
}
- public int Int16() {
+ public static int Int16() {
if (freeBuffer > 3) {
freeBuffer-=4;
- int y=(int)((buffer>>=3) & 0x0000000000000F);
- return y;
+ return (int)((buffer>>=3) & 0x0000000000000F);
}
- ulong temp_x = y_;
+ x_ ^= x_ << 23;
- x_ ^= x_ << 23;
+ ulong temp_x = y_;
y_ = x_ ^ y_ ^ ( x_ >> 17 ) ^ ( y_ >> 26 );
x_ = temp_x;
@@ -127,19 +157,20 @@ public class FastRandom {
return (int)(buffer & 0x0000000000000F);
}
- public void Byte2(List list) {
+ public static void Byte2(List list) {
if (freeBuffer > 0) {
freeBuffer--;
list.Add((byte)((buffer>>=1) & 1));
return;
}
+ x_ ^= x_ << 23;
+
ulong temp_x = y_;
- x_ ^= x_ << 23;
y_ = x_ ^ y_ ^ ( x_ >> 17 ) ^ ( y_ >> 26 );
x_ = temp_x;
-
+
buffer = y_ + temp_x;
freeBuffer=64-1;
@@ -149,15 +180,16 @@ public class FastRandom {
/// Generates a pseudorandom byte.
/// A pseudorandom byte.
- public byte Byte() {
+ public static byte Byte() {
if (freeBuffer >= 8) {
freeBuffer-=8;
return (byte)((buffer>>=8) & 0x000000000000FF);
}
+ x_ ^= x_ << 23;
+
ulong temp_x = y_;
- x_ ^= x_ << 23;
y_ = x_ ^ y_ ^ ( x_ >> 17 ) ^ ( y_ >> 26 );
x_ = temp_x;
@@ -167,15 +199,16 @@ public class FastRandom {
return (byte)(buffer & 0x000000000000FF);
}
- public byte Byte128_Plus128() {
+ public static byte Byte128_Plus128() {
if (freeBuffer >= 7) {
freeBuffer-=7;
return (byte)((buffer>>=7) & 0x0000000000007F + 128);
}
+ x_ ^= x_ << 23;
+
ulong temp_x = y_;
- x_ ^= x_ << 23;
y_ = x_ ^ y_ ^ ( x_ >> 17 ) ^ ( y_ >> 26 );
x_ = temp_x;
@@ -185,16 +218,17 @@ public class FastRandom {
return (byte)(buffer & 0x0000000000007F + 128);
}
- public void Byte(List list) {
+ public static void Byte(List list) {
if (freeBuffer >= 8) {
freeBuffer-=8;
list.Add((byte)((buffer>>=8) & 0x000000000000FF));
return;
}
+ x_ ^= x_ << 23;
+
ulong temp_x = y_;
- x_ ^= x_ << 23;
y_ = x_ ^ y_ ^ ( x_ >> 17 ) ^ ( y_ >> 26 );
x_ = temp_x;
@@ -207,22 +241,26 @@ public class FastRandom {
/// Generates a pseudorandom 32-bit unsigned integer.
/// A pseudorandom 32-bit unsigned integer.
- public uint UInt() {
- ulong temp_x=y_;
+ public static uint UInt() {
x_^=x_<<23;
+
+ ulong temp_x=y_;
+
y_=x_^y_^(x_>>17)^(y_>>26);
x_=temp_x;
return (uint)(y_+temp_x);
}
-
+
/// Generates a pseudorandom double between 0 and 1 non-inclusive.
/// A pseudorandom double.
- public double Double() {
+ public static double Double() {
+
+ x_ ^= x_ << 23;
+
ulong temp_x = y_;
- x_ ^= x_ << 23;
y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26);
x_ = temp_x;
@@ -231,164 +269,216 @@ public class FastRandom {
/// Generates a pseudorandom float between 0 and 1 non-inclusive.
/// A pseudorandom double.
- public float Float() {
+ public static float Float() {
+ x_ ^= x_ << 23;
+
ulong temp_x = y_;
- x_ ^= x_ << 23;
y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26);
x_ = temp_x;
return (float)(DOUBLE_UNIT * (0x7FFFFFFF & (y_ + temp_x)));
}
+
+ public static float Rotatin() {
+ x_ ^= x_ << 23;
+
+ ulong temp_x = y_;
+
+ y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26);
+ x_ = temp_x;
+
+ return (float)(DOUBLE_UNIT * (0x7FFFFFFF & (y_ + temp_x)))*6.28318530717958647693f;
+ }
#endregion
- public bool Bool_20Percent() {
+ public static bool Bool_20Percent() {
+ x_ ^= x_ << 23;
+
ulong temp_x = y_;
- x_ ^= x_ << 23;
y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26);
x_ = temp_x;
return (DOUBLE_UNIT * (0x7FFFFFFF & (temp_x + y_))) < 0.2;
}
- public bool Bool_33_333Percent() {
+ public static bool Bool_33_333Percent() {
+ x_ ^= x_ << 23;
+
ulong temp_x = y_;
- x_ ^= x_ << 23;
y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26);
x_ = temp_x;
return (DOUBLE_UNIT * (0x7FFFFFFF & (temp_x + y_))) < 0.33333333333;
}
- public bool Bool_10Percent() {
- ulong temp_x = y_;
+ public static bool Bool_10Percent() {
- x_ ^= x_ << 23;
+ x_ ^= x_ << 23;
+ ulong temp_x = y_;
y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26);
x_ = temp_x;
return (DOUBLE_UNIT * (0x7FFFFFFF & (temp_x + y_))) < 0.1;
}
- public bool Bool_11_111Percent() {
- ulong temp_x = y_;
+ public static bool Bool_11_111Percent() {
- x_ ^= x_ << 23;
+ x_ ^= x_ << 23;
+ ulong temp_x = y_;
y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26);
x_ = temp_x;
return (DOUBLE_UNIT * (0x7FFFFFFF & (temp_x + y_))) < 0.11111111111111;
}
- public bool Bool_5_555Percent() {
- ulong temp_x = y_;
+ public static bool Bool_5_555Percent() {
- x_ ^= x_ << 23;
+ x_ ^= x_ << 23;
+ ulong temp_x = y_;
y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26);
x_ = temp_x;
return (DOUBLE_UNIT * (0x7FFFFFFF & (temp_x + y_))) < 0.0555555555555556;
}
- public bool Bool_2Percent() {
- ulong temp_x = y_;
+ public static bool Bool_2Percent() {
- x_ ^= x_ << 23;
+ x_ ^= x_ << 23;
+ ulong temp_x = y_;
y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26);
x_ = temp_x;
return (DOUBLE_UNIT * (0x7FFFFFFF & (temp_x + y_))) < 0.02;
}
- public bool Bool_5Percent() {
+ public static bool Bool_5Percent() {
+ x_ ^= x_ << 23;
+
ulong temp_x = y_;
- x_ ^= x_ << 23;
y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26);
x_ = temp_x;
return (DOUBLE_UNIT * (0x7FFFFFFF & (temp_x + y_))) < 0.05;
}
- public bool Bool_75Percent() {
- ulong temp_x = y_;
+ public static bool Bool_75Percent() {
x_^=x_<<23;
+
+ ulong temp_x = y_;
+
y_=x_^y_^(x_>>17)^(y_>>26);
x_=temp_x;
- return (DOUBLE_UNIT*(0x7FFFFFFF&(temp_x+y_)))<0.75;
+
+ return (DOUBLE_UNIT * (0x7FFFFFFF & (temp_x+y_))) < 0.75;
}
-
- public bool Bool_1Percent() {
- ulong temp_x = y_;
+
+ public static bool Bool_1Percent() {
x_^=x_<<23;
+ ulong temp_x = y_;
y_=x_^y_^(x_>>17)^(y_>>26);
x_=temp_x;
return (DOUBLE_UNIT*(0x7FFFFFFF&(temp_x+y_)))<0.01;
}
-
- public bool Bool_25Percent() => Int4()==1;
- public bool Bool_12_5Percent() {
+ public static bool Bool_25Percent() {
+ if (freeBuffer > 1) {
+ freeBuffer-=2;
+ return (int)((buffer>>=2) & 0x00000000000003)==1;
+ }
+
+ x_ ^= x_ << 23;
+
ulong temp_x = y_;
+
+ y_ = x_ ^ y_ ^ ( x_ >> 17 ) ^ ( y_ >> 26 );
+ x_ = temp_x;
+
+ buffer = y_ + temp_x;
+
+ freeBuffer=64-2;
+ return (int)(buffer & 0x00000000000003)==1;
+ }
+
+ public static bool Bool_12_5Percent() {
x_^=x_<<23;
+
+ ulong temp_x = y_;
+
y_=x_^y_^(x_>>17)^(y_>>26);
x_=temp_x;
+
return (DOUBLE_UNIT*(0x7FFFFFFF&(temp_x+y_)))<0.125;
}
- public byte Byte3() {
+ public static byte Byte3() {
+ x_ ^= x_ << 23;
+
ulong temp_x = y_;
- x_ ^= x_ << 23;
y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26);
x_ = temp_x;
return (byte)(DOUBLE_UNIT * (0x7FFFFFFF & (temp_x + y_)) * 3);
}
- public int Int3() {
+ public static int Int3() {
+ x_ ^= x_ << 23;
+
ulong temp_x = y_;
- x_ ^= x_ << 23;
y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26);
x_ = temp_x;
return (int)(DOUBLE_UNIT * (0x7FFFFFFF & (temp_x + y_)) * 3);
}
-
- public int Int5() {
+
+ public static int Int5() {
+ x_ ^= x_ << 23;
+
ulong temp_x = y_;
- x_ ^= x_ << 23;
y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26);
x_ = temp_x;
return (int)(DOUBLE_UNIT * (0x7FFFFFFF & (temp_x + y_)) * 5);
}
- public Color ColorMonogame() => new Color(UInt() | 0xFF000000);
+ public static Color ColorMonogame() {
+ x_^=x_<<23;
+
+ ulong temp_x=y_;
+
+ y_=x_^y_^(x_>>17)^(y_>>26);
+ x_=temp_x;
+
+ return new((uint)(y_+temp_x) | 0xFF000000);
+ }
- public unsafe System.Drawing.Color ColorSystemDrawing() {
- uint r=UInt() | 0xFF000000;
+ public static unsafe System.Drawing.Color ColorSystemDrawing() {
+ uint r = UInt() | 0xFF000000;
return System.Drawing.Color.FromArgb(*(int*)&r);
}
- public int Int(int minValue, int maxValue) {
+ public static int Int(int minValue, int maxValue) {
+ x_ ^= x_ << 23;
+
ulong temp_x = y_;
- x_ ^= x_ << 23;
y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26);
x_ = temp_x;
return (int)(DOUBLE_UNIT * (0x7FFFFFFF & (temp_x + y_)) * (maxValue-minValue)) + minValue;
}
-
- public int Int(int value) {
+
+ public static int Int(int value) {
+ x_ ^= x_ << 23;
+
ulong temp_x = y_;
- x_ ^= x_ << 23;
y_ = x_ ^ y_ ^ (x_ >> 17) ^ (y_ >> 26);
x_ = temp_x;
diff --git a/rabcrClient/GImageButton.cs b/rabcrClient/GImageButton.cs
index 0bcd97d..e692c7b 100644
--- a/rabcrClient/GImageButton.cs
+++ b/rabcrClient/GImageButton.cs
@@ -25,7 +25,7 @@ public enum State :byte{
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
BackColor =Color.FromArgb(0,255,255,255);
- (timer=new Timer {
+ (timer=new Timer {
Interval=40
}).Tick+=Timer_Tick;
}
diff --git a/rabcrClient/GenLiveObject.cs b/rabcrClient/GenLiveObject.cs
index 9039dd9..4599413 100644
--- a/rabcrClient/GenLiveObject.cs
+++ b/rabcrClient/GenLiveObject.cs
@@ -3,7 +3,7 @@
namespace rabcrClient {
// For generating, (little bit bigger ram)
- public abstract class GenLiveObject {
+ public abstract class GenLiveObject {
public int IdNumber;
public static int TotalCreated;
@@ -14,7 +14,7 @@ class GenCactus : GenLiveObject {
public UShortAndByte Root;
public List Titles;
- public GenCactus(int x, int y) {
+ public GenCactus(int x, int y) {
Root=new UShortAndByte((ushort)x, (byte)y);
Titles=new List();
IdNumber=TotalCreated;
@@ -30,7 +30,7 @@ public class GenTree : GenLiveObject {
public List TitlesLeaves;
public List TitlesWood;
- public GenTree(int x, int y) {
+ public GenTree(int x, int y) {
Root=new UShortAndByte((ushort)x, (byte)y);
TitlesLeaves=new List();
TitlesWood=new List();
@@ -43,7 +43,7 @@ public class GenTree : GenLiveObject {
public void AddWood(int x, int y) => TitlesWood.Add(new UShortAndByte((ushort)x, (byte)y));
}
- enum LiveObjectType : byte{
+ enum LiveObjectType : byte{
Grass,
Plant,
Cactus,
diff --git a/rabcrClient/InterLogic/Data/SoundEffects.cs b/rabcrClient/InterLogic/Data/SoundEffects.cs
index bd5b697..ac5926d 100644
--- a/rabcrClient/InterLogic/Data/SoundEffects.cs
+++ b/rabcrClient/InterLogic/Data/SoundEffects.cs
@@ -1,7 +1,7 @@
namespace rabcrClient {
static class SoundEffects {
public static volatile Microsoft.Xna.Framework.Audio.SoundEffect
-
+
// Eating
Eat,
diff --git a/rabcrClient/InterLogic/DrawComponents/Classic/Components/GButton.cs b/rabcrClient/InterLogic/DrawComponents/Classic/Components/GButton.cs
index d127dd3..2780903 100644
--- a/rabcrClient/InterLogic/DrawComponents/Classic/Components/GButton.cs
+++ b/rabcrClient/InterLogic/DrawComponents/Classic/Components/GButton.cs
@@ -68,18 +68,18 @@ public enum Orientation :byte{
}
public Orientation SetOrientation {
- get => currentOrientation;
- set {
+ get => currentOrientation;
+ set {
currentOrientation = value;
Invalidate();
}
}
public bool Disamble {
- get => disamble;
- set {
- disamble = value;
- Invalidate();
+ get => disamble;
+ set {
+ disamble = value;
+ Invalidate();
}
}
@@ -150,8 +150,8 @@ public enum Orientation :byte{
sb = new Pen(new SolidBrush(Color.Black));
}
- int SizeBounds3=SizeBounds/3,
- SizeBounds6=SizeBounds/6,
+ int SizeBounds3=SizeBounds/3,
+ SizeBounds6=SizeBounds/6,
SizeBounds2=SizeBounds/2;
using (Bitmap nb=new Bitmap(buttonSize.Width, buttonSize.Height)) {
@@ -279,7 +279,7 @@ public enum Orientation :byte{
Size buttonSize=new Size(Size.Width-3,Size.Height-3);
Pen sb = new Pen(new SolidBrush(Color.Black));
Brush b = new LinearGradientBrush(ClientRectangle, Color.FromArgb(alpha, alpha, alpha), Color.FromArgb(alpha-40, alpha-40, alpha-40), 90);
-
+
using (Bitmap nb=new Bitmap(buttonSize.Width,buttonSize.Height)) {
if (Orientation.Left==currentOrientation) {
using (Graphics g2 = Graphics.FromImage(nb)) {
@@ -328,7 +328,7 @@ public enum Orientation :byte{
}
}
- int smallW=(int)(buttonSize.Width*Constants.TextBlur)+2,
+ int smallW=(int)(buttonSize.Width*Constants.TextBlur)+2,
smallH=(int)(buttonSize.Height*Constants.TextBlur)+2;
shadow?.Dispose();
@@ -343,13 +343,13 @@ public enum Orientation :byte{
}
BitmapData bdout=shadow.LockBits(new Rectangle(0, 0, smallW, smallH), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);
-
+
byte* pointer = (byte*)bdout.Scan0.ToPointer();
-
+
// one third of alpha
byte* max=pointer+smallW*smallH*4;
for (pointer+=3; pointer selected;
- set {
- selected = value;
- Invalidate();
+ get => selected;
+ set {
+ selected = value;
+ Invalidate();
}
}
@@ -268,7 +268,7 @@ enum State :byte{
g.DrawImage(nb, new Point(1, 1));
if (!Custom) g.FillRectangle(new SolidBrush(color),new Rectangle(4,4,buttonSize.Width-4-2,buttonSize.Height-4-2));
-
+
// NativeMethods.Text(g, Constants.font14,Text,pos.X,pos.Y,255);
}else if (State.Click==currentState){
// if (shadow!=null) {
@@ -385,7 +385,7 @@ enum State :byte{
g2.DrawRectangle(sb, new Rectangle(0, 0, buttonSize.Width-1, buttonSize.Height-1));
}
-
+
using (Bitmap small=new Bitmap((int)(buttonSize.Width*Constants.TextBlur)+2, (int)(buttonSize.Height*Constants.TextBlur)+2)){
using (Graphics gT = Graphics.FromImage(small)) {
gT.CompositingQuality=CompositingQuality.HighQuality;
diff --git a/rabcrClient/InterLogic/DrawComponents/Classic/Components/GTextBox.cs b/rabcrClient/InterLogic/DrawComponents/Classic/Components/GTextBox.cs
index 4b01d4f..f496dd7 100644
--- a/rabcrClient/InterLogic/DrawComponents/Classic/Components/GTextBox.cs
+++ b/rabcrClient/InterLogic/DrawComponents/Classic/Components/GTextBox.cs
@@ -82,7 +82,7 @@ public partial class GTextBox:UserControl {
public string TextInTextBox {
- get => textBox.Text;
+ get => textBox.Text;
set => textBox.Text=value;
}
diff --git a/rabcrClient/InterLogic/DrawComponents/Classic/Components/GeDoPanel.cs b/rabcrClient/InterLogic/DrawComponents/Classic/Components/GeDoPanel.cs
index 802db2b..2711528 100644
--- a/rabcrClient/InterLogic/DrawComponents/Classic/Components/GeDoPanel.cs
+++ b/rabcrClient/InterLogic/DrawComponents/Classic/Components/GeDoPanel.cs
@@ -89,13 +89,13 @@ public class GeDoPanel : Control{
protected override void OnMouseDown(MouseEventArgs e) {
base.OnMouseDown(e);
- if (gedo!=null)
+ if (gedo!=null)
gedo.Click=true;
}
protected override void OnMouseUp(MouseEventArgs e) {
base.OnMouseUp(e);
- if (gedo!=null)
+ if (gedo!=null)
gedo.Click=false;
}
diff --git a/rabcrClient/InterLogic/DrawComponents/Classic/Help/GGeDo.cs b/rabcrClient/InterLogic/DrawComponents/Classic/Help/GGeDo.cs
index df99348..4e9e986 100644
--- a/rabcrClient/InterLogic/DrawComponents/Classic/Help/GGeDo.cs
+++ b/rabcrClient/InterLogic/DrawComponents/Classic/Help/GGeDo.cs
@@ -968,7 +968,7 @@ public class GGeDoStringRandom : GGeDoString{
public override void Draw(Graphics g) {
brush.Dispose();
- brush=new SolidBrush(Rabcr.random.ColorSystemDrawing()/* Color.FromArgb(Rabcr.random.Byte(),Rabcr.random.Byte(),Rabcr.random.Byte())*/);
+ brush=new SolidBrush(FastRandom.ColorSystemDrawing()/* Color.FromArgb(FastRandom.Byte(),FastRandom.Byte(),FastRandom.Byte())*/);
NativeMethods.Text(g, text, X, Y, brush);
}
}
diff --git a/rabcrClient/InterLogic/Game/BlockType/AnimatedBlock.cs b/rabcrClient/InterLogic/Game/BlockType/AnimatedBlock.cs
index 282ec0e..f3a8d92 100644
--- a/rabcrClient/InterLogic/Game/BlockType/AnimatedBlock.cs
+++ b/rabcrClient/InterLogic/Game/BlockType/AnimatedBlock.cs
@@ -2,14 +2,14 @@
using Microsoft.Xna.Framework.Graphics;
namespace rabcrClient {
- class AnimatedBlock :Block{
+ class AnimatedBlock:Block {
public float screen;
public float imageSpeed = 0;
readonly int height, width;
readonly float divideC;
public Vector2 Position;
public Texture2D Texture;
-
+ Rectangle rec;
public AnimatedBlock(Texture2D texture, Vector2 position, int w, int h, ushort id) {
Texture = texture;
@@ -18,17 +18,30 @@ class AnimatedBlock :Block{
height = h;
Id=id;
divideC=(Texture.Width-w)/(float)width;
+ rec=new Rectangle(width*(int)screen, 0, width, height);
}
+ private AnimatedBlock(){ }
+
public override void Draw() {
screen+=imageSpeed;
if (screen>=divideC) screen = 0;
+ rec.X=width*(int)screen;
- Rabcr.spriteBatch.Draw(Texture, Position, new Rectangle(width*(int)screen,0,width,height), ColorWhite);
+ Rabcr.spriteBatch.Draw(Texture, Position, rec/*new Rectangle(width*(int)screen, 0, width, height)*/, ColorWhite);
}
public override Block CloneDown() {
AnimatedBlock a = new AnimatedBlock(Texture, Position, width, height, Id);
+ /* AnimatedBlock a = new AnimatedBlock{
+ Texture=Texture,
+ Id=Id,
+ height=height,
+ width=width,
+ divideC=divideC,
+ Position=Position,
+ rec=rec,
+ };*/
Position.Y+=16;
return a;
}
diff --git a/rabcrClient/InterLogic/Game/BlockType/BasicWavingPlant.cs b/rabcrClient/InterLogic/Game/BlockType/BasicWavingPlant.cs
index 9e976ab..466544f 100644
--- a/rabcrClient/InterLogic/Game/BlockType/BasicWavingPlant.cs
+++ b/rabcrClient/InterLogic/Game/BlockType/BasicWavingPlant.cs
@@ -7,7 +7,7 @@ public class BasicWavingPlant: Block{
#region Varibles
public Vector2 Position;
public Texture2D Texture;
-
+
readonly Vector2 vecOrigin;
public int ticks;
public float offsed;
@@ -23,12 +23,12 @@ public class BasicWavingPlant: Block{
ticks=0;
}
- public override void Draw() => Rabcr.spriteBatch.Draw(Texture, Position+vecOrigin, null, ColorWhite, (float)System.Math.Sin(ticks/10f+offsed)*0.25f*(1-ticks/100f)/*(ticks/100f)*/, vecOrigin, 1f, SpriteEffects.None, 0);
+ public override void Draw() => Rabcr.spriteBatch.Draw(Texture, Position+vecOrigin, null, ColorWhite, (float)System.Math.Sin(ticks/10f+offsed)*0.25f*(1-ticks/100f)/*(ticks/100f)*/, vecOrigin, 1f, SpriteEffects.None, 0);
- public NormalBlock TurnOff() => new NormalBlock {
+ public NormalBlock TurnOff() => new NormalBlock {
Texture=Texture,
Position=Position,
- Id=Id
+ Id=Id
};
public override Block CloneDown() => null;
diff --git a/rabcrClient/InterLogic/Game/BlockType/BoxBlock.cs b/rabcrClient/InterLogic/Game/BlockType/BoxBlock.cs
index f6af5c6..a9c3c9e 100644
--- a/rabcrClient/InterLogic/Game/BlockType/BoxBlock.cs
+++ b/rabcrClient/InterLogic/Game/BlockType/BoxBlock.cs
@@ -2,7 +2,7 @@
using Microsoft.Xna.Framework.Graphics;
namespace rabcrClient {
- internal class BoxBlock:Block{
+ public class BoxBlock:Block {
public ItemInv[] Inv;
public Vector2 Position;
public Texture2D Texture;
@@ -14,10 +14,16 @@ internal class BoxBlock:Block{
Inv=new ItemInv[max];
}
+ private BoxBlock(){ }
+
public override void Draw() => Rabcr.spriteBatch.Draw(Texture, Position, ColorWhite);
public override Block CloneDown() {
- BoxBlock b=new BoxBlock(Texture, Id, Position, Inv.Length);
+ BoxBlock b=new BoxBlock{
+ Texture=Texture,
+ Position=Position,
+ Id=Id,
+ };//Texture, Id, Position, Inv.Length);
b.Position.Y+=16;
return b;
}
diff --git a/rabcrClient/InterLogic/Game/BlockType/CactusBlock.cs b/rabcrClient/InterLogic/Game/BlockType/CactusBlock.cs
index 7e7d45a..0ef8952 100644
--- a/rabcrClient/InterLogic/Game/BlockType/CactusBlock.cs
+++ b/rabcrClient/InterLogic/Game/BlockType/CactusBlock.cs
@@ -19,16 +19,12 @@ public class CactusBlock:Block{
Position = position;
}
- // public override void Draw() => Rabcr.spriteBatch.Draw(Texture, Position, ColorWhite);
-
-
- public void SetOrigin() {
+ public void SetOrigin() {
vecOrigin=-new Vector2(Position.X-cactus.Root.X*16/*+*/-8, Position.Y-cactus.Root.Y*16/*-8*/-8/*-16*/);
-
}
- public override void Draw() {
- if (cactus!=null) Rabcr.spriteBatch.Draw(Texture, Position+vecOrigin, null, ColorWhite, cactus.angle, vecOrigin, 1f, SpriteEffects.None, 0);
+ public override void Draw() {
+ if (cactus!=null) Rabcr.spriteBatch.Draw(Texture, Position+vecOrigin, null, ColorWhite, cactus.angle, vecOrigin, 1f, SpriteEffects.None, 0);
}
public override Block CloneDown() {
diff --git a/rabcrClient/InterLogic/Game/BlockType/Chicken.cs b/rabcrClient/InterLogic/Game/BlockType/Chicken.cs
index fa6f0eb..c6a962e 100644
--- a/rabcrClient/InterLogic/Game/BlockType/Chicken.cs
+++ b/rabcrClient/InterLogic/Game/BlockType/Chicken.cs
@@ -15,44 +15,158 @@ class Chicken :Mob{
public bool needToChangeChunk;
public MoveType moveType;
- public Chicken(/*ushort id,*/ byte height, /*byte lives, */int x, bool dir, Texture2D chTextureWalk, Texture2D chTextureEat/*, Random rnd*/) {
- //Height=height;
- // Position.Y=((float)height)*16;
+ public Chicken(byte height, int x, bool dir, Texture2D chTextureWalk, Texture2D chTextureEat) {
Position=new Vector2(x*16,height*16);
TextureWalk = chTextureWalk;
TextureEat = chTextureEat;
- // Lives=lives;
Frame=0;
Eat=false;
Dir=dir;
Id=(ushort)BlockId.Chicken;
}
- public Chicken(/*ushort id,*/ int height, int x, bool dir, Texture2D chTextureWalk, Texture2D chTextureEat) {
- // Height=height;
- // Position.Y=/*((float)*/height/*)*/*16;
+ public Chicken(int height, int x, bool dir, Texture2D chTextureWalk, Texture2D chTextureEat) {
+ Position=new Vector2(x*16,height*16);
+ TextureWalk = chTextureWalk;
+ TextureEat = chTextureEat;
+
+ Frame=0;
+ Eat=false;
+ Dir=dir;
+ Id=(ushort)BlockId.Chicken;
+ }
+
+ public unsafe override byte[] Save() {
+ ushort id=Id;
+ byte* mbytes=(byte*)&id;
+
+ return new byte[] {
+ mbytes[1],
+ mbytes[0],
+ Height,
+ Dir ? (byte)1 : (byte)0
+ };
+ }
+
+ public override void Draw() {
+ Frame+=8;
+
+ if (Eat) {
+ if (Frame>=TextureEat.Width) {
+ Frame=0;
+ Eat=false;
+ if (FastRandom.Int(3)==1)Dir=!Dir;
+ }
+
+ if (Dir) Rabcr.spriteBatch.Draw(TextureEat, Position,new Rectangle(Frame/16*16,0,16,16), Color.White);
+ else Rabcr.spriteBatch.Draw(TextureEat, Position, new Rectangle(Frame/16*16,0,16,16), Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0);
+ } else {
+ if (move) {
+ switch (moveType){
+ case MoveType.Walk:
+ moveCount--;
+ if (moveCount==0) {
+ move=false;
+ needToChangeChunk=true;
+ }
+
+ if (Frame>=TextureWalk.Width) {
+ Frame=0;
+ }
+
+ if (Dir) Position.X+=0.25f;
+ else Position.X-=0.25f;
+ break;
+
+ case MoveType.Fall:
+ moveCount--;
+ if (moveCount==0) {
+ move=false;
+ needToChangeChunk=true;
+ }
+
+ if (Frame>=TextureWalk.Width) {
+ Frame=0;
+ }
+ if (Dir) {Position.X+=0.25f; Position.Y+=0.25f;}
+ else {Position.X-=0.25f; Position.Y+=0.25f;}
+ break;
+
+ case MoveType.Jump:
+ moveCount--;
+ if (moveCount==0) {
+ move=false;
+ needToChangeChunk=true;
+ }
+
+ if (Frame>=TextureWalk.Width) {
+ Frame=0;
+ }
+
+ if (Dir) {Position.X+=0.25f; Position.Y-=0.25f;}
+ else {Position.X-=0.25f; Position.Y-=0.25f;}
+ break;
+ }
+ } else {
+ if (Frame>=TextureWalk.Width) {
+ Frame=0;
+ Eat=FastRandom.Int(5)==1;
+ if (FastRandom.Bool_20Percent())Dir=!Dir;
+ }
+ }
+
+ if (Dir) Rabcr.spriteBatch.Draw(TextureWalk, Position,new Rectangle(Frame/16*16,0,16,16), Color.White);
+ else Rabcr.spriteBatch.Draw(TextureWalk, Position, new Rectangle(Frame/16*16,0,16,16), Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0);
+ }
+ }
+ }
+
+ class MChicken :MMob{
+
+ public byte Frame;
+ public bool Eat;
+
+ readonly Texture2D TextureWalk, TextureEat;
+
+ public bool move;
+ public byte moveCount;
+ public short lastChunkID;
+ public bool needToChangeChunk;
+ public MoveType moveType;
+
+ public MChicken(byte height, int x, bool dir, Texture2D chTextureWalk, Texture2D chTextureEat) {
Position=new Vector2(x*16,height*16);
TextureWalk = chTextureWalk;
TextureEat = chTextureEat;
- // Lives=lives;
Frame=0;
Eat=false;
Dir=dir;
Id=(ushort)BlockId.Chicken;
}
- public unsafe override byte[] Save() {
+ public MChicken(int height, int x, bool dir, Texture2D chTextureWalk, Texture2D chTextureEat) {
+ Position=new Vector2(x*16,height*16);
+ TextureWalk = chTextureWalk;
+ TextureEat = chTextureEat;
+
+ Frame=0;
+ Eat=false;
+ Dir=dir;
+ Id=(ushort)BlockId.Chicken;
+ }
+
+ public unsafe override byte[] Save() {
ushort id=Id;
- byte* mbytes=(byte*)&id ;
-
- return new byte[]{
- mbytes[1],
- mbytes[0],
- Height,
- Dir ? (byte)1 : (byte)0
+ byte* mbytes=(byte*)&id;
+
+ return new byte[] {
+ mbytes[1],
+ mbytes[0],
+ Height,
+ Dir ? (byte)1 : (byte)0
};
}
@@ -63,7 +177,7 @@ class Chicken :Mob{
if (Frame>=TextureEat.Width) {
Frame=0;
Eat=false;
- if (Rabcr.random.Int(3)==1)Dir=!Dir;
+ if (FastRandom.Int(3)==1)Dir=!Dir;
}
if (Dir) Rabcr.spriteBatch.Draw(TextureEat, Position,new Rectangle(Frame/16*16,0,16,16), Color.White);
@@ -119,8 +233,8 @@ class Chicken :Mob{
} else {
if (Frame>=TextureWalk.Width) {
Frame=0;
- Eat=Rabcr.random.Int(5)==1;
- if (Rabcr.random.Bool_20Percent())Dir=!Dir;
+ Eat=FastRandom.Int(5)==1;
+ if (FastRandom.Bool_20Percent())Dir=!Dir;
}
}
diff --git a/rabcrClient/InterLogic/Game/BlockType/Fish.cs b/rabcrClient/InterLogic/Game/BlockType/Fish.cs
index c7afbdf..de7e435 100644
--- a/rabcrClient/InterLogic/Game/BlockType/Fish.cs
+++ b/rabcrClient/InterLogic/Game/BlockType/Fish.cs
@@ -34,15 +34,15 @@ class Fish :Mob{
Id=(ushort)BlockId.Fish;
}
- public unsafe override byte[] Save(){
+ public unsafe override byte[] Save(){
ushort id=Id;
byte* mbytes=(byte*)&id;
-
- return new byte[]{
+
+ return new byte[]{
mbytes[1],
- mbytes[0],
- Height,
- Dir ? (byte)1 : (byte)0
+ mbytes[0],
+ Height,
+ Dir ? (byte)1 : (byte)0
};
}
@@ -51,15 +51,15 @@ class Fish :Mob{
else Position.X+=speed;
- if (Rabcr.random.Bool()) speed += .01f; else speed -= .01f;
+ if (FastRandom.Bool()) speed += .01f; else speed -= .01f;
if (speed < .01) speed += .01f;
if (speed > 2) speed -= .01f;
}
public override void Draw() {
- if (Rabcr.random.Int(10)==1){
- if (Rabcr.random.Bool_12_5Percent()) Frame=!Frame;
- if (Rabcr.random.Int(20)==1) Dir=!Dir;
+ if (FastRandom.Bool_10Percent()){
+ if (FastRandom.Bool_12_5Percent()) Frame=!Frame;
+ if (FastRandom.Bool_5Percent()) Dir=!Dir;
}
if (Dir){
diff --git a/rabcrClient/InterLogic/Game/BlockType/FruitPlantWaving.cs b/rabcrClient/InterLogic/Game/BlockType/FruitPlantWaving.cs
index 407bf58..0475bed 100644
--- a/rabcrClient/InterLogic/Game/BlockType/FruitPlantWaving.cs
+++ b/rabcrClient/InterLogic/Game/BlockType/FruitPlantWaving.cs
@@ -7,15 +7,15 @@ public class FruitPlantWaving:Plant{
public int ticks;
public float offsed;
- public FruitPlantWaving(bool right) {
+ public FruitPlantWaving(bool right) {
vecOrigin=new Vector2(8, 16);
if (!right)offsed=FastMath.PI;
ticks=0;
}
-
- public override void Draw() => Rabcr.spriteBatch.Draw(GrowTexture, Position+vecOrigin, drawRectangle, Color.White, (float)System.Math.Sin(ticks/10f+offsed)*0.25f*(1-ticks/100f), vecOrigin, 1f, SpriteEffects.None, 0);
-
- public Plant TurnOff() => new Plant {
+
+ public override void Draw() => Rabcr.spriteBatch.Draw(GrowTexture, Position+vecOrigin, drawRectangle, Color.White, (float)System.Math.Sin(ticks/10f+offsed)*0.25f*(1-ticks/100f), vecOrigin, 1f, SpriteEffects.None, 0);
+
+ public Plant TurnOff() => new Plant {
GrowTexture=GrowTexture,
Position=Position,
Id=Id,
diff --git a/rabcrClient/InterLogic/Game/BlockType/LeavesBlock.cs b/rabcrClient/InterLogic/Game/BlockType/LeavesBlock.cs
index a6d8cd3..3dc8726 100644
--- a/rabcrClient/InterLogic/Game/BlockType/LeavesBlock.cs
+++ b/rabcrClient/InterLogic/Game/BlockType/LeavesBlock.cs
@@ -8,13 +8,13 @@ public class LeavesBlock:Block{
public Vector2 Position;
public Texture2D Texture;
public Tree tree;
-
+
Vector2 vecOrigin;
public Color Color;
#endregion
- public LeavesBlock() {
- Color=ColorWhite;
+ private LeavesBlock() {
+ // Color=ColorWhite;
}
public LeavesBlock(Texture2D texture, ushort id, Vector2 position) {
@@ -24,20 +24,21 @@ public class LeavesBlock:Block{
Color=ColorWhite;
}
- public void SetOrigin() {
+ public void SetOrigin() {
vecOrigin=-new Vector2(Position.X-tree.Root.X*16/*+*/-8, Position.Y-tree.Root.Y*16/*-8*/+8/*-16*/);
}
public override void Draw() {
- if (tree!=null) Rabcr.spriteBatch.Draw(Texture, Position+vecOrigin, null, Color, tree.angle, vecOrigin, 1f, SpriteEffects.None, 0);
- else Rabcr.spriteBatch.Draw(Texture, Position, Color);
+ if (tree!=null) Rabcr.spriteBatch.Draw(Texture, Position+vecOrigin, null, Color, tree.angle, vecOrigin, 1f, SpriteEffects.None, 0f);
+ else Rabcr.spriteBatch.Draw(Texture, Position, Color);
}
public override Block CloneDown() {
- LeavesBlock n = new LeavesBlock{
+ LeavesBlock n = new LeavesBlock {
Texture=Texture,
Id=Id,
- Position=Position
+ Position=Position,
+ Color=ColorWhite,
};
n.Position.Y+=16;
return n;
diff --git a/rabcrClient/InterLogic/Game/BlockType/MFish.cs b/rabcrClient/InterLogic/Game/BlockType/MFish.cs
new file mode 100644
index 0000000..88ffee1
--- /dev/null
+++ b/rabcrClient/InterLogic/Game/BlockType/MFish.cs
@@ -0,0 +1,97 @@
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace rabcrClient {
+ class MFish :MMob{
+ // public bool IsLeft;
+ public float speed;
+ bool Frame;
+ readonly Texture2D Texture1, Texture2;
+
+ public MFish(/*ushort id, */byte height, int x, bool dir, Texture2D fishTexture1, Texture2D fishTexture2) {
+ // Height=height;
+ Position=new Vector2(x*16+2,/*Height*/height*16+3);
+ Texture1 = fishTexture1;
+ Texture2 = fishTexture2;
+ Dir=dir;
+ // random=rnd;
+ //Lives=lives;
+ Frame=false;
+ speed = 1;
+ Id=(ushort)BlockId.Fish;
+ }
+
+ public MFish(/*ushort id,*/ int height, int x, bool dir, Texture2D fishTexture1, Texture2D fishTexture2) {
+ // Height=height;
+ Position=new Vector2(x*16+2,/*Height*/height*16+3);
+ Texture1 = fishTexture1;
+ Texture2 = fishTexture2;
+ Dir=dir;
+ // random=rnd;
+ //Lives=lives;
+ Frame=false;
+ speed = 1;
+ Id=(ushort)BlockId.Fish;
+ }
+
+ public unsafe override byte[] Save(){
+ ushort id=Id;
+ byte* mbytes=(byte*)&id;
+
+ return new byte[]{
+ mbytes[1],
+ mbytes[0],
+ Height,
+ Dir ? (byte)1 : (byte)0
+ };
+ }
+
+ public override void Update() {
+ if (Dir) Position.X-=speed;
+ else Position.X+=speed;
+
+
+ if (FastRandom.Bool()) speed += .01f; else speed -= .01f;
+ if (speed < .01) speed += .01f;
+ if (speed > 2) speed -= .01f;
+ }
+
+ public override void Draw() {
+ if (FastRandom.Bool_10Percent()){
+ if (FastRandom.Bool_12_5Percent()) Frame=!Frame;
+ if (FastRandom.Bool_5Percent()) Dir=!Dir;
+ }
+
+ if (Dir){
+ if (Frame) Rabcr.spriteBatch.Draw(Texture1, Position, Color.White);
+ else Rabcr.spriteBatch.Draw(Texture2, Position, Color.White);
+ } else {
+ if (Frame) Rabcr.spriteBatch.Draw(Texture1, Position, null, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0);
+ else Rabcr.spriteBatch.Draw(Texture2, Position, null, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0);
+ }
+
+ }
+ }
+}
+/*
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace rabcrClient {
+ public class Mob {
+ //public bool Dir;
+ public byte Height;
+ public byte Id;
+ public Vector2 position;
+
+ public Mob() { }
+
+ public Mob(byte id, byte height, Vector2 pos) {
+ Id=id;
+ Height=height;
+ position=pos;
+ }
+
+ public void Draw(SpriteBatch s){ }
+ }
+}*/
\ No newline at end of file
diff --git a/rabcrClient/InterLogic/Game/BlockType/Mob.cs b/rabcrClient/InterLogic/Game/BlockType/Mob.cs
index 6809713..ef6fc6a 100644
--- a/rabcrClient/InterLogic/Game/BlockType/Mob.cs
+++ b/rabcrClient/InterLogic/Game/BlockType/Mob.cs
@@ -2,34 +2,42 @@
namespace rabcrClient {
public abstract class Mob {
- public byte Height{
- get { return (byte)(Position.Y/16);}
- set{ Position.Y=((float)value)*16;}
+
+ public byte Height {
+ get { return (byte)(Position.Y/16); }
+ set { Position.Y=((float)value)*16; }
}
+
public ushort Id;
public Vector2 Position;
public bool Dir;
-
+ public float Lives;
+ public float MaxLives;
protected Mob() { }
- public virtual byte[] Save(){ return null;}
+ public virtual byte[] Save() => null;
- public virtual void Update(){ }
+ public virtual void Update() { }
- public virtual void Draw(){ }
+ public virtual void Draw() { }
}
public abstract class MMob {
- public byte Height { get { return (byte)(Position.Y/16); } set { Position.Y=((float)value)*16; } }
- public byte Id;
+ public byte Height {
+ get { return (byte)(Position.Y/16); }
+ set { Position.Y=((float)value)*16; }
+ }
+ public ushort Id;
public Vector2 Position;
public bool Dir;
- public bool Exists = true;
+ public MBlockState Exists;
protected MMob() { }
+ public virtual byte[] Save() => null;
+
public virtual void Update() { }
public virtual void Draw() { }
diff --git a/rabcrClient/InterLogic/Game/BlockType/NormalBlock.cs b/rabcrClient/InterLogic/Game/BlockType/NormalBlock.cs
index 12a213b..1fef230 100644
--- a/rabcrClient/InterLogic/Game/BlockType/NormalBlock.cs
+++ b/rabcrClient/InterLogic/Game/BlockType/NormalBlock.cs
@@ -20,7 +20,7 @@ public class NormalBlock:Block{
public override void Draw() => Rabcr.spriteBatch.Draw(Texture, Position, ColorWhite);
public override Block CloneDown() {
- NormalBlock n = new NormalBlock{
+ NormalBlock n = new NormalBlock {
Texture=Texture,
Id=Id,
Position=Position
diff --git a/rabcrClient/InterLogic/Game/BlockType/Parrot.cs b/rabcrClient/InterLogic/Game/BlockType/Parrot.cs
index d3d3bc7..6893504 100644
--- a/rabcrClient/InterLogic/Game/BlockType/Parrot.cs
+++ b/rabcrClient/InterLogic/Game/BlockType/Parrot.cs
@@ -4,7 +4,7 @@
namespace rabcrClient {
class Parrot:Mob {
-
+
#region Varibles
const float BirdSpeed=1f;
@@ -20,7 +20,6 @@ class Parrot:Mob {
#endregion
public unsafe Parrot(byte height, int x, bool dir, Texture2D textureStill, Texture2D textureFlying) {
- // PositionFlyTo=Pos;
Position=new Vector2(x*16, height*16);
Flying=false;
Dir=dir;
@@ -28,7 +27,7 @@ class Parrot:Mob {
TextureFlying = textureFlying;
Frame=0;
Id=(ushort)BlockId.MobParrot;
- }
+ }
public unsafe Parrot(byte height, int x, bool dir, Vector2 Pos, Texture2D textureStill, Texture2D textureFlying) {
PositionFlyTo=Pos;
@@ -39,38 +38,38 @@ class Parrot:Mob {
TextureFlying = textureFlying;
Frame=0;
Id=(ushort)BlockId.MobParrot;
- }
+ }
- public unsafe override byte[] Save(){
- ushort
- id=Id,
+ public unsafe override byte[] Save(){
+ ushort
+ id=Id,
flyToX=(ushort)PositionFlyTo.X;
- byte*
+ byte*
mbytes=(byte*)&id,
mbytesFlyToX=(byte*)&flyToX;
- if (Flying)
- return new byte[]{
- mbytes[1],
- mbytes[0],
- Flying? (byte)1 : (byte)0,
- Height,
- Dir ? (byte)1 : (byte)0,
+ if (Flying)
+ return new byte[]{
+ mbytes[1],
+ mbytes[0],
+ Flying? (byte)1 : (byte)0,
+ Height,
+ Dir ? (byte)1 : (byte)0,
- mbytesFlyToX[1],
- mbytesFlyToX[0],
+ mbytesFlyToX[1],
+ mbytesFlyToX[0],
(byte)(PositionFlyTo.Y/16f)
};
- else return
- new byte[]{
- mbytes[1],
- mbytes[0],
- Flying? (byte)1 : (byte)0,
- Height,
- Dir ? (byte)1 : (byte)0,
+ else return
+ new byte[]{
+ mbytes[1],
+ mbytes[0],
+ Flying? (byte)1 : (byte)0,
+ Height,
+ Dir ? (byte)1 : (byte)0,
};
}
-
+
public Parrot(int height, int x, bool dir, bool Flying, Texture2D textureStill, Texture2D textureFlying) {
Position=new Vector2(x*16, height*16);
TextureStill = textureStill;
@@ -81,9 +80,129 @@ class Parrot:Mob {
Id=(ushort)BlockId.MobParrot;
}
- public void UpdateFlying() {
- if (FastMath.DistanceInt(Position.X,Position.Y, PositionFlyTo.X,PositionFlyTo.Y)<=BirdSpeed*2) {
-
+ public void UpdateFlying() {
+ if (FastMath.DistanceInt(Position.X,Position.Y, PositionFlyTo.X,PositionFlyTo.Y)<=BirdSpeed*2) {
+
+ Position=PositionFlyTo;
+ Flying=false;
+
+ // invoke to check existence of destination flight
+ /*if (*/StopFlying.Invoke();//) {
+ //}
+
+ } else {
+ Position+=SpeedVector;
+ }
+ }
+
+ public void SetFlying(int x, int y) {
+ Flying=true;
+
+ PositionFlyTo.X=x;
+ PositionFlyTo.Y=y;
+
+ Vector2 RawSpeedVector=new Vector2(PositionFlyTo.X-Position.X, PositionFlyTo.Y-Position.Y);
+ float vecSize=(float)Math.Sqrt(RawSpeedVector.X*RawSpeedVector.X+RawSpeedVector.Y*RawSpeedVector.Y);
+
+ SpeedVector=RawSpeedVector/vecSize*BirdSpeed;
+ Dir=SpeedVector.X>0;
+ }
+
+ public override void Draw() {
+ if (Flying) {
+ UpdateFlying();
+
+ // Frames
+ Frame+=10;
+ if (Frame>TextureFlying.Width-35)Frame-=TextureFlying.Width-35;
+
+ // Draw
+ if (Dir) Rabcr.spriteBatch.Draw(TextureFlying/*Rabcr.Pixel*/, Position, new Rectangle((int)(Frame/16)*16,0,16,16), Color.White, 0, Vector2.Zero, 1f, SpriteEffects.FlipHorizontally, 0);
+ else Rabcr.spriteBatch.Draw(TextureFlying, Position, new Rectangle((int)(Frame/16)*16,0,16,16), Color.White);
+ } else Rabcr.spriteBatch.Draw(TextureStill, new Vector2(Position.X+5,Position.Y-10), Color.White);
+ }
+ }
+
+ class MParrot:MMob {
+
+ #region Varibles
+ const float BirdSpeed=1f;
+
+ public bool Flying;
+ public int Frame;
+ public Vector2 PositionFlyTo;
+
+ public delegate bool EventStopFly();
+ public event EventStopFly StopFlying;
+
+ readonly Texture2D TextureStill, TextureFlying;
+ Vector2 SpeedVector;
+ #endregion
+
+ public unsafe MParrot(byte height, int x, bool dir, Texture2D textureStill, Texture2D textureFlying) {
+ Position=new Vector2(x*16, height*16);
+ Flying=false;
+ Dir=dir;
+ TextureStill = textureStill;
+ TextureFlying = textureFlying;
+ Frame=0;
+ Id=(ushort)BlockId.MobParrot;
+ }
+
+ public unsafe MParrot(byte height, int x, bool dir, Vector2 Pos, Texture2D textureStill, Texture2D textureFlying) {
+ PositionFlyTo=Pos;
+ Position=new Vector2(x*16, height*16);
+ Flying=true;
+ Dir=dir;
+ TextureStill = textureStill;
+ TextureFlying = textureFlying;
+ Frame=0;
+ Id=(ushort)BlockId.MobParrot;
+ }
+
+ public unsafe override byte[] Save(){
+ ushort
+ id=Id,
+ flyToX=(ushort)PositionFlyTo.X;
+ byte*
+ mbytes=(byte*)&id,
+ mbytesFlyToX=(byte*)&flyToX;
+
+ if (Flying)
+ return new byte[] {
+ mbytes[1],
+ mbytes[0],
+ Flying? (byte)1 : (byte)0,
+ Height,
+ Dir ? (byte)1 : (byte)0,
+
+ mbytesFlyToX[1],
+ mbytesFlyToX[0],
+ (byte)(PositionFlyTo.Y/16f)
+ };
+ else return
+ new byte[]{
+ mbytes[1],
+ mbytes[0],
+ Flying? (byte)1 : (byte)0,
+ Height,
+ Dir ? (byte)1 : (byte)0,
+ };
+ }
+
+ public MParrot(int height, int x, bool dir, bool Flying, Texture2D textureStill, Texture2D textureFlying) {
+ Position=new Vector2(x*16, height*16);
+ TextureStill = textureStill;
+ TextureFlying = textureFlying;
+ this.Flying=Flying;
+ Frame=0;
+ Dir=dir;
+ Id=(ushort)BlockId.MobParrot;
+ }
+
+ public void UpdateFlying() {
+ if (FastMath.DistanceInt(Position.X,Position.Y, PositionFlyTo.X,PositionFlyTo.Y)<=BirdSpeed*2) {
+
Position=PositionFlyTo;
Flying=false;
@@ -91,14 +210,14 @@ class Parrot:Mob {
/*if (*/StopFlying.Invoke();//) {
//}
- } else {
+ } else {
Position+=SpeedVector;
}
}
- public void SetFlying(int x, int y) {
+ public void SetFlying(int x, int y) {
Flying=true;
-
+
PositionFlyTo.X=x;
PositionFlyTo.Y=y;
diff --git a/rabcrClient/InterLogic/Game/BlockType/Plant.cs b/rabcrClient/InterLogic/Game/BlockType/Plant.cs
index 8e5c84a..6763024 100644
--- a/rabcrClient/InterLogic/Game/BlockType/Plant.cs
+++ b/rabcrClient/InterLogic/Game/BlockType/Plant.cs
@@ -36,7 +36,7 @@ public class Plant{
public virtual void Draw() => Rabcr.spriteBatch.Draw(GrowTexture, Position, drawRectangle, Color.White);
- public FruitPlantWaving TurnToWavingPlant(bool right)=>new FruitPlantWaving(right){
+ public FruitPlantWaving TurnToWavingPlant(bool right)=>new FruitPlantWaving(right){
GrowTexture=GrowTexture,
Position=Position,
Id=Id,
diff --git a/rabcrClient/InterLogic/Game/BlockType/Rabbit.cs b/rabcrClient/InterLogic/Game/BlockType/Rabbit.cs
index 9572c81..5d1b102 100644
--- a/rabcrClient/InterLogic/Game/BlockType/Rabbit.cs
+++ b/rabcrClient/InterLogic/Game/BlockType/Rabbit.cs
@@ -3,7 +3,6 @@
namespace rabcrClient {
class Rabbit:Mob {
-
public byte Frame;
public bool needToChangeChunk;
public bool move;
@@ -14,44 +13,43 @@ class Rabbit:Mob {
readonly Texture2D TextureWalk, TextureEat, TextureJump;
public Texture2D thisTexture;
+ Rectangle rec;
- public Rabbit(/*ushort id,*/ byte height, /*byte lives,*/ int x, bool dir, Texture2D textureWalk, Texture2D textureEat,Texture2D textureJump) {
- // Height=height;
- // Position.Y=height*16;
+ public Rabbit(byte height, int x, bool dir, Texture2D textureWalk, Texture2D textureEat,Texture2D textureJump) {
Position=new Vector2(x*16,height*16);
TextureWalk = textureWalk;
TextureEat = textureEat;
TextureJump = textureJump;
- // Lives=lives;
+
Frame=0;
Dir=dir;
Id=(ushort)BlockId.Rabbit;
thisTexture=TextureEat;
+ rec=new Rectangle((int)(Frame/16f)*16, 0, 16, 16);
}
- public Rabbit(/*ushort id,*/ int height, /*byte lives,*/ int x, bool dir, Texture2D textureWalk, Texture2D textureEat,Texture2D textureJump) {
- // Height=height;
+ public Rabbit(int height, int x, bool dir, Texture2D textureWalk, Texture2D textureEat, Texture2D textureJump) {
Position.Y=height*16;
Position=new Vector2(x*16,Height*16);
TextureWalk = textureWalk;
TextureEat = textureEat;
TextureJump = textureJump;
- // Lives=lives;
Frame=0;
Dir=dir;
- Id=(ushort)BlockId.Rabbit;
+ Id=(ushort)BlockId.Rabbit;
thisTexture=TextureEat;
+ rec=new Rectangle((int)(Frame/16f)*16, 0, 16, 16);
}
- public unsafe override byte[] Save() {
+ public unsafe override byte[] Save() {
ushort id=Id;
- byte* mbytes=(byte*)&id ;
-
- return new byte[]{
- mbytes[1],
- mbytes[0],
- Height,
- Dir ? (byte)1 : (byte)0
+ byte* mbytes=(byte*)&id;
+
+ return new byte[]{
+ mbytes[1],
+ mbytes[0],
+ Height,
+ Dir ? (byte)1 : (byte)0
};
}
@@ -118,13 +116,144 @@ class Rabbit:Mob {
switchtoWalk=false;/*System.Console.WriteLine("switch walk");*/
} else {
// System.Console.WriteLine(thisTexture.Name);
- if (Rabcr.random.Bool()){
+ if (FastRandom.Bool()){
+ if (thisTexture==TextureEat) {
+ if (FastRandom.Bool()){thisTexture=TextureWalk; /*System.Console.WriteLine("switch tex jump");*/}
+ }else{ //System.Console.WriteLine("?");
+ thisTexture=TextureEat;//System.Console.WriteLine("switch tex eat");
+ }
+ if (FastRandom.Bool()){Dir=!Dir;/*System.Console.WriteLine("switch dir");*/ }
+ }
+
+
+ }
+ }
+ }
+ rec.X=(int)(Frame/16f)*16;
+
+ if (Dir) Rabcr.spriteBatch.Draw(thisTexture, Position, rec/*new Rectangle((int)(Frame/16f)*16,0,16,16)*/, Color.White);
+ else Rabcr.spriteBatch.Draw(thisTexture, Position, rec/*new Rectangle((int)(Frame/16f)*16,0,16,16)*/, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0);
+ }
+ }
+
+ class MRabbit:MMob {
+ public byte Frame;
+ public bool needToChangeChunk;
+ public bool move;
+ public short lastChunkID;
+ public byte moveCount;
+ public bool switchtoWalk;
+ public MoveType moveType;
+
+ readonly Texture2D TextureWalk, TextureEat, TextureJump;
+ public Texture2D thisTexture;
+
+ public MRabbit(byte height, int x, bool dir, Texture2D textureWalk, Texture2D textureEat,Texture2D textureJump) {
+ Position=new Vector2(x*16,height*16);
+ TextureWalk = textureWalk;
+ TextureEat = textureEat;
+ TextureJump = textureJump;
+
+ Frame=0;
+ Dir=dir;
+ Id=(ushort)BlockId.Rabbit;
+ thisTexture=TextureEat;
+ }
+
+ public MRabbit(int height, int x, bool dir, Texture2D textureWalk, Texture2D textureEat, Texture2D textureJump) {
+ Position.Y=height*16;
+ Position=new Vector2(x*16,Height*16);
+ TextureWalk = textureWalk;
+ TextureEat = textureEat;
+ TextureJump = textureJump;
+ Frame=0;
+ Dir=dir;
+ Id=(ushort)BlockId.Rabbit;
+ thisTexture=TextureEat;
+ }
+
+ public unsafe override byte[] Save() {
+ ushort id=Id;
+ byte* mbytes=(byte*)&id;
+
+ return new byte[]{
+ mbytes[1],
+ mbytes[0],
+ Height,
+ Dir ? (byte)1 : (byte)0
+ };
+ }
+
+ public override void Draw() {
+ Frame+=10;
+ if (move) {
+ switch (moveType){
+ case MoveType.Walk:
+ if (Dir) Position.X+=0.25f;
+ else Position.X-=0.25f;
+
+ moveCount--;
+ if (moveCount==0) {
+ move=false;
+ needToChangeChunk=true;
+ thisTexture=TextureEat;
+ }
+
+ if (Frame>=thisTexture.Width) {
+ Frame=0;
+ }
+ break;
+
+ case MoveType.Fall:
+ if (Dir){ Position.X+=0.25f; Position.Y+=0.25f; }
+ else {Position.X-=0.25f; Position.Y+=0.25f; }
+
+ moveCount--;
+ if (moveCount==0) {
+ move=false;
+ needToChangeChunk=true;
+ thisTexture=TextureEat;
+ }
+
+ if (Frame>=thisTexture.Width) {
+ Frame=0;
+ }
+ break;
+
+ case MoveType.Jump:
+ if (Dir) {Position.X+=0.25f; Position.Y-=0.25f; }
+ else {Position.X-=0.25f; Position.Y-=0.25f; }
+
+ moveCount--;
+ if (moveCount==0) {
+ move=false;
+ needToChangeChunk=true;
+ thisTexture=TextureEat;
+ }
+
+ if (Frame>=thisTexture.Width) {
+ Frame=0;
+ }
+ break;
+
+ }
+ } else {
+ if (Frame>=thisTexture.Width){
+ Frame=0;
+
+ if (switchtoWalk){
+ move=true;
+ thisTexture=TextureJump;
+ switchtoWalk=false;/*System.Console.WriteLine("switch walk");*/
+ } else {
+ // System.Console.WriteLine(thisTexture.Name);
+ if (FastRandom.Bool()){
if (thisTexture==TextureEat) {
- if (Rabcr.random.Bool()){thisTexture=TextureWalk; /*System.Console.WriteLine("switch tex jump");*/}
+ if (FastRandom.Bool()){thisTexture=TextureWalk; /*System.Console.WriteLine("switch tex jump");*/}
}else{ //System.Console.WriteLine("?");
thisTexture=TextureEat;//System.Console.WriteLine("switch tex eat");
}
- if (Rabcr.random.Bool()){Dir=!Dir;/*System.Console.WriteLine("switch dir");*/ }
+ if (FastRandom.Bool()){Dir=!Dir;/*System.Console.WriteLine("switch dir");*/ }
}
diff --git a/rabcrClient/InterLogic/Game/BlockType/ScreenBlock.cs b/rabcrClient/InterLogic/Game/BlockType/ScreenBlock.cs
index dbc2509..f5ec2bc 100644
--- a/rabcrClient/InterLogic/Game/BlockType/ScreenBlock.cs
+++ b/rabcrClient/InterLogic/Game/BlockType/ScreenBlock.cs
@@ -4,8 +4,8 @@
namespace rabcrClient {
class ScreenBlock : Block{//static =no animation (fence,label)
- public int screen;
Rectangle rectangle;
+ public int screen;
public Vector2 Position;
public Texture2D Texture;
@@ -17,9 +17,10 @@ class ScreenBlock : Block{//static =no animation (fence,label)
}
public int Screen {
- set{
+ set {
screen=value;
- rectangle = new Rectangle(rectangle.Width * screen,0, rectangle.Width, rectangle.Height);
+ rectangle.X=rectangle.Width * screen;
+ // rectangle = new Rectangle(rectangle.Width * screen,0, rectangle.Width, rectangle.Height);
}
}
diff --git a/rabcrClient/InterLogic/Game/BlockType/ShelfBlock.cs b/rabcrClient/InterLogic/Game/BlockType/ShelfBlock.cs
index 302eb34..a66b382 100644
--- a/rabcrClient/InterLogic/Game/BlockType/ShelfBlock.cs
+++ b/rabcrClient/InterLogic/Game/BlockType/ShelfBlock.cs
@@ -17,7 +17,7 @@ class ShelfBlock:Block{
Id=id;
Inv=new ItemInv[max];
ColorItem=ColorWhite;
- SmalItemRectangle=new Rectangle((int)position.X+2,(int)position.Y+2,12,12);
+ SmalItemRectangle=new Rectangle((int)position.X+2, (int)position.Y+2, 12, 12);
}
public override void Draw() {
diff --git a/rabcrClient/InterLogic/Game/BlockType/Water.cs b/rabcrClient/InterLogic/Game/BlockType/Water.cs
index 9268724..5eb070e 100644
--- a/rabcrClient/InterLogic/Game/BlockType/Water.cs
+++ b/rabcrClient/InterLogic/Game/BlockType/Water.cs
@@ -11,27 +11,28 @@ class Water : Block{
Vector2 pos;
public Rectangle rec;
- public void Mass(int value){
- if ((GetMass=value)==255){
+ public void Mass(int value) {
+ if ((GetMass=value)==255) {
Fill=true;
return;
} else {
Fill=false;
int h=(int)(16*(GetMass/255f));
- pos = new Vector2(Position.X,Position.Y+16-h);
+ pos = new Vector2(Position.X, Position.Y+16-h);
rec = new Rectangle(0, 16-h, 16, h);
}
}
- public void MassNoFill(int value){
+
+ public void MassNoFill(int value) {
GetMass=value;
Fill=false;
int h=(int)(16*(GetMass/255f));
- pos = new Vector2(Position.X,Position.Y+16-h);
+ pos = new Vector2(Position.X, Position.Y+16-h);
rec = new Rectangle(0, 16-h, 16, h);
}
- public Water(){ }
+ private Water(){ }
public Water(Texture2D texture, ushort type, Vector2 position) {
Texture = texture;
@@ -67,7 +68,7 @@ class Water : Block{
}
public override Block CloneDown() {
- Water w = new Water{
+ Water w = new Water {
Texture=Texture,
Id=Id,
Position=Position,
diff --git a/rabcrClient/InterLogic/Game/BlockType/WavingPlant.cs b/rabcrClient/InterLogic/Game/BlockType/WavingPlant.cs
index de1a83f..70a37c4 100644
--- a/rabcrClient/InterLogic/Game/BlockType/WavingPlant.cs
+++ b/rabcrClient/InterLogic/Game/BlockType/WavingPlant.cs
@@ -15,7 +15,7 @@
// public int ticks;
// #endregion
-// // public abstract void Draw();
+// // public abstract void Draw();
// public abstract object TurnOff();
// }
diff --git a/rabcrClient/InterLogic/Game/Enums/BlocksIds.cs b/rabcrClient/InterLogic/Game/Enums/BlocksIds.cs
index 3626558..24e82ab 100644
--- a/rabcrClient/InterLogic/Game/Enums/BlocksIds.cs
+++ b/rabcrClient/InterLogic/Game/Enums/BlocksIds.cs
@@ -22,14 +22,14 @@
WaterBlock,
WaterSalt,
-
- Barrel,
-
- _MoreInLoad,
-
+ Barrel,
+
+
+ _MoreInLoad,
+
Lava,
-
+
#region Trees
OakLeaves,
OakWood,
@@ -339,4 +339,6 @@
ChristmasBallPurple,
ChristmasBallLightGreen,
MobParrot,
+ Spawner, // for server, place where are players spawned
+ Teleporter // for gates - other places in current world or another world
}
\ No newline at end of file
diff --git a/rabcrClient/InterLogic/Game/GameButton.cs b/rabcrClient/InterLogic/Game/GameButton.cs
index 6c23786..46272d8 100644
--- a/rabcrClient/InterLogic/Game/GameButton.cs
+++ b/rabcrClient/InterLogic/Game/GameButton.cs
@@ -6,13 +6,12 @@ class GameButtonMedium {
#region Varibles
int fill=255;
- // int needBeFill=255;
Color color;
public Texture2D texture;
public string text;
- /*float*/int Xp,Yp;
+ int Xp,Yp;
int TextPositionX, TextPositionY;
Vector2 TexturePositon;
Text Ttext;
@@ -48,7 +47,7 @@ class GameButtonMedium {
}
void SetText(){
- Ttext=new Text(text,TextPositionX, TextPositionY,BitmapFont.bitmapFont18);
+ Ttext=new Text(text,TextPositionX, TextPositionY, BitmapFont.bitmapFont18);
}
public bool Update() {
diff --git a/rabcrClient/InterLogic/Game/GameDraw.cs b/rabcrClient/InterLogic/Game/GameDraw.cs
index f30af60..a4b0004 100644
--- a/rabcrClient/InterLogic/Game/GameDraw.cs
+++ b/rabcrClient/InterLogic/Game/GameDraw.cs
@@ -1,153 +1,19 @@
using Microsoft.Xna.Framework;
-//using Microsoft.Xna.Framework.Graphics;
namespace rabcrClient {
-
class GameDraw {
- static readonly Color
- //color_r200_g200_b200_a100= new Color(200,200,200,100),
- //color_r0_g0_b0_a200 = new Color(0,0,0,200),
- //color_r10_g140_b255 = new Color(10,140,255),
- //color_r128_g128_b128= new Color(128,128,128),
- //color_r128_g128_b128_a128= new Color(128,128,128,128),
- //color_r150_g150_b150= new Color(150,150,150),
- color_r0_g0_b0_a100 = new Color(0,0,0,100)//,
- //color_r255_g0_b0_a100 = new Color(255, 0, 0, 100),
- //color_r200_g200_b200=new Color(200, 200, 200),
- // lampColorLight=new Color(255, 255, 220, 255)
- ;
- // static Vector2 vector_x0_y4;
- // public static void DrawItemInInventory(Texture2D texture, ItemInv inv, int x, int y) {
- // switch (inv){
- // case ItemInvTool16 item:
- // Rabcr.spriteBatch.Draw(texture, new Rectangle(x, y,texture.Width*2,texture.Height*2), Color.White);
-
- // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+1, y+28, 30, 5), Color.Black);
- // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2, y+29, (int)(item.GetCount*0.3f), 3), Color.Green);
- // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2+(int)(item.GetCount*0.3f), y+29, 28-(int)(item.GetCount*0.3), 3), Color.Red);
- // return;
-
- // case ItemInvTool32 item:
- // Rabcr.spriteBatch.Draw(texture, new Vector2(x, y), Color.White);
-
- // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+1, y+28, 30, 5), Color.Black);
- // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2, y+29, (int)(item.GetCount*0.3f), 3), Color.Green);
- // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2+(int)(item.GetCount*0.3f), y+29, 28-(int)(item.GetCount*0.3), 3), Color.Red);
- // return;
-
- // case ItemInvBasic16 item:
- // Rabcr.spriteBatch.Draw(texture, new Rectangle(x, y,texture.Width*2,texture.Height*2), Color.White);
- // return;
-
- // case ItemInvBasic32 item:
- // Rabcr.spriteBatch.Draw(texture, new Vector2(x, y), Color.White);
- // return;
- // }
-
- // //if (texture.Width==16 && texture.Height==16) Rabcr.spriteBatch.Draw(texture, new Rectangle(x, y,texture.Width*2,texture.Height*2), Color.White);
- // //else if (texture.Width==32 && texture.Height==32) Rabcr.spriteBatch.Draw(texture, new Vector2(x, y), Color.White);
- // //else Rabcr.spriteBatch.Draw(texture, new Rectangle(x+(16-texture.Width), y+(16-texture.Height),texture.Width*2,texture.Height*2), Color.White);
-
- // //if (inv.X<(short)Items._SystemMaxTools){
- // // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+1, y+28, 30, 5), Color.Black);
- // // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2, y+29, (int)(inv.Y*0.3f), 3), Color.Green);
- // // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2+(int)(inv.Y*0.3f), y+29, 28-(int)(inv.Y*0.3), 3), Color.Red);
- // //}else if (inv.Y!=1) DrawTextShadowMin(x, y+20,inv.Y/*.ToString()*/);
- //}
-
- //public static void DrawItemInInventory(Texture2D texture, ItemNonInv inv, int x, int y) {
- // switch (inv){
- // case ItemNonInvTool item:
- // Rabcr.spriteBatch.Draw(texture, new Rectangle(x, y,texture.Width*2,texture.Height*2), Color.White);
-
- // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+1, y+28, 30, 5), Color.Black);
- // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2, y+29, (int)(item.Count*0.3f), 3), Color.Green);
- // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2+(int)(item.Count*0.3f), y+29, 28-(int)(item.Count*0.3), 3), Color.Red);
- // return;
-
- // case ItemNonInvBasicColoritzedNonStackable item:
- // Rabcr.spriteBatch.Draw(texture, new Vector2(x, y), item.color);
- // return;
-
- // case ItemNonInvBasic item:
- // Rabcr.spriteBatch.Draw(texture, new Rectangle(x, y,texture.Width*2,texture.Height*2), Color.White);
- // return;
-
- // case ItemNonInvNonStackable item:
- // Rabcr.spriteBatch.Draw(texture, new Vector2(x, y), Color.White);
- // return;
+ static readonly Color color_r0_g0_b0_a100 = new Color(0,0,0,100);
- // case ItemNonInvFood item:
- // Rabcr.spriteBatch.Draw(texture, new Vector2(x, y), Color.White);
- // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+1, y+28, 30, 5), Color.Black);
- // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2, y+29, (int)(item.Count*0.3f), 3), new Color(item.Descay/item.DescayMaximum,1-item.Descay/item.DescayMaximum,0));
- // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2+(int)(item.Count*0.3f), y+29, 28-(int)(item.Count*0.3), 3), Color.White);
- // return;
- // }
-
- // //if (texture.Width==16 && texture.Height==16) Rabcr.spriteBatch.Draw(texture, new Rectangle(x, y,texture.Width*2,texture.Height*2), Color.White);
- // //else if (texture.Width==32 && texture.Height==32) Rabcr.spriteBatch.Draw(texture, new Vector2(x, y), Color.White);
- // //else Rabcr.spriteBatch.Draw(texture, new Rectangle(x+(16-texture.Width), y+(16-texture.Height),texture.Width*2,texture.Height*2), Color.White);
-
- // //if (inv.X<(short)Items._SystemMaxTools){
- // // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+1, y+28, 30, 5), Color.Black);
- // // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2, y+29, (int)(inv.Y*0.3f), 3), Color.Green);
- // // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2+(int)(inv.Y*0.3f), y+29, 28-(int)(inv.Y*0.3), 3), Color.Red);
- // //}else if (inv.Y!=1) DrawTextShadowMin(x, y+20,inv.Y/*.ToString()*/);
- //}
-
- //public static void DrawItemInInventory(Texture2D texture, int invX, int invY, int x, int y) {
-
- // if (texture.Width==16 && texture.Height==16) Rabcr.spriteBatch.Draw(texture, new Rectangle(x, y,texture.Width*2,texture.Height*2), Color.White);
- // else if (texture.Width==32 && texture.Height==32) Rabcr.spriteBatch.Draw(texture, new Vector2(x, y), Color.White);
- // else Rabcr.spriteBatch.Draw(texture, new Rectangle(x+(16-texture.Width), y+(16-texture.Height),texture.Width*2,texture.Height*2), Color.White);
-
- // if (invX<(short)Items._SystemMaxTools){
- // int invYY=(int)(invY*0.3f);
- // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+1, y+28, 30, 5), Color.Black);
- // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2, y+29, invYY/*(int)(invY*0.3f)*/, 3), Color.Green);
- // Rabcr.spriteBatch.Draw(Rabcr.Pixel, new Rectangle(x+2+invYY/*(int)(invY*0.3f)*/, y+29, 28-invYY/*(int)(invY*0.3)*/, 3), Color.Red);
- // }else if (invY!=1) DrawTextShadowMin(x, y+20,invY/*.ToString()*/);
- //}
-
- //public static void DrawItemInInventory(Texture2D texture, int count, int x, int y) {
- // if (texture.Width==16 && texture.Height==16) Rabcr.spriteBatch.Draw(texture, new Rectangle(x, y, 32, 32), Color.White);
- // else if (texture.Width==32 && texture.Height==32) Rabcr.spriteBatch.Draw(texture, new Vector2(x, y), Color.White);
- // else Rabcr.spriteBatch.Draw(texture, new Rectangle(x+16-texture.Width, y+16-texture.Height, texture.Width*2, texture.Height*2), Color.White);
-
- // if (count!=1) DrawTextShadowMin(x, y+20, count/*.ToString()*/);
- //}
-
- public static void DrawTextShadowMin(int x, int y, int i) {
+ /* public static void DrawTextShadowMin(int x, int y, int i) {
string str=i.ToString();
- //if (Setting.BetterFont) {
- // if (Constants.Shadow)Rabcr.spriteBatch.DrawString(Fonts.Medium, str, new Vector2(x+0.5f, y+0.5f), color_r0_g0_b0_a100, 0, vector_x0_y4, Global.ScaleMediumToSmall, SpriteEffects.None, 0);
- // Rabcr.spriteBatch.DrawString(Fonts.Medium, str, new Vector2(x, y), Color.Black, 0, vector_x0_y4, Global.ScaleMediumToSmall, SpriteEffects.None, 0);
- //} else {
- /* if (Constants.Shadow)*/Rabcr.spriteBatch.DrawString(Fonts.Small, str, new Vector2(x+0.5f, y+0.5f), color_r0_g0_b0_a100);
- Rabcr.spriteBatch.DrawString(Fonts.Small, str, new Vector2(x,y), Color.Black);
- //}
- }
- public static void DrawTextShadowMin(int x, int y, string str, Color c) {
+ Rabcr.spriteBatch.DrawString(Fonts.Small, str, new Vector2(x+0.5f, y+0.5f), color_r0_g0_b0_a100);
+ Rabcr.spriteBatch.DrawString(Fonts.Small, str, new Vector2(x, y), Color.Black);
+ }*/
- //if (Setting.BetterFont) {
- // if (Constants.Shadow)Rabcr.spriteBatch.DrawString(Fonts.Medium, str, new Vector2(x+0.5f, y+0.5f), color_r0_g0_b0_a100, 0, vector_x0_y4, Global.ScaleMediumToSmall, SpriteEffects.None, 0);
- // Rabcr.spriteBatch.DrawString(Fonts.Medium, str, new Vector2(x, y), Color.Black, 0, vector_x0_y4, Global.ScaleMediumToSmall, SpriteEffects.None, 0);
- //} else {
- /*if (Constants.Shadow)*/Rabcr.spriteBatch.DrawString(Fonts.Small, str, new Vector2(x+0.5f, y+0.5f), color_r0_g0_b0_a100);
- Rabcr.spriteBatch.DrawString(Fonts.Small, str, new Vector2(x,y), c);
- //}
+ public static void DrawTextShadowMin(int x, int y, string str, Color c) {
+ Rabcr.spriteBatch.DrawString(Fonts.Small, str, new Vector2(x+0.5f, y+0.5f), color_r0_g0_b0_a100);
+ Rabcr.spriteBatch.DrawString(Fonts.Small, str, new Vector2(x, y), c);
}
-
- //public static void DrawTextShadowMin(int x, int y, string str, Color c) {
- // if (Setting.BetterFont) {
- // if (Constants.Shadow) Rabcr.spriteBatch.DrawString(Fonts.Medium, str, new Vector2(x+0.5f, y+0.5f), color_r128_g128_b128_a128*(c.A/255f), 0, vector_x0_y4, Global.ScaleMediumToSmall, SpriteEffects.None,0);
- // Rabcr.spriteBatch.DrawString(Fonts.Medium, str, new Vector2(x, y), c, 0, vector_x0_y4, Global.ScaleMediumToSmall, SpriteEffects.None, 0);
- // } else {
- // if (Constants.Shadow) Rabcr.spriteBatch.DrawString(Fonts.Small, str, new Vector2(x+0.5f, y+0.5f), color_r128_g128_b128_a128*(c.A/255f));
- // Rabcr.spriteBatch.DrawString(Fonts.Small, str, new Vector2(x, y), c);
- // }
- //}
}
-}
+}
\ No newline at end of file
diff --git a/rabcrClient/InterLogic/Game/GameMethods.cs b/rabcrClient/InterLogic/Game/GameMethods.cs
index d5785b2..8fef7f8 100644
--- a/rabcrClient/InterLogic/Game/GameMethods.cs
+++ b/rabcrClient/InterLogic/Game/GameMethods.cs
@@ -5,7 +5,6 @@
using System.Diagnostics;
#endif
-
namespace rabcrClient {
public class CraftingIn{
public ItemNonInv[] ItemSlot;
@@ -192,97 +191,96 @@ public class CraftingOut {
static class GameMethods {
- public static bool IsHalfShadowBlock(ushort id) {
- switch (id) {
- case (ushort)BlockId.AcaciaLeaves: return true;
- case (ushort)BlockId.AppleLeaves: return true;
- case (ushort)BlockId.AppleLeavesWithApples: return true;
- case (ushort)BlockId.AppleLeavesBlossom: return true;
- case (ushort)BlockId.CherryLeaves: return true;
- case (ushort)BlockId.CherryLeavesBlossom: return true;
- case (ushort)BlockId.CherryLeavesWithCherries: return true;
- case (ushort)BlockId.EucalyptusLeaves: return true;
- case (ushort)BlockId.KapokLeaves: return true;
- case (ushort)BlockId.LemonLeaves: return true;
- case (ushort)BlockId.LemonLeavesWithLemons: return true;
- case (ushort)BlockId.LindenLeaves: return true;
- case (ushort)BlockId.MangroveLeaves: return true;
- case (ushort)BlockId.OakLeaves: return true;
- case (ushort)BlockId.OliveLeaves: return true;
- case (ushort)BlockId.OliveLeavesWithOlives: return true;
- case (ushort)BlockId.OrangeLeaves: return true;
- case (ushort)BlockId.OrangeLeavesWithOranges: return true;
- case (ushort)BlockId.PineLeaves: return true;
- case (ushort)BlockId.PlumLeaves: return true;
- case (ushort)BlockId.PlumLeavesBlossom: return true;
- case (ushort)BlockId.PlumLeavesWithPlums: return true;
- case (ushort)BlockId.RubberTreeLeaves: return true;
- case (ushort)BlockId.SpruceLeaves: return true;
- case (ushort)BlockId.WillowLeaves: return true;
-
- case (ushort)BlockId.Ice: return true;
- case (ushort)BlockId.WaterBlock: return true;
- case (ushort)BlockId.WaterSalt: return true;
- }
- return false;
- }
+ public static bool IsHalfShadowBlock(ushort id) {
+ return id switch {
+ (ushort)BlockId.AcaciaLeaves => true,
+ (ushort)BlockId.AppleLeaves => true,
+ (ushort)BlockId.AppleLeavesWithApples => true,
+ (ushort)BlockId.AppleLeavesBlossom => true,
+ (ushort)BlockId.CherryLeaves => true,
+ (ushort)BlockId.CherryLeavesBlossom => true,
+ (ushort)BlockId.CherryLeavesWithCherries => true,
+ (ushort)BlockId.EucalyptusLeaves => true,
+ (ushort)BlockId.KapokLeaves => true,
+ (ushort)BlockId.LemonLeaves => true,
+ (ushort)BlockId.LemonLeavesWithLemons => true,
+ (ushort)BlockId.LindenLeaves => true,
+ (ushort)BlockId.MangroveLeaves => true,
+ (ushort)BlockId.OakLeaves => true,
+ (ushort)BlockId.OliveLeaves => true,
+ (ushort)BlockId.OliveLeavesWithOlives => true,
+ (ushort)BlockId.OrangeLeaves => true,
+ (ushort)BlockId.OrangeLeavesWithOranges => true,
+ (ushort)BlockId.PineLeaves => true,
+ (ushort)BlockId.PlumLeaves => true,
+ (ushort)BlockId.PlumLeavesBlossom => true,
+ (ushort)BlockId.PlumLeavesWithPlums => true,
+ (ushort)BlockId.RubberTreeLeaves => true,
+ (ushort)BlockId.SpruceLeaves => true,
+ (ushort)BlockId.WillowLeaves => true,
+ (ushort)BlockId.Ice => true,
+ (ushort)BlockId.WaterBlock => true,
+ (ushort)BlockId.WaterSalt => true,
+ _ => false,
+ };
+ }
- public static bool IsLeaves(ushort id) {
- switch (id) {
- case (ushort)BlockId.AcaciaLeaves: return true;
- case (ushort)BlockId.AppleLeaves: return true;
- case (ushort)BlockId.AppleLeavesWithApples: return true;
- case (ushort)BlockId.AppleLeavesBlossom: return true;
- case (ushort)BlockId.CherryLeaves: return true;
- case (ushort)BlockId.CherryLeavesBlossom: return true;
- case (ushort)BlockId.CherryLeavesWithCherries: return true;
- case (ushort)BlockId.EucalyptusLeaves: return true;
- case (ushort)BlockId.KapokLeaves: return true;
- case (ushort)BlockId.LemonLeaves: return true;
- case (ushort)BlockId.LemonLeavesWithLemons: return true;
- case (ushort)BlockId.LindenLeaves: return true;
- case (ushort)BlockId.MangroveLeaves: return true;
- case (ushort)BlockId.OakLeaves: return true;
- case (ushort)BlockId.OliveLeaves: return true;
- case (ushort)BlockId.OliveLeavesWithOlives: return true;
- case (ushort)BlockId.OrangeLeaves: return true;
- case (ushort)BlockId.OrangeLeavesWithOranges: return true;
- case (ushort)BlockId.PineLeaves: return true;
- case (ushort)BlockId.PlumLeaves: return true;
- case (ushort)BlockId.PlumLeavesBlossom: return true;
- case (ushort)BlockId.PlumLeavesWithPlums: return true;
- case (ushort)BlockId.RubberTreeLeaves: return true;
- case (ushort)BlockId.SpruceLeaves: return true;
- case (ushort)BlockId.WillowLeaves: return true;
- }
- return false;
- }
+ public static bool IsLeaves(ushort id) {
+ return id switch {
+ (ushort)BlockId.AcaciaLeaves => true,
+ (ushort)BlockId.AppleLeaves => true,
+ (ushort)BlockId.AppleLeavesWithApples => true,
+ (ushort)BlockId.AppleLeavesBlossom => true,
+ (ushort)BlockId.CherryLeaves => true,
+ (ushort)BlockId.CherryLeavesBlossom => true,
+ (ushort)BlockId.CherryLeavesWithCherries => true,
+ (ushort)BlockId.EucalyptusLeaves => true,
+ (ushort)BlockId.KapokLeaves => true,
+ (ushort)BlockId.LemonLeaves => true,
+ (ushort)BlockId.LemonLeavesWithLemons => true,
+ (ushort)BlockId.LindenLeaves => true,
+ (ushort)BlockId.MangroveLeaves => true,
+ (ushort)BlockId.OakLeaves => true,
+ (ushort)BlockId.OliveLeaves => true,
+ (ushort)BlockId.OliveLeavesWithOlives => true,
+ (ushort)BlockId.OrangeLeaves => true,
+ (ushort)BlockId.OrangeLeavesWithOranges => true,
+ (ushort)BlockId.PineLeaves => true,
+ (ushort)BlockId.PlumLeaves => true,
+ (ushort)BlockId.PlumLeavesBlossom => true,
+ (ushort)BlockId.PlumLeavesWithPlums => true,
+ (ushort)BlockId.RubberTreeLeaves => true,
+ (ushort)BlockId.SpruceLeaves => true,
+ (ushort)BlockId.WillowLeaves => true,
+ _ => false,
+ };
+ }
- public static bool IsSelectedShears(ushort id) {
- switch (id) {
- case (ushort)Items.ShearsCopper: return true;
+ public static bool IsSelectedShears(ushort id) {
+ switch (id) {
+ case (ushort)Items.ShearsCopper: return true;
case (ushort)Items.ShearsBronze: return true;
case (ushort)Items.ShearsGold: return true;
case (ushort)Items.ShearsIron: return true;
case (ushort)Items.ShearsSteel: return true;
case (ushort)Items.ShearsAluminium: return true;
}
-
- return false;
- }
- public static bool IsSelectedKnife(ushort id) {
- switch (id) {
- case (ushort)Items.KnifeCopper: return true;
- case (ushort)Items.KnifeBronze: return true;
- case (ushort)Items.KnifeGold: return true;
- case (ushort)Items.KnifeIron: return true;
- case (ushort)Items.KnifeSteel: return true;
- case (ushort)Items.KnifeAluminium: return true;
- }
return false;
}
+ public static bool IsSelectedKnife(ushort id) {
+ return id switch {
+ (ushort)Items.KnifeCopper => true,
+ (ushort)Items.KnifeBronze => true,
+ (ushort)Items.KnifeGold => true,
+ (ushort)Items.KnifeIron => true,
+ (ushort)Items.KnifeSteel => true,
+ (ushort)Items.KnifeAluminium => true,
+ _ => false,
+ };
+ }
+
public static int GetItemNameId(ushort id) {
switch (id) {
// Blocks
@@ -855,132 +853,119 @@ static class GameMethods {
}
public static ushort ToolToBasic(ushort i) {
- switch (i) {
- case (ushort)Items.BucketOil: return (ushort)Items.Bucket;
- case (ushort)Items.BucketWater: return (ushort)Items.Bucket;
- case (ushort)Items.TorchElectricON: return (ushort)Items.TorchElectricOFF;
- case (ushort)Items.LighterON: return (ushort)Items.LighterOFF;
-
- case (ushort)Items.BottleOil: return (ushort)Items.Bottle;
- case (ushort)Items.BottleWater: return (ushort)Items.Bottle;
-
- case (ushort)Items.ElectricDrill: return (ushort)Items.ElectricDrillOff;
- case (ushort)Items.ElectricSaw: return (ushort)Items.ElectricSawOff;
- }
- return (ushort)Items.None;
+ return i switch {
+ (ushort)Items.BucketOil => (ushort)Items.Bucket,
+ (ushort)Items.BucketWater => (ushort)Items.Bucket,
+ (ushort)Items.TorchElectricON => (ushort)Items.TorchElectricOFF,
+ (ushort)Items.LighterON => (ushort)Items.LighterOFF,
+ (ushort)Items.BottleOil => (ushort)Items.Bottle,
+ (ushort)Items.BottleWater => (ushort)Items.Bottle,
+ (ushort)Items.ElectricDrill => (ushort)Items.ElectricDrillOff,
+ (ushort)Items.ElectricSaw => (ushort)Items.ElectricSawOff,
+ _ => (ushort)Items.None,
+ };
}
public static int ToolMax(ushort id) {
//max uses
- switch (id) {
+ return id switch {
+ (ushort)Items.AxeStone => 50,
+ (ushort)Items.PickaxeStone => 50,
+ (ushort)Items.ShovelStone => 50,
+ (ushort)Items.HoeStone => 50,
+ (ushort)Items.HoeCopper => 200,
+ (ushort)Items.KnifeCopper => 200,
+ (ushort)Items.SawCopper => 200,
+ (ushort)Items.ShearsCopper => 200,
+ (ushort)Items.HammerCopper => 200,
+ (ushort)Items.PickaxeCopper => 200,
+ (ushort)Items.ShovelCopper => 200,
+ (ushort)Items.AxeCopper => 200,
+ (ushort)Items.HammerBronze => 250,
+ (ushort)Items.HoeBronze => 250,
+ (ushort)Items.KnifeBronze => 250,
+ (ushort)Items.SawBronze => 250,
+ (ushort)Items.ShearsBronze => 250,
+ (ushort)Items.PickaxeBronze => 250,
+ (ushort)Items.ShovelBronze => 250,
+ (ushort)Items.AxeBronze => 250,
+ (ushort)Items.AxeIron => 300,
+ (ushort)Items.HammerIron => 300,
+ (ushort)Items.HoeIron => 300,
+ (ushort)Items.PickaxeIron => 300,
+ (ushort)Items.ShovelIron => 300,
+ (ushort)Items.KnifeIron => 300,
+ (ushort)Items.SawIron => 300,
+ (ushort)Items.ShearsIron => 300,
+ (ushort)Items.AxeSteel => 350,
+ (ushort)Items.HammerSteel => 350,
+ (ushort)Items.HoeSteel => 350,
+ (ushort)Items.PickaxeSteel => 350,
+ (ushort)Items.ShovelSteel => 350,
+ (ushort)Items.KnifeSteel => 350,
+ (ushort)Items.SawSteel => 350,
+ (ushort)Items.ShearsSteel => 350,
+ (ushort)Items.AxeAluminium => 150,
+ (ushort)Items.HammerAluminium => 150,
+ (ushort)Items.HoeAluminium => 150,
+ (ushort)Items.PickaxeAluminium => 150,
+ (ushort)Items.ShovelAluminium => 150,
+ (ushort)Items.KnifeAluminium => 150,
+ (ushort)Items.SawAluminium => 150,
+ (ushort)Items.ShearsAluminium => 150,
+ (ushort)Items.AxeGold => 5,
+ (ushort)Items.HammerGold => 5,
+ (ushort)Items.HoeGold => 5,
+ (ushort)Items.PickaxeGold => 5,
+ (ushort)Items.ShovelGold => 5,
+ (ushort)Items.KnifeGold => 5,
+ (ushort)Items.SawGold => 5,
+ (ushort)Items.ShearsGold => 5,
+ (ushort)Items.ElectricDrill => 400,
+ (ushort)Items.ElectricSaw => 400,
+ (ushort)Items.TorchElectricON => 400,
+ (ushort)Items.Gun => 1000,
+ (ushort)Items.AirTank => 1000,
+ (ushort)Items.AirTank2 => 2000,
+ (ushort)Items.BucketWater => 255,
+ (ushort)Items.BucketOil => 255,
+ (ushort)Items.BottleOil => 50,
+ (ushort)Items.BottleWater => 50,
+ (ushort)Items.TorchON => 100,
+ (ushort)Items.DyeArmy => 50,
+ (ushort)Items.DyeBlack => 50,
+ (ushort)Items.DyeBlue => 50,
+ (ushort)Items.DyeBrown => 50,
+ (ushort)Items.DyeDarkBlue => 50,
+ (ushort)Items.DyeDarkGray => 50,
+ (ushort)Items.DyeDarkGreen => 50,
+ (ushort)Items.DyeDarkRed => 50,
+ (ushort)Items.DyeGold => 50,
+ (ushort)Items.DyeGray => 50,
+ (ushort)Items.DyeGreen => 50,
+ (ushort)Items.DyeLightBlue => 50,
+ (ushort)Items.DyeLightGray => 50,
+ (ushort)Items.DyeLightGreen => 50,
+ (ushort)Items.DyeMagenta => 50,
+ (ushort)Items.DyeOlive => 50,
+ (ushort)Items.DyeOrange => 50,
+ (ushort)Items.DyePink => 50,
+ (ushort)Items.DyePurple => 50,
+ (ushort)Items.DyeRed => 50,
+ (ushort)Items.DyeRoseQuartz => 50,
+ (ushort)Items.DyeSpringGreen => 50,
+ (ushort)Items.DyeTeal => 50,
+ (ushort)Items.DyeViolet => 50,
+ (ushort)Items.DyeWhite => 50,
+ (ushort)Items.DyeYellow => 50,
+ (ushort)Items.ItemBattery => 99,
+ _ => throw new System.Exception("Tool " + (Items)id + " not found in switch above"),
+ };
- case (ushort)Items.AxeStone: return 50;
- case (ushort)Items.PickaxeStone: return 50;
- case (ushort)Items.ShovelStone: return 50;
- case (ushort)Items.HoeStone: return 50;
- case (ushort)Items.HoeCopper: return 200;
- case (ushort)Items.KnifeCopper: return 200;
- case (ushort)Items.SawCopper: return 200;
- case (ushort)Items.ShearsCopper: return 200;
- case (ushort)Items.HammerCopper: return 200;
- case (ushort)Items.PickaxeCopper: return 200;
- case (ushort)Items.ShovelCopper: return 200;
- case (ushort)Items.AxeCopper: return 200;
-
- case (ushort)Items.HammerBronze: return 250;
- case (ushort)Items.HoeBronze: return 250;
- case (ushort)Items.KnifeBronze: return 250;
- case (ushort)Items.SawBronze: return 250;
- case (ushort)Items.ShearsBronze: return 250;
- case (ushort)Items.PickaxeBronze: return 250;
- case (ushort)Items.ShovelBronze: return 250;
- case (ushort)Items.AxeBronze: return 250;
-
- case (ushort)Items.AxeIron: return 300;
- case (ushort)Items.HammerIron: return 300;
- case (ushort)Items.HoeIron: return 300;
- case (ushort)Items.PickaxeIron: return 300;
- case (ushort)Items.ShovelIron: return 300;
- case (ushort)Items.KnifeIron: return 300;
- case (ushort)Items.SawIron: return 300;
- case (ushort)Items.ShearsIron: return 300;
-
- case (ushort)Items.AxeSteel: return 350;
- case (ushort)Items.HammerSteel: return 350;
- case (ushort)Items.HoeSteel: return 350;
- case (ushort)Items.PickaxeSteel: return 350;
- case (ushort)Items.ShovelSteel: return 350;
- case (ushort)Items.KnifeSteel: return 350;
- case (ushort)Items.SawSteel: return 350;
- case (ushort)Items.ShearsSteel: return 350;
-
- case (ushort)Items.AxeAluminium: return 150;
- case (ushort)Items.HammerAluminium: return 150;
- case (ushort)Items.HoeAluminium: return 150;
- case (ushort)Items.PickaxeAluminium: return 150;
- case (ushort)Items.ShovelAluminium: return 150;
- case (ushort)Items.KnifeAluminium: return 150;
- case (ushort)Items.SawAluminium: return 150;
- case (ushort)Items.ShearsAluminium: return 150;
-
- case (ushort)Items.AxeGold: return 5;
- case (ushort)Items.HammerGold: return 5;
- case (ushort)Items.HoeGold: return 5;
- case (ushort)Items.PickaxeGold: return 5;
- case (ushort)Items.ShovelGold: return 5;
- case (ushort)Items.KnifeGold: return 5;
- case (ushort)Items.SawGold: return 5;
- case (ushort)Items.ShearsGold: return 5;
-
- case (ushort)Items.ElectricDrill: return 400;
- case (ushort)Items.ElectricSaw: return 400;
-
- case (ushort)Items.TorchElectricON: return 400;
-
- case (ushort)Items.Gun: return 1000;
- case (ushort)Items.AirTank: return 1000;
- case (ushort)Items.AirTank2: return 2000;
-
- case (ushort)Items.BucketWater: return 255;
- case (ushort)Items.BucketOil: return 255;
- case (ushort)Items.BottleOil: return 50;
- case (ushort)Items.BottleWater: return 50;
-
- case (ushort)Items.TorchON : return 100;
-
- case (ushort)Items.DyeArmy: return 50;
- case (ushort)Items.DyeBlack: return 50;
- case (ushort)Items.DyeBlue: return 50;
- case (ushort)Items.DyeBrown: return 50;
- case (ushort)Items.DyeDarkBlue: return 50;
- case (ushort)Items.DyeDarkGray: return 50;
- case (ushort)Items.DyeDarkGreen: return 50;
- case (ushort)Items.DyeDarkRed: return 50;
- case (ushort)Items.DyeGold: return 50;
- case (ushort)Items.DyeGray: return 50;
- case (ushort)Items.DyeGreen: return 50;
- case (ushort)Items.DyeLightBlue: return 50;
- case (ushort)Items.DyeLightGray: return 50;
- case (ushort)Items.DyeLightGreen: return 50;
- case (ushort)Items.DyeMagenta: return 50;
- case (ushort)Items.DyeOlive: return 50;
- case (ushort)Items.DyeOrange: return 50;
- case (ushort)Items.DyePink: return 50;
- case (ushort)Items.DyePurple: return 50;
- case (ushort)Items.DyeRed: return 50;
- case (ushort)Items.DyeRoseQuartz: return 50;
- case (ushort)Items.DyeSpringGreen: return 50;
- case (ushort)Items.DyeTeal: return 50;
- case (ushort)Items.DyeViolet: return 50;
- case (ushort)Items.DyeWhite: return 50;
- case (ushort)Items.DyeYellow: return 50;
- case (ushort)Items.ItemBattery: return 99;
- }
- #if DEBUG
- throw new System.Exception("Tool "+(Items)id+" not found in switch above");
- #else
+#if DEBUG
+#else
return -1;
- #endif
+#endif
}
//public static int BurnWoodInFurnace(ushort id){
@@ -1007,425 +992,381 @@ static class GameMethods {
//}
public static bool IsCompostable(ushort id) {
- switch (id) {
- case (ushort)Items.Alore: return true;
- case (ushort)Items.Apple: return true;
- case (ushort)Items.AppleLeaves: return true;
- case (ushort)Items.AppleLeavesWithApples: return true;
- case (ushort)Items.AppleSapling: return true;
- case (ushort)Items.Ash: return true;
- case (ushort)Items.Banana: return true;
- case (ushort)Items.Blueberries: return true;
- case (ushort)Items.Boletus: return true;
- case (ushort)Items.CactusBig: return true;
- case (ushort)Items.CactusSmall: return true;
- case (ushort)Items.Carrot: return true;
- case (ushort)Items.Champignon: return true;
- case (ushort)Items.Cherry: return true;
- case (ushort)Items.CherryLeaves: return true;
- case (ushort)Items.CherryLeavesWithCherries: return true;
- case (ushort)Items.CherrySapling: return true;
- case (ushort)Items.Cloth: return true;
- case (ushort)Items.CoalDust: return true;
- case (ushort)Items.Coral: return true;
- case (ushort)Items.Dandelion: return true;
- case (ushort)Items.FishMeat: return true;
- case (ushort)Items.Flax: return true;
- case (ushort)Items.FlaxSeeds: return true;
- case (ushort)Items.GrassBlockClay: return true;
- case (ushort)Items.GrassBlockDesert: return true;
- case (ushort)Items.GrassBlockForest: return true;
- case (ushort)Items.GrassBlockHills: return true;
- case (ushort)Items.GrassBlockJungle: return true;
- case (ushort)Items.GrassBlockPlains: return true;
- case (ushort)Items.GrassDesert: return true;
- case (ushort)Items.GrassForest: return true;
- case (ushort)Items.GrassHills: return true;
- case (ushort)Items.GrassJungle: return true;
- case (ushort)Items.GrassPlains: return true;
- case (ushort)Items.Hay: return true;
- case (ushort)Items.HayBlock: return true;
- case (ushort)Items.Heater: return true;
- case (ushort)Items.Leave: return true;
- case (ushort)Items.Lemon: return true;
- case (ushort)Items.LemonLeaves: return true;
- case (ushort)Items.LemonLeavesWithLemons: return true;
- case (ushort)Items.LemonSapling: return true;
- case (ushort)Items.LindenLeaves: return true;
- case (ushort)Items.LindenSapling: return true;
- case (ushort)Items.MudIngot: return true;
- case (ushort)Items.OakLeaves: return true;
- case (ushort)Items.OakSapling: return true;
- case (ushort)Items.Onion: return true;
- case (ushort)Items.Orange: return true;
- case (ushort)Items.OrangeLeaves: return true;
- case (ushort)Items.OrangeLeavesWithOranges: return true;
- case (ushort)Items.OrangeSapling: return true;
- case (ushort)Items.Paper: return true;
- case (ushort)Items.Peas: return true;
- case (ushort)Items.PineLeaves: return true;
- case (ushort)Items.PineSapling: return true;
- case (ushort)Items.PlantBlueberry: return true;
- case (ushort)Items.PlantCarrot: return true;
- case (ushort)Items.PlantOnion: return true;
- case (ushort)Items.PlantOrchid: return true;
- case (ushort)Items.PlantPeas: return true;
- case (ushort)Items.PlantRashberry: return true;
- case (ushort)Items.PlantRose: return true;
- case (ushort)Items.PlantStrawberry: return true;
- case (ushort)Items.PlantViolet: return true;
- case (ushort)Items.Plum: return true;
- case (ushort)Items.PlumLeaves: return true;
- case (ushort)Items.PlumLeavesWithPlums: return true;
- case (ushort)Items.PlumSapling: return true;
- case (ushort)Items.RabbitMeat: return true;
- case (ushort)Items.RabbitMeatCooked: return true;
- case (ushort)Items.Rashberry: return true;
- case (ushort)Items.Rope: return true;
- case (ushort)Items.Seaweed: return true;
- case (ushort)Items.Seeds: return true;
- case (ushort)Items.Stick: return true;
- case (ushort)Items.Sticks: return true;
- case (ushort)Items.Strawberry: return true;
- case (ushort)Items.SugarCane: return true;
- case (ushort)Items.WheatStraw: return true;
- case (ushort)Items.Yarn: return true;
- case (ushort)Items.GrassBlockCompost: return true;
- case (ushort)Items.Egg: return true;
- case (ushort)Items.boiledEgg: return true;
- case (ushort)Items.Saltpeter: return true;
- default: return false;
- }
+ return id switch {
+ (ushort)Items.Alore => true,
+ (ushort)Items.Apple => true,
+ (ushort)Items.AppleLeaves => true,
+ (ushort)Items.AppleLeavesWithApples => true,
+ (ushort)Items.AppleSapling => true,
+ (ushort)Items.Ash => true,
+ (ushort)Items.Banana => true,
+ (ushort)Items.Blueberries => true,
+ (ushort)Items.Boletus => true,
+ (ushort)Items.CactusBig => true,
+ (ushort)Items.CactusSmall => true,
+ (ushort)Items.Carrot => true,
+ (ushort)Items.Champignon => true,
+ (ushort)Items.Cherry => true,
+ (ushort)Items.CherryLeaves => true,
+ (ushort)Items.CherryLeavesWithCherries => true,
+ (ushort)Items.CherrySapling => true,
+ (ushort)Items.Cloth => true,
+ (ushort)Items.CoalDust => true,
+ (ushort)Items.Coral => true,
+ (ushort)Items.Dandelion => true,
+ (ushort)Items.FishMeat => true,
+ (ushort)Items.Flax => true,
+ (ushort)Items.FlaxSeeds => true,
+ (ushort)Items.GrassBlockClay => true,
+ (ushort)Items.GrassBlockDesert => true,
+ (ushort)Items.GrassBlockForest => true,
+ (ushort)Items.GrassBlockHills => true,
+ (ushort)Items.GrassBlockJungle => true,
+ (ushort)Items.GrassBlockPlains => true,
+ (ushort)Items.GrassDesert => true,
+ (ushort)Items.GrassForest => true,
+ (ushort)Items.GrassHills => true,
+ (ushort)Items.GrassJungle => true,
+ (ushort)Items.GrassPlains => true,
+ (ushort)Items.Hay => true,
+ (ushort)Items.HayBlock => true,
+ (ushort)Items.Heater => true,
+ (ushort)Items.Leave => true,
+ (ushort)Items.Lemon => true,
+ (ushort)Items.LemonLeaves => true,
+ (ushort)Items.LemonLeavesWithLemons => true,
+ (ushort)Items.LemonSapling => true,
+ (ushort)Items.LindenLeaves => true,
+ (ushort)Items.LindenSapling => true,
+ (ushort)Items.MudIngot => true,
+ (ushort)Items.OakLeaves => true,
+ (ushort)Items.OakSapling => true,
+ (ushort)Items.Onion => true,
+ (ushort)Items.Orange => true,
+ (ushort)Items.OrangeLeaves => true,
+ (ushort)Items.OrangeLeavesWithOranges => true,
+ (ushort)Items.OrangeSapling => true,
+ (ushort)Items.Paper => true,
+ (ushort)Items.Peas => true,
+ (ushort)Items.PineLeaves => true,
+ (ushort)Items.PineSapling => true,
+ (ushort)Items.PlantBlueberry => true,
+ (ushort)Items.PlantCarrot => true,
+ (ushort)Items.PlantOnion => true,
+ (ushort)Items.PlantOrchid => true,
+ (ushort)Items.PlantPeas => true,
+ (ushort)Items.PlantRashberry => true,
+ (ushort)Items.PlantRose => true,
+ (ushort)Items.PlantStrawberry => true,
+ (ushort)Items.PlantViolet => true,
+ (ushort)Items.Plum => true,
+ (ushort)Items.PlumLeaves => true,
+ (ushort)Items.PlumLeavesWithPlums => true,
+ (ushort)Items.PlumSapling => true,
+ (ushort)Items.RabbitMeat => true,
+ (ushort)Items.RabbitMeatCooked => true,
+ (ushort)Items.Rashberry => true,
+ (ushort)Items.Rope => true,
+ (ushort)Items.Seaweed => true,
+ (ushort)Items.Seeds => true,
+ (ushort)Items.Stick => true,
+ (ushort)Items.Sticks => true,
+ (ushort)Items.Strawberry => true,
+ (ushort)Items.SugarCane => true,
+ (ushort)Items.WheatStraw => true,
+ (ushort)Items.Yarn => true,
+ (ushort)Items.GrassBlockCompost => true,
+ (ushort)Items.Egg => true,
+ (ushort)Items.boiledEgg => true,
+ (ushort)Items.Saltpeter => true,
+ _ => false,
+ };
}
- public static bool IsLeave(ushort id) {
- switch (id) {
+ public static bool IsLeave(ushort id) {
+ return id switch {
// Frequent leaves
- case (ushort)BlockId.SpruceLeaves: return true;
-
+ (ushort)BlockId.SpruceLeaves => true,
// Frequent branches
- case (ushort)BlockId.OakBranches: return true;
- case (ushort)BlockId.LindenBranches: return true;
- case (ushort)BlockId.WillowBranches: return true;
-
+ (ushort)BlockId.OakBranches => true,
+ (ushort)BlockId.LindenBranches => true,
+ (ushort)BlockId.WillowBranches => true,
// Fruit branches
- case (ushort)BlockId.AppleBranches: return true;
- case (ushort)BlockId.CherryBranches: return true;
- case (ushort)BlockId.PlumBranches: return true;
-
+ (ushort)BlockId.AppleBranches => true,
+ (ushort)BlockId.CherryBranches => true,
+ (ushort)BlockId.PlumBranches => true,
// Non-frequent leaves
- case (ushort)BlockId.WillowLeaves: return true;
- case (ushort)BlockId.OakLeaves: return true;
- case (ushort)BlockId.LindenLeaves: return true;
-
+ (ushort)BlockId.WillowLeaves => true,
+ (ushort)BlockId.OakLeaves => true,
+ (ushort)BlockId.LindenLeaves => true,
// Fruit leaves
- case (ushort)BlockId.AppleLeaves: return true;
- case (ushort)BlockId.AppleLeavesBlossom: return true;
- case (ushort)BlockId.AppleLeavesWithApples: return true;
-
- case (ushort)BlockId.CherryLeaves: return true;
- case (ushort)BlockId.CherryLeavesBlossom: return true;
- case (ushort)BlockId.CherryLeavesWithCherries: return true;
-
- case (ushort)BlockId.PlumLeaves: return true;
- case (ushort)BlockId.PlumLeavesBlossom: return true;
- case (ushort)BlockId.PlumLeavesWithPlums: return true;
-
+ (ushort)BlockId.AppleLeaves => true,
+ (ushort)BlockId.AppleLeavesBlossom => true,
+ (ushort)BlockId.AppleLeavesWithApples => true,
+ (ushort)BlockId.CherryLeaves => true,
+ (ushort)BlockId.CherryLeavesBlossom => true,
+ (ushort)BlockId.CherryLeavesWithCherries => true,
+ (ushort)BlockId.PlumLeaves => true,
+ (ushort)BlockId.PlumLeavesBlossom => true,
+ (ushort)BlockId.PlumLeavesWithPlums => true,
// Leaves in Hot biomes
- case (ushort)BlockId.OrangeLeaves: return true;
- case (ushort)BlockId.OrangeLeavesWithOranges: return true;
-
- case (ushort)BlockId.OliveLeaves: return true;
- case (ushort)BlockId.OliveLeavesWithOlives: return true;
-
- case (ushort)BlockId.LemonLeaves: return true;
- case (ushort)BlockId.LemonLeavesWithLemons: return true;
-
- case (ushort)BlockId.PineLeaves: return true;
- case (ushort)BlockId.AcaciaLeaves: return true;
- case (ushort)BlockId.EucalyptusLeaves: return true;
- case (ushort)BlockId.MangroveLeaves: return true;
-
- case (ushort)BlockId.RubberTreeLeaves: return true;
-
- case (ushort)BlockId.KapokLeaves: return true;
- case (ushort)BlockId.KapokLeacesFlowering: return true;
- case (ushort)BlockId.KapokLeacesFibre: return true;
-
- }
- return false;
+ (ushort)BlockId.OrangeLeaves => true,
+ (ushort)BlockId.OrangeLeavesWithOranges => true,
+ (ushort)BlockId.OliveLeaves => true,
+ (ushort)BlockId.OliveLeavesWithOlives => true,
+ (ushort)BlockId.LemonLeaves => true,
+ (ushort)BlockId.LemonLeavesWithLemons => true,
+ (ushort)BlockId.PineLeaves => true,
+ (ushort)BlockId.AcaciaLeaves => true,
+ (ushort)BlockId.EucalyptusLeaves => true,
+ (ushort)BlockId.MangroveLeaves => true,
+ (ushort)BlockId.RubberTreeLeaves => true,
+ (ushort)BlockId.KapokLeaves => true,
+ (ushort)BlockId.KapokLeacesFlowering => true,
+ (ushort)BlockId.KapokLeacesFibre => true,
+ _ => false,
+ };
}
#region Blocks from Items
public static ushort BackBlockFromItem(ushort item) {
- switch (item) {
-
+ return item switch {
// Blocks
- case (ushort)Items.Lava: return (ushort)BlockId.Lava;
-
+ (ushort)Items.Lava => (ushort)BlockId.Lava,
// Backs
- case (ushort)Items.BackCobblestone: return (ushort)BlockId.BackCobblestone;
- case (ushort)Items.BackSand: return (ushort)BlockId.BackSand;
- case (ushort)Items.BackDirt: return (ushort)BlockId.BackDirt;
- case (ushort)Items.BackAluminium: return (ushort)BlockId.BackAluminium;
- case (ushort)Items.BackAnorthosite: return (ushort)BlockId.BackAnorthosite;
- case (ushort)Items.BackBasalt: return (ushort)BlockId.BackBasalt;
- case (ushort)Items.BackClay: return (ushort)BlockId.BackClay;
- case (ushort)Items.BackCoal: return (ushort)BlockId.BackCoal;
- case (ushort)Items.BackCopper: return (ushort)BlockId.BackCopper;
- case (ushort)Items.BackDiorit: return (ushort)BlockId.BackDiorit;
- case (ushort)Items.BackDolomite: return (ushort)BlockId.BackDolomite;
- case (ushort)Items.BackFlint: return (ushort)BlockId.BackFlint;
- case (ushort)Items.BackGabbro: return (ushort)BlockId.BackGabbro;
- case (ushort)Items.BackGneiss: return (ushort)BlockId.BackGneiss;
- case (ushort)Items.BackGold: return (ushort)BlockId.BackGold;
- case (ushort)Items.BackGravel: return (ushort)BlockId.BackGravel;
- case (ushort)Items.BackIron: return (ushort)BlockId.BackIron;
- case (ushort)Items.BackLimestone: return (ushort)BlockId.BackLimestone;
- case (ushort)Items.BackMudstone: return (ushort)BlockId.BackMudstone;
- case (ushort)Items.BackRedSand: return (ushort)BlockId.BackRedSand;
- case (ushort)Items.BackRegolite: return (ushort)BlockId.BackRegolite;
- case (ushort)Items.BackRhyolite: return (ushort)BlockId.BackRhyolite;
- case (ushort)Items.BackSaltpeter: return (ushort)BlockId.BackSaltpeter;
- case (ushort)Items.BackSandstone: return (ushort)BlockId.BackSandstone;
- case (ushort)Items.BackSchist: return (ushort)BlockId.BackSchist;
- case (ushort)Items.BackSilver: return (ushort)BlockId.BackSilver;
- case (ushort)Items.BackSulfur: return (ushort)BlockId.BackSulfur;
- case (ushort)Items.BackTin: return (ushort)BlockId.BackTin;
-
+ (ushort)Items.BackCobblestone => (ushort)BlockId.BackCobblestone,
+ (ushort)Items.BackSand => (ushort)BlockId.BackSand,
+ (ushort)Items.BackDirt => (ushort)BlockId.BackDirt,
+ (ushort)Items.BackAluminium => (ushort)BlockId.BackAluminium,
+ (ushort)Items.BackAnorthosite => (ushort)BlockId.BackAnorthosite,
+ (ushort)Items.BackBasalt => (ushort)BlockId.BackBasalt,
+ (ushort)Items.BackClay => (ushort)BlockId.BackClay,
+ (ushort)Items.BackCoal => (ushort)BlockId.BackCoal,
+ (ushort)Items.BackCopper => (ushort)BlockId.BackCopper,
+ (ushort)Items.BackDiorit => (ushort)BlockId.BackDiorit,
+ (ushort)Items.BackDolomite => (ushort)BlockId.BackDolomite,
+ (ushort)Items.BackFlint => (ushort)BlockId.BackFlint,
+ (ushort)Items.BackGabbro => (ushort)BlockId.BackGabbro,
+ (ushort)Items.BackGneiss => (ushort)BlockId.BackGneiss,
+ (ushort)Items.BackGold => (ushort)BlockId.BackGold,
+ (ushort)Items.BackGravel => (ushort)BlockId.BackGravel,
+ (ushort)Items.BackIron => (ushort)BlockId.BackIron,
+ (ushort)Items.BackLimestone => (ushort)BlockId.BackLimestone,
+ (ushort)Items.BackMudstone => (ushort)BlockId.BackMudstone,
+ (ushort)Items.BackRedSand => (ushort)BlockId.BackRedSand,
+ (ushort)Items.BackRegolite => (ushort)BlockId.BackRegolite,
+ (ushort)Items.BackRhyolite => (ushort)BlockId.BackRhyolite,
+ (ushort)Items.BackSaltpeter => (ushort)BlockId.BackSaltpeter,
+ (ushort)Items.BackSandstone => (ushort)BlockId.BackSandstone,
+ (ushort)Items.BackSchist => (ushort)BlockId.BackSchist,
+ (ushort)Items.BackSilver => (ushort)BlockId.BackSilver,
+ (ushort)Items.BackSulfur => (ushort)BlockId.BackSulfur,
+ (ushort)Items.BackTin => (ushort)BlockId.BackTin,
// Wood
- case (ushort)Items.WoodApple: return (ushort)BlockId.AppleWood;
- case (ushort)Items.WoodCherry: return (ushort)BlockId.CherryWood;
- case (ushort)Items.WoodLemon: return (ushort)BlockId.LemonWood;
- case (ushort)Items.WoodLinden: return (ushort)BlockId.LindenWood;
- case (ushort)Items.WoodOak: return (ushort)BlockId.OakWood;
- case (ushort)Items.WoodOrange: return (ushort)BlockId.OrangeWood;
- case (ushort)Items.WoodPine: return (ushort)BlockId.PineWood;
- case (ushort)Items.WoodPlum: return (ushort)BlockId.PlumWood;
- case (ushort)Items.WoodSpruce: return (ushort)BlockId.SpruceWood;
- case (ushort)Items.AcaciaWood: return (ushort)BlockId.AcaciaWood;
- case (ushort)Items.EucalyptusWood: return (ushort)BlockId.EucalyptusWood;
- case (ushort)Items.KapokWood: return (ushort)BlockId.KapokWood;
- case (ushort)Items.MangroveWood: return (ushort)BlockId.MangroveWood;
- case (ushort)Items.OliveWood: return (ushort)BlockId.OliveWood;
- case (ushort)Items.RubberTreeWood: return (ushort)BlockId.RubberTreeWood;
- case (ushort)Items.WillowWood: return (ushort)BlockId.WillowWood;
-
-
- case (ushort)Items.Glass: return (ushort)BlockId.Glass;
- case (ushort)Items.AdvancedSpaceBack: return (ushort)BlockId.AdvancedSpaceBack;
- case (ushort)Items.AdvancedSpaceWindow: return (ushort)BlockId.AdvancedSpaceWindow;
- }
-
- return (ushort)BlockId.None;
+ (ushort)Items.WoodApple => (ushort)BlockId.AppleWood,
+ (ushort)Items.WoodCherry => (ushort)BlockId.CherryWood,
+ (ushort)Items.WoodLemon => (ushort)BlockId.LemonWood,
+ (ushort)Items.WoodLinden => (ushort)BlockId.LindenWood,
+ (ushort)Items.WoodOak => (ushort)BlockId.OakWood,
+ (ushort)Items.WoodOrange => (ushort)BlockId.OrangeWood,
+ (ushort)Items.WoodPine => (ushort)BlockId.PineWood,
+ (ushort)Items.WoodPlum => (ushort)BlockId.PlumWood,
+ (ushort)Items.WoodSpruce => (ushort)BlockId.SpruceWood,
+ (ushort)Items.AcaciaWood => (ushort)BlockId.AcaciaWood,
+ (ushort)Items.EucalyptusWood => (ushort)BlockId.EucalyptusWood,
+ (ushort)Items.KapokWood => (ushort)BlockId.KapokWood,
+ (ushort)Items.MangroveWood => (ushort)BlockId.MangroveWood,
+ (ushort)Items.OliveWood => (ushort)BlockId.OliveWood,
+ (ushort)Items.RubberTreeWood => (ushort)BlockId.RubberTreeWood,
+ (ushort)Items.WillowWood => (ushort)BlockId.WillowWood,
+ (ushort)Items.Glass => (ushort)BlockId.Glass,
+ (ushort)Items.AdvancedSpaceBack => (ushort)BlockId.AdvancedSpaceBack,
+ (ushort)Items.AdvancedSpaceWindow => (ushort)BlockId.AdvancedSpaceWindow,
+ _ => (ushort)BlockId.None,
+ };
}
public static ushort SolidBlockFromItem(ushort item) {
- switch (item) {
+ return item switch {
// Stone
- case (ushort)Items.StoneBasalt: return (ushort)BlockId.StoneBasalt;
- case (ushort)Items.StoneDiorit: return (ushort)BlockId.StoneDiorit;
- case (ushort)Items.StoneDolomite: return (ushort)BlockId.StoneDolomite;
- case (ushort)Items.StoneGabbro: return (ushort)BlockId.StoneGabbro;
- case (ushort)Items.StoneGneiss: return (ushort)BlockId.StoneGneiss;
- case (ushort)Items.StoneLimestone: return (ushort)BlockId.StoneLimestone;
- case (ushort)Items.StoneRhyolite: return (ushort)BlockId.StoneRhyolite;
- case (ushort)Items.StoneSandstone: return (ushort)BlockId.StoneSandstone;
- case (ushort)Items.StoneSchist: return (ushort)BlockId.StoneSchist;
-
+ (ushort)Items.StoneBasalt => (ushort)BlockId.StoneBasalt,
+ (ushort)Items.StoneDiorit => (ushort)BlockId.StoneDiorit,
+ (ushort)Items.StoneDolomite => (ushort)BlockId.StoneDolomite,
+ (ushort)Items.StoneGabbro => (ushort)BlockId.StoneGabbro,
+ (ushort)Items.StoneGneiss => (ushort)BlockId.StoneGneiss,
+ (ushort)Items.StoneLimestone => (ushort)BlockId.StoneLimestone,
+ (ushort)Items.StoneRhyolite => (ushort)BlockId.StoneRhyolite,
+ (ushort)Items.StoneSandstone => (ushort)BlockId.StoneSandstone,
+ (ushort)Items.StoneSchist => (ushort)BlockId.StoneSchist,
// Ore
- case (ushort)Items.OreAluminium: return (ushort)BlockId.OreAluminium;
- case (ushort)Items.OreCopper: return (ushort)BlockId.OreCopper;
- case (ushort)Items.OreGold: return (ushort)BlockId.OreGold;
- case (ushort)Items.OreIron: return (ushort)BlockId.OreIron;
- case (ushort)Items.OreSilver: return (ushort)BlockId.OreSilver;
- case (ushort)Items.OreTin: return (ushort)BlockId.OreTin;
- case (ushort)Items.OreCoal: return (ushort)BlockId.OreCoal;
- case (ushort)Items.OreSulfur: return (ushort)BlockId.OreSulfur;
- case (ushort)Items.OreSaltpeter: return (ushort)BlockId.OreSaltpeter;
-
+ (ushort)Items.OreAluminium => (ushort)BlockId.OreAluminium,
+ (ushort)Items.OreCopper => (ushort)BlockId.OreCopper,
+ (ushort)Items.OreGold => (ushort)BlockId.OreGold,
+ (ushort)Items.OreIron => (ushort)BlockId.OreIron,
+ (ushort)Items.OreSilver => (ushort)BlockId.OreSilver,
+ (ushort)Items.OreTin => (ushort)BlockId.OreTin,
+ (ushort)Items.OreCoal => (ushort)BlockId.OreCoal,
+ (ushort)Items.OreSulfur => (ushort)BlockId.OreSulfur,
+ (ushort)Items.OreSaltpeter => (ushort)BlockId.OreSaltpeter,
// Blocks
- case (ushort)Items.Dirt: return (ushort)BlockId.Dirt;
- case (ushort)Items.Gravel: return (ushort)BlockId.Gravel;
- case (ushort)Items.Stonerubble: return (ushort)BlockId.Cobblestone;
- case (ushort)Items.Sand: return (ushort)BlockId.Sand;
- case (ushort)Items.Ice: return (ushort)BlockId.Ice;
- case (ushort)Items.Compost: return (ushort)BlockId.Compost;
-
+ (ushort)Items.Dirt => (ushort)BlockId.Dirt,
+ (ushort)Items.Gravel => (ushort)BlockId.Gravel,
+ (ushort)Items.Stonerubble => (ushort)BlockId.Cobblestone,
+ (ushort)Items.Sand => (ushort)BlockId.Sand,
+ (ushort)Items.Ice => (ushort)BlockId.Ice,
+ (ushort)Items.Compost => (ushort)BlockId.Compost,
// Grass
- case (ushort)Items.GrassBlockDesert: return (ushort)BlockId.GrassBlockDesert;
- case (ushort)Items.GrassBlockForest: return (ushort)BlockId.GrassBlockForest;
- case (ushort)Items.GrassBlockHills: return (ushort)BlockId.GrassBlockHills;
- case (ushort)Items.GrassBlockJungle: return (ushort)BlockId.GrassBlockJungle;
- case (ushort)Items.GrassBlockPlains: return (ushort)BlockId.GrassBlockPlains;
- case (ushort)Items.GrassBlockCompost: return (ushort)BlockId.GrassBlockCompost;
-
+ (ushort)Items.GrassBlockDesert => (ushort)BlockId.GrassBlockDesert,
+ (ushort)Items.GrassBlockForest => (ushort)BlockId.GrassBlockForest,
+ (ushort)Items.GrassBlockHills => (ushort)BlockId.GrassBlockHills,
+ (ushort)Items.GrassBlockJungle => (ushort)BlockId.GrassBlockJungle,
+ (ushort)Items.GrassBlockPlains => (ushort)BlockId.GrassBlockPlains,
+ (ushort)Items.GrassBlockCompost => (ushort)BlockId.GrassBlockCompost,
// Artifical
- case (ushort)Items.Roof1: return (ushort)BlockId.Roof1;
- case (ushort)Items.Roof2: return (ushort)BlockId.Roof2;
- case (ushort)Items.Bricks: return (ushort)BlockId.Bricks;
-
- case (ushort)Items.Door: return (ushort)BlockId.DoorClose;
- case (ushort)Items.Planks: return (ushort)BlockId.Planks;
-
- case (ushort)Items.AdvancedSpaceBlock: return (ushort)BlockId.AdvancedSpaceBlock;
- case (ushort)Items.AdvancedSpaceFloor: return (ushort)BlockId.AdvancedSpaceFloor;
- case (ushort)Items.AdvancedSpacePart1: return (ushort)BlockId.AdvancedSpacePart1;
- case (ushort)Items.AdvancedSpacePart2: return (ushort)BlockId.AdvancedSpacePart2;
- case (ushort)Items.AdvancedSpacePart3: return (ushort)BlockId.AdvancedSpacePart3;
- case (ushort)Items.AdvancedSpacePart4: return (ushort)BlockId.AdvancedSpacePart4;
-
- case (ushort)Items.Snow: return (ushort)BlockId.Snow;
-
- }
-
- return (ushort)BlockId.None;
+ (ushort)Items.Roof1 => (ushort)BlockId.Roof1,
+ (ushort)Items.Roof2 => (ushort)BlockId.Roof2,
+ (ushort)Items.Bricks => (ushort)BlockId.Bricks,
+ (ushort)Items.Door => (ushort)BlockId.DoorClose,
+ (ushort)Items.Planks => (ushort)BlockId.Planks,
+ (ushort)Items.AdvancedSpaceBlock => (ushort)BlockId.AdvancedSpaceBlock,
+ (ushort)Items.AdvancedSpaceFloor => (ushort)BlockId.AdvancedSpaceFloor,
+ (ushort)Items.AdvancedSpacePart1 => (ushort)BlockId.AdvancedSpacePart1,
+ (ushort)Items.AdvancedSpacePart2 => (ushort)BlockId.AdvancedSpacePart2,
+ (ushort)Items.AdvancedSpacePart3 => (ushort)BlockId.AdvancedSpacePart3,
+ (ushort)Items.AdvancedSpacePart4 => (ushort)BlockId.AdvancedSpacePart4,
+ (ushort)Items.Snow => (ushort)BlockId.Snow,
+ _ => (ushort)BlockId.None,
+ };
}
public static ushort TopBlockFromItem(ushort item) {
- switch (item) {
- case (ushort)Items.ChristmasStar: return (ushort)BlockId.ChristmasStar;
-
- case (ushort)Items.Egg: return (ushort)BlockId.EggDrop;
- case (ushort)Items.BucketForRubber: return (ushort)BlockId.BucketForRubber;
- case (ushort)Items.Shelf: return (ushort)BlockId.Shelf;
- case (ushort)Items.Barrel: return (ushort)BlockId.Barrel;
- case (ushort)Items.BoxWooden: return (ushort)BlockId.BoxWooden;
- case (ushort)Items.BoxAdv: return (ushort)BlockId.BoxAdv;
- case (ushort)Items.OxygenMachine: return (ushort)BlockId.OxygenMachine;
-
+ return item switch {
+ (ushort)Items.ChristmasStar => (ushort)BlockId.ChristmasStar,
+ (ushort)Items.Egg => (ushort)BlockId.EggDrop,
+ (ushort)Items.BucketForRubber => (ushort)BlockId.BucketForRubber,
+ (ushort)Items.Shelf => (ushort)BlockId.Shelf,
+ (ushort)Items.Barrel => (ushort)BlockId.Barrel,
+ (ushort)Items.BoxWooden => (ushort)BlockId.BoxWooden,
+ (ushort)Items.BoxAdv => (ushort)BlockId.BoxAdv,
+ (ushort)Items.OxygenMachine => (ushort)BlockId.OxygenMachine,
// Leaves
- case (ushort)Items.AppleLeaves: return (ushort)BlockId.AppleLeaves;
- case (ushort)Items.LemonLeavesWithLemons: return (ushort)BlockId.LemonLeavesWithLemons;
- case (ushort)Items.LindenLeaves: return (ushort)BlockId.LindenLeaves;
- case (ushort)Items.OakLeaves: return (ushort)BlockId.OakLeaves;
- case (ushort)Items.OrangeLeaves: return (ushort)BlockId.OrangeLeaves;
- case (ushort)Items.SpruceLeaves: return (ushort)BlockId.SpruceLeaves;
- case (ushort)Items.PlumLeavesWithPlums: return (ushort)BlockId.PlumLeavesWithPlums;
- case (ushort)Items.PlumLeaves: return (ushort)BlockId.PlumLeaves;
- case (ushort)Items.PineLeaves: return (ushort)BlockId.PineLeaves;
- case (ushort)Items.OrangeLeavesWithOranges: return (ushort)BlockId.OrangeLeavesWithOranges;
- case (ushort)Items.AppleLeavesWithApples: return (ushort)BlockId.AppleLeavesWithApples;
- case (ushort)Items.CherryLeaves: return (ushort)BlockId.CherryLeaves;
- case (ushort)Items.CherryLeavesWithCherries: return (ushort)BlockId.CherryLeavesWithCherries;
- case (ushort)Items.LemonLeaves: return (ushort)BlockId.LemonLeaves;
-
- case (ushort)Items.WillowLeaves: return (ushort)BlockId.WillowLeaves;
- case (ushort)Items.WillowWood: return (ushort)BlockId.WillowWood;
- case (ushort)Items.MangroveLeaves: return (ushort)BlockId.MangroveLeaves;
- case (ushort)Items.MangroveWood: return (ushort)BlockId.MangroveWood;
- case (ushort)Items.EucalyptusLeaves: return (ushort)BlockId.EucalyptusLeaves;
- case (ushort)Items.EucalyptusWood: return (ushort)BlockId.EucalyptusWood;
- case (ushort)Items.OliveLeavesWithOlives: return (ushort)BlockId.OliveLeavesWithOlives;
- case (ushort)Items.OliveLeaves: return (ushort)BlockId.OliveLeaves;
- case (ushort)Items.OliveWood: return (ushort)BlockId.OliveWood;
- case (ushort)Items.RubberTreeLeaves: return (ushort)BlockId.RubberTreeLeaves;
- case (ushort)Items.RubberTreeWood: return (ushort)BlockId.RubberTreeWood;
- case (ushort)Items.AcaciaLeaves: return (ushort)BlockId.AcaciaLeaves;
- case (ushort)Items.AcaciaWood: return (ushort)BlockId.AcaciaWood;
- case (ushort)Items.KapokLeacesFlowering: return (ushort)BlockId.KapokLeacesFlowering;
- case (ushort)Items.KapokLeavesFibre: return (ushort)BlockId.KapokLeacesFibre;
- case (ushort)Items.KapokLeaves: return (ushort)BlockId.KapokLeaves;
- case (ushort)Items.KapokWood: return (ushort)BlockId.KapokWood;
- case (ushort)Items.WillowSapling: return (ushort)BlockId.WillowSapling;
- case (ushort)Items.MangroveSapling: return (ushort)BlockId.MangroveSapling;
- case (ushort)Items.EucalyptusSapling: return (ushort)BlockId.EucalyptusSapling;
- case (ushort)Items.OliveSapling: return (ushort)BlockId.OliveSapling;
- case (ushort)Items.RubberTreeSapling: return (ushort)BlockId.RubberTreeSapling;
- case (ushort)Items.AcaciaSapling: return (ushort)BlockId.AcaciaSapling;
- case (ushort)Items.KapokSapling: return (ushort)BlockId.KapokSapling;
-
+ (ushort)Items.AppleLeaves => (ushort)BlockId.AppleLeaves,
+ (ushort)Items.LemonLeavesWithLemons => (ushort)BlockId.LemonLeavesWithLemons,
+ (ushort)Items.LindenLeaves => (ushort)BlockId.LindenLeaves,
+ (ushort)Items.OakLeaves => (ushort)BlockId.OakLeaves,
+ (ushort)Items.OrangeLeaves => (ushort)BlockId.OrangeLeaves,
+ (ushort)Items.SpruceLeaves => (ushort)BlockId.SpruceLeaves,
+ (ushort)Items.PlumLeavesWithPlums => (ushort)BlockId.PlumLeavesWithPlums,
+ (ushort)Items.PlumLeaves => (ushort)BlockId.PlumLeaves,
+ (ushort)Items.PineLeaves => (ushort)BlockId.PineLeaves,
+ (ushort)Items.OrangeLeavesWithOranges => (ushort)BlockId.OrangeLeavesWithOranges,
+ (ushort)Items.AppleLeavesWithApples => (ushort)BlockId.AppleLeavesWithApples,
+ (ushort)Items.CherryLeaves => (ushort)BlockId.CherryLeaves,
+ (ushort)Items.CherryLeavesWithCherries => (ushort)BlockId.CherryLeavesWithCherries,
+ (ushort)Items.LemonLeaves => (ushort)BlockId.LemonLeaves,
+ (ushort)Items.WillowLeaves => (ushort)BlockId.WillowLeaves,
+ (ushort)Items.WillowWood => (ushort)BlockId.WillowWood,
+ (ushort)Items.MangroveLeaves => (ushort)BlockId.MangroveLeaves,
+ (ushort)Items.MangroveWood => (ushort)BlockId.MangroveWood,
+ (ushort)Items.EucalyptusLeaves => (ushort)BlockId.EucalyptusLeaves,
+ (ushort)Items.EucalyptusWood => (ushort)BlockId.EucalyptusWood,
+ (ushort)Items.OliveLeavesWithOlives => (ushort)BlockId.OliveLeavesWithOlives,
+ (ushort)Items.OliveLeaves => (ushort)BlockId.OliveLeaves,
+ (ushort)Items.OliveWood => (ushort)BlockId.OliveWood,
+ (ushort)Items.RubberTreeLeaves => (ushort)BlockId.RubberTreeLeaves,
+ (ushort)Items.RubberTreeWood => (ushort)BlockId.RubberTreeWood,
+ (ushort)Items.AcaciaLeaves => (ushort)BlockId.AcaciaLeaves,
+ (ushort)Items.AcaciaWood => (ushort)BlockId.AcaciaWood,
+ (ushort)Items.KapokLeacesFlowering => (ushort)BlockId.KapokLeacesFlowering,
+ (ushort)Items.KapokLeavesFibre => (ushort)BlockId.KapokLeacesFibre,
+ (ushort)Items.KapokLeaves => (ushort)BlockId.KapokLeaves,
+ (ushort)Items.KapokWood => (ushort)BlockId.KapokWood,
+ (ushort)Items.WillowSapling => (ushort)BlockId.WillowSapling,
+ (ushort)Items.MangroveSapling => (ushort)BlockId.MangroveSapling,
+ (ushort)Items.EucalyptusSapling => (ushort)BlockId.EucalyptusSapling,
+ (ushort)Items.OliveSapling => (ushort)BlockId.OliveSapling,
+ (ushort)Items.RubberTreeSapling => (ushort)BlockId.RubberTreeSapling,
+ (ushort)Items.AcaciaSapling => (ushort)BlockId.AcaciaSapling,
+ (ushort)Items.KapokSapling => (ushort)BlockId.KapokSapling,
// Blocks
- case (ushort)Items.SnowTop: return (ushort)BlockId.SnowTop;
- case (ushort)Items.Glass: return (ushort)BlockId.Glass;
- case (ushort)Items.Oil: return (ushort)BlockId.Oil;
- case (ushort)Items.BucketWater: return (ushort)BlockId.WaterBlock;
- case (ushort)Items.Stick: return (ushort)BlockId.BranchWithout;
-
+ (ushort)Items.SnowTop => (ushort)BlockId.SnowTop,
+ (ushort)Items.Glass => (ushort)BlockId.Glass,
+ (ushort)Items.Oil => (ushort)BlockId.Oil,
+ (ushort)Items.BucketWater => (ushort)BlockId.WaterBlock,
+ (ushort)Items.Stick => (ushort)BlockId.BranchWithout,
// Saplings
- case (ushort)Items.AppleSapling: return (ushort)BlockId.AppleSapling;
- case (ushort)Items.OrangeSapling: return (ushort)BlockId.OrangeSapling;
- case (ushort)Items.PineSapling: return (ushort)BlockId.PineSapling;
- case (ushort)Items.CherrySapling: return (ushort)BlockId.CherrySapling;
- case (ushort)Items.PlumSapling: return (ushort)BlockId.PlumSapling;
- case (ushort)Items.LemonSapling: return (ushort)BlockId.LemonSapling;
-
- case (ushort)Items.OakSapling: return (ushort)BlockId.OakSapling;
- case (ushort)Items.SpruceSapling: return (ushort)BlockId.SpruceSapling;
- case (ushort)Items.LindenSapling: return (ushort)BlockId.LindenSapling;
-
+ (ushort)Items.AppleSapling => (ushort)BlockId.AppleSapling,
+ (ushort)Items.OrangeSapling => (ushort)BlockId.OrangeSapling,
+ (ushort)Items.PineSapling => (ushort)BlockId.PineSapling,
+ (ushort)Items.CherrySapling => (ushort)BlockId.CherrySapling,
+ (ushort)Items.PlumSapling => (ushort)BlockId.PlumSapling,
+ (ushort)Items.LemonSapling => (ushort)BlockId.LemonSapling,
+ (ushort)Items.OakSapling => (ushort)BlockId.OakSapling,
+ (ushort)Items.SpruceSapling => (ushort)BlockId.SpruceSapling,
+ (ushort)Items.LindenSapling => (ushort)BlockId.LindenSapling,
// Flowers
- case (ushort)Items.Alore: return (ushort)BlockId.Alore;
- case (ushort)Items.PlantRose: return (ushort)BlockId.Rose;
- case (ushort)Items.PlantViolet: return (ushort)BlockId.Violet;
- case (ushort)Items.Dandelion: return (ushort)BlockId.Dandelion;
- case (ushort)Items.PlantOrchid: return (ushort)BlockId.Orchid;
- case (ushort)Items.CactusBig: return (ushort)BlockId.CactusBig;
- case (ushort)Items.CactusSmall: return (ushort)BlockId.CactusSmall;
-
+ (ushort)Items.Alore => (ushort)BlockId.Alore,
+ (ushort)Items.PlantRose => (ushort)BlockId.Rose,
+ (ushort)Items.PlantViolet => (ushort)BlockId.Violet,
+ (ushort)Items.Dandelion => (ushort)BlockId.Dandelion,
+ (ushort)Items.PlantOrchid => (ushort)BlockId.Orchid,
+ (ushort)Items.CactusBig => (ushort)BlockId.CactusBig,
+ (ushort)Items.CactusSmall => (ushort)BlockId.CactusSmall,
// Grass
- case (ushort)Items.GrassDesert: return (ushort)BlockId.GrassDesert;
- case (ushort)Items.GrassForest: return (ushort)BlockId.GrassForest;
- case (ushort)Items.GrassHills: return (ushort)BlockId.GrassHills;
- case (ushort)Items.GrassJungle: return (ushort)BlockId.GrassJungle;
- case (ushort)Items.GrassPlains: return (ushort)BlockId.GrassPlains;
-
+ (ushort)Items.GrassDesert => (ushort)BlockId.GrassDesert,
+ (ushort)Items.GrassForest => (ushort)BlockId.GrassForest,
+ (ushort)Items.GrassHills => (ushort)BlockId.GrassHills,
+ (ushort)Items.GrassJungle => (ushort)BlockId.GrassJungle,
+ (ushort)Items.GrassPlains => (ushort)BlockId.GrassPlains,
// Artifical Blocks
- case (ushort)Items.Door: return (ushort)BlockId.DoorOpen;
-
+ (ushort)Items.Door => (ushort)BlockId.DoorOpen,
// Mechanical
- case (ushort)Items.Desk: return (ushort)BlockId.Desk;
- case (ushort)Items.Flag: return (ushort)BlockId.Flag;
- case (ushort)Items.Ladder: return (ushort)BlockId.Ladder;
- case (ushort)Items.TorchON: return (ushort)BlockId.BurningTorch;
-
+ (ushort)Items.Desk => (ushort)BlockId.Desk,
+ (ushort)Items.Flag => (ushort)BlockId.Flag,
+ (ushort)Items.Ladder => (ushort)BlockId.Ladder,
+ (ushort)Items.TorchON => (ushort)BlockId.BurningTorch,
// Electrical
- case (ushort)Items.Lamp: return (ushort)BlockId.Lamp;
- case (ushort)Items.Radio: return (ushort)BlockId.Radio;
- case (ushort)Items.WindMill: return (ushort)BlockId.Windmill;
- case (ushort)Items.Label: return (ushort)BlockId.Label;
- case (ushort)Items.Rocket: return (ushort)BlockId.Rocket;
- case (ushort)Items.SewingMachine: return (ushort)BlockId.SewingMachine;
-
- case (ushort)Items.FurnaceElectric: return (ushort)BlockId.FurnaceElectric;
- case (ushort)Items.Macerator: return (ushort)BlockId.Macerator;
- case (ushort)Items.WaterMill: return (ushort)BlockId.Watermill;
- case (ushort)Items.SolarPanel: return (ushort)BlockId.SolarPanel;
- case (ushort)Items.Miner: return (ushort)BlockId.Miner;
- case (ushort)Items.Charger: return (ushort)BlockId.Charger;
- case (ushort)Items.FurnaceStone: return (ushort)BlockId.FurnaceStone;
- case (ushort)Items.Composter: return (ushort)BlockId.Composter;
- }
-
- return (ushort)BlockId.None;
+ (ushort)Items.Lamp => (ushort)BlockId.Lamp,
+ (ushort)Items.Radio => (ushort)BlockId.Radio,
+ (ushort)Items.WindMill => (ushort)BlockId.Windmill,
+ (ushort)Items.Label => (ushort)BlockId.Label,
+ (ushort)Items.Rocket => (ushort)BlockId.Rocket,
+ (ushort)Items.SewingMachine => (ushort)BlockId.SewingMachine,
+ (ushort)Items.FurnaceElectric => (ushort)BlockId.FurnaceElectric,
+ (ushort)Items.Macerator => (ushort)BlockId.Macerator,
+ (ushort)Items.WaterMill => (ushort)BlockId.Watermill,
+ (ushort)Items.SolarPanel => (ushort)BlockId.SolarPanel,
+ (ushort)Items.Miner => (ushort)BlockId.Miner,
+ (ushort)Items.Charger => (ushort)BlockId.Charger,
+ (ushort)Items.FurnaceStone => (ushort)BlockId.FurnaceStone,
+ (ushort)Items.Composter => (ushort)BlockId.Composter,
+ _ => (ushort)BlockId.None,
+ };
}
public static ushort PlantFromItem(ushort item) {
- switch (item) {
- case (ushort)Items.Strawberry: return (ushort)BlockId.Strawberry;
- case (ushort)Items.PlantBlueberry: return (ushort)BlockId.Blueberry;
- case (ushort)Items.PlantRashberry: return (ushort)BlockId.Rashberry;
-
- case (ushort)Items.PlantOnion: return (ushort)BlockId.Onion;
- case (ushort)Items.PlantPeas: return (ushort)BlockId.Peas;
- case (ushort)Items.PlantCarrot: return (ushort)BlockId.Carrot;
- case (ushort)Items.Peas: return (ushort)BlockId.Peas;
- case (ushort)Items.Carrot: return (ushort)BlockId.Carrot;
- case (ushort)Items.Onion: return (ushort)BlockId.Onion;
- }
-
- return (ushort)BlockId.None;
+ return item switch {
+ (ushort)Items.Strawberry => (ushort)BlockId.Strawberry,
+ (ushort)Items.PlantBlueberry => (ushort)BlockId.Blueberry,
+ (ushort)Items.PlantRashberry => (ushort)BlockId.Rashberry,
+ (ushort)Items.PlantOnion => (ushort)BlockId.Onion,
+ (ushort)Items.PlantPeas => (ushort)BlockId.Peas,
+ (ushort)Items.PlantCarrot => (ushort)BlockId.Carrot,
+ (ushort)Items.Peas => (ushort)BlockId.Peas,
+ (ushort)Items.Carrot => (ushort)BlockId.Carrot,
+ (ushort)Items.Onion => (ushort)BlockId.Onion,
+ _ => (ushort)BlockId.None,
+ };
}
public static ushort MobFromItem(ushort item) {
- switch (item) {
- case (ushort)Items.AnimalRabbit: return (ushort)BlockId.Rabbit;
- case (ushort)Items.AnimalChicken: return (ushort)BlockId.Chicken;
- case (ushort)Items.AnimalFish: return (ushort)BlockId.Fish;
- case (ushort)Items.AnimalParrot: return (ushort)BlockId.MobParrot;
- }
-
- return (ushort)BlockId.None;
+ return item switch {
+ (ushort)Items.AnimalRabbit => (ushort)BlockId.Rabbit,
+ (ushort)Items.AnimalChicken => (ushort)BlockId.Chicken,
+ (ushort)Items.AnimalFish => (ushort)BlockId.Fish,
+ (ushort)Items.AnimalParrot => (ushort)BlockId.MobParrot,
+ _ => (ushort)BlockId.None,
+ };
}
#endregion
@@ -1465,75 +1406,71 @@ static class GameMethods {
return true;
}
- public static bool IsBlockOnGrowing(ushort id) {
- switch (id){
- case (ushort)BlockId.Dirt: return true;
- case (ushort)BlockId.Compost: return true;
- case (ushort)BlockId.Clay: return true;
-
- case (ushort)BlockId.GrassBlockPlains: return true;
- case (ushort)BlockId.GrassBlockHills: return true;
- case (ushort)BlockId.GrassBlockJungle: return true;
- case (ushort)BlockId.GrassBlockDesert: return true;
- case (ushort)BlockId.GrassBlockForest: return true;
- case (ushort)BlockId.GrassBlockClay: return true;
- case (ushort)BlockId.GrassBlockCompost: return true;
-
- case (ushort)BlockId.GrassBlockSnowPlains: return true;
- case (ushort)BlockId.GrassBlockSnowHills: return true;
- case (ushort)BlockId.GrassBlockSnowJungle: return true;
- case (ushort)BlockId.GrassBlockSnowDesert: return true;
- case (ushort)BlockId.GrassBlockSnowForest: return true;
- case (ushort)BlockId.GrassBlockSnowClay: return true;
- case (ushort)BlockId.GrassBlockSnowCompost: return true;
-
- default: return false;
- }
+ public static bool IsBlockOnGrowing(ushort id) {
+ return id switch {
+ (ushort)BlockId.Dirt => true,
+ (ushort)BlockId.Compost => true,
+ (ushort)BlockId.Clay => true,
+ (ushort)BlockId.GrassBlockPlains => true,
+ (ushort)BlockId.GrassBlockHills => true,
+ (ushort)BlockId.GrassBlockJungle => true,
+ (ushort)BlockId.GrassBlockDesert => true,
+ (ushort)BlockId.GrassBlockForest => true,
+ (ushort)BlockId.GrassBlockClay => true,
+ (ushort)BlockId.GrassBlockCompost => true,
+ (ushort)BlockId.GrassBlockSnowPlains => true,
+ (ushort)BlockId.GrassBlockSnowHills => true,
+ (ushort)BlockId.GrassBlockSnowJungle => true,
+ (ushort)BlockId.GrassBlockSnowDesert => true,
+ (ushort)BlockId.GrassBlockSnowForest => true,
+ (ushort)BlockId.GrassBlockSnowClay => true,
+ (ushort)BlockId.GrassBlockSnowCompost => true,
+ _ => false,
+ };
}
public static bool IsDirtPlaceable(ushort id) {
- switch (id) {
- case (ushort)BlockId.OakSapling: return true;
- case (ushort)BlockId.OrangeSapling: return true;
- case (ushort)BlockId.PineSapling: return true;
- case (ushort)BlockId.PlumSapling: return true;
- case (ushort)BlockId.SpruceSapling: return true;
- case (ushort)BlockId.AppleSapling: return true;
- case (ushort)BlockId.CherrySapling: return true;
- case (ushort)BlockId.LemonSapling: return true;
- case (ushort)BlockId.LindenSapling: return true;
- case (ushort)BlockId.AcaciaSapling: return true;
- case (ushort)BlockId.EucalyptusSapling: return true;
- case (ushort)BlockId.KapokSapling: return true;
- case (ushort)BlockId.MangroveSapling: return true;
- case (ushort)BlockId.OliveSapling: return true;
- case (ushort)BlockId.RubberTreeSapling: return true;
- case (ushort)BlockId.WillowSapling: return true;
- case (ushort)BlockId.Rose: return true;
- case (ushort)BlockId.Dandelion: return true;
- case (ushort)BlockId.Heather: return true;
- case (ushort)BlockId.Orchid: return true;
- case (ushort)BlockId.Violet: return true;
- case (ushort)BlockId.Alore: return true;
- case (ushort)BlockId.Boletus: return true;
- case (ushort)BlockId.BranchFull: return true;
- case (ushort)BlockId.Champignon: return true;
- case (ushort)BlockId.GrassDesert: return true;
- case (ushort)BlockId.GrassForest: return true;
- case (ushort)BlockId.GrassHills: return true;
- case (ushort)BlockId.GrassJungle: return true;
- case (ushort)BlockId.GrassPlains: return true;
- case (ushort)BlockId.Toadstool: return true;
- case (ushort)BlockId.EggDrop: return true;
- case (ushort)BlockId.Rocks: return true;
- }
- return false;
+ return id switch {
+ (ushort)BlockId.OakSapling => true,
+ (ushort)BlockId.OrangeSapling => true,
+ (ushort)BlockId.PineSapling => true,
+ (ushort)BlockId.PlumSapling => true,
+ (ushort)BlockId.SpruceSapling => true,
+ (ushort)BlockId.AppleSapling => true,
+ (ushort)BlockId.CherrySapling => true,
+ (ushort)BlockId.LemonSapling => true,
+ (ushort)BlockId.LindenSapling => true,
+ (ushort)BlockId.AcaciaSapling => true,
+ (ushort)BlockId.EucalyptusSapling => true,
+ (ushort)BlockId.KapokSapling => true,
+ (ushort)BlockId.MangroveSapling => true,
+ (ushort)BlockId.OliveSapling => true,
+ (ushort)BlockId.RubberTreeSapling => true,
+ (ushort)BlockId.WillowSapling => true,
+ (ushort)BlockId.Rose => true,
+ (ushort)BlockId.Dandelion => true,
+ (ushort)BlockId.Heather => true,
+ (ushort)BlockId.Orchid => true,
+ (ushort)BlockId.Violet => true,
+ (ushort)BlockId.Alore => true,
+ (ushort)BlockId.Boletus => true,
+ (ushort)BlockId.BranchFull => true,
+ (ushort)BlockId.Champignon => true,
+ (ushort)BlockId.GrassDesert => true,
+ (ushort)BlockId.GrassForest => true,
+ (ushort)BlockId.GrassHills => true,
+ (ushort)BlockId.GrassJungle => true,
+ (ushort)BlockId.GrassPlains => true,
+ (ushort)BlockId.Toadstool => true,
+ (ushort)BlockId.EggDrop => true,
+ (ushort)BlockId.Rocks => true,
+ _ => false,
+ };
}
public static CraftingRecipe[] Craft(ushort id) {
- switch (id) {
- case (ushort)Items.AngelHair:
- return new CraftingRecipe[] {
+ return id switch {
+ (ushort)Items.AngelHair => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateGold, 1)),
@@ -1541,9 +1478,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.AngelHair,2)
),
- };
- case (ushort)Items.MediumStone:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.MediumStone => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.BigStone, 1)),
@@ -1557,10 +1493,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.MediumStone, 3)
),
- };
-
- case (ushort)Items.SmallStone:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.SmallStone => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.MediumStone, 1)),
@@ -1581,10 +1515,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.SmallStone, 3)
),
- };
-
- case (ushort)Items.HammerCopper:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.HammerCopper => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.CopperIngot,1)),
@@ -1593,10 +1525,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.HammerCopper)
)
- };
-
- case (ushort)Items.HammerAluminium:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.HammerAluminium => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.AluminiumIngot,1)),
@@ -1605,10 +1535,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.HammerAluminium)
)
- };
-
- case (ushort)Items.HammerSteel:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.HammerSteel => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.SteelIngot,1)),
@@ -1617,10 +1545,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.HammerSteel)
)
- };
-
- case (ushort)Items.ShearsSteel:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShearsSteel => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.ShearsHeadSteel,1)),
@@ -1628,10 +1554,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.ShearsSteel)
)
- };
-
- case (ushort)Items.ShovelBronze:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShovelBronze => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.ShovelHeadBronze,1)),
@@ -1639,10 +1563,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.ShovelBronze)
)
- };
-
- case (ushort)Items.DyeBrown:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeBrown => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvTool((ushort)Items.DyeBlack)),
@@ -1650,10 +1572,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.DyeBrown)
)
- };
-
- case (ushort)Items.DyeMagenta:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeMagenta => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvTool((ushort)Items.DyeBlue)),
@@ -1661,10 +1581,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.DyeMagenta)
)
- };
-
- case (ushort)Items.DyeOrange:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeOrange => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvTool((ushort)Items.DyeYellow)),
@@ -1672,10 +1590,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.DyeOrange)
)
- };
-
- case (ushort)Items.DyeTeal:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeTeal => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvTool((ushort)Items.DyeBlue)),
@@ -1683,10 +1599,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.DyeTeal)
)
- };
-
- case (ushort)Items.DyeArmy:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeArmy => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvTool((ushort)Items.DyeBrown)),
@@ -1695,10 +1609,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.DyeArmy)
)
- };
-
- case (ushort)Items.DyeRoseQuartz:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeRoseQuartz => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvTool((ushort)Items.DyeWhite)),
@@ -1706,10 +1618,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.DyeRoseQuartz)
)
- };
-
- case (ushort)Items.DyePink:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyePink => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvTool((ushort)Items.DyeWhite)),
@@ -1717,10 +1627,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.DyePink)
)
- };
-
- case (ushort)Items.DyeLightBlue:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeLightBlue => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvTool((ushort)Items.DyeWhite)),
@@ -1728,10 +1636,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.DyeLightBlue)
)
- };
-
- case (ushort)Items.DyeLightGreen:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeLightGreen => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvTool((ushort)Items.DyeWhite)),
@@ -1739,10 +1645,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.DyeLightGreen)
)
- };
-
- case (ushort)Items.DyeDarkGreen:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeDarkGreen => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvTool((ushort)Items.DyeBlack)),
@@ -1750,10 +1654,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.DyeDarkGreen)
)
- };
-
- case (ushort)Items.DyeDarkBlue:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeDarkBlue => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvTool((ushort)Items.DyeBlack)),
@@ -1761,10 +1663,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.DyeDarkBlue)
)
- };
-
- case (ushort)Items.DyeDarkRed:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeDarkRed => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvTool((ushort)Items.DyeBlack)),
@@ -1772,10 +1672,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.DyeDarkRed)
)
- };
-
- case (ushort)Items.OxygenMachine:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.OxygenMachine => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Charger,1)),
@@ -1792,10 +1690,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.OxygenMachine,1)
)
- };
-
- case (ushort)Items.AirTank:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AirTank => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.IronIngot,1)),
@@ -1806,10 +1702,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.AirTank,1)
)
- };
-
- case (ushort)Items.AirTank2:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AirTank2 => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.IronIngot,2)),
@@ -1820,10 +1714,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.AirTank2,1)
)
- };
-
- case (ushort)Items.Gun:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Gun => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.IronIngot,1)),
@@ -1834,10 +1726,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Gun,1)
)
- };
-
- case (ushort)Items.Ammo:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Ammo => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateCopper,2)),
@@ -1847,10 +1737,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Ammo,5)
)
- };
-
- case (ushort)Items.Gunpowder:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Gunpowder => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Saltpeter, 5)),
@@ -1859,10 +1747,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Gunpowder,7)
)
- };
-
- case (ushort)Items.BucketForRubber:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.BucketForRubber => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Bucket,1)),
@@ -1870,10 +1756,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.BucketForRubber,1)
)
- };
-
- case (ushort)Items.HoeBronze:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.HoeBronze => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.HoeHeadBronze,1)),
@@ -1881,10 +1765,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.HoeBronze)
)
- };
-
- case (ushort)Items.HoeCopper:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.HoeCopper => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.HoeHeadCopper, 1)),
@@ -1892,10 +1774,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.HoeCopper)
)
- };
-
- case (ushort)Items.HoeIron:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.HoeIron => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.HoeHeadIron, 1)),
@@ -1903,10 +1783,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.HoeIron)
)
- };
-
- case (ushort)Items.HoeGold:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.HoeGold => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.HoeHeadGold, 1)),
@@ -1914,10 +1792,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.HoeGold)
)
- };
-
- case (ushort)Items.HoeAluminium:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.HoeAluminium => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.HoeHeadAluminium, 1)),
@@ -1925,10 +1801,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.HoeAluminium)
)
- };
-
- case (ushort)Items.Composter:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Composter => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Planks,4)),
@@ -1939,10 +1813,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.BowlEmpty,1)
)
- };
-
- case (ushort)Items.BowlEmpty:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.BowlEmpty => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Planks,1)),
@@ -1950,10 +1822,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.BowlEmpty,1)
)
- };
-
- case (ushort)Items.TorchOFF:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.TorchOFF => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)),
@@ -1973,10 +1843,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.TorchOFF,1)
)
- };
-
- case (ushort)Items.PickaxeIron:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PickaxeIron => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)),
@@ -1984,10 +1852,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.PickaxeIron)
)
- };
-
- case (ushort)Items.PickaxeCopper:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PickaxeCopper => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)),
@@ -1995,10 +1861,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.PickaxeCopper)
)
- };
-
- case (ushort)Items.PickaxeGold:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PickaxeGold => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)),
@@ -2006,10 +1870,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.PickaxeGold)
)
- };
-
- case (ushort)Items.PickaxeSteel:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PickaxeSteel => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)),
@@ -2017,10 +1879,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.PickaxeSteel)
)
- };
-
- case (ushort)Items.PickaxeAluminium:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PickaxeAluminium => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)),
@@ -2028,10 +1888,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.PickaxeAluminium)
)
- };
-
- case (ushort)Items.PickaxeBronze:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PickaxeBronze => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)),
@@ -2039,10 +1897,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.PickaxeCopper)
)
- };
-
- case (ushort)Items.KnifeCopper:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.KnifeCopper => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)),
@@ -2050,10 +1906,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.KnifeCopper)
)
- };
-
- case (ushort)Items.KnifeBronze:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.KnifeBronze => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)),
@@ -2061,10 +1915,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.KnifeBronze)
)
- };
-
- case (ushort)Items.KnifeGold:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.KnifeGold => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)),
@@ -2072,10 +1924,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.KnifeGold)
)
- };
-
- case (ushort)Items.KnifeSteel:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.KnifeSteel => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)),
@@ -2083,10 +1933,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.KnifeSteel)
)
- };
-
- case (ushort)Items.HoeSteel:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.HoeSteel => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)),
@@ -2094,10 +1942,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.HoeSteel)
)
- };
-
- case (ushort)Items.AxeSteel:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AxeSteel => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)),
@@ -2105,10 +1951,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.AxeSteel)
)
- };
-
- case (ushort)Items.AxeBronze:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AxeBronze => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)),
@@ -2116,10 +1960,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.AxeBronze)
)
- };
-
- case (ushort)Items.AxeCopper:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AxeCopper => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)),
@@ -2127,10 +1969,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.AxeCopper)
)
- };
-
- case (ushort)Items.AxeAluminium:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AxeAluminium => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)),
@@ -2138,10 +1978,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.AxeAluminium)
)
- };
-
- case (ushort)Items.KnifeIron:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.KnifeIron => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)),
@@ -2149,10 +1987,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.KnifeIron)
)
- };
-
- case (ushort)Items.KnifeAluminium:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.KnifeAluminium => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)),
@@ -2160,11 +1996,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.KnifeAluminium)
)
- };
-
-
- case (ushort)Items.SewingMachine:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.SewingMachine => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateIron,1)),
@@ -2174,10 +2007,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.SewingMachine, 1)
)
- };
-
- case (ushort)Items.Charger:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Charger => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInv[]{
@@ -2190,10 +2021,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Charger,1)
)
- };
-
- case (ushort)Items.HoeStone:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.HoeStone => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[] {
new CraftingIn(new ItemNonInvBasic((ushort)Items.StoneHead,1)),
@@ -2201,10 +2030,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.HoeStone)
)
- };
-
- case (ushort)Items.AxeIron:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AxeIron => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.AxeHeadIron,1)),
@@ -2212,10 +2039,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.AxeIron)
)
- };
-
- case (ushort)Items.TorchElectricON:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.TorchElectricON => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Bulb,1)),
@@ -2225,10 +2050,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.TorchElectricON)
)
- };
-
- case (ushort)Items.ShovelIron:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShovelIron => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.ShovelHeadIron,1)),
@@ -2236,10 +2059,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.ShovelIron)
)
- };
-
- case (ushort)Items.ShovelAluminium:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShovelAluminium => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.ShovelHeadIron,1)),
@@ -2247,10 +2068,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.ShovelAluminium)
)
- };
-
- case (ushort)Items.ShovelCopper:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShovelCopper => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.ShovelHeadCopper,1)),
@@ -2258,10 +2077,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.ShovelCopper)
)
- };
-
- case (ushort)Items.AxeHeadIron:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AxeHeadIron => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.IronIngot,1)),
@@ -2269,10 +2086,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.AxeHeadIron, 4)
)
- };
-
- case (ushort)Items.PickaxeHeadIron:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PickaxeHeadIron => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.IronIngot,1)),
@@ -2280,10 +2095,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.PickaxeHeadIron, 4)
)
- };
-
- case (ushort)Items.ShovelHeadIron:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShovelHeadIron => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.IronIngot,1)),
@@ -2291,11 +2104,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.ShovelHeadIron, 4)
)
- };
-
-
- case (ushort)Items.BronzeDust:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.BronzeDust => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.CopperDust, 3)),
@@ -2303,10 +2113,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.CopperDust, 4)
)
- };
-
- case (ushort)Items.WaterMill:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.WaterMill => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateCopper, 2)),
@@ -2316,16 +2124,11 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.WaterMill,1)
)
- };
-
-
- case (ushort)Items.Stonerubble:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Stonerubble => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.SmallStone, 4),new ItemNonInvBasic((ushort)Items.Stonerubble, 4))
- };
-
- case (ushort)Items.Bricks:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Bricks => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.OneBrick, 4)),
@@ -2335,10 +2138,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Bricks,1)
)
- };
-
- case (ushort)Items.Leave:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Leave => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn(new ItemNonInvBasic((ushort)Items.Sticks,1)),
new CraftingOut[]{
@@ -2355,10 +2156,8 @@ static class GameMethods {
new CraftingOut(new ItemNonInvBasic((ushort)Items.Stick, 2))
}
),
- };
-
- case (ushort)Items.Ladder:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Ladder => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick, 10)),
@@ -2366,10 +2165,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Ladder,1)
)
- };
-
- case (ushort)Items.Flag:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Flag => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)),
@@ -2377,10 +2174,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Flag,1)
)
- };
-
- case (ushort)Items.Shelf:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Shelf => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Planks, 5)),
@@ -2389,10 +2184,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Shelf,1)
)
- };
-
- case (ushort)Items.Barrel:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Barrel => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Planks, 10)),
@@ -2402,10 +2195,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Barrel,1)
)
- };
-
- case (ushort)Items.BoxWooden:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.BoxWooden => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Planks, 7)),
@@ -2414,10 +2205,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.BoxWooden,1)
)
- };
-
- case (ushort)Items.BoxAdv:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.BoxAdv => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.plateAluminium, 2)),
@@ -2427,10 +2216,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Shelf,1)
)
- };
-
- case (ushort)Items.Sticks:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Sticks => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.OakLeaves,1)),
@@ -2441,10 +2228,8 @@ static class GameMethods {
new CraftingIn[]{CraftingRecipe.AnySapling(1)},
new CraftingOut[]{ new CraftingOut(new ItemNonInvBasic((ushort)Items.Sticks, 1)) }
)
- };
-
- case (ushort)Items.WheatSeeds:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.WheatSeeds => new CraftingRecipe[] {
new CraftingRecipe(
new ItemNonInvBasic((ushort)Items.WheatStraw,1),
new CraftingOut[] {
@@ -2452,10 +2237,8 @@ static class GameMethods {
new CraftingOut(new ItemNonInvBasic((ushort)Items.WheatSeeds, 1))
}
)
- };
-
- case (ushort)Items.Seeds:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Seeds => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInv[]{new ItemNonInvBasic((ushort)Items.WheatSeeds,1), new ItemNonInvBasic((ushort)Items.FlaxSeeds,1) })
@@ -2471,10 +2254,8 @@ static class GameMethods {
new CraftingOut(new ItemNonInvBasic((ushort)Items.Hay, 1)),
}
)
- };
-
- case (ushort)Items.Desk:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Desk => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.BigStone,1)),
@@ -2482,10 +2263,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Desk,1)
)
- };
-
- case (ushort)Items.CoalDust:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.CoalDust => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInv[]{ new ItemNonInvBasic((ushort)Items.ItemCoal,1), new ItemNonInvBasic((ushort)Items.OreCoal,1),new ItemNonInvBasic((ushort)Items.CoalWood,1) }),
@@ -2493,10 +2272,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.CoalDust,2)
)
- };
-
- case (ushort)Items.Hay:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Hay => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.HayBlock,1)),
@@ -2509,10 +2286,8 @@ static class GameMethods {
},
new CraftingOut[]{ new CraftingOut( new ItemNonInvBasic((ushort)Items.Hay, 4)),new CraftingOut(new ItemNonInvBasic((ushort)Items.WheatSeeds,1)) }
),
- };
-
- case (ushort)Items.Gravel:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Gravel => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInv[]{ new ItemNonInvBasic((ushort)Items.BigStone,1) , new ItemNonInvBasic((ushort)Items.MediumStone,2),new ItemNonInvBasic((ushort)Items.SmallStone,4)}),
@@ -2520,10 +2295,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Gravel,1)
)
- };
-
- case (ushort)Items.Stick:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Stick => new CraftingRecipe[] {
new CraftingRecipe(
new ItemNonInvBasic((ushort)Items.Sticks,1),
new CraftingOut[]{
@@ -2538,10 +2311,8 @@ static class GameMethods {
new CraftingOut(new ItemNonInvBasic((ushort)Items.Leave, 3))
}
),
- };
-
- case (ushort)Items.StoneHead:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.StoneHead => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.BigStone,1)),
@@ -2553,10 +2324,8 @@ static class GameMethods {
new CraftingOut(new ItemNonInvBasic((ushort)Items.MediumStone,3), 0.3f)
}
)
- };
-
- case (ushort)Items.PickaxeStone:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PickaxeStone => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.StoneHead,1)),
@@ -2564,10 +2333,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.PickaxeStone)
)
- };
-
- case (ushort)Items.AxeStone:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AxeStone => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.StoneHead,1)),
@@ -2575,10 +2342,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.AxeStone)
)
- };
-
- case (ushort)Items.ShovelStone:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShovelStone => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.StoneHead,1)),
@@ -2586,16 +2351,11 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.ShovelStone)
)
- };
-
- case (ushort)Items.HayBlock:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.HayBlock => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Hay,4),new ItemNonInvBasic((ushort)Items.HayBlock, 1))
- };
-
-
- case (ushort)Items.PlateCopper:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PlateCopper => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.CopperIngot,1)),
@@ -2603,10 +2363,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.PlateCopper, 2)
)
- };
-
- case (ushort)Items.plateAluminium:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.plateAluminium => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.AluminiumIngot,1)),
@@ -2614,10 +2372,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.plateAluminium, 2)
)
- };
-
- case (ushort)Items.PlateIron:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PlateIron => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.IronIngot, 1)),
@@ -2625,10 +2381,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.PlateIron, 2)
)
- };
-
- case (ushort)Items.PlateBronze:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PlateBronze => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.BronzeIngot, 1)),
@@ -2636,10 +2390,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.PlateBronze, 2)
)
- };
-
- case (ushort)Items.PlateGold:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PlateGold => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.GoldIngot, 1)),
@@ -2647,10 +2399,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.PlateGold, 2)
)
- };
-
- case (ushort)Items.FurnaceElectric:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.FurnaceElectric => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateIron, 4)),
@@ -2660,10 +2410,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.FurnaceElectric,1)
)
- };
-
- case (ushort)Items.Macerator:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Macerator => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateIron, 2)),
@@ -2677,10 +2425,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Macerator,1)
)
- };
-
- case (ushort)Items.Radio:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Radio => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.BigCircuit, 2)),
@@ -2689,10 +2435,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Radio,1)
)
- };
-
- case (ushort)Items.Label:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Label => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.BareLabel, 2)),
@@ -2700,10 +2444,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Label,1)
)
- };
-
- case (ushort)Items.BareLabel:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.BareLabel => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateCopper,1)),
@@ -2711,10 +2453,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.BareLabel, 4)
)
- };
-
- case (ushort)Items.Sand:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Sand => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Gravel,1)),
@@ -2736,10 +2476,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Sand,1)
),
- };
-
- case (ushort)Items.ShearsCopper:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShearsCopper => new CraftingRecipe[] {
//new CraftingRecipe(
// new CraftingIn[]{
// new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateCopper,1)),
@@ -2756,10 +2494,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.ShearsCopper)
)
- };
-
- case (ushort)Items.ShearsBronze:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShearsBronze => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.ShearsHeadBronze,1)),
@@ -2768,11 +2504,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.ShearsBronze)
)
- };
-
-
- case (ushort)Items.ShearsIron:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShearsIron => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.ShearsHeadIron,1)),
@@ -2781,11 +2514,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.ShearsIron)
)
- };
-
-
- case (ushort)Items.AdvancedSpaceBlock:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AdvancedSpaceBlock => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.plateAluminium, 2)),
@@ -2795,10 +2525,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.AdvancedSpaceBlock, 2)
)
- };
-
- case (ushort)Items.Miner:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Miner => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.ElectricDrill,1)),
@@ -2809,10 +2537,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Miner,1)
)
- };
-
- case (ushort)Items.Diode:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Diode => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.BareLabel,1)),
@@ -2820,10 +2546,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Diode, 4)
)
- };
-
- case (ushort)Items.HammerBronze:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.HammerBronze => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.BronzeIngot,1)),
@@ -2832,10 +2556,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.HammerBronze,1)
)
- };
-
- case (ushort)Items.HammerIron:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.HammerIron => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.IronIngot,1)),
@@ -2844,10 +2566,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.HammerIron,1)
)
- };
-
- case (ushort)Items.SawCopper:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.SawCopper => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateCopper,1)),
@@ -2856,10 +2576,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.SawCopper)
)
- };
-
- case (ushort)Items.SawBronze:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.SawBronze => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateBronze,1)),
@@ -2868,10 +2586,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.SawBronze)
)
- };
-
- case (ushort)Items.SawIron:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.SawIron => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateIron,1)),
@@ -2880,10 +2596,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.SawIron)
)
- };
-
- case (ushort)Items.ElectricDrill:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ElectricDrill => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.IronIngot, 1)),
@@ -2895,11 +2609,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.ElectricDrill)
)
- };
-
-
- case (ushort)Items.ElectricSaw:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ElectricSaw => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateIron, 3)),
@@ -2911,10 +2622,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.ElectricSaw)
)
- };
-
- case (ushort)Items.Rocket:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Rocket => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.plateAluminium, 16)),
@@ -2929,11 +2638,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Rocket,1)
)
- };
-
-
- case (ushort)Items.Door:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Door => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick, 3)),
@@ -2943,10 +2649,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Door,1)
)
- };
-
- case (ushort)Items.Yarn:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Yarn => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick,1)),
@@ -2954,13 +2658,9 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Yarn,1)
)
- };
-
- case (ushort)Items.Rope:
- return new CraftingRecipe[] {new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Yarn, 3), new ItemNonInvBasic((ushort)Items.Rope,1))};
-
- case (ushort)Items.Nail:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Rope => new CraftingRecipe[] { new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Yarn, 3), new ItemNonInvBasic((ushort)Items.Rope, 1)) },
+ (ushort)Items.Nail => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.IronIngot, 1)),
@@ -2968,10 +2668,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Nail, 10)
)
- };
-
- case (ushort)Items.Roof1:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Roof1 => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Bricks,1)),
@@ -2979,10 +2677,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Roof1, 2)
)
- };
-
- case (ushort)Items.Roof2:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Roof2 => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Bricks,1)),
@@ -2990,11 +2686,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Roof2, 2)
)
- };
-
-
- case (ushort)Items.FurnaceStone:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.FurnaceStone => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInv[]{ new ItemNonInvBasic((ushort)Items.MediumStone, 6), new ItemNonInvBasic((ushort)Items.BigStone,4), new ItemNonInvBasic((ushort)Items.SmallStone,8)}),
@@ -3002,10 +2695,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.FurnaceStone,1)
)
- };
-
- case (ushort)Items.MudIngot:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.MudIngot => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Clay, 1), new ItemNonInvBasic((ushort)Items.MudIngot, 1)),
new CraftingRecipe(
new CraftingIn[]{
@@ -3015,10 +2706,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.MudIngot,1)
)
- };
-
- case (ushort)Items.ItemBattery:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ItemBattery => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Lemon,1)),
@@ -3027,10 +2716,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.ItemBattery,1)
)
- };
-
- case (ushort)Items.BigCircuit:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.BigCircuit => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Circuit, 1)),
@@ -3043,10 +2730,8 @@ static class GameMethods {
new ItemNonInvBasic((ushort)Items.BigCircuit,1)
),
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Circuit, 3),new ItemNonInvBasic((ushort)Items.BigCircuit,1))
- };
-
- case (ushort)Items.Bucket:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Bucket => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Planks, 2)),
@@ -3061,10 +2746,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Bucket,1)
)
- };
-
- case (ushort)Items.Bulb:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Bulb => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Label,1)),
@@ -3074,10 +2757,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Bulb,1)
)
- };
-
- case (ushort)Items.Circuit:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Circuit => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateCopper, 1)),
@@ -3088,10 +2769,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Circuit,1)
)
- };
-
- case (ushort)Items.SolarPanel:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.SolarPanel => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Silicium, 1)),
@@ -3101,12 +2780,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.SolarPanel,1)
)
- };
-
-
-
- case (ushort)Items.WindMill:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.WindMill => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Motor, 1)),
@@ -3120,10 +2795,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.WindMill,1)
)
- };
-
- case (ushort)Items.AdvancedSpaceWindow:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AdvancedSpaceWindow => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.AdvancedSpaceBlock,1)),
@@ -3132,10 +2805,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.AdvancedSpaceWindow,1)
)
- };
-
- case (ushort)Items.AdvancedSpaceFloor:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AdvancedSpaceFloor => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.AdvancedSpaceBlock,1)),
@@ -3143,10 +2814,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.AdvancedSpaceFloor,1)
)
- };
-
- case (ushort)Items.AdvancedSpacePart1:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AdvancedSpacePart1 => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.AdvancedSpaceBlock,1)),
@@ -3154,10 +2823,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.AdvancedSpacePart1,1)
)
- };
-
- case (ushort)Items.AdvancedSpacePart2:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AdvancedSpacePart2 => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.AdvancedSpaceBlock,1)),
@@ -3165,10 +2832,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.AdvancedSpacePart2,1)
)
- };
-
- case (ushort)Items.AdvancedSpacePart3:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AdvancedSpacePart3 => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.AdvancedSpaceBlock,1)),
@@ -3176,10 +2841,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.AdvancedSpacePart3,1)
)
- };
-
- case (ushort)Items.AdvancedSpacePart4:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AdvancedSpacePart4 => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.AdvancedSpaceBlock,1)),
@@ -3187,10 +2850,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.AdvancedSpacePart4,1)
)
- };
-
- case (ushort)Items.Lamp:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Lamp => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Bulb, 1)),
@@ -3205,10 +2866,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Lamp,1)
)
- };
-
- case (ushort)Items.Cloth:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Cloth => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick, 2)),
@@ -3216,10 +2875,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Cloth,1)
)
- };
-
- case (ushort)Items.AxeGold:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AxeGold => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick, 1)),
@@ -3227,10 +2884,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.AxeGold)
)
- };
-
- case (ushort)Items.ShovelGold:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShovelGold => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick, 1)),
@@ -3238,10 +2893,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.ShovelGold)
)
- };
-
- case (ushort)Items.ShovelSteel:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShovelSteel => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick, 1)),
@@ -3249,10 +2902,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.ShovelSteel)
)
- };
-
- case (ushort)Items.ShearsAluminium:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShearsAluminium => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick, 1)),
@@ -3260,20 +2911,18 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.ShearsAluminium)
)
- };
-
- // case (ushort)Items.ShovelGold:
- //return new CraftingRecipe[] {
- // new CraftingRecipe(
- // new CraftingIn[]{
- // new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick, 1)),
- // new CraftingIn(new ItemNonInvBasic((ushort)Items.ShovelHeadGold, 1))
- // },
- // new ItemNonInvTool((ushort)Items.ShovelGold)
- // )
- //};
- case (ushort)Items.ShearsGold:
- return new CraftingRecipe[] {
+ },
+ // case (ushort)Items.ShovelGold:
+ //return new CraftingRecipe[] {
+ // new CraftingRecipe(
+ // new CraftingIn[]{
+ // new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick, 1)),
+ // new CraftingIn(new ItemNonInvBasic((ushort)Items.ShovelHeadGold, 1))
+ // },
+ // new ItemNonInvTool((ushort)Items.ShovelGold)
+ // )
+ //};
+ (ushort)Items.ShearsGold => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick, 2)),
@@ -3281,10 +2930,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.ShearsGold)
)
- };
-
- case (ushort)Items.HammerGold:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.HammerGold => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Stick, 1)),
@@ -3293,10 +2940,8 @@ static class GameMethods {
},
new ItemNonInvTool((ushort)Items.HammerGold)
)
- };
-
- case (ushort)Items.Motor:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Motor => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.IronIngot, 1)),
@@ -3306,10 +2951,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Motor,1)
)
- };
-
- case (ushort)Items.Rod:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Rod => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInv[]{ new ItemNonInvBasic((ushort)Items.IronIngot, 1), new ItemNonInvBasic((ushort)Items.BronzeIngot, 1) }),
@@ -3317,10 +2960,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Rod, 2)
)
- };
-
- case (ushort)Items.Condenser:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Condenser => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInv[]{ new ItemNonInvBasic((ushort)Items.plateAluminium, 1), new ItemNonInvBasic((ushort)Items.PlateCopper, 1) }),
@@ -3329,10 +2970,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Condenser, 5)
)
- };
-
- case (ushort)Items.Rezistance:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Rezistance => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.CoalWood,1)),
@@ -3340,15 +2979,11 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Rezistance, 5)
)
- };
-
- case (ushort)Items.Tranzistor:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Tranzistor => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Diode, 2), new ItemNonInvBasic((ushort)Items.Tranzistor, 1))
- };
-
- case (ushort)Items.Planks:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Planks => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
CraftingRecipe.AnyWood(1),
@@ -3359,16 +2994,14 @@ static class GameMethods {
new CraftingOut(new ItemNonInvBasic((ushort)Items.WoodDust,1), 0.5f)
}
)
- };
-
- default: return null;
- }
+ },
+ _ => null,
+ };
}
public static CraftingRecipe[] Bake(ushort id) {
- switch (id) {
- case (ushort)Items.ChristmasBallGray:
- return new CraftingRecipe[] {
+ return id switch {
+ (ushort)Items.ChristmasBallGray => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Glass,1)),
@@ -3376,10 +3009,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.ChristmasBallGray)
)
- };
-
- case (ushort)Items.ChristmasStar:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ChristmasStar => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Glass,1)),
@@ -3387,10 +3018,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.ChristmasStar)
)
- };
-
- case (ushort)Items.SteelIngot:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.SteelIngot => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(
@@ -3420,9 +3049,8 @@ static class GameMethods {
new CraftingOut(new ItemNonInvBasic((ushort)Items.SteelIngot, 1))
}
)
- };
- case (ushort)Items.DyeBlue:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeBlue => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Blueberries, 1)),
@@ -3433,10 +3061,8 @@ static class GameMethods {
new CraftingOut(new ItemNonInvBasic((ushort)Items.Leave, 1))
}
)
- };
-
- case (ushort)Items.DyeViolet:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeViolet => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.PlantViolet, 1)),
@@ -3447,15 +3073,11 @@ static class GameMethods {
new CraftingOut(new ItemNonInvBasic((ushort)Items.Leave, 1))
}
)
- };
-
- case (ushort)Items.boiledEgg:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.boiledEgg => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Egg, 1), new ItemNonInvFood((ushort)Items.boiledEgg, 1, 0))
- };
-
- case (ushort)Items.DyeRed:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeRed => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(
@@ -3468,10 +3090,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.DyeRed, 1)
)
- };
-
- case (ushort)Items.DyeGreen:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeGreen => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Leave, 1)),
@@ -3482,10 +3102,8 @@ static class GameMethods {
new CraftingOut(new ItemNonInvBasic((ushort)Items.Leave, 1))
}
)
- };
-
- case (ushort)Items.DyeOrange:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeOrange => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvFood((ushort)Items.Carrot, 1, 0.5f)),
@@ -3493,10 +3111,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.DyeOrange, 1)
)
- };
-
- case (ushort)Items.DyeSpringGreen:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeSpringGreen => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvFood((ushort)Items.Peas, 1, 0.5f)),
@@ -3504,10 +3120,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.DyeSpringGreen, 1)
)
- };
-
- case (ushort)Items.DyeYellow:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeYellow => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(
@@ -3520,10 +3134,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.DyeYellow, 1)
)
- };
-
- case (ushort)Items.DyeDarkGreen:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeDarkGreen => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvFood((ushort)Items.Seaweed, 1, 0.5f)),
@@ -3531,10 +3143,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.DyeDarkGreen, 1)
)
- };
-
- case (ushort)Items.DyeBrown:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeBrown => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(
@@ -3548,10 +3158,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.DyeBrown, 1)
)
- };
-
- case (ushort)Items.DyeLightGray:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeLightGray => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Ash, 1)),
@@ -3559,10 +3167,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.DyeLightGray, 1)
)
- };
-
- case (ushort)Items.DyeGray:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeGray => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(
@@ -3577,10 +3183,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.DyeGray, 1)
)
- };
-
- case (ushort)Items.DyeBlack:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeBlack => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.CoalDust, 1)),
@@ -3588,10 +3192,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.DyeBlack, 1)
)
- };
-
- case (ushort)Items.DyeWhite:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeWhite => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Saltpeter, 1)),
@@ -3599,10 +3201,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.DyeWhite, 1)
)
- };
-
- case (ushort)Items.DyeGold:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeGold => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.GoldDust, 1)),
@@ -3610,10 +3210,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.DyeGold, 1)
)
- };
-
- case (ushort)Items.DyeRoseQuartz:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeRoseQuartz => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.PlantRose, 1)),
@@ -3621,10 +3219,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.DyeRoseQuartz, 1)
)
- };
-
- case (ushort)Items.TestTube:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.TestTube => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn(
new ItemNonInv[]{
@@ -3634,82 +3230,54 @@ static class GameMethods {
),
new CraftingOut(new ItemNonInvBasic((ushort)Items.TestTube,1))
),
- };
-
- case (ushort)Items.TorchON:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.TorchON => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.TorchOFF,1),new ItemNonInvTool((ushort)Items.TorchON,1)),
- };
-
- case (ushort)Items.Bottle:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Bottle => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Plastic,1),new ItemNonInvBasic((ushort)Items.Bottle,1)),
- };
-
- case (ushort)Items.ShovelHeadSteel:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShovelHeadSteel => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.SteelIngot,1),new ItemNonInvBasic((ushort)Items.ShovelHeadSteel,1)),
- };
-
- case (ushort)Items.AxeHeadGold:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AxeHeadGold => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.GoldIngot,1),new ItemNonInvBasic((ushort)Items.AxeHeadGold,1)),
- };
-
- case (ushort)Items.DyeOlive:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.DyeOlive => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[] {
new CraftingIn(new ItemNonInvBasic((ushort)Items.Olive,1)),
new CraftingIn(new ItemNonInvBasic((ushort)Items.TestTube,1))
},
-
+
new ItemNonInvBasic((ushort)Items.DyeOlive,1)
)
- };
-
- case (ushort)Items.HoeHeadBronze:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.HoeHeadBronze => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BronzeIngot,1), new ItemNonInvBasic((ushort)Items.HoeHeadBronze,1)),
- };
-
- case (ushort)Items.HoeHeadCopper:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.HoeHeadCopper => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CopperIngot,1), new ItemNonInvBasic((ushort)Items.HoeHeadCopper,1)),
- };
-
- case (ushort)Items.HoeHeadAluminium:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.HoeHeadAluminium => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.AluminiumIngot,1), new ItemNonInvBasic((ushort)Items.HoeHeadAluminium,1)),
- };
-
- case (ushort)Items.HoeHeadSteel:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.HoeHeadSteel => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.SteelIngot,1), new ItemNonInvBasic((ushort)Items.HoeHeadSteel,1)),
- };
-
- case (ushort)Items.HoeHeadGold:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.HoeHeadGold => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.GoldIngot,1), new ItemNonInvBasic((ushort)Items.HoeHeadGold,1)),
- };
-
- case (ushort)Items.HoeHeadIron:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.HoeHeadIron => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.IronIngot,1), new ItemNonInvBasic((ushort)Items.HoeHeadIron,1)),
- };
-
- case (ushort)Items.RabbitMeatCooked:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.RabbitMeatCooked => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.RabbitMeat,1), new ItemNonInvBasic((ushort)Items.RabbitMeatCooked,1)),
- };
-
- case (ushort)Items.RabbitMeatCookedWithSalt:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.RabbitMeatCookedWithSalt => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.RabbitMeat,1), new ItemNonInvBasic((ushort)Items.RabbitMeatCookedWithSalt,1)),
- };
-
- case (ushort)Items.Plastic:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Plastic => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Rubber,1)),
@@ -3719,10 +3287,8 @@ static class GameMethods {
new ItemNonInvBasic((ushort)Items.Plastic,1)
),
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Bottle,1), new ItemNonInvBasic((ushort)Items.Plastic,1))
- };
-
- case (ushort)Items.BowlWithMushrooms:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.BowlWithMushrooms => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.BowlEmpty,1)),
@@ -3733,10 +3299,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.BowlWithMushrooms,1)
)
- };
-
- case (ushort)Items.BowlWithVegetables:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.BowlWithVegetables => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.BowlEmpty,1)),
@@ -3747,195 +3311,119 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.BowlWithVegetables,1)
)
- };
-
- case (ushort)Items.plateAluminium:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.plateAluminium => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.AluminiumIngot,1), new ItemNonInvBasic((ushort)Items.plateAluminium, 2))
- };
-
- case (ushort)Items.OneBrick:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.OneBrick => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.MudIngot,1), new ItemNonInvBasic((ushort)Items.OneBrick, 1))
- };
-
- case (ushort)Items.BareLabel:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.BareLabel => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CopperIngot,1),new ItemNonInvBasic((ushort)Items.BareLabel, 3))
- };
-
- case (ushort)Items.PlateBronze:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PlateBronze => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BronzeIngot,1), new ItemNonInvBasic((ushort)Items.PlateBronze, 2))
- };
-
- case (ushort)Items.PlateCopper:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PlateCopper => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CopperIngot,1), new ItemNonInvBasic((ushort)Items.PlateCopper, 2))
- };
-
- case (ushort)Items.PlateGold:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PlateGold => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.GoldIngot,1),new ItemNonInvBasic((ushort)Items.PlateGold, 2))
- };
-
- case (ushort)Items.PlateIron:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PlateIron => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.IronIngot, 1), new ItemNonInvBasic((ushort)Items.PlateIron, 2))
- };
-
- case (ushort)Items.FishMeatCooked:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.FishMeatCooked => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.FishMeat,1), new ItemNonInvBasic((ushort)Items.FishMeatCooked,1))
- };
-
- case (ushort)Items.AxeHeadIron:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AxeHeadIron => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.IronIngot,1),new ItemNonInvBasic((ushort)Items.AxeHeadIron,1))
- };
-
- case (ushort)Items.AxeHeadCopper:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AxeHeadCopper => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CopperIngot,1),new ItemNonInvBasic((ushort)Items.AxeHeadCopper,1))
- };
-
- case (ushort)Items.AxeHeadBronze:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AxeHeadBronze => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BronzeIngot,1),new ItemNonInvBasic((ushort)Items.AxeHeadBronze,1))
- };
-
- case (ushort)Items.AxeHeadAluminium:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AxeHeadAluminium => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.AluminiumIngot,1),new ItemNonInvBasic((ushort)Items.AxeHeadAluminium,1))
- };
-
- case (ushort)Items.AxeHeadSteel:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AxeHeadSteel => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.SteelIngot,1),new ItemNonInvBasic((ushort)Items.AxeHeadSteel,1))
- };
-
- case (ushort)Items.PickaxeHeadIron:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PickaxeHeadIron => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.IronIngot,1), new ItemNonInvBasic((ushort)Items.PickaxeHeadIron,1))
- };
-
- case (ushort)Items.PickaxeHeadCopper:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PickaxeHeadCopper => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CopperIngot,1), new ItemNonInvBasic((ushort)Items.PickaxeHeadCopper,1))
- };
-
- case (ushort)Items.PickaxeHeadBronze:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PickaxeHeadBronze => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BronzeIngot,1), new ItemNonInvBasic((ushort)Items.PickaxeHeadBronze,1))
- };
-
- case (ushort)Items.PickaxeHeadGold:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PickaxeHeadGold => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.GoldIngot,1), new ItemNonInvBasic((ushort)Items.PickaxeHeadGold,1))
- };
-
- case (ushort)Items.PickaxeHeadAluminium:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PickaxeHeadAluminium => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.AluminiumIngot,1), new ItemNonInvBasic((ushort)Items.PickaxeHeadAluminium,1))
- };
-
- case (ushort)Items.PickaxeHeadSteel:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PickaxeHeadSteel => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.SteelIngot,1), new ItemNonInvBasic((ushort)Items.PickaxeHeadSteel,1))
- };
-
- case (ushort)Items.ShovelHeadIron:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShovelHeadIron => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.IronIngot,1),new ItemNonInvBasic((ushort)Items.ShovelHeadIron,1))
- };
-
- case (ushort)Items.ShovelHeadCopper:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShovelHeadCopper => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CopperIngot,1),new ItemNonInvBasic((ushort)Items.ShovelHeadCopper,1))
- };
-
- case (ushort)Items.ShovelHeadBronze:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShovelHeadBronze => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CopperIngot,1),new ItemNonInvBasic((ushort)Items.ShovelHeadBronze,1))
- };
-
- case (ushort)Items.ShovelHeadGold:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShovelHeadGold => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.GoldIngot,1),new ItemNonInvBasic((ushort)Items.ShovelHeadGold,1))
- };
-
- case (ushort)Items.ShovelHeadAluminium:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShovelHeadAluminium => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.AluminiumIngot,1),new ItemNonInvBasic((ushort)Items.ShovelHeadAluminium,1))
- };
-
- case (ushort)Items.ShearsHeadAluminium:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShearsHeadAluminium => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.AluminiumIngot,1),new ItemNonInvBasic((ushort)Items.ShearsHeadAluminium,1))
- };
-
- case (ushort)Items.ShearsHeadCopper:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShearsHeadCopper => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CopperIngot,1),new ItemNonInvBasic((ushort)Items.ShearsHeadCopper,1))
- };
-
- case (ushort)Items.ShearsHeadBronze:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShearsHeadBronze => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BronzeIngot,1),new ItemNonInvBasic((ushort)Items.ShearsHeadBronze,1))
- };
-
- case (ushort)Items.ShearsHeadIron:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShearsHeadIron => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.IronIngot,1),new ItemNonInvBasic((ushort)Items.ShearsHeadIron,1))
- };
-
- case (ushort)Items.ShearsHeadGold:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShearsHeadGold => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.GoldIngot,1),new ItemNonInvBasic((ushort)Items.ShearsHeadGold,1))
- };
-
- case (ushort)Items.ShearsHeadSteel:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShearsHeadSteel => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.SteelIngot,1),new ItemNonInvBasic((ushort)Items.ShearsHeadSteel,1))
- };
-
- case (ushort)Items.KnifeHeadSteel:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.KnifeHeadSteel => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.SteelIngot,1),new ItemNonInvBasic((ushort)Items.KnifeHeadSteel,1))
- };
-
- case (ushort)Items.KnifeHeadCopper:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.KnifeHeadCopper => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CopperIngot,1),new ItemNonInvBasic((ushort)Items.KnifeHeadCopper,1))
- };
-
- case (ushort)Items.KnifeHeadBronze:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.KnifeHeadBronze => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BronzeIngot,1),new ItemNonInvBasic((ushort)Items.KnifeHeadBronze,1))
- };
-
- case (ushort)Items.KnifeHeadGold:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.KnifeHeadGold => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.GoldIngot,1),new ItemNonInvBasic((ushort)Items.KnifeHeadGold,1))
- };
-
- case (ushort)Items.KnifeHeadIron:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.KnifeHeadIron => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.IronIngot,1),new ItemNonInvBasic((ushort)Items.KnifeHeadIron,1))
- };
-
- case (ushort)Items.KnifeHeadAluminium:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.KnifeHeadAluminium => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.AluminiumIngot,1),new ItemNonInvBasic((ushort)Items.KnifeHeadAluminium,1))
- };
-
- case (ushort)Items.Glass:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Glass => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Sand,1), new ItemNonInvBasic((ushort)Items.Glass,1))
- };
-
- case (ushort)Items.Rubber:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Rubber => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[] {
new CraftingIn(new ItemNonInv[]{
@@ -3945,10 +3433,8 @@ static class GameMethods {
new ItemNonInvBasic((ushort)Items.Rubber,1)
)
//new CraftingRecipe((ushort)Items.Resin, (ushort)Items.Rubber)
- };
-
- case (ushort)Items.Ash:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Ash => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[] {
new CraftingIn(new ItemNonInv[]{
@@ -3959,15 +3445,11 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Ash,1)
)
- };
-
- case (ushort)Items.CoalWood:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.CoalWood => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Planks, 2), new ItemNonInvBasic((ushort)Items.CoalWood, 1))
- };
-
- case (ushort)Items.Silicium:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Silicium => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[] {
new CraftingIn(new ItemNonInvTool((ushort)Items.ItemBattery)),
@@ -3980,10 +3462,8 @@ static class GameMethods {
new CraftingOut(new ItemNonInvTool((ushort)Items.ItemBattery, 1)),
}
)
- };
-
- case (ushort)Items.AluminiumIngot:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AluminiumIngot => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[] {
new CraftingIn(new ItemNonInvTool((ushort)Items.ItemBattery)),
@@ -4002,10 +3482,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.AluminiumIngot,1)
)
- };
-
- case (ushort)Items.IronIngot:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.IronIngot => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn( new ItemNonInv[]{
@@ -4021,10 +3499,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.IronIngot,1)
)
- };
-
- case (ushort)Items.SilverIngot:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.SilverIngot => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn( new ItemNonInv[]{
@@ -4034,10 +3510,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.SilverIngot,1)
)
- };
-
- case (ushort)Items.CopperIngot:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.CopperIngot => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInv[]{
@@ -4049,10 +3523,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.CopperIngot,1)
)
- };
-
- case (ushort)Items.GoldIngot:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.GoldIngot => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{new CraftingIn(
new ItemNonInv[]{
@@ -4063,10 +3535,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.GoldIngot,1)
)
- };
-
- case (ushort)Items.BronzeIngot:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.BronzeIngot => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[] {
new CraftingIn(new ItemNonInv[]{ new ItemNonInvBasic((ushort)Items.ItemCopper, 3), new ItemNonInvBasic((ushort)Items.CopperIngot, 3)}),
@@ -4082,31 +3552,25 @@ static class GameMethods {
new ItemNonInvBasic((ushort)Items.BronzeIngot, 2)
),
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.PlateBronze, 2),new ItemNonInvBasic((ushort)Items.BronzeIngot, 2)),
- };
-
- case (ushort)Items.TinIngot:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.TinIngot => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInv[]{ new ItemNonInvBasic((ushort)Items.ItemTin, 1), new ItemNonInvBasic((ushort)Items.TinDust, 2), new ItemNonInvBasic((ushort)Items.OreTin, 1)})
},
new ItemNonInvBasic((ushort)Items.TinIngot,1)
)
- };
-
- default: return null;
- }
+ },
+ _ => null,
+ };
}
public static CraftingRecipe[] Clothes(ushort id) {
- switch (id) {
- case (ushort)Items.boiledEgg:
- return new CraftingRecipe[] {
+ return id switch {
+ (ushort)Items.boiledEgg => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Egg,1), new ItemNonInvBasic((ushort)Items.boiledEgg,1))
- };
-
- case (ushort)Items.BucketForRubber:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.BucketForRubber => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[] {
new CraftingIn(new ItemNonInvBasic((ushort)Items.Bucket, 1)),
@@ -4114,10 +3578,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.BucketForRubber, 1)
)
- };
-
- case (ushort)Items.Hat:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Hat => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[] {
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth, 1)),
@@ -4125,10 +3587,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Hat, 1)
)
- };
-
- case (ushort)Items.Crown:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Crown => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.PlateGold, 2)),
@@ -4138,11 +3598,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Crown, 1)
)
- };
-
-
- case (ushort)Items.Cap:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Cap => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)),
@@ -4150,11 +3607,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Cap, 1)
)
- };
-
-
- case (ushort)Items.SpaceHelmet:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.SpaceHelmet => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)),
@@ -4164,15 +3618,11 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.SpaceHelmet, 1)
)
- };
-
- case (ushort)Items.FormalShoes:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.FormalShoes => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Cloth,1), new ItemNonInvBasic((ushort)Items.FormalShoes,1))
- };
-
- case (ushort)Items.Pumps:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Pumps => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)),
@@ -4180,15 +3630,11 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Pumps, 1)
)
- };
-
- case (ushort)Items.Sneakers:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Sneakers => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Cloth,1),new ItemNonInvBasic((ushort)Items.Sneakers,1))
- };
-
- case (ushort)Items.SpaceBoots:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.SpaceBoots => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)),
@@ -4196,19 +3642,15 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.SpaceBoots, 1)
)
- };
-
-
- case (ushort)Items.BikiniDown:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.BikiniDown => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1))
},
new ItemNonInvBasic((ushort)Items.BikiniDown,1)
)
- };
-
+ },
//case (ushort)Items.BlueBikini:
// return new CraftingRecipe[] {
// new CraftingRecipe(
@@ -4219,45 +3661,32 @@ static class GameMethods {
// new ItemNonInv((ushort)Items.BlueBikini, 1)
// )
// };
-
-
- case (ushort)Items.Underpants:
- return new CraftingRecipe[] {
+ (ushort)Items.Underpants => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1))
},
new ItemNonInvBasic((ushort)Items.Underpants, 1)
)
- };
-
-
- case (ushort)Items.BoxerShorts:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.BoxerShorts => new CraftingRecipe[] {
new CraftingRecipe(
new ItemNonInvBasic((ushort)Items.Cloth,1),
new ItemNonInvBasic((ushort)Items.BoxerShorts,1)
)
- };
-
-
+ },
//case (ushort)Items.GrayUnderpants:
// return new CraftingRecipe[] {
// new CraftingRecipe((ushort)Items.Cloth, (ushort)Items.GrayUnderpants)
// };
-
-
- case (ushort)Items.Panties:
- return new CraftingRecipe[] {
+ (ushort)Items.Panties => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1))
},
new ItemNonInvBasic((ushort)Items.Panties, 1)
)
- };
-
-
+ },
//case (ushort)Items.PantiesRed:
// return new CraftingRecipe[] {
// new CraftingRecipe(
@@ -4268,10 +3697,7 @@ static class GameMethods {
// new ItemNonInv((ushort)Items.PantiesRed, 1)
// )
// };
-
-
- case (ushort)Items.Swimsuit:
- return new CraftingRecipe[] {
+ (ushort)Items.Swimsuit => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)),
@@ -4279,55 +3705,41 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Swimsuit, 1)
)
- };
-
-
- case (ushort)Items.Dress:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Dress => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,3))
},
new ItemNonInvBasic((ushort)Items.Dress, 1)
)
- };
-
-
- case (ushort)Items.TShirt:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.TShirt => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,2))
},
new ItemNonInvBasic((ushort)Items.TShirt, 1)
)
- };
-
-
- //case (ushort)Items.LightBlueTShirt:
- // return new CraftingRecipe[] {
- // new CraftingRecipe(
- // new CraftingIn[]{
- // new CraftingIn(new ItemNonInv((ushort)Items.Cloth,2)),
- // new CraftingIn(new ItemNonInvBasic((ushort)Items.Blueberries),
- // },
- // new ItemNonInv((ushort)Items.LightBlueTShirt, 1)
- // )
- // };
-
-
- case (ushort)Items.Shirt:
- return new CraftingRecipe[] {
+ },
+ //case (ushort)Items.LightBlueTShirt:
+ // return new CraftingRecipe[] {
+ // new CraftingRecipe(
+ // new CraftingIn[]{
+ // new CraftingIn(new ItemNonInv((ushort)Items.Cloth,2)),
+ // new CraftingIn(new ItemNonInvBasic((ushort)Items.Blueberries),
+ // },
+ // new ItemNonInv((ushort)Items.LightBlueTShirt, 1)
+ // )
+ // };
+ (ushort)Items.Shirt => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Cloth,2), new ItemNonInvBasic((ushort)Items.Shirt, 1))
- };
-
+ },
//case (ushort)Items.Dress:
// return new CraftingRecipe[] {
// new CraftingRecipe(new ItemNonInv((ushort)Items.Cloth,3), new ItemNonInv((ushort)Items.WhiteDress, 1))
// };
-
- case (ushort)Items.CoatArmy:
- return new CraftingRecipe[] {
+ (ushort)Items.CoatArmy => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[] {
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,3)),
@@ -4335,15 +3747,11 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.CoatArmy, 1)
)
- };
-
- case (ushort)Items.Coat:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Coat => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Cloth,3), new ItemNonInvBasic((ushort)Items.Coat, 1))
- };
-
- case (ushort)Items.JacketDenim:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.JacketDenim => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[] {
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,2)),
@@ -4351,10 +3759,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.JacketDenim,1)
)
- };
-
- case (ushort)Items.JacketFormal:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.JacketFormal => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,2)),
@@ -4362,8 +3768,7 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.JacketFormal,1)
)
- };
-
+ },
//case (ushort)Items.jac:
// return new CraftingRecipe[] {
// new CraftingRecipe(
@@ -4374,9 +3779,7 @@ static class GameMethods {
// new ItemNonInvBasic((ushort)Items.Jacket
// )
// };
-
- case (ushort)Items.JacketShort:
- return new CraftingRecipe[] {
+ (ushort)Items.JacketShort => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)),
@@ -4384,11 +3787,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.JacketShort,1)
)
- };
-
-
- case (ushort)Items.SpaceSuit:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.SpaceSuit => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)),
@@ -4399,10 +3799,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.SpaceSuit,1)
)
- };
-
- case (ushort)Items.ArmyTrousers:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ArmyTrousers => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)),
@@ -4410,20 +3808,16 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.ArmyTrousers,1)
)
- };
-
- case (ushort)Items.Skirt:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Skirt => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1))
},
new ItemNonInvBasic((ushort)Items.Skirt,1)
)
- };
-
- case (ushort)Items.Jeans:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Jeans => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)),
@@ -4431,8 +3825,7 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Jeans,1)
)
- };
-
+ },
//case (ushort)Items.Skirt:
// return new CraftingRecipe[] {
// new CraftingRecipe(
@@ -4444,10 +3837,7 @@ static class GameMethods {
// new ItemNonInvBasic((ushort)Items.PinkSkirt
// )
// };
-
-
- case (ushort)Items.Shorts:
- return new CraftingRecipe[] {
+ (ushort)Items.Shorts => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)),
@@ -4455,11 +3845,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Shorts, 1)
)
- };
-
-
- case (ushort)Items.SpaceTrousers:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.SpaceTrousers => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)),
@@ -4468,10 +3855,8 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.SpaceTrousers,1)
)
- };
-
- case (ushort)Items.Bra:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Bra => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)),
@@ -4479,8 +3864,7 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Bra,1)
)
- };
-
+ },
//case (ushort)Items.PurpleBra:
// return new CraftingRecipe[] {
// new CraftingRecipe(
@@ -4492,8 +3876,6 @@ static class GameMethods {
// new ItemNonInv((ushort)Items.PurpleBra, 1)
// )
// };
-
-
//case (ushort)Items.RedBra:
// return new CraftingRecipe[] {
// new CraftingRecipe(
@@ -4504,9 +3886,7 @@ static class GameMethods {
// new ItemNonInv((ushort)Items.RedBra, 1)
// )
// };
-
- case (ushort)Items.BikiniTop:
- return new CraftingRecipe[] {
+ (ushort)Items.BikiniTop => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)),
@@ -4515,8 +3895,7 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.BikiniTop,1)
)
- };
-
+ },
//case (ushort)Items.TopBlueBikini:
// return new CraftingRecipe[] {
// new CraftingRecipe(
@@ -4528,9 +3907,7 @@ static class GameMethods {
// new ItemNonInvBasic((ushort)Items.TopBlueBikini
// )
// };
-
- case (ushort)Items.Backpack:
- return new CraftingRecipe[] {
+ (ushort)Items.Backpack => new CraftingRecipe[] {
new CraftingRecipe(
new CraftingIn[]{
new CraftingIn(new ItemNonInvBasic((ushort)Items.Cloth,1)),
@@ -4538,21 +3915,17 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.Backpack,1)
)
- };
-
- default: return null;
- }
+ },
+ _ => null,
+ };
}
public static CraftingRecipe[] ToDust(ushort id) {
- switch (id) {
- case (ushort)Items.StoneHead:
- return new CraftingRecipe[] {
+ return id switch {
+ (ushort)Items.StoneHead => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BigStone,1), new ItemNonInvBasic((ushort)Items.StoneHead, 1)),
- };
-
- case (ushort)Items.IronDust:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.IronDust => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.IronIngot,1), new ItemNonInvBasic((ushort)Items.IronDust, 2)),
new CraftingRecipe(
new ItemNonInvBasic((ushort)Items.ItemIron,1),
@@ -4573,27 +3946,19 @@ static class GameMethods {
},
new ItemNonInvBasic((ushort)Items.IronDust,2)
)
- };
-
- case (ushort)Items.CopperDust:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.CopperDust => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CopperIngot,1), new ItemNonInvBasic((ushort)Items.CopperDust,2)),
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.ItemCopper,1), new CraftingOut(new ItemNonInvBasic((ushort)Items.CopperDust,3),0.75f))
- };
-
- case (ushort)Items.BareLabel:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.BareLabel => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BareLabel,1), new ItemNonInvBasic((ushort)Items.CopperDust,1)),
- };
-
- case (ushort)Items.TinDust:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.TinDust => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.TinIngot,1), new CraftingOut(new ItemNonInvBasic((ushort)Items.TinDust,2),0.75f)),
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.ItemTin,1), new CraftingOut(new ItemNonInvBasic((ushort)Items.TinDust,1),0.75f))
- };
-
- case (ushort)Items.BronzeDust:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.BronzeDust => new CraftingRecipe[] {
new CraftingRecipe (
new CraftingIn[] {
new CraftingIn(new ItemNonInvBasic((ushort)Items.CopperIngot, 3)),
@@ -4602,113 +3967,73 @@ static class GameMethods {
new ItemNonInvBasic((ushort)Items.BronzeDust, 8)
),
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BronzeIngot,1), new ItemNonInvBasic((ushort)Items.BronzeDust,2))
- };
-
- case (ushort)Items.AluminiumDust:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AluminiumDust => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.AluminiumIngot, 1), new ItemNonInvBasic((ushort)Items.AluminiumDust, 2))
- };
-
- case (ushort)Items.WoodDust:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.WoodDust => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Stick,1), new ItemNonInvBasic((ushort)Items.WoodDust, 4))
- };
-
- case (ushort)Items.GoldDust:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.GoldDust => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.GoldIngot,1), new ItemNonInvBasic((ushort)Items.GoldDust, 2)),
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.ItemGold,1), new CraftingOut(new ItemNonInvBasic((ushort)Items.GoldDust,3), 0.75f))
- };
-
- case (ushort)Items.CoalDust:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.CoalDust => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.OreCoal,1), new ItemNonInvBasic((ushort)Items.CoalDust, 2)),
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CoalWood,1), new ItemNonInvBasic((ushort)Items.CoalDust, 2))
- };
-
- case (ushort)Items.SilverDust:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.SilverDust => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.SilverIngot,1), new ItemNonInvBasic((ushort)Items.SilverDust, 2)),
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.ItemSilver,1), new CraftingOut(new ItemNonInvBasic((ushort)Items.SilverDust,3), 0.75f))
- };
-
- case (ushort)Items.CopperIngot:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.CopperIngot => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Label,1), new ItemNonInvBasic((ushort)Items.BareLabel,1)),
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.CoalWood,1), new ItemNonInvBasic((ushort)Items.BareLabel, 2))
- };
-
- case (ushort)Items.Gravel:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Gravel => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BigStone,1),new ItemNonInvBasic((ushort)Items.Gravel,1)),
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.MediumStone, 2), new ItemNonInvBasic((ushort)Items.Gravel,1)),
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.SmallStone, 4), new ItemNonInvBasic((ushort)Items.Gravel,1)),
- };
-
- case (ushort)Items.Sand:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Sand => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Gravel,1), new ItemNonInvBasic((ushort)Items.Sand, 1)),
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Bricks,1), new ItemNonInvBasic((ushort)Items.Sand, 1))
- };
-
- case (ushort)Items.WheatSeeds:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.WheatSeeds => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.WheatStraw,1), new ItemNonInvBasic((ushort)Items.WheatSeeds,1))
- };
-
- case (ushort)Items.AxeHeadIron:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.AxeHeadIron => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.IronIngot,1),new ItemNonInvBasic((ushort)Items.AxeHeadIron,1))
- };
-
- case (ushort)Items.PickaxeHeadIron:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.PickaxeHeadIron => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.IronIngot,1), new ItemNonInvBasic((ushort)Items.PickaxeHeadIron,1))
- };
-
- case (ushort)Items.ShovelHeadIron:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.ShovelHeadIron => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.IronIngot,1), new ItemNonInvBasic((ushort)Items.ShovelHeadIron,1))
- };
-
- case (ushort)Items.Seeds:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Seeds => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Hay,1), new ItemNonInvBasic((ushort)Items.Seeds,1))
- };
-
- case (ushort)Items.Leave:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Leave => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.OakLeaves,1), new ItemNonInvBasic((ushort)Items.Seeds, 4))
- };
-
- case (ushort)Items.Yarn:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Yarn => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Cloth,1), new ItemNonInvBasic((ushort)Items.Yarn, 2)),
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Rope,1), new ItemNonInvBasic((ushort)Items.Yarn, 1)),
- };
-
- case (ushort)Items.Cloth:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Cloth => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Flag,1), new ItemNonInvBasic((ushort)Items.Cloth, 2))
- };
-
- case (ushort)Items.Hay:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Hay => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.HayBlock,1), new ItemNonInvBasic((ushort)Items.Hay, 2))
- };
-
- case (ushort)Items.BucketWater:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.BucketWater => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Bucket,1), new ItemNonInvBasic((ushort)Items.Lemon, 4)),
- };
-
- case (ushort)Items.FlaxSeeds:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.FlaxSeeds => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Flax,1), new CraftingOut(new ItemNonInvBasic((ushort)Items.FlaxSeeds,2),0.75f))
- };
-
- case (ushort)Items.Label:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Label => new CraftingRecipe[] {
new CraftingRecipe(
new ItemNonInvBasic((ushort)Items.Lamp,1),
new CraftingOut[]{
@@ -4763,34 +4088,25 @@ static class GameMethods {
new CraftingOut(new ItemNonInvBasic((ushort)Items.Motor, 1))
}
),
- };
-
- case (ushort)Items.SmallStone:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.SmallStone => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.MediumStone,1), new ItemNonInvBasic((ushort)Items.SmallStone, 2)),
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BigStone,1), new ItemNonInvBasic((ushort)Items.SmallStone, 4)),
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Stonerubble,1), new ItemNonInvBasic((ushort)Items.SmallStone, 4)),
- };
-
- case (ushort)Items.MediumStone:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.MediumStone => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.BigStone,1), new ItemNonInvBasic((ushort)Items.MediumStone, 2)),
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.Stonerubble,1), new ItemNonInvBasic((ushort)Items.MediumStone, 2)),
- };
-
- case (ushort)Items.Stonerubble:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Stonerubble => new CraftingRecipe[] {
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.SmallStone, 4), new ItemNonInvBasic((ushort)Items.Stonerubble, 1)),
new CraftingRecipe(new ItemNonInvBasic((ushort)Items.MediumStone, 2), new ItemNonInvBasic((ushort)Items.Stonerubble, 1))
- };
-
- case (ushort)Items.Stick:
- return new CraftingRecipe[] {
+ },
+ (ushort)Items.Stick => new CraftingRecipe[] {
new CraftingRecipe(new CraftingIn[]{ CraftingRecipe.AnyWood(1) }, new ItemNonInvBasic((ushort)Items.Stick, 4))
- };
-
- default: return null;
- }
+ },
+ _ => null,
+ };
}
public static int FoodMaxCount(ushort id) {
@@ -5163,215 +4479,193 @@ static class GameMethods {
}
public static bool IsItemInvBasic32(ushort id) {
- switch (id) {
- case (ushort)Items.AngelHair: return true;
- case (ushort)Items.ChristmasBallGray: return true;
- case (ushort)Items.ChristmasBallBlue: return true;
- case (ushort)Items.ChristmasBallLightGreen: return true;
- case (ushort)Items.ChristmasBallOrange: return true;
- case (ushort)Items.ChristmasBallPink: return true;
- case (ushort)Items.ChristmasBallPurple: return true;
- case (ushort)Items.ChristmasBallRed: return true;
- case (ushort)Items.ChristmasBallYellow: return true;
- case (ushort)Items.ChristmasBallTeal: return true;
- case (ushort)Items.Rope: return true;
- case (ushort)Items.Nail: return true;
- case (ushort)Items.Bottle: return true;
- case (ushort)Items.Flag: return true;
- case (ushort)Items.Diode: return true;
- case (ushort)Items.Tranzistor: return true;
- case (ushort)Items.Rezistance: return true;
- case (ushort)Items.Motor: return true;
- case (ushort)Items.ElectricDrillOff: return true;
- case (ushort)Items.ElectricSawOff: return true;
- case (ushort)Items.LighterOFF: return true;
- case (ushort)Items.TorchElectricOFF: return true;
- case (ushort)Items.Condenser: return true;
- case (ushort)Items.Rod: return true;
- case (ushort)Items.Ammo: return true;
+ return id switch {
+ (ushort)Items.AngelHair => true,
+ (ushort)Items.ChristmasBallGray => true,
+ (ushort)Items.ChristmasBallBlue => true,
+ (ushort)Items.ChristmasBallLightGreen => true,
+ (ushort)Items.ChristmasBallOrange => true,
+ (ushort)Items.ChristmasBallPink => true,
+ (ushort)Items.ChristmasBallPurple => true,
+ (ushort)Items.ChristmasBallRed => true,
+ (ushort)Items.ChristmasBallYellow => true,
+ (ushort)Items.ChristmasBallTeal => true,
+ (ushort)Items.Rope => true,
+ (ushort)Items.Nail => true,
+ (ushort)Items.Bottle => true,
+ (ushort)Items.Flag => true,
+ (ushort)Items.Diode => true,
+ (ushort)Items.Tranzistor => true,
+ (ushort)Items.Rezistance => true,
+ (ushort)Items.Motor => true,
+ (ushort)Items.ElectricDrillOff => true,
+ (ushort)Items.ElectricSawOff => true,
+ (ushort)Items.LighterOFF => true,
+ (ushort)Items.TorchElectricOFF => true,
+ (ushort)Items.Condenser => true,
+ (ushort)Items.Rod => true,
+ (ushort)Items.Ammo => true,
//case (ushort)Items.ItemBattery: return true;
- case (ushort)Items.Label: return true;
- case (ushort)Items.BareLabel: return true;
- case (ushort)Items.Bricks: return true;
- case (ushort)Items.plateAluminium: return true;
- case (ushort)Items.PlateBronze: return true;
- case (ushort)Items.PlateIron: return true;
- case (ushort)Items.PlateGold: return true;
- case (ushort)Items.PlateCopper: return true;
- case (ushort)Items.MudIngot: return true;
- case (ushort)Items.Bulb: return true;
-
- case (ushort)Items.CopperIngot: return true;
- case (ushort)Items.TinIngot: return true;
- case (ushort)Items.BronzeIngot: return true;
- case (ushort)Items.GoldIngot: return true;
- case (ushort)Items.SilverIngot: return true;
- case (ushort)Items.IronIngot: return true;
- case (ushort)Items.SteelIngot: return true;
- case (ushort)Items.AluminiumIngot: return true;
-
-
- case (ushort)Items.Egg: return true;
- case (ushort)Items.TinEmpty: return true;
- case (ushort)Items.Circuit: return true;
- case (ushort)Items.BigCircuit: return true;
- case (ushort)Items.WindMill: return true;
- case (ushort)Items.OneBrick: return true;
- case (ushort)Items.TestTube: return true;
-
-
- case (ushort)Items.AxeHeadCopper: return true;
- case (ushort)Items.AxeHeadBronze: return true;
- case (ushort)Items.AxeHeadGold: return true;
- case (ushort)Items.AxeHeadIron: return true;
- case (ushort)Items.AxeHeadSteel: return true;
- case (ushort)Items.AxeHeadAluminium: return true;
-
- case (ushort)Items.ShovelHeadCopper: return true;
- case (ushort)Items.ShovelHeadBronze: return true;
- case (ushort)Items.ShovelHeadGold: return true;
- case (ushort)Items.ShovelHeadIron: return true;
- case (ushort)Items.ShovelHeadSteel: return true;
- case (ushort)Items.ShovelHeadAluminium: return true;
-
- case (ushort)Items.PickaxeHeadCopper: return true;
- case (ushort)Items.PickaxeHeadBronze: return true;
- case (ushort)Items.PickaxeHeadGold: return true;
- case (ushort)Items.PickaxeHeadIron: return true;
- case (ushort)Items.PickaxeHeadSteel: return true;
- case (ushort)Items.PickaxeHeadAluminium: return true;
-
- case (ushort)Items.ShearsHeadCopper: return true;
- case (ushort)Items.ShearsHeadBronze: return true;
- case (ushort)Items.ShearsHeadGold: return true;
- case (ushort)Items.ShearsHeadIron: return true;
- case (ushort)Items.ShearsHeadSteel: return true;
- case (ushort)Items.ShearsHeadAluminium: return true;
-
- case (ushort)Items.KnifeHeadCopper: return true;
- case (ushort)Items.KnifeHeadBronze: return true;
- case (ushort)Items.KnifeHeadGold: return true;
- case (ushort)Items.KnifeHeadIron: return true;
- case (ushort)Items.KnifeHeadSteel: return true;
- case (ushort)Items.KnifeHeadAluminium: return true;
-
- }
- return false;
+ (ushort)Items.Label => true,
+ (ushort)Items.BareLabel => true,
+ (ushort)Items.Bricks => true,
+ (ushort)Items.plateAluminium => true,
+ (ushort)Items.PlateBronze => true,
+ (ushort)Items.PlateIron => true,
+ (ushort)Items.PlateGold => true,
+ (ushort)Items.PlateCopper => true,
+ (ushort)Items.MudIngot => true,
+ (ushort)Items.Bulb => true,
+ (ushort)Items.CopperIngot => true,
+ (ushort)Items.TinIngot => true,
+ (ushort)Items.BronzeIngot => true,
+ (ushort)Items.GoldIngot => true,
+ (ushort)Items.SilverIngot => true,
+ (ushort)Items.IronIngot => true,
+ (ushort)Items.SteelIngot => true,
+ (ushort)Items.AluminiumIngot => true,
+ (ushort)Items.Egg => true,
+ (ushort)Items.TinEmpty => true,
+ (ushort)Items.Circuit => true,
+ (ushort)Items.BigCircuit => true,
+ (ushort)Items.WindMill => true,
+ (ushort)Items.OneBrick => true,
+ (ushort)Items.TestTube => true,
+ (ushort)Items.AxeHeadCopper => true,
+ (ushort)Items.AxeHeadBronze => true,
+ (ushort)Items.AxeHeadGold => true,
+ (ushort)Items.AxeHeadIron => true,
+ (ushort)Items.AxeHeadSteel => true,
+ (ushort)Items.AxeHeadAluminium => true,
+ (ushort)Items.ShovelHeadCopper => true,
+ (ushort)Items.ShovelHeadBronze => true,
+ (ushort)Items.ShovelHeadGold => true,
+ (ushort)Items.ShovelHeadIron => true,
+ (ushort)Items.ShovelHeadSteel => true,
+ (ushort)Items.ShovelHeadAluminium => true,
+ (ushort)Items.PickaxeHeadCopper => true,
+ (ushort)Items.PickaxeHeadBronze => true,
+ (ushort)Items.PickaxeHeadGold => true,
+ (ushort)Items.PickaxeHeadIron => true,
+ (ushort)Items.PickaxeHeadSteel => true,
+ (ushort)Items.PickaxeHeadAluminium => true,
+ (ushort)Items.ShearsHeadCopper => true,
+ (ushort)Items.ShearsHeadBronze => true,
+ (ushort)Items.ShearsHeadGold => true,
+ (ushort)Items.ShearsHeadIron => true,
+ (ushort)Items.ShearsHeadSteel => true,
+ (ushort)Items.ShearsHeadAluminium => true,
+ (ushort)Items.KnifeHeadCopper => true,
+ (ushort)Items.KnifeHeadBronze => true,
+ (ushort)Items.KnifeHeadGold => true,
+ (ushort)Items.KnifeHeadIron => true,
+ (ushort)Items.KnifeHeadSteel => true,
+ (ushort)Items.KnifeHeadAluminium => true,
+ _ => false,
+ };
}
public static bool IsItemInvTool32(ushort id) {
- switch (id) {
+ return id switch {
// Hoe
- case (ushort)Items.HoeStone: return true;
- case (ushort)Items.HoeCopper: return true;
- case (ushort)Items.HoeBronze: return true;
- case (ushort)Items.HoeIron: return true;
- case (ushort)Items.HoeGold: return true;
- case (ushort)Items.HoeAluminium: return true;
- case (ushort)Items.HoeSteel: return true;
-
+ (ushort)Items.HoeStone => true,
+ (ushort)Items.HoeCopper => true,
+ (ushort)Items.HoeBronze => true,
+ (ushort)Items.HoeIron => true,
+ (ushort)Items.HoeGold => true,
+ (ushort)Items.HoeAluminium => true,
+ (ushort)Items.HoeSteel => true,
// Knife
- case (ushort)Items.KnifeCopper: return true;
- case (ushort)Items.KnifeBronze: return true;
- case (ushort)Items.KnifeIron: return true;
- case (ushort)Items.KnifeSteel: return true;
- case (ushort)Items.KnifeAluminium: return true;
- case (ushort)Items.KnifeGold: return true;
-
+ (ushort)Items.KnifeCopper => true,
+ (ushort)Items.KnifeBronze => true,
+ (ushort)Items.KnifeIron => true,
+ (ushort)Items.KnifeSteel => true,
+ (ushort)Items.KnifeAluminium => true,
+ (ushort)Items.KnifeGold => true,
// Pickaxe
- case (ushort)Items.PickaxeStone: return true;
- case (ushort)Items.PickaxeIron: return true;
- case (ushort)Items.PickaxeCopper: return true;
- case (ushort)Items.PickaxeBronze: return true;
- case (ushort)Items.PickaxeSteel: return true;
- case (ushort)Items.PickaxeGold: return true;
- case (ushort)Items.PickaxeAluminium: return true;
-
+ (ushort)Items.PickaxeStone => true,
+ (ushort)Items.PickaxeIron => true,
+ (ushort)Items.PickaxeCopper => true,
+ (ushort)Items.PickaxeBronze => true,
+ (ushort)Items.PickaxeSteel => true,
+ (ushort)Items.PickaxeGold => true,
+ (ushort)Items.PickaxeAluminium => true,
// Axe
- case (ushort)Items.AxeStone: return true;
- case (ushort)Items.AxeIron: return true;
- case (ushort)Items.AxeSteel: return true;
- case (ushort)Items.AxeAluminium: return true;
- case (ushort)Items.AxeCopper: return true;
- case (ushort)Items.AxeBronze: return true;
- case (ushort)Items.AxeGold: return true;
-
+ (ushort)Items.AxeStone => true,
+ (ushort)Items.AxeIron => true,
+ (ushort)Items.AxeSteel => true,
+ (ushort)Items.AxeAluminium => true,
+ (ushort)Items.AxeCopper => true,
+ (ushort)Items.AxeBronze => true,
+ (ushort)Items.AxeGold => true,
// Shovel
- case (ushort)Items.ShovelStone: return true;
- case (ushort)Items.ShovelIron: return true;
- case (ushort)Items.ShovelSteel: return true;
- case (ushort)Items.ShovelAluminium: return true;
- case (ushort)Items.ShovelGold: return true;
- case (ushort)Items.ShovelCopper: return true;
- case (ushort)Items.ShovelBronze: return true;
-
+ (ushort)Items.ShovelStone => true,
+ (ushort)Items.ShovelIron => true,
+ (ushort)Items.ShovelSteel => true,
+ (ushort)Items.ShovelAluminium => true,
+ (ushort)Items.ShovelGold => true,
+ (ushort)Items.ShovelCopper => true,
+ (ushort)Items.ShovelBronze => true,
// Saw
- case (ushort)Items.SawCopper: return true;
- case (ushort)Items.SawBronze: return true;
- case (ushort)Items.SawIron: return true;
- case (ushort)Items.SawGold: return true;
- case (ushort)Items.SawSteel: return true;
- case (ushort)Items.SawAluminium: return true;
-
+ (ushort)Items.SawCopper => true,
+ (ushort)Items.SawBronze => true,
+ (ushort)Items.SawIron => true,
+ (ushort)Items.SawGold => true,
+ (ushort)Items.SawSteel => true,
+ (ushort)Items.SawAluminium => true,
// Hammer
- case (ushort)Items.HammerBronze: return true;
- case (ushort)Items.HammerIron: return true;
- case (ushort)Items.HammerCopper: return true;
- case (ushort)Items.HammerAluminium: return true;
- case (ushort)Items.HammerGold: return true;
- case (ushort)Items.HammerSteel: return true;
-
+ (ushort)Items.HammerBronze => true,
+ (ushort)Items.HammerIron => true,
+ (ushort)Items.HammerCopper => true,
+ (ushort)Items.HammerAluminium => true,
+ (ushort)Items.HammerGold => true,
+ (ushort)Items.HammerSteel => true,
// Shears
- case (ushort)Items.ShearsCopper: return true;
- case (ushort)Items.ShearsBronze: return true;
- case (ushort)Items.ShearsIron: return true;
- case (ushort)Items.ShearsAluminium: return true;
- case (ushort)Items.ShearsGold: return true;
- case (ushort)Items.ShearsSteel: return true;
-
+ (ushort)Items.ShearsCopper => true,
+ (ushort)Items.ShearsBronze => true,
+ (ushort)Items.ShearsIron => true,
+ (ushort)Items.ShearsAluminium => true,
+ (ushort)Items.ShearsGold => true,
+ (ushort)Items.ShearsSteel => true,
// Electric
- case (ushort)Items.ElectricDrill: return true;
- case (ushort)Items.ElectricSaw: return true;
-
- case (ushort)Items.TorchElectricON: return true;
-
- case (ushort)Items.BottleOil: return true;
- case (ushort)Items.BottleSaltWater: return true;
- case (ushort)Items.BottleWater: return true;
- case (ushort)Items.Gun: return true;
-
- case (ushort)Items.LighterON: return true;
- case (ushort)Items.AirTank2: return true;
- case (ushort)Items.AirTank: return true;
-
- case (ushort)Items.DyeArmy: return true;
- case (ushort)Items.DyeBlack: return true;
- case (ushort)Items.DyeBlue: return true;
- case (ushort)Items.DyeBrown: return true;
- case (ushort)Items.DyeDarkBlue: return true;
- case (ushort)Items.DyeDarkGray: return true;
- case (ushort)Items.DyeDarkGreen: return true;
- case (ushort)Items.DyeDarkRed: return true;
- case (ushort)Items.DyeGold: return true;
- case (ushort)Items.DyeGray: return true;
- case (ushort)Items.DyeGreen: return true;
- case (ushort)Items.DyeLightBlue: return true;
- case (ushort)Items.DyeLightGray: return true;
- case (ushort)Items.DyeLightGreen: return true;
- case (ushort)Items.DyeMagenta: return true;
- case (ushort)Items.DyeOlive: return true;
- case (ushort)Items.DyeOrange: return true;
- case (ushort)Items.DyePink: return true;
- case (ushort)Items.DyePurple: return true;
- case (ushort)Items.DyeRed: return true;
- case (ushort)Items.DyeRoseQuartz: return true;
- case (ushort)Items.DyeSpringGreen: return true;
- case (ushort)Items.DyeTeal: return true;
- case (ushort)Items.DyeViolet: return true;
- case (ushort)Items.DyeWhite: return true;
- case (ushort)Items.DyeYellow: return true;
- }
- return false;
+ (ushort)Items.ElectricDrill => true,
+ (ushort)Items.ElectricSaw => true,
+ (ushort)Items.TorchElectricON => true,
+ (ushort)Items.BottleOil => true,
+ (ushort)Items.BottleSaltWater => true,
+ (ushort)Items.BottleWater => true,
+ (ushort)Items.Gun => true,
+ (ushort)Items.LighterON => true,
+ (ushort)Items.AirTank2 => true,
+ (ushort)Items.AirTank => true,
+ (ushort)Items.DyeArmy => true,
+ (ushort)Items.DyeBlack => true,
+ (ushort)Items.DyeBlue => true,
+ (ushort)Items.DyeBrown => true,
+ (ushort)Items.DyeDarkBlue => true,
+ (ushort)Items.DyeDarkGray => true,
+ (ushort)Items.DyeDarkGreen => true,
+ (ushort)Items.DyeDarkRed => true,
+ (ushort)Items.DyeGold => true,
+ (ushort)Items.DyeGray => true,
+ (ushort)Items.DyeGreen => true,
+ (ushort)Items.DyeLightBlue => true,
+ (ushort)Items.DyeLightGray => true,
+ (ushort)Items.DyeLightGreen => true,
+ (ushort)Items.DyeMagenta => true,
+ (ushort)Items.DyeOlive => true,
+ (ushort)Items.DyeOrange => true,
+ (ushort)Items.DyePink => true,
+ (ushort)Items.DyePurple => true,
+ (ushort)Items.DyeRed => true,
+ (ushort)Items.DyeRoseQuartz => true,
+ (ushort)Items.DyeSpringGreen => true,
+ (ushort)Items.DyeTeal => true,
+ (ushort)Items.DyeViolet => true,
+ (ushort)Items.DyeWhite => true,
+ (ushort)Items.DyeYellow => true,
+ _ => false,
+ };
}
public static bool IsItemInvFood16(ushort id) {
@@ -5679,7 +4973,7 @@ static class GameMethods {
public static bool ItemsCanBeFill(ushort itemId, byte Liquid, ref int max, ref ushort newId){
switch (Liquid) {
-
+
case (byte)LiquidId.Water:
switch (itemId) {
case (ushort)Items.Bucket:
@@ -5819,7 +5113,7 @@ static class GameMethods {
newId=(ushort)Items.ChristmasBallGray;
max=50;
return true;
-
+
case (ushort)Items.ChristmasBallYellow:
newId=(ushort)Items.ChristmasBallGray;
max=50;
@@ -6154,7 +5448,7 @@ static class GameMethods {
return;
}
- public static float FurnaceStoneBurnWood(ushort id) {
+ public static float FurnaceStoneBurnWood(ushort id) {
switch (id) {
case (ushort)Items.WoodOak: return 0.25f;
case (ushort)Items.WoodPine: return 0.25f;
@@ -6174,7 +5468,7 @@ static class GameMethods {
case (ushort)Items.EucalyptusWood: return 0.225f;
case (ushort)Items.AcaciaWood: return 0.225f;
case (ushort)Items.KapokWood: return 0.22f;
-
+
case (ushort)Items.OreCoal: return 0.5f;
case (ushort)Items.Stick: return 0.02f;
case (ushort)Items.Paper: return 0.05f;
diff --git a/rabcrClient/InterLogic/Game/Structs.cs b/rabcrClient/InterLogic/Game/Structs.cs
index 7d28ffa..6998acf 100644
--- a/rabcrClient/InterLogic/Game/Structs.cs
+++ b/rabcrClient/InterLogic/Game/Structs.cs
@@ -1,60 +1,38 @@
using Microsoft.Xna.Framework;
+using System;
using System.Collections.Generic;
-//namespace rabcrClient {
-public class/*struct*/ DInt {
- public int X, Y;
- // public bool Defined;
- //static DInt zero=new DInt(0, 0),
- // notDefined=new DInt(0, 0){ Defined=false };
-
- //public static DInt Zero => zero;
+public class DInt : IEquatable{
- //public static DInt NotDefined => notDefined;
+ public int X, Y;
public DInt () { }
public DInt (int x, int y) {
X = x;
Y = y;
- // Defined=true;
}
- //public DInt (Vector2 vec) {
- // X = (int)vec.X;
- // Y = (int)vec.Y;
- // // Defined=true;
- // }
-
-// public Vector2 Vector() => new Vector2(X, Y);
+ public Vector2 ToVector() => new Vector2(X, Y);
public DInt Clone() => (DInt)MemberwiseClone();
-}
-//public class InventorySlot {
-// public Texture2D Texture;
-// public int Id, Count;
+ public bool Equals(DInt other) => X==other.X && Y==other.Y;
-// public InventorySlot() {
-// Id = 0;
-// Count = 0;
-// }
+ public void Deconstruct(out int x, out int y) {
+ x = X;
+ y = Y;
+ }
-// public InventorySlot(int id, int count) {
-// Id = id;
-// Count = count;
-// }
-//}
+ public static bool operator != (DInt value1, DInt value2) => value1.X != value2.X || value1.Y != value2.Y;
+ public static bool operator == (DInt value1, DInt value2) => value1.X == value2.X && value1.Y == value2.Y;
-public /*class*/struct ShortAndByte {
+}
+
+public struct ShortAndByte {
public short X;
public byte Y;
- //public ShortAndByte() {
- // X = 0;
- // Y = 0;
- //}
-
public ShortAndByte(int x, int y) {
X=(short)x;
Y=(byte)y;
@@ -64,71 +42,14 @@
X = x;
Y = y;
}
-
-// public Vector2 Vector() => new Vector2(X, Y);
}
public struct UShortAndByte {
public ushort X;
public byte Y;
- //public UShortAndByte(int x, int y) {
- // X=(short)x;
- // Y=(byte)y;
- //}
-
public UShortAndByte(ushort x, byte y) {
X = x;
Y = y;
}
-
- //public Vector2 Vector() => new Vector2(X, Y);
-}
-
-public class DListInt {
- public List List1, List2;
-
- //public DListInt () {
- // List1=new List();
- // List2=new List();
- //}
-
- //public DListInt (List list1, List list2) {
- // List1=list1;
- // List2=list2;
- //}
-
- //public DListInt (List list1, DInt list2Item) {
- // List1=list1;
- // List2=new List {
- // list2Item
- // };
- //}
-
- //public DListInt (DInt list1Item, List list2) {
- // List2=list2;
- // List1=new List {
- // list1Item
- // };
- //}
-
- //public DListInt (DInt list1Item, DInt list2Item) {
- // List1=new List {
- // list1Item
- // };
-
- // List2=new List {
- // list2Item
- // };
- //}
-
- //public DListInt (List list) {
- // List1=list;
- // List2=list;
- //}
-
- //public DListInt (List list1, DInt[] list2) {
- // List1=list1;
- // List2=list2.ToList();
- //}
}
\ No newline at end of file
diff --git a/rabcrClient/InterLogic/Game/Terrain/GenerateWorld.cs b/rabcrClient/InterLogic/Game/Terrain/GenerateWorld.cs
index 00d8336..49d6ed5 100644
--- a/rabcrClient/InterLogic/Game/Terrain/GenerateWorld.cs
+++ b/rabcrClient/InterLogic/Game/Terrain/GenerateWorld.cs
@@ -1,10 +1,12 @@
-using System.Collections.Generic;
+using Microsoft.Xna.Framework;
+using System;
+using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Threading;
-namespace rabcrClient {
- public class GenDataBasic {
+namespace rabcrClient {
+ public class GenDataBasic {
public ushort Id;
public virtual void SaveTop(List list) { }
@@ -74,87 +76,23 @@ enum Biome :byte {
SpaceStation,
}
- public class GenDataWater: GenDataBasic{
- public override void SaveTop(List list) {
+ public class GenDataWater: GenDataBasic{
+ public override void SaveTop(List list) {
list.Add(255);
}
- }
-
+ }
+
public class GenerateWorld {
- //readonly GenDataBasic
- // (ushort)BlockId.Gravel =new GenDataBasic{ Id=(ushort)BlockId. Gravel },
- // (ushort)BlockId.Sand =new GenDataBasic{ Id=(ushort)BlockId. Sand },
- // (ushort)BlockId.Cobblestone=new GenDataBasic{ Id=(ushort)BlockId. Cobblestone },
- // (ushort)BlockId.Snow =new GenDataBasic{ Id=(ushort)BlockId. Snow },
- // (ushort)BlockId.Dandelion =new GenDataBasic{ Id=(ushort)BlockId. Dandelion },
- // (ushort)BlockId.SnowTop =new GenDataBasic{ Id=(ushort)BlockId. SnowTop },
- // (ushort)BlockId.Coral =new GenDataBasic{ Id=(ushort)BlockId. Coral },
- // (ushort)BlockId.GrassBlockHills =new GenDataBasic{ Id=(ushort)BlockId. GrassBlockHills },
- // (ushort)BlockId.GrassBlockForest =new GenDataBasic{ Id=(ushort)BlockId. GrassBlockForest },
- // (ushort)BlockId.GrassBlockJungle =new GenDataBasic{ Id=(ushort)BlockId. GrassBlockJungle },
- // (ushort)BlockId.GrassBlockDesert =new GenDataBasic{ Id=(ushort)BlockId. GrassBlockDesert },
- // (ushort)BlockId.GrassBlockPlains =new GenDataBasic{ Id=(ushort)BlockId. GrassBlockPlains },
- // (ushort)BlockId.GrassBlockClay =new GenDataBasic{ Id=(ushort)BlockId. GrassBlockClay },
- // (ushort)BlockId.Heater =new GenDataBasic{ Id=(ushort)BlockId. Heather },
- // (ushort)BlockId.Rocks =new GenDataBasic{ Id=(ushort)BlockId. Rocks },
- // (ushort)BlockId.GrassHills =new GenDataBasic{ Id=(ushort)BlockId. GrassHills },
- // (ushort)BlockId.GrassJungle =new GenDataBasic{ Id=(ushort)BlockId. GrassJungle },
- // (ushort)BlockId.GrassDesert =new GenDataBasic{ Id=(ushort)BlockId. GrassDesert },
- // (ushort)BlockId.GrassForest =new GenDataBasic{ Id=(ushort)BlockId. GrassForest },
- // (ushort)BlockId.GrassPlains =new GenDataBasic{ Id=(ushort)BlockId. GrassPlains },
- // (ushort)BlockId.Alore =new GenDataBasic{ Id=(ushort)BlockId. Alore },
- // (ushort)BlockId.BranchALittle1 =new GenDataBasic{ Id=(ushort)BlockId. BranchALittle1 },
- // (ushort)BlockId.BranchALittle2 =new GenDataBasic{ Id=(ushort)BlockId. BranchALittle2 },
- // (ushort)BlockId.BranchFull =new GenDataBasic{ Id=(ushort)BlockId. BranchFull },
- // (ushort)BlockId.BranchWithout =new GenDataBasic{ Id=(ushort)BlockId. BranchWithout },
- // (ushort)BlockId.Boletus =new GenDataBasic{ Id=(ushort)BlockId. Boletus },
- // (ushort)BlockId.Toadstool =new GenDataBasic{ Id=(ushort)BlockId. Toadstool },
- // (ushort)BlockId.Champignon =new GenDataBasic{ Id=(ushort)BlockId. Champignon },
- // (ushort)BlockId.Rose =new GenDataBasic{ Id=(ushort)BlockId. Rose },
- // (ushort)BlockId.Violet =new GenDataBasic{ Id=(ushort)BlockId. Violet },
- // (ushort)BlockId.Orchid =new GenDataBasic{ Id=(ushort)BlockId. Orchid },
- // (ushort)BlockId.Ice =new GenDataBasic{ Id=(ushort)BlockId. Ice },
- // (ushort)BlockId.Seaweed =new GenDataBasic{ Id=(ushort)BlockId. Seaweed },
- // (ushort)BlockId.Water =new GenDataWater{ Id=(ushort)BlockId. WaterBlock },
- // waterSalt =new GenDataWater{ Id=(ushort)BlockId. WaterSalt },
- // (ushort)BlockId.StoneBasalt =new GenDataBasic{ Id=(ushort)BlockId. StoneBasalt },
- // (ushort)BlockId.StoneDiorit =new GenDataBasic{ Id=(ushort)BlockId. StoneDiorit },
- // (ushort)BlockId.StoneDolomite =new GenDataBasic{ Id=(ushort)BlockId. StoneDolomite },
- // (ushort)BlockId.StoneGabbro =new GenDataBasic{ Id=(ushort)BlockId. StoneGabbro },
- // (ushort)BlockId.StoneGneiss =new GenDataBasic{ Id=(ushort)BlockId. StoneGneiss },
- // clay =new GenDataBasic{ Id=(ushort)BlockId. Clay },
- // (ushort)BlockId.StoneLimestone =new GenDataBasic{ Id=(ushort)BlockId. StoneLimestone },
- // (ushort)BlockId.StoneRhyolite =new GenDataBasic{ Id=(ushort)BlockId. StoneRhyolite },
- // (ushort)BlockId.OreAluminium =new GenDataBasic{ Id=(ushort)BlockId. OreAluminium },
- // (ushort)BlockId.OreCopper =new GenDataBasic{ Id=(ushort)BlockId. OreCopper },
- // (ushort)BlockId.OreGold =new GenDataBasic{ Id=(ushort)BlockId. OreGold },
- // (ushort)BlockId.OreIron =new GenDataBasic{ Id=(ushort)BlockId. OreIron },
- // (ushort)BlockId.OreSaltpeter =new GenDataBasic{ Id=(ushort)BlockId. OreSaltpeter },
- // (ushort)BlockId.OreSilver =new GenDataBasic{ Id=(ushort)BlockId. OreSilver },
- // (ushort)BlockId.OreSulfur =new GenDataBasic{ Id=(ushort)BlockId. OreSulfur },
- // (ushort)BlockId.OreTin =new GenDataBasic{ Id=(ushort)BlockId. OreTin },
- // (ushort)BlockId.Oil =new GenDataBasic{ Id=(ushort)BlockId. Oil },
- // (ushort)BlockId.MudStone =new GenDataBasic{ Id=(ushort)BlockId. MudStone },
- // (ushort)BlockId.StoneSandstone =new GenDataBasic{ Id=(ushort)BlockId. StoneSandstone },
- // (ushort)BlockId.StoneSchist =new GenDataBasic{ Id=(ushort)BlockId. StoneSchist },
- // (ushort)BlockId.GrassBlockCompost =new GenDataBasic{ Id=(ushort)BlockId. GrassBlockCompost },
- // (ushort)BlockId.Compost =new GenDataBasic{ Id=(ushort)BlockId. Compost },
- // (ushort)BlockId.Regolite =new GenDataBasic{ Id=(ushort)BlockId. Regolite },
- // (ushort)BlockId.Anorthosite =new GenDataBasic{ Id=(ushort)BlockId. Anorthosite },
- // (ushort)BlockId.Lava =new GenDataBasic{ Id=(ushort)BlockId. Lava },
- // (ushort)BlockId.RedSand =new GenDataBasic{ Id=(ushort)BlockId. RedSand },
- // (ushort)BlockId.OreCoal =new GenDataBasic{ Id=(ushort)BlockId. OreCoal },
- // (ushort)BlockId.Dirt =new GenDataBasic{ Id=(ushort)BlockId. Dirt };
-
- void SetLeave(GChunk chunk, int x, int y, ushort id, GenTree tree){
+
+ void SetLeave(GChunk chunk, int x, int y, ushort id, GenTree tree){
if (chunk.TopBlocks[y]==0){
- chunk.TopBlocks[y]=id;
+ chunk.TopBlocks[y]=id;
byte by=(byte)y;
tree.AddLeave(x, by);
- if (chunk.SetLightPosHalf) {
+ if (chunk.SetLightPosHalf) {
if (y LiveObjects = new List();
- //enum Biome :byte {
- // SaltOcean,
- // // SugarOcean,
-
- // HotPlains,
- // //_polar,
- // Arctic,
- // //CoolTemperateDesertScrub,
- // //ArticMountains,
-
- // // _Subarctic,
- // Tundra,
- // // ArcticAlpineDesert,
-
- // //_Mild,
- // Bog,
- // // Wetland,
- // // TemperateFreshWaterSwampForest,
- // // Saltmarsh,
- // Subtropics,
- // // Heath,
-
- // //_Tropical,
- // Desert,
- // Savanna,
- // Mangrove,
-
- // //WarmTemperateDesert,
-
- // TropicalRainforest,
- // WetTundra,
- // Taiga,
- // Swamp,
- // Plains,
- // LeaveForest,
- // Jungle,
- // ColdTaiga,
- // DryTundra,
- // Fen,
- // ArcticPlains,
- // BothForest,
- // Beach,
- // SpruceForest,
- // HumidSubtropical,
- //}
-
+
enum HotBiome:byte{
None,
@@ -261,13 +154,13 @@ enum ChangerBiome: byte{
void GenerateBiome(WetBiome wet, HotBiome hot, ChangerBiome changer, bool IsOceanNear) {
switch (hot) {
- case HotBiome.Ocean:
+ case HotBiome.Ocean:
BiomeOcean();
BiomeOceanUp();
return;
-
- case HotBiome.Arctic:
+
+ case HotBiome.Arctic:
switch (wet) {
case WetBiome.Low:
BiomeCoolTemperateDesertScrub();
@@ -277,9 +170,9 @@ enum ChangerBiome: byte{
BiomePoles(changer);
return;
}
-
- case HotBiome.Subarctic:
+
+ case HotBiome.Subarctic:
switch (wet) {
case WetBiome.Low:
BiomeDryTundra(/*changer*/);
@@ -293,9 +186,9 @@ enum ChangerBiome: byte{
BiomeTundra(/*changer*/);
return;
}
-
- case HotBiome.ColdTaiga:
+
+ case HotBiome.ColdTaiga:
switch (wet) {
case WetBiome.Low:
BiomePlains(/*changer,wet,hot*/);
@@ -309,9 +202,9 @@ enum ChangerBiome: byte{
BiomeColdTaiga(/*changer*/);
return;
}
-
- case HotBiome.Taiga:
+
+ case HotBiome.Taiga:
switch (wet) {
case WetBiome.Low:
BiomePlains(/*changer,wet,hot*/);
@@ -325,9 +218,9 @@ enum ChangerBiome: byte{
BiomeTaiga(/*changer*/);
return;
}
-
- case HotBiome.SpruceForest:
+
+ case HotBiome.SpruceForest:
switch (wet) {
case WetBiome.Low:
BiomePlains(/*changer,wet,hot*/);
@@ -341,9 +234,9 @@ enum ChangerBiome: byte{
BiomeSpruceForest(/*changer*/);
return;
}
-
- case HotBiome.BothForest:
+
+ case HotBiome.BothForest:
switch (wet) {
case WetBiome.Low:
BiomePlains(/*changer,wet,hot*/);
@@ -357,9 +250,9 @@ enum ChangerBiome: byte{
BiomeBothForest(/*changer*/);
return;
}
-
- case HotBiome.LeaveForest:
+
+ case HotBiome.LeaveForest:
switch (wet) {
case WetBiome.Low:
BiomePlains(/*changer,wet,hot*/);
@@ -373,9 +266,9 @@ enum ChangerBiome: byte{
BiomeLeaveForest(/*changer*/);
return;
}
-
- case HotBiome.Subtropics:
+
+ case HotBiome.Subtropics:
switch (wet) {
case WetBiome.Low:
BiomeSubtropicsPlains(/*changer*/);
@@ -389,14 +282,14 @@ enum ChangerBiome: byte{
BiomeSubtropics(/*changer*/);
return;
}
-
- case HotBiome.Desert:
+
+ case HotBiome.Desert:
BiomeDesert(/*changer,wet*/);
return;
-
- case HotBiome.Savanna:
+
+ case HotBiome.Savanna:
switch (wet) {
case WetBiome.Low:
BiomeSubtropicsPlains(/*changer*/);
@@ -414,9 +307,9 @@ enum ChangerBiome: byte{
BiomeSavana(/*changer,wet*/);
return;
}
-
- case HotBiome.Tropical:
+
+ case HotBiome.Tropical:
if (IsOceanNear){
BiomeMangrove();
return;
@@ -435,21 +328,21 @@ enum ChangerBiome: byte{
return;
}
}
-
+
}
}
List GeneratePartOfBiomes(){
List Biomes=new List();
- int ocean=random.Int(12)+1;
- // int ocean2=random.Int(12);
+ int ocean=FastRandom.Int(12)+1;
+ // int ocean2=FastRandom.Int(12);
for (int i = 1; i<13; i++) {
if (i==ocean) {
Biomes.Add(new BiomeExt(){ Temterature=HotBiome.Ocean });
} else {
- switch (random.Int3()){
+ switch (FastRandom.Int3()){
case 2:
Biomes.Add(new BiomeExt(){
Temterature=(HotBiome)(i+2),
@@ -529,7 +422,7 @@ public enum WorldSize : byte{
bool hill=true;
int treeChange=/*9*/2;
- //random random;
+ //FastRandom FastRandom;
int biomeSize;
readonly string playedWorld;
@@ -543,18 +436,18 @@ public enum WorldSize : byte{
ushort plantPrefer;
int plantSeek;
- readonly FastRandom random;
+ // readonly FastRandom FastRandom;
public GenerateWorld(string dir, WorldSize ws) {
playedWorld=dir;
- random=Rabcr.random;
- // _boolBits=(uint)/*~*/random.Int();
+ // FastRandom=Rabcr.FastRandom;
+ // _boolBits=(uint)/*~*/FastRandom.Int();
// type=ntype;
currentWorldSize=ws;
}
void AddCactus(int x, int y, int height, ushort id) {
-
+
GChunk chunk = terrain[x];
@@ -563,7 +456,7 @@ public enum WorldSize : byte{
int to=y-height;
- for (; y>to; y--) {
+ for (; y>to; y--) {
if (chunk.TopBlocks[y]!=0) break;
chunk.TopBlocks[y]=id;
cactus.Add(x, y);
@@ -656,10 +549,14 @@ public enum WorldSize : byte{
else Biomes[i].Humidity=WetBiome.Low;
}
- foreach (BiomeExt biome in Biomes){
+ foreach (BiomeExt biome in Biomes) {
GenerateBiome(biome.Humidity,biome.Temterature,biome.Changer,biome.oceanIndex==1);
}
+ for (int i=100; i {
- (byte)(/*random.Int2()*/random.Int2()-1),
- (byte)(/*random.Int2()*/random.Int2()-1),
+ (byte)(/*FastRandom.Int2()*/FastRandom.Int2()-1),
+ (byte)(/*FastRandom.Int2()*/FastRandom.Int2()-1),
0,
- (byte)(/*random.Int2()*/random.Int2()-1),
+ (byte)(/*FastRandom.Int2()*/FastRandom.Int2()-1),
- (byte)(/*random.Int2()*/random.Int2()-1),
+ (byte)(/*FastRandom.Int2()*/FastRandom.Int2()-1),
1,
- (byte)(/*random.Int2()*/random.Int2()-1),
- (byte)(/*random.Int2()*/random.Int2()-1)
+ (byte)(/*FastRandom.Int2()*/FastRandom.Int2()-1),
+ (byte)(/*FastRandom.Int2()*/FastRandom.Int2()-1)
};
@@ -728,10 +618,6 @@ public enum WorldSize : byte{
}
Save("Moon");
-
- // File.WriteAllText(playedWorld + @"\MoonGenerated.txt", (terrain.Count-7).ToString());
- // Finish=true;
- // Console.WriteLine("Vygenerováno za "+(((DateTime.Now-now).TotalMilliseconds)/1000f).ToString(".000")+"s");
}
void GenerateMars() {
@@ -741,18 +627,18 @@ public enum WorldSize : byte{
biomes=new List {
0,
- random.Byte3(),
+ FastRandom.Byte3(),
1,
- random.Byte3(),
+ FastRandom.Byte3(),
3,
- random.Byte3(),
+ FastRandom.Byte3(),
0,
0,
- random.Byte3(),
+ FastRandom.Byte3(),
1,
- random.Byte3(),
+ FastRandom.Byte3(),
2,
- random.Byte3(),
+ FastRandom.Byte3(),
0,
};
@@ -805,16 +691,16 @@ public enum WorldSize : byte{
if (terrainHeight>52+5+2) terrainHeight--;
else if (terrainHeight<49+6+2) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=4+random.Int5();
+ terrainChange=4+FastRandom.Int5();
} else terrainChange--;
if (seabedChange<0) {
seabedSand=!seabedSand;
- seabedChange=10+random.Int(20);
+ seabedChange=10+FastRandom.Int(20);
} else seabedChange--;
chunk.LightPosFull=terrainHeight;
@@ -825,17 +711,17 @@ public enum WorldSize : byte{
// Water
for (int yy=53; yy54){
- if (random.Bool()) {
- if (random.Bool()) chunk.BackBlocks[terrainHeight-1]=(ushort)BlockId.Seaweed;
+ if (FastRandom.Bool()) {
+ if (FastRandom.Bool()) chunk.BackBlocks[terrainHeight-1]=(ushort)BlockId.Seaweed;
else chunk.BackBlocks[terrainHeight-1]=(ushort)BlockId.Coral;
- }
+ }
}
// Seabed
@@ -859,7 +745,7 @@ public enum WorldSize : byte{
// Terrain height
if (terrainChange<0) {
terrainHeight--;
- terrainChange=3+random.Int3();
+ terrainChange=3+FastRandom.Int3();
} else terrainChange--;
chunk.LightPosFull=terrainHeight;
@@ -870,15 +756,15 @@ public enum WorldSize : byte{
// Water
for (int yy=53; yy3) dirtHeight--;
// else if (dirtHeight<2) dirtHeight++;
// else {
- // if (random.Bool()) dirtHeight++;
+ // if (FastRandom.Bool()) dirtHeight++;
// else dirtHeight--;
// }
- // dirtChange=1+random.Int3();
+ // dirtChange=1+FastRandom.Int3();
// } else dirtChange--;
// chunk.LightPos=terrainHeight;
@@ -932,8 +818,8 @@ public enum WorldSize : byte{
// for (int yy=terrainHeight; yy3) dirtHeight--;
// else if (dirtHeight<2) dirtHeight++;
// else {
- // if (random.Bool()) dirtHeight++;
+ // if (FastRandom.Bool()) dirtHeight++;
// else dirtHeight--;
// }
- // dirtChange=1+random.Int3();
+ // dirtChange=1+FastRandom.Int3();
// } else dirtChange--;
// chunk.LightPos=terrainHeight;
@@ -1002,8 +888,8 @@ public enum WorldSize : byte{
// for (int yy=terrainHeight; yy53-1) terrainHeight--;
else if (terrainHeight<53-6) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- if (changer==ChangerBiome.Low) terrainChange=2+random.Int3();
- else if (changer==ChangerBiome.Medium) terrainChange=2+random.Int2();
- else terrainChange=1+random.Int2();
+ if (changer==ChangerBiome.Low) terrainChange=2+FastRandom.Int3();
+ else if (changer==ChangerBiome.Medium) terrainChange=2+FastRandom.Int2();
+ else terrainChange=1+FastRandom.Int2();
} else terrainChange--;
// Height (ushort)BlockId.Dirt
@@ -1063,10 +949,10 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
@@ -1075,7 +961,7 @@ public enum WorldSize : byte{
}
chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Snow;
- if (random.Bool_33_333Percent()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.SnowTop;
+ if (FastRandom.Bool_33_333Percent()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.SnowTop;
for (int b = terrainHeight+1; b53-1) terrainHeight--;
else if (terrainHeight<53-6) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=2+random.Int3();
+ terrainChange=2+FastRandom.Int3();
} else terrainChange--;
// Height (ushort)BlockId.Dirt
@@ -1107,10 +993,10 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
@@ -1118,12 +1004,12 @@ public enum WorldSize : byte{
if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight;
}
- if (random.Bool_33_333Percent()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Rocks;
- else if (random.Bool_10Percent())chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.SnowTop;
+ if (FastRandom.Bool_33_333Percent()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Rocks;
+ else if (FastRandom.Bool_10Percent())chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.SnowTop;
if (seabedChange<0) {
grass=!grass;
- seabedChange=10+random.Int(20);
+ seabedChange=10+FastRandom.Int(20);
} else seabedChange--;
if (grass) {
@@ -1137,7 +1023,7 @@ public enum WorldSize : byte{
void BiomeTundra(/*ChangerBiome changer*/) {
for (; pos52) terrainHeight--;
else if (terrainHeight<49) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=4+random.Int5();
+ terrainChange=4+FastRandom.Int5();
} else terrainChange--;
// Height Dirt
@@ -1157,36 +1043,36 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
if (!chunk.SetLightPosHalf) {
if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight;
}
- if (random.Bool()) {
- if (random.Bool_5Percent()){
+ if (FastRandom.Bool()) {
+ if (FastRandom.Bool_5Percent()){
chunk.AddRabbit((byte)(terrainHeight-1));
}
chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockHills;
- if (random.Bool_20Percent()) {
- if (random.Bool()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Heather;
+ if (FastRandom.Bool_20Percent()) {
+ if (FastRandom.Bool()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Heather;
else chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.GrassHills;
}
} else {
- if (random.Bool()) chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Ice;
+ if (FastRandom.Bool()) chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Ice;
else chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Snow;
- if (random.Bool_33_333Percent()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.SnowTop;
+ if (FastRandom.Bool_33_333Percent()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.SnowTop;
}
for (int b=terrainHeight+1; b52) terrainHeight--;
else if (terrainHeight<47) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=4+random.Int5();
+ terrainChange=4+FastRandom.Int5();
} else terrainChange--;
// Height Dirt
@@ -1217,26 +1103,26 @@ public enum WorldSize : byte{
if (dirtHeight>2) dirtHeight--;
else if (dirtHeight<1) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
if (!chunk.SetLightPosHalf) {
if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight;
}
- if (random.Bool_20Percent()){
+ if (FastRandom.Bool_20Percent()){
chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockHills;
- if (random.Bool_12_5Percent()) {
- if (random.Bool()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Rocks;
+ if (FastRandom.Bool_12_5Percent()) {
+ if (FastRandom.Bool()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Rocks;
else chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.GrassHills;
}
} else chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Cobblestone;
- if (random.Bool()) {
+ if (FastRandom.Bool()) {
chunk.SolidBlocks[1/*dirtHeight*/+terrainHeight]=(ushort)BlockId.Cobblestone;
GenerateUnderSurface(chunk, terrainHeight+dirtHeight+1);
} else GenerateUnderSurface(chunk, terrainHeight+1);
@@ -1247,7 +1133,7 @@ public enum WorldSize : byte{
void BiomeWetTundra() {
for (; pos52) terrainHeight--;
else if (terrainHeight<50) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=4+random.Int5();
+ terrainChange=4+FastRandom.Int5();
} else terrainChange--;
// Height (ushort)BlockId.Dirt
@@ -1267,35 +1153,35 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
if (!chunk.SetLightPosHalf) {
if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight;
}
- if (random.Bool()) {
- if (random.Bool_5Percent()) chunk.AddRabbit((byte)(terrainHeight-1));
+ if (FastRandom.Bool()) {
+ if (FastRandom.Bool_5Percent()) chunk.AddRabbit((byte)(terrainHeight-1));
chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockHills;
- if (random.Bool_20Percent()) {
- if (random.Bool()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Heather;
+ if (FastRandom.Bool_20Percent()) {
+ if (FastRandom.Bool()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Heather;
else chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.GrassHills;
}
} else {
- if (random.Bool()) chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Ice;
+ if (FastRandom.Bool()) chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Ice;
else chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Snow;
- if (random.Bool_33_333Percent()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.SnowTop;
+ if (FastRandom.Bool_33_333Percent()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.SnowTop;
}
for (int b=terrainHeight+1; b52) terrainHeight--;
else if (terrainHeight<49) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=4+random.Int5();
+ terrainChange=4+FastRandom.Int5();
} else terrainChange--;
// Height (ushort)BlockId.Dirt
@@ -1328,30 +1214,30 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
if (!chunk.SetLightPosHalf) {
if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight;
}
- if (random.Bool_1Percent())chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Cobblestone;
- else if (random.Bool_1Percent())chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Gravel;
+ if (FastRandom.Bool_1Percent())chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Cobblestone;
+ else if (FastRandom.Bool_1Percent())chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Gravel;
else chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockHills;
- if (random.Bool()) {
- if (random.Bool_2Percent()) ClayPlace(pos-5, terrainHeight-1);
-
+ if (FastRandom.Bool()) {
+ if (FastRandom.Bool_2Percent()) ClayPlace(pos-5, terrainHeight-1);
+
// Add animals
- if (random.Int(15)==1) chunk.AddRabbit((byte)(terrainHeight-1));
+ if (FastRandom.Int(15)==1) chunk.AddRabbit((byte)(terrainHeight-1));
bool placed=false;
if (plantSeek!=0){
if (plantPrefer!=0){
- if (random.Bool()){
+ if (FastRandom.Bool()){
chunk.AddPlant(plantPrefer,(byte)(terrainHeight-1));
placed=true;
}
@@ -1359,7 +1245,7 @@ public enum WorldSize : byte{
} plantSeek--;
if (!placed){
- switch (random.Int(10)) {
+ switch (FastRandom.Int(10)) {
case 1:
chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Heather;
break;
@@ -1385,10 +1271,10 @@ public enum WorldSize : byte{
break;
case 7:
- if (random.Bool()){
+ if (FastRandom.Bool()){
if (plantSeek<-20){
plantPrefer=(ushort)BlockId.Blueberry;
- plantSeek=3+random.Int(10);
+ plantSeek=3+FastRandom.Int(10);
}
}
break;
@@ -1403,18 +1289,18 @@ public enum WorldSize : byte{
}
if (treeChange<0) {
- if (random.Bool_20Percent()) TreeSpruceLittle(pos, terrainHeight);
+ if (FastRandom.Bool_20Percent()) TreeSpruceLittle(pos, terrainHeight);
} else treeChange--;
//Add dirt
for (int b=terrainHeight+1; b52) terrainHeight--;
else if (terrainHeight<49) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=4+random.Int5();
+ terrainChange=4+FastRandom.Int5();
} else terrainChange--;
// Height (ushort)BlockId.Dirt
@@ -1446,30 +1332,30 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
if (!chunk.SetLightPosHalf) {
if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight;
}
- if (random.Bool_1Percent())chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Cobblestone;
- else if (random.Bool_1Percent())chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Gravel;
+ if (FastRandom.Bool_1Percent())chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Cobblestone;
+ else if (FastRandom.Bool_1Percent())chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.Gravel;
else chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockHills;
- if (random.Bool()) {
- if (random.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1);
+ if (FastRandom.Bool()) {
+ if (FastRandom.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1);
- if (random.Int(15)==1){
+ if (FastRandom.Int(15)==1){
chunk.AddRabbit((byte)(terrainHeight-1));
}
bool placed=false;
if (plantSeek!=0){
if (plantPrefer!=0){
- if (random.Bool()){
+ if (FastRandom.Bool()){
chunk.AddPlant(plantPrefer,(byte)(terrainHeight-1));
placed=true;
}
@@ -1477,7 +1363,7 @@ public enum WorldSize : byte{
}
plantSeek--;
if (!placed){
- switch (random.Int(10)) {
+ switch (FastRandom.Int(10)) {
case 1: chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Heather;
break;
@@ -1497,10 +1383,10 @@ public enum WorldSize : byte{
break;
case 7:
- if (random.Bool()){
+ if (FastRandom.Bool()){
if (plantSeek<-15){
plantPrefer=(ushort)BlockId.Blueberry;
- plantSeek=3+random.Int(10);
+ plantSeek=3+FastRandom.Int(10);
}
}
break;
@@ -1515,18 +1401,18 @@ public enum WorldSize : byte{
}
if (treeChange<0) {
- if (random.Bool_20Percent()) TreeSpruceLittle(pos,terrainHeight);
+ if (FastRandom.Bool_20Percent()) TreeSpruceLittle(pos,terrainHeight);
else TreeSpruceBig(pos, terrainHeight);
}else treeChange--;
for (int b=terrainHeight+1; b53-1) terrainHeight--;
else if (terrainHeight<53-6) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=2+random.Int3();
+ terrainChange=2+FastRandom.Int3();
} else terrainChange--;
//Height (ushort)BlockId.Dirt
@@ -1558,10 +1444,10 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
@@ -1570,17 +1456,17 @@ public enum WorldSize : byte{
}
chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockForest;
- if (random.Bool()) {
+ if (FastRandom.Bool()) {
- if (random.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1);
- if (random.Int(14)==1){
+ if (FastRandom.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1);
+ if (FastRandom.Int(14)==1){
chunk.AddRabbit((byte)(terrainHeight-1));
}
- switch (random.Int(9)) {
+ switch (FastRandom.Int(9)) {
case 1:
- if (random.Bool()) {
- if (random.Bool()){
+ if (FastRandom.Bool()) {
+ if (FastRandom.Bool()){
chunk.AddPlant((ushort)BlockId.Blueberry,(byte)(terrainHeight-1));
} else {
chunk.AddPlant((ushort)BlockId.Rashberry,(byte)(terrainHeight-1));
@@ -1613,8 +1499,8 @@ public enum WorldSize : byte{
break;
case 8:
- if (random.Bool_20Percent()) {
- if (random.Bool()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Toadstool;
+ if (FastRandom.Bool_20Percent()) {
+ if (FastRandom.Bool()) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Toadstool;
else chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Boletus;
}
break;
@@ -1622,7 +1508,7 @@ public enum WorldSize : byte{
}
if (treeChange<0) {
- switch (random.Int3()) {
+ switch (FastRandom.Int3()) {
case 1:
TreeSpruceLittle(pos, terrainHeight);
break;
@@ -1636,7 +1522,7 @@ public enum WorldSize : byte{
for (int b = terrainHeight+1; b53-1) terrainHeight--;
else if (terrainHeight<53-6) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=2+random.Int3();
+ terrainChange=2+FastRandom.Int3();
} else terrainChange--;
//Height (ushort)BlockId.Dirt
@@ -1668,10 +1554,10 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
@@ -1680,16 +1566,16 @@ public enum WorldSize : byte{
}
chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockForest;
- if (random.Bool()) {
- if (random.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1);
+ if (FastRandom.Bool()) {
+ if (FastRandom.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1);
- if (random.Int(13)==1){
+ if (FastRandom.Int(13)==1){
chunk.AddRabbit((byte)(terrainHeight-1));
}
- switch (random.Int(7)) {
+ switch (FastRandom.Int(7)) {
case 0:
- switch (random.Int4()){
+ switch (FastRandom.Int4()){
case 0:
chunk.AddPlant((ushort)BlockId.Rashberry,(byte)(terrainHeight-1));
break;
@@ -1730,7 +1616,7 @@ public enum WorldSize : byte{
break;
case 6:
- switch (random.Int4()) {
+ switch (FastRandom.Int4()) {
case 1:chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Boletus;
break;
case 2:chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Toadstool;
@@ -1743,7 +1629,7 @@ public enum WorldSize : byte{
}
if (treeChange<0) {
- switch (random.Int(9)) {
+ switch (FastRandom.Int(9)) {
case 1:
TreeSpruceLittle(pos, terrainHeight);
break;
@@ -1774,7 +1660,7 @@ public enum WorldSize : byte{
for (int b = terrainHeight+1; b53-1) terrainHeight--;
else if (terrainHeight<53-6) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=2+random.Int3();
+ terrainChange=2+FastRandom.Int3();
} else terrainChange--;
//Height (ushort)BlockId.Dirt
@@ -1806,21 +1692,21 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
if (!chunk.SetLightPosHalf) {
if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight;
}
- if (random.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1);
+ if (FastRandom.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1);
- switch (random.Int(7)) {
+ switch (FastRandom.Int(7)) {
case 0:
- switch (random.Int4()){
+ switch (FastRandom.Int4()){
case 0:
chunk.AddPlant((ushort)BlockId.Rashberry,(byte)(terrainHeight-1));
break;
@@ -1867,7 +1753,7 @@ public enum WorldSize : byte{
}
if (treeChange<0) {
- switch (random.Int(9)) {
+ switch (FastRandom.Int(9)) {
case 1:
TreeSpruceLittle(pos, terrainHeight);
break;
@@ -1897,8 +1783,8 @@ public enum WorldSize : byte{
if (seabedChange<0) {
- if (grass) seabedChange=10+random.Int(20);
- else seabedChange=3+random.Int5();
+ if (grass) seabedChange=10+FastRandom.Int(20);
+ else seabedChange=3+FastRandom.Int5();
grass=!grass;
} else seabedChange--;
@@ -1908,12 +1794,12 @@ public enum WorldSize : byte{
} else {
chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockCompost;
for (int b = terrainHeight+1; b53-1) terrainHeight--;
else if (terrainHeight<53-3) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=2+random.Int3();
+ terrainChange=2+FastRandom.Int3();
} else terrainChange--;
//Height (ushort)BlockId.Dirt
@@ -1945,10 +1831,10 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
@@ -1957,12 +1843,12 @@ public enum WorldSize : byte{
}
chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockForest;
- if (random.Bool()) {
- if (random.Int(13)==1) {
+ if (FastRandom.Bool()) {
+ if (FastRandom.Int(13)==1) {
chunk.AddRabbit((byte)(terrainHeight-1));
}
- switch (random.Int(7)) {
+ switch (FastRandom.Int(7)) {
case 1:
chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.GrassForest;
break;
@@ -1984,7 +1870,7 @@ public enum WorldSize : byte{
break;
case 6:
- switch (random.Int4()) {
+ switch (FastRandom.Int4()) {
case 1:chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Boletus;
break;
case 2:chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Toadstool;
@@ -1997,7 +1883,7 @@ public enum WorldSize : byte{
}
if (treeChange<0) {
- switch (random.Int(9)) {
+ switch (FastRandom.Int(9)) {
case 1:
TreeSpruceLittle(pos, terrainHeight);
break;
@@ -2028,7 +1914,7 @@ public enum WorldSize : byte{
for (int b = terrainHeight+1; b53-1) terrainHeight--;
else if (terrainHeight<53-6) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=2+random.Int3();
+ terrainChange=2+FastRandom.Int3();
} else terrainChange--;
//Height (ushort)BlockId.Dirt
@@ -2060,10 +1946,10 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
@@ -2073,14 +1959,14 @@ public enum WorldSize : byte{
chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockForest;
- if (random.Bool()) {
- if (random.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1);
+ if (FastRandom.Bool()) {
+ if (FastRandom.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1);
- if (random.Int(13)==1) {
+ if (FastRandom.Int(13)==1) {
chunk.AddRabbit((byte)(terrainHeight-1));
}
- switch (random.Int(13)) {
+ switch (FastRandom.Int(13)) {
case 1:
chunk.AddPlant((ushort)BlockId.Rashberry,(byte)(terrainHeight-1));
break;
@@ -2126,7 +2012,7 @@ public enum WorldSize : byte{
break;
case 12:
- switch (random.Int4()) {
+ switch (FastRandom.Int4()) {
case 1:chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Boletus;
break;
case 2:chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Toadstool;
@@ -2139,7 +2025,7 @@ public enum WorldSize : byte{
}
if (treeChange<0) {
- switch (random.Int(9)) {
+ switch (FastRandom.Int(9)) {
case 1:
TreePlum(pos, terrainHeight);
break;
@@ -2172,7 +2058,7 @@ public enum WorldSize : byte{
for (int b = terrainHeight+1; b53-1) terrainHeight--;
else if (terrainHeight<53-6) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=2+random.Int3();
+ terrainChange=2+FastRandom.Int3();
} else terrainChange--;
// Height dirt
@@ -2204,10 +2090,10 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
@@ -2218,17 +2104,17 @@ public enum WorldSize : byte{
// Add grass
chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockPlains;
- if (random.Bool()) {
- if (random.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1);
+ if (FastRandom.Bool()) {
+ if (FastRandom.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1);
// Animals
- if (random.Int(13)==1) chunk.AddRabbit((byte)(terrainHeight-1));
- else if (random.Int(15)==1) chunk.AddChicken((byte)(terrainHeight-1));
+ if (FastRandom.Int(13)==1) chunk.AddRabbit((byte)(terrainHeight-1));
+ else if (FastRandom.Int(15)==1) chunk.AddChicken((byte)(terrainHeight-1));
// Add something on grass
- switch (random.Int(10)) {
+ switch (FastRandom.Int(10)) {
case 1:
- if (random.Bool()) chunk.AddPlant((ushort)BlockId.Onion,(byte)(terrainHeight-1));
+ if (FastRandom.Bool()) chunk.AddPlant((ushort)BlockId.Onion,(byte)(terrainHeight-1));
else chunk.AddPlantCarrot((byte)(terrainHeight-1));
break;
@@ -2261,7 +2147,7 @@ public enum WorldSize : byte{
break;
case 9:
- if (random.Bool()) chunk.AddPlantFlax((byte)(terrainHeight-1));
+ if (FastRandom.Bool()) chunk.AddPlantFlax((byte)(terrainHeight-1));
break;
}
}
@@ -2270,7 +2156,7 @@ public enum WorldSize : byte{
for (int b = terrainHeight+1; b53-1) terrainHeight--;
else if (terrainHeight<53-6) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=2+random.Int3();
+ terrainChange=2+FastRandom.Int3();
} else terrainChange--;
// Height Dirt
@@ -2303,10 +2189,10 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
@@ -2315,15 +2201,15 @@ public enum WorldSize : byte{
}
chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockDesert;
- if (random.Bool_1Percent()) ClayPlace(pos-5,terrainHeight-1);
+ if (FastRandom.Bool_1Percent()) ClayPlace(pos-5,terrainHeight-1);
// Add something on grass
- if (random.Bool()) {
- double z=random.Double();
+ if (FastRandom.Bool()) {
+ double z=FastRandom.Double();
if (z<0.5) chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.GrassDesert;
- else {
+ else {
if (z<0.66)chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.BranchFull;
- else if (z<0.88)chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Dandelion;
+ else if (z<0.88)chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Dandelion;
else chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Rocks;
}
}
@@ -2332,7 +2218,7 @@ public enum WorldSize : byte{
for (int b = terrainHeight+1; b53-1) terrainHeight--;
else if (terrainHeight<53-6) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=2+random.Int3();
+ terrainChange=2+FastRandom.Int3();
} else terrainChange--;
//Height (ushort)BlockId.Dirt
@@ -2365,30 +2251,30 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
// Sub
if (seabedChange<0) {
grass=!grass;
- seabedChange=5+random.Int(10);
+ seabedChange=5+FastRandom.Int(10);
} else seabedChange--;
chunk.LightPosFull=terrainHeight;
if (!chunk.SetLightPosHalf) {
if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight;
- }
+ }
if (grass) {
chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockDesert;
- if (random.Bool()) {
+ if (FastRandom.Bool()) {
// Add animals
- if (random.Int(15)==1) chunk.AddRabbit((byte)(terrainHeight-1));
- else if (random.Bool_10Percent()) chunk.AddChicken((byte)(terrainHeight-1));
+ if (FastRandom.Int(15)==1) chunk.AddRabbit((byte)(terrainHeight-1));
+ else if (FastRandom.Bool_10Percent()) chunk.AddChicken((byte)(terrainHeight-1));
- switch (random.Int(10)) {
+ switch (FastRandom.Int(10)) {
case 1:
chunk.AddPlantWheat((byte)(terrainHeight-1));
break;
@@ -2414,7 +2300,7 @@ public enum WorldSize : byte{
break;
case 7:
- if (random.Bool()) chunk.AddPlant((ushort)BlockId.Onion,(byte)(terrainHeight-1));
+ if (FastRandom.Bool()) chunk.AddPlant((ushort)BlockId.Onion,(byte)(terrainHeight-1));
else chunk.AddPlantCarrot((byte)(terrainHeight-1));
break;
@@ -2423,16 +2309,16 @@ public enum WorldSize : byte{
break;
case 9:
- if (random.Bool()) chunk.AddPlantFlax((byte)(terrainHeight-1));
+ if (FastRandom.Bool()) chunk.AddPlantFlax((byte)(terrainHeight-1));
break;
}
}
} else {
chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockForest;
- if (random.Bool()) {
- if (random.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1);
- switch (random.Int(11)) {
+ if (FastRandom.Bool()) {
+ if (FastRandom.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1);
+ switch (FastRandom.Int(11)) {
case 1:
chunk.AddPlant((ushort)BlockId.Strawberry,(byte)(terrainHeight-1));
break;
@@ -2466,18 +2352,18 @@ public enum WorldSize : byte{
break;
case 9:
- if (random.Bool()) chunk.AddPlantFlax((byte)(terrainHeight-1));
+ if (FastRandom.Bool()) chunk.AddPlantFlax((byte)(terrainHeight-1));
break;
case 10:
- if (random.Bool_33_333Percent()) chunk.AddPlantWheat((byte)(terrainHeight-1));
+ if (FastRandom.Bool_33_333Percent()) chunk.AddPlantWheat((byte)(terrainHeight-1));
break;
}
}
}
if (treeChange<0) {
- switch (random.Int(9)) {
+ switch (FastRandom.Int(9)) {
case 1:
TreeEucalyptus(pos, terrainHeight);
break;
@@ -2509,7 +2395,7 @@ public enum WorldSize : byte{
for (int b = terrainHeight+1; b53-1) terrainHeight--;
else if (terrainHeight<53-6) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=2+random.Int3();
+ terrainChange=2+FastRandom.Int3();
} else terrainChange--;
//Height Dirt
@@ -2541,30 +2427,30 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
// Sub
if (seabedChange<0) {
grass=!grass;
- seabedChange=5+random.Int(10);
+ seabedChange=5+FastRandom.Int(10);
} else seabedChange--;
chunk.LightPosFull=terrainHeight;
if (!chunk.SetLightPosHalf) {
if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight;
}
- if (random.Bool()) {
+ if (FastRandom.Bool()) {
// Add animals
- if (random.Int(15)==1) chunk.AddRabbit((byte)(terrainHeight-1));
- else if (random.Bool_10Percent()) chunk.AddChicken((byte)(terrainHeight-1));
+ if (FastRandom.Int(15)==1) chunk.AddRabbit((byte)(terrainHeight-1));
+ else if (FastRandom.Bool_10Percent()) chunk.AddChicken((byte)(terrainHeight-1));
// Add something on grass
- switch (random.Int(10)) {
+ switch (FastRandom.Int(10)) {
case 1:
chunk.AddPlantWheat((byte)(terrainHeight-1));
break;
@@ -2590,7 +2476,7 @@ public enum WorldSize : byte{
break;
case 7:
- if (random.Bool()) chunk.AddPlant((ushort)BlockId.Onion,(byte)(terrainHeight-1));
+ if (FastRandom.Bool()) chunk.AddPlant((ushort)BlockId.Onion,(byte)(terrainHeight-1));
else chunk.AddPlantCarrot((byte)(terrainHeight-1));
break;
@@ -2599,7 +2485,7 @@ public enum WorldSize : byte{
break;
case 9:
- if (random.Bool()) chunk.AddPlantFlax((byte)(terrainHeight-1));
+ if (FastRandom.Bool()) chunk.AddPlantFlax((byte)(terrainHeight-1));
break;
}
}
@@ -2607,7 +2493,7 @@ public enum WorldSize : byte{
chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockForest;
if (treeChange<0) {
- switch (random.Int(9)) {
+ switch (FastRandom.Int(9)) {
case 1:
TreeEucalyptus(pos, terrainHeight);
break;
@@ -2639,7 +2525,7 @@ public enum WorldSize : byte{
for (int b = terrainHeight+1; b53-1) terrainHeight--;
else if (terrainHeight<53-6) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=2+random.Int3();
+ terrainChange=2+FastRandom.Int3();
} else terrainChange--;
//Height (ushort)BlockId.Dirt
@@ -2671,10 +2557,10 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
@@ -2682,8 +2568,8 @@ public enum WorldSize : byte{
if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight;
}
if (seabedChange<0) {
- if (grass) seabedChange=20+random.Int(50);
- else seabedChange=3+random.Int5();
+ if (grass) seabedChange=20+FastRandom.Int(50);
+ else seabedChange=3+FastRandom.Int5();
grass=!grass;
} else seabedChange--;
@@ -2695,8 +2581,8 @@ public enum WorldSize : byte{
for (int b = terrainHeight+1; b53-1) terrainHeight--;
else if (terrainHeight<53-6) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=2+random.Int3();
+ terrainChange=2+FastRandom.Int3();
} else terrainChange--;
// Height dirt
@@ -2781,10 +2667,10 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
@@ -2792,15 +2678,15 @@ public enum WorldSize : byte{
if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight;
}
if (seabedChange<0) {
- if (grass) seabedChange=20+random.Int(50);
- else seabedChange=3+random.Int5();
+ if (grass) seabedChange=20+FastRandom.Int(50);
+ else seabedChange=3+FastRandom.Int5();
grass=!grass;
} else seabedChange--;
if (grass) {
// Add animals
- if (random.Int(25)==1) chunk.AddChicken((byte)(terrainHeight-1));
+ if (FastRandom.Int(25)==1) chunk.AddChicken((byte)(terrainHeight-1));
// Add grass
chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockDesert;
@@ -2808,7 +2694,7 @@ public enum WorldSize : byte{
// Add dirt
for (int b = terrainHeight+1; b53-1) terrainHeight--;
else if (terrainHeight<53-2) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=3+random.Int3();
+ terrainChange=3+FastRandom.Int3();
} else terrainChange--;
//Height dirt
@@ -2908,10 +2794,10 @@ public enum WorldSize : byte{
if (dirtHeight>2) dirtHeight--;
else if (dirtHeight<1) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
@@ -2920,8 +2806,8 @@ public enum WorldSize : byte{
}
for (int b = terrainHeight; b53-1) terrainHeight--;
else if (terrainHeight<53-6) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=2+random.Int3();
+ terrainChange=2+FastRandom.Int3();
} else terrainChange--;
// Height dirt
@@ -2980,25 +2866,25 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
if (!chunk.SetLightPosHalf) {
if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight;
}
- if (random.Bool()) {
+ if (FastRandom.Bool()) {
- if (random.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1);
+ if (FastRandom.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1);
// Add animals
- if (random.Int(15)==1) chunk.AddChicken((byte)(terrainHeight-1));
-
-
- switch (random.Int(9)) {
+ if (FastRandom.Int(15)==1) chunk.AddChicken((byte)(terrainHeight-1));
+
+
+ switch (FastRandom.Int(9)) {
case 1:
chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Orchid;
break;
@@ -3038,7 +2924,7 @@ public enum WorldSize : byte{
else chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockForest;
if (treeChange<0) {
- switch (random.Int4()){
+ switch (FastRandom.Int4()){
default:
TreePineJunle(pos, terrainHeight);
break;
@@ -3057,7 +2943,7 @@ public enum WorldSize : byte{
for (int b = terrainHeight+1; b3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
@@ -3105,11 +2991,11 @@ public enum WorldSize : byte{
// Add grass
chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockHills;
- if (random.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1);
+ if (FastRandom.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1);
// Add something on grass
- if (random.Bool()) {
- switch (random.Int(9)) {
+ if (FastRandom.Bool()) {
+ switch (FastRandom.Int(9)) {
case 1:
chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.GrassHills;
break;
@@ -3145,8 +3031,8 @@ public enum WorldSize : byte{
}
if (treeChange<0) {
- if (random.Bool_10Percent()) {
- if (random.Bool()) TreeSpruceLittle(pos, terrainHeight);
+ if (FastRandom.Bool_10Percent()) {
+ if (FastRandom.Bool()) TreeSpruceLittle(pos, terrainHeight);
else TreeOakLittle(pos, terrainHeight);
}
} else treeChange--;
@@ -3155,7 +3041,7 @@ public enum WorldSize : byte{
for (int b = terrainHeight+1; b3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
@@ -3200,9 +3086,9 @@ public enum WorldSize : byte{
if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight;
}
chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockHills;
- if (random.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1);
- if (random.Bool()) {
- switch (random.Int(9)) {
+ if (FastRandom.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1);
+ if (FastRandom.Bool()) {
+ switch (FastRandom.Int(9)) {
case 1:
chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.GrassHills;
break;
@@ -3238,8 +3124,8 @@ public enum WorldSize : byte{
}
if (treeChange<0) {
- if (random.Bool_10Percent()) {
- if (random.Bool()) TreeSpruceLittle(pos, terrainHeight);
+ if (FastRandom.Bool_10Percent()) {
+ if (FastRandom.Bool()) TreeSpruceLittle(pos, terrainHeight);
else TreeOakLittle(pos, terrainHeight);
}
} else treeChange--;
@@ -3248,7 +3134,7 @@ public enum WorldSize : byte{
for (int b = terrainHeight+1; b3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
@@ -3295,10 +3181,10 @@ public enum WorldSize : byte{
// Add grass
chunk.SolidBlocks[terrainHeight]=(ushort)BlockId.GrassBlockForest;
- if (random.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1);
+ if (FastRandom.Bool_2Percent()) ClayPlace(pos-5,terrainHeight-1);
- if (random.Bool()) {
- switch (random.Int(9)) {
+ if (FastRandom.Bool()) {
+ switch (FastRandom.Int(9)) {
case 1:
chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.GrassHills;
break;
@@ -3334,8 +3220,8 @@ public enum WorldSize : byte{
}
if (treeChange<0) {
- if (random.Bool_10Percent()) {
- if (random.Bool()) TreeSpruceLittle(pos, terrainHeight);
+ if (FastRandom.Bool_10Percent()) {
+ if (FastRandom.Bool()) TreeSpruceLittle(pos, terrainHeight);
else TreePine(pos, terrainHeight);
}
} else treeChange--;
@@ -3343,7 +3229,7 @@ public enum WorldSize : byte{
for (int b = terrainHeight+1; b53-1) terrainHeight--;
else if (terrainHeight<53-6) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=2+random.Int3();
+ terrainChange=2+FastRandom.Int3();
} else terrainChange--;
// Height dirt
@@ -3374,10 +3260,10 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
@@ -3386,22 +3272,22 @@ public enum WorldSize : byte{
}
ushort[] chunk_SolidBlocks=chunk.SolidBlocks;
- if (random.Int(9)==1) {
- if (random.Bool()) chunk_SolidBlocks[terrainHeight-1]=(ushort)BlockId.Cobblestone;
+ if (FastRandom.Int(9)==1) {
+ if (FastRandom.Bool()) chunk_SolidBlocks[terrainHeight-1]=(ushort)BlockId.Cobblestone;
else chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Rocks;
}
- if (random.Int(9)==1) chunk_SolidBlocks[terrainHeight]=(ushort)BlockId.StoneBasalt;
- else if (random.Int(9)==1) chunk_SolidBlocks[terrainHeight]=(ushort)BlockId.Cobblestone;
+ if (FastRandom.Int(9)==1) chunk_SolidBlocks[terrainHeight]=(ushort)BlockId.StoneBasalt;
+ else if (FastRandom.Int(9)==1) chunk_SolidBlocks[terrainHeight]=(ushort)BlockId.Cobblestone;
else chunk_SolidBlocks[terrainHeight]=(ushort)BlockId.Regolite;
for (int b = terrainHeight+1; b53-1) terrainHeight--;
else if (terrainHeight<53-6) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=2+random.Int3();
+ terrainChange=2+FastRandom.Int3();
} else terrainChange--;
// Height dirt
@@ -3431,10 +3317,10 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
@@ -3443,23 +3329,23 @@ public enum WorldSize : byte{
}
ushort[] chunk_SolidBlocks=chunk.SolidBlocks;
- if (random.Bool_12_5Percent()) {
- if (random.Bool()) chunk_SolidBlocks[terrainHeight-1]=(ushort)BlockId.Cobblestone;
+ if (FastRandom.Bool_12_5Percent()) {
+ if (FastRandom.Bool()) chunk_SolidBlocks[terrainHeight-1]=(ushort)BlockId.Cobblestone;
else chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Rocks;
}
- if (random.Int(9)==1) chunk_SolidBlocks[terrainHeight]=(ushort)BlockId.Anorthosite;
- else if (random.Int(9)==1) chunk_SolidBlocks[terrainHeight]=(ushort)BlockId.Cobblestone;
+ if (FastRandom.Int(9)==1) chunk_SolidBlocks[terrainHeight]=(ushort)BlockId.Anorthosite;
+ else if (FastRandom.Int(9)==1) chunk_SolidBlocks[terrainHeight]=(ushort)BlockId.Cobblestone;
else chunk_SolidBlocks[terrainHeight]=(ushort)BlockId.Regolite;
for (int b = terrainHeight+1; b53-1) terrainHeight--;
else if (terrainHeight<53-6) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=2+random.Int3();
+ terrainChange=2+FastRandom.Int3();
} else terrainChange--;
//Height (ushort)BlockId.Dirt
@@ -3489,17 +3375,17 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=(byte)(terrainHeight-2);
if (!chunk.SetLightPosHalf) {
if (terrainHeight>53) chunk.LightPosHalf=53; else chunk.LightPosHalf=terrainHeight;
}
- if (Rabcr.random.Bool_12_5Percent()) chunk.TopBlocks[terrainHeight-3]=(ushort)BlockId.SnowTop;
+ if (FastRandom.Bool_12_5Percent()) chunk.TopBlocks[terrainHeight-3]=(ushort)BlockId.SnowTop;
ushort[] chunk_SolidBlocks=chunk.SolidBlocks;
@@ -3507,7 +3393,7 @@ public enum WorldSize : byte{
chunk_SolidBlocks[terrainHeight-1]=(ushort)BlockId.Ice;
// Lithosphere
- if (random.Bool()) {
+ if (FastRandom.Bool()) {
chunk_SolidBlocks[terrainHeight]=(ushort)BlockId.Cobblestone;
GenerateUnderSurfaceMars(chunk, terrainHeight+1);
} else GenerateUnderSurfaceMars(chunk, terrainHeight);
@@ -3525,11 +3411,11 @@ public enum WorldSize : byte{
if (terrainHeight>53-1) terrainHeight--;
else if (terrainHeight<53-6) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=2+random.Int3();
+ terrainChange=2+FastRandom.Int3();
} else terrainChange--;
// Height dirt
@@ -3537,10 +3423,10 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
@@ -3549,18 +3435,18 @@ public enum WorldSize : byte{
}
ushort[] chunk_SolidBlocks=chunk.SolidBlocks;
- if (random.Int(6)==1) {
- if (random.Bool_20Percent()) chunk_SolidBlocks[terrainHeight-1]=(ushort)BlockId.Cobblestone;
+ if (FastRandom.Int(6)==1) {
+ if (FastRandom.Bool_20Percent()) chunk_SolidBlocks[terrainHeight-1]=(ushort)BlockId.Cobblestone;
else chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Rocks;
}
for (int b =terrainHeight; b53-1) terrainHeight--;
else if (terrainHeight<53-6) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=2+random.Int3();
+ terrainChange=2+FastRandom.Int3();
} else terrainChange--;
// Height dirt
@@ -3590,10 +3476,10 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
@@ -3602,18 +3488,18 @@ public enum WorldSize : byte{
}
ushort[] chunk_SolidBlocks=chunk.SolidBlocks;
- if (random.Int(6)==1) {
- if (random.Bool_20Percent()) chunk_SolidBlocks[terrainHeight-1]=(ushort)BlockId.Cobblestone;
+ if (FastRandom.Int(6)==1) {
+ if (FastRandom.Bool_20Percent()) chunk_SolidBlocks[terrainHeight-1]=(ushort)BlockId.Cobblestone;
else chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Rocks;
}
for (int b = terrainHeight; b53-1) terrainHeight--;
else if (terrainHeight<53-6) terrainHeight++;
else {
- if (random.Bool()) terrainHeight++;
+ if (FastRandom.Bool()) terrainHeight++;
else terrainHeight--;
}
- terrainChange=2+random.Int3();
+ terrainChange=2+FastRandom.Int3();
} else terrainChange--;
// height dirt
@@ -3643,10 +3529,10 @@ public enum WorldSize : byte{
if (dirtHeight>3) dirtHeight--;
else if (dirtHeight<2) dirtHeight++;
else {
- if (random.Bool()) dirtHeight++;
+ if (FastRandom.Bool()) dirtHeight++;
else dirtHeight--;
}
- dirtChange=1+random.Int3();
+ dirtChange=1+FastRandom.Int3();
} else dirtChange--;
chunk.LightPosFull=terrainHeight;
@@ -3655,18 +3541,18 @@ public enum WorldSize : byte{
}
ushort[] chunk_SolidBlocks=chunk.SolidBlocks;
- if (random.Int(6)==1) {
- if (random.Bool_20Percent())chunk_SolidBlocks[terrainHeight-1]=(ushort)BlockId.Cobblestone;
+ if (FastRandom.Int(6)==1) {
+ if (FastRandom.Bool_20Percent())chunk_SolidBlocks[terrainHeight-1]=(ushort)BlockId.Cobblestone;
else chunk.TopBlocks[terrainHeight-1]=(ushort)BlockId.Rocks;
}
for (int b = terrainHeight; b70) height12--;
else {
- if (random.Bool()) height12++;
+ if (FastRandom.Bool()) height12++;
else height12--;
}
- height12Change=random.Int2()+1;
+ height12Change=FastRandom.Int2()+1;
} else height12Change--;
if (height23Change==0) {
if (height23<80)height23++;
else if (height23>85)height23--;
- else if (random.Bool()) height23++;
+ else if (FastRandom.Bool()) height23++;
else height23--;
- height23Change=random.Int3()+1;
+ height23Change=FastRandom.Int3()+1;
} else height23Change--;
if (height34Change==0) {
if (height34<105)height34++;
else if (height34>110)height34--;
- else if (random.Bool()) height34++;
+ else if (FastRandom.Bool()) height34++;
else height34--;
- height34Change=random.Int4()+1;
+ height34Change=FastRandom.Int4()+1;
} else height34Change--;
//Type
if (level1Lenght==0) {
level1TypeLast=level1Type;
level1Crossing=2;
- level1Type=random.Int(10);
+ level1Type=FastRandom.Int(10);
- level1Lenght=random.Int(12)+8+8;
+ level1Lenght=FastRandom.Int(12)+8+8;
block1 =GetByIdHeight1(level1Type);
} else {
level1Lenght--;
@@ -3723,9 +3609,9 @@ public enum WorldSize : byte{
if (level2Lenght==0) {
level2TypeLast=level2Type;
level2Crossing=2;
- level2Type=random.Int(10);
+ level2Type=FastRandom.Int(10);
- level2Lenght=random.Int16()+8+8+8;
+ level2Lenght=FastRandom.Int16()+8+8+8;
block2 =GetByIdHeight2(level2Type);
} else {
level2Lenght--;
@@ -3735,9 +3621,9 @@ public enum WorldSize : byte{
if (level3Lenght==0) {
level3TypeLast=level3Type;
level3Crossing=2;
- level3Type=random.Int(10);
+ level3Type=FastRandom.Int(10);
- level3Lenght=random.Int(20)+8+8+24;
+ level3Lenght=FastRandom.Int(20)+8+8+24;
block3 =GetByIdHeight3(level3Type);
} else {
level3Lenght--;
@@ -3752,13 +3638,13 @@ public enum WorldSize : byte{
if (level1Crossing==2) {
ushort oldTop = GetByIdHeight1(level1TypeLast);
for (int y = height; y15) {
- switch (random.Int(35)) {
+ switch (FastRandom.Int(35)) {
case 1:
- OreCoal(height+3+random.Int(height34-height-10));
+ OreCoal(height+3+FastRandom.Int(height34-height-10));
break;
case 2:
- OreCoal(height+3+random.Int(45));
+ OreCoal(height+3+FastRandom.Int(45));
break;
case 3:
- OreCoal(height+3+random.Int(10));
+ OreCoal(height+3+FastRandom.Int(10));
break;
case 4:
- OreCoal(height+3+random.Int(10));
+ OreCoal(height+3+FastRandom.Int(10));
break;
case 5:
- OreCoal(height+3+30+random.Int(10));
+ OreCoal(height+3+30+FastRandom.Int(10));
break;
case 6:
- OreCoal(height+3+30+random.Int(10));
+ OreCoal(height+3+30+FastRandom.Int(10));
break;
case 7:
- OreCopper(height+3+random.Int(height34-height-10));
+ OreCopper(height+3+FastRandom.Int(height34-height-10));
break;
case 8:
- OreCopper(height+3+random.Int(45));
+ OreCopper(height+3+FastRandom.Int(45));
break;
case 9:
- OreCopper(height+3+random.Int(15));
+ OreCopper(height+3+FastRandom.Int(15));
break;
case 10:
- OreCopper(height+3+random.Int(10));
+ OreCopper(height+3+FastRandom.Int(10));
break;
case 11:
- OreCopper(height+10+random.Int(10));
+ OreCopper(height+10+FastRandom.Int(10));
break;
case 12:
- OreIron(height+3+random.Int(height34-height-10)+2);
+ OreIron(height+3+FastRandom.Int(height34-height-10)+2);
break;
case 13:
- OreIron(height+3+random.Int(45)+2);
+ OreIron(height+3+FastRandom.Int(45)+2);
break;
case 14:
- OreIron(height+10+random.Int(20));
+ OreIron(height+10+FastRandom.Int(20));
break;
case 15:
- OreIron(height+3+random.Int(45)+2);
+ OreIron(height+3+FastRandom.Int(45)+2);
break;
case 16:
- OreOil(height+3+random.Int(height34-height-10));
+ OreOil(height+3+FastRandom.Int(height34-height-10));
break;
case 17:
- OreOil(height+3+random.Int(45));
+ OreOil(height+3+FastRandom.Int(45));
break;
case 18:
- OreOil(height+3+random.Int(34));
+ OreOil(height+3+FastRandom.Int(34));
break;
case 19:
- OreOil(height+3+random.Int(35));
+ OreOil(height+3+FastRandom.Int(35));
break;
case 20:
- OreTin(height+3+random.Int(height34-height-10));
+ OreTin(height+3+FastRandom.Int(height34-height-10));
break;
case 21:
- OreTin(height+3+random.Int(35));
+ OreTin(height+3+FastRandom.Int(35));
break;
case 22:
- OreTin(height+6+random.Int(25));
+ OreTin(height+6+FastRandom.Int(25));
break;
case 23:
- OreSilver(height+3+random.Int(height34-height-5));
+ OreSilver(height+3+FastRandom.Int(height34-height-5));
break;
case 24:
- OreGold(height+3+random.Int(height34-height-5));
+ OreGold(height+3+FastRandom.Int(height34-height-5));
break;
case 25:
- OreAliminium(height+3+random.Int(height34-height-10));
+ OreAliminium(height+3+FastRandom.Int(height34-height-10));
break;
case 26:
- OreAliminium(height+3+random.Int(45));
+ OreAliminium(height+3+FastRandom.Int(45));
break;
case 27:
- OreAliminium(height+3+random.Int(35));
+ OreAliminium(height+3+FastRandom.Int(35));
break;
case 28:
- OreSulfur(height+3+random.Int(height12-height/*-10*/));
+ OreSulfur(height+3+FastRandom.Int(height12-height/*-10*/));
break;
case 29:
- OreSaltpeter(height+3+random.Int(height12-height/*-10*/));
+ OreSaltpeter(height+3+FastRandom.Int(height12-height/*-10*/));
break;
case 30:
- OreSulfur(height+3+random.Int(height12-height/*-10*/));
+ OreSulfur(height+3+FastRandom.Int(height12-height/*-10*/));
break;
case 31:
- OreSaltpeter(height+3+random.Int(height12-height/*-10*/));
+ OreSaltpeter(height+3+FastRandom.Int(height12-height/*-10*/));
break;
}
}
@@ -3931,17 +3817,17 @@ public enum WorldSize : byte{
if (height34Change==0) {
if (height34<105)height34++;
else if (height34>110)height34--;
- else if (random.Bool()) height34++;
+ else if (FastRandom.Bool()) height34++;
else height34--;
- height34Change=random.Int4()+1;
+ height34Change=FastRandom.Int4()+1;
} else height34Change--;
if (level3Lenght==0) {
level3TypeLast=level3Type;
level3Crossing=2;
- level3Type=random.Int(10);
+ level3Type=FastRandom.Int(10);
- level3Lenght=random.Int(20)+8+8+24;
+ level3Lenght=FastRandom.Int(20)+8+8+24;
} else {
level3Lenght--;
level3Crossing--;
@@ -3953,76 +3839,76 @@ public enum WorldSize : byte{
for (int y=height; y15) {
- switch (random.Int(25)) {
+ switch (FastRandom.Int(25)) {
case 7:
- OreCopper(height+3+random.Int(height34-height-10));
+ OreCopper(height+3+FastRandom.Int(height34-height-10));
break;
case 8:
- OreCopper(height+3+random.Int(45));
+ OreCopper(height+3+FastRandom.Int(45));
break;
case 9:
- OreIron(height+3+random.Int(15));
+ OreIron(height+3+FastRandom.Int(15));
break;
case 10:
- OreCopper(height+3+random.Int(10));
+ OreCopper(height+3+FastRandom.Int(10));
break;
case 11:
- OreCopper(height+10+random.Int(10));
+ OreCopper(height+10+FastRandom.Int(10));
break;
case 12:
- OreIron(height+3+random.Int(height34-height-10));
+ OreIron(height+3+FastRandom.Int(height34-height-10));
break;
case 13:
- OreIron(height+3+random.Int(45));
+ OreIron(height+3+FastRandom.Int(45));
break;
case 14:
- OreIron(height+10+random.Int(20));
+ OreIron(height+10+FastRandom.Int(20));
break;
case 15:
- OreIron(height+3+random.Int(45));
+ OreIron(height+3+FastRandom.Int(45));
break;
case 20:
- OreTin(height+3+random.Int(height34-height-10));
+ OreTin(height+3+FastRandom.Int(height34-height-10));
break;
case 21:
- OreTin(height+3+random.Int(35));
+ OreTin(height+3+FastRandom.Int(35));
break;
case 22:
- OreTin(height+6+random.Int(25));
+ OreTin(height+6+FastRandom.Int(25));
break;
case 23:
- OreSilver(height+3+random.Int(height34-height-5));
+ OreSilver(height+3+FastRandom.Int(height34-height-5));
break;
case 24:
- OreGold(height+3+random.Int(height34-height-5));
+ OreGold(height+3+FastRandom.Int(height34-height-5));
break;
case 25:
- OreAliminium(height+3+random.Int(height34-height-10));
+ OreAliminium(height+3+FastRandom.Int(height34-height-10));
break;
case 26:
- OreAliminium(height+3+random.Int(45));
+ OreAliminium(height+3+FastRandom.Int(45));
break;
case 27:
- OreAliminium(height+3+random.Int(35));
+ OreAliminium(height+3+FastRandom.Int(35));
break;
}
}
@@ -4033,18 +3919,18 @@ public enum WorldSize : byte{
if (height34Change==0) {
if (height34<105)height34++;
else if (height34>110)height34--;
- else if (random.Bool()) height34++;
+ else if (FastRandom.Bool()) height34++;
else height34--;
- height34Change=random.Int4()+1;
+ height34Change=FastRandom.Int4()+1;
} else height34Change--;
if (level3Lenght==0) {
level3TypeLast=level3Type;
level3Crossing=2;
- level3Type=random.Int(10);
+ level3Type=FastRandom.Int(10);
- level3Lenght=random.Int(20)+8+8+24;
+ level3Lenght=FastRandom.Int(20)+8+8+24;
} else {
level3Lenght--;
level3Crossing--;
@@ -4054,45 +3940,45 @@ public enum WorldSize : byte{
for (int y=height; y15) {
- switch (random.Int(25)) {
+ switch (FastRandom.Int(25)) {
case 7:
- OreCopper(height+3+random.Int(height34-height-10));
+ OreCopper(height+3+FastRandom.Int(height34-height-10));
break;
case 8:
- OreCopper(height+3+random.Int(45));
+ OreCopper(height+3+FastRandom.Int(45));
break;
case 9:
- OreIron(height+3+random.Int(15));
+ OreIron(height+3+FastRandom.Int(15));
break;
case 10:
- OreCopper(height+3+random.Int(10));
+ OreCopper(height+3+FastRandom.Int(10));
break;
case 11:
- OreCopper(height+10+random.Int(10));
+ OreCopper(height+10+FastRandom.Int(10));
break;
case 12:
- OreIron(height+3+random.Int(height34-height-10));
+ OreIron(height+3+FastRandom.Int(height34-height-10));
break;
case 13:
- OreIron(height+3+random.Int(45));
+ OreIron(height+3+FastRandom.Int(45));
break;
case 14:
- OreIron(height+10+random.Int(20));
+ OreIron(height+10+FastRandom.Int(20));
break;
case 15:
- OreIron(height+3+random.Int(45));
+ OreIron(height+3+FastRandom.Int(45));
break;
@@ -4100,33 +3986,33 @@ public enum WorldSize : byte{
case 20:
- OreTin(height+3+random.Int(height34-height-10));
+ OreTin(height+3+FastRandom.Int(height34-height-10));
break;
case 21:
- OreTin(height+3+random.Int(35));
+ OreTin(height+3+FastRandom.Int(35));
break;
case 22:
- OreTin(height+6+random.Int(25));
+ OreTin(height+6+FastRandom.Int(25));
break;
case 23:
- OreSilver(height+3+random.Int(height34-height-5));
+ OreSilver(height+3+FastRandom.Int(height34-height-5));
break;
case 24:
- OreGold(height+3+random.Int(height34-height-5));
+ OreGold(height+3+FastRandom.Int(height34-height-5));
break;
case 25:
- OreAliminium(height+3+random.Int(height34-height-10));
+ OreAliminium(height+3+FastRandom.Int(height34-height-10));
break;
case 26:
- OreAliminium(height+3+random.Int(45));
+ OreAliminium(height+3+FastRandom.Int(45));
break;
case 27:
- OreAliminium(height+3+random.Int(35));
+ OreAliminium(height+3+FastRandom.Int(35));
break;
}
}
@@ -4140,10 +4026,10 @@ public enum WorldSize : byte{
if (height12<65) height12++;
else if (height12>70) height12--;
else {
- if (random.Bool()) height12++;
+ if (FastRandom.Bool()) height12++;
else height12--;
}
- height12Change=random.Int2()+1;
+ height12Change=FastRandom.Int2()+1;
} else height12Change--;
@@ -4152,9 +4038,9 @@ public enum WorldSize : byte{
if (level1Lenght==0) {
level1TypeLast=level1Type;
level1Crossing=2;
- level1Type=random.Int5();
+ level1Type=FastRandom.Int5();
- level1Lenght=random.Int(20)+20;
+ level1Lenght=FastRandom.Int(20)+20;
} else {
level1Lenght--;
level1Crossing--;
@@ -4169,13 +4055,13 @@ public enum WorldSize : byte{
if (level1Crossing==2) {
ushort oldTop = GetByIdHeight1(level1TypeLast);
for (int y = height; y15) {
- switch (random.Int(25)) {
+ switch (FastRandom.Int(25)) {
case 1:
- OreIron(height+3+random.Int(height34-height-10));
+ OreIron(height+3+FastRandom.Int(height34-height-10));
break;
case 2:
- OreIron(height+3+random.Int(45));
+ OreIron(height+3+FastRandom.Int(45));
break;
case 7:
- OreCopper(height+3+random.Int(height34-height-10));
+ OreCopper(height+3+FastRandom.Int(height34-height-10));
break;
case 8:
- OreCopper(height+3+random.Int(45));
+ OreCopper(height+3+FastRandom.Int(45));
break;
case 9:
- OreCopper(height+3+random.Int(15));
+ OreCopper(height+3+FastRandom.Int(15));
break;
case 10:
- OreCopper(height+3+random.Int(10));
+ OreCopper(height+3+FastRandom.Int(10));
break;
case 11:
- OreCopper(height+10+random.Int(10));
+ OreCopper(height+10+FastRandom.Int(10));
break;
case 12:
- OreIron(height+3+random.Int(height34-height-10));
+ OreIron(height+3+FastRandom.Int(height34-height-10));
break;
case 13:
- OreIron(height+3+random.Int(45));
+ OreIron(height+3+FastRandom.Int(45));
break;
case 14:
- OreIron(height+10+random.Int(20));
+ OreIron(height+10+FastRandom.Int(20));
break;
case 15:
- OreIron(height+3+random.Int(45));
+ OreIron(height+3+FastRandom.Int(45));
break;
case 20:
- OreTin(height+3+random.Int(height34-height-10));
+ OreTin(height+3+FastRandom.Int(height34-height-10));
break;
case 21:
- OreTin(height+3+random.Int(35));
+ OreTin(height+3+FastRandom.Int(35));
break;
case 22:
- OreTin(height+6+random.Int(25));
+ OreTin(height+6+FastRandom.Int(25));
break;
case 23:
- OreSilver(height+3+random.Int(height34-height-5));
+ OreSilver(height+3+FastRandom.Int(height34-height-5));
break;
case 24:
- OreGold(height+3+random.Int(height34-height-5));
+ OreGold(height+3+FastRandom.Int(height34-height-5));
break;
case 25:
- OreAliminium(height+3+random.Int(height34-height-10));
+ OreAliminium(height+3+FastRandom.Int(height34-height-10));
break;
case 26:
- OreAliminium(height+3+random.Int(45));
+ OreAliminium(height+3+FastRandom.Int(45));
break;
case 27:
- OreAliminium(height+3+random.Int(35));
+ OreAliminium(height+3+FastRandom.Int(35));
break;
}
}
@@ -4320,38 +4206,34 @@ public enum WorldSize : byte{
}
ushort GetByIdHeight3(int v) {
- switch (v) {
- case 1: return (ushort)BlockId.StoneBasalt;
- case 2: return (ushort)BlockId.StoneGabbro;
- case 3: return (ushort)BlockId.StoneDiorit;
- case 4: return (ushort)BlockId.StoneGneiss;
-
- case 5: return (ushort)BlockId.StoneBasalt;
- case 11: return (ushort)BlockId.StoneGabbro;
- case 12: return (ushort)BlockId.StoneDiorit;
- case 13: return (ushort)BlockId.StoneGneiss;
-
- case 14: return (ushort)BlockId.StoneBasalt;
- case 15: return (ushort)BlockId.StoneBasalt;
-
- case 6: return (ushort)BlockId.StoneSandstone;
- case 7: return (ushort)BlockId.StoneLimestone;
- case 8: return (ushort)BlockId.StoneSchist;
- case 9: return (ushort)BlockId.StoneDolomite;
- case 10: return (ushort)BlockId.StoneRhyolite;
-
- default: return (ushort)BlockId.StoneDolomite;
- }
+ return v switch {
+ 1 => (ushort)BlockId.StoneBasalt,
+ 2 => (ushort)BlockId.StoneGabbro,
+ 3 => (ushort)BlockId.StoneDiorit,
+ 4 => (ushort)BlockId.StoneGneiss,
+ 5 => (ushort)BlockId.StoneBasalt,
+ 11 => (ushort)BlockId.StoneGabbro,
+ 12 => (ushort)BlockId.StoneDiorit,
+ 13 => (ushort)BlockId.StoneGneiss,
+ 14 => (ushort)BlockId.StoneBasalt,
+ 15 => (ushort)BlockId.StoneBasalt,
+ 6 => (ushort)BlockId.StoneSandstone,
+ 7 => (ushort)BlockId.StoneLimestone,
+ 8 => (ushort)BlockId.StoneSchist,
+ 9 => (ushort)BlockId.StoneDolomite,
+ 10 => (ushort)BlockId.StoneRhyolite,
+ _ => (ushort)BlockId.StoneDolomite,
+ };
}
ushort GetByIdHeightMars(int v) {
- switch (v) {
- case 1: return (ushort)BlockId.StoneSandstone;
- case 2: return (ushort)BlockId.StoneBasalt;
- case 3: return (ushort)BlockId.StoneBasalt;
- case 4: return (ushort)BlockId.MudStone;
- default: return (ushort)BlockId.StoneSandstone;
- }
+ return v switch {
+ 1 => (ushort)BlockId.StoneSandstone,
+ 2 => (ushort)BlockId.StoneBasalt,
+ 3 => (ushort)BlockId.StoneBasalt,
+ 4 => (ushort)BlockId.MudStone,
+ _ => (ushort)BlockId.StoneSandstone,
+ };
}
unsafe void Save(string name) {
@@ -5020,7 +4902,7 @@ public enum WorldSize : byte{
world++;
void SaveLiveObject(GenLiveObject lo) {
- switch (lo) {
+ switch (lo) {
case GenTree tree:
// Basic info
bytesLiveObject.Add((byte)LiveObjectType.Tree);
@@ -5033,7 +4915,7 @@ public enum WorldSize : byte{
int countWood=tree.TitlesWood.Count;
bytesLiveObject.Add((byte)countWood);
- for (int i=0; i1f)add=1f;
+ if (add+lastRnd<0f)add=0f;
+
+ lastRnd+=add;
+
+ float half=(float)i/len;
+ points[i].Item2=lastRnd*(1f-(2f*half-1f)*(2f*half-1f));
+
+ // Next acc
+ float nextLen=FastRandom.Float()+0.5f;
+ lastPoint.X+=((float)Math.Cos(angle))*nextLen;
+ lastPoint.Y+=((float)Math.Sin(angle))*nextLen;
+
+ angle+=(FastRandom.Float()-0.5f)*0.1f;
+ points[i].Item3=(angle*ta)/2f;
+
+ }
+
+ Vector2[] fin=new Vector2[len];
+ for (int i=0; i40) RemoveRound(1+FastRandom.Int(7),xx,yy);
+ }
+
+ void RemoveRound(int size, int xx, int yy) {
+ RemoveBlock(xx,yy);
+
+ RemoveBlock(xx, yy+1);
+ RemoveBlock(xx, yy-1);
+ if (size>2) return;
+
+ RemoveBlock(xx-1, yy);
+ RemoveBlock(xx+1, yy);
+ if (size>3) return;
+
+ RemoveBlock(xx+1, yy+1);
+ RemoveBlock(xx-1, yy-1);
+ if (size>4) return;
+
+ RemoveBlock(xx+1, yy-1);
+ RemoveBlock(xx-1, yy+1);
+ if (size>5) return;
+
+ RemoveBlock(xx+2, yy);
+ RemoveBlock(xx-2, yy);
+ if (size>6) return;
+
+ RemoveBlock(xx, yy+2);
+ RemoveBlock(xx, yy-2);
+ if (size>7) return;
+ }
+
+ void RemoveBlock(int xx, int yy) {
+ ushort solidId=terrain[xx].SolidBlocks[yy];
+
+ if (solidId!=0) {
+
+ switch (solidId) {
+ case (ushort)BlockId.StoneBasalt:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackBasalt;
+ break;
+
+ case (ushort)BlockId.StoneDiorit:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackDiorit;
+ break;
+
+ case (ushort)BlockId.StoneDolomite:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackDolomite;
+ break;
+
+ case (ushort)BlockId.StoneGabbro:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackGabbro;
+ break;
+
+ case (ushort)BlockId.StoneGneiss:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackGneiss;
+ break;
+
+ case (ushort)BlockId.StoneLimestone:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackLimestone;
+ break;
+
+ case (ushort)BlockId.StoneRhyolite:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackRhyolite;
+ break;
+
+ case (ushort)BlockId.StoneSandstone:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackSandstone;
+ break;
+
+ case (ushort)BlockId.StoneSchist:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackSchist;
+ break;
+
+ case (ushort)BlockId.OreAluminium:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackAluminium;
+ break;
+
+ case (ushort)BlockId.OreCoal:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackCoal;
+ break;
+
+ case (ushort)BlockId.OreCopper:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackCopper;
+ break;
+
+ case (ushort)BlockId.OreGold:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackGold;
+ break;
+
+ case (ushort)BlockId.OreIron:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackIron;
+ break;
+
+ case (ushort)BlockId.OreSaltpeter:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackSaltpeter;
+ break;
+
+ case (ushort)BlockId.OreSilver:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackSilver;
+ break;
+
+ case (ushort)BlockId.OreSulfur:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackSulfur;
+ break;
+
+ case (ushort)BlockId.OreTin:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackTin;
+ break;
+
+ case (ushort)BlockId.Dirt:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackDirt;
+ break;
+
+ case (ushort)BlockId.Sand:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackSand;
+ break;
+
+ case (ushort)BlockId.Gravel:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackGravel;
+ break;
+
+ case (ushort)BlockId.Cobblestone:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackCobblestone;
+ break;
+
+ case (ushort)BlockId.Clay:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackClay;
+ break;
+
+ case (ushort)BlockId.GrassBlockClay:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackClay;
+ break;
+
+ case (ushort)BlockId.GrassBlockCompost:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackDirt;
+ break;
+
+ case (ushort)BlockId.GrassBlockDesert:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackDirt;
+ break;
+
+ case (ushort)BlockId.GrassBlockForest:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackDirt;
+ break;
+
+ case (ushort)BlockId.GrassBlockHills:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackDirt;
+ break;
+
+ case (ushort)BlockId.GrassBlockJungle:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackDirt;
+ break;
+
+ case (ushort)BlockId.GrassBlockPlains:
+ terrain[xx].SolidBlocks[yy]=0;
+ terrain[xx].BackBlocks[yy]=(ushort)BlockId.BackDirt;
+ break;
+ }
+
+ if (terrain[xx].SolidBlocks[yy-1]!=0) {
+ ushort idTop=terrain[xx].TopBlocks[yy-1];
+ if (idTop!=0) {
+ switch (idTop) {
+ case (ushort)BlockId.GrassDesert: terrain[xx].TopBlocks[yy-1]=0; break;
+ case (ushort)BlockId.GrassForest: terrain[xx].TopBlocks[yy-1]=0; break;
+ case (ushort)BlockId.GrassHills: terrain[xx].TopBlocks[yy-1]=0; break;
+ case (ushort)BlockId.GrassJungle: terrain[xx].TopBlocks[yy-1]=0; break;
+ case (ushort)BlockId.GrassPlains: terrain[xx].TopBlocks[yy-1]=0; break;
+ case (ushort)BlockId.Heather: terrain[xx].TopBlocks[yy-1]=0; break;
+ case (ushort)BlockId.Dandelion: terrain[xx].TopBlocks[yy-1]=0; break;
+ case (ushort)BlockId.Violet: terrain[xx].TopBlocks[yy-1]=0; break;
+ case (ushort)BlockId.Rose: terrain[xx].TopBlocks[yy-1]=0; break;
+ case (ushort)BlockId.BranchALittle1:terrain[xx].TopBlocks[yy-1]=0; break;
+ case (ushort)BlockId.BranchALittle2:terrain[xx].TopBlocks[yy-1]=0; break;
+ case (ushort)BlockId.BranchFull: terrain[xx].TopBlocks[yy-1]=0; break;
+ case (ushort)BlockId.BranchWithout: terrain[xx].TopBlocks[yy-1]=0; break;
+ case (ushort)BlockId.Alore: terrain[xx].TopBlocks[yy-1]=0; break;
+ }
+ }
+ }
+ }
+ }
+ }
class BiomeExt{
public HotBiome Temterature;
@@ -6519,7 +6660,7 @@ public class GChunk {
public List
Plants = new List(),
- Mobs = new List();
+ Mobs = new();
public unsafe void AddPlant(ushort id, byte height) {
#if DEBUG
@@ -6530,7 +6671,7 @@ public class GChunk {
Plants.Add(ids[1]);
Plants.Add(ids[0]);
Plants.Add(height);
- Rabcr.random.Byte(Plants);
+ FastRandom.Byte(Plants);
PlantsCount++;
}
@@ -6538,7 +6679,7 @@ public class GChunk {
Plants.Add(byteWheat1);
Plants.Add(byteWheat0);
Plants.Add(height);
- Rabcr.random.Byte(Plants);
+ FastRandom.Byte(Plants);
PlantsCount++;
}
@@ -6546,7 +6687,7 @@ public class GChunk {
Plants.Add(byteCarrot1);
Plants.Add(byteCarrot0);
Plants.Add(height);
- Rabcr.random.Byte(Plants);
+ FastRandom.Byte(Plants);
PlantsCount++;
}
@@ -6554,7 +6695,7 @@ public class GChunk {
Plants.Add(byteFlax1);
Plants.Add(byteFlax0);
Plants.Add(height);
- Rabcr.random.Byte(Plants);
+ FastRandom.Byte(Plants);
PlantsCount++;
}
@@ -6574,7 +6715,7 @@ const byte
byteRabbit0=(byte)(ushort)BlockId.Rabbit,
byteRabbit1=(byte)(ushort)(((ushort)BlockId.Rabbit)>>8),
-
+
byteParrot0=(byte)(ushort)BlockId.MobParrot,
byteParrot1=(byte)(ushort)(((ushort)BlockId.MobParrot)>>8),
@@ -6585,7 +6726,7 @@ const byte
Mobs.Add(byteFish1);
Mobs.Add(byteFish0);
Mobs.Add(height);
- Rabcr.random.Byte2(Mobs);
+ FastRandom.Byte2(Mobs);
MobsCount++;
}
@@ -6593,7 +6734,7 @@ const byte
Mobs.Add(byteRabbit1);
Mobs.Add(byteRabbit0);
Mobs.Add(height);
- Rabcr.random.Byte2(Mobs);
+ FastRandom.Byte2(Mobs);
MobsCount++;
}
@@ -6601,7 +6742,7 @@ const byte
Mobs.Add(byteChicken1);
Mobs.Add(byteChicken0);
Mobs.Add(height);
- Rabcr.random.Byte2(Mobs);
+ FastRandom.Byte2(Mobs);
MobsCount++;
}
@@ -6613,7 +6754,7 @@ const byte
Mobs.Add(0);
Mobs.Add(height);
- Rabcr.random.Byte2(Mobs);
+ FastRandom.Byte2(Mobs);
MobsCount++;
}
@@ -6624,6 +6765,7 @@ const byte
public byte LightPosHalf;
public bool SetLightPosHalf;
public byte Half;
+
}
public class GPreChunk {
diff --git a/rabcrClient/InterLogic/Game/Terrain/MTerrain.cs b/rabcrClient/InterLogic/Game/Terrain/MTerrain.cs
index 44c70f9..5853aa7 100644
--- a/rabcrClient/InterLogic/Game/Terrain/MTerrain.cs
+++ b/rabcrClient/InterLogic/Game/Terrain/MTerrain.cs
@@ -10,69 +10,218 @@ public enum MChunkState:byte{
}
public class MTerrain {
+ public int
+ // Total (With half)
+ LightPosFull,
+ LightPosFull16,
+ LightPosHalf,
+ LightPosHalf16,
+ StartSomething;
+
public MChunkState state=MChunkState.NotDownloaded;
public DateTime sended;
- public byte LightPos;
- public int LightPos16;
- public byte StartSomething;
-
public Block[] Background=new Block[125];
public Block[] SolidBlocks=new Block[125];
public Block[] TopBlocks=new Block[125];
- public MBlockState[] IsBackground=new MBlockState[125];
- public MBlockState[] IsSolidBlocks=new MBlockState[125];
- public MBlockState[] IsTopBlocks=new MBlockState[125];
+ public bool[]
+ IsBackground=new bool[125],
+ IsSolidBlocks=new bool[125],
+ IsTopBlocks=new bool[125];
+
+ // public bool BackgroundExists(int h) => IsBackground[h]==MBlockState.Exist;//((int)IsBackground[h] & 1)==1;
+
+ // public bool SolidBlocksExists(int h) => IsSolidBlocks[h]==MBlockState.Exist/* || IsSolidBlocks[h]==MBlockState.TmpAdded*/;//((int)IsSolidBlocks[h] & 1)==1;
+ // public bool TopBlocksExists(int h) => IsTopBlocks[h]==MBlockState.Exist;//((int)IsTopBlocks[h] & 1)==1;
public List Mobs=new List();
public List Plants=new List();
- public Vector2 LightVec;//new Vector2(x*16-48+8, terrain[x].LightPos*16-48+8)
+ public Vector2 LightVec;
+
+ /// After you removed New Block on Y pos terrain
+ public void RefreshLightingRemoveTop(int newBlockOnY, ushort id) {
+ if (newBlockOnY==LightPosHalf) {
+ if (GameMethods.IsHalfShadowBlock(id)) {
+
+ for (int i=LightPosHalf; i<125; i++) {
+ if (i==LightPosFull) {
+ LightPosHalf=i;
+ LightPosHalf16=i*16;
+ //StartSomething=newBlockOnY;
+ return;
+ }
+
+ if (IsTopBlocks[i]) {
+ if (GameMethods.IsHalfShadowBlock(TopBlocks[i].Id)) {
+ LightPosHalf=i;
+ LightPosHalf16=i*16;
+ // StartSomething=newBlockOnY;
+ return;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /// After you Added New Block on Y pos terrain
+ public void RefreshLightingAddTop(int newBlockOnY, ushort id) {
+ if (GameMethods.IsHalfShadowBlock(id)) {
+ //if (newBlockOnYLooks like notexisting, but not, but server need check if player can remove
+ TmpRemoved=2, //10
+
+ ///Looks like existing, but not, but server need check if player can add
+ TmpAdded=3, //11
}
- class ChangeTerrain {
+ class ChangeTerrain {
public DateTime sended;
- enum ChangeTerrainType:byte{
+ enum ChangeTerrainType:byte{
BasicRemove,
BasicAdd,
+ Changed,
+
-
}
}
class SendedBlockToRemove:ChangeTerrain {
- public Mob animal;
+ // public MMob animal;
public DInt blockPos;
public BlockType blockType;
- public List items;
+ // public List items;
public string World;
+
+ public int SelectedInv;
}
- //class SendedBlockToRemove:ChangeTerrain {
- // public Mob animal;
- // public DInt blockPos;
- // public BlockType blockType;
- // public List items;
- // public string World;
- //}
+ class SendedBlockToChange : ChangeTerrain {
+ // public MMob animal;
+ public DInt blockPos;
+ public BlockType blockType;
+ // public List items;
+ public string World;
+ }
class SendedBlockToAdd:ChangeTerrain {
- public Mob animal;
+ // public MMob animal;
public DInt blockPos;
public BlockType blockType;
- public List items;
+ // public List items;
public string World;
+
+ public int SelectedInv;
}
diff --git a/rabcrClient/InterLogic/Game/Terrain/MultiplayerMethods.cs b/rabcrClient/InterLogic/Game/Terrain/MultiplayerMethods.cs
new file mode 100644
index 0000000..186ecac
--- /dev/null
+++ b/rabcrClient/InterLogic/Game/Terrain/MultiplayerMethods.cs
@@ -0,0 +1,1933 @@
+using Microsoft.Xna.Framework;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+//using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Net.Sockets;
+
+namespace rabcrClient {
+ partial class Multiplayer {
+ int playerId=-1;
+ #region varibles
+ List terrainChanges = new List();
+ List Queue = new List();
+ const string toServer = "{Server}";
+ const string toEveryone = "{Everyone}";
+ string SomeoneWantTeleportToYouName;
+
+ Password password;
+
+ enum LoginType {
+ Null,
+
+ Banned,
+ BannedWithInfo,
+
+ FirstConnectPassword,
+ FirstConnect,
+
+ NotOnWhitelistNoInfo,
+ NotOnWhitelist,
+
+ LoginWithPassword,
+ BasicLogin,
+ }
+ int state = 0;
+ const int downloadingSpawnAreaMax = 53;
+ int downloadedSpawnArea = 0;
+ // bool cmdWeb;
+ byte[] byteData = new byte[1024];
+ Current currentState;
+ bool Error = false;
+ int joinedPlayers = 0;
+ Socket clientSocket;
+ string serverName = "";
+ int maxplayers = 10;
+ DateTime tpPlayerTime;
+ string tpPlayerMsgWaiting;
+ int safeSpawn = 0;
+ List players = new List();
+ // bool UseBackColor;
+ // Color BackColor;
+ // bool UseGedo;
+ GameButtonMedium menu;
+ float Process {
+ get { return state/496f; }
+ }
+ string sn = "";
+ #endregion
+
+ void DestroyBlockTopBlock(int x, int y) {
+ MTerrain chunk=terrain[x];
+ SendRemovedBlock(x, y, chunk.TopBlocks[y].Id,BlockType.Top);
+ // chunk.TopBlocks[y]=null;
+ // chunk.IsTopBlocks[y]=MBlockState.TmpRemoved;
+ }
+
+ void DestroyBlockBackBlock(int x, int y) {
+ MTerrain chunk=terrain[x];
+ SendRemovedBlock(x, y, chunk.TopBlocks[y].Id,BlockType.Back);
+ //chunk.BackBlocks[y]=null;
+ // chunk.IsTopBlocks[y]=MBlockState.TmpRemoved;
+ }
+
+ void DestroyBlockSolidBlock(int x, int y) {
+ MTerrain chunk=terrain[x];
+ SendRemovedBlock(x, y, chunk.SolidBlocks[y].Id,BlockType.Solid);
+ // chunk.TopBlocks[y]=null;
+ //chunk.IsTopBlocks[y]=MBlockState.TmpRemoved;
+ }
+
+ void SendRemovedBlock(int x, int y, ushort id, BlockType bt) {
+ terrainChanges.Add(new SendedBlockToRemove {
+ blockPos=new DInt(x,y),
+ blockType=bt,
+ World="Earth",
+ SelectedInv=boxSelected,
+ sended=DateTime.Now,
+ });
+
+ //switch (bt) {
+ // case BlockType.Back:
+ // terrain[x].IsBackground[y]=MBlockState.TmpRemoved;
+ // break;
+
+ // case BlockType.Solid:
+ // terrain[x].IsSolidBlocks[y]=MBlockState.TmpRemoved;
+ // break;
+
+ // case BlockType.Top:
+ // terrain[x].IsTopBlocks[y]=MBlockState.TmpRemoved;
+ // break;
+
+ // case BlockType.Plant:
+ // terrain[x].Plants.[y]=MBlockState.TmpRemoved;
+ // break;
+
+ // case BlockType.Mob:
+ // terrain[x].IsTopBlocks[y]=MBlockState.TmpRemoved;
+ // break;
+ //}
+
+ //Queue.Add(new DataToSend {
+ // Importance=Importance.Middle,
+ // Bytes=new Data {
+ // Cmd=Command.EditTerrain,
+ // From=Setting.Name,
+ // To=toServer,
+ // Message="-|"+x+"|"+y+"|"+world+"|"+(int)BlockType.Top+"|"+id+"|",
+ // }.ToByte(),
+ //});
+ }
+
+ //void SendChangedBlock(int x, int y, ushort oldId, ushort newId, BlockType bt) {
+ // terrainChanges.Add(new SendedBlockToAdd {
+ // blockPos=new DInt(x,y),
+ // blockType=bt,
+ // World="Earth",
+ // sended=DateTime.Now,
+ // });
+
+ // //switch (bt) {
+ // // case BlockType.Back:
+ // // // terrain[x].IsBackground[y]=false;
+ // // break;
+
+ // // case BlockType.Solid:
+ // // // terrain[x].IsSolidBlocks[y]=MBlockState.TmpRemoved;
+ // // break;
+
+ // // case BlockType.Top:
+ // // // terrain[x].IsTopBlocks[y]=MBlockState.TmpRemoved;
+ // // break;
+
+ // // case BlockType.Plant:
+ // // // terrain[x].Plants.[y]=MBlockState.TmpRemoved;
+ // // break;
+
+ // // case BlockType.Mob:
+ // // // terrain[x].IsTopBlocks[y]=MBlockState.TmpRemoved;
+ // // break;
+ // //}
+
+ // Queue.Add(new DataToSend {
+ // Importance=Importance.Middle,
+ // Bytes=new Data {
+ // Cmd=Command.EditTerrain,
+ // From=Setting.Name,
+ // To=toServer,
+ // Message="*|"+x+"|"+y+"|"+world+"|"+(int)BlockType.Top+"|"+oldId+"|"+newId,
+ // }.ToByte(),
+ // });
+ //}
+
+ void SendAddedBlock(int x, int y, int id, BlockType bt) {
+ terrainChanges.Add(new SendedBlockToAdd {
+ blockPos=new DInt(x,y),
+ blockType=bt,
+ World="Earth",
+ SelectedInv=boxSelected,
+ sended=DateTime.Now,
+ });
+
+ //switch (bt) {
+ // case BlockType.Back:
+ // // terrain[x].IsBackground[y]=false;
+ // break;
+
+ // case BlockType.Solid:
+ // // terrain[x].IsSolidBlocks[y]=MBlockState.TmpRemoved;
+ // break;
+
+ // case BlockType.Top:
+ // // terrain[x].IsTopBlocks[y]=MBlockState.TmpRemoved;
+ // break;
+
+ // case BlockType.Plant:
+ // // terrain[x].Plants.[y]=MBlockState.TmpRemoved;
+ // break;
+
+ // case BlockType.Mob:
+ // // terrain[x].IsTopBlocks[y]=MBlockState.TmpRemoved;
+ // break;
+ //}
+
+ //Queue.Add(new DataToSend {
+ // Importance=Importance.Middle,
+ // Bytes=new Data {
+ // Cmd=Command.EditTerrain,
+ // From=Setting.Name,
+ // To=toServer,
+ // Message="+|"+x+"|"+y+"|"+world+"|"+(int)BlockType.Top+"|"+id+"|",
+ // }.ToByte(),
+ //});
+ }
+
+ void SendEatItem() {
+ //Queue.Add(new DataToSend {
+ // Importance=Importance.Middle,
+ // Bytes=new Data {
+ // Cmd=Command.EatFood,
+ // From=Setting.Name,
+ // To=toServer,
+ // Message=InventoryNormal[boxSelected].Id.ToString(),
+ // }.ToByte(),
+ //});
+ }
+
+ void SendHoeAction(int x, int y) {
+
+ }
+
+ Color StringToColor(string str) {
+ string h = str.Replace("[", "").Replace("]", "").Replace(" ", "");
+ return new Color(int.Parse(h.Substring(0, h.IndexOf(","))),
+ int.Parse(h.Substring(h.IndexOf(",")+1, h.LastIndexOf(",")-h.IndexOf(",")-1)),
+ int.Parse(h.Substring(h.LastIndexOf(",")+1)));
+ }
+
+ public void Connect() {
+ clientSocket=new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) {
+ ReceiveTimeout=10
+ };
+ IPAddress ipAddress = ip;
+
+ if (ipAddress.ToString()==IPAddress.Any.ToString()) { ipAddress=IPAddress.Loopback; ip=IPAddress.Loopback; }
+
+ IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, port);
+
+ Console.WriteLine("Připojování: "+ipAddress.ToString()+":"+port);
+
+ clientSocket.BeginConnect(ipEndPoint, new AsyncCallback(OnCheck), null);
+ }
+
+ public void ConnectDuringGameError() {
+ clientSocket=new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) {
+ ReceiveTimeout=10
+ };
+ IPAddress ipAddress = ip;
+
+ if (ipAddress.ToString()==IPAddress.Any.ToString()) ipAddress=IPAddress.Loopback;
+
+ IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, port);
+
+ Console.WriteLine("Znovupřipojování: "+ipAddress.ToString()+":"+port);
+
+ clientSocket.BeginConnect(ipEndPoint, new AsyncCallback(OnCheck), null);
+ }
+
+ void OnCheck(IAsyncResult ar) {
+ try {
+ state++;
+ clientSocket.EndConnect(ar);
+
+ //Data msgToSend = new Data {
+ // Cmd = Command.Check,
+ // // From=Setting.Name,
+ // To = toServer,
+ // Message = ""
+ //};
+
+ List bytesToSend=new List();
+ bytesToSend.Add((byte)Command.Check);
+ AddStringToByteList(bytesToSend, Setting.Name);
+
+ byteData = bytesToSend.ToArray();
+
+ //byteData = msgToSend.ToByte();
+
+ clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null);
+
+ byteData = new byte[1024];
+
+ clientSocket.BeginReceive(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnReceive), null);
+
+ //current=Current.EndChecking;
+ state++;
+ } catch (SocketException ex) {
+
+ //Nemohlo být vytvořeno žádné připojení, protože cílový počítač je aktivně odmítl
+ if (10061 == ex.ErrorCode) {
+ ShowError("Nelze se připojit k serveru", "Žádný server není spuštěn na adrese " + ip + ":" + port);
+ } else {
+ //Pokus o připojení selhal, protože připojená strana v časovém intervalu řádně neodpověděla, nebo vytvořené připojení selhalo, protože neodpověděl připojený hostitel
+ if (10060 == ex.ErrorCode) {
+ ShowError("Nelze se připojit k serveru", "Připojování trvalo příliš dlouho.");
+ } else if (10013 == ex.ErrorCode) {
+ ShowError("Nelze se připojit k serveru", "Pravděpodobně Váš firewall blokuje připojení (Zkuste ho vypnout)");
+ } else
+ ShowError("Nelze se připojit k serveru", "Neznámá chyba v OnCheck: " + ex.Message + "; Kód: " + ex.ErrorCode);
+ }
+ }
+
+ //if (!Global.OnlineAccount){
+ // string url="https://geftgames.ga/System/rabcr/ifplayerexists.php?username="+Setting.Name;
+ // MyWebClient wc=new MyWebClient {
+ // Encoding=Encoding.UTF8,
+ // };
+ // try{
+ // string get=wc.DownloadString(new Uri(url));
+ // Console.WriteLine(6);
+ // if (string.IsNullOrEmpty(get)) {
+ // ShowError("Nelze zkontrolovat hráče", "Nelze ověřit zda již takový účet neexistuje");
+ // } else {
+ // string[]g=get.Split('|');
+
+ // if (g.Length>1){
+ // switch (g[0]) {
+ // case "E":
+
+ // break;
+
+ // case "O":
+ // //ok
+ // ShowError("Tento účet již existuje", "Někdo si již takovou přezdívku používá");
+ // break;
+
+ // default:
+ // // ShowError("Tento účet již existuje", "Někdo si již takovou přezdívku používá");
+ // break;
+ // }
+ // } else {
+ // ShowError("Nelze zkontrolovat hráče", "Nelze ověřit zda již takový účet neexistuje");
+ // }
+ // }
+ // }catch{
+ // ShowError("Nelze zkontrolovat hráče", "Nelze ověřit zda již takový účet neexistuje");
+ // }
+ //}
+
+ }
+
+ void SendMyInventory() {
+ //Data data = new Data {
+ // Cmd=Command.Message,
+ // To=toServer,
+ // Message="*int-set ",
+ //};
+
+ //data.Message+=maxInvCount+" ";
+
+ ////for (int i = 0; i inv = null;
+ int id = terrain[x].TopBlocks[y].Id;
+
+ //if (terrain[x].TopBlocks[y] is BoxBlock) {
+ // inv=((BoxBlock)terrain[x].TopBlocks[y]).Inv;
+ //} else if (terrain[x].TopBlocks[y] is MashineBlockBasic) {
+ // inv=((MashineBlockBasic)terrain[x].TopBlocks[y]).Inv;
+ //} else if (terrain[x].TopBlocks[y] is ShelfBlock) {
+ // inv=((ShelfBlock)terrain[x].TopBlocks[y]).Inv;
+ //} else return;
+
+ //Data data = new Data {
+ // Cmd=Command.Message,
+ // To=toServer,
+ // Message="*inv-machine-set "+x+" "+y+" ",
+ //};
+
+ //data.Message+=inv.Count+" ";
+
+ //for (int i = 0; i inv=null;
+
+
+ //Data data = new Data {
+ // Cmd=Command.Message,
+ // To=toServer,
+ // Message="*inv-set ",
+ //};
+
+ //data.Message+=maxInvCount+" ";
+
+ //List bytesInv=new();
+ //for (int i = 0; i \"; y je číslo");
+ }
+ } else {
+ if (int.TryParse(word[2], out int y)) {
+ DisplayText("Použití: \"*tp \"; x je číslo");
+ } else {
+ DisplayText("Použití: \"*tp \"; x a y je číslo");
+ }
+ }
+ }
+ } else {
+ DisplayText("Na tento příkaz namáte oprávnění");
+ }
+ return;
+
+ case "*warp-set":
+ if (word.Length==2) {
+ //Queue.Add(new DataToSend {
+ // Bytes=new Data {
+ // Cmd=Command.Message,
+ // // From=Setting.Name,
+ // To=toServer,
+ // Message="*warp-set "+word[1]+" "+PlayerX+" "+PlayerY,
+ // }.ToByte(),
+ // Importance=Importance.Middle
+ //});
+ DisplayText("Nastavuji warp "+word[1]);
+ }
+ break;
+
+ case "*warp":
+ if (word.Length==2) {
+ //Queue.Add(new DataToSend {
+ // Bytes=new Data {
+ // Cmd=Command.Message,
+ // // From=Setting.Name,
+ // To=toServer,
+ // Message="*warp "+word[1],
+ // }.ToByte(),
+ // Importance=Importance.Middle
+ //});
+ }
+ break;
+
+ case "*kick":
+ if (word.Length==2) {
+ //Queue.Add(new DataToSend {
+ // Bytes=new Data {
+ // Cmd=Command.Message,
+ // // From=Setting.Name,
+ // To=toServer,
+ // Message="*kick "+word[1],
+ // }.ToByte(),
+ // Importance=Importance.Middle
+ //});
+ }
+ break;
+
+ case "*ban":
+ if (word.Length==2) {
+ //Queue.Add(new DataToSend {
+ // Bytes=new Data {
+ // Cmd=Command.Message,
+ // // From=Setting.Name,
+ // To=toServer,
+ // Message="*ban "+word[1],
+ // }.ToByte(),
+ // Importance=Importance.Middle
+ //});
+ }
+ break;
+
+ case "*unban":
+ if (word.Length==2) {
+ //Queue.Add(new DataToSend {
+ // Bytes=new Data {
+ // Cmd=Command.Message,
+ // // From=Setting.Name,
+ // To=toServer,
+ // Message="*unban "+word[1],
+ // }.ToByte(),
+ // Importance=Importance.Middle
+ //});
+ }
+ break;
+
+ case "*warp-remove":
+ if (word.Length==2) {
+ //Queue.Add(new DataToSend {
+ // Bytes=new Data {
+ // Cmd=Command.Message,
+ // // From=Setting.Name,
+ // To=toServer,
+ // Message="*warp-remove "+word[1],
+ // }.ToByte(),
+ // Importance=Importance.Middle
+ //});
+ }
+ break;
+
+ case "*group-set":
+ if (word.Length==3) {
+ //Queue.Add(new DataToSend {
+ // Bytes=new Data {
+ // Cmd=Command.Message,
+ // // From=Setting.Name,
+ // To=toServer,
+ // Message="*group-set "+word[1]+" "+word[2],
+ // }.ToByte(),
+ // Importance=Importance.Middle
+ //});
+ }
+ break;
+
+ case "*itemsclear":
+ //Queue.Add(new DataToSend {
+ // Bytes=new Data {
+ // Cmd=Command.Message,
+ // // From=Setting.Name,
+ // To=toServer,
+ // Message="*itemsclear",
+ // }.ToByte(),
+ // Importance=Importance.Middle
+ //});
+ break;
+
+ case "*server-backup":
+ //Queue.Add(new DataToSend {
+ // Bytes=new Data {
+ // Cmd=Command.Message,
+ // // From=Setting.Name,
+ // To=toServer,
+ // Message="*server-backup",
+ // }.ToByte(),
+ // Importance=Importance.Middle
+ //});
+ break;
+
+ case "*server-reset":
+ //Queue.Add(new DataToSend {
+ // Bytes=new Data {
+ // Cmd=Command.Message,
+ // // From=Setting.Name,
+ // To=toServer,
+ // Message="*server-reset",
+ // }.ToByte(),
+ // Importance=Importance.Middle
+ //});
+ break;
+
+ case "*server-end":
+ //Queue.Add(new DataToSend {
+ // Bytes=new Data {
+ // Cmd=Command.Message,
+ // // From=Setting.Name,
+ // To=toServer,
+ // Message="*server-end",
+ // }.ToByte(),
+ // Importance=Importance.Middle
+ //});
+ break;
+
+ case "*changepassword":
+ password=new Password();
+ password.Show();
+ break;
+
+ case "*spawn-set":
+ //Queue.Add(new DataToSend {
+ // Bytes=new Data {
+ // Cmd=Command.Message,
+ // // From=Setting.Name,
+ // To=toServer,
+ // Message="*spawn-set "+PlayerX+" "+PlayerY,
+ // }.ToByte(),
+ // Importance=Importance.Middle
+ //});
+ break;
+
+ case "*gamemode":
+ if (word.Length==2) {
+ if (word[1]=="Dobrodružná"||word[1]=="Výzkum"||word[1]=="Kreativní"
+ ||word[1]=="0"||word[1]=="1"||word[1]=="2"
+ ||word[1]=="d"||word[1]=="v"||word[1]=="k") {
+ //Queue.Add(new DataToSend {
+ // Bytes=new Data {
+ // Cmd=Command.Message,
+ // // From=Setting.Name,
+ // To=toServer,
+ // Message="*gamemode "+word[1],
+ // }.ToByte(),
+ // Importance=Importance.Middle
+ //});
+ } else DisplayText("Neplatný příkaz, zkus \"*help\"");
+ }
+ break;
+
+ default:
+ DisplayText("Neplatný příkaz, zkus \"*help\"");
+ return;
+ }
+ }
+
+ void OnReceive(IAsyncResult ar) {
+ //Console.WriteLine("rec");
+ try {
+ clientSocket.EndReceive(ar);
+ } catch (Exception ex) {
+ if (ex.HResult==10054) {
+ //ShowError("Spojení bylo přerušeno", ex.Message);
+ //clientSocket.Shutdown(new SocketShutdown());
+ //clientSocket.Close();
+ //clientSocket.Dispose();
+ if (!exit) SolveErrorDuringGame(ex.HResult, "", "");
+ return;
+ } else {
+ Console.WriteLine(ex.Message+" rec1");
+ }
+ }
+
+ // Data msgReceived = new Data(byteData);
+ // msgReceived.Talk();
+ Command cmd=(Command)byteData[0];
+
+ Console.WriteLine("Get: "+cmd.ToString("g"));
+
+ switch (cmd) {
+ case Command.SendingWorldData:
+ {
+ // if (msgReceived.terrain!=null) {
+ // if (msgReceived.terrain.Length>2) {
+ // Load(bytes: msgReceived.terrain, pos: msgReceived.pos);
+
+ // if (currentState==Current.GettingSpawn) {
+ // if (downloadedSpawnArea bytes = new List();
+ // if (strs.Length==5) {
+ // if (strs[4]!="") {
+ // foreach (string s in strs[4].Split(',')) {
+ // bytes.Add(byte.Parse(s));
+ // }
+ // }
+ // }
+ // if (strs[0]=="+") {
+ // int x = int.Parse(strs[1]),
+ // y = int.Parse(strs[2]);
+ // if (terrain[x]==null) break;
+ // byte id = byte.Parse(strs[3]);
+ // bool stay = true;
+
+ // {
+ // Block b = SolidBlockFromId(id, new Vector2(x, y));
+ // if (b!=null) {
+ // // if (terrain[x].IsSolidBlocks[y]) GetItemsFromBlock(id, x, y);
+ // terrain[x].IsSolidBlocks[y]=true;
+ // terrain[x].SolidBlocks[y]=b;
+ // stay=false;
+ // }
+ // }
+ // if (stay) {
+ // Block b = TopBlockFromId(id, new Vector2(x, y));
+ // if (b!=null) {
+ // // if (terrain[x].IsTopBlocks[y]) GetItemsFromBlock(id, x, y);
+ // terrain[x].IsTopBlocks[y]=true;
+ // terrain[x].TopBlocks[y]=b;
+ // stay=false;
+ // }
+ // }
+ // if (stay) {
+ // Block b = BackBlockFromId(id, new Vector2(x, y));
+ // if (b!=null) {
+ // // if (terrain[x].IsBackground[y]) GetItemsFromBlock(id, x, y);
+ // terrain[x].IsBackground[y]=true;
+ // terrain[x].Background[y]=null;
+ // stay=false;
+ // }
+ // }
+
+ // if (stay) {
+ // Plant p = GetPlantFromId(id, (byte)y,/*?*/255, (short)x);
+ // if (p!=null) {
+ // foreach (Plant px in terrain[x].Plants) {
+ // if (px.Height==y) {
+ // //GetItemsFromPlant(id, new DInt(x, y), px.Grow==255);
+ // terrain[x].Plants.Remove(px);
+ // break;
+ // }
+ // }
+ // stay=false;
+ // terrain[x].Plants.Add(p);
+ // }
+ // }
+
+
+ // //if (stay) {
+ // // Block b=ani(id,new Vector2(x,y));
+ // // if (b!=null) {
+ // // foreach (Mob m in terrain[x].Mobs) {
+ // // if (m.Height==y) {
+ // // if (m.Id==id) {GetItemsFromBlock(id,new DInt(x,y));
+ // // terrain[x].Mobs.Remove(m);
+ // // stay=false;
+ // // break;
+ // // }
+ // // }
+ // // }
+ // //}
+ // } else {
+ // int x = int.Parse(strs[1]),
+ // y = int.Parse(strs[2]);
+ // if (terrain[x]==null) break;
+ // byte id = byte.Parse(strs[3]);
+ // bool stay = true;
+
+ // if (terrain[x].IsSolidBlocks[y]) {
+ // if (terrain[x].SolidBlocks[y].Id==id) {
+ // terrain[x].IsSolidBlocks[y]=false;
+ // terrain[x].SolidBlocks[y]=null;
+ // stay=false;
+ // }
+ // }
+ // if (stay) {
+ // if (terrain[x].IsTopBlocks[y]) {
+ // if (terrain[x].TopBlocks[y].Id==id) {
+ // terrain[x].IsTopBlocks[y]=false;
+ // terrain[x].TopBlocks[y]=null;
+ // stay=false;
+ // }
+ // }
+ // }
+ // if (stay) {
+ // if (terrain[x].IsBackground[y]) {
+ // if (terrain[x].Background[y].Id==id) {
+ // terrain[x].IsBackground[y]=false;
+ // terrain[x].Background[y]=null;
+ // stay=false;
+ // }
+ // }
+ // }
+
+ // if (stay) {
+ // foreach (Plant p in terrain[x].Plants) {
+ // if (p.Height==y) {
+ // if (p.Id==id) {
+ // terrain[x].Plants.Remove(p);
+ // stay=false;
+ // break;
+ // }
+ // }
+ // }
+ // }
+ // if (stay) {
+ // foreach (MMob m in terrain[x].Mobs) {
+ // if (m.Height==y) {
+ // if (m.Id==id) {
+ // terrain[x].Mobs.Remove(m);
+ // stay=false;
+ // break;
+ // }
+ // }
+ // }
+ // }
+ // }
+ // }
+ // }
+ }
+ break;
+
+ case Command.Login:
+ {
+ state++;
+ bool success = byteData[1]==1;
+
+ if (success) {
+ playerId = byteData[3] | (byteData[4]>>8) | (byteData[5]>>16) | (byteData[6]>>24);
+
+ //PlayerX = (byteData[7] | (byteData[8]>>8));
+ //PlayerY = byteData[9];
+
+ List bytesToSend = new List();
+ bytesToSend.Add((byte)Command.PlayerPosition);
+ // bytesToSend.Add((byte)LoginType.BasicLogin);
+ AddStringToByteList(bytesToSend, Setting.Name);
+
+ Queue.Add(new DataToSend {
+ Bytes = bytesToSend.ToArray(),
+ Importance = Importance.VeryImportant
+ });
+
+ SendMsgTerrain();
+ } else {
+ ShowError("Nelze se připjit", "Server odmítl hráče připojit");
+ }
+
+
+ //if (msgReceived.Message!=null) {
+
+ // string[] strs = msgReceived.Message.Split('|');
+ // if (strs.Length>0) {
+ // if (strs[0]=="0") {
+ // // Console.WriteLine("Wrong password!");
+ // System.Windows.Forms.MessageBox.Show("Špatné heslo", "Pro připojení k serveru je potřeba zadat správné heslo");
+ // // System.Windows.Forms.MessageBox.Show("Zadali jste špatné heslo","Špatné heslo");
+ // clientSocket.Disconnect(false);
+ // // Rabcr.GoTo(new MenuMultiplayer());
+ // } else if (strs[0]=="1") {
+ // //Console.WriteLine("Setting vars");
+
+ // TerrainLenght=int.Parse(strs[1]);
+ // terrain=new MTerrain[TerrainLenght];
+ // Console.WriteLine(TerrainLenght+" len");
+
+ // for (int c = 0; c bytesToSend = new List();
+ bytesToSend.Add((byte)Command.Login);
+ bytesToSend.Add((byte)LoginType.BasicLogin);
+ AddStringToByteList(bytesToSend, Setting.Name);
+
+ Queue.Add(new DataToSend {
+ Bytes = bytesToSend.ToArray(),
+ Importance = Importance.VeryImportant
+ });
+ // byteData = msg.ToByte();
+
+ //clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null);
+ }
+ break;
+
+ case LoginType.FirstConnect:
+ {
+ //Data msg = new Data {
+ // Cmd = Command.SetPassword,
+ // // From=Setting.Name,
+ // To = toServer,
+ // Message = ""
+ //};
+ List bytesToSend = new List();
+ bytesToSend.Add((byte)Command.Login);
+ bytesToSend.Add((byte)LoginType.FirstConnect);
+ AddStringToByteList(bytesToSend, Setting.Name);
+
+ Queue.Add(new DataToSend {
+ Bytes = bytesToSend.ToArray(),
+ Importance = Importance.VeryImportant
+ });
+ // byteData = msg.ToByte();
+
+ // clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null);
+ }
+ break;
+
+ }
+ // }
+
+
+
+ //if (strs.Length>0) {
+ // switch (strs[0]) {
+ // case "0":
+ // if (strs.Length==3) {
+ // ShowError("Zakázaný přístup", "Máte zakázaný přístup na server"+Environment.NewLine+strs[1]+Environment.NewLine+"zkuste tento web: "+strs[2]);
+ // } else ShowError("Chybná konfigurace", "Sáček k přihlašování neodpovídá sestavení");
+ // break;
+
+ // case "1":
+ // if (strs.Length==2) {
+ // ShowError("Zakázaný přístup", "Máte zakázaný přístup na server"+Environment.NewLine+strs[1]);
+ // } else ShowError("Chybná konfigurace", "Sáček k přihlašování neodpovídá sestavení");
+ // break;
+
+ // case "2":
+ // if (strs.Length==4) {
+ // int x = int.Parse(strs[0]);
+ // int y = int.Parse(strs[1]);
+ // string password = strs[2];
+ // int type = int.Parse(strs[3]);
+
+ // if (password!="") {
+ // chp=new CheckPassword();
+ // chp.Show();
+ // waitingPassword=true;
+ // this.password=password;
+ // }
+ // ShowError("Zakázaný přístup", "Máte zakázaný přístup na server"+Environment.NewLine+strs[1]);
+ // } else ShowError("Chybná konfigurace", "Sáček k přihlašování neodpovídá sestavení");
+ // break;
+
+ // case "3":
+ // if (strs.Length==2) {
+ // ShowError("Nejste v seznamu", "Kontaktujte majtele serveru a požádejteho o členství"+Environment.NewLine+strs[1]);
+ // } else ShowError("Chybná konfigurace", "Sáček k přihlašování neodpovídá sestavení");
+ // break;
+
+ // case "4":
+ // if (strs.Length==1) {
+ // ShowError("Nejste v seznamu", "Kontaktujte majtele serveru a požádejteho o členství");
+ // } else ShowError("Chybná konfigurace", "Sáček k přihlašování neodpovídá sestavení");
+ // break;
+
+ // case "5":
+
+ // break;
+ // }
+ //}
+
+ //int.TryParse(strs[1], out spawnX);
+ //int.TryParse(strs[2], out spawnY);
+ //int.TryParse(strs[3], out safeSpawn);
+
+ //PlayerX=spawnX;
+ //PlayerY=spawnY;
+
+ //SendMsgTerrain();
+ state++;
+ }
+ break;
+
+ //case Command.Logout:
+ // clientSocket.Disconnect(false);
+ // break;
+
+ case Command.PlayersTeleportMessageToSource:
+ {
+ //if (!string.IsNullOrEmpty(msgReceived.Message)) {
+ // string[] strs = msgReceived.Message.Split('|');
+
+ // if (int.TryParse(strs[0], out int num)) {
+ // if (num==1) {
+ // //DisplayText("Vaše žádost byla zamítnuta");
+ // }
+ // if (num==2) {
+ // if ((DateTime.Now-tpPlayerTime.Date).TotalMinutes<=2) {
+ // foreach (Player p in players) {
+ // if (tpPlayerMsgWaiting==p.name) {
+ // // DisplayText("Teleportuji...");
+ // text="Teleportuji...";
+ // PlayerX=p.x;
+ // PlayerY=p.y;
+ // break;
+ // }
+ // }
+ // }
+ // }
+ // if (num==3) {
+ // if (strs[1]==Setting.Name) {
+ // //SomeoneWantTeleportToYou=true;
+ // SomeoneWantTeleportToYouName=msgReceived.From;
+ // gedo.BuildString("Hráč "+SomeoneWantTeleportToYouName+" se chce k vám teleportovat.\r\nPoužij \"*tp-allow\" pro přijení nebo \"*tp-deny\" pro zamítnutí.");
+ // diserpeard=255;
+ // }
+ // }
+ // }
+ //}
+ }
+ break;
+
+ case Command.Message:
+ {
+ //if (msgReceived.Message!=null||msgReceived.Message!="") {
+ // if (msgReceived.Message.StartsWith("*")) {
+ // string[] word = msgReceived.Message.Split(' ');
+ // switch (word[0]) {
+ // case "*setplayerpos":
+ // if (word.Length==3) {
+ // PlayerX=int.Parse(word[1]);
+ // PlayerY=int.Parse(word[2]);
+ // DisplayText("Teleportuji...");
+ // SetPlayerPos(PlayerX, PlayerY);
+ // }
+ // break;
+
+ // case "*spawnwaschanged":
+ // spawnX=int.Parse(word[1]);
+ // spawnY=int.Parse(word[2]);
+ // break;
+
+ // case "*int-set": {
+ // int count = int.Parse(word[1]);
+
+ // List tmpInv = new List();
+
+ // //for (int i = 0; i tmpInv = new List();
+
+ // //for (int i = 0; i"+msgReceived.cmdCommand.ToString()+"<>"+msgReceived.strMessage);
+ ////} else Console.WriteLine("!jméno "+msgReceived.strName);
+ }
+ break;
+
+ //case Command.Request:
+ // {
+ // Data msg = new Data {
+ // Cmd=Command.Request,
+ // // From=Setting.Name,
+ // To=toServer,
+ // Message=""
+ // };
+ // //byteData=new byte[1024];
+ // //byteData=msg.ToByte();
+
+ // //clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null);
+ // Queue.Add(new DataToSend {
+ // Bytes=msg.ToByte(),
+ // Importance=Importance.VeryImportant
+ // });
+ // }
+ // break;
+
+ case Command.Check:
+ {
+ state++;
+ // Version
+ byte lenVersion = byteData[1];
+ string version=System.Text.Encoding.UTF8.GetString(byteData, 2, lenVersion);
+
+ if (version==Release.VersionString) {
+
+ // Message
+ int pos=3+lenVersion;
+ int lenMessage=byteData[pos];
+ string serverMessage=System.Text.Encoding.UTF8.GetString(byteData, pos, lenMessage);
+
+ pos+=lenMessage+1;
+ joinedPlayers=byteData[pos];
+ maxplayers=byteData[pos+1];
+
+ Debug.WriteLine("G|"+version+'|'+serverMessage+'|'+joinedPlayers+'|'+maxplayers);
+
+ // Ask server what I need to join server
+ List bytesToSend=new List();
+ bytesToSend.Add((byte)Command.GetStatus);
+
+ Queue.Add(new DataToSend {
+ Bytes=bytesToSend.ToArray(),
+ Importance=Importance.VeryImportant
+ });
+ //clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null);
+ } else ShowError("Jiná verze serveru", "Verze serveru ("+version+") je rozdílná od verze hry.");
+
+ // string[] get = msgReceived.Message.Split('|');
+
+ // if (get.Length > 0) {
+ // maxplayers = int.Parse(get[1]);
+ // joinedPlayers = int.Parse(get[2]);
+ // string version = get[3];
+ // //smd=true;
+ // if (version == Release.VersionString) {
+ // Data msg = new Data {
+ // Cmd = Command.Login,
+ // // From=Setting.Name,
+ // To = toServer,
+ // //Message=Setting.Name
+ // };
+ // //byteData=msg.ToByte();
+ // currentState = Current.EndChecking;
+ // SetMultiplayerLoadingText();
+ // //clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null);
+ // Queue.Add(new DataToSend {
+ // Bytes = msg.ToByte(),
+ // Importance = Importance.VeryImportant
+ // });
+ // } else {
+
+ // }
+ // } else {
+ // ShowError("Chyba sáčku", "Hra obdržela od serveru prázdný soubor s informacemi.");
+ // }
+ // Console.WriteLine(msgReceived.strMessage);
+ // string _new = msgReceived.strMessage;
+ // string version = _new.Substring(_new.LastIndexOf("|") + 1);
+ // _new = _new.Substring(0, _new.LastIndexOf("|"));
+ // int.TryParse(_new.Substring(_new.LastIndexOf("|") + 1), out maxplayers);
+ // _new = _new.Substring(0, _new.LastIndexOf("|"));
+ // int.TryParse(_new.Substring(_new.LastIndexOf("|") + 1), out joinedPlayers);
+ // _new = _new.Substring(0, _new.LastIndexOf("|"));
+ // Console.WriteLine("sdfgdfgfdf");
+ // if
+ // if (joinedPlayers < maxplayers) {
+ // // OK ////////////////////////////////////////
+
+
+
+ // }
+ // Console.WriteLine("Logining...");
+ // state++;
+
+ // } else {
+ // Error = true;
+ // ErrorCode = "Server je plný.";
+ // Console.WriteLine("Moc hráčů.");
+ // clientSocket.Disconnect(false);
+ // clientSocket.Close();
+ // clientSocket.Dispose();
+ // }
+ //} else {
+ // Error = true;
+ // ErrorCode = "Server je pro jinou verzi.";
+ // Console.WriteLine("Jiná verze.");
+ // clientSocket.Disconnect(false);
+ // clientSocket.Close();
+ // clientSocket.Dispose();
+ //}
+ }
+ break;
+
+ case Command.Exit:
+ //Queue.Add(new DataToSend {
+ // Bytes=new Data {
+ // // From=Setting.Name,
+ // To=toServer,
+ // Message="*beforeexitdata "+PlayerX+" "+PlayerY,//+inv...
+ // Cmd=Command.Message
+ // }.ToByte(),
+ // Importance=Importance.VeryImportant
+ //});
+ //closingServer=true;
+ break;
+
+ case Command.PlayersList: {
+ //players.Clear();
+ //foreach (string h in msgReceived.Message.Split('~')) {
+ // if (h!="") {
+ // string[] splited = h.Split('|');
+
+ // Player player = new Player(splited[0]) {
+ // x=int.Parse(splited[1]),
+ // y=int.Parse(splited[2])
+ // };
+ // players.Add(player);
+ // }
+ //}
+
+ //if (currentState==Current.GettingPlayers) {
+ // currentState=Current.Playing;
+ // SetMultiplayerLoadingText();
+ // //Resize();
+ //}
+ }
+ break;
+ }
+
+ if (Queue.Count == 0) {
+ // if (cmd==Command.Blank)
+ // System.Threading.Thread.Sleep(10);
+ // else System.Threading.Thread.Sleep(5);
+ //Data data = new Data {
+ // // From=Setting.Name,
+ // To = toServer,
+ // Cmd = Command.Blank
+ //};
+ ListbytesToSend=new List();
+ bytesToSend.Add((byte)Command.Blank);
+ try {
+ byte[] bytes = bytesToSend.ToArray();
+ clientSocket.BeginSend(bytes, 0, bytes.Length, SocketFlags.None, new AsyncCallback(OnSend), null);
+ } catch (Exception ex) { Console.WriteLine(ex.Message + "1"); }
+ } else {
+ try {
+ byte[] bytes = Queue[0].Bytes;
+ Console.WriteLine("SEND: "+((Command)Queue[0].Bytes[0]).ToString());
+ Queue.RemoveAt(0);
+ clientSocket.BeginSend(bytes, 0, bytes.Length, SocketFlags.None, new AsyncCallback(OnSend), null);
+ } catch (Exception ex) { Console.WriteLine(ex.Message + "2"); }
+ }
+
+
+
+ ////////if (!closingServer){
+ //////// byteData=new byte[1024];
+
+ //////// try {
+ //////// clientSocket.BeginReceive(byteData,
+ //////// 0,
+ //////// byteData.Length,
+ //////// SocketFlags.None,
+ //////// new AsyncCallback(OnReceive),
+ //////// clientSocket);
+ //////// } catch (Exception ex) {
+ //////// if (ex.HResult==10054) {
+ //////// ShowError("Spojení bylo přerušeno", ex.Message);
+ //////// clientSocket.Shutdown(new SocketShutdown());
+ //////// clientSocket.Close();
+ //////// clientSocket.Dispose();
+ //////// return;
+ //////// }else{
+ //////// Console.WriteLine(ex.Message+"12");
+ //////// }
+ //////// }
+ ////////} else {
+ //////// clientSocket.Shutdown(new SocketShutdown());
+ //////// current=Current.Checking;
+ //////// clientSocket.Disconnect(false);
+ //////// clientSocket.Close();
+ //////// // clientSocket.Dispose();
+ //////// ShowError("Server byl ukončen","Server se vypnul ze strany serveru");
+ //////// // Rabcr.GoTo(new Menu());
+ ////////}
+ //if (msgReceived.strMessage != null && msgReceived.cmdCommand != Command.List) {
+ // chat += msgReceived.strMessage + "\r\n";
+ // Console.WriteLine("G " + msgReceived.strMessage);
+ // foreach (Player p in players) {//Console.WriteLine(0);
+ // if (p.name == msgReceived.strName) {//Console.WriteLine(1);
+ // string data = msgReceived.strMessage.Replace(msgReceived.strName + ": ", "");
+ // if (data.StartsWith("X")) {//Console.WriteLine(2);
+
+ // //for (int i=0; i bytesToSend=new List();
+ bytesToSend.Add((byte)Command.ConnectDuringGame);
+ AddStringToByteList(bytesToSend,Setting.Name);
+
+ byteData=bytesToSend.ToArray();
+ clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSend), null);
+
+ byteData=new byte[1024];
+ clientSocket.BeginReceive(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnReceive), null);
+
+ //current=Current.EndChecking;
+ state++;
+ } catch (SocketException ex) {
+
+ //Nemohlo být vytvořeno žádné připojení, protože cílový počítač je aktivně odmítl
+ if (10061==ex.ErrorCode) {
+ ShowError("Nelze se připojit k serveru", "Pravděpodobně není spuštěn server.");
+ } else {
+ //Pokus o připojení selhal, protože připojená strana v časovém intervalu řádně neodpověděla, nebo vytvořené připojení selhalo, protože neodpověděl připojený hostitel
+ if (10060==ex.ErrorCode) {
+ ShowError("Nelze se připojit k serveru", "Připojování trvalo příliš dlouho.");
+ } else {
+ ShowError("Nelze se připojit k serveru", "Neznámá chyba v OnConnectDuringGameError: "+ex.Message);
+ }
+ }
+ }
+ }
+
+ void OnSend(IAsyncResult ar) {
+ try {
+ // clientSocket.Connected
+ //Process=0.55f;
+ clientSocket.EndSend(ar);
+ //Process=1f;
+ //ready=true;
+ //Loading=false;
+ } catch (SocketException ex) {
+ //Console.WriteLine(ex.ErrorCode+" 2 "+ex.Message);
+ ////Process=1f;
+ //ready=true;
+ //Error=true;
+ //ErrorCode=ex.Message;
+ if (!exit) ShowError("Nelze odeslat sáček", ""+ex.Message);
+ }
+ //Console.WriteLine(byteData);
+ // Console.WriteLine("send");
+ }
+
+ void SendEveryone(string text) {
+ try {
+ //Fill the info for the message to be send
+ //Data msgToSend = new Data {
+ // //Console.WriteLine(text);
+ // // From=Setting.Name,
+ // To=toEveryone,
+ // Message=text,
+ // Cmd=Command.Message
+ //};
+
+ ////byte[] byteData =
+ //Queue.Add(new DataToSend {
+ // Bytes=msgToSend.ToByte(),
+ // Importance=Importance.High
+ //});
+ //Send it to the server
+ //clientSocket.BeginSend(byteData, 0, byteData.Length, SocketFlags.None, new AsyncCallback(OnSendAfter), null);
+ // Console.WriteLine("sending: "+System.Text.Encoding.UTF8.GetString(byteData));
+ // txtMessage.Text = null;
+ } catch (Exception) {
+ //Console.WriteLine("Unable to send message to the server.");
+ }
+ }
+
+ void ShowError(string main, string toShow) {
+ Error=true;
+ ErrorHeader=main;
+ ErrorText=toShow;
+ currentState=Current.ErrorDuringGame;
+ textHeader=new TextWithMeasure(ErrorHeader,0,0);
+ textMore=new TextWithMeasure(ErrorText,0,0);
+
+ textHeader.ChangePosition(Global.WindowWidthHalf-textHeader.MeasureX/2, Global.WindowHeightHalf-30/2);
+ textMore.ChangePosition(Global.WindowWidthHalf-textMore.MeasureX/2, Global.WindowHeightHalf+30/2);
+ }
+
+ void SetMultiplayerLoadingText(){
+ switch (currentState) {
+ case Current.Checking:
+ textHeader=new TextWithMeasure("Připojování...",0,0);
+ // textHeader.Draw(spriteFont_big, (int)((Global.WindowWidth-spriteFont_big.MeasureString().X)/2), Global.WindowHeightHalf-50, "Připojování...", Color.Black);
+ break;
+
+ case Current.EndChecking:
+ textHeader=new TextWithMeasure("Přihlašování...",0,0);
+ // textHeader.Draw(spriteFont_big, (int)((Global.WindowWidth-spriteFont_big.MeasureString().X)/2), Global.WindowHeightHalf-50, "Připojování...", Color.Black);
+ break;
+
+ case Current.EndLoging:
+ textHeader=new TextWithMeasure("Přihlašování...",0,0);
+ // textHeader.Draw(spriteFont_big, (int)((Global.WindowWidth-spriteFont_big.MeasureString().X)/2), Global.WindowHeightHalf-50, "Připojování...", Color.Black);
+ break;
+
+ case Current.Loging:
+ textHeader=new TextWithMeasure("Přihlašování...",0,0);
+ // textHeader.Draw(spriteFont_big, (int)((Global.WindowWidth-spriteFont_big.MeasureString().X)/2), Global.WindowHeightHalf-50, "Připojování...", Color.Black);
+ break;
+
+ case Current.SendingBasic:
+ textHeader=new TextWithMeasure("Přihlašování...",0,0);
+ // textHeader.Draw(spriteFont_big, (int)((Global.WindowWidth-spriteFont_big.MeasureString().X)/2), Global.WindowHeightHalf-50, "Připojování...", Color.Black);
+ break;
+
+ case Current.GettingSpawn:
+ textHeader=new TextWithMeasure("Získávání terénu",0,0);
+ // textHeader.Draw(spriteFont_big, (int)((Global.WindowWidth-spriteFont_big.MeasureString().X)/2), Global.WindowHeightHalf-50, "Získávání terénu", Color.Black);
+ break;
+
+ case Current.GettingPlayers:
+ textHeader=new TextWithMeasure("Informace o hráčích",0,0);
+ // textHeader.Draw(spriteFont_big, (int)((Global.WindowWidth-spriteFont_big.MeasureString().X)/2), Global.WindowHeightHalf-50, "Načítání herních komponent", Color.Black);
+ break;
+
+ case Current.LoadingAssets:
+ textHeader=new TextWithMeasure("Herních komponent",0,0);
+ // textHeader.Draw(spriteFont_big, (int)((Global.WindowWidth-spriteFont_big.MeasureString().X)/2), Global.WindowHeightHalf-50, "Načítání herních komponent", Color.Black);
+ break;
+ }
+ textHeader.ChangePosition(Global.WindowWidthHalf-textHeader.MeasureX/2, Global.WindowHeightHalf-30/2);
+ //}
+ // textHeader=new TextWithMeasure(,0,0);//.Draw(spriteFont_big, (int)((Global.WindowWidth-spriteFont_big.MeasureString("Připojování...").X)/2), Global.WindowHeightHalf-50, "Připojování...", Color.Black);
+ }
+
+ }
+}
diff --git a/rabcrClient/InterLogic/Game/Terrain/Terrain.cs b/rabcrClient/InterLogic/Game/Terrain/Terrain.cs
index 0741000..a0c3f82 100644
--- a/rabcrClient/InterLogic/Game/Terrain/Terrain.cs
+++ b/rabcrClient/InterLogic/Game/Terrain/Terrain.cs
@@ -3,14 +3,13 @@
namespace rabcrClient {
public class Terrain {
- public int
+ public int
// Total (With half)
LightPosFull,
LightPosFull16,
LightPosHalf,
- LightPosHalf16;
-
- public int StartSomething;
+ LightPosHalf16,
+ StartSomething;
public Block[]
Background=new Block[125],
@@ -22,26 +21,26 @@ public int
IsSolidBlocks=new bool[125],
IsTopBlocks=new bool[125];
- public List Mobs=new List();
- public List Plants=new List();
+ public List Mobs=new();
+ public List Plants=new();
public Vector2 LightVec;
///