From b227504537359dcf169203145f3a9f2117682931 Mon Sep 17 00:00:00 2001 From: paulevsGitch Date: Fri, 4 Dec 2020 18:54:02 +0300 Subject: [PATCH 01/11] Fixes --- .../world/features/terrain/SulphuricCaveFeature.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/ru/betterend/world/features/terrain/SulphuricCaveFeature.java b/src/main/java/ru/betterend/world/features/terrain/SulphuricCaveFeature.java index c08cb175..2a5732c3 100644 --- a/src/main/java/ru/betterend/world/features/terrain/SulphuricCaveFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/SulphuricCaveFeature.java @@ -54,6 +54,7 @@ public class SulphuricCaveFeature extends DefaultFeature { double hr = radius * 0.75; double nr = radius * 0.25; + BlockState state; Set brimstone = Sets.newHashSet(); BlockState rock = EndBlocks.SULPHURIC_ROCK.stone.getDefaultState(); int waterLevel = pos.getY() + MHelper.randRange(MHelper.floor(radius * 0.8), radius, random); @@ -74,13 +75,14 @@ public class SulphuricCaveFeature extends DefaultFeature { double r2 = r + 5; double dist = xsq + ysq + zsq; if (dist < r * r) { - BlockState state = world.getBlockState(mut); + state = world.getBlockState(mut); if (isReplaceable(state)) { BlocksHelper.setWithoutUpdate(world, mut, y < waterLevel ? WATER : CAVE_AIR); } } else if (dist < r2 * r2) { - if (world.getBlockState(mut).isIn(EndTags.GEN_TERRAIN)) { + state = world.getBlockState(mut); + if (state.isIn(EndTags.GEN_TERRAIN) || state.isOf(Blocks.AIR)) { double v = noise.eval(x * 0.1, y * 0.1, z * 0.1) + noise.eval(x * 0.03, y * 0.03, z * 0.03) * 0.5; if (v > 0.4) { brimstone.add(mut.toImmutable()); @@ -102,12 +104,12 @@ public class SulphuricCaveFeature extends DefaultFeature { for (int i = 0; i < count; i++) { mut.set(pos).move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 0, MHelper.floor(random.nextGaussian() * 2 + 0.5)); int dist = MHelper.floor(6 - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ())) + random.nextInt(2); - BlockState state = world.getBlockState(mut); + state = world.getBlockState(mut); while (state.isOf(Blocks.WATER)) { mut.setY(mut.getY() - 1); state = world.getBlockState(mut); } - if (state.isIn(EndTags.GEN_TERRAIN) || state.isOf(Blocks.AIR)) { + if (state.isIn(EndTags.GEN_TERRAIN)) { for (int j = 0; j <= dist; j++) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone); mut.setY(mut.getY() + 1); From d647c3f015228d42d29cf168ba99e02d65a67841 Mon Sep 17 00:00:00 2001 From: paulevsGitch Date: Fri, 4 Dec 2020 19:09:25 +0300 Subject: [PATCH 02/11] Fixes --- .../terrain/SulphuricCaveFeature.java | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/main/java/ru/betterend/world/features/terrain/SulphuricCaveFeature.java b/src/main/java/ru/betterend/world/features/terrain/SulphuricCaveFeature.java index 2a5732c3..8880120a 100644 --- a/src/main/java/ru/betterend/world/features/terrain/SulphuricCaveFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/SulphuricCaveFeature.java @@ -103,25 +103,27 @@ public class SulphuricCaveFeature extends DefaultFeature { int count = MHelper.randRange(5, 20, random); for (int i = 0; i < count; i++) { mut.set(pos).move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 0, MHelper.floor(random.nextGaussian() * 2 + 0.5)); - int dist = MHelper.floor(6 - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ())) + random.nextInt(2); - state = world.getBlockState(mut); - while (state.isOf(Blocks.WATER)) { - mut.setY(mut.getY() - 1); - state = world.getBlockState(mut); - } - if (state.isIn(EndTags.GEN_TERRAIN)) { - for (int j = 0; j <= dist; j++) { - BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone); - mut.setY(mut.getY() + 1); - } - BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.HYDROTHERMAL_VENT); - mut.setY(mut.getY() + 1); + int dist = MHelper.floor(3 - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ())) + random.nextInt(2); + if (dist > 0) { state = world.getBlockState(mut); while (state.isOf(Blocks.WATER)) { - BlocksHelper.setWithoutUpdate(world, mut, Blocks.BUBBLE_COLUMN.getDefaultState().with(BubbleColumnBlock.DRAG, false)); - world.getBlockTickScheduler().schedule(mut, Blocks.BUBBLE_COLUMN, MHelper.randRange(8, 32, random)); + mut.setY(mut.getY() - 1); + state = world.getBlockState(mut); + } + if (state.isIn(EndTags.GEN_TERRAIN)) { + for (int j = 0; j <= dist; j++) { + BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone); + mut.setY(mut.getY() + 1); + } + BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.HYDROTHERMAL_VENT); mut.setY(mut.getY() + 1); state = world.getBlockState(mut); + while (state.isOf(Blocks.WATER)) { + BlocksHelper.setWithoutUpdate(world, mut, Blocks.BUBBLE_COLUMN.getDefaultState().with(BubbleColumnBlock.DRAG, false)); + world.getBlockTickScheduler().schedule(mut, Blocks.BUBBLE_COLUMN, MHelper.randRange(8, 32, random)); + mut.setY(mut.getY() + 1); + state = world.getBlockState(mut); + } } } } From fa3f8afed46e1f4528a4466f8cd910fcfb5bf716 Mon Sep 17 00:00:00 2001 From: paulevsGitch Date: Fri, 4 Dec 2020 20:33:27 +0300 Subject: [PATCH 03/11] Hydralux textures --- .../textures/block/hydralux_bloom_bottom.png | Bin 0 -> 309 bytes .../textures/block/hydralux_bloom_side.png | Bin 0 -> 268 bytes .../textures/block/hydralux_bloom_top.png | Bin 0 -> 348 bytes .../textures/block/hydralux_flower_bottom.png | Bin 0 -> 1850 bytes .../textures/block/hydralux_flower_bud.png | Bin 0 -> 1891 bytes .../block/hydralux_flower_bud_petal_bottom.png | Bin 0 -> 314 bytes .../block/hydralux_flower_bud_petal_side.png | Bin 0 -> 284 bytes .../block/hydralux_flower_bud_petal_top.png | Bin 0 -> 326 bytes .../textures/block/hydralux_flower_petal.png | Bin 0 -> 387 bytes .../textures/block/hydralux_sapling.png | Bin 0 -> 250 bytes .../betterend/textures/block/hydralux_vine.png | Bin 0 -> 414 bytes .../betterend/textures/item/hydralux_spore.png | Bin 0 -> 417 bytes 12 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/main/resources/assets/betterend/textures/block/hydralux_bloom_bottom.png create mode 100644 src/main/resources/assets/betterend/textures/block/hydralux_bloom_side.png create mode 100644 src/main/resources/assets/betterend/textures/block/hydralux_bloom_top.png create mode 100644 src/main/resources/assets/betterend/textures/block/hydralux_flower_bottom.png create mode 100644 src/main/resources/assets/betterend/textures/block/hydralux_flower_bud.png create mode 100644 src/main/resources/assets/betterend/textures/block/hydralux_flower_bud_petal_bottom.png create mode 100644 src/main/resources/assets/betterend/textures/block/hydralux_flower_bud_petal_side.png create mode 100644 src/main/resources/assets/betterend/textures/block/hydralux_flower_bud_petal_top.png create mode 100644 src/main/resources/assets/betterend/textures/block/hydralux_flower_petal.png create mode 100644 src/main/resources/assets/betterend/textures/block/hydralux_sapling.png create mode 100644 src/main/resources/assets/betterend/textures/block/hydralux_vine.png create mode 100644 src/main/resources/assets/betterend/textures/item/hydralux_spore.png diff --git a/src/main/resources/assets/betterend/textures/block/hydralux_bloom_bottom.png b/src/main/resources/assets/betterend/textures/block/hydralux_bloom_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..ca9df9d337792df3454209b3f70952092093aa21 GIT binary patch literal 309 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!Bd_tjv*HQS0``eI^@997QDTw%VNiiXOFb@ zHP3$k=E*BHzFk+3Ivx>|@!!8~|DCN_2mR^_VrF^k)jR1Ior{#Vdiu|Jtv*Lo#5yrO z@Auc<9)0${!B*nvG#UMEk?$AX`Kc1HAc3h??eatIon8fup&V?gFQqNge_j!ZIluHt zUEsvl-ucBVMYbvmIUK61*0P;;dqrl*f`&I@VS>F}e;RJq%z3Y{J4)7$Pf%24(-M!| zA6G;;+T7lsTqv>R$1SGq!fQHzKdAmL|L1SAQ8femjG`lz@r~brzGCon^>bP0l+XkK D3F3VP literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/betterend/textures/block/hydralux_bloom_side.png b/src/main/resources/assets/betterend/textures/block/hydralux_bloom_side.png new file mode 100644 index 0000000000000000000000000000000000000000..d66a4c18ce2284f358ee4db655bfb9f4ef22e2f8 GIT binary patch literal 268 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!G)eKjv*HQ$$$R;w`W#u;Pjfz%XW`pih;&! zj(`6jeDh|Lv-4ZQ!F+hS|9wf3kfR54CdhQ$4c$0RP=|pBvwIgYevx=m|l6k&Gw*LqRm=!u#XGb0B> zhS|LFcFsJ9Sq=6uTx#%9X3j~9U=~bM?r|$)-IeY3nTeU1!R~6tp7sr0r-6=T@O1Ta JS?83{1OQM;Rwn=e literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/betterend/textures/block/hydralux_bloom_top.png b/src/main/resources/assets/betterend/textures/block/hydralux_bloom_top.png new file mode 100644 index 0000000000000000000000000000000000000000..746e2d45b56be846f9366132b868aab40c433878 GIT binary patch literal 348 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!H=FUjv*HQSA%zR9dZ!3v-#o=k0zH~9i2Z6 z2QS?_w|?v9?ILSjFC20*?C5;|>Wt3K2daw_wAiQ3_5PNYZtjw~R+FEr@So&P)*ivO z#dh*{mbq5Qy?Ot{#LJWIfcoQ^kDOT!H;RPjc4zs`v@F^k?ay-AfF&TM+Vz$W|C6mb zVlHki|C;A2#wBtrI8mm3MY<$o>y4uFdU2z6ZVT^vQ)h;|tUGGB*2z35V4NqX{Fvd} z#gDQID%CPXNl8xN)U@^0TP27#v8*UBfmuHLpdcp8Y!nrG@kzw2auf}c{cC49l r>G_9c4_T%w$?ZSa_u;#}@I~Q;-A&TB`Wzd8o@elM^>bP0l+XkKQhbVZ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/betterend/textures/block/hydralux_flower_bottom.png b/src/main/resources/assets/betterend/textures/block/hydralux_flower_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..dbd33c141905f81619601181e784a5844f4b3256 GIT binary patch literal 1850 zcmbVNTWs4@7#HI9MAedAkCe%@F66~Rqc%r-_Cb3CC0fpn-Xi+yRA~`;` zzw>?HfAQ~=g9DFmZP?jB5X9F0zVHw}Z*!0OI{e>yGY|0TZnN)*O%P3&+@tEPy-m9a zqV`)Y8gpWiCuL})JwP=S}9<&%NC&#L)GFF z8$o%$>T=&8sZODiRa|qFUY`HsF|BTz7x5&s76r zj(=2DCW z(0)$fXi?-5?GHdCB5y#H0;1c{g&vXnG#giMqV$R!LdQz0ltvcXLI%)n_aFt`IwKrU z@wT=>J~pLX+Mh`xOnQgn7iDZC?qq<4dJ;Hyo9Qp+cK&TJerNZat7g&GM()@3gYHe(Fc6s6L zmXGi8?0%lO@W#t$?$v)hb@Skt$5Y_M_PSgyH*$slX8)dnW%hKOof{@SjWewmuO=^_ zJ-Ncn-ZxkE!HIgib8$HKP}chO!RzL9-Dj)!|8?f6mg)BA2D?|j%K>6OKKtPuOT4r+ nl_dG?x2kuv=eImCP46Hk-@8D)OI-Qh{krw{4un72KQjF{akyJ{ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/betterend/textures/block/hydralux_flower_bud.png b/src/main/resources/assets/betterend/textures/block/hydralux_flower_bud.png new file mode 100644 index 0000000000000000000000000000000000000000..938ba1230a396e0c80c6229c6677f300f940279a GIT binary patch literal 1891 zcmbVNeM}o=9KOOpm<%>Q2{Y_+sM{RZ`)+&3D%2K*Xpun8Sh6g#yQvOkQv1e0x%4c{xJf?<=`QRvR341~t8osAg-$UV@;qcE;&e&Ubp6oIRXpV%dY>97%m z3AJUwgq;Iz5qY3T78RoLaeQY+LIf#j13Z&TYL=Ao6FFW9t)1Hxf#)E0kDmxQf_PWB z9S`az#09s9lo_7Iy`r1(&?3v%<1Ed1DcVah97!`0?U6VU&;JOdW-2kMBlKim3tjn% zgl!uVMWxeecbaqSW}IR~QKV>=Vp$R)NULA7L59?{eUfWL~ zr;8z^i~_A@<cxkDF;;K0?z0)lR0rkreG4Lpk`YL%M`FiLbr7*q2GqO z@OXs)N^Lk?&{)+=DpioM?B+fcMm`~{qOC~30jUmX>Aj{5oBNQ>Iwu-K3Yrkux*5^+ zwhzHOJPDSF!4zHAQ+0UP=WmS$;^VM&^gu(ZSo62tGHIf1GO`nAH@BL(0(N1YXFb6x5TtiG-0mF6SZ~mRdE- z2AT|8Lw*81CAMcx6}@U8xt!H;r65M&VWU2e z2ao~~eWXX^At?d?NY1A~z{FS@aPR0~zFKmUq!!hQKwQpIy^ApzNGcRwLJ zb%qL&zpbv4k2NXh_oovOk=~*Bi|Uphv(vzYfjG+DTKbE+oqr4T-P!%xs<~)uHTNs} z@qfC{Cr3^IEe_EHr3fb;%9%BbrJ?>^wcN91b7={VhMlu4Oj&eMnA1>0)Fzt3C*xn8 z!!VbxH57>WPRWy#XXmM-^|Mzm{oYVoySMEiH9o}+UB|I|8v4%H)D_o$UesA}v}D$I z;V@oY?s~K8z0ZR8&Fvdbt;??aqV&*#J;Cp=QDXGq<}2gVC4uDV(=VE?AI^oeLZOW^~f79 zdn-b-H>#VeOMm`!e&j?fm_GHw*on^0 z2jBTvJ5xKc_kn1#L_I@)RQh362kF z(ZMgwb5VGYm{T;xctb?GNq5nI-b~*Gcvy{yFTg$fn3F!hFDt z@$A1(FRc$xwtg>Rx91n%F$FUZo^@=T3B1e`)C7Kf`e`lE%;3W#yFh~Blkyq08Eyg% z8y$-_6f`h)B{M4XRQ#|wm?Ia*!OLV|=FzvpKtRA*g6T4kurs?vA_J4c?39p}1G5|? zjm z%B#;Esf{&>2pJ8kQnMF;k)u-@>UY25aR#q43F{9?_YNgiA`o>(TYxXnE8 z^gD+h%`-P8x`Zbbylz*yczMbq2Ki%EA550!@i)BBvaOgE^qs4cY2)(9SKk|+Z<4cl c+kAqXvAsBcgTt|bP0l+XkKsrY`; literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/betterend/textures/block/hydralux_flower_petal.png b/src/main/resources/assets/betterend/textures/block/hydralux_flower_petal.png new file mode 100644 index 0000000000000000000000000000000000000000..52c056e24c0e378b8e722902c8a4f5e9068933ed GIT binary patch literal 387 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc4HBL%jv*HQxs!ME9x@PUlNDoVIkecpDTKpp zK@uxlL!?BbRqOk0!qyqj?gq3tevo-+%d{&vvE)77^xL(`@^H{JMr z`*&csd|$JP-D{7I@7kfpU5YP?A96g%e)3KJqH1}vJa@%=2G(zBMTyBA1>H5q`p?{1 z+8Asn-<{h%brr8{s>FS>xJ9>ey1!I~zkabHw0P~+K&2nWk1xmZ9iO~sV=;S(k3NII fVbQ1mI6ksIHRxQJtFE;L7;p@pu6{1-oD!M<6M32# literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/betterend/textures/block/hydralux_sapling.png b/src/main/resources/assets/betterend/textures/block/hydralux_sapling.png new file mode 100644 index 0000000000000000000000000000000000000000..560562628a45505f7f636099dbfee7ae6a0103f0 GIT binary patch literal 250 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!G2E{#}EtuWC>PfrZcb4{op?opqI(8Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0W(QNK~y+Tm6I_` z13?gl$7pkq1c_oW1_>mJc4{XntnB{^Kkr3q)Ig8`Ydy^fR%Z#8O zEW7O9dpk2bw?c~Zi<7+FYtTGSXf&A8?ac$9%l_zjO4nC+B~2yFB|3XeYIhrSdUlvY zyuKBM6U%CtneP7fWo3;hO*3lkZcvtIG6nYsvW4d%0i#UF184~TVL!e@*z;EER?@~wpt@`ef0@J!qYAbz}m`3YA{2K7zVxT9M-+uwoHxMVib$}z$SO5S307*qo IM6N<$fPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0X9iQK~y+TV;FG2 z2&Hj?rZkuTP$om&tUVa&S)epl0MhId6%XYxFx$hSC@SrddYGh=Gyi zKLZCh4}*@mA;aH$HybWIeBB6D#=r!n;UK|I>puv~sH%YZpFckX(;r{IVBi;(0JD(+ ziUA;7OQ%m{NNcKOcyjv=R1~5a7l3;Kq&YahoPn2D3hZQQWfg`!%NBy^myhl;eEs;I z;lS$U4E^g)qJ#lTAi`_{(I8DA(7$K~nAT Date: Fri, 4 Dec 2020 21:24:24 +0300 Subject: [PATCH 04/11] Hydralux blocks --- .../ru/betterend/blocks/BlockHydralux.java | 41 +++++++ .../betterend/blocks/BlockHydraluxSpore.java | 44 ++++++++ .../ru/betterend/blocks/BlockProperties.java | 32 ++++++ .../java/ru/betterend/registry/EndBlocks.java | 5 + .../betterend/blockstates/hydralux.json | 14 +++ .../betterend/blockstates/hydralux_spore.json | 8 ++ .../block/hydralux_flower_big_1_bottom.json | 105 ++++++++++++++++++ .../block/hydralux_flower_big_2_bottom.json | 102 +++++++++++++++++ .../block/hydralux_flower_big_3_bottom.json | 105 ++++++++++++++++++ .../models/block/hydralux_flower_big_top.json | 43 +++++++ .../block/hydralux_flower_small_bottom.json | 58 ++++++++++ .../block/hydralux_flower_small_top.json | 23 ++++ .../models/block/hydralux_roots.json | 76 +++++++++++++ .../models/block/hydralux_spore.json | 6 + .../betterend/models/block/hydralux_vine.json | 6 + .../textures/block/hydralux_roots.png | Bin 0 -> 2071 bytes ...ydralux_sapling.png => hydralux_spore.png} | Bin 17 files changed, 668 insertions(+) create mode 100644 src/main/java/ru/betterend/blocks/BlockHydralux.java create mode 100644 src/main/java/ru/betterend/blocks/BlockHydraluxSpore.java create mode 100644 src/main/resources/assets/betterend/blockstates/hydralux.json create mode 100644 src/main/resources/assets/betterend/blockstates/hydralux_spore.json create mode 100644 src/main/resources/assets/betterend/models/block/hydralux_flower_big_1_bottom.json create mode 100644 src/main/resources/assets/betterend/models/block/hydralux_flower_big_2_bottom.json create mode 100644 src/main/resources/assets/betterend/models/block/hydralux_flower_big_3_bottom.json create mode 100644 src/main/resources/assets/betterend/models/block/hydralux_flower_big_top.json create mode 100644 src/main/resources/assets/betterend/models/block/hydralux_flower_small_bottom.json create mode 100644 src/main/resources/assets/betterend/models/block/hydralux_flower_small_top.json create mode 100644 src/main/resources/assets/betterend/models/block/hydralux_roots.json create mode 100644 src/main/resources/assets/betterend/models/block/hydralux_spore.json create mode 100644 src/main/resources/assets/betterend/models/block/hydralux_vine.json create mode 100644 src/main/resources/assets/betterend/textures/block/hydralux_roots.png rename src/main/resources/assets/betterend/textures/block/{hydralux_sapling.png => hydralux_spore.png} (100%) diff --git a/src/main/java/ru/betterend/blocks/BlockHydralux.java b/src/main/java/ru/betterend/blocks/BlockHydralux.java new file mode 100644 index 00000000..c2dc49b4 --- /dev/null +++ b/src/main/java/ru/betterend/blocks/BlockHydralux.java @@ -0,0 +1,41 @@ +package ru.betterend.blocks; + +import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; +import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags; +import net.minecraft.block.BlockState; +import net.minecraft.block.Material; +import net.minecraft.sound.BlockSoundGroup; +import net.minecraft.state.property.EnumProperty; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.WorldView; +import ru.betterend.blocks.BlockProperties.HydraluxShape; +import ru.betterend.blocks.basis.BlockUnderwaterPlant; +import ru.betterend.registry.EndBlocks; + +public class BlockHydralux extends BlockUnderwaterPlant { + public static final EnumProperty SHAPE = BlockProperties.HYDRALUX_SHAPE; + + public BlockHydralux() { + super(FabricBlockSettings.of(Material.UNDERWATER_PLANT) + .breakByTool(FabricToolTags.SHEARS) + .sounds(BlockSoundGroup.WET_GRASS) + .breakByHand(true) + .luminance((state) -> { return state.get(SHAPE).hasGlow() ? 15 : 0; }) + .noCollision()); + } + + @Override + public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) { + BlockState down = world.getBlockState(pos.down()); + HydraluxShape shape = state.get(SHAPE); + if (shape == HydraluxShape.FLOWER_BIG_TOP || shape == HydraluxShape.FLOWER_SMALL_TOP) { + return down.isOf(this); + } + else if (shape == HydraluxShape.ROOTS) { + return down.isOf(EndBlocks.SULPHURIC_ROCK.stone) && world.getBlockState(pos.up()).isOf(this); + } + else { + return down.isOf(this) && world.getBlockState(pos.up()).isOf(this); + } + } +} diff --git a/src/main/java/ru/betterend/blocks/BlockHydraluxSpore.java b/src/main/java/ru/betterend/blocks/BlockHydraluxSpore.java new file mode 100644 index 00000000..c821a0a0 --- /dev/null +++ b/src/main/java/ru/betterend/blocks/BlockHydraluxSpore.java @@ -0,0 +1,44 @@ +package ru.betterend.blocks; + +import java.util.Random; + +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.BlockPos.Mutable; +import net.minecraft.world.StructureWorldAccess; +import ru.betterend.blocks.BlockProperties.HydraluxShape; +import ru.betterend.blocks.basis.BlockUnderwaterPlantWithAge; +import ru.betterend.registry.EndBlocks; +import ru.betterend.util.BlocksHelper; +import ru.betterend.util.MHelper; + +public class BlockHydraluxSpore extends BlockUnderwaterPlantWithAge { + @Override + public void grow(StructureWorldAccess world, Random random, BlockPos pos) { + int h = MHelper.randRange(4, 8, random); + Mutable mut = new Mutable().set(pos); + + for (int i = 1; i < h; i++) { + mut.setY(pos.getY() + i); + if (!world.getBlockState(mut).isOf(Blocks.WATER)) { + return; + } + } + + mut.setY(pos.getY()); + BlockState state = EndBlocks.HYDRALUX.getDefaultState(); + BlocksHelper.setWithoutUpdate(world, pos, state.with(BlockProperties.HYDRALUX_SHAPE, HydraluxShape.ROOTS)); + for (int i = 1; i < h - 2; i++) { + mut.setY(pos.getY() + i); + BlocksHelper.setWithoutUpdate(world, pos, state.with(BlockProperties.HYDRALUX_SHAPE, HydraluxShape.VINE)); + } + + mut.setY(mut.getY() + 1); + boolean big = random.nextBoolean(); + BlocksHelper.setWithoutUpdate(world, pos, state.with(BlockProperties.HYDRALUX_SHAPE, big ? HydraluxShape.FLOWER_BIG_BOTTOM : HydraluxShape.FLOWER_SMALL_BOTTOM)); + + mut.setY(mut.getY() + 1); + BlocksHelper.setWithoutUpdate(world, pos, state.with(BlockProperties.HYDRALUX_SHAPE, big ? HydraluxShape.FLOWER_BIG_TOP : HydraluxShape.FLOWER_SMALL_TOP)); + } +} diff --git a/src/main/java/ru/betterend/blocks/BlockProperties.java b/src/main/java/ru/betterend/blocks/BlockProperties.java index 5c9af96b..29b92634 100644 --- a/src/main/java/ru/betterend/blocks/BlockProperties.java +++ b/src/main/java/ru/betterend/blocks/BlockProperties.java @@ -7,6 +7,7 @@ import net.minecraft.util.StringIdentifiable; public class BlockProperties { public static final EnumProperty TRIPLE_SHAPE = EnumProperty.of("shape", TripleShape.class); public final static EnumProperty PEDESTAL_STATE = EnumProperty.of("state", PedestalState.class); + public static final EnumProperty HYDRALUX_SHAPE = EnumProperty.of("shape", HydraluxShape.class); public static final BooleanProperty HAS_ITEM = BooleanProperty.of("has_item"); public static final BooleanProperty HAS_LIGHT = BooleanProperty.of("has_light"); public static final BooleanProperty ACTIVATED = BooleanProperty.of("active"); @@ -57,4 +58,35 @@ public class BlockProperties { return this.name; } } + + public static enum HydraluxShape implements StringIdentifiable { + FLOWER_BIG_BOTTOM("flower_big_bottom", true), + FLOWER_BIG_TOP("flower_big_top", true), + FLOWER_SMALL_BOTTOM("flower_small_bottom", true), + FLOWER_SMALL_TOP("flower_small_top", true), + VINE("vine", false), + ROOTS("roots", false); + + private final String name; + private final boolean glow; + + HydraluxShape(String name, boolean glow) { + this.name = name; + this.glow = glow; + } + + @Override + public String asString() { + return name; + } + + @Override + public String toString() { + return name; + } + + public boolean hasGlow() { + return glow; + } + } } diff --git a/src/main/java/ru/betterend/registry/EndBlocks.java b/src/main/java/ru/betterend/registry/EndBlocks.java index cd88b3fb..80a3e588 100644 --- a/src/main/java/ru/betterend/registry/EndBlocks.java +++ b/src/main/java/ru/betterend/registry/EndBlocks.java @@ -28,6 +28,8 @@ import ru.betterend.blocks.BlockEndLotusSeed; import ru.betterend.blocks.BlockEndLotusStem; import ru.betterend.blocks.BlockEndstoneDust; import ru.betterend.blocks.BlockGlowingMoss; +import ru.betterend.blocks.BlockHydralux; +import ru.betterend.blocks.BlockHydraluxSpore; import ru.betterend.blocks.BlockHydrothermalVent; import ru.betterend.blocks.BlockLacugroveSapling; import ru.betterend.blocks.BlockMossyGlowshroomCap; @@ -164,6 +166,9 @@ public class EndBlocks { public static final Block END_LILY = registerBlockNI("end_lily", new BlockEndLily()); public static final Block END_LILY_SEED = registerBlock("end_lily_seed", new BlockEndLilySeed()); + public static final Block HYDRALUX_SPORE = registerBlock("hydralux_spore", new BlockHydraluxSpore()); + public static final Block HYDRALUX = registerBlock("hydralux", new BlockHydralux()); + public static final Block CAVE_BUSH = registerBlock("cave_bush", new BlockSimpleLeaves(MaterialColor.MAGENTA)); public static final Block MURKWEED = registerBlock("murkweed", new BlockMurkweed()); diff --git a/src/main/resources/assets/betterend/blockstates/hydralux.json b/src/main/resources/assets/betterend/blockstates/hydralux.json new file mode 100644 index 00000000..d0423855 --- /dev/null +++ b/src/main/resources/assets/betterend/blockstates/hydralux.json @@ -0,0 +1,14 @@ +{ + "variants": { + "shape=flower_big_bottom": [ + { "model": "betterend:block/hydralux_flower_big_1_bottom" }, + { "model": "betterend:block/hydralux_flower_big_2_bottom" }, + { "model": "betterend:block/hydralux_flower_big_3_bottom" } + ], + "shape=flower_big_top": { "model": "betterend:block/hydralux_flower_big_top" }, + "shape=flower_small_bottom": { "model": "betterend:block/hydrothermal_vent" }, + "shape=flower_small_top": { "model": "betterend:block/hydralux_flower_small_bottom" }, + "shape=vine": { "model": "betterend:block/hydralux_vine" }, + "shape=roots": { "model": "betterend:block/hydralux_roots" } + } +} diff --git a/src/main/resources/assets/betterend/blockstates/hydralux_spore.json b/src/main/resources/assets/betterend/blockstates/hydralux_spore.json new file mode 100644 index 00000000..af85a8d3 --- /dev/null +++ b/src/main/resources/assets/betterend/blockstates/hydralux_spore.json @@ -0,0 +1,8 @@ +{ + "variants": { + "age=0": { "model": "betterend:block/hydralux_spore" }, + "age=1": { "model": "betterend:block/hydralux_spore" }, + "age=2": { "model": "betterend:block/hydralux_spore" }, + "age=3": { "model": "betterend:block/hydralux_spore" } + } +} diff --git a/src/main/resources/assets/betterend/models/block/hydralux_flower_big_1_bottom.json b/src/main/resources/assets/betterend/models/block/hydralux_flower_big_1_bottom.json new file mode 100644 index 00000000..abc5294e --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/hydralux_flower_big_1_bottom.json @@ -0,0 +1,105 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "textures": { + "particle": "betterend:block/hydralux_flower_bottom", + "texture": "betterend:block/hydralux_flower_bottom", + "petal_bottom": "betterend:block/hydralux_flower_bud_petal_bottom", + "petal_side": "betterend:block/hydralux_flower_bud_petal_side", + "petal": "betterend:block/hydralux_flower_petal", + "top": "betterend:block/hydralux_bloom_top" + }, + "elements": [ + { + "__comment": "PlaneX1", + "from": [ 2.375, 0, 2.25 ], + "to": [ 2.376, 6, 18.25 ], + "rotation": { "origin": [ 2.375, 0, 2.25 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 9, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 9, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX1", + "from": [ 13.75, 0, 2.25 ], + "to": [ 13.751, 6, 18.25 ], + "rotation": { "origin": [ 13.75, 0, 2.25 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 9, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 9, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "Box3", + "from": [ 4, 6, 4 ], + "to": [ 12, 8, 12 ], + "faces": { + "down": { "uv": [ 4, 4, 12, 12 ], "texture": "#petal_bottom" }, + "north": { "uv": [ 4, 8, 12, 10 ], "texture": "#texture" }, + "south": { "uv": [ 4, 8, 12, 10 ], "texture": "#texture" }, + "west": { "uv": [ 4, 8, 12, 10 ], "texture": "#texture" }, + "east": { "uv": [ 4, 8, 12, 10 ], "texture": "#texture" } + } + }, + { + "__comment": "Box4", + "from": [ 3, 8, 3 ], + "to": [ 13, 16, 13 ], + "shade": false, + "faces": { + "down": { "uv": [ 3, 3, 13, 13 ], "texture": "#texture" }, + "up": { "uv": [ 3, 3, 13, 13 ], "texture": "#top" }, + "north": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" }, + "south": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" }, + "west": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" }, + "east": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneY5", + "from": [ 0, 16, 13 ], + "to": [ 16, 16.001, 29 ], + "rotation": { "origin": [ 0, 16, 13 ], "axis": "x", "angle": 45 }, + "shade": false, + "faces": { + "down": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal", "rotation": 180 } + } + }, + { + "__comment": "PlaneY5", + "from": [ 0, 0, 3 ], + "to": [ 16, 16, 3.001 ], + "rotation": { "origin": [ 0, 16, 3 ], "axis": "x", "angle": 45 }, + "shade": false, + "faces": { + "north": { "uv": [ 0, 16, 16, 0 ], "texture": "#petal" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal", "rotation": 180 } + } + }, + { + "__comment": "PlaneY7", + "from": [ 13, 16, 0 ], + "to": [ 29, 16.001, 16 ], + "rotation": { "origin": [ 13, 16, 0 ], "axis": "z", "angle": -45 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal", "rotation": 90 }, + "up": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal", "rotation": 90 } + } + }, + { + "__comment": "PlaneY7", + "from": [ 3, 0, 0 ], + "to": [ 3.001, 16, 16 ], + "rotation": { "origin": [ 3, 16, 0 ], "axis": "z", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 16, 16, 0, 0 ], "texture": "#petal" }, + "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal", "rotation": 180 } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/hydralux_flower_big_2_bottom.json b/src/main/resources/assets/betterend/models/block/hydralux_flower_big_2_bottom.json new file mode 100644 index 00000000..27cdfd0f --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/hydralux_flower_big_2_bottom.json @@ -0,0 +1,102 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "textures": { + "particle": "betterend:block/hydralux_flower_bottom", + "texture": "betterend:block/hydralux_flower_bottom", + "petal_bottom": "betterend:block/hydralux_flower_bud_petal_bottom", + "petal_side": "betterend:block/hydralux_flower_bud_petal_side", + "petal": "betterend:block/hydralux_flower_petal", + "top": "betterend:block/hydralux_bloom_top" + }, + "elements": [ + { + "__comment": "PlaneX1", + "from": [ 2.375, 0, 2.25 ], + "to": [ 2.376, 6, 18.25 ], + "rotation": { "origin": [ 2.375, 0, 2.25 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 9, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 9, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX1", + "from": [ 13.75, 0, 2.25 ], + "to": [ 13.751, 6, 18.25 ], + "rotation": { "origin": [ 13.75, 0, 2.25 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 9, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 9, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "Box3", + "from": [ 4, 6, 4 ], + "to": [ 12, 8, 12 ], + "faces": { + "down": { "uv": [ 4, 4, 12, 12 ], "texture": "#petal_bottom" }, + "north": { "uv": [ 4, 8, 12, 10 ], "texture": "#texture" }, + "south": { "uv": [ 4, 8, 12, 10 ], "texture": "#texture" }, + "west": { "uv": [ 4, 8, 12, 10 ], "texture": "#texture" }, + "east": { "uv": [ 4, 8, 12, 10 ], "texture": "#texture" } + } + }, + { + "__comment": "Box4", + "from": [ 3, 8, 3 ], + "to": [ 13, 16, 13 ], + "shade": false, + "faces": { + "down": { "uv": [ 3, 3, 13, 13 ], "texture": "#texture" }, + "up": { "uv": [ 3, 3, 13, 13 ], "texture": "#top" }, + "north": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" }, + "south": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" }, + "west": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" }, + "east": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneY5", + "from": [ 0, 16, 13 ], + "to": [ 16, 16.001, 29 ], + "shade": false, + "faces": { + "down": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal", "rotation": 180 } + } + }, + { + "__comment": "PlaneY5", + "from": [ 0, 15.9989, -13 ], + "to": [ 16, 15.9999, 3 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal", "rotation": 180 }, + "up": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal" } + } + }, + { + "__comment": "PlaneY7", + "from": [ 13, 16, 0 ], + "to": [ 29, 16.001, 16 ], + "rotation": { "origin": [ 13, 16, 0 ], "axis": "z", "angle": 0 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal", "rotation": 90 }, + "up": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal", "rotation": 90 } + } + }, + { + "__comment": "PlaneY7", + "from": [ -13, 15.9989, 0 ], + "to": [ 3, 15.9999, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal", "rotation": 270 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal", "rotation": 270 } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/hydralux_flower_big_3_bottom.json b/src/main/resources/assets/betterend/models/block/hydralux_flower_big_3_bottom.json new file mode 100644 index 00000000..c21ff703 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/hydralux_flower_big_3_bottom.json @@ -0,0 +1,105 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "textures": { + "particle": "betterend:block/hydralux_flower_bottom", + "texture": "betterend:block/hydralux_flower_bottom", + "petal_bottom": "betterend:block/hydralux_flower_bud_petal_bottom", + "petal_side": "betterend:block/hydralux_flower_bud_petal_side", + "petal": "betterend:block/hydralux_flower_petal", + "top": "betterend:block/hydralux_bloom_top" + }, + "elements": [ + { + "__comment": "PlaneX1", + "from": [ 2.375, 0, 2.25 ], + "to": [ 2.376, 6, 18.25 ], + "rotation": { "origin": [ 2.375, 0, 2.25 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 9, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 9, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX1", + "from": [ 13.75, 0, 2.25 ], + "to": [ 13.751, 6, 18.25 ], + "rotation": { "origin": [ 13.75, 0, 2.25 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 9, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 9, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "Box3", + "from": [ 4, 6, 4 ], + "to": [ 12, 8, 12 ], + "faces": { + "down": { "uv": [ 4, 4, 12, 12 ], "texture": "#petal_bottom" }, + "north": { "uv": [ 4, 8, 12, 10 ], "texture": "#texture" }, + "south": { "uv": [ 4, 8, 12, 10 ], "texture": "#texture" }, + "west": { "uv": [ 4, 8, 12, 10 ], "texture": "#texture" }, + "east": { "uv": [ 4, 8, 12, 10 ], "texture": "#texture" } + } + }, + { + "__comment": "Box4", + "from": [ 3, 8, 3 ], + "to": [ 13, 16, 13 ], + "shade": false, + "faces": { + "down": { "uv": [ 3, 3, 13, 13 ], "texture": "#texture" }, + "up": { "uv": [ 3, 3, 13, 13 ], "texture": "#top" }, + "north": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" }, + "south": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" }, + "west": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" }, + "east": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneY5", + "from": [ 0, 16, 13 ], + "to": [ 16, 16.001, 29 ], + "rotation": { "origin": [ 0, 16, 13 ], "axis": "x", "angle": -45 }, + "shade": false, + "faces": { + "down": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal", "rotation": 180 } + } + }, + { + "__comment": "PlaneY5", + "from": [ 0, 15.9989, -13 ], + "to": [ 16, 15.9999, 3 ], + "rotation": { "origin": [ 0, 16, 3 ], "axis": "x", "angle": 45 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal", "rotation": 180 }, + "up": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal" } + } + }, + { + "__comment": "PlaneY7", + "from": [ 13, 16, 0 ], + "to": [ 29, 16.001, 16 ], + "rotation": { "origin": [ 13, 16, 0 ], "axis": "z", "angle": 45 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal", "rotation": 90 }, + "up": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal", "rotation": 90 } + } + }, + { + "__comment": "PlaneY7", + "from": [ -13, 15.9989, 0 ], + "to": [ 3, 15.9999, 16 ], + "rotation": { "origin": [ 3, 16, 0 ], "axis": "z", "angle": -45 }, + "shade": false, + "faces": { + "down": { "uv": [ 16, 0, 0, 16 ], "texture": "#petal", "rotation": 270 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal", "rotation": 270 } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/hydralux_flower_big_top.json b/src/main/resources/assets/betterend/models/block/hydralux_flower_big_top.json new file mode 100644 index 00000000..f8861c1a --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/hydralux_flower_big_top.json @@ -0,0 +1,43 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "textures": { + "particle": "betterend:block/hydralux_flower_bud", + "texture": "betterend:block/hydralux_flower_bud" + }, + "elements": [ + { + "__comment": "Box3", + "from": [ 4, 0, 4 ], + "to": [ 12, 3, 12 ], + "faces": { + "up": { "uv": [ 0, 0, 8, 8 ], "texture": "#texture" }, + "north": { "uv": [ 0, 8, 8, 11 ], "texture": "#texture" }, + "south": { "uv": [ 0, 8, 8, 11 ], "texture": "#texture" }, + "west": { "uv": [ 0, 8, 8, 11 ], "texture": "#texture" }, + "east": { "uv": [ 0, 8, 8, 11 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX9", + "from": [ 5.5, 3, 5.5 ], + "to": [ 5.501, 11, 13.5 ], + "rotation": { "origin": [ 5.5, 3, 5.5 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 8, 8, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 8, 8, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX9", + "from": [ 10.5, 3, 5.5 ], + "to": [ 10.501, 11, 13.5 ], + "rotation": { "origin": [ 10.5, 3, 5.5 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 8, 8, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 8, 8, 16, 16 ], "texture": "#texture" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/hydralux_flower_small_bottom.json b/src/main/resources/assets/betterend/models/block/hydralux_flower_small_bottom.json new file mode 100644 index 00000000..55a894c4 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/hydralux_flower_small_bottom.json @@ -0,0 +1,58 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "textures": { + "particle": "betterend:block/hydralux_flower_bottom", + "texture": "betterend:block/hydralux_flower_bottom", + "petal_bottom": "betterend:block/hydralux_flower_bud_petal_bottom", + "petal_side": "betterend:block/hydralux_flower_bud_petal_side" + }, + "elements": [ + { + "__comment": "PlaneX1", + "from": [ 2.375, 0, 2.25 ], + "to": [ 2.376, 6, 18.25 ], + "rotation": { "origin": [ 2.375, 0, 2.25 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 9, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 9, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX1", + "from": [ 13.75, 0, 2.25 ], + "to": [ 13.751, 6, 18.25 ], + "rotation": { "origin": [ 13.75, 0, 2.25 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 9, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 9, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "Box3", + "from": [ 4, 6, 4 ], + "to": [ 12, 8, 12 ], + "faces": { + "down": { "uv": [ 4, 4, 12, 12 ], "texture": "#petal_bottom" }, + "north": { "uv": [ 4, 8, 12, 10 ], "texture": "#texture" }, + "south": { "uv": [ 4, 8, 12, 10 ], "texture": "#texture" }, + "west": { "uv": [ 4, 8, 12, 10 ], "texture": "#texture" }, + "east": { "uv": [ 4, 8, 12, 10 ], "texture": "#texture" } + } + }, + { + "__comment": "Box4", + "from": [ 3, 8, 3 ], + "to": [ 13, 16, 13 ], + "shade": false, + "faces": { + "down": { "uv": [ 3, 3, 13, 13 ], "texture": "#petal_bottom" }, + "north": { "uv": [ 3, 8, 13, 16 ], "texture": "#petal_side" }, + "south": { "uv": [ 3, 8, 13, 16 ], "texture": "#petal_side" }, + "west": { "uv": [ 3, 8, 13, 16 ], "texture": "#petal_side" }, + "east": { "uv": [ 3, 8, 13, 16 ], "texture": "#petal_side" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/hydralux_flower_small_top.json b/src/main/resources/assets/betterend/models/block/hydralux_flower_small_top.json new file mode 100644 index 00000000..8342b9c5 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/hydralux_flower_small_top.json @@ -0,0 +1,23 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "textures": { + "particle": "betterend:block/hydralux_flower_bud_petal_side", + "texture": "betterend:block/hydralux_flower_bud_petal_side", + "petal_top": "betterend:block/hydralux_flower_bud_petal_top" + }, + "elements": [ + { + "__comment": "Box4", + "from": [ 3, 0, 3 ], + "to": [ 13, 8, 13 ], + "shade": false, + "faces": { + "up": { "uv": [ 3, 3, 13, 13 ], "texture": "#petal_top" }, + "north": { "uv": [ 3, 8, 13, 16 ], "texture": "#texture" }, + "south": { "uv": [ 3, 8, 13, 16 ], "texture": "#texture" }, + "west": { "uv": [ 3, 8, 13, 16 ], "texture": "#texture" }, + "east": { "uv": [ 3, 8, 13, 16 ], "texture": "#texture" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/hydralux_roots.json b/src/main/resources/assets/betterend/models/block/hydralux_roots.json new file mode 100644 index 00000000..4d0ba2b8 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/hydralux_roots.json @@ -0,0 +1,76 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "textures": { + "particle": "betterend:block/hydralux_vine", + "texture": "betterend:block/hydralux_vine", + "roots": "betterend:block/hydralux_roots" + }, + "elements": [ + { + "__comment": "PlaneX1", + "from": [ 2.375, 0, 2.25 ], + "to": [ 2.376, 16, 18.25 ], + "rotation": { "origin": [ 2.375, 0, 2.25 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX1", + "from": [ 13.75, 0, 2.25 ], + "to": [ 13.751, 16, 18.25 ], + "rotation": { "origin": [ 13.75, 0, 2.25 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX4", + "from": [ 5, 0, 0.5 ], + "to": [ 5.001, 16, 16.5 ], + "rotation": { "origin": [ 5, 0, 0.5 ], "axis": "y", "angle": 22.5 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" } + } + }, + { + "__comment": "PlaneZ5", + "from": [ 0.5, 0, 11 ], + "to": [ 16.5, 16, 11.001 ], + "rotation": { "origin": [ 0.5, 0, 11 ], "axis": "y", "angle": 22.5 }, + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" } + } + }, + { + "__comment": "PlaneX4", + "from": [ 11, 0, 0.5 ], + "to": [ 11.001, 16, 16.5 ], + "rotation": { "origin": [ 11, 0, 0.5 ], "axis": "y", "angle": -22.5 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" } + } + }, + { + "__comment": "PlaneZ5", + "from": [ 0.5, 0, 5 ], + "to": [ 16.5, 16, 5.001 ], + "rotation": { "origin": [ 0.5, 0, 5 ], "axis": "y", "angle": -22.5 }, + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/hydralux_spore.json b/src/main/resources/assets/betterend/models/block/hydralux_spore.json new file mode 100644 index 00000000..c7a7897e --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/hydralux_spore.json @@ -0,0 +1,6 @@ +{ + "parent": "betterend:block/cross_no_distortion", + "textures": { + "texture": "betterend:block/hydralux_spore" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/hydralux_vine.json b/src/main/resources/assets/betterend/models/block/hydralux_vine.json new file mode 100644 index 00000000..25db406b --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/hydralux_vine.json @@ -0,0 +1,6 @@ +{ + "parent": "betterend:block/cross_no_distortion", + "textures": { + "texture": "betterend:block/hydralux_vine" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/textures/block/hydralux_roots.png b/src/main/resources/assets/betterend/textures/block/hydralux_roots.png new file mode 100644 index 0000000000000000000000000000000000000000..a1ee21419b6cb4633e9fdff147587acad8ca9ccb GIT binary patch literal 2071 zcmbVN3ry5@94^>GyM+FM(=0}~(k z7)Cb@YJA{h^AWeO&8eBo20E3X;$sPMINhSSpl0(iM2(8i{d*iYT+o?a((AwN_y4}{ z_vo*SiwY+uYF^Vo5R~Z5b4&*3B=s23AN;4@d`yAUz+m3HG6W4uR*yJn-TD*=N@(HT z9>wD-AZan6r5Mr6YQupbKts^jap53E&tw(Y%ldf1hIG{bh`>B!L#7&CxGQL9OZdD> zi7l=ybkmhHX)A+_%Yny+Nk9-_6$%aq{DMq|ZAgTd1Z(v+hQJYsGSh~PR|R2@s|dD> z5(^u(CX^-&I@oO05+>ZLGi1X$oG@d!86)&4PLQ~X)LY@`4*_Zt!;zC6xlt`}WkX67 zB}igeC=}9$^jcB!VT9Fc#c&;_)1d%?$`yh_g;7CH>tS%PGA;2zg%<@_Wu&}fnPNkL z)9w%g!5FO|N7DonhJ~phMrd(0qzI6qW4K_MJK#D&X6It5vw1e$d^YzPQj%kvCrrY&BYvzSnvvwBh1Xuwg6nKPnh1LZYYImXKo zvHcE_E>nxE?(gn%Mx+79KdKyOHX3Nkh#DZ&uY60~lGW$zZh5U?c9;qgK{HqgD=(c^O7Wn@mR9NLbW{j`Rqb$IGC47139u znEf!i^7C+{El7%1+uerHYMogIiQeY>$j5UjNB4(HSU~!W;&-ddBBz8Xi5>3)xqF`e z!k*?|rplk~{`soeZL7EYKKt>1x{oG@E};Y;3nnOrsPSOxtm!Td_V21ip7okbJ#aAW z)MaeSf{WOkW(7bkfhk<2Ie!3x;;uR!^Dwx{+fulF z1wdI|)g;tSspE4tjXB@mdAf4%bg1j$rrMPF4ct#lnhuU$m7i%DF}OTuQ~UIOU!3ui z$LB7py5E-e{*GThJ9yTS^c!qPtg8AG&Ci8NQd&94# z-|i}}A6c+=D6}Sbn&+&>d? j^-F&^{Q7?FH@8ybca(9}ld9EEKjfTH==l2W8C8D+Yl_ Date: Fri, 4 Dec 2020 21:36:43 +0300 Subject: [PATCH 05/11] Fixes --- .../ru/betterend/blocks/BlockBubbleCoral.java | 10 +++++++++ .../ru/betterend/blocks/BlockEndLily.java | 12 +++++++++++ .../ru/betterend/blocks/BlockHydralux.java | 21 +++++++++++++++++++ .../betterend/blocks/BlockHydraluxSpore.java | 11 +++++++--- .../betterend/blockstates/hydralux.json | 4 ++-- .../block/hydralux_flower_small_top.json | 8 +++---- .../betterend/models/item/hydralux_spore.json | 6 ++++++ 7 files changed, 63 insertions(+), 9 deletions(-) create mode 100644 src/main/resources/assets/betterend/models/item/hydralux_spore.json diff --git a/src/main/java/ru/betterend/blocks/BlockBubbleCoral.java b/src/main/java/ru/betterend/blocks/BlockBubbleCoral.java index f20dd4a4..f2bff154 100644 --- a/src/main/java/ru/betterend/blocks/BlockBubbleCoral.java +++ b/src/main/java/ru/betterend/blocks/BlockBubbleCoral.java @@ -47,4 +47,14 @@ public class BlockBubbleCoral extends BlockUnderwaterPlant { public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ePos) { return SHAPE; } + + @Override + public boolean isFertilizable(BlockView world, BlockPos pos, BlockState state, boolean isClient) { + return false; + } + + @Override + public boolean canGrow(World world, Random random, BlockPos pos, BlockState state) { + return false; + } } diff --git a/src/main/java/ru/betterend/blocks/BlockEndLily.java b/src/main/java/ru/betterend/blocks/BlockEndLily.java index d930b267..5b78d7ef 100644 --- a/src/main/java/ru/betterend/blocks/BlockEndLily.java +++ b/src/main/java/ru/betterend/blocks/BlockEndLily.java @@ -2,6 +2,7 @@ package ru.betterend.blocks; import java.util.Collections; import java.util.List; +import java.util.Random; import com.google.common.collect.Lists; @@ -26,6 +27,7 @@ import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; import net.minecraft.util.shape.VoxelShape; import net.minecraft.world.BlockView; +import net.minecraft.world.World; import net.minecraft.world.WorldAccess; import net.minecraft.world.WorldView; import ru.betterend.blocks.BlockProperties.TripleShape; @@ -103,4 +105,14 @@ public class BlockEndLily extends BlockUnderwaterPlant { public ItemStack getPickStack(BlockView world, BlockPos pos, BlockState state) { return new ItemStack(EndBlocks.END_LILY_SEED); } + + @Override + public boolean isFertilizable(BlockView world, BlockPos pos, BlockState state, boolean isClient) { + return false; + } + + @Override + public boolean canGrow(World world, Random random, BlockPos pos, BlockState state) { + return false; + } } diff --git a/src/main/java/ru/betterend/blocks/BlockHydralux.java b/src/main/java/ru/betterend/blocks/BlockHydralux.java index c2dc49b4..aba2384c 100644 --- a/src/main/java/ru/betterend/blocks/BlockHydralux.java +++ b/src/main/java/ru/betterend/blocks/BlockHydralux.java @@ -1,12 +1,18 @@ package ru.betterend.blocks; +import java.util.Random; + import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags; +import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Material; import net.minecraft.sound.BlockSoundGroup; +import net.minecraft.state.StateManager; import net.minecraft.state.property.EnumProperty; import net.minecraft.util.math.BlockPos; +import net.minecraft.world.BlockView; +import net.minecraft.world.World; import net.minecraft.world.WorldView; import ru.betterend.blocks.BlockProperties.HydraluxShape; import ru.betterend.blocks.basis.BlockUnderwaterPlant; @@ -24,6 +30,11 @@ public class BlockHydralux extends BlockUnderwaterPlant { .noCollision()); } + @Override + protected void appendProperties(StateManager.Builder stateManager) { + stateManager.add(SHAPE); + } + @Override public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) { BlockState down = world.getBlockState(pos.down()); @@ -38,4 +49,14 @@ public class BlockHydralux extends BlockUnderwaterPlant { return down.isOf(this) && world.getBlockState(pos.up()).isOf(this); } } + + @Override + public boolean isFertilizable(BlockView world, BlockPos pos, BlockState state, boolean isClient) { + return false; + } + + @Override + public boolean canGrow(World world, Random random, BlockPos pos, BlockState state) { + return false; + } } diff --git a/src/main/java/ru/betterend/blocks/BlockHydraluxSpore.java b/src/main/java/ru/betterend/blocks/BlockHydraluxSpore.java index c821a0a0..75df7e2a 100644 --- a/src/main/java/ru/betterend/blocks/BlockHydraluxSpore.java +++ b/src/main/java/ru/betterend/blocks/BlockHydraluxSpore.java @@ -31,14 +31,19 @@ public class BlockHydraluxSpore extends BlockUnderwaterPlantWithAge { BlocksHelper.setWithoutUpdate(world, pos, state.with(BlockProperties.HYDRALUX_SHAPE, HydraluxShape.ROOTS)); for (int i = 1; i < h - 2; i++) { mut.setY(pos.getY() + i); - BlocksHelper.setWithoutUpdate(world, pos, state.with(BlockProperties.HYDRALUX_SHAPE, HydraluxShape.VINE)); + BlocksHelper.setWithoutUpdate(world, mut, state.with(BlockProperties.HYDRALUX_SHAPE, HydraluxShape.VINE)); } mut.setY(mut.getY() + 1); boolean big = random.nextBoolean(); - BlocksHelper.setWithoutUpdate(world, pos, state.with(BlockProperties.HYDRALUX_SHAPE, big ? HydraluxShape.FLOWER_BIG_BOTTOM : HydraluxShape.FLOWER_SMALL_BOTTOM)); + BlocksHelper.setWithoutUpdate(world, mut, state.with(BlockProperties.HYDRALUX_SHAPE, big ? HydraluxShape.FLOWER_BIG_BOTTOM : HydraluxShape.FLOWER_SMALL_BOTTOM)); mut.setY(mut.getY() + 1); - BlocksHelper.setWithoutUpdate(world, pos, state.with(BlockProperties.HYDRALUX_SHAPE, big ? HydraluxShape.FLOWER_BIG_TOP : HydraluxShape.FLOWER_SMALL_TOP)); + BlocksHelper.setWithoutUpdate(world, mut, state.with(BlockProperties.HYDRALUX_SHAPE, big ? HydraluxShape.FLOWER_BIG_TOP : HydraluxShape.FLOWER_SMALL_TOP)); + } + + @Override + protected boolean isTerrain(BlockState state) { + return state.isOf(EndBlocks.SULPHURIC_ROCK.stone); } } diff --git a/src/main/resources/assets/betterend/blockstates/hydralux.json b/src/main/resources/assets/betterend/blockstates/hydralux.json index d0423855..bf8eb1ce 100644 --- a/src/main/resources/assets/betterend/blockstates/hydralux.json +++ b/src/main/resources/assets/betterend/blockstates/hydralux.json @@ -6,8 +6,8 @@ { "model": "betterend:block/hydralux_flower_big_3_bottom" } ], "shape=flower_big_top": { "model": "betterend:block/hydralux_flower_big_top" }, - "shape=flower_small_bottom": { "model": "betterend:block/hydrothermal_vent" }, - "shape=flower_small_top": { "model": "betterend:block/hydralux_flower_small_bottom" }, + "shape=flower_small_bottom": { "model": "betterend:block/hydralux_flower_small_bottom" }, + "shape=flower_small_top": { "model": "betterend:block/hydralux_flower_small_top" }, "shape=vine": { "model": "betterend:block/hydralux_vine" }, "shape=roots": { "model": "betterend:block/hydralux_roots" } } diff --git a/src/main/resources/assets/betterend/models/block/hydralux_flower_small_top.json b/src/main/resources/assets/betterend/models/block/hydralux_flower_small_top.json index 8342b9c5..68be2bc3 100644 --- a/src/main/resources/assets/betterend/models/block/hydralux_flower_small_top.json +++ b/src/main/resources/assets/betterend/models/block/hydralux_flower_small_top.json @@ -13,10 +13,10 @@ "shade": false, "faces": { "up": { "uv": [ 3, 3, 13, 13 ], "texture": "#petal_top" }, - "north": { "uv": [ 3, 8, 13, 16 ], "texture": "#texture" }, - "south": { "uv": [ 3, 8, 13, 16 ], "texture": "#texture" }, - "west": { "uv": [ 3, 8, 13, 16 ], "texture": "#texture" }, - "east": { "uv": [ 3, 8, 13, 16 ], "texture": "#texture" } + "north": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" }, + "south": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" }, + "west": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" }, + "east": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" } } } ] diff --git a/src/main/resources/assets/betterend/models/item/hydralux_spore.json b/src/main/resources/assets/betterend/models/item/hydralux_spore.json new file mode 100644 index 00000000..0f7e1e46 --- /dev/null +++ b/src/main/resources/assets/betterend/models/item/hydralux_spore.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "betterend:item/hydralux_spore" + } +} From eb6d36b5ddd3b84a41d9b3162ae8c658f129a487 Mon Sep 17 00:00:00 2001 From: paulevsGitch Date: Fri, 4 Dec 2020 22:27:42 +0300 Subject: [PATCH 06/11] Flower enhancements --- .../ru/betterend/blocks/BlockHydralux.java | 24 ++++ ...uxSpore.java => BlockHydraluxSapling.java} | 2 +- .../java/ru/betterend/registry/EndBlocks.java | 4 +- .../blockstates/hydralux_sapling.json | 8 ++ .../betterend/blockstates/hydralux_spore.json | 8 -- .../materialmaps/block/hydralux.json | 42 +++++++ .../block/hydralux_flower_big_1_bottom.json | 4 +- .../block/hydralux_flower_big_2_bottom.json | 5 +- .../block/hydralux_flower_big_3_bottom.json | 4 +- .../models/block/hydralux_flower_big_top.json | 14 +-- .../models/block/hydralux_roots.json | 105 +++++------------- ...lux_spore.json => hydralux_sapling_1.json} | 2 +- .../models/block/hydralux_sapling_2.json | 6 + .../models/block/hydralux_sapling_3.json | 6 + .../models/block/hydralux_sapling_4.json | 6 + .../betterend/models/hydralux_roots.json | 76 +++++++++++++ .../textures/block/hydralux_bloom_side.png | Bin 268 -> 0 bytes .../textures/block/hydralux_flower_bottom.png | Bin 1850 -> 2022 bytes .../textures/block/hydralux_roots.png | Bin 2071 -> 363 bytes .../textures/block/hydralux_sapling_1.png | Bin 0 -> 316 bytes .../textures/block/hydralux_sapling_2.png | Bin 0 -> 350 bytes .../textures/block/hydralux_sapling_3.png | Bin 0 -> 400 bytes .../textures/block/hydralux_sapling_4.png | Bin 0 -> 379 bytes .../textures/block/hydralux_spore.png | Bin 250 -> 0 bytes .../textures/block/hydralux_vine_bottom.png | Bin 0 -> 451 bytes 25 files changed, 215 insertions(+), 101 deletions(-) rename src/main/java/ru/betterend/blocks/{BlockHydraluxSpore.java => BlockHydraluxSapling.java} (93%) create mode 100644 src/main/resources/assets/betterend/blockstates/hydralux_sapling.json delete mode 100644 src/main/resources/assets/betterend/blockstates/hydralux_spore.json create mode 100644 src/main/resources/assets/betterend/materialmaps/block/hydralux.json rename src/main/resources/assets/betterend/models/block/{hydralux_spore.json => hydralux_sapling_1.json} (56%) create mode 100644 src/main/resources/assets/betterend/models/block/hydralux_sapling_2.json create mode 100644 src/main/resources/assets/betterend/models/block/hydralux_sapling_3.json create mode 100644 src/main/resources/assets/betterend/models/block/hydralux_sapling_4.json create mode 100644 src/main/resources/assets/betterend/models/hydralux_roots.json delete mode 100644 src/main/resources/assets/betterend/textures/block/hydralux_bloom_side.png create mode 100644 src/main/resources/assets/betterend/textures/block/hydralux_sapling_1.png create mode 100644 src/main/resources/assets/betterend/textures/block/hydralux_sapling_2.png create mode 100644 src/main/resources/assets/betterend/textures/block/hydralux_sapling_3.png create mode 100644 src/main/resources/assets/betterend/textures/block/hydralux_sapling_4.png delete mode 100644 src/main/resources/assets/betterend/textures/block/hydralux_spore.png create mode 100644 src/main/resources/assets/betterend/textures/block/hydralux_vine_bottom.png diff --git a/src/main/java/ru/betterend/blocks/BlockHydralux.java b/src/main/java/ru/betterend/blocks/BlockHydralux.java index aba2384c..b1405666 100644 --- a/src/main/java/ru/betterend/blocks/BlockHydralux.java +++ b/src/main/java/ru/betterend/blocks/BlockHydralux.java @@ -1,12 +1,20 @@ package ru.betterend.blocks; +import java.util.Collections; +import java.util.List; import java.util.Random; +import com.google.common.collect.Lists; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Material; +import net.minecraft.item.ItemStack; +import net.minecraft.loot.context.LootContext; import net.minecraft.sound.BlockSoundGroup; import net.minecraft.state.StateManager; import net.minecraft.state.property.EnumProperty; @@ -17,6 +25,7 @@ import net.minecraft.world.WorldView; import ru.betterend.blocks.BlockProperties.HydraluxShape; import ru.betterend.blocks.basis.BlockUnderwaterPlant; import ru.betterend.registry.EndBlocks; +import ru.betterend.util.MHelper; public class BlockHydralux extends BlockUnderwaterPlant { public static final EnumProperty SHAPE = BlockProperties.HYDRALUX_SHAPE; @@ -59,4 +68,19 @@ public class BlockHydralux extends BlockUnderwaterPlant { public boolean canGrow(World world, Random random, BlockPos pos, BlockState state) { return false; } + + @Override + @Environment(EnvType.CLIENT) + public ItemStack getPickStack(BlockView world, BlockPos pos, BlockState state) { + return new ItemStack(EndBlocks.HYDRALUX_SAPLING); + } + + @Override + public List getDroppedStacks(BlockState state, LootContext.Builder builder) { + HydraluxShape shape = state.get(SHAPE); + if (shape == HydraluxShape.ROOTS) { + return Lists.newArrayList(new ItemStack(EndBlocks.HYDRALUX_SAPLING, MHelper.randRange(1, 2, MHelper.RANDOM))); + } + return Collections.emptyList(); + } } diff --git a/src/main/java/ru/betterend/blocks/BlockHydraluxSpore.java b/src/main/java/ru/betterend/blocks/BlockHydraluxSapling.java similarity index 93% rename from src/main/java/ru/betterend/blocks/BlockHydraluxSpore.java rename to src/main/java/ru/betterend/blocks/BlockHydraluxSapling.java index 75df7e2a..b3615fe3 100644 --- a/src/main/java/ru/betterend/blocks/BlockHydraluxSpore.java +++ b/src/main/java/ru/betterend/blocks/BlockHydraluxSapling.java @@ -13,7 +13,7 @@ import ru.betterend.registry.EndBlocks; import ru.betterend.util.BlocksHelper; import ru.betterend.util.MHelper; -public class BlockHydraluxSpore extends BlockUnderwaterPlantWithAge { +public class BlockHydraluxSapling extends BlockUnderwaterPlantWithAge { @Override public void grow(StructureWorldAccess world, Random random, BlockPos pos) { int h = MHelper.randRange(4, 8, random); diff --git a/src/main/java/ru/betterend/registry/EndBlocks.java b/src/main/java/ru/betterend/registry/EndBlocks.java index 80a3e588..be87968f 100644 --- a/src/main/java/ru/betterend/registry/EndBlocks.java +++ b/src/main/java/ru/betterend/registry/EndBlocks.java @@ -29,7 +29,7 @@ import ru.betterend.blocks.BlockEndLotusStem; import ru.betterend.blocks.BlockEndstoneDust; import ru.betterend.blocks.BlockGlowingMoss; import ru.betterend.blocks.BlockHydralux; -import ru.betterend.blocks.BlockHydraluxSpore; +import ru.betterend.blocks.BlockHydraluxSapling; import ru.betterend.blocks.BlockHydrothermalVent; import ru.betterend.blocks.BlockLacugroveSapling; import ru.betterend.blocks.BlockMossyGlowshroomCap; @@ -166,7 +166,7 @@ public class EndBlocks { public static final Block END_LILY = registerBlockNI("end_lily", new BlockEndLily()); public static final Block END_LILY_SEED = registerBlock("end_lily_seed", new BlockEndLilySeed()); - public static final Block HYDRALUX_SPORE = registerBlock("hydralux_spore", new BlockHydraluxSpore()); + public static final Block HYDRALUX_SAPLING = registerBlock("hydralux_sapling", new BlockHydraluxSapling()); public static final Block HYDRALUX = registerBlock("hydralux", new BlockHydralux()); public static final Block CAVE_BUSH = registerBlock("cave_bush", new BlockSimpleLeaves(MaterialColor.MAGENTA)); diff --git a/src/main/resources/assets/betterend/blockstates/hydralux_sapling.json b/src/main/resources/assets/betterend/blockstates/hydralux_sapling.json new file mode 100644 index 00000000..0db9745c --- /dev/null +++ b/src/main/resources/assets/betterend/blockstates/hydralux_sapling.json @@ -0,0 +1,8 @@ +{ + "variants": { + "age=0": { "model": "betterend:block/hydralux_sapling_1" }, + "age=1": { "model": "betterend:block/hydralux_sapling_2" }, + "age=2": { "model": "betterend:block/hydralux_sapling_3" }, + "age=3": { "model": "betterend:block/hydralux_sapling_4" } + } +} diff --git a/src/main/resources/assets/betterend/blockstates/hydralux_spore.json b/src/main/resources/assets/betterend/blockstates/hydralux_spore.json deleted file mode 100644 index af85a8d3..00000000 --- a/src/main/resources/assets/betterend/blockstates/hydralux_spore.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "variants": { - "age=0": { "model": "betterend:block/hydralux_spore" }, - "age=1": { "model": "betterend:block/hydralux_spore" }, - "age=2": { "model": "betterend:block/hydralux_spore" }, - "age=3": { "model": "betterend:block/hydralux_spore" } - } -} diff --git a/src/main/resources/assets/betterend/materialmaps/block/hydralux.json b/src/main/resources/assets/betterend/materialmaps/block/hydralux.json new file mode 100644 index 00000000..d5bae077 --- /dev/null +++ b/src/main/resources/assets/betterend/materialmaps/block/hydralux.json @@ -0,0 +1,42 @@ +{ + "defaultMap": { + "spriteMap": [ + { + "sprite": "betterend:block/hydralux_flower_petal", + "material": "betterend:waving_glow_inc" + }, + { + "sprite": "betterend:block/hydralux_flower_bud_petal_side", + "material": "betterend:waving_glow_inc" + }, + { + "sprite": "betterend:block/hydralux_flower_bud_petal_top", + "material": "betterend:waving_glow_inc" + }, + { + "sprite": "betterend:block/hydralux_bloom_bottom", + "material": "betterend:waving" + }, + { + "sprite": "betterend:block/hydralux_bloom_top", + "material": "betterend:waving" + }, + { + "sprite": "betterend:block/hydralux_vine", + "material": "betterend:waving" + }, + { + "sprite": "betterend:block/hydralux_flower_bottom", + "material": "betterend:waving_glow_inc" + }, + { + "sprite": "betterend:block/hydralux_flower_bud", + "material": "betterend:waving" + }, + { + "sprite": "betterend:block/hydralux_vine_bottom", + "material": "betterend:waving_floor" + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/hydralux_flower_big_1_bottom.json b/src/main/resources/assets/betterend/models/block/hydralux_flower_big_1_bottom.json index abc5294e..992b96ac 100644 --- a/src/main/resources/assets/betterend/models/block/hydralux_flower_big_1_bottom.json +++ b/src/main/resources/assets/betterend/models/block/hydralux_flower_big_1_bottom.json @@ -3,7 +3,7 @@ "textures": { "particle": "betterend:block/hydralux_flower_bottom", "texture": "betterend:block/hydralux_flower_bottom", - "petal_bottom": "betterend:block/hydralux_flower_bud_petal_bottom", + "petal_bottom": "betterend:block/hydralux_bloom_bottom", "petal_side": "betterend:block/hydralux_flower_bud_petal_side", "petal": "betterend:block/hydralux_flower_petal", "top": "betterend:block/hydralux_bloom_top" @@ -49,7 +49,7 @@ "to": [ 13, 16, 13 ], "shade": false, "faces": { - "down": { "uv": [ 3, 3, 13, 13 ], "texture": "#texture" }, + "down": { "uv": [ 3, 3, 13, 13 ], "texture": "#petal_bottom" }, "up": { "uv": [ 3, 3, 13, 13 ], "texture": "#top" }, "north": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" }, "south": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" }, diff --git a/src/main/resources/assets/betterend/models/block/hydralux_flower_big_2_bottom.json b/src/main/resources/assets/betterend/models/block/hydralux_flower_big_2_bottom.json index 27cdfd0f..3fdfdafe 100644 --- a/src/main/resources/assets/betterend/models/block/hydralux_flower_big_2_bottom.json +++ b/src/main/resources/assets/betterend/models/block/hydralux_flower_big_2_bottom.json @@ -3,7 +3,7 @@ "textures": { "particle": "betterend:block/hydralux_flower_bottom", "texture": "betterend:block/hydralux_flower_bottom", - "petal_bottom": "betterend:block/hydralux_flower_bud_petal_bottom", + "petal_bottom": "betterend:block/hydralux_bloom_bottom", "petal_side": "betterend:block/hydralux_flower_bud_petal_side", "petal": "betterend:block/hydralux_flower_petal", "top": "betterend:block/hydralux_bloom_top" @@ -49,7 +49,7 @@ "to": [ 13, 16, 13 ], "shade": false, "faces": { - "down": { "uv": [ 3, 3, 13, 13 ], "texture": "#texture" }, + "down": { "uv": [ 3, 3, 13, 13 ], "texture": "#petal_bottom" }, "up": { "uv": [ 3, 3, 13, 13 ], "texture": "#top" }, "north": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" }, "south": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" }, @@ -81,7 +81,6 @@ "__comment": "PlaneY7", "from": [ 13, 16, 0 ], "to": [ 29, 16.001, 16 ], - "rotation": { "origin": [ 13, 16, 0 ], "axis": "z", "angle": 0 }, "shade": false, "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#petal", "rotation": 90 }, diff --git a/src/main/resources/assets/betterend/models/block/hydralux_flower_big_3_bottom.json b/src/main/resources/assets/betterend/models/block/hydralux_flower_big_3_bottom.json index c21ff703..d7b1b2f3 100644 --- a/src/main/resources/assets/betterend/models/block/hydralux_flower_big_3_bottom.json +++ b/src/main/resources/assets/betterend/models/block/hydralux_flower_big_3_bottom.json @@ -3,7 +3,7 @@ "textures": { "particle": "betterend:block/hydralux_flower_bottom", "texture": "betterend:block/hydralux_flower_bottom", - "petal_bottom": "betterend:block/hydralux_flower_bud_petal_bottom", + "petal_bottom": "betterend:block/hydralux_bloom_bottom", "petal_side": "betterend:block/hydralux_flower_bud_petal_side", "petal": "betterend:block/hydralux_flower_petal", "top": "betterend:block/hydralux_bloom_top" @@ -49,7 +49,7 @@ "to": [ 13, 16, 13 ], "shade": false, "faces": { - "down": { "uv": [ 3, 3, 13, 13 ], "texture": "#texture" }, + "down": { "uv": [ 3, 3, 13, 13 ], "texture": "#petal_bottom" }, "up": { "uv": [ 3, 3, 13, 13 ], "texture": "#top" }, "north": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" }, "south": { "uv": [ 3, 0, 13, 8 ], "texture": "#texture" }, diff --git a/src/main/resources/assets/betterend/models/block/hydralux_flower_big_top.json b/src/main/resources/assets/betterend/models/block/hydralux_flower_big_top.json index f8861c1a..24cc4a5f 100644 --- a/src/main/resources/assets/betterend/models/block/hydralux_flower_big_top.json +++ b/src/main/resources/assets/betterend/models/block/hydralux_flower_big_top.json @@ -7,14 +7,14 @@ "elements": [ { "__comment": "Box3", - "from": [ 4, 0, 4 ], - "to": [ 12, 3, 12 ], + "from": [ 5, 0, 5 ], + "to": [ 11, 2, 11 ], "faces": { - "up": { "uv": [ 0, 0, 8, 8 ], "texture": "#texture" }, - "north": { "uv": [ 0, 8, 8, 11 ], "texture": "#texture" }, - "south": { "uv": [ 0, 8, 8, 11 ], "texture": "#texture" }, - "west": { "uv": [ 0, 8, 8, 11 ], "texture": "#texture" }, - "east": { "uv": [ 0, 8, 8, 11 ], "texture": "#texture" } + "up": { "uv": [ 1, 1, 7, 7 ], "texture": "#texture" }, + "north": { "uv": [ 1, 8, 7, 10 ], "texture": "#texture" }, + "south": { "uv": [ 1, 8, 7, 10 ], "texture": "#texture" }, + "west": { "uv": [ 1, 8, 7, 10 ], "texture": "#texture" }, + "east": { "uv": [ 1, 8, 7, 10 ], "texture": "#texture" } } }, { diff --git a/src/main/resources/assets/betterend/models/block/hydralux_roots.json b/src/main/resources/assets/betterend/models/block/hydralux_roots.json index 4d0ba2b8..22560827 100644 --- a/src/main/resources/assets/betterend/models/block/hydralux_roots.json +++ b/src/main/resources/assets/betterend/models/block/hydralux_roots.json @@ -1,76 +1,31 @@ -{ - "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", - "textures": { - "particle": "betterend:block/hydralux_vine", - "texture": "betterend:block/hydralux_vine", - "roots": "betterend:block/hydralux_roots" - }, - "elements": [ - { - "__comment": "PlaneX1", - "from": [ 2.375, 0, 2.25 ], - "to": [ 2.376, 16, 18.25 ], - "rotation": { "origin": [ 2.375, 0, 2.25 ], "axis": "y", "angle": 45 }, - "shade": false, - "faces": { - "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, - "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" } - } - }, - { - "__comment": "PlaneX1", - "from": [ 13.75, 0, 2.25 ], - "to": [ 13.751, 16, 18.25 ], - "rotation": { "origin": [ 13.75, 0, 2.25 ], "axis": "y", "angle": -45 }, - "shade": false, - "faces": { - "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, - "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" } - } - }, - { - "__comment": "PlaneX4", - "from": [ 5, 0, 0.5 ], - "to": [ 5.001, 16, 16.5 ], - "rotation": { "origin": [ 5, 0, 0.5 ], "axis": "y", "angle": 22.5 }, - "shade": false, - "faces": { - "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" }, - "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" } - } - }, - { - "__comment": "PlaneZ5", - "from": [ 0.5, 0, 11 ], - "to": [ 16.5, 16, 11.001 ], - "rotation": { "origin": [ 0.5, 0, 11 ], "axis": "y", "angle": 22.5 }, - "shade": false, - "faces": { - "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" }, - "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" } - } - }, - { - "__comment": "PlaneX4", - "from": [ 11, 0, 0.5 ], - "to": [ 11.001, 16, 16.5 ], - "rotation": { "origin": [ 11, 0, 0.5 ], "axis": "y", "angle": -22.5 }, - "shade": false, - "faces": { - "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" }, - "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" } - } - }, - { - "__comment": "PlaneZ5", - "from": [ 0.5, 0, 5 ], - "to": [ 16.5, 16, 5.001 ], - "rotation": { "origin": [ 0.5, 0, 5 ], "axis": "y", "angle": -22.5 }, - "shade": false, - "faces": { - "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" }, - "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" } - } - } - ] +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "textures": { + "particle": "betterend:block/hydralux_vine_bottom", + "texture": "betterend:block/hydralux_vine_bottom" + }, + "elements": [ + { + "__comment": "PlaneX1", + "from": [ 2.375, 0, 2.25 ], + "to": [ 2.376, 16, 18.25 ], + "rotation": { "origin": [ 2.375, 0, 2.25 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX1", + "from": [ 13.75, 0, 2.25 ], + "to": [ 13.751, 16, 18.25 ], + "rotation": { "origin": [ 13.75, 0, 2.25 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" } + } + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/hydralux_spore.json b/src/main/resources/assets/betterend/models/block/hydralux_sapling_1.json similarity index 56% rename from src/main/resources/assets/betterend/models/block/hydralux_spore.json rename to src/main/resources/assets/betterend/models/block/hydralux_sapling_1.json index c7a7897e..03a16dfb 100644 --- a/src/main/resources/assets/betterend/models/block/hydralux_spore.json +++ b/src/main/resources/assets/betterend/models/block/hydralux_sapling_1.json @@ -1,6 +1,6 @@ { "parent": "betterend:block/cross_no_distortion", "textures": { - "texture": "betterend:block/hydralux_spore" + "texture": "betterend:block/hydralux_sapling_1" } } \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/hydralux_sapling_2.json b/src/main/resources/assets/betterend/models/block/hydralux_sapling_2.json new file mode 100644 index 00000000..35e4df6c --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/hydralux_sapling_2.json @@ -0,0 +1,6 @@ +{ + "parent": "betterend:block/cross_no_distortion", + "textures": { + "texture": "betterend:block/hydralux_sapling_2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/hydralux_sapling_3.json b/src/main/resources/assets/betterend/models/block/hydralux_sapling_3.json new file mode 100644 index 00000000..6f1007dc --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/hydralux_sapling_3.json @@ -0,0 +1,6 @@ +{ + "parent": "betterend:block/cross_no_distortion", + "textures": { + "texture": "betterend:block/hydralux_sapling_3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/hydralux_sapling_4.json b/src/main/resources/assets/betterend/models/block/hydralux_sapling_4.json new file mode 100644 index 00000000..8b50f5a5 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/hydralux_sapling_4.json @@ -0,0 +1,6 @@ +{ + "parent": "betterend:block/cross_no_distortion", + "textures": { + "texture": "betterend:block/hydralux_sapling_4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/hydralux_roots.json b/src/main/resources/assets/betterend/models/hydralux_roots.json new file mode 100644 index 00000000..8ee64882 --- /dev/null +++ b/src/main/resources/assets/betterend/models/hydralux_roots.json @@ -0,0 +1,76 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "textures": { + "particle": "betterend:block/hydralux_vine_bottom", + "texture": "betterend:block/hydralux_vine_bottom", + "roots": "betterend:block/hydralux_roots" + }, + "elements": [ + { + "__comment": "PlaneX1", + "from": [ 2.375, 0, 2.25 ], + "to": [ 2.376, 16, 18.25 ], + "rotation": { "origin": [ 2.375, 0, 2.25 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX1", + "from": [ 13.75, 0, 2.25 ], + "to": [ 13.751, 16, 18.25 ], + "rotation": { "origin": [ 13.75, 0, 2.25 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX4", + "from": [ 5, 0, 0.5 ], + "to": [ 5.001, 16, 16.5 ], + "rotation": { "origin": [ 5, 0, 0.5 ], "axis": "y", "angle": 22.5 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" } + } + }, + { + "__comment": "PlaneZ5", + "from": [ 0.5, 0, 11 ], + "to": [ 16.5, 16, 11.001 ], + "rotation": { "origin": [ 0.5, 0, 11 ], "axis": "y", "angle": 22.5 }, + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" } + } + }, + { + "__comment": "PlaneX4", + "from": [ 11, 0, 0.5 ], + "to": [ 11.001, 16, 16.5 ], + "rotation": { "origin": [ 11, 0, 0.5 ], "axis": "y", "angle": -22.5 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" } + } + }, + { + "__comment": "PlaneZ5", + "from": [ 0.5, 0, 5 ], + "to": [ 16.5, 16, 5.001 ], + "rotation": { "origin": [ 0.5, 0, 5 ], "axis": "y", "angle": -22.5 }, + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#roots" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/textures/block/hydralux_bloom_side.png b/src/main/resources/assets/betterend/textures/block/hydralux_bloom_side.png deleted file mode 100644 index d66a4c18ce2284f358ee4db655bfb9f4ef22e2f8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 268 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!G)eKjv*HQ$$$R;w`W#u;Pjfz%XW`pih;&! zj(`6jeDh|Lv-4ZQ!F+hS|9wf3kfR54CdhQ$4c$0RP=|pBvwIgYevx=m|l6k&Gw*LqRm=!u#XGb0B> zhS|LFcFsJ9Sq=6uTx#%9X3j~9U=~bM?r|$)-IeY3nTeU1!R~6tp7sr0r-6=T@O1Ta JS?83{1OQM;Rwn=e diff --git a/src/main/resources/assets/betterend/textures/block/hydralux_flower_bottom.png b/src/main/resources/assets/betterend/textures/block/hydralux_flower_bottom.png index dbd33c141905f81619601181e784a5844f4b3256..22e70a26999d2c54f13340338aa19f09b807b339 100644 GIT binary patch delta 634 zcmdnR_l$pniWFmUkh>GZx^prw85kH?(j9#r85lP9bN@+Xov0|z#3nP*%AbjsYhqU} zGcT9I#P3e5KuSSjvnAt2CQ~pI$g`=)E%5cV^2jVM$uFw3g9!sAic-?7f>R5TgcK&L zupgt?0&fL_J zL=exuq98FjJGDe1H7~_hsYuD*j#WW*8Uq7keXysCV~B-+@1*@+%#H%>&s|!YC6Xr0 zN$6@2+xXc(bM4fXHR2xyj~qL9iCrLPi@=smn}oQ#xjQB}9pql5$i}2Jr>?l~&9ie4 z*pJ^ickWMGdReoH@6j7KZ~IMG%N8=7^~vzf$>>jO{>{wrTXv{RW$v~k^J8z`x8*E( zJiAkV^&XY_TFd_TCISLRA2z!8bgL%_R8-WgTE4*Q|BtQ{oL_c1Yfg1udBw^1$!h(u ztH!2svGK)e@Ue8PVVsg)#;U3ep z*NfuY%%!I;EuR14|HXq(-%B^lIgpmEyEG}&N?KvZ>+a3c{s*$M6*-uA*Xf6p=GvNv zKTECL`*FWyO#IP?&t;ucLK6Vvg7g0X delta 467 zcmaFHzl(2z%0x#ICf17+!~Gc*Ca%bxEWzlsIiB$%lazu@MQ(wwua!q;aY=qrrJaIJ zQA(OsaB895WJ6Z*$u%s?ne;)-bM^W_IenNUkcqAjEa#G1oLrPyP?DLS2U8y8;s#H(hilcN1Tzo5Bkxv4oaUIEp5(xkA6Lh8S?N(tLXTeGxnl+l zk%A}8W+*C1#VY$T+wJ+)mn6`^f4N78omuCE%!K+xlTAr8EUcstv);)0@#&{^SmB&F zhD?WL8&5v`!nDgf!DN$L$#nyz<;)RL4Xg?$_AfAD>|%}hHRJmJ`q_f(x%Fgf8MaMq zpDvvDxc9UF!J3@JMj^JIo}PrWMyH%K{H_~JNi*0Grl7~uC%@-h#>oYpkMw7VZ(v;0 z$Wd%}A}m6#qUgKqje;h&9ls?0P7f4pQjZUCcyy^JkzrHXjI|pK7}`$PXDAp6ePI$) i|IaSjq$|cyHE)~JT!yo^8Mql37(8A5T-G@yGywoXq_rmi diff --git a/src/main/resources/assets/betterend/textures/block/hydralux_roots.png b/src/main/resources/assets/betterend/textures/block/hydralux_roots.png index a1ee21419b6cb4633e9fdff147587acad8ca9ccb..1238efff7bfff718aa7cc4fdc3fff0be6cfad566 100644 GIT binary patch delta 336 zcmV-W0k8g-5bFYvB!2;OQb$4nuFf3k00004XF*Lt006O%3;baP00009a7bBm000ic z000ic0Tn1pfB*mi07*naR5(xFlD`W{w&vH3B{U}ECGH7E-uHa1U5 z85my4@KVOd_i%JPHv^k*-CpboiYcnL^1LRnsH}iauO22dF-p4$+HHJZ!yFL6wcY@7AYXFn=m)glo(T3aha{kuvD$6X5{@Sgw$Ix{y|MfoBHtWT=86 i5H0x|&%uSiL_}9+y>_g4(RBs@0000^>GyM+FM(=0}~(k z7)Cb@YJA{h^AWeO&8eBo20E3X;$sPMINhSSpl0(iM2(8i{d*iYT+o?a((AwN_y4}{ z_vo*SiwY+uYF^Vo5R~Z5b4&*3B=s23AN;4@d`yAUz+m3HG6W4uR*yJn-TD*=N@(HT z9>wD-AZan6r5Mr6YQupbKts^jap53E&tw(Y%ldf1hIG{bh`>B!L#7&CxGQL9OZdD> zi7l=ybkmhHX)A+_%Yny+Nk9-_6$%aq{DMq|ZAgTd1Z(v+hQJYsGSh~PR|R2@s|dD> z5(^u(CX^-&I@oO05+>ZLGi1X$oG@d!86)&4PLQ~X)LY@`4*_Zt!;zC6xlt`}WkX67 zB}igeC=}9$^jcB!VT9Fc#c&;_)1d%?$`yh_g;7CH>tS%PGA;2zg%<@_Wu&}fnPNkL z)9w%g!5FO|N7DonhJ~phMrd(0qzI6qW4K_MJK#D&X6It5vw1e$d^YzPQj%kvCrrY&BYvzSnvvwBh1Xuwg6nKPnh1LZYYImXKo zvHcE_E>nxE?(gn%Mx+79KdKyOHX3Nkh#DZ&uY60~lGW$zZh5U?c9;qgK{HqgD=(c^O7Wn@mR9NLbW{j`Rqb$IGC47139u znEf!i^7C+{El7%1+uerHYMogIiQeY>$j5UjNB4(HSU~!W;&-ddBBz8Xi5>3)xqF`e z!k*?|rplk~{`soeZL7EYKKt>1x{oG@E};Y;3nnOrsPSOxtm!Td_V21ip7okbJ#aAW z)MaeSf{WOkW(7bkfhk<2Ie!3x;;uR!^Dwx{+fulF z1wdI|)g;tSspE4tjXB@mdAf4%bg1j$rrMPF4ct#lnhuU$m7i%DF}OTuQ~UIOU!3ui z$LB7py5E-e{*GThJ9yTS^c!qPtg8AG&Ci8NQd&94# z-|i}}A6c+=D6}Sbn&+&>d? j^-F&^{Q7?FH@8ybca(9}ld9EEKjfTH==l2W8C8D+Yl_-SV~B-+@}K|z?GHCFPI%fAV8*5JM9a;s z!)$_;nn5>{!$w9G=9Kq>Pg^VRO8$40IHk(lU}9HQ^7a4K)w>_IO?cCEe*S#Jnwq~& z4^O_e4iF4!FqKN&mb<@h=E2}#@ija1uE}kPny~i7#S=_vii{J|rhkapa8{wl+ZYutCz|c4{K@Ha_{fCZHc2-Fsf~;+i99?ETN+zf<*b`_13ky!>FVdQ I&MBb@0E3@(^Z)<= literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/betterend/textures/block/hydralux_sapling_2.png b/src/main/resources/assets/betterend/textures/block/hydralux_sapling_2.png new file mode 100644 index 0000000000000000000000000000000000000000..774fa495a6bfbe376024bbd01495e9d4b2791d4d GIT binary patch literal 350 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1en@Uy3jV~B-+@}K|z?GHCFPI%fAV8*5JM9a;s z!)#J4|D}dCoXfcr7HFPjUAHUmnp{PN;_e34Gl!TQW(jAh8P)vz)AR80YjK5z{~dZI z8qcvT-N-Z{O=3qm^FcSZ2;PR9Oq+gQySbQ0U;ZxZ=Z%a#1`L_=?oZ}4dwAiQbAq8j zM8ONG2we}ke2E5=-7U`#&8`1?Ub~IkUB2Pw4TdoN15EEuzP0AbkE?6yN@BOz%W&yW zf8;zfUkzY)E1_ks{&7W?(pj^#sFV))QS5 s{_+d8OZKecTg|Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!TOn#=#IS9kwEc3|;;5E~?h z>;e#*1X zA)R2S_1`}w49vcKUl>o48R%& zAk8k}xnSpmz~QHN7#Kc%2eZ)u&M<)a{mJb+3{UR7V^}r!2#RZA07DSwM35^$nm;S@ zF|X*Z@Ku0|Nk3!=u9nRBey|00000fhdEP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!T6Y59fkzW|R}TuMH06p(s(n-h#EI9K zd!r-bt`fy^<|`Z}vTcX5`4l2v#q5A+JTygCcu2M_B=_2b^yQxD;vGU zW7=F8#u=QBmK5)QEJ=vfxwxN6Xa;iP*AHdt)d=r~37%mxF*bmBJY4?OWfQ*BAcS~G zG~+!Q@ZQ+qX|P)m)pYP*4eFm&(d&%7zn|UwMDo3KFwnp+1pQ*rXkbb;iNS{kLBbma Z{Q@xqVL}PwD|-L{002ovPDHLkV1g?Fn%V#W literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/betterend/textures/block/hydralux_spore.png b/src/main/resources/assets/betterend/textures/block/hydralux_spore.png deleted file mode 100644 index 560562628a45505f7f636099dbfee7ae6a0103f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 250 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!G2E{#}EtuWC>PfrZcb4{op?opqI(8Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!T$p-S=kZ?OGs(!{Z&(UaQkANon{pq1&qg?@NC8JfVxTJC9Se(L-mwLG5mx_WGL! z~JS~=pvMi_8>JsH9r}6uglFyWWzO$e@5F~U(bOO9Sjl7XGf&>5& zL=mdg%7HI}s0XuY%H*$)lo!a_7ki8m2;cw?a@DyI=7tEyh>1iy0QvF$&9y5cF|dF! z#x0Fl9^!!Hy$<#dwoIjJjhjb&^T$63MiA!_MdavY*Ig|P)o=n*U0MWSB61+Z!0{-t zJAYu4;Hn&i0Ny-+_rKhz@o$jjE!hAL#S)PaM881v%}|OL+SvdA002ovPDHLkV1mHs!}I_E literal 0 HcmV?d00001 From a54f7d5e6df982488288f8810852237cdc02a725 Mon Sep 17 00:00:00 2001 From: paulevsGitch Date: Fri, 4 Dec 2020 22:54:50 +0300 Subject: [PATCH 07/11] Flowers generation --- .../ru/betterend/registry/EndFeatures.java | 2 ++ .../world/biome/BiomeSulfurSprings.java | 7 +++-- .../world/features/HydraluxFeature.java | 25 ++++++++++++++++++ .../models/block/hydralux_flower_big_top.json | 8 +++--- .../textures/block/hydralux_flower_bud.png | Bin 1891 -> 2113 bytes 5 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 src/main/java/ru/betterend/world/features/HydraluxFeature.java diff --git a/src/main/java/ru/betterend/registry/EndFeatures.java b/src/main/java/ru/betterend/registry/EndFeatures.java index e081cf7a..87d88e83 100644 --- a/src/main/java/ru/betterend/registry/EndFeatures.java +++ b/src/main/java/ru/betterend/registry/EndFeatures.java @@ -18,6 +18,7 @@ import ru.betterend.world.features.EndFeature; import ru.betterend.world.features.EndLilyFeature; import ru.betterend.world.features.EndLotusFeature; import ru.betterend.world.features.EndLotusLeafFeature; +import ru.betterend.world.features.HydraluxFeature; import ru.betterend.world.features.SinglePlantFeature; import ru.betterend.world.features.UnderwaterPlantFeature; import ru.betterend.world.features.VineFeature; @@ -87,6 +88,7 @@ public class EndFeatures { public static final EndFeature END_LILY_RARE = new EndFeature("end_lily_rare", new EndLilyFeature(3), 4); public static final EndFeature END_LOTUS = new EndFeature("end_lotus", new EndLotusFeature(7), 5); public static final EndFeature END_LOTUS_LEAF = new EndFeature("end_lotus_leaf", new EndLotusLeafFeature(20), 25); + public static final EndFeature HYDRALUX = new EndFeature("hydralux", new HydraluxFeature(5), 5); // Terrain // public static final EndFeature END_LAKE = EndFeature.makeLakeFeature("end_lake", new EndLakeFeature(), 4); diff --git a/src/main/java/ru/betterend/world/biome/BiomeSulfurSprings.java b/src/main/java/ru/betterend/world/biome/BiomeSulfurSprings.java index 934e8828..776409df 100644 --- a/src/main/java/ru/betterend/world/biome/BiomeSulfurSprings.java +++ b/src/main/java/ru/betterend/world/biome/BiomeSulfurSprings.java @@ -1,8 +1,6 @@ package ru.betterend.world.biome; import net.minecraft.entity.EntityType; -import net.minecraft.world.gen.GenerationStep; -import net.minecraft.world.gen.carver.ConfiguredCarvers; import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndParticles; import ru.betterend.world.surface.SurfaceBuilders; @@ -11,7 +9,8 @@ public class BiomeSulfurSprings extends EndBiome { public BiomeSulfurSprings() { super(new BiomeDefinition("sulfur_springs") .setSurface(SurfaceBuilders.SULPHURIC_SURFACE) - .setWaterAndFogColor(25, 90, 157) + .setWaterColor(25, 90, 157) + .setWaterFogColor(30, 65, 61) .setFogColor(207, 194, 62) .setFogDensity(1.5F) .setCaves(false) @@ -19,7 +18,7 @@ public class BiomeSulfurSprings extends EndBiome { .addFeature(EndFeatures.GEYSER) .addFeature(EndFeatures.SULPHURIC_LAKE) .addFeature(EndFeatures.SULPHURIC_CAVE) - .addCarver(GenerationStep.Carver.AIR, ConfiguredCarvers.CAVE) + .addFeature(EndFeatures.HYDRALUX) .addMobSpawn(EntityType.ENDERMAN, 50, 1, 4)); } } diff --git a/src/main/java/ru/betterend/world/features/HydraluxFeature.java b/src/main/java/ru/betterend/world/features/HydraluxFeature.java new file mode 100644 index 00000000..48f4e46f --- /dev/null +++ b/src/main/java/ru/betterend/world/features/HydraluxFeature.java @@ -0,0 +1,25 @@ +package ru.betterend.world.features; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.StructureWorldAccess; +import ru.betterend.blocks.BlockHydraluxSapling; +import ru.betterend.registry.EndBlocks; + +public class HydraluxFeature extends UnderwaterPlantScatter { + public HydraluxFeature(int radius) { + super(radius); + } + + @Override + public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) { + BlockHydraluxSapling seed = (BlockHydraluxSapling) EndBlocks.HYDRALUX_SAPLING; + seed.grow(world, random, blockPos); + } + + @Override + protected int getChance() { + return 15; + } +} diff --git a/src/main/resources/assets/betterend/models/block/hydralux_flower_big_top.json b/src/main/resources/assets/betterend/models/block/hydralux_flower_big_top.json index 24cc4a5f..4e15b836 100644 --- a/src/main/resources/assets/betterend/models/block/hydralux_flower_big_top.json +++ b/src/main/resources/assets/betterend/models/block/hydralux_flower_big_top.json @@ -19,8 +19,8 @@ }, { "__comment": "PlaneX9", - "from": [ 5.5, 3, 5.5 ], - "to": [ 5.501, 11, 13.5 ], + "from": [ 5.5, 2, 5.5 ], + "to": [ 5.501, 10, 13.5 ], "rotation": { "origin": [ 5.5, 3, 5.5 ], "axis": "y", "angle": 45 }, "shade": false, "faces": { @@ -30,8 +30,8 @@ }, { "__comment": "PlaneX9", - "from": [ 10.5, 3, 5.5 ], - "to": [ 10.501, 11, 13.5 ], + "from": [ 10.5, 2, 5.5 ], + "to": [ 10.501, 10, 13.5 ], "rotation": { "origin": [ 10.5, 3, 5.5 ], "axis": "y", "angle": -45 }, "shade": false, "faces": { diff --git a/src/main/resources/assets/betterend/textures/block/hydralux_flower_bud.png b/src/main/resources/assets/betterend/textures/block/hydralux_flower_bud.png index 938ba1230a396e0c80c6229c6677f300f940279a..e208d9697dc2021488f4857ad33f23c34857e154 100644 GIT binary patch delta 342 zcmaFNcTix01ryuCjaCzw*o~}A4XljJCSPPygR}oJ1*oJM8l|P0o2Kd}rJ7jiTBMky z=_Z*NCF!On8CawmngFqZ(dHs%7pBS2Sj>o0J=uX(3T{Or>pBjLs9DPy7#Q6qi?eCf z2c0>5{3OF-#|NjEzvq#Ut7Vt=;MmY0(!}7gxx+#}hUv)u!hf2H%np8RjI5!BZS33Q z51BT{IQDSQaOh$=Vj+2N&!3h@LK_qV4s-5uaC7CzQ9dE6z+lu9A>P3J@#NfcjdcyI zN*+B67!{b72rOZY4iPe85G&o#&|JwZvcSNM`}t3=V4gL@j!Oy12V#q_6n@^!XE vO}2trH}^i3xp7-zug{TRe?Q5;IVr_ZWwkV`^T?GN1|aZs^>bP0l+XkKuu69a delta 238 zcmVDZ-ewQ5$pHMf3PQO0GmCTAEyZ_&Hw-a07*qoM6N<$f(wFMh5!Hn From e05eeb89de65536382b374e51c5bce2d70c48a36 Mon Sep 17 00:00:00 2001 From: paulevsGitch Date: Fri, 4 Dec 2020 23:03:03 +0300 Subject: [PATCH 08/11] Fixes --- .../world/features/terrain/GeyserFeature.java | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/main/java/ru/betterend/world/features/terrain/GeyserFeature.java b/src/main/java/ru/betterend/world/features/terrain/GeyserFeature.java index 630ca1a0..934c95a2 100644 --- a/src/main/java/ru/betterend/world/features/terrain/GeyserFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/GeyserFeature.java @@ -140,7 +140,7 @@ public class GeyserFeature extends DefaultFeature { BlocksHelper.setWithoutUpdate(world, pos, WATER); Mutable mut = new Mutable().set(pos); count = getYOnSurface(world, pos.getX(), pos.getZ()) - pos.getY(); - for (int i = 0; i <= count; i++) { + for (int i = 0; i < count; i++) { BlocksHelper.setWithoutUpdate(world, mut, WATER); for (Direction dir: BlocksHelper.HORIZONTAL) { BlocksHelper.setWithoutUpdate(world, mut.offset(dir), WATER); @@ -151,24 +151,26 @@ public class GeyserFeature extends DefaultFeature { for (int i = 0; i < 150; i++) { mut.set(pos).move(MHelper.floor(random.nextGaussian() * 4 + 0.5), -halfHeight - 10, MHelper.floor(random.nextGaussian() * 4 + 0.5)); int dist = MHelper.floor(6 - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ())) + random.nextInt(2); - BlockState state = world.getBlockState(mut); - while (state.isOf(Blocks.WATER)) { - mut.setY(mut.getY() - 1); - state = world.getBlockState(mut); - } - if (state.isIn(EndTags.GEN_TERRAIN)) { - for (int j = 0; j < dist; j++) { - BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone); - mut.setY(mut.getY() + 1); - } - BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.HYDROTHERMAL_VENT); - mut.setY(mut.getY() + 1); - state = world.getBlockState(mut); + if (dist >= 0) { + BlockState state = world.getBlockState(mut); while (state.isOf(Blocks.WATER)) { - BlocksHelper.setWithoutUpdate(world, mut, Blocks.BUBBLE_COLUMN.getDefaultState().with(BubbleColumnBlock.DRAG, false)); - world.getBlockTickScheduler().schedule(mut, Blocks.BUBBLE_COLUMN, MHelper.randRange(8, 32, random)); + mut.setY(mut.getY() - 1); + state = world.getBlockState(mut); + } + if (state.isIn(EndTags.GEN_TERRAIN)) { + for (int j = 0; j <= dist; j++) { + BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone); + mut.setY(mut.getY() + 1); + } + BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.HYDROTHERMAL_VENT); mut.setY(mut.getY() + 1); state = world.getBlockState(mut); + while (state.isOf(Blocks.WATER)) { + BlocksHelper.setWithoutUpdate(world, mut, Blocks.BUBBLE_COLUMN.getDefaultState().with(BubbleColumnBlock.DRAG, false)); + world.getBlockTickScheduler().schedule(mut, Blocks.BUBBLE_COLUMN, MHelper.randRange(8, 32, random)); + mut.setY(mut.getY() + 1); + state = world.getBlockState(mut); + } } } } From bb99374fb562651e2278dfb54a3b539f3a579b60 Mon Sep 17 00:00:00 2001 From: paulevsGitch Date: Fri, 4 Dec 2020 23:15:36 +0300 Subject: [PATCH 09/11] Petal block --- .../ru/betterend/blocks/HydraluxPetalBlock.java | 17 +++++++++++++++++ .../java/ru/betterend/registry/EndBlocks.java | 2 ++ 2 files changed, 19 insertions(+) create mode 100644 src/main/java/ru/betterend/blocks/HydraluxPetalBlock.java diff --git a/src/main/java/ru/betterend/blocks/HydraluxPetalBlock.java b/src/main/java/ru/betterend/blocks/HydraluxPetalBlock.java new file mode 100644 index 00000000..3c939594 --- /dev/null +++ b/src/main/java/ru/betterend/blocks/HydraluxPetalBlock.java @@ -0,0 +1,17 @@ +package ru.betterend.blocks; + +import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; +import net.minecraft.block.Material; +import net.minecraft.entity.Entity; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import ru.betterend.blocks.basis.BlockBase; + +public class HydraluxPetalBlock extends BlockBase { + public HydraluxPetalBlock() { + super(FabricBlockSettings.of(Material.PLANT).hardness(1).resistance(1).breakByHand(true)); + } + + @Override + public void onLandedUpon(World world, BlockPos pos, Entity entity, float distance) {} +} diff --git a/src/main/java/ru/betterend/registry/EndBlocks.java b/src/main/java/ru/betterend/registry/EndBlocks.java index be87968f..a9562789 100644 --- a/src/main/java/ru/betterend/registry/EndBlocks.java +++ b/src/main/java/ru/betterend/registry/EndBlocks.java @@ -53,6 +53,7 @@ import ru.betterend.blocks.EndStoneSmelter; import ru.betterend.blocks.EnderBlock; import ru.betterend.blocks.EternalPedestal; import ru.betterend.blocks.EternalRunedFlavolite; +import ru.betterend.blocks.HydraluxPetalBlock; import ru.betterend.blocks.InfusionPedestal; import ru.betterend.blocks.PedestalVanilla; import ru.betterend.blocks.RunedFlavolite; @@ -168,6 +169,7 @@ public class EndBlocks { public static final Block HYDRALUX_SAPLING = registerBlock("hydralux_sapling", new BlockHydraluxSapling()); public static final Block HYDRALUX = registerBlock("hydralux", new BlockHydralux()); + public static final Block HYDRALUX_PETAL_BLOCK = registerBlock("hydralux_petal_block", new HydraluxPetalBlock()); public static final Block CAVE_BUSH = registerBlock("cave_bush", new BlockSimpleLeaves(MaterialColor.MAGENTA)); From 329a59c7bedf5feb94f64a45ae80790bebe7665b Mon Sep 17 00:00:00 2001 From: paulevsGitch Date: Fri, 4 Dec 2020 23:18:50 +0300 Subject: [PATCH 10/11] Fixes --- .../java/ru/betterend/registry/EndBlocks.java | 2 +- ...dralux_spore.json => hydralux_sapling.json} | 0 .../textures/block/hydralux_sapling_4.png | Bin 379 -> 1789 bytes 3 files changed, 1 insertion(+), 1 deletion(-) rename src/main/resources/assets/betterend/models/item/{hydralux_spore.json => hydralux_sapling.json} (100%) diff --git a/src/main/java/ru/betterend/registry/EndBlocks.java b/src/main/java/ru/betterend/registry/EndBlocks.java index a9562789..576554b6 100644 --- a/src/main/java/ru/betterend/registry/EndBlocks.java +++ b/src/main/java/ru/betterend/registry/EndBlocks.java @@ -168,7 +168,7 @@ public class EndBlocks { public static final Block END_LILY_SEED = registerBlock("end_lily_seed", new BlockEndLilySeed()); public static final Block HYDRALUX_SAPLING = registerBlock("hydralux_sapling", new BlockHydraluxSapling()); - public static final Block HYDRALUX = registerBlock("hydralux", new BlockHydralux()); + public static final Block HYDRALUX = registerBlockNI("hydralux", new BlockHydralux()); public static final Block HYDRALUX_PETAL_BLOCK = registerBlock("hydralux_petal_block", new HydraluxPetalBlock()); public static final Block CAVE_BUSH = registerBlock("cave_bush", new BlockSimpleLeaves(MaterialColor.MAGENTA)); diff --git a/src/main/resources/assets/betterend/models/item/hydralux_spore.json b/src/main/resources/assets/betterend/models/item/hydralux_sapling.json similarity index 100% rename from src/main/resources/assets/betterend/models/item/hydralux_spore.json rename to src/main/resources/assets/betterend/models/item/hydralux_sapling.json diff --git a/src/main/resources/assets/betterend/textures/block/hydralux_sapling_4.png b/src/main/resources/assets/betterend/textures/block/hydralux_sapling_4.png index 297150c3d4dd000d0caa19bad38926b8b894d0a2..47a49fad85f1bec99bc86105ccddb410b1a6754f 100644 GIT binary patch literal 1789 zcmcIlTWB0r7@jmVnwmnfN=u}6oLW$HcFx>)hHgUKjV91d(sZRMDD>=^GrMDU=1gZM z*-Z$VriwRE`%t1m4fvuDUR(4f!7E5blc0SNL@Ir0p0uD3B1YFUd$ULz^5VdmIcLsy zzW@6#^Ut#*Ll5oT(Y=FVn4NOn~1mxXpuZlR9v5;8Rk%L#fNAdM{FJ!952OPUHXJ$9V^8hQ?nrJr*Y94 zm=5sK>7g8&9!G}7_4crbDkddxaRk|lTk=A)lHzK-CY{Hx1&*yjqVW{h7aL^9vLkGo z1ejG58jnOpVs#@SYQT_``&kKyx&U-RlzAYUKr>~7ZCo6+7Ff19nt8Bci>^{!F^YUs z5X$9pqAVv!P!L4JFa#h8lEhO4A5M7@tnglVpvjQIAqpHna)`&qj4)3oq7+A!)?IM@ z7OfXH!bAfmRG=@22@t!~1ZK0FLtVFp4x|1_YNes~y2N2_%E!Ve4#`A-aQ`Isq61B1 z7HXaKCxTMVQws^Wgk1^?sW7o+$}f_Lghg@#KU&)@Z+tTyU>K1gM@XresF5ZMn@-1x zNwW7Gb3BWb!+T>Rl}6h}oR9LF+~SO!ToY4N}iH6E&p#3w=C=2caJdfrxb186l}^n8Y( zi8zAs`FiDA1W}GwkW58JQqrLAS)!ryB2qNokn;+!N>J4xkaR5CO}62{p&t({UCSD) zvM8gbsrjTXOFTwM;Vn(k`J`g&JS}}&2f&t8OXpY%nKlVrNK3_WVF3%iSK!!x)uc&@ z1X*Iyn9FfNQ+DdbfD_W}O*KA|qxfWFR&v-{-I)-@<(}eDoM&utjn~d~qPI1jb=q<5=eFYlnt<;xrBmE(q++6+Ea{vFTZv+<=p;y4Pg9=>ij}Z5odTNCK zX05h&OuYO%_uTi){9Bcd z$B%Tre`Wr~U!+HRf+s8OC;t9@xU>EI2hNv|F&FH;fBw37wd=?7C3)ArXV{fab@!2t znZ@T%UHE$f-`Kg8C$>L)a`~f+mzX6Y59fkzW|R}TuMH06p(s(n-h#EI9Kd!r-bt`fy^<|`Z}vTcX5`4l2 zv#q5A+JTygCcu2M_B=_2b^yQxD;vGUW7=F8#u=QBmK5)QEJ=vfxwxN6Xa;iP*AHdt z)d=r~37%mxFUk&P?RnhB=yuY8_ y{6zA-bTH7sF9iK!&}d*vHHpE820_9b1^ogs17Si5;wyUq0000 Date: Fri, 4 Dec 2020 23:53:49 +0300 Subject: [PATCH 11/11] Vent particles optimization --- .../ru/betterend/blocks/BlockHydralux.java | 6 ++- .../blocks/BlockHydrothermalVent.java | 25 +++++++++++- .../entities/BlockEntityHydrothermalVent.java | 6 +-- .../java/ru/betterend/registry/EndItems.java | 1 + .../world/features/terrain/GeyserFeature.java | 36 +++++++++++++++++- .../textures/item/hydralux_petal.png | Bin 0 -> 371 bytes 6 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 src/main/resources/assets/betterend/textures/item/hydralux_petal.png diff --git a/src/main/java/ru/betterend/blocks/BlockHydralux.java b/src/main/java/ru/betterend/blocks/BlockHydralux.java index b1405666..cbba5ddb 100644 --- a/src/main/java/ru/betterend/blocks/BlockHydralux.java +++ b/src/main/java/ru/betterend/blocks/BlockHydralux.java @@ -25,6 +25,7 @@ import net.minecraft.world.WorldView; import ru.betterend.blocks.BlockProperties.HydraluxShape; import ru.betterend.blocks.basis.BlockUnderwaterPlant; import ru.betterend.registry.EndBlocks; +import ru.betterend.registry.EndItems; import ru.betterend.util.MHelper; public class BlockHydralux extends BlockUnderwaterPlant { @@ -78,7 +79,10 @@ public class BlockHydralux extends BlockUnderwaterPlant { @Override public List getDroppedStacks(BlockState state, LootContext.Builder builder) { HydraluxShape shape = state.get(SHAPE); - if (shape == HydraluxShape.ROOTS) { + if (shape == HydraluxShape.FLOWER_BIG_BOTTOM || shape == HydraluxShape.FLOWER_SMALL_BOTTOM) { + return Lists.newArrayList(new ItemStack(EndItems.HYDRALUX_PETAL, MHelper.randRange(1, 4, MHelper.RANDOM))); + } + else if (shape == HydraluxShape.ROOTS) { return Lists.newArrayList(new ItemStack(EndBlocks.HYDRALUX_SAPLING, MHelper.randRange(1, 2, MHelper.RANDOM))); } return Collections.emptyList(); diff --git a/src/main/java/ru/betterend/blocks/BlockHydrothermalVent.java b/src/main/java/ru/betterend/blocks/BlockHydrothermalVent.java index 1af7533b..8f418e90 100644 --- a/src/main/java/ru/betterend/blocks/BlockHydrothermalVent.java +++ b/src/main/java/ru/betterend/blocks/BlockHydrothermalVent.java @@ -4,6 +4,8 @@ import java.util.Random; import org.jetbrains.annotations.Nullable; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags; import net.minecraft.block.Block; @@ -22,6 +24,7 @@ import net.minecraft.fluid.FluidState; import net.minecraft.fluid.Fluids; import net.minecraft.item.ItemPlacementContext; import net.minecraft.item.ItemStack; +import net.minecraft.particle.ParticleTypes; import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.BlockSoundGroup; import net.minecraft.state.StateManager; @@ -37,9 +40,11 @@ import net.minecraft.world.WorldView; import ru.betterend.blocks.basis.BlockBaseNotFull; import ru.betterend.blocks.entities.BlockEntityHydrothermalVent; import ru.betterend.registry.EndBlocks; +import ru.betterend.registry.EndParticles; public class BlockHydrothermalVent extends BlockBaseNotFull implements BlockEntityProvider, FluidFillable, Waterloggable { public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED; + public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVATED; private static final VoxelShape SHAPE = Block.createCuboidShape(1, 1, 1, 15, 16, 15); public BlockHydrothermalVent() { @@ -48,12 +53,12 @@ public class BlockHydrothermalVent extends BlockBaseNotFull implements BlockEnti .sounds(BlockSoundGroup.STONE) .noCollision() .requiresTool()); - this.setDefaultState(getDefaultState().with(WATERLOGGED, true)); + this.setDefaultState(getDefaultState().with(WATERLOGGED, true).with(ACTIVATED, false)); } @Override protected void appendProperties(StateManager.Builder builder) { - builder.add(WATERLOGGED); + builder.add(WATERLOGGED, ACTIVATED); } @Override @@ -116,4 +121,20 @@ public class BlockHydrothermalVent extends BlockBaseNotFull implements BlockEnti scheduledTick(state,(ServerWorld) world, pos, world.random); } } + + @Environment(EnvType.CLIENT) + public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) { + if (!state.get(ACTIVATED) && random.nextBoolean()) { + super.randomDisplayTick(state, world, pos, random); + double x = pos.getX() + random.nextDouble(); + double y = pos.getY() + 0.9 + random.nextDouble() * 0.3; + double z = pos.getZ() + random.nextDouble(); + if (state.get(WATERLOGGED)) { + world.addParticle(EndParticles.GEYSER_PARTICLE, x, y, z, 0, 0, 0); + } + else { + world.addParticle(ParticleTypes.BUBBLE, x, y, z, 0, 0, 0); + } + } + } } diff --git a/src/main/java/ru/betterend/blocks/entities/BlockEntityHydrothermalVent.java b/src/main/java/ru/betterend/blocks/entities/BlockEntityHydrothermalVent.java index b2210495..6508ad28 100644 --- a/src/main/java/ru/betterend/blocks/entities/BlockEntityHydrothermalVent.java +++ b/src/main/java/ru/betterend/blocks/entities/BlockEntityHydrothermalVent.java @@ -16,13 +16,13 @@ public class BlockEntityHydrothermalVent extends BlockEntity implements Tickable @Override public void tick() { - if (world.random.nextInt(32) == 0) { + if (world.random.nextInt(20) == 0) { double x = pos.getX() + world.random.nextDouble(); double y = pos.getY() + 0.9 + world.random.nextDouble() * 0.3; double z = pos.getZ() + world.random.nextDouble(); BlockState state = getCachedState(); - if (state.isOf(EndBlocks.HYDROTHERMAL_VENT)) { - if (getCachedState().get(BlockHydrothermalVent.WATERLOGGED)) { + if (state.isOf(EndBlocks.HYDROTHERMAL_VENT) && state.get(BlockHydrothermalVent.ACTIVATED)) { + if (state.get(BlockHydrothermalVent.WATERLOGGED)) { world.addParticle(EndParticles.GEYSER_PARTICLE, x, y, z, 0, 0, 0); } else { diff --git a/src/main/java/ru/betterend/registry/EndItems.java b/src/main/java/ru/betterend/registry/EndItems.java index d06c933f..79752504 100644 --- a/src/main/java/ru/betterend/registry/EndItems.java +++ b/src/main/java/ru/betterend/registry/EndItems.java @@ -62,6 +62,7 @@ public class EndItems { public final static Item AMBER_GEM = registerItem("amber_gem"); public final static Item GLOWING_BULB = registerItem("glowing_bulb"); public final static Item CRYSTALLINE_SULPHUR = registerItem("crystalline_sulphur"); + public final static Item HYDRALUX_PETAL = registerItem("hydralux_petal"); // Armor // public static final Item TERMINITE_HELMET = registerItem("terminite_helmet", new ArmorItem(EndArmorMaterial.TERMINITE, EquipmentSlot.HEAD, makeSettings())); diff --git a/src/main/java/ru/betterend/world/features/terrain/GeyserFeature.java b/src/main/java/ru/betterend/world/features/terrain/GeyserFeature.java index 934c95a2..99115bd0 100644 --- a/src/main/java/ru/betterend/world/features/terrain/GeyserFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/GeyserFeature.java @@ -15,6 +15,7 @@ import net.minecraft.util.math.MathHelper; import net.minecraft.world.StructureWorldAccess; import net.minecraft.world.gen.chunk.ChunkGenerator; import net.minecraft.world.gen.feature.DefaultFeatureConfig; +import ru.betterend.blocks.BlockHydrothermalVent; import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndTags; @@ -150,7 +151,8 @@ public class GeyserFeature extends DefaultFeature { for (int i = 0; i < 150; i++) { mut.set(pos).move(MHelper.floor(random.nextGaussian() * 4 + 0.5), -halfHeight - 10, MHelper.floor(random.nextGaussian() * 4 + 0.5)); - int dist = MHelper.floor(6 - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ())) + random.nextInt(2); + float distRaw = MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ()); + int dist = MHelper.floor(6 - distRaw) + random.nextInt(2); if (dist >= 0) { BlockState state = world.getBlockState(mut); while (state.isOf(Blocks.WATER)) { @@ -162,7 +164,37 @@ public class GeyserFeature extends DefaultFeature { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone); mut.setY(mut.getY() + 1); } - BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.HYDROTHERMAL_VENT); + state = EndBlocks.HYDROTHERMAL_VENT.getDefaultState().with(BlockHydrothermalVent.ACTIVATED, distRaw < 2); + BlocksHelper.setWithoutUpdate(world, mut, state); + mut.setY(mut.getY() + 1); + state = world.getBlockState(mut); + while (state.isOf(Blocks.WATER)) { + BlocksHelper.setWithoutUpdate(world, mut, Blocks.BUBBLE_COLUMN.getDefaultState().with(BubbleColumnBlock.DRAG, false)); + world.getBlockTickScheduler().schedule(mut, Blocks.BUBBLE_COLUMN, MHelper.randRange(8, 32, random)); + mut.setY(mut.getY() + 1); + state = world.getBlockState(mut); + } + } + } + } + + for (int i = 0; i < 10; i++) { + mut.set(pos).move(MHelper.floor(random.nextGaussian() * 0.7 + 0.5), -halfHeight - 10, MHelper.floor(random.nextGaussian() * 0.7 + 0.5)); + float distRaw = MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ()); + int dist = MHelper.floor(6 - distRaw) + random.nextInt(2); + if (dist >= 0) { + BlockState state = world.getBlockState(mut); + while (state.isOf(Blocks.WATER)) { + mut.setY(mut.getY() - 1); + state = world.getBlockState(mut); + } + if (state.isIn(EndTags.GEN_TERRAIN)) { + for (int j = 0; j <= dist; j++) { + BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone); + mut.setY(mut.getY() + 1); + } + state = EndBlocks.HYDROTHERMAL_VENT.getDefaultState().with(BlockHydrothermalVent.ACTIVATED, distRaw < 2); + BlocksHelper.setWithoutUpdate(world, mut, state); mut.setY(mut.getY() + 1); state = world.getBlockState(mut); while (state.isOf(Blocks.WATER)) { diff --git a/src/main/resources/assets/betterend/textures/item/hydralux_petal.png b/src/main/resources/assets/betterend/textures/item/hydralux_petal.png new file mode 100644 index 0000000000000000000000000000000000000000..3f38d97b79b14430bef7b11f23e498f4f02ea9de GIT binary patch literal 371 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1en1Ba)JV~B-+a*6`upa1{mPc<>PxlP)#m}y3$ zi=^RtYv#PtpqD%w1y=F!81OLM