diff --git a/src/main/generated/.cache/04fb54d911b9daf8fa33d64269c96354f0dfbd70 b/src/main/generated/.cache/04fb54d911b9daf8fa33d64269c96354f0dfbd70 new file mode 100644 index 0000000..4cdabfc --- /dev/null +++ b/src/main/generated/.cache/04fb54d911b9daf8fa33d64269c96354f0dfbd70 @@ -0,0 +1,87 @@ +// 1.21 2024-07-31T21:53:49.9681826 MITEequilibrium/Recipes +314fc1cfe6b117e5dc27cce742a9ee39a7c32af1 data\miteequilibrium\recipe\copper_axe.json +c05cc1b8a4428745e97c814ac9ad1259d2eb8765 data\miteequilibrium\recipe\silver_shovel.json +ecde098f400d9a35afb8f04ed623b40425db6cf4 data\miteequilibrium\advancement\recipes\misc\adamantium_block.json +0624b2eae6c0b84dc2dfc512c914898141cb6f91 data\miteequilibrium\advancement\recipes\misc\copper_from_block.json +3e0d46555613cd73eaa81a866536b99f089089e0 data\miteequilibrium\recipe\silver_dagger.json +54f74d888e4362b35df5049818207f1258366c08 data\miteequilibrium\advancement\recipes\tools\mithril_axe.json +17e464467be181d883fb2219384e7aceb30ce65f data\miteequilibrium\recipe\adamantium_pickaxe.json +6374346478a2bf9d980d17f5bb88b9ab8e464886 data\miteequilibrium\advancement\recipes\tools\silver_hoe.json +3516d074d46e4eea0a263a6104507dcad7bb43c4 data\miteequilibrium\recipe\flint_shovel.json +a8d8e5356cb496866f5cbeefe448617950de370e data\miteequilibrium\recipe\mithril_axe.json +e1c31abe2a1f2a608e0d9c11f77869c4796ca2c7 data\miteequilibrium\recipe\adamantium_axe.json +eef83431d46825b331d3a0255814920e6d1d4479 data\miteequilibrium\recipe\adamantium_from_block.json +317fa84f40a330d88ca0907eb5112922f15e84c2 data\miteequilibrium\recipe\mithril_nugget.json +7ebc48c9822475cc7072c13c8a3a26f48ceaf627 data\miteequilibrium\recipe\copper_shovel.json +ba14b1369fa6259102ec53e59fc18c854d675d80 data\miteequilibrium\recipe\flint_axe.json +0bb1bcc6f65df2ac5a6fa1a109a7c5d093597cc8 data\miteequilibrium\recipe\mithril_dagger.json +c08da4b746ba6452cc648575c0956af2ef4bfa24 data\miteequilibrium\recipe\copper_from_block.json +bf21478f77fd259742eabaf317fbec6f86dbdfb0 data\miteequilibrium\advancement\recipes\tools\flint_shovel.json +555053cc5fd09b6858ef15a89c77f7a3f21f57f8 data\miteequilibrium\recipe\mithril_shovel.json +40598ba96ecd68bea4d6f51c7a102fa29dab3256 data\miteequilibrium\advancement\recipes\tools\adamantium_pickaxe.json +17d23f6ff2e1ecbdf92fbbc49a67368a1b9bac81 data\miteequilibrium\recipe\copper_dagger.json +fc10f6e12e7252d1c3972173612eb627455b3d98 data\miteequilibrium\recipe\mithril_from_block.json +f5d2f456df2fe0a25320ff5e72013aa32778b02e data\miteequilibrium\advancement\recipes\misc\adamantium.json +1aaf0449989350824d610edd4fa6b6fe0f4bab1c data\miteequilibrium\recipe\silver_nugget.json +f0b39d5b17bd7ee42b7a4c6268161e8a6bca5957 data\miteequilibrium\advancement\recipes\tools\copper_shovel.json +614cbc3a440e5f3b18c53edd54d9582fc5f276a7 data\miteequilibrium\recipe\mithril.json +38edfb04aa426151dfdafda6201911124ec50ae5 data\miteequilibrium\recipe\mithril_block.json +6d26f7b6f41327ed3d0e612808a339fda35cfaf8 data\miteequilibrium\recipe\copper.json +68c5ce2e5a7b69a5b32b1b21c739129697e957ea data\miteequilibrium\advancement\recipes\tools\adamantium_hoe.json +653f76fe61b76db80791e191f537a661700dda7f data\miteequilibrium\recipe\copper_block.json +a0008b59edbad041064997f4be33ac79f8ffbe1d data\miteequilibrium\advancement\recipes\tools\gold_dagger.json +ebbd4902c5503a749d82e0cf44848449645003ac data\miteequilibrium\recipe\copper_nugget.json +665f927d4a9684072318076922ae2a0b973f2b7c data\miteequilibrium\recipe\silver_axe.json +e985af7c6a06dfdc858124a8b4f55e13a0911948 data\miteequilibrium\recipe\mithril_pickaxe.json +4df59820040097f8c67c0de6fefc13259223499c data\miteequilibrium\recipe\silver_block.json +1b68ba75eaf46136bb69f90e6845f4972fa5cb1e data\miteequilibrium\advancement\recipes\misc\silver.json +fc05afe6a2cf37f289c03513e6804e729d90c5d1 data\miteequilibrium\recipe\copper_pickaxe.json +58e99d8b0f73c8c11e351d2cba7f841da3dbe1cb data\miteequilibrium\advancement\recipes\misc\adamantium_nugget.json +95af659da4b54d1efce84ff2a5e31da2bb7d671e data\miteequilibrium\advancement\recipes\misc\mithril.json +32d143abf8198a52e7d07e60eef9ad98ef46495e data\miteequilibrium\recipe\flint_knife.json +bd7c9812b73f608c2e1247722232bf124bc46714 data\miteequilibrium\advancement\recipes\misc\copper_block.json +ed7cfd5d63b27e81f11f956543d8a5f612fe1165 data\miteequilibrium\recipe\silver_pickaxe.json +8fcf69dec4b2dfdf49ca16926b98082fa7e5f126 data\miteequilibrium\advancement\recipes\misc\flint_to_piece.json +15af8f99843db24483c89b1ba3463ec801490f3e data\miteequilibrium\advancement\recipes\misc\silver_block.json +39ddcd9964adb3c5edde9bcdc0b3196bdfa00742 data\miteequilibrium\advancement\recipes\misc\piece_to_flint.json +59d7c309d3d90bc863de9bd6f89d41c33271f7b9 data\miteequilibrium\recipe\copper_hoe.json +ea02b55e055430d3052f259222f3f4ef07ce1825 data\miteequilibrium\advancement\recipes\misc\copper_nugget.json +53a68a795d2d099d6fde3a87fcf52d27fa73a157 data\miteequilibrium\advancement\recipes\tools\copper_pickaxe.json +603c059d453350b73d62983cb11b5df686d45d61 data\miteequilibrium\advancement\recipes\tools\flint_knife.json +4744b008da34309f5b62679974e7493086b3a63c data\miteequilibrium\advancement\recipes\tools\adamantium_dagger.json +b82aa92b1022e5171db93afbfb17c8245dd065b6 data\miteequilibrium\advancement\recipes\tools\silver_axe.json +ef05a877782b6db836c0d1319cd0b2770d4d000c data\miteequilibrium\recipe\iron_dagger.json +2901322250d14a57e6d28775fbe468d9ba012e93 data\miteequilibrium\advancement\recipes\tools\mithril_hoe.json +19f4bd5a02f2f0ca13a519618279d9ec7503a6a2 data\miteequilibrium\advancement\recipes\misc\mithril_block.json +3a1274decc637597790e1e552f867d6d64adb62c data\miteequilibrium\recipe\piece_to_flint.json +6342c03adf1eb0e88e27f8a25283ff90d0156197 data\miteequilibrium\advancement\recipes\misc\silver_from_block.json +d63eb785c9ee1bbddf6224331a8e2d270ddbd8d4 data\miteequilibrium\recipe\adamantium_block.json +b22b06e4de912db3c0306479236eddbf0464d88b data\miteequilibrium\advancement\recipes\misc\mithril_from_block.json +6c0e67d9ad996cf904c9b895fd805dbc36d69ab9 data\miteequilibrium\recipe\adamantium.json +fa6f0a112456d37f6f156eea2b2e525ccd1c079a data\miteequilibrium\recipe\adamantium_nugget.json +cda89878c560aac8c74889046e4694d3260a8f79 data\miteequilibrium\recipe\gold_dagger.json +5f246081a1af8045d3a8146864d72cba31064887 data\miteequilibrium\recipe\adamantium_hoe.json +561f3889cd9bc77bdb5b1cdd8ddc55c01b00bec6 data\miteequilibrium\recipe\mithril_hoe.json +bd75dfe683de226b1ae953ee21977a07221d59ca data\miteequilibrium\advancement\recipes\tools\silver_dagger.json +b5edb270a16ad601ce1892ce5baffc7ab16efc47 data\miteequilibrium\recipe\flint_to_piece.json +0d1e4959e8818dee61e660eebc402e4b34f6c815 data\miteequilibrium\recipe\adamantium_shovel.json +5077e7d780d031c78b8b1579f1febb2317801636 data\miteequilibrium\advancement\recipes\tools\silver_shovel.json +6d86ed48e2f9a236b1d94cf47252752af40b4492 data\miteequilibrium\recipe\adamantium_dagger.json +263b8ecc2d3db1d777151657ca2dd3dfd3be12e4 data\miteequilibrium\advancement\recipes\tools\copper_dagger.json +88bba28eb978fd24daa4ff7e2fe107a651d1a2c7 data\miteequilibrium\advancement\recipes\tools\mithril_shovel.json +67f93830020270511e1c64f0706d1f6b6a07220c data\miteequilibrium\advancement\recipes\tools\adamantium_shovel.json +5e3b46da543212ac6eebeef3548ee0c05743cae7 data\miteequilibrium\advancement\recipes\misc\silver_nugget.json +c205b8a2150511cdbca414b0562be74b98cbf1b2 data\miteequilibrium\advancement\recipes\tools\copper_axe.json +6bc1ad5a516714ddc04af954ea3ceba8689d5e23 data\miteequilibrium\advancement\recipes\tools\copper_hoe.json +5d61bdd21559ba13cc57051335cfc01dcc1a794d data\miteequilibrium\advancement\recipes\tools\mithril_dagger.json +5417b1257613c5c6021ebc4954d25f6c5d7dba1d data\miteequilibrium\advancement\recipes\tools\adamantium_axe.json +b6944f3fe7f200d77436032ca2def41f5d6c86ab data\miteequilibrium\recipe\silver.json +20af519a9b9c82a01ce0f9bff8e5178e9694d613 data\miteequilibrium\recipe\silver_hoe.json +8bce345f3032241dcfc330eadf3c29a6c6f7ac7c data\miteequilibrium\advancement\recipes\tools\mithril_pickaxe.json +02a982c07d1a1d36b2094798e044f92739153fea data\miteequilibrium\advancement\recipes\tools\silver_pickaxe.json +88db92ae67f55b45be9410d33d8107191ae03683 data\miteequilibrium\advancement\recipes\tools\iron_dagger.json +daadc659fc0f8fe730735d0ebe192e357ec4b3ab data\miteequilibrium\advancement\recipes\misc\copper.json +fefdc96ea823f05c4590ac1bdb477bd7c2f23ee9 data\miteequilibrium\recipe\silver_from_block.json +a60a36f183438cc3005c3aafd375aa1c0b9f5b79 data\miteequilibrium\advancement\recipes\misc\adamantium_from_block.json +3098b78fb801698ee2810ef3395ae514336a21bf data\miteequilibrium\advancement\recipes\misc\mithril_nugget.json +79242b230cc626712202f3434712d93603a034a1 data\miteequilibrium\advancement\recipes\tools\flint_axe.json diff --git a/src/main/generated/.cache/8ce55c2d46c78681d7eebf7cad72e9c2de67a045 b/src/main/generated/.cache/8ce55c2d46c78681d7eebf7cad72e9c2de67a045 index e695917..fac00ae 100644 --- a/src/main/generated/.cache/8ce55c2d46c78681d7eebf7cad72e9c2de67a045 +++ b/src/main/generated/.cache/8ce55c2d46c78681d7eebf7cad72e9c2de67a045 @@ -1,41 +1,81 @@ -// 1.21 2024-07-29T03:03:04.7432411 MITEequilibrium/Model Definitions +// 1.21 2024-07-31T21:53:49.9667734 MITEequilibrium/Model Definitions dccf3bc904ca2659a45b1924b2b5dd8188a0ef27 assets\miteequilibrium\blockstates\gold_block.json bf6219fde185b69def1a3cb8977dbb23ab0b560c assets\miteequilibrium\models\item\mithril_ore.json +f4006898a3cd86f27a7eb2e15957893062459f43 assets\miteequilibrium\models\item\mithril_hoe.json +44cb9f97c245f4caef0adfa70bb960564f5399dc assets\miteequilibrium\models\item\adamantium_shovel.json 6aa639f29ea4e247aa818822152bded3ec0a0ef4 assets\miteequilibrium\blockstates\mithril_block.json -a3aa407225058101f487dc2d69a2323cff577294 assets\miteequilibrium\models\block\silver_ore.json 6deb1bf7820e58ac89e2411f78d6925861ce3cf5 assets\miteequilibrium\models\item\silver_nugget.json -46bfd511f5c0f2f1afc5d77cc9dbd0144377d522 assets\miteequilibrium\models\item\mithril_nugget.json -15c22b2ffa7c2dda180ffcadd87e26e7542db7c5 assets\miteequilibrium\blockstates\silver_ore.json +43c4858ebe1f953fcb4766a26e2c59a70e6589ad assets\miteequilibrium\models\item\flint_axe.json +ef8a7c6819ef054496a67f7d4ecb451a5207ec68 assets\miteequilibrium\models\item\adamantium_dagger.json +9602405ba485e4ae133596673ca0196656a98441 assets\miteequilibrium\models\item\iron_hoe.json +4d27742d1d87642cf2a975f931d47294ea7ff62f assets\miteequilibrium\models\item\gold_hoe.json +0f858e745e24691787be4b7258a0c8bfc043b3dd assets\miteequilibrium\models\item\flint_knife.json 904f5b6be17869c8e9b6bc8b25fd229e15163b7e assets\miteequilibrium\models\block\gold_block.json c6d473a5f7fb2189afdb6f6040f9449d6355e4c9 assets\miteequilibrium\models\block\copper_block.json -8a2002cdb9a1c1088eac1973807e01b3db6a8fc7 assets\miteequilibrium\blockstates\gold_ore.json +a3b95e32365c698d79d6081cee52ed31e925c319 assets\miteequilibrium\models\item\silver_axe.json +1b84723c0643619ce5b4e9dfe9cda12d39392cee assets\miteequilibrium\models\item\copper_dagger.json 37a416ce5d40380df1321db7e7272faa4858973c assets\miteequilibrium\models\item\copper_nugget.json -cabffc3950e51bb500254bcd2a47053341050615 assets\miteequilibrium\blockstates\copper_block.json +404ea14f2fc717e8295fc5345f757a2aaaad85b1 assets\miteequilibrium\models\item\iron_shovel.json 88b2592c9e57bdfd9ff42721aee23f1879810fcc assets\miteequilibrium\models\block\gold_ore.json -1c76eeb8e434a4959a45a985f71e33bee98cef47 assets\miteequilibrium\blockstates\ancient_metal_block.json 1a33bb82f46b606fab1e1e0d8c970942b6f39727 assets\miteequilibrium\models\item\ancient_metal_block.json +52ffcea1c7635c05c0e7fb7140b411ff587fe2f6 assets\miteequilibrium\models\item\adamantium_sword.json +13172c6e814595e571ef09f63545e5b8aa80246b assets\miteequilibrium\models\item\iron_dagger.json +1f7b348d12cff07e1e885df86d2f3dfa878f163e assets\miteequilibrium\models\item\copper_shovel.json 0c2d41191b17a2834e2684947e382b5dccdfa6ed assets\miteequilibrium\models\item\gold_ore.json d7f20ad7d635c2505ea669d0de4c217d2ea182ef assets\miteequilibrium\models\block\mithril_ore.json -b41255903349f66fb5b8c8732ca305c79510b588 assets\miteequilibrium\models\item\copper_ore.json +863298a95365a0e57b9024b9e8662a0c86661528 assets\miteequilibrium\models\item\flint.json +2b1d457313041bd9dd1f014d4ea30664d0af27da assets\miteequilibrium\models\item\iron_pickaxe.json dd63bef5ea7f82d06c0c162106a2c5a9a1efee37 assets\miteequilibrium\blockstates\mithril_ore.json d23ecf679ccfafb2cf9b62c3aec46729ba685fa0 assets\miteequilibrium\models\item\ancient_metal_nugget.json +bc15854aa98a5d01405e463a80efd1be70037632 assets\miteequilibrium\models\item\gold_shovel.json +8096e5784b5e7c9952f34e2e1ad39a0eae0c737e assets\miteequilibrium\models\item\silver_shovel.json +7c4cee2936da319e500f6719a6b7a2f0c99771e2 assets\miteequilibrium\models\item\silver_dagger.json +9dbf5484c735d893e147d2526067c47fb4f31ffa assets\miteequilibrium\models\item\adamantium_ore.json +bd1451deafea45746222bc1019655e80fc3649d8 assets\miteequilibrium\models\item\iron_sword.json +1d9a2dd39ad592b4ecec5e920aa31e0150f1e703 assets\miteequilibrium\models\item\adamantium_block.json +25794eb6d7b690eadf5b58601aa7543da4ffde40 assets\miteequilibrium\models\item\gold_dagger.json +cc71d90802971d78699316fe4bd7e793c923ee84 assets\miteequilibrium\models\item\flint_hatchet.json +f34fa81117489a9a66ea93f728f5f2bcbec9b953 assets\miteequilibrium\models\block\silver_block.json +3bfc6b2a90d037aeb9e8e8793afd2559a496a5df assets\miteequilibrium\models\item\silver_ore.json +6bd864649dcf6f855f2d2e7b0499c4c36d3a1b20 assets\miteequilibrium\models\item\mithril_shovel.json +d09505456e3c561372cd4929b1a786ddbd931bb7 assets\miteequilibrium\models\item\mithril_block.json +bbc44d5c338a560948dfe2224099b8c4a63f590d assets\miteequilibrium\models\item\mithril_dagger.json +d3cc5699799289f2c4a19e78fd294b4402bef759 assets\miteequilibrium\models\item\mithril_axe.json +3d418e67d5459701baf68a9171a7f9817bdf705d assets\miteequilibrium\models\item\mithril_pickaxe.json +a3aa407225058101f487dc2d69a2323cff577294 assets\miteequilibrium\models\block\silver_ore.json +e6f645cf4f1c4aff77fd1c7ac8bc6316ee113c32 assets\miteequilibrium\models\item\iron_axe.json +46bfd511f5c0f2f1afc5d77cc9dbd0144377d522 assets\miteequilibrium\models\item\mithril_nugget.json +193e837ac04bbb1b0d2a730fa68913497894a0e0 assets\miteequilibrium\models\item\gold_axe.json +a86b810f80a4cf0bf50dbeb002d0d125ea478578 assets\miteequilibrium\models\item\mithril_sword.json +e2b4c890490aac1a94f5fba2bf9974ef7b62ffa9 assets\miteequilibrium\models\item\gold_pickaxe.json +15c22b2ffa7c2dda180ffcadd87e26e7542db7c5 assets\miteequilibrium\blockstates\silver_ore.json +8a2002cdb9a1c1088eac1973807e01b3db6a8fc7 assets\miteequilibrium\blockstates\gold_ore.json +aba26b9d3646284a3331fc6e317a9cfeada6a786 assets\miteequilibrium\models\item\adamantium_pickaxe.json +754d900271910bdf0b236ecdd209d1e7436e3757 assets\miteequilibrium\models\item\silver_hoe.json +e9ea44a82cbd7333b2dea14821b48dd702b672f8 assets\miteequilibrium\models\item\gold_sword.json +cabffc3950e51bb500254bcd2a47053341050615 assets\miteequilibrium\blockstates\copper_block.json +30f2a48ab2b870778390415b2cab12dbb4abd3a7 assets\miteequilibrium\models\item\adamantium_axe.json +1c76eeb8e434a4959a45a985f71e33bee98cef47 assets\miteequilibrium\blockstates\ancient_metal_block.json +d0afeaeba60a92163f1c394bc000834213404f0b assets\miteequilibrium\models\item\silver_pickaxe.json +3c2d3978753a43111b633b95e59755cd2e89ae2d assets\miteequilibrium\models\item\copper_pickaxe.json +12b37e17f18295fecc16bf0d50f04bde31f1ff14 assets\miteequilibrium\models\item\flint_shovel.json +b41255903349f66fb5b8c8732ca305c79510b588 assets\miteequilibrium\models\item\copper_ore.json +56f4793aff3571fb954d4b88cdad77aebccf9d19 assets\miteequilibrium\models\item\copper_axe.json +51af2547bb72c23774533976579c40861830a549 assets\miteequilibrium\models\item\copper_hoe.json ddd198fb1a94b797709f8a13de207a162ca83920 assets\miteequilibrium\blockstates\silver_block.json 3a0550b68023aeb8d1f2e05c3bc8b1683a5ec457 assets\miteequilibrium\models\block\copper_ore.json +b5e47c0da4f39c8428895d1a9af7eee1f9e2bdec assets\miteequilibrium\models\item\copper_sword.json daac16a0ec15119c4965bf7b42998bf7c30f46fc assets\miteequilibrium\blockstates\adamantium_ore.json ebbf1665c7578e664e339d1379497b8e68ceb9f9 assets\miteequilibrium\blockstates\adamantium_block.json -9dbf5484c735d893e147d2526067c47fb4f31ffa assets\miteequilibrium\models\item\adamantium_ore.json -1d9a2dd39ad592b4ecec5e920aa31e0150f1e703 assets\miteequilibrium\models\item\adamantium_block.json +828274b1f8d7c10953e38bc7955515ff2f853cca assets\miteequilibrium\models\item\silver_sword.json 47b83ac7ffdcd4f349e7b9d2c9ecbaa7296cd2c1 assets\miteequilibrium\models\block\adamantium_ore.json 7167477d055461b8c0d0dd1ddff296c3e8739c1b assets\miteequilibrium\models\item\gold_nugget.json 71230db95fb36a59ca886b42a8578a7e5289f27e assets\miteequilibrium\models\block\mithril_block.json 4993969e47354bc3559414336f2a3d6f20da6d3f assets\miteequilibrium\models\item\gold_block.json 9c2092f86b72ce8167788a7d59bb2f6915f0caf6 assets\miteequilibrium\models\block\ancient_metal_block.json -cc71d90802971d78699316fe4bd7e793c923ee84 assets\miteequilibrium\models\item\flint_hatchet.json -f34fa81117489a9a66ea93f728f5f2bcbec9b953 assets\miteequilibrium\models\block\silver_block.json -3bfc6b2a90d037aeb9e8e8793afd2559a496a5df assets\miteequilibrium\models\item\silver_ore.json +4800d43dcda70106f5d90793053d3bd15034f224 assets\miteequilibrium\models\item\adamantium_hoe.json b834efa7e8d540313d35956439827b44a4cee03e assets\miteequilibrium\models\block\adamantium_block.json d3ae8dd9287a60924640b0e719f39f41d143c8b9 assets\miteequilibrium\models\item\silver_block.json -d09505456e3c561372cd4929b1a786ddbd931bb7 assets\miteequilibrium\models\item\mithril_block.json d918fe036accbdb8c8dad219ff5b3f769ac1b7ab assets\miteequilibrium\models\item\adamantium_nugget.json 5af9fa21466ac378f1f8783fc5934cb0e6c77eca assets\miteequilibrium\blockstates\copper_ore.json 106cb8fa8b1669c63211922d5b858bb6ad95b6e3 assets\miteequilibrium\models\item\copper_block.json diff --git a/src/main/java/com/equilibrium/MITEequilibrium.java b/src/main/java/com/equilibrium/MITEequilibrium.java index 290c359..0fb5f47 100644 --- a/src/main/java/com/equilibrium/MITEequilibrium.java +++ b/src/main/java/com/equilibrium/MITEequilibrium.java @@ -2,39 +2,42 @@ import com.equilibrium.block.ModBlocks; +import com.equilibrium.craft_time_register.BlockInit; +import com.equilibrium.craft_time_register.UseBlock; import com.equilibrium.event.BreakBlockEvent; import com.equilibrium.item.Metal; import com.equilibrium.item.ModItemGroup; import com.equilibrium.item.ModItems; import com.equilibrium.item.Tools; -import com.equilibrium.register.tags.ModItemTags; import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; +import net.minecraft.world.World; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + import com.equilibrium.config.Config; -import com.equilibrium.register.BlockEnityRegistry; -import com.equilibrium.register.BlockInit; -import com.equilibrium.register.UseBlock; +import com.equilibrium.craft_time_register.BlockEnityRegistry; + import com.equilibrium.event.sound.SoundEventRegistry; import com.equilibrium.util.CreativeGroup; -import com.equilibrium.worklevel.CraftingIngredients; -import com.equilibrium.worklevel.FurnaceIngredients; +import com.equilibrium.craft_time_worklevel.CraftingIngredients; +import com.equilibrium.craft_time_worklevel.FurnaceIngredients; import static com.equilibrium.entity.ModEntities.registerModEntities; -import static com.equilibrium.register.tags.ModBlockTags.registerModBlockTags; -import static com.equilibrium.register.tags.ModItemTags.registerModItemTags; +import static com.equilibrium.tags.ModBlockTags.registerModBlockTags; +import static com.equilibrium.tags.ModItemTags.registerModItemTags; import static com.equilibrium.util.LootTableModifier.modifierLootTables; -import static com.equilibrium.worldgen.ModPlacementGenerator.registerModOre; +import static com.equilibrium.ore_generator.ModPlacementGenerator.registerModOre; public class MITEequilibrium implements ModInitializer { @@ -42,7 +45,6 @@ public class MITEequilibrium implements ModInitializer { public static final String MOD_ID = "miteequilibrium"; public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID); - public static Config config; @@ -90,6 +92,9 @@ public void onInitialize() { + + + config = new Config(); config.load(); diff --git a/src/main/java/com/equilibrium/MITEequilibriumDataGenerator.java b/src/main/java/com/equilibrium/MITEequilibriumDataGenerator.java index 9ca2f80..c9a761d 100644 --- a/src/main/java/com/equilibrium/MITEequilibriumDataGenerator.java +++ b/src/main/java/com/equilibrium/MITEequilibriumDataGenerator.java @@ -1,7 +1,7 @@ package com.equilibrium; import com.equilibrium.gen.ModModelProvider; -import com.equilibrium.gen.*; +import com.equilibrium.gen.ModRecipeGenerator; import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint; import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; @@ -11,8 +11,8 @@ public class MITEequilibriumDataGenerator implements DataGeneratorEntrypoint { @Override public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator){ FabricDataGenerator.Pack pack=fabricDataGenerator.createPack(); -// pack.addProvider(ModRecipeGenerator::new); -// pack.addProvider(ModModelProvider::new); + pack.addProvider(ModRecipeGenerator::new); + pack.addProvider(ModModelProvider::new); // pack.addProvider(ModLanguageTranslatorZhCn::new); // pack.addProvider(TagsProvider::new); diff --git a/src/main/java/com/equilibrium/block/TheCraftingTableBlock.java b/src/main/java/com/equilibrium/block/TheCraftingTableBlock.java index 9f8055e..34ac6a5 100644 --- a/src/main/java/com/equilibrium/block/TheCraftingTableBlock.java +++ b/src/main/java/com/equilibrium/block/TheCraftingTableBlock.java @@ -1,7 +1,7 @@ package com.equilibrium.block; -import com.equilibrium.register.BlockInit; +import com.equilibrium.craft_time_register.BlockInit; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.CraftingTableBlock; diff --git a/src/main/java/com/equilibrium/block/TheFurnace.java b/src/main/java/com/equilibrium/block/TheFurnace.java index 3f90358..317819a 100644 --- a/src/main/java/com/equilibrium/block/TheFurnace.java +++ b/src/main/java/com/equilibrium/block/TheFurnace.java @@ -3,7 +3,7 @@ import com.equilibrium.block.blockentity.TheFurnaceEntity; -import com.equilibrium.register.BlockEnityRegistry; +import com.equilibrium.craft_time_register.BlockEnityRegistry; import com.mojang.serialization.MapCodec; diff --git a/src/main/java/com/equilibrium/block/blockentity/TheFurnaceEntity.java b/src/main/java/com/equilibrium/block/blockentity/TheFurnaceEntity.java index 7f49a65..b91ba9d 100644 --- a/src/main/java/com/equilibrium/block/blockentity/TheFurnaceEntity.java +++ b/src/main/java/com/equilibrium/block/blockentity/TheFurnaceEntity.java @@ -1,7 +1,7 @@ package com.equilibrium.block.blockentity; -import com.equilibrium.register.BlockEnityRegistry; -import com.equilibrium.register.BlockInit; +import com.equilibrium.craft_time_register.BlockEnityRegistry; +import com.equilibrium.craft_time_register.BlockInit; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.entity.AbstractFurnaceBlockEntity; diff --git a/src/main/java/com/equilibrium/constant/MaxCount.java b/src/main/java/com/equilibrium/constant/MaxCount.java new file mode 100644 index 0000000..215b10b --- /dev/null +++ b/src/main/java/com/equilibrium/constant/MaxCount.java @@ -0,0 +1,5 @@ +package com.equilibrium.constant; + +public class MaxCount { + public static boolean vanillaMaxCount; +} diff --git a/src/main/java/com/equilibrium/register/BlockEnityRegistry.java b/src/main/java/com/equilibrium/craft_time_register/BlockEnityRegistry.java similarity index 95% rename from src/main/java/com/equilibrium/register/BlockEnityRegistry.java rename to src/main/java/com/equilibrium/craft_time_register/BlockEnityRegistry.java index ed665d0..b7f5a48 100644 --- a/src/main/java/com/equilibrium/register/BlockEnityRegistry.java +++ b/src/main/java/com/equilibrium/craft_time_register/BlockEnityRegistry.java @@ -1,4 +1,4 @@ -package com.equilibrium.register; +package com.equilibrium.craft_time_register; import com.equilibrium.MITEequilibrium; diff --git a/src/main/java/com/equilibrium/register/BlockInit.java b/src/main/java/com/equilibrium/craft_time_register/BlockInit.java similarity index 99% rename from src/main/java/com/equilibrium/register/BlockInit.java rename to src/main/java/com/equilibrium/craft_time_register/BlockInit.java index db27b74..f70751a 100644 --- a/src/main/java/com/equilibrium/register/BlockInit.java +++ b/src/main/java/com/equilibrium/craft_time_register/BlockInit.java @@ -1,4 +1,4 @@ -package com.equilibrium.register; +package com.equilibrium.craft_time_register; import com.equilibrium.MITEequilibrium; diff --git a/src/main/java/com/equilibrium/register/UseBlock.java b/src/main/java/com/equilibrium/craft_time_register/UseBlock.java similarity index 97% rename from src/main/java/com/equilibrium/register/UseBlock.java rename to src/main/java/com/equilibrium/craft_time_register/UseBlock.java index c7c9fed..3e7a5aa 100644 --- a/src/main/java/com/equilibrium/register/UseBlock.java +++ b/src/main/java/com/equilibrium/craft_time_register/UseBlock.java @@ -1,4 +1,4 @@ -package com.equilibrium.register; +package com.equilibrium.craft_time_register; import net.fabricmc.fabric.api.event.player.UseBlockCallback; import net.minecraft.block.*; diff --git a/src/main/java/com/equilibrium/worklevel/CraftingIngredient.java b/src/main/java/com/equilibrium/craft_time_worklevel/CraftingIngredient.java similarity index 87% rename from src/main/java/com/equilibrium/worklevel/CraftingIngredient.java rename to src/main/java/com/equilibrium/craft_time_worklevel/CraftingIngredient.java index 3a13e6b..a3cf247 100644 --- a/src/main/java/com/equilibrium/worklevel/CraftingIngredient.java +++ b/src/main/java/com/equilibrium/craft_time_worklevel/CraftingIngredient.java @@ -1,4 +1,4 @@ -package com.equilibrium.worklevel; +package com.equilibrium.craft_time_worklevel; public class CraftingIngredient { public static final int FLINT_CRAFTING_TABLE = 1, COPPER_CRAFTING_TABLE = 2, IRON_CRAFTING_TABLE = 3, DIAMOND_CRAFTING_TABLE = 4, NETHERITE_CRAFTING_TABLE = 5; diff --git a/src/main/java/com/equilibrium/worklevel/CraftingIngredients.java b/src/main/java/com/equilibrium/craft_time_worklevel/CraftingIngredients.java similarity index 98% rename from src/main/java/com/equilibrium/worklevel/CraftingIngredients.java rename to src/main/java/com/equilibrium/craft_time_worklevel/CraftingIngredients.java index 7dfb8a5..e991b9b 100644 --- a/src/main/java/com/equilibrium/worklevel/CraftingIngredients.java +++ b/src/main/java/com/equilibrium/craft_time_worklevel/CraftingIngredients.java @@ -1,4 +1,4 @@ -package com.equilibrium.worklevel; +package com.equilibrium.craft_time_worklevel; import java.util.HashMap; diff --git a/src/main/java/com/equilibrium/worklevel/FurnaceIngredient.java b/src/main/java/com/equilibrium/craft_time_worklevel/FurnaceIngredient.java similarity index 84% rename from src/main/java/com/equilibrium/worklevel/FurnaceIngredient.java rename to src/main/java/com/equilibrium/craft_time_worklevel/FurnaceIngredient.java index 085b67d..d4a7b46 100644 --- a/src/main/java/com/equilibrium/worklevel/FurnaceIngredient.java +++ b/src/main/java/com/equilibrium/craft_time_worklevel/FurnaceIngredient.java @@ -1,4 +1,4 @@ -package com.equilibrium.worklevel; +package com.equilibrium.craft_time_worklevel; public class FurnaceIngredient { public static final int COBBLESTONE_FURNACE = 1, OBSIDIAN_FURNACE = 2, NETHERRACK_FURNACE = 3; diff --git a/src/main/java/com/equilibrium/worklevel/FurnaceIngredients.java b/src/main/java/com/equilibrium/craft_time_worklevel/FurnaceIngredients.java similarity index 98% rename from src/main/java/com/equilibrium/worklevel/FurnaceIngredients.java rename to src/main/java/com/equilibrium/craft_time_worklevel/FurnaceIngredients.java index 895a1fd..c8bfeb8 100644 --- a/src/main/java/com/equilibrium/worklevel/FurnaceIngredients.java +++ b/src/main/java/com/equilibrium/craft_time_worklevel/FurnaceIngredients.java @@ -1,4 +1,4 @@ -package com.equilibrium.worklevel; +package com.equilibrium.craft_time_worklevel; import java.util.HashMap; diff --git a/src/main/java/com/equilibrium/data/data.zip b/src/main/java/com/equilibrium/data/data.zip new file mode 100644 index 0000000..28ad881 Binary files /dev/null and b/src/main/java/com/equilibrium/data/data.zip differ diff --git a/src/main/java/com/equilibrium/data/minecraft/dimension/overworld.json b/src/main/java/com/equilibrium/data/minecraft/dimension/overworld.json new file mode 100644 index 0000000..720be50 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/dimension/overworld.json @@ -0,0 +1,2552 @@ +{ + "type": "minecraft:overworld", + "generator": { + "type": "minecraft:noise", + "settings": { + "sea_level": 63, + "disable_mob_generation": false, + "aquifers_enabled": true, + "ore_veins_enabled": true, + "legacy_random_source": false, + "default_block": { + "Name": "minecraft:stone" + }, + "default_fluid": { + "Name": "minecraft:water", + "Properties": { + "level": "0" + } + }, + "noise": { + "min_y": -64, + "height": 384, + "size_horizontal": 1, + "size_vertical": 2 + }, + "noise_router": { + "barrier": { + "type": "minecraft:noise", + "noise": "minecraft:aquifer_barrier", + "xz_scale": 1, + "y_scale": 0.5 + }, + "fluid_level_floodedness": { + "type": "minecraft:noise", + "noise": "minecraft:aquifer_fluid_level_floodedness", + "xz_scale": 1, + "y_scale": 0.67 + }, + "fluid_level_spread": { + "type": "minecraft:noise", + "noise": "minecraft:aquifer_fluid_level_spread", + "xz_scale": 1, + "y_scale": 0.7142857142857143 + }, + "lava": { + "type": "minecraft:noise", + "noise": "minecraft:aquifer_lava", + "xz_scale": 1, + "y_scale": 1 + }, + "temperature": { + "type": "minecraft:shifted_noise", + "noise": "minecraft:temperature", + "xz_scale": 0.25, + "y_scale": 0, + "shift_x": "minecraft:shift_x", + "shift_y": 0, + "shift_z": "minecraft:shift_z" + }, + "vegetation": { + "type": "minecraft:shifted_noise", + "noise": "minecraft:vegetation", + "xz_scale": 0.25, + "y_scale": 0, + "shift_x": "minecraft:shift_x", + "shift_y": 0, + "shift_z": "minecraft:shift_z" + }, + "continents": "minecraft:overworld/continents", + "erosion": "minecraft:overworld/erosion", + "depth": "minecraft:overworld/depth", + "ridges": "minecraft:overworld/ridges", + "initial_density_without_jaggedness": { + "type": "minecraft:add", + "argument1": 0.1171875, + "argument2": { + "type": "minecraft:mul", + "argument1": { + "type": "minecraft:y_clamped_gradient", + "from_y": -64, + "to_y": -40, + "from_value": 0, + "to_value": 1 + }, + "argument2": { + "type": "minecraft:add", + "argument1": -0.1171875, + "argument2": { + "type": "minecraft:add", + "argument1": -0.078125, + "argument2": { + "type": "minecraft:mul", + "argument1": { + "type": "minecraft:y_clamped_gradient", + "from_y": 240, + "to_y": 256, + "from_value": 1, + "to_value": 0 + }, + "argument2": { + "type": "minecraft:add", + "argument1": 0.078125, + "argument2": { + "type": "minecraft:clamp", + "input": { + "type": "minecraft:add", + "argument1": -0.703125, + "argument2": { + "type": "minecraft:mul", + "argument1": 4, + "argument2": { + "type": "minecraft:quarter_negative", + "argument": { + "type": "minecraft:mul", + "argument1": "minecraft:overworld/depth", + "argument2": { + "type": "minecraft:cache_2d", + "argument": "minecraft:overworld/factor" + } + } + } + } + }, + "min": -64, + "max": 64 + } + } + } + } + } + } + }, + "final_density": { + "type": "minecraft:min", + "argument1": { + "type": "minecraft:squeeze", + "argument": { + "type": "minecraft:mul", + "argument1": 0.64, + "argument2": { + "type": "minecraft:interpolated", + "argument": { + "type": "minecraft:blend_density", + "argument": { + "type": "minecraft:add", + "argument1": 0.1171875, + "argument2": { + "type": "minecraft:mul", + "argument1": { + "type": "minecraft:y_clamped_gradient", + "from_y": -64, + "to_y": -40, + "from_value": 0, + "to_value": 1 + }, + "argument2": { + "type": "minecraft:add", + "argument1": -0.1171875, + "argument2": { + "type": "minecraft:add", + "argument1": -0.078125, + "argument2": { + "type": "minecraft:mul", + "argument1": { + "type": "minecraft:y_clamped_gradient", + "from_y": 240, + "to_y": 256, + "from_value": 1, + "to_value": 0 + }, + "argument2": { + "type": "minecraft:add", + "argument1": 0.078125, + "argument2": { + "type": "minecraft:range_choice", + "input": "minecraft:overworld/sloped_cheese", + "min_inclusive": -1000000, + "max_exclusive": 1.5625, + "when_in_range": { + "type": "minecraft:min", + "argument1": "minecraft:overworld/sloped_cheese", + "argument2": { + "type": "minecraft:mul", + "argument1": 5, + "argument2": "minecraft:overworld/caves/entrances" + } + }, + "when_out_of_range": { + "type": "minecraft:max", + "argument1": { + "type": "minecraft:min", + "argument1": { + "type": "minecraft:min", + "argument1": { + "type": "minecraft:add", + "argument1": { + "type": "minecraft:mul", + "argument1": 4, + "argument2": { + "type": "minecraft:square", + "argument": { + "type": "minecraft:noise", + "noise": "minecraft:cave_layer", + "xz_scale": 1, + "y_scale": 8 + } + } + }, + "argument2": { + "type": "minecraft:add", + "argument1": { + "type": "minecraft:clamp", + "input": { + "type": "minecraft:add", + "argument1": 0.27, + "argument2": { + "type": "minecraft:noise", + "noise": "minecraft:cave_cheese", + "xz_scale": 0.5, + "y_scale": 0.2 + } + }, + "min": -1, + "max": 1 + }, + "argument2": { + "type": "minecraft:clamp", + "input": { + "type": "minecraft:add", + "argument1": 1.5, + "argument2": { + "type": "minecraft:mul", + "argument1": -0.649, + "argument2": "minecraft:overworld/sloped_cheese" + } + }, + "min": 0, + "max": 0.5 + } + } + }, + "argument2": "minecraft:overworld/caves/entrances" + }, + "argument2": { + "type": "minecraft:add", + "argument1": "minecraft:overworld/caves/entrances", + "argument2": "minecraft:overworld/caves/spaghetti_roughness_function" + } + }, + "argument2": { + "type": "minecraft:range_choice", + "input": "minecraft:overworld/caves/pillars", + "min_inclusive": -1000000, + "max_exclusive": 0.03, + "when_in_range": -1000000, + "when_out_of_range": "minecraft:overworld/caves/pillars" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "argument2": "minecraft:overworld/caves/noodle" + }, + "vein_toggle": { + "type": "minecraft:interpolated", + "argument": { + "type": "minecraft:range_choice", + "input": "minecraft:y", + "min_inclusive": -60, + "max_exclusive": 51, + "when_in_range": { + "type": "minecraft:noise", + "noise": "minecraft:ore_veininess", + "xz_scale": 1.5, + "y_scale": 1.5 + }, + "when_out_of_range": 0 + } + }, + "vein_ridged": { + "type": "minecraft:add", + "argument1": -0.07999999821186066, + "argument2": { + "type": "minecraft:max", + "argument1": { + "type": "minecraft:abs", + "argument": { + "type": "minecraft:interpolated", + "argument": { + "type": "minecraft:range_choice", + "input": "minecraft:y", + "min_inclusive": -60, + "max_exclusive": 51, + "when_in_range": { + "type": "minecraft:noise", + "noise": "minecraft:ore_vein_a", + "xz_scale": 4, + "y_scale": 4 + }, + "when_out_of_range": 0 + } + } + }, + "argument2": { + "type": "minecraft:abs", + "argument": { + "type": "minecraft:interpolated", + "argument": { + "type": "minecraft:range_choice", + "input": "minecraft:y", + "min_inclusive": -60, + "max_exclusive": 51, + "when_in_range": { + "type": "minecraft:noise", + "noise": "minecraft:ore_vein_b", + "xz_scale": 4, + "y_scale": 4 + }, + "when_out_of_range": 0 + } + } + } + } + }, + "vein_gap": { + "type": "minecraft:noise", + "noise": "minecraft:ore_gap", + "xz_scale": 1, + "y_scale": 1 + } + }, + "spawn_target": [ + { + "temperature": [ + -1, + 1 + ], + "humidity": [ + -1, + 1 + ], + "continentalness": [ + -0.11, + 1 + ], + "erosion": [ + -1, + 1 + ], + "weirdness": [ + -1, + -0.16 + ], + "depth": 0, + "offset": 0 + }, + { + "temperature": [ + -1, + 1 + ], + "humidity": [ + -1, + 1 + ], + "continentalness": [ + -0.11, + 1 + ], + "erosion": [ + -1, + 1 + ], + "weirdness": [ + 0.16, + 1 + ], + "depth": 0, + "offset": 0 + } + ], + "surface_rule": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:vertical_gradient", + "random_name": "minecraft:bedrock_floor", + "true_at_and_below": { + "above_bottom": 0 + }, + "false_at_and_above": { + "above_bottom": 5 + } + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:bedrock" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:above_preliminary_surface" + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "floor", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:wooded_badlands" + ] + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:y_above", + "anchor": { + "absolute": 97 + }, + "surface_depth_multiplier": 2, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": -0.909, + "max_threshold": -0.5454 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:coarse_dirt" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": -0.1818, + "max_threshold": 0.1818 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:coarse_dirt" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": 0.5454, + "max_threshold": 0.909 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:coarse_dirt" + } + } + }, + { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:grass_block", + "Properties": { + "snowy": "false" + } + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:dirt" + } + } + ] + } + ] + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:swamp" + ] + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:y_above", + "anchor": { + "absolute": 62 + }, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:not", + "invert": { + "type": "minecraft:y_above", + "anchor": { + "absolute": 63 + }, + "surface_depth_multiplier": 0, + "add_stone_depth": false + } + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface_swamp", + "min_threshold": 0, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:water", + "Properties": { + "level": "0" + } + } + } + } + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:mangrove_swamp" + ] + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:y_above", + "anchor": { + "absolute": 60 + }, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:not", + "invert": { + "type": "minecraft:y_above", + "anchor": { + "absolute": 63 + }, + "surface_depth_multiplier": 0, + "add_stone_depth": false + } + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface_swamp", + "min_threshold": 0, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:water", + "Properties": { + "level": "0" + } + } + } + } + } + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:badlands", + "minecraft:eroded_badlands", + "minecraft:wooded_badlands" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "floor", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:y_above", + "anchor": { + "absolute": 256 + }, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:orange_terracotta" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:y_above", + "anchor": { + "absolute": 74 + }, + "surface_depth_multiplier": 1, + "add_stone_depth": true + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": -0.909, + "max_threshold": -0.5454 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:terracotta" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": -0.1818, + "max_threshold": 0.1818 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:terracotta" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": 0.5454, + "max_threshold": 0.909 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:terracotta" + } + } + }, + { + "type": "minecraft:bandlands" + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": -1, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:red_sandstone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:red_sand" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:not", + "invert": { + "type": "minecraft:hole" + } + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:orange_terracotta" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": -6, + "surface_depth_multiplier": -1, + "add_stone_depth": true + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:white_terracotta" + } + } + }, + { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:gravel" + } + } + ] + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:y_above", + "anchor": { + "absolute": 63 + }, + "surface_depth_multiplier": -1, + "add_stone_depth": true + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:y_above", + "anchor": { + "absolute": 63 + }, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:not", + "invert": { + "type": "minecraft:y_above", + "anchor": { + "absolute": 74 + }, + "surface_depth_multiplier": 1, + "add_stone_depth": true + } + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:orange_terracotta" + } + } + } + }, + { + "type": "minecraft:bandlands" + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "floor", + "add_surface_depth": true, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": -6, + "surface_depth_multiplier": -1, + "add_stone_depth": true + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:white_terracotta" + } + } + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "floor", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": -1, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:frozen_ocean", + "minecraft:deep_frozen_ocean" + ] + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:hole" + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:air" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:temperature" + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:ice" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:water", + "Properties": { + "level": "0" + } + } + } + ] + } + } + }, + { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:frozen_peaks" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:steep" + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:packed_ice" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:packed_ice", + "min_threshold": 0, + "max_threshold": 0.2 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:packed_ice" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:ice", + "min_threshold": 0, + "max_threshold": 0.025 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:ice" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:snow_block" + } + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:snowy_slopes" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:steep" + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:powder_snow", + "min_threshold": 0.35, + "max_threshold": 0.6 + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:powder_snow" + } + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:snow_block" + } + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:jagged_peaks" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:steep" + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:snow_block" + } + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:grove" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:powder_snow", + "min_threshold": 0.35, + "max_threshold": 0.6 + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:powder_snow" + } + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:snow_block" + } + } + } + ] + } + }, + { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:stony_peaks" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:calcite", + "min_threshold": -0.0125, + "max_threshold": 0.0125 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:calcite" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:stony_shore" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:gravel", + "min_threshold": -0.05, + "max_threshold": 0.05 + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:gravel" + } + } + ] + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:windswept_hills" + ] + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": 0.12121212121212122, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:warm_ocean", + "minecraft:beach", + "minecraft:snowy_beach" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sandstone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sand" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:desert" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sandstone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sand" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:dripstone_caves" + ] + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + } + ] + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:windswept_savanna" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": 0.21212121212121213, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": -0.06060606060606061, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:coarse_dirt" + } + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:windswept_gravelly_hills" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": 0.24242424242424243, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:gravel" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": 0.12121212121212122, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": -0.12121212121212122, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:grass_block", + "Properties": { + "snowy": "false" + } + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:dirt" + } + } + ] + } + }, + { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:gravel" + } + } + ] + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:old_growth_pine_taiga", + "minecraft:old_growth_spruce_taiga" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": 0.21212121212121213, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:coarse_dirt" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": -0.11515151515151514, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:podzol", + "Properties": { + "snowy": "false" + } + } + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:ice_spikes" + ] + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:snow_block" + } + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:mangrove_swamp" + ] + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:mud" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:mushroom_fields" + ] + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:mycelium", + "Properties": { + "snowy": "false" + } + } + } + }, + { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:grass_block", + "Properties": { + "snowy": "false" + } + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:dirt" + } + } + ] + } + ] + } + ] + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": -6, + "surface_depth_multiplier": -1, + "add_stone_depth": true + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "floor", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:frozen_ocean", + "minecraft:deep_frozen_ocean" + ] + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:hole" + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:water", + "Properties": { + "level": "0" + } + } + } + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "floor", + "add_surface_depth": true, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:frozen_peaks" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:steep" + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:packed_ice" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:packed_ice", + "min_threshold": -0.5, + "max_threshold": 0.2 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:packed_ice" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:ice", + "min_threshold": -0.0625, + "max_threshold": 0.025 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:ice" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:snow_block" + } + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:snowy_slopes" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:steep" + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:powder_snow", + "min_threshold": 0.45, + "max_threshold": 0.58 + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:powder_snow" + } + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:snow_block" + } + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:jagged_peaks" + ] + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:grove" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:powder_snow", + "min_threshold": 0.45, + "max_threshold": 0.58 + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:powder_snow" + } + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:dirt" + } + } + ] + } + }, + { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:stony_peaks" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:calcite", + "min_threshold": -0.0125, + "max_threshold": 0.0125 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:calcite" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:stony_shore" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:gravel", + "min_threshold": -0.05, + "max_threshold": 0.05 + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:gravel" + } + } + ] + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:windswept_hills" + ] + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": 0.12121212121212122, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:warm_ocean", + "minecraft:beach", + "minecraft:snowy_beach" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sandstone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sand" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:desert" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sandstone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sand" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:dripstone_caves" + ] + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + } + ] + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:windswept_savanna" + ] + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": 0.21212121212121213, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:windswept_gravelly_hills" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": 0.24242424242424243, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:gravel" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": 0.12121212121212122, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": -0.12121212121212122, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:dirt" + } + } + }, + { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:gravel" + } + } + ] + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:mangrove_swamp" + ] + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:mud" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:dirt" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:warm_ocean", + "minecraft:beach", + "minecraft:snowy_beach" + ] + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "floor", + "add_surface_depth": true, + "secondary_depth_range": 6 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sandstone" + } + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:desert" + ] + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "floor", + "add_surface_depth": true, + "secondary_depth_range": 30 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sandstone" + } + } + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "floor", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:frozen_peaks", + "minecraft:jagged_peaks" + ] + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:warm_ocean", + "minecraft:lukewarm_ocean", + "minecraft:deep_lukewarm_ocean" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sandstone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sand" + } + } + ] + } + }, + { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:gravel" + } + } + ] + } + ] + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:vertical_gradient", + "random_name": "minecraft:deepslate", + "true_at_and_below": { + "absolute": -48 + }, + "false_at_and_above": { + "absolute": -40 + } + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:deepslate", + "Properties": { + "axis": "y" + } + } + } + } + ] + } + }, + "biome_source": { + "type": "minecraft:multi_noise", + "preset": "minecraft:overworld" + } + } +} diff --git a/src/main/java/com/equilibrium/data/minecraft/enchantment/efficiency.json b/src/main/java/com/equilibrium/data/minecraft/enchantment/efficiency.json new file mode 100644 index 0000000..9ee9870 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/enchantment/efficiency.json @@ -0,0 +1,33 @@ +{ + "description": { + "translate": "enchantment.minecraft.efficiency" + }, + "supported_items": "#miteequilibrium:mining_enchantable", + "weight": 10, + "max_level": 5, + "min_cost": { + "base": 1, + "per_level_above_first": 10 + }, + "max_cost": { + "base": 51, + "per_level_above_first": 10 + }, + "anvil_cost": 1, + "slots": [ + "mainhand" + ], + "effects": { + "minecraft:attributes": [ + { + "id": "minecraft:enchantment.efficiency", + "attribute": "minecraft:player.mining_efficiency", + "amount": { + "type": "minecraft:levels_squared", + "added": 1 + }, + "operation": "add_value" + } + ] + } +} diff --git a/src/main/java/com/equilibrium/data/minecraft/enchantment/fortune.json b/src/main/java/com/equilibrium/data/minecraft/enchantment/fortune.json new file mode 100644 index 0000000..58044f5 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/enchantment/fortune.json @@ -0,0 +1,21 @@ +{ + "description": { + "translate": "enchantment.minecraft.fortune" + }, + "exclusive_set": "#minecraft:exclusive_set/mining", + "supported_items": "#miteequilibrium:fortune", + "weight": 2, + "max_level": 3, + "min_cost": { + "base": 15, + "per_level_above_first": 9 + }, + "max_cost": { + "base": 65, + "per_level_above_first": 9 + }, + "anvil_cost": 4, + "slots": [ + "mainhand" + ] +} diff --git a/src/main/java/com/equilibrium/data/minecraft/enchantment/silk_touch.json b/src/main/java/com/equilibrium/data/minecraft/enchantment/silk_touch.json new file mode 100644 index 0000000..aec1df6 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/enchantment/silk_touch.json @@ -0,0 +1,31 @@ +{ + "description": { + "translate": "enchantment.minecraft.silk_touch" + }, + "exclusive_set": "#minecraft:exclusive_set/mining", + "supported_items": "#miteequilibrium:silktouch", + "weight": 1, + "max_level": 1, + "min_cost": { + "base": 15, + "per_level_above_first": 0 + }, + "max_cost": { + "base": 65, + "per_level_above_first": 0 + }, + "anvil_cost": 8, + "slots": [ + "mainhand" + ], + "effects": { + "minecraft:block_experience": [ + { + "effect": { + "type": "minecraft:set", + "value": 0 + } + } + ] + } +} diff --git a/src/main/java/com/equilibrium/data/minecraft/enchantment/unbreaking.json b/src/main/java/com/equilibrium/data/minecraft/enchantment/unbreaking.json new file mode 100644 index 0000000..e5a9069 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/enchantment/unbreaking.json @@ -0,0 +1,76 @@ +{ + "description": { + "translate": "enchantment.minecraft.unbreaking" + }, + "supported_items": "#miteequilibrium:unbreaking", + "primary_items": "#miteequilibrium:unbreaking_enchantable", + "weight": 5, + "max_level": 3, + "min_cost": { + "base": 5, + "per_level_above_first": 8 + }, + "max_cost": { + "base": 55, + "per_level_above_first": 8 + }, + "anvil_cost": 2, + "slots": [ + "any" + ], + "effects": { + "minecraft:item_damage": [ + { + "effect": { + "type": "minecraft:remove_binomial", + "chance": { + "type": "minecraft:fraction", + "numerator": { + "type": "minecraft:linear", + "base": 2, + "per_level_above_first": 2 + }, + "denominator": { + "type": "minecraft:linear", + "base": 10, + "per_level_above_first": 5 + } + } + }, + "requirements": { + "condition": "minecraft:match_tool", + "predicate": { + "items": "#minecraft:enchantable/armor" + } + } + }, + { + "effect": { + "type": "minecraft:remove_binomial", + "chance": { + "type": "minecraft:fraction", + "numerator": { + "type": "minecraft:linear", + "base": 1, + "per_level_above_first": 1 + }, + "denominator": { + "type": "minecraft:linear", + "base": 2, + "per_level_above_first": 1 + } + } + }, + "requirements": { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:match_tool", + "predicate": { + "items": "#minecraft:enchantable/armor" + } + } + } + } + ] + } +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/biome/plains.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/biome/plains.json new file mode 100644 index 0000000..671ef9c --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/biome/plains.json @@ -0,0 +1,201 @@ +{ + "carvers": { + "air": [ + "minecraft:cave", + "minecraft:cave_extra_underground", + "minecraft:canyon" + ] + }, + "downfall": 0.4, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 7907327, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "features": [ + [], + [ + "minecraft:lake_lava_underground", + "minecraft:lake_lava_surface" + ], + [ + "minecraft:amethyst_geode" + ], + [ + "minecraft:monster_room", + "minecraft:monster_room_deep" + ], + [], + [], + [ + "minecraft:ore_dirt", + "minecraft:ore_gravel", + "minecraft:ore_granite_upper", + "minecraft:ore_granite_lower", + "minecraft:ore_diorite_upper", + "minecraft:ore_diorite_lower", + "minecraft:ore_andesite_upper", + "minecraft:ore_andesite_lower", + "minecraft:ore_tuff", + "minecraft:ore_coal_upper", + "minecraft:ore_coal_lower", + "minecraft:ore_iron_upper", + "minecraft:ore_iron_middle", + "minecraft:ore_iron_small", + "minecraft:ore_gold", + "minecraft:ore_gold_lower", + "minecraft:ore_redstone", + "minecraft:ore_redstone_lower", + "minecraft:ore_diamond", + "minecraft:ore_diamond_medium", + "minecraft:ore_diamond_large", + "minecraft:ore_diamond_buried", + "minecraft:ore_lapis", + "minecraft:ore_lapis_buried", + "minecraft:ore_copper", + "minecraft:underwater_magma", + "minecraft:disk_sand", + "minecraft:disk_clay", + "minecraft:disk_gravel" + ], + [], + [ + "minecraft:spring_water", + "minecraft:spring_lava" + ], + [ + "minecraft:glow_lichen", + "minecraft:patch_tall_grass_2", + "minecraft:trees_plains", + "minecraft:flower_plains", + "minecraft:patch_grass_plain", + "minecraft:brown_mushroom_normal", + "minecraft:red_mushroom_normal", + "minecraft:patch_sugar_cane", + "minecraft:patch_pumpkin" + ], + [ + "minecraft:freeze_top_layer" + ] + ], + "has_precipitation": true, + "spawn_costs": {}, + "spawners": { + "ambient": [ + { + "type": "minecraft:bat", + "maxCount": 1, + "minCount": 1, + "weight": 10 + } + ], + "axolotls": [], + "creature": [ + { + "type": "minecraft:sheep", + "maxCount": 1, + "minCount": 1, + "weight": 12 + }, + { + "type": "minecraft:pig", + "maxCount": 1, + "minCount": 1, + "weight": 10 + }, + { + "type": "minecraft:chicken", + "maxCount": 1, + "minCount": 1, + "weight": 10 + }, + { + "type": "minecraft:cow", + "maxCount": 1, + "minCount": 1, + "weight": 8 + }, + { + "type": "minecraft:horse", + "maxCount": 1, + "minCount": 1, + "weight": 5 + }, + { + "type": "minecraft:donkey", + "maxCount": 1, + "minCount": 1, + "weight": 1 + } + ], + "misc": [], + "monster": [ + { + "type": "minecraft:spider", + "maxCount": 1, + "minCount": 1, + "weight": 100 + }, + { + "type": "minecraft:zombie", + "maxCount": 1, + "minCount": 1, + "weight": 95 + }, + { + "type": "minecraft:zombie_villager", + "maxCount": 1, + "minCount": 1, + "weight": 5 + }, + { + "type": "minecraft:skeleton", + "maxCount": 1, + "minCount": 1, + "weight": 100 + }, + { + "type": "minecraft:creeper", + "maxCount": 1, + "minCount": 1, + "weight": 100 + }, + { + "type": "minecraft:slime", + "maxCount": 1, + "minCount": 1, + "weight": 100 + }, + { + "type": "minecraft:enderman", + "maxCount": 1, + "minCount": 1, + "weight": 10 + }, + { + "type": "minecraft:witch", + "maxCount": 1, + "minCount": 1, + "weight": 5 + } + ], + "underground_water_creature": [ + { + "type": "minecraft:glow_squid", + "maxCount": 1, + "minCount": 1, + "weight": 10 + } + ], + "water_ambient": [], + "water_creature": [] + }, + "temperature": 0.8 +} \ No newline at end of file diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_andesite.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_andesite.json new file mode 100644 index 0000000..2789f98 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_andesite.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0, + "size": 32, + "targets": [ + { + "state": { + "Name": "minecraft:andesite" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:base_stone_overworld" + } + } + ] + } +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_coal_buried.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_coal_buried.json new file mode 100644 index 0000000..8e89bbd --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_coal_buried.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0.5, + "size": 16, + "targets": [ + { + "state": { + "Name": "minecraft:coal_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:stone_ore_replaceables" + } + }, + { + "state": { + "Name": "minecraft:deepslate_coal_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:deepslate_ore_replaceables" + } + } + ] + } +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_copper_large.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_copper_large.json new file mode 100644 index 0000000..b52b7bb --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_copper_large.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0, + "size": 5, + "targets": [ + { + "state": { + "Name": "minecraft:copper_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:stone_ore_replaceables" + } + }, + { + "state": { + "Name": "minecraft:deepslate_copper_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:deepslate_ore_replaceables" + } + } + ] + } +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_copper_small.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_copper_small.json new file mode 100644 index 0000000..ad79fb3 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_copper_small.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0, + "size": 4, + "targets": [ + { + "state": { + "Name": "minecraft:copper_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:stone_ore_replaceables" + } + }, + { + "state": { + "Name": "minecraft:deepslate_copper_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:deepslate_ore_replaceables" + } + } + ] + } +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_diamond_buried.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_diamond_buried.json new file mode 100644 index 0000000..96b33b8 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_diamond_buried.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 1, + "size": 4, + "targets": [ + { + "state": { + "Name": "minecraft:diamond_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:stone_ore_replaceables" + } + }, + { + "state": { + "Name": "minecraft:deepslate_diamond_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:deepslate_ore_replaceables" + } + } + ] + } +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_diamond_large.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_diamond_large.json new file mode 100644 index 0000000..577df18 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_diamond_large.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0.7, + "size": 8, + "targets": [ + { + "state": { + "Name": "minecraft:diamond_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:stone_ore_replaceables" + } + }, + { + "state": { + "Name": "minecraft:deepslate_diamond_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:deepslate_ore_replaceables" + } + } + ] + } +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_diorite.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_diorite.json new file mode 100644 index 0000000..3dd0ddd --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_diorite.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0, + "size": 32, + "targets": [ + { + "state": { + "Name": "minecraft:diorite" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:base_stone_overworld" + } + } + ] + } +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_emerald.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_emerald.json new file mode 100644 index 0000000..3602620 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_emerald.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0, + "size": 1, + "targets": [ + { + "state": { + "Name": "minecraft:emerald_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:stone_ore_replaceables" + } + }, + { + "state": { + "Name": "minecraft:deepslate_emerald_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:deepslate_ore_replaceables" + } + } + ] + } +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_granite.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_granite.json new file mode 100644 index 0000000..9a0b810 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_granite.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0, + "size": 21, + "targets": [ + { + "state": { + "Name": "minecraft:granite" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:base_stone_overworld" + } + } + ] + } +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_iron.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_iron.json new file mode 100644 index 0000000..a22b7fd --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/configured_feature/ore_iron.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0, + "size": 4, + "targets": [ + { + "state": { + "Name": "minecraft:iron_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:stone_ore_replaceables" + } + }, + { + "state": { + "Name": "minecraft:deepslate_iron_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:deepslate_ore_replaceables" + } + } + ] + } +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/noise/continentalness.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/noise/continentalness.json new file mode 100644 index 0000000..e24dca5 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/noise/continentalness.json @@ -0,0 +1,14 @@ +{ + "amplitudes": [ + 1, + 1, + 2, + 2, + 2, + 1, + 1, + 1, + 1 + ], + "firstOctave": -13 +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/noise/erosion.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/noise/erosion.json new file mode 100644 index 0000000..4b3b76f --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/noise/erosion.json @@ -0,0 +1,10 @@ +{ + "amplitudes": [ + 1, + 1, + 0, + 1, + 1 + ], + "firstOctave": -13 +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/noise/temperature.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/noise/temperature.json new file mode 100644 index 0000000..9936f84 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/noise/temperature.json @@ -0,0 +1,11 @@ +{ + "amplitudes": [ + 1.5, + 0, + 1, + 0, + 0, + 0 + ], + "firstOctave": -14 +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/noise/vegetation.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/noise/vegetation.json new file mode 100644 index 0000000..45d9782 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/noise/vegetation.json @@ -0,0 +1,11 @@ +{ + "amplitudes": [ + 1, + 1, + 0, + 0, + 0, + 0 + ], + "firstOctave": -12 +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_andesite_lower.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_andesite_lower.json new file mode 100644 index 0000000..ab77d00 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_andesite_lower.json @@ -0,0 +1,27 @@ +{ + "feature": "minecraft:ore_andesite", + "placement": [ + { + "type": "minecraft:count", + "count": 2 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:uniform", + "max_inclusive": { + "absolute": 60 + }, + "min_inclusive": { + "absolute": 0 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_andesite_upper.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_andesite_upper.json new file mode 100644 index 0000000..877e6ae --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_andesite_upper.json @@ -0,0 +1,27 @@ +{ + "feature": "minecraft:ore_andesite", + "placement": [ + { + "type": "minecraft:rarity_filter", + "chance": 3 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:uniform", + "max_inclusive": { + "absolute": 128 + }, + "min_inclusive": { + "absolute": 64 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_coal_lower.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_coal_lower.json new file mode 100644 index 0000000..3b2839d --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_coal_lower.json @@ -0,0 +1,33 @@ +{ + "feature": "minecraft:ore_coal_buried", + "placement": [ + { + "type": "minecraft:count", + "count": 20 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:trapezoid", + "max_inclusive": { + "absolute": 192 + }, + "min_inclusive": { + "absolute": 0 + } + }, + "min_inclusive": { + "absolute": 61 + }, + "max_inclusive": { + "absolute": 192 + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_copper.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_copper.json new file mode 100644 index 0000000..2e30da1 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_copper.json @@ -0,0 +1,27 @@ +{ + "feature": "minecraft:ore_copper_small", + "placement": [ + { + "type": "minecraft:count", + "count": 16 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:trapezoid", + "max_inclusive": { + "absolute": 112 + }, + "min_inclusive": { + "absolute": -16 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_copper_large.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_copper_large.json new file mode 100644 index 0000000..5d571cf --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_copper_large.json @@ -0,0 +1,27 @@ +{ + "feature": "minecraft:ore_copper_large", + "placement": [ + { + "type": "minecraft:count", + "count": 16 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:trapezoid", + "max_inclusive": { + "absolute": 112 + }, + "min_inclusive": { + "absolute": -16 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_diamond_buried.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_diamond_buried.json new file mode 100644 index 0000000..a1772a8 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_diamond_buried.json @@ -0,0 +1,33 @@ +{ + "feature": "minecraft:ore_diamond_buried", + "placement": [ + { + "type": "minecraft:count", + "count": 4 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:trapezoid", + "max_inclusive": { + "above_bottom": 80 + }, + "min_inclusive": { + "above_bottom": -80 + } + }, + "min_inclusive": { + "above_bottom": -80 + }, + "max_inclusive": { + "above_bottom": 80 + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_diamond_large.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_diamond_large.json new file mode 100644 index 0000000..808211d --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_diamond_large.json @@ -0,0 +1,33 @@ +{ + "feature": "minecraft:ore_diamond_large", + "placement": [ + { + "type": "minecraft:rarity_filter", + "chance": 5 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:trapezoid", + "max_inclusive": { + "above_bottom": 80 + }, + "min_inclusive": { + "above_bottom": -80 + } + }, + "min_inclusive": { + "above_bottom": -80 + }, + "max_inclusive": { + "above_bottom": 80 + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_diorite_lower.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_diorite_lower.json new file mode 100644 index 0000000..c0c66e5 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_diorite_lower.json @@ -0,0 +1,27 @@ +{ + "feature": "minecraft:ore_diorite", + "placement": [ + { + "type": "minecraft:count", + "count": 2 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:uniform", + "max_inclusive": { + "absolute": 60 + }, + "min_inclusive": { + "absolute": 0 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_diorite_upper.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_diorite_upper.json new file mode 100644 index 0000000..6783495 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_diorite_upper.json @@ -0,0 +1,27 @@ +{ + "feature": "minecraft:ore_diorite", + "placement": [ + { + "type": "minecraft:rarity_filter", + "chance": 6 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:uniform", + "max_inclusive": { + "absolute": 128 + }, + "min_inclusive": { + "absolute": 64 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_dirt.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_dirt.json new file mode 100644 index 0000000..abe6d78 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_dirt.json @@ -0,0 +1,12 @@ +{ + "feature": { + "type": "minecraft:no_op", + "config": {} + }, + "placement": [ + { + "type": "minecraft:rarity_filter", + "chance": 468795 + } + ] +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_emerald.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_emerald.json new file mode 100644 index 0000000..6443efb --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_emerald.json @@ -0,0 +1,33 @@ +{ + "feature": "minecraft:ore_emerald", + "placement": [ + { + "type": "minecraft:count", + "count": 100 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:trapezoid", + "max_inclusive": { + "absolute": 480 + }, + "min_inclusive": { + "absolute": -16 + } + }, + "min_inclusive": { + "absolute": -16 + }, + "max_inclusive": { + "absolute": 64 + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_granite_lower.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_granite_lower.json new file mode 100644 index 0000000..e6bd8b7 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_granite_lower.json @@ -0,0 +1,27 @@ +{ + "feature": "minecraft:ore_granite", + "placement": [ + { + "type": "minecraft:count", + "count": 2 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:uniform", + "max_inclusive": { + "absolute": 60 + }, + "min_inclusive": { + "absolute": 0 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_granite_upper.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_granite_upper.json new file mode 100644 index 0000000..bd742b4 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_granite_upper.json @@ -0,0 +1,27 @@ +{ + "feature": "minecraft:ore_granite", + "placement": [ + { + "type": "minecraft:rarity_filter", + "chance": 6 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:uniform", + "max_inclusive": { + "absolute": 128 + }, + "min_inclusive": { + "absolute": 64 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_iron_middle.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_iron_middle.json new file mode 100644 index 0000000..bec34a5 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_iron_middle.json @@ -0,0 +1,27 @@ +{ + "feature": "minecraft:ore_iron", + "placement": [ + { + "type": "minecraft:count", + "count": 10 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:trapezoid", + "max_inclusive": { + "absolute": 56 + }, + "min_inclusive": { + "absolute": -24 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_iron_upper.json b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_iron_upper.json new file mode 100644 index 0000000..e81bba7 --- /dev/null +++ b/src/main/java/com/equilibrium/data/minecraft/worldgen/placed_feature/ore_iron_upper.json @@ -0,0 +1,33 @@ +{ + "feature": "minecraft:ore_iron", + "placement": [ + { + "type": "minecraft:count", + "count": 90 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:trapezoid", + "max_inclusive": { + "absolute": 384 + }, + "min_inclusive": { + "absolute": 80 + } + }, + "min_inclusive": { + "absolute": 60 + }, + "max_inclusive": { + "absolute": 85 + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/datapack/data.zip b/src/main/java/com/equilibrium/datapack/data.zip index 9024cc3..1ce86dc 100644 Binary files a/src/main/java/com/equilibrium/datapack/data.zip and b/src/main/java/com/equilibrium/datapack/data.zip differ diff --git a/src/main/java/com/equilibrium/datapack/zip/data.zip b/src/main/java/com/equilibrium/datapack/zip/data.zip new file mode 100644 index 0000000..add54ce Binary files /dev/null and b/src/main/java/com/equilibrium/datapack/zip/data.zip differ diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/dimension/overworld.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/dimension/overworld.json new file mode 100644 index 0000000..720be50 --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/dimension/overworld.json @@ -0,0 +1,2552 @@ +{ + "type": "minecraft:overworld", + "generator": { + "type": "minecraft:noise", + "settings": { + "sea_level": 63, + "disable_mob_generation": false, + "aquifers_enabled": true, + "ore_veins_enabled": true, + "legacy_random_source": false, + "default_block": { + "Name": "minecraft:stone" + }, + "default_fluid": { + "Name": "minecraft:water", + "Properties": { + "level": "0" + } + }, + "noise": { + "min_y": -64, + "height": 384, + "size_horizontal": 1, + "size_vertical": 2 + }, + "noise_router": { + "barrier": { + "type": "minecraft:noise", + "noise": "minecraft:aquifer_barrier", + "xz_scale": 1, + "y_scale": 0.5 + }, + "fluid_level_floodedness": { + "type": "minecraft:noise", + "noise": "minecraft:aquifer_fluid_level_floodedness", + "xz_scale": 1, + "y_scale": 0.67 + }, + "fluid_level_spread": { + "type": "minecraft:noise", + "noise": "minecraft:aquifer_fluid_level_spread", + "xz_scale": 1, + "y_scale": 0.7142857142857143 + }, + "lava": { + "type": "minecraft:noise", + "noise": "minecraft:aquifer_lava", + "xz_scale": 1, + "y_scale": 1 + }, + "temperature": { + "type": "minecraft:shifted_noise", + "noise": "minecraft:temperature", + "xz_scale": 0.25, + "y_scale": 0, + "shift_x": "minecraft:shift_x", + "shift_y": 0, + "shift_z": "minecraft:shift_z" + }, + "vegetation": { + "type": "minecraft:shifted_noise", + "noise": "minecraft:vegetation", + "xz_scale": 0.25, + "y_scale": 0, + "shift_x": "minecraft:shift_x", + "shift_y": 0, + "shift_z": "minecraft:shift_z" + }, + "continents": "minecraft:overworld/continents", + "erosion": "minecraft:overworld/erosion", + "depth": "minecraft:overworld/depth", + "ridges": "minecraft:overworld/ridges", + "initial_density_without_jaggedness": { + "type": "minecraft:add", + "argument1": 0.1171875, + "argument2": { + "type": "minecraft:mul", + "argument1": { + "type": "minecraft:y_clamped_gradient", + "from_y": -64, + "to_y": -40, + "from_value": 0, + "to_value": 1 + }, + "argument2": { + "type": "minecraft:add", + "argument1": -0.1171875, + "argument2": { + "type": "minecraft:add", + "argument1": -0.078125, + "argument2": { + "type": "minecraft:mul", + "argument1": { + "type": "minecraft:y_clamped_gradient", + "from_y": 240, + "to_y": 256, + "from_value": 1, + "to_value": 0 + }, + "argument2": { + "type": "minecraft:add", + "argument1": 0.078125, + "argument2": { + "type": "minecraft:clamp", + "input": { + "type": "minecraft:add", + "argument1": -0.703125, + "argument2": { + "type": "minecraft:mul", + "argument1": 4, + "argument2": { + "type": "minecraft:quarter_negative", + "argument": { + "type": "minecraft:mul", + "argument1": "minecraft:overworld/depth", + "argument2": { + "type": "minecraft:cache_2d", + "argument": "minecraft:overworld/factor" + } + } + } + } + }, + "min": -64, + "max": 64 + } + } + } + } + } + } + }, + "final_density": { + "type": "minecraft:min", + "argument1": { + "type": "minecraft:squeeze", + "argument": { + "type": "minecraft:mul", + "argument1": 0.64, + "argument2": { + "type": "minecraft:interpolated", + "argument": { + "type": "minecraft:blend_density", + "argument": { + "type": "minecraft:add", + "argument1": 0.1171875, + "argument2": { + "type": "minecraft:mul", + "argument1": { + "type": "minecraft:y_clamped_gradient", + "from_y": -64, + "to_y": -40, + "from_value": 0, + "to_value": 1 + }, + "argument2": { + "type": "minecraft:add", + "argument1": -0.1171875, + "argument2": { + "type": "minecraft:add", + "argument1": -0.078125, + "argument2": { + "type": "minecraft:mul", + "argument1": { + "type": "minecraft:y_clamped_gradient", + "from_y": 240, + "to_y": 256, + "from_value": 1, + "to_value": 0 + }, + "argument2": { + "type": "minecraft:add", + "argument1": 0.078125, + "argument2": { + "type": "minecraft:range_choice", + "input": "minecraft:overworld/sloped_cheese", + "min_inclusive": -1000000, + "max_exclusive": 1.5625, + "when_in_range": { + "type": "minecraft:min", + "argument1": "minecraft:overworld/sloped_cheese", + "argument2": { + "type": "minecraft:mul", + "argument1": 5, + "argument2": "minecraft:overworld/caves/entrances" + } + }, + "when_out_of_range": { + "type": "minecraft:max", + "argument1": { + "type": "minecraft:min", + "argument1": { + "type": "minecraft:min", + "argument1": { + "type": "minecraft:add", + "argument1": { + "type": "minecraft:mul", + "argument1": 4, + "argument2": { + "type": "minecraft:square", + "argument": { + "type": "minecraft:noise", + "noise": "minecraft:cave_layer", + "xz_scale": 1, + "y_scale": 8 + } + } + }, + "argument2": { + "type": "minecraft:add", + "argument1": { + "type": "minecraft:clamp", + "input": { + "type": "minecraft:add", + "argument1": 0.27, + "argument2": { + "type": "minecraft:noise", + "noise": "minecraft:cave_cheese", + "xz_scale": 0.5, + "y_scale": 0.2 + } + }, + "min": -1, + "max": 1 + }, + "argument2": { + "type": "minecraft:clamp", + "input": { + "type": "minecraft:add", + "argument1": 1.5, + "argument2": { + "type": "minecraft:mul", + "argument1": -0.649, + "argument2": "minecraft:overworld/sloped_cheese" + } + }, + "min": 0, + "max": 0.5 + } + } + }, + "argument2": "minecraft:overworld/caves/entrances" + }, + "argument2": { + "type": "minecraft:add", + "argument1": "minecraft:overworld/caves/entrances", + "argument2": "minecraft:overworld/caves/spaghetti_roughness_function" + } + }, + "argument2": { + "type": "minecraft:range_choice", + "input": "minecraft:overworld/caves/pillars", + "min_inclusive": -1000000, + "max_exclusive": 0.03, + "when_in_range": -1000000, + "when_out_of_range": "minecraft:overworld/caves/pillars" + } + } + } + } + } + } + } + } + } + } + } + } + }, + "argument2": "minecraft:overworld/caves/noodle" + }, + "vein_toggle": { + "type": "minecraft:interpolated", + "argument": { + "type": "minecraft:range_choice", + "input": "minecraft:y", + "min_inclusive": -60, + "max_exclusive": 51, + "when_in_range": { + "type": "minecraft:noise", + "noise": "minecraft:ore_veininess", + "xz_scale": 1.5, + "y_scale": 1.5 + }, + "when_out_of_range": 0 + } + }, + "vein_ridged": { + "type": "minecraft:add", + "argument1": -0.07999999821186066, + "argument2": { + "type": "minecraft:max", + "argument1": { + "type": "minecraft:abs", + "argument": { + "type": "minecraft:interpolated", + "argument": { + "type": "minecraft:range_choice", + "input": "minecraft:y", + "min_inclusive": -60, + "max_exclusive": 51, + "when_in_range": { + "type": "minecraft:noise", + "noise": "minecraft:ore_vein_a", + "xz_scale": 4, + "y_scale": 4 + }, + "when_out_of_range": 0 + } + } + }, + "argument2": { + "type": "minecraft:abs", + "argument": { + "type": "minecraft:interpolated", + "argument": { + "type": "minecraft:range_choice", + "input": "minecraft:y", + "min_inclusive": -60, + "max_exclusive": 51, + "when_in_range": { + "type": "minecraft:noise", + "noise": "minecraft:ore_vein_b", + "xz_scale": 4, + "y_scale": 4 + }, + "when_out_of_range": 0 + } + } + } + } + }, + "vein_gap": { + "type": "minecraft:noise", + "noise": "minecraft:ore_gap", + "xz_scale": 1, + "y_scale": 1 + } + }, + "spawn_target": [ + { + "temperature": [ + -1, + 1 + ], + "humidity": [ + -1, + 1 + ], + "continentalness": [ + -0.11, + 1 + ], + "erosion": [ + -1, + 1 + ], + "weirdness": [ + -1, + -0.16 + ], + "depth": 0, + "offset": 0 + }, + { + "temperature": [ + -1, + 1 + ], + "humidity": [ + -1, + 1 + ], + "continentalness": [ + -0.11, + 1 + ], + "erosion": [ + -1, + 1 + ], + "weirdness": [ + 0.16, + 1 + ], + "depth": 0, + "offset": 0 + } + ], + "surface_rule": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:vertical_gradient", + "random_name": "minecraft:bedrock_floor", + "true_at_and_below": { + "above_bottom": 0 + }, + "false_at_and_above": { + "above_bottom": 5 + } + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:bedrock" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:above_preliminary_surface" + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "floor", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:wooded_badlands" + ] + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:y_above", + "anchor": { + "absolute": 97 + }, + "surface_depth_multiplier": 2, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": -0.909, + "max_threshold": -0.5454 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:coarse_dirt" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": -0.1818, + "max_threshold": 0.1818 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:coarse_dirt" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": 0.5454, + "max_threshold": 0.909 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:coarse_dirt" + } + } + }, + { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:grass_block", + "Properties": { + "snowy": "false" + } + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:dirt" + } + } + ] + } + ] + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:swamp" + ] + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:y_above", + "anchor": { + "absolute": 62 + }, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:not", + "invert": { + "type": "minecraft:y_above", + "anchor": { + "absolute": 63 + }, + "surface_depth_multiplier": 0, + "add_stone_depth": false + } + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface_swamp", + "min_threshold": 0, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:water", + "Properties": { + "level": "0" + } + } + } + } + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:mangrove_swamp" + ] + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:y_above", + "anchor": { + "absolute": 60 + }, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:not", + "invert": { + "type": "minecraft:y_above", + "anchor": { + "absolute": 63 + }, + "surface_depth_multiplier": 0, + "add_stone_depth": false + } + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface_swamp", + "min_threshold": 0, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:water", + "Properties": { + "level": "0" + } + } + } + } + } + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:badlands", + "minecraft:eroded_badlands", + "minecraft:wooded_badlands" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "floor", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:y_above", + "anchor": { + "absolute": 256 + }, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:orange_terracotta" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:y_above", + "anchor": { + "absolute": 74 + }, + "surface_depth_multiplier": 1, + "add_stone_depth": true + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": -0.909, + "max_threshold": -0.5454 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:terracotta" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": -0.1818, + "max_threshold": 0.1818 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:terracotta" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": 0.5454, + "max_threshold": 0.909 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:terracotta" + } + } + }, + { + "type": "minecraft:bandlands" + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": -1, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:red_sandstone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:red_sand" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:not", + "invert": { + "type": "minecraft:hole" + } + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:orange_terracotta" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": -6, + "surface_depth_multiplier": -1, + "add_stone_depth": true + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:white_terracotta" + } + } + }, + { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:gravel" + } + } + ] + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:y_above", + "anchor": { + "absolute": 63 + }, + "surface_depth_multiplier": -1, + "add_stone_depth": true + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:y_above", + "anchor": { + "absolute": 63 + }, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:not", + "invert": { + "type": "minecraft:y_above", + "anchor": { + "absolute": 74 + }, + "surface_depth_multiplier": 1, + "add_stone_depth": true + } + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:orange_terracotta" + } + } + } + }, + { + "type": "minecraft:bandlands" + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "floor", + "add_surface_depth": true, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": -6, + "surface_depth_multiplier": -1, + "add_stone_depth": true + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:white_terracotta" + } + } + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "floor", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": -1, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:frozen_ocean", + "minecraft:deep_frozen_ocean" + ] + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:hole" + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:air" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:temperature" + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:ice" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:water", + "Properties": { + "level": "0" + } + } + } + ] + } + } + }, + { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:frozen_peaks" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:steep" + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:packed_ice" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:packed_ice", + "min_threshold": 0, + "max_threshold": 0.2 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:packed_ice" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:ice", + "min_threshold": 0, + "max_threshold": 0.025 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:ice" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:snow_block" + } + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:snowy_slopes" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:steep" + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:powder_snow", + "min_threshold": 0.35, + "max_threshold": 0.6 + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:powder_snow" + } + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:snow_block" + } + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:jagged_peaks" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:steep" + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:snow_block" + } + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:grove" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:powder_snow", + "min_threshold": 0.35, + "max_threshold": 0.6 + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:powder_snow" + } + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:snow_block" + } + } + } + ] + } + }, + { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:stony_peaks" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:calcite", + "min_threshold": -0.0125, + "max_threshold": 0.0125 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:calcite" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:stony_shore" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:gravel", + "min_threshold": -0.05, + "max_threshold": 0.05 + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:gravel" + } + } + ] + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:windswept_hills" + ] + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": 0.12121212121212122, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:warm_ocean", + "minecraft:beach", + "minecraft:snowy_beach" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sandstone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sand" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:desert" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sandstone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sand" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:dripstone_caves" + ] + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + } + ] + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:windswept_savanna" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": 0.21212121212121213, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": -0.06060606060606061, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:coarse_dirt" + } + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:windswept_gravelly_hills" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": 0.24242424242424243, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:gravel" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": 0.12121212121212122, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": -0.12121212121212122, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:grass_block", + "Properties": { + "snowy": "false" + } + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:dirt" + } + } + ] + } + }, + { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:gravel" + } + } + ] + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:old_growth_pine_taiga", + "minecraft:old_growth_spruce_taiga" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": 0.21212121212121213, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:coarse_dirt" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": -0.11515151515151514, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:podzol", + "Properties": { + "snowy": "false" + } + } + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:ice_spikes" + ] + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:snow_block" + } + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:mangrove_swamp" + ] + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:mud" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:mushroom_fields" + ] + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:mycelium", + "Properties": { + "snowy": "false" + } + } + } + }, + { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:grass_block", + "Properties": { + "snowy": "false" + } + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:dirt" + } + } + ] + } + ] + } + ] + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": -6, + "surface_depth_multiplier": -1, + "add_stone_depth": true + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "floor", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:frozen_ocean", + "minecraft:deep_frozen_ocean" + ] + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:hole" + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:water", + "Properties": { + "level": "0" + } + } + } + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "floor", + "add_surface_depth": true, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:frozen_peaks" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:steep" + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:packed_ice" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:packed_ice", + "min_threshold": -0.5, + "max_threshold": 0.2 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:packed_ice" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:ice", + "min_threshold": -0.0625, + "max_threshold": 0.025 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:ice" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:snow_block" + } + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:snowy_slopes" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:steep" + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:powder_snow", + "min_threshold": 0.45, + "max_threshold": 0.58 + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:powder_snow" + } + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:snow_block" + } + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:jagged_peaks" + ] + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:grove" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:powder_snow", + "min_threshold": 0.45, + "max_threshold": 0.58 + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:water", + "offset": 0, + "surface_depth_multiplier": 0, + "add_stone_depth": false + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:powder_snow" + } + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:dirt" + } + } + ] + } + }, + { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:stony_peaks" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:calcite", + "min_threshold": -0.0125, + "max_threshold": 0.0125 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:calcite" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:stony_shore" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:gravel", + "min_threshold": -0.05, + "max_threshold": 0.05 + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:gravel" + } + } + ] + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:windswept_hills" + ] + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": 0.12121212121212122, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:warm_ocean", + "minecraft:beach", + "minecraft:snowy_beach" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sandstone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sand" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:desert" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sandstone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sand" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:dripstone_caves" + ] + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + } + ] + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:windswept_savanna" + ] + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": 0.21212121212121213, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:windswept_gravelly_hills" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": 0.24242424242424243, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:gravel" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": 0.12121212121212122, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:noise_threshold", + "noise": "minecraft:surface", + "min_threshold": -0.12121212121212122, + "max_threshold": 1.7976931348623157e+308 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:dirt" + } + } + }, + { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:gravel" + } + } + ] + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:mangrove_swamp" + ] + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:mud" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:dirt" + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:warm_ocean", + "minecraft:beach", + "minecraft:snowy_beach" + ] + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "floor", + "add_surface_depth": true, + "secondary_depth_range": 6 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sandstone" + } + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:desert" + ] + }, + "then_run": { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "floor", + "add_surface_depth": true, + "secondary_depth_range": 30 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sandstone" + } + } + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "floor", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:frozen_peaks", + "minecraft:jagged_peaks" + ] + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:biome", + "biome_is": [ + "minecraft:warm_ocean", + "minecraft:lukewarm_ocean", + "minecraft:deep_lukewarm_ocean" + ] + }, + "then_run": { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sandstone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:sand" + } + } + ] + } + }, + { + "type": "minecraft:sequence", + "sequence": [ + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:stone_depth", + "offset": 0, + "surface_type": "ceiling", + "add_surface_depth": false, + "secondary_depth_range": 0 + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:stone" + } + } + }, + { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:gravel" + } + } + ] + } + ] + } + } + ] + } + }, + { + "type": "minecraft:condition", + "if_true": { + "type": "minecraft:vertical_gradient", + "random_name": "minecraft:deepslate", + "true_at_and_below": { + "absolute": -48 + }, + "false_at_and_above": { + "absolute": -40 + } + }, + "then_run": { + "type": "minecraft:block", + "result_state": { + "Name": "minecraft:deepslate", + "Properties": { + "axis": "y" + } + } + } + } + ] + } + }, + "biome_source": { + "type": "minecraft:multi_noise", + "preset": "minecraft:overworld" + } + } +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/enchantment/efficiency.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/enchantment/efficiency.json new file mode 100644 index 0000000..9ee9870 --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/enchantment/efficiency.json @@ -0,0 +1,33 @@ +{ + "description": { + "translate": "enchantment.minecraft.efficiency" + }, + "supported_items": "#miteequilibrium:mining_enchantable", + "weight": 10, + "max_level": 5, + "min_cost": { + "base": 1, + "per_level_above_first": 10 + }, + "max_cost": { + "base": 51, + "per_level_above_first": 10 + }, + "anvil_cost": 1, + "slots": [ + "mainhand" + ], + "effects": { + "minecraft:attributes": [ + { + "id": "minecraft:enchantment.efficiency", + "attribute": "minecraft:player.mining_efficiency", + "amount": { + "type": "minecraft:levels_squared", + "added": 1 + }, + "operation": "add_value" + } + ] + } +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_andesite.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_andesite.json new file mode 100644 index 0000000..2789f98 --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_andesite.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0, + "size": 32, + "targets": [ + { + "state": { + "Name": "minecraft:andesite" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:base_stone_overworld" + } + } + ] + } +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_coal_buried.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_coal_buried.json new file mode 100644 index 0000000..8e89bbd --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_coal_buried.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0.5, + "size": 16, + "targets": [ + { + "state": { + "Name": "minecraft:coal_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:stone_ore_replaceables" + } + }, + { + "state": { + "Name": "minecraft:deepslate_coal_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:deepslate_ore_replaceables" + } + } + ] + } +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_copper_large.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_copper_large.json new file mode 100644 index 0000000..b52b7bb --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_copper_large.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0, + "size": 5, + "targets": [ + { + "state": { + "Name": "minecraft:copper_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:stone_ore_replaceables" + } + }, + { + "state": { + "Name": "minecraft:deepslate_copper_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:deepslate_ore_replaceables" + } + } + ] + } +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_copper_small.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_copper_small.json new file mode 100644 index 0000000..ad79fb3 --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_copper_small.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0, + "size": 4, + "targets": [ + { + "state": { + "Name": "minecraft:copper_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:stone_ore_replaceables" + } + }, + { + "state": { + "Name": "minecraft:deepslate_copper_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:deepslate_ore_replaceables" + } + } + ] + } +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_diamond_buried.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_diamond_buried.json new file mode 100644 index 0000000..96b33b8 --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_diamond_buried.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 1, + "size": 4, + "targets": [ + { + "state": { + "Name": "minecraft:diamond_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:stone_ore_replaceables" + } + }, + { + "state": { + "Name": "minecraft:deepslate_diamond_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:deepslate_ore_replaceables" + } + } + ] + } +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_diamond_large.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_diamond_large.json new file mode 100644 index 0000000..577df18 --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_diamond_large.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0.7, + "size": 8, + "targets": [ + { + "state": { + "Name": "minecraft:diamond_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:stone_ore_replaceables" + } + }, + { + "state": { + "Name": "minecraft:deepslate_diamond_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:deepslate_ore_replaceables" + } + } + ] + } +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_diorite.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_diorite.json new file mode 100644 index 0000000..3dd0ddd --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_diorite.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0, + "size": 32, + "targets": [ + { + "state": { + "Name": "minecraft:diorite" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:base_stone_overworld" + } + } + ] + } +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_emerald.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_emerald.json new file mode 100644 index 0000000..3602620 --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_emerald.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0, + "size": 1, + "targets": [ + { + "state": { + "Name": "minecraft:emerald_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:stone_ore_replaceables" + } + }, + { + "state": { + "Name": "minecraft:deepslate_emerald_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:deepslate_ore_replaceables" + } + } + ] + } +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_granite.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_granite.json new file mode 100644 index 0000000..9a0b810 --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_granite.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0, + "size": 21, + "targets": [ + { + "state": { + "Name": "minecraft:granite" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:base_stone_overworld" + } + } + ] + } +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_iron.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_iron.json new file mode 100644 index 0000000..a22b7fd --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/configured_feature/ore_iron.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0, + "size": 4, + "targets": [ + { + "state": { + "Name": "minecraft:iron_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:stone_ore_replaceables" + } + }, + { + "state": { + "Name": "minecraft:deepslate_iron_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:deepslate_ore_replaceables" + } + } + ] + } +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/noise/continentalness.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/noise/continentalness.json new file mode 100644 index 0000000..a616438 --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/noise/continentalness.json @@ -0,0 +1,14 @@ +{ + "firstOctave": -11, + "amplitudes": [ + 1, + 1, + 2, + 2, + 2, + 1, + 1, + 1, + 1 + ] +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/noise/erosion.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/noise/erosion.json new file mode 100644 index 0000000..5a2ead5 --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/noise/erosion.json @@ -0,0 +1,10 @@ +{ + "firstOctave": -11, + "amplitudes": [ + 1, + 1, + 0, + 1, + 1 + ] +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/noise/temperature.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/noise/temperature.json new file mode 100644 index 0000000..f6d56fd --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/noise/temperature.json @@ -0,0 +1,11 @@ +{ + "firstOctave": -12, + "amplitudes": [ + 1.5, + 0, + 1, + 0, + 0, + 0 + ] +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/noise/vegetation.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/noise/vegetation.json new file mode 100644 index 0000000..d380669 --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/noise/vegetation.json @@ -0,0 +1,11 @@ +{ + "firstOctave": -10, + "amplitudes": [ + 1, + 1, + 0, + 0, + 0, + 0 + ] +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_andesite_lower.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_andesite_lower.json new file mode 100644 index 0000000..ab77d00 --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_andesite_lower.json @@ -0,0 +1,27 @@ +{ + "feature": "minecraft:ore_andesite", + "placement": [ + { + "type": "minecraft:count", + "count": 2 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:uniform", + "max_inclusive": { + "absolute": 60 + }, + "min_inclusive": { + "absolute": 0 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_andesite_upper.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_andesite_upper.json new file mode 100644 index 0000000..877e6ae --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_andesite_upper.json @@ -0,0 +1,27 @@ +{ + "feature": "minecraft:ore_andesite", + "placement": [ + { + "type": "minecraft:rarity_filter", + "chance": 3 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:uniform", + "max_inclusive": { + "absolute": 128 + }, + "min_inclusive": { + "absolute": 64 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_coal_lower.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_coal_lower.json new file mode 100644 index 0000000..3b2839d --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_coal_lower.json @@ -0,0 +1,33 @@ +{ + "feature": "minecraft:ore_coal_buried", + "placement": [ + { + "type": "minecraft:count", + "count": 20 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:trapezoid", + "max_inclusive": { + "absolute": 192 + }, + "min_inclusive": { + "absolute": 0 + } + }, + "min_inclusive": { + "absolute": 61 + }, + "max_inclusive": { + "absolute": 192 + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_copper.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_copper.json new file mode 100644 index 0000000..2e30da1 --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_copper.json @@ -0,0 +1,27 @@ +{ + "feature": "minecraft:ore_copper_small", + "placement": [ + { + "type": "minecraft:count", + "count": 16 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:trapezoid", + "max_inclusive": { + "absolute": 112 + }, + "min_inclusive": { + "absolute": -16 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_copper_large.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_copper_large.json new file mode 100644 index 0000000..5d571cf --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_copper_large.json @@ -0,0 +1,27 @@ +{ + "feature": "minecraft:ore_copper_large", + "placement": [ + { + "type": "minecraft:count", + "count": 16 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:trapezoid", + "max_inclusive": { + "absolute": 112 + }, + "min_inclusive": { + "absolute": -16 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_diamond_buried.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_diamond_buried.json new file mode 100644 index 0000000..a1772a8 --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_diamond_buried.json @@ -0,0 +1,33 @@ +{ + "feature": "minecraft:ore_diamond_buried", + "placement": [ + { + "type": "minecraft:count", + "count": 4 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:trapezoid", + "max_inclusive": { + "above_bottom": 80 + }, + "min_inclusive": { + "above_bottom": -80 + } + }, + "min_inclusive": { + "above_bottom": -80 + }, + "max_inclusive": { + "above_bottom": 80 + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_diamond_large.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_diamond_large.json new file mode 100644 index 0000000..808211d --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_diamond_large.json @@ -0,0 +1,33 @@ +{ + "feature": "minecraft:ore_diamond_large", + "placement": [ + { + "type": "minecraft:rarity_filter", + "chance": 5 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:trapezoid", + "max_inclusive": { + "above_bottom": 80 + }, + "min_inclusive": { + "above_bottom": -80 + } + }, + "min_inclusive": { + "above_bottom": -80 + }, + "max_inclusive": { + "above_bottom": 80 + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_diorite_lower.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_diorite_lower.json new file mode 100644 index 0000000..c0c66e5 --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_diorite_lower.json @@ -0,0 +1,27 @@ +{ + "feature": "minecraft:ore_diorite", + "placement": [ + { + "type": "minecraft:count", + "count": 2 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:uniform", + "max_inclusive": { + "absolute": 60 + }, + "min_inclusive": { + "absolute": 0 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_diorite_upper.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_diorite_upper.json new file mode 100644 index 0000000..6783495 --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_diorite_upper.json @@ -0,0 +1,27 @@ +{ + "feature": "minecraft:ore_diorite", + "placement": [ + { + "type": "minecraft:rarity_filter", + "chance": 6 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:uniform", + "max_inclusive": { + "absolute": 128 + }, + "min_inclusive": { + "absolute": 64 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_dirt.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_dirt.json new file mode 100644 index 0000000..abe6d78 --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_dirt.json @@ -0,0 +1,12 @@ +{ + "feature": { + "type": "minecraft:no_op", + "config": {} + }, + "placement": [ + { + "type": "minecraft:rarity_filter", + "chance": 468795 + } + ] +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_emerald.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_emerald.json new file mode 100644 index 0000000..6443efb --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_emerald.json @@ -0,0 +1,33 @@ +{ + "feature": "minecraft:ore_emerald", + "placement": [ + { + "type": "minecraft:count", + "count": 100 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:trapezoid", + "max_inclusive": { + "absolute": 480 + }, + "min_inclusive": { + "absolute": -16 + } + }, + "min_inclusive": { + "absolute": -16 + }, + "max_inclusive": { + "absolute": 64 + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_granite_lower.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_granite_lower.json new file mode 100644 index 0000000..e6bd8b7 --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_granite_lower.json @@ -0,0 +1,27 @@ +{ + "feature": "minecraft:ore_granite", + "placement": [ + { + "type": "minecraft:count", + "count": 2 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:uniform", + "max_inclusive": { + "absolute": 60 + }, + "min_inclusive": { + "absolute": 0 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_granite_upper.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_granite_upper.json new file mode 100644 index 0000000..bd742b4 --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_granite_upper.json @@ -0,0 +1,27 @@ +{ + "feature": "minecraft:ore_granite", + "placement": [ + { + "type": "minecraft:rarity_filter", + "chance": 6 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:uniform", + "max_inclusive": { + "absolute": 128 + }, + "min_inclusive": { + "absolute": 64 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_iron_middle.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_iron_middle.json new file mode 100644 index 0000000..bec34a5 --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_iron_middle.json @@ -0,0 +1,27 @@ +{ + "feature": "minecraft:ore_iron", + "placement": [ + { + "type": "minecraft:count", + "count": 10 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:trapezoid", + "max_inclusive": { + "absolute": 56 + }, + "min_inclusive": { + "absolute": -24 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_iron_upper.json b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_iron_upper.json new file mode 100644 index 0000000..e81bba7 --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/data/minecraft/worldgen/placed_feature/ore_iron_upper.json @@ -0,0 +1,33 @@ +{ + "feature": "minecraft:ore_iron", + "placement": [ + { + "type": "minecraft:count", + "count": 90 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:trapezoid", + "max_inclusive": { + "absolute": 384 + }, + "min_inclusive": { + "absolute": 80 + } + }, + "min_inclusive": { + "absolute": 60 + }, + "max_inclusive": { + "absolute": 85 + } + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/java/com/equilibrium/datapack/zip/pack.mcmeta b/src/main/java/com/equilibrium/datapack/zip/pack.mcmeta new file mode 100644 index 0000000..856bd23 --- /dev/null +++ b/src/main/java/com/equilibrium/datapack/zip/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "pack_format": 48, + "description": "Customized world from misode.github.io" + } +} diff --git a/src/main/java/com/equilibrium/entity/goal/BreakBlockGoal.java b/src/main/java/com/equilibrium/entity/goal/BreakBlockGoal.java new file mode 100644 index 0000000..aba371c --- /dev/null +++ b/src/main/java/com/equilibrium/entity/goal/BreakBlockGoal.java @@ -0,0 +1,126 @@ +//package com.equilibrium.entity.goal; +// +//import net.minecraft.block.Block; +//import net.minecraft.block.BlockState; +//import net.minecraft.block.Blocks; +//import net.minecraft.entity.Entity; +//import net.minecraft.entity.LivingEntity; +//import net.minecraft.entity.ai.NavigationConditions; +//import net.minecraft.entity.ai.NoPenaltyTargeting; +//import net.minecraft.entity.ai.goal.Goal; +//import net.minecraft.entity.damage.DamageType; +//import net.minecraft.entity.mob.MobEntity; +//import net.minecraft.entity.mob.PathAwareEntity; +//import net.minecraft.item.PickaxeItem; +//import net.minecraft.item.ShovelItem; +//import net.minecraft.registry.tag.BlockTags; +//import net.minecraft.registry.tag.DamageTypeTags; +//import net.minecraft.registry.tag.FluidTags; +//import net.minecraft.registry.tag.TagKey; +//import net.minecraft.util.math.BlockPos; +//import net.minecraft.util.math.Vec3d; +//import net.minecraft.world.BlockView; +//import net.minecraft.world.GameRules; +//import net.minecraft.world.WorldEvents; +//import org.jetbrains.annotations.NotNull; +//import org.jetbrains.annotations.Nullable; +// +//import java.util.EnumSet; +//import java.util.function.Function; +// +//public class BreakBlockGoal extends Goal { +// protected final MobEntity mob; +// protected BlockPos breakPos = BlockPos.ORIGIN; +// protected BlockState breakState = Blocks.AIR.getDefaultState(); +// protected boolean shouldStop; +// private float offsetX, offsetZ; +// protected int breakProgress = -1, prevBreakStage = -1; +// +// public BreakBlockGoal(MobEntity mob) { +// this.mob = mob; +// if (!NavigationConditions.hasMobNavigation(mob)) { +// throw new IllegalArgumentException("Unsupported mob type for BreakBlockGoal"); +// } +// } +// +// @Override +// public boolean canStart() { +// //Choose a block to break +// LivingEntity target = this.mob.getTarget(); +// if (target == null || !this.mob.getWorld().getGameRules().getBoolean(GameRules.DO_MOB_GRIEFING)) return false; +// for (double[] findPos : EntityHelper.FIND_NEAREST_BLOCKS) { +// //Should not dig upward when not above target +// if (findPos[1] == -1 && this.mob.getY() <= target.getY()) continue; +// //Should not dig downward when not under target +// if (findPos[1] == 2 && this.mob.getY() >= target.getY()) continue; +// //Choose a pos to break +// BlockPos pendingBreakPos = new BlockPos((int) (this.mob.getX() + findPos[0]), (int) (this.mob.getY() + findPos[1]), (int) (this.mob.getZ() + findPos[2])); +// //Should not break the block behind itself +// BlockPos backPos = EntityHelper.getPosFacing(this.mob, true); +// if (pendingBreakPos.getX() == backPos.getX() && pendingBreakPos.getZ() == backPos.getZ()) continue; +// BlockState pendingBreakState = this.mob.world.getBlockState(pendingBreakPos); +// Material material = pendingBreakState.getMaterial(); +// //Avoid redundant destroying +// if (material == Material.REPLACEABLE_PLANT || material == Material.PLANT) continue; +// //Determine whether to start +// if (canBreakBlock(pendingBreakState) && this.mob.getNavigation().isIdle()) { +// this.breakPos = pendingBreakPos; +// this.breakState = pendingBreakState; +// return true; +// } +// } +// return false; +// } +// +// @Override +// public void start() { +// this.shouldStop = false; +// this.offsetX = (float) ((double) this.breakPos.getX() + 0.5 - this.mob.getX()); +// this.offsetZ = (float) ((double) this.breakPos.getZ() + 0.5 - this.mob.getZ()); +// this.breakProgress = 0; +// } +// +// @Override +// public void stop() { +// super.stop(); +// this.mob.getWorld().setBlockBreakingInfo(this.mob.getId(), this.breakPos, -1); +// } +// +// @Override +// public boolean shouldRunEveryTick() { +// return true; +// } +// +// +// @Override +// public boolean shouldContinue() { +//// System.out.println("state=" + this.breakState + "\t!shouldStop=" + !this.shouldStop + "\t breakProgress=" + this.breakProgress + "\t max=" + this.getMaxProgress() + "\t canBreak=" + canBreakBlock(this.breakState) + "\t withinDistance=" + this.breakPos.isWithinDistance(this.mob.getPos(), 5) + "\tTimeSinceLastAttack=" + this.mob.getDamageTracker().getTimeSinceLastAttack() + "\tRecently attacked=" + this.mob.getDamageTracker().wasRecentlyAttacked()); +// return !this.shouldStop && this.breakProgress <= this.getMaxProgress() && canBreakBlock(this.breakState) && this.breakPos.isWithinDistance(this.mob.getPos(), 5) && (!this.mob.getDamageTracker().wasRecentlyAttacked() || this.mob.getDamageTracker().getTimeSinceLastAttack() > 20); +// } +// +// public int getMaxProgress() { +// return (int) (HcsDifficulty.chooseVal(this.mob.getWorld(), 2000.0F, 1000.0F, 500.0F) * this.breakState.getBlock().getHardness() * ((this.mob.getMainHandStack().getItem() instanceof ShovelItem) ? 0.2F : 1.0F)); +// } +// +// public boolean canBreakBlock(@NotNull BlockState state) { +// return !state.isAir() && (DoorBlock.isWoodenDoor(state) || (DigRestrictHelper.canBreak(this.mob.getMainHandStack().getItem(), state) && (state.getBlock().getHardness() < Blocks.STONE.getHardness() || this.mob.getMainHandStack().getItem() instanceof PickaxeItem)) /*&& !state.getBlock().getTranslationKey().contains("brick")*/) || state.isIn(BlockTags.SHOVEL_MINEABLE); +// } +// +// @Override +// public void tick() { +// ++this.breakProgress; +// if (this.offsetX * (float) ((double) this.breakPos.getX() + 0.5 - this.mob.getX()) + this.offsetZ * (float) ((double) this.breakPos.getZ() + 0.5 - this.mob.getZ()) < 0.0f) +// this.shouldStop = true; +// if (this.breakProgress % 40 == 0 && !this.mob.handSwinging) this.mob.swingHand(this.mob.getActiveHand()); +// int breakStage = (int) ((float) this.breakProgress / (float) this.getMaxProgress() * 10.0f); +// if (breakStage != this.prevBreakStage) { +// this.mob.getWorld().setBlockBreakingInfo(this.mob.getId(), this.breakPos, breakStage); +// this.mob.getWorld().syncWorldEvent(WorldEvents.BLOCK_BROKEN, this.breakPos, Block.getRawIdFromState(this.breakState)); +// this.prevBreakStage = breakStage; +// } +// if (this.breakProgress >= this.getMaxProgress()) { +// this.mob.getWorld().breakBlock(this.breakPos, true, this.mob); +// WorldHelper.checkBlockGravity(this.mob.getWorld(), this.breakPos); +// } +// } +//} \ No newline at end of file diff --git a/src/main/java/com/equilibrium/event/BreakBlockEvent.java b/src/main/java/com/equilibrium/event/BreakBlockEvent.java index f1c36fe..5137643 100644 --- a/src/main/java/com/equilibrium/event/BreakBlockEvent.java +++ b/src/main/java/com/equilibrium/event/BreakBlockEvent.java @@ -1,5 +1,6 @@ package com.equilibrium.event; -import com.equilibrium.register.tags.ModBlockTags; +import com.equilibrium.item.Metal; +import com.equilibrium.tags.ModBlockTags; import com.equilibrium.util.IsMinable; import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents; import net.minecraft.block.*; @@ -11,6 +12,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.*; import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.tag.BlockTags; import net.minecraft.text.Text; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -18,11 +20,7 @@ import java.util.Random; -import static com.equilibrium.MITEequilibrium.LOGGER; - public class BreakBlockEvent implements PlayerBlockBreakEvents.After{ - - /** * Called after a block is successfully broken. * @@ -48,13 +46,55 @@ public void afterBlockBreak(World world, PlayerEntity player, BlockPos pos, Bloc } + if(state.isIn(ModBlockTags.LOG_120)){ + itemStack.damage(120-1,player, EquipmentSlot.MAINHAND); + player.sendMessage(Text.of("-120")); + }else + if(state.isIn(ModBlockTags.STONE_LIKE_240)){ itemStack.damage(240-1,player, EquipmentSlot.MAINHAND); + player.sendMessage(Text.of("-240")); } - if(state.isIn(ModBlockTags.LOG_120)){ - itemStack.damage(120-1,player, EquipmentSlot.MAINHAND); + else + if(state.isIn(ModBlockTags.STONE_LIKE_360)){ + itemStack.damage(360-1,player, EquipmentSlot.MAINHAND); + player.sendMessage(Text.of("-360")); + } + else + if(state.isIn(ModBlockTags.STONE_LIKE_480)){ + itemStack.damage(480-1,player, EquipmentSlot.MAINHAND); + player.sendMessage(Text.of("-480")); + } + + //240 360 480其余没有列出的,但是确实比较硬的物品,而且在三者子集里容易冲突 + else + if(state.isIn(BlockTags.NEEDS_STONE_TOOL)){ + itemStack.damage(240-1,player, EquipmentSlot.MAINHAND); + player.sendMessage(Text.of("-240"));} + else + if(state.isIn(BlockTags.NEEDS_IRON_TOOL)) { + itemStack.damage(360 - 1, player, EquipmentSlot.MAINHAND); + player.sendMessage(Text.of("-360")); + } + else + if(state.isIn(BlockTags.NEEDS_DIAMOND_TOOL)) { + itemStack.damage(480 - 1, player, EquipmentSlot.MAINHAND); + player.sendMessage(Text.of("-480")); + } + + else + if(state.isIn(ModBlockTags.NORMAL_30)){ + itemStack.damage(30-1,player, EquipmentSlot.MAINHAND); + player.sendMessage(Text.of("-30")); + } + else + if(state.isIn(ModBlockTags.NORMAL_60)){ + itemStack.damage(60-1,player, EquipmentSlot.MAINHAND); + player.sendMessage(Text.of("-60")); } + + if (state.getBlock() == Blocks.GRAVEL) { itemStack =player.getMainHandStack(); @@ -84,25 +124,35 @@ public void afterBlockBreak(World world, PlayerEntity player, BlockPos pos, Bloc if(randomNumber2==0){ //0,就1个,1% itemDrop = new ItemEntity( world, pos.getX()+0.5, pos.getY(), pos.getZ()+0.5, - new ItemStack(Items.GOLD_BLOCK)); + new ItemStack(Metal.copper_nugget)); + world.spawnEntity(itemDrop); + world.spawnEntity(itemDrop); + world.spawnEntity(itemDrop); + } else if(randomNumber2<=8) { //1-8,共8个 8% itemDrop = new ItemEntity( world, pos.getX()+0.5, pos.getY(), pos.getZ()+0.5, - new ItemStack(Items.GOLD_INGOT)); + new ItemStack(Metal.silver_nugget)); + world.spawnEntity(itemDrop); + } else if (randomNumber2 <= 24) { //9-24,共16个 16% itemDrop = new ItemEntity( world, pos.getX()+0.5, pos.getY(), pos.getZ()+0.5, - new ItemStack(Items.GOLD_NUGGET)); + new ItemStack(Items.FLINT)); + world.spawnEntity(itemDrop); + } else if (randomNumber2 <= 46) { //25-46,共22个 22% itemDrop = new ItemEntity( world, pos.getX()+0.5, pos.getY(), pos.getZ()+0.5, - new ItemStack(Items.GOLD_NUGGET)); + new ItemStack(Metal.copper_nugget)); + world.spawnEntity(itemDrop); + }else{ - //47-99,共53个 75% + //47-99,共53个 53% itemDrop = new ItemEntity(world, pos.getX()+0.5, pos.getY(), pos.getZ()+0.5, - new ItemStack(Items.STONE)); + new ItemStack(Metal.FLINT)); + world.spawnEntity(itemDrop); } - world.spawnEntity(itemDrop); }else{ return; } diff --git a/src/main/java/com/equilibrium/event/MoonPhaseEvent.java b/src/main/java/com/equilibrium/event/MoonPhaseEvent.java new file mode 100644 index 0000000..aa4e741 --- /dev/null +++ b/src/main/java/com/equilibrium/event/MoonPhaseEvent.java @@ -0,0 +1,229 @@ +package com.equilibrium.event; + +import com.equilibrium.util.WorldMoonPhasesSelector; +import net.minecraft.block.Blocks; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.EquipmentSlot; +import net.minecraft.entity.LightningEntity; +import net.minecraft.entity.effect.StatusEffectInstance; +import net.minecraft.entity.effect.StatusEffects; +import net.minecraft.entity.mob.CreeperEntity; +import net.minecraft.entity.mob.MobEntity; +import net.minecraft.entity.mob.SkeletonEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.network.packet.s2c.play.GameStateChangeS2CPacket; +import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.sound.SoundCategory; +import net.minecraft.sound.SoundEvents; +import net.minecraft.text.Text; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; +import net.minecraft.world.GameRules; +import net.minecraft.world.World; + +import java.util.Random; + +import net.minecraft.server.world.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.GameRules; +import net.minecraft.world.level.ServerWorldProperties; + +public class MoonPhaseEvent { + private static final EntityType[] ANIMAL_TYPES = new EntityType[]{ + EntityType.PIG, + EntityType.COW, + EntityType.SHEEP, + EntityType.CHICKEN + }; + private static final EntityType[] MOB_TYPES = new EntityType[]{ + EntityType.ZOMBIE, + EntityType.CREEPER, + EntityType.SPIDER, + EntityType.SKELETON + }; + private static String moonType; + + public static String getMoonType(World world) { + moonType = WorldMoonPhasesSelector.setAndGetMoonType(world); + if (moonType != null) + return moonType; + else { + return "errorMoontype"; + } + } + + + + + public static void spawnMobNearPlayer(ServerWorld world) { + PlayerEntity player = world.getRandomAlivePlayer(); + if (player != null) { + Random random = new Random(); + Vec3d playerPos = player.getPos(); + + for (int i = 0; i < 10; i++) { // Try up to 10 times to find a valid position + double offsetX = (random.nextDouble() - 0.5) * 40.0; // Offset range extended to 40 + double offsetZ = (random.nextDouble() - 0.5) * 40.0; // Offset range extended to 40 + if (Math.abs(offsetX) < 16) { + offsetX += 16 * Math.signum(offsetX); // Ensure minimum offset of 16 blocks + } + if (Math.abs(offsetZ) < 16) { + offsetZ += 16 * Math.signum(offsetZ); // Ensure minimum offset of 16 blocks + } + BlockPos spawnPos = new BlockPos((int) (playerPos.x + offsetX), (int) playerPos.y, (int) (playerPos.z + offsetZ)); + + // Find the highest non-air block at the spawn position + while (world.isAir(spawnPos) && spawnPos.getY() > 0) { + spawnPos = spawnPos.down(); + } + + // Ensure the spawn position is not in lava and the block above is air + if (world.getBlockState(spawnPos).getBlock() != Blocks.LAVA && !world.isAir(spawnPos)) { + BlockPos spawnAbovePos = spawnPos.up(); + BlockPos spawnAbovePos2 = spawnPos.up(2); + + // Check if the position is valid for spawning a mob + if (world.isAir(spawnAbovePos) && world.isAir(spawnAbovePos2)) { + EntityType mobType = MOB_TYPES[random.nextInt(MOB_TYPES.length)]; + MobEntity mob = (MobEntity) mobType.create(world); + StatusEffectInstance statusEffectInstance = new StatusEffectInstance(StatusEffects.STRENGTH, -1, 2, false, true, false); + if (mob != null) { + mob.refreshPositionAndAngles(spawnPos.getX() + 0.5, spawnPos.getY() + 1, spawnPos.getZ() + 0.5, random.nextFloat() * 360.0F, 0.0F); + //为怪物施加力量效果,除了苦力怕 + if (!(mob instanceof CreeperEntity)) { + mob.addStatusEffect(statusEffectInstance); + } + // Ensure SkeletonEntity spawns with a bow + if (mob instanceof SkeletonEntity) { + SkeletonEntity skeleton = (SkeletonEntity) mob; + skeleton.equipStack(EquipmentSlot.MAINHAND, new ItemStack(Items.BOW)); + } + + world.spawnEntity(mob); + break; + } + } + } + } + } + + } + + + public static void spawnLighteningNearPlayer(ServerWorld world, PlayerEntity player) { + Random random = new Random(); + Vec3d playerPos = player.getPos(); + + double offsetX = (random.nextDouble() - 0.5) * 40.0; // Offset range extended to 40 + double offsetZ = (random.nextDouble() - 0.5) * 40.0; // Offset range extended to 40 + + BlockPos spawnPos = new BlockPos((int) (playerPos.x + offsetX), (int) playerPos.y, (int) (playerPos.z + offsetZ)); + // Find the highest non-air block at the spawn position + while (world.isAir(spawnPos) && spawnPos.getY() > 0) { + spawnPos = spawnPos.down(); + } + + LightningEntity lightning = EntityType.LIGHTNING_BOLT.create(world); + if (lightning != null) { + lightning.refreshPositionAfterTeleport(Vec3d.ofBottomCenter(spawnPos)); + world.spawnEntity(lightning); + } + + } + + + + public static void spawnAnimalNearPlayer(ServerWorld world) { + PlayerEntity player = world.getRandomAlivePlayer(); + if (player != null) { + Random random = new Random(); + Vec3d playerPos = player.getPos(); + + for (int i = 0; i < 10; i++) { // Try up to 10 times to find a valid position + double offsetX = (random.nextDouble() - 0.5) * 64.0; // Offset range extended to 64 + double offsetZ = (random.nextDouble() - 0.5) * 64.0; // Offset range extended to 64 + if (Math.abs(offsetX) < 32) { + offsetX += 32 * Math.signum(offsetX); // Ensure minimum offset of 32 blocks + } + if (Math.abs(offsetZ) < 32) { + offsetZ += 32 * Math.signum(offsetZ); // Ensure minimum offset of 32 blocks + } + BlockPos spawnPos = new BlockPos((int) (playerPos.x + offsetX), (int) playerPos.y, (int) (playerPos.z + offsetZ)); + + // Find the highest non-air block at the spawn position + while (world.isAir(spawnPos) && spawnPos.getY() > 0) { + spawnPos = spawnPos.down(); + } + + // Ensure the spawn position is not in lava + if (world.getBlockState(spawnPos).getBlock() == Blocks.LAVA || world.getBlockState(spawnPos).getBlock() == Blocks.WATER) { + continue; + } + + // Check if the position is valid for spawning an animal + if (world.isAir(spawnPos.up()) && world.isAir(spawnPos.up(2))) { + EntityType animalType = ANIMAL_TYPES[random.nextInt(ANIMAL_TYPES.length)]; + MobEntity animal = (MobEntity) animalType.create(world); + if (animal != null) { + animal.refreshPositionAndAngles(spawnPos.getX() + 0.5, spawnPos.getY() + 1, spawnPos.getZ() + 0.5, random.nextFloat() * 360.0F, 0.0F); + world.spawnEntity(animal); + break; + } + } + } + } + } + + + public static void RandomTickModifier(ServerWorld world, int randomTickSpeed) { + PlayerEntity player = world.getRandomAlivePlayer(); + if (player != null) + player.getWorld().getGameRules().get(GameRules.RANDOM_TICK_SPEED).set(randomTickSpeed, player.getServer()); + } + + + public static void controlWeather(ServerWorld world) { + PlayerEntity playerEntity = world.getRandomAlivePlayer(); + long timeOfDay = world.getTimeOfDay() % 24000; // 获取当前时间(一天有24000刻) + + if (timeOfDay >= 0 && timeOfDay < 14000) { + startThunderstorm(world); + if (playerEntity != null) + if (playerEntity.getRandom().nextInt(4) == 0) { + playerEntity.sendMessage(Text.of("雷声")); + playerEntity.getWorld().playSound(null, BlockPos.ofFloored(playerEntity.getPos()), SoundEvents.ENTITY_LIGHTNING_BOLT_THUNDER, SoundCategory.WEATHER, 1.0F, 1.0F); + } else { + spawnLighteningNearPlayer(world, playerEntity); + playerEntity.sendMessage(Text.of("雷电")); + } + + + } else { // 其他时间段 + clearWeather(world); + } + } + + public static void startThunderstorm(ServerWorld world) { + ServerWorldProperties worldProperties = (ServerWorldProperties) world.getLevelProperties(); + worldProperties.setThundering(true); + worldProperties.setRaining(true); + worldProperties.setClearWeatherTime(0); + worldProperties.setRainTime(6000); + worldProperties.setThunderTime(6000); + + + } + + public static void clearWeather(ServerWorld world) { + ServerWorldProperties worldProperties = (ServerWorldProperties) world.getLevelProperties(); + worldProperties.setThundering(false); // 关闭雷雨 + worldProperties.setRaining(false); // 关闭降雨 + worldProperties.setClearWeatherTime(12000); // 设置晴天时间长度(可以根据需要调整) + } + + +} diff --git a/src/main/java/com/equilibrium/gen/ModModelProvider.java b/src/main/java/com/equilibrium/gen/ModModelProvider.java index 8f73416..85511df 100644 --- a/src/main/java/com/equilibrium/gen/ModModelProvider.java +++ b/src/main/java/com/equilibrium/gen/ModModelProvider.java @@ -3,13 +3,11 @@ import com.equilibrium.block.ModBlocks; import com.equilibrium.item.Metal; import com.equilibrium.item.Tools; -import com.equilibrium.item.tools.ModToolMaterials; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.fabricmc.fabric.api.datagen.v1.provider.FabricModelProvider; import net.minecraft.data.client.BlockStateModelGenerator; import net.minecraft.data.client.ItemModelGenerator; import net.minecraft.data.client.Models; -import net.minecraft.item.Item; public class ModModelProvider extends FabricModelProvider { public ModModelProvider(FabricDataOutput output) { @@ -55,9 +53,54 @@ public void generateItemModels(ItemModelGenerator itemModelGenerator) { itemModelGenerator.register(Metal.gold_nugget, Models.GENERATED); itemModelGenerator.register(Metal.mithril_nugget, Models.GENERATED); itemModelGenerator.register(Metal.silver_nugget, Models.GENERATED); + itemModelGenerator.register(Metal.FLINT, Models.GENERATED); itemModelGenerator.register(Tools.FLINT_HATCHET, Models.HANDHELD); + itemModelGenerator.register(Tools.FLINT_AXE, Models.HANDHELD); + itemModelGenerator.register(Tools.FLINT_KNIFE, Models.HANDHELD); + itemModelGenerator.register(Tools.FLINT_SHOVEL, Models.HANDHELD); + itemModelGenerator.register(Tools.IRON_AXE, Models.HANDHELD); + itemModelGenerator.register(Tools.ADAMANTIUM_AXE, Models.HANDHELD); + itemModelGenerator.register(Tools.GOLD_AXE, Models.HANDHELD); + itemModelGenerator.register(Tools.COPPER_AXE, Models.HANDHELD); + itemModelGenerator.register(Tools.SILVER_AXE, Models.HANDHELD); + itemModelGenerator.register(Tools.MITHRIL_AXE, Models.HANDHELD); + + itemModelGenerator.register(Tools.IRON_HOE, Models.HANDHELD); + itemModelGenerator.register(Tools.ADMANTIUM_HOE, Models.HANDHELD); + itemModelGenerator.register(Tools.GOLD_HOE, Models.HANDHELD); + itemModelGenerator.register(Tools.COPPER_HOE, Models.HANDHELD); + itemModelGenerator.register(Tools.SILVER_HOE, Models.HANDHELD); + itemModelGenerator.register(Tools.MITHRIL_HOE, Models.HANDHELD); + + itemModelGenerator.register(Tools.IRON_DAGGER, Models.HANDHELD); + itemModelGenerator.register(Tools.ADMANTIUM_DAGGER, Models.HANDHELD); + itemModelGenerator.register(Tools.GOLD_DAGGER, Models.HANDHELD); + itemModelGenerator.register(Tools.COPPER_DAGGER, Models.HANDHELD); + itemModelGenerator.register(Tools.SILVER_DAGGER, Models.HANDHELD); + itemModelGenerator.register(Tools.MITHRIL_DAGGER, Models.HANDHELD); + + itemModelGenerator.register(Tools.IRON_SHOVEL, Models.HANDHELD); + itemModelGenerator.register(Tools.ADMANTIUM_SHOVEL, Models.HANDHELD); + itemModelGenerator.register(Tools.GOLD_SHOVEL, Models.HANDHELD); + itemModelGenerator.register(Tools.COPPER_SHOVEL, Models.HANDHELD); + itemModelGenerator.register(Tools.SILVER_SHOVEL, Models.HANDHELD); + itemModelGenerator.register(Tools.MITHRIL_SHOVEL, Models.HANDHELD); + + itemModelGenerator.register(Tools.IRON_SWORD, Models.HANDHELD); + itemModelGenerator.register(Tools.ADMANTIUM_SWORD, Models.HANDHELD); + itemModelGenerator.register(Tools.GOLD_SWORD, Models.HANDHELD); + itemModelGenerator.register(Tools.COPPER_SWORD, Models.HANDHELD); + itemModelGenerator.register(Tools.SILVER_SWORD, Models.HANDHELD); + itemModelGenerator.register(Tools.MITHRIL_SWORD, Models.HANDHELD); + + itemModelGenerator.register(Tools.IRON_PICKAXE, Models.HANDHELD); + itemModelGenerator.register(Tools.ADMANTIUM_PICKAXE, Models.HANDHELD); + itemModelGenerator.register(Tools.GOLD_PICKAXE, Models.HANDHELD); + itemModelGenerator.register(Tools.COPPER_PICKAXE, Models.HANDHELD); + itemModelGenerator.register(Tools.SILVER_PICKAXE, Models.HANDHELD); + itemModelGenerator.register(Tools.MITHRIL_PICKAXE, Models.HANDHELD); } } diff --git a/src/main/java/com/equilibrium/gen/ModRecipeGenerator.java b/src/main/java/com/equilibrium/gen/ModRecipeGenerator.java index 27dd684..fca849c 100644 --- a/src/main/java/com/equilibrium/gen/ModRecipeGenerator.java +++ b/src/main/java/com/equilibrium/gen/ModRecipeGenerator.java @@ -1,7 +1,10 @@ package com.equilibrium.gen; +import com.equilibrium.block.ModBlocks; import com.equilibrium.item.Metal; +import com.equilibrium.item.ModItems; import com.equilibrium.item.Tools; +import com.equilibrium.tags.ModItemTags; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider; import net.minecraft.data.server.recipe.RecipeExporter; @@ -16,19 +19,466 @@ public class ModRecipeGenerator extends FabricRecipeProvider { + public ModRecipeGenerator(FabricDataOutput output, CompletableFuture registriesFuture) { super(output, registriesFuture); } + @Override public void generate(RecipeExporter exporter) { - ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.adamantium_axe). + + //piece->flint + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, Items.FLINT). + pattern("XX"). + pattern("XX"). + input('X', Metal.FLINT). + criterion("has_item", RecipeProvider.conditionsFromItem(Items.FLINT)). + offerTo(exporter, Identifier.of("miteequilibrium","piece_to_flint")); + + //flint->piece + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, Metal.FLINT,4). + pattern("X"). + input('X', Items.FLINT). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.FLINT)). + offerTo(exporter, Identifier.of("miteequilibrium","flint_to_piece")); + + + + + //axe + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.FLINT_AXE). + pattern("XX"). + pattern("XY"). + pattern(" Y"). + input('X', Items.FLINT). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Items.FLINT)). + offerTo(exporter, Identifier.of("miteequilibrium","flint_axe")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.ADAMANTIUM_AXE). pattern("XX"). pattern("XY"). pattern(" Y"). input('X', Metal.adamantium). input('Y',Items.STICK). criterion("has_item", RecipeProvider.conditionsFromItem(Metal.adamantium)). - offerTo(exporter, Identifier.of("adamantium_axe")); + offerTo(exporter, Identifier.of("miteequilibrium","adamantium_axe")); + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.COPPER_AXE). + pattern("XX"). + pattern("XY"). + pattern(" Y"). + input('X', Metal.copper). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.copper)). + offerTo(exporter, Identifier.of("miteequilibrium","copper_axe")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.SILVER_AXE). + pattern("XX"). + pattern("XY"). + pattern(" Y"). + input('X', Metal.silver). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.silver)). + offerTo(exporter, Identifier.of("miteequilibrium","silver_axe")); +//在合成表输出的时候替换掉原来的铁工具就好了 +// ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.IRON_AXE). +// pattern("XX"). +// pattern("XY"). +// pattern(" Y"). +// input('X', Items.IRON_INGOT). +// input('Y',Items.STICK). +// criterion("has_item", RecipeProvider.conditionsFromItem(Items.IRON_INGOT)). +// offerTo(exporter, Identifier.of("miteequilibrium","iron_axe")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.MITHRIL_AXE). + pattern("XX"). + pattern("XY"). + pattern(" Y"). + input('X', Metal.mithril). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.mithril)). + offerTo(exporter, Identifier.of("miteequilibrium","mithril_axe")); + +// ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.GOLD_AXE). +// pattern("XX"). +// pattern("XY"). +// pattern(" Y"). +// input('X', Metal.gold). +// input('Y',Items.STICK). +// criterion("has_item", RecipeProvider.conditionsFromItem(Metal.gold)). +// offerTo(exporter, Identifier.of("miteequilibrium","gold_axe")); + + + + + + //shovel + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.FLINT_SHOVEL). + pattern("X"). + pattern("Y"). + pattern("Y"). + input('X', Items.FLINT). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Items.FLINT)). + offerTo(exporter, Identifier.of("miteequilibrium","flint_shovel")); + + + + + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.ADMANTIUM_SHOVEL). + pattern("X"). + pattern("Y"). + pattern("Y"). + input('X', Metal.adamantium). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.adamantium)). + offerTo(exporter, Identifier.of("miteequilibrium","adamantium_shovel")); + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.COPPER_SHOVEL). + pattern("X"). + pattern("Y"). + pattern("Y"). + input('X', Metal.copper). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.copper)). + offerTo(exporter, Identifier.of("miteequilibrium","copper_shovel")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.SILVER_SHOVEL). + pattern("X"). + pattern("Y"). + pattern("Y"). + input('X', Metal.silver). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.silver)). + offerTo(exporter, Identifier.of("miteequilibrium","silver_shovel")); + +// ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.IRON_SHOVEL). +// pattern("X"). +// pattern("Y"). +// pattern("Y"). +// input('X', Items.IRON_INGOT). +// input('Y',Items.STICK). +// criterion("has_item", RecipeProvider.conditionsFromItem(Items.IRON_INGOT)). +// offerTo(exporter, Identifier.of("miteequilibrium","iron_axe")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.MITHRIL_SHOVEL). + pattern("X"). + pattern("Y"). + pattern("Y"). + input('X', Metal.mithril). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.mithril)). + offerTo(exporter, Identifier.of("miteequilibrium","mithril_shovel")); + +// ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.GOLD_SHOVEL). +// pattern("X"). +// pattern("Y"). +// pattern("Y"). +// input('X', Metal.gold). +// input('Y',Items.STICK). +// criterion("has_item", RecipeProvider.conditionsFromItem(Metal.gold)). +// offerTo(exporter, Identifier.of("miteequilibrium","gold_shovel")); + + + //dagger + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.FLINT_KNIFE). + pattern("X"). + pattern("Y"). + input('X', Items.FLINT). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Items.FLINT)). + offerTo(exporter, Identifier.of("miteequilibrium","flint_knife")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.ADMANTIUM_DAGGER). + pattern("X"). + pattern("Y"). + input('X', Metal.adamantium). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.adamantium)). + offerTo(exporter, Identifier.of("miteequilibrium","adamantium_dagger")); + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.COPPER_DAGGER). + pattern("X"). + pattern("Y"). + input('X', Metal.copper). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.copper)). + offerTo(exporter, Identifier.of("miteequilibrium","copper_dagger")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.SILVER_DAGGER). + pattern("X"). + pattern("Y"). + input('X', Metal.silver). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.silver)). + offerTo(exporter, Identifier.of("miteequilibrium","silver_dagger")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.IRON_DAGGER). + pattern("X"). + pattern("Y"). + input('X', Items.IRON_INGOT). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Items.IRON_INGOT)). + offerTo(exporter, Identifier.of("miteequilibrium","iron_dagger")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.MITHRIL_DAGGER). + pattern("X"). + pattern("Y"). + input('X', Metal.mithril). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.mithril)). + offerTo(exporter, Identifier.of("miteequilibrium","mithril_dagger")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.GOLD_DAGGER). + pattern("X"). + pattern("Y"). + input('X', Items.GOLD_INGOT). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.gold)). + offerTo(exporter, Identifier.of("miteequilibrium","gold_dagger")); + + //hoe + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.ADMANTIUM_HOE). + pattern("XX"). + pattern(" Y"). + pattern(" Y"). + input('X', Metal.adamantium). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.adamantium)). + offerTo(exporter, Identifier.of("miteequilibrium","adamantium_hoe")); + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.COPPER_HOE). + pattern("XX"). + pattern(" Y"). + pattern(" Y"). + input('X', Metal.copper). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.copper)). + offerTo(exporter, Identifier.of("miteequilibrium","copper_hoe")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.SILVER_HOE). + pattern("XX"). + pattern(" Y"). + pattern(" Y"). + input('X', Metal.silver). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.silver)). + offerTo(exporter, Identifier.of("miteequilibrium","silver_hoe")); + +// ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.IRON_HOE). +// pattern("XX"). +// pattern(" Y"). +// pattern(" Y"). +// input('X', Items.IRON_INGOT). +// input('Y',Items.STICK). +// criterion("has_item", RecipeProvider.conditionsFromItem(Items.IRON_INGOT)). +// offerTo(exporter, Identifier.of("miteequilibrium","iron_hoe")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.MITHRIL_HOE). + pattern("XX"). + pattern(" Y"). + pattern(" Y"). + input('X', Metal.mithril). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.mithril)). + offerTo(exporter, Identifier.of("miteequilibrium","mithril_hoe")); + +// ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.GOLD_HOE). +// pattern("XX"). +// pattern(" Y"). +// pattern(" Y"). +// input('X', Metal.gold). +// input('Y',Items.STICK). +// criterion("has_item", RecipeProvider.conditionsFromItem(Metal.gold)). +// offerTo(exporter, Identifier.of("miteequilibrium","gold_hoe")); + + + //pickaxe + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.ADMANTIUM_PICKAXE). + pattern("XXX"). + pattern(" Y "). + pattern(" Y "). + input('X', Metal.adamantium). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.adamantium)). + offerTo(exporter, Identifier.of("miteequilibrium","adamantium_pickaxe")); + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.COPPER_PICKAXE). + pattern("XXX"). + pattern(" Y "). + pattern(" Y "). + input('X', Metal.copper). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.copper)). + offerTo(exporter, Identifier.of("miteequilibrium","copper_pickaxe")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.SILVER_PICKAXE). + pattern("XXX"). + pattern(" Y "). + pattern(" Y "). + input('X', Metal.silver). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.silver)). + offerTo(exporter, Identifier.of("miteequilibrium","silver_pickaxe")); +// +// ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.IRON_PICKAXE). +// pattern("XXX"). +// pattern(" Y "). +// pattern(" Y "). +// input('X', Items.IRON_INGOT). +// input('Y',Items.STICK). +// criterion("has_item", RecipeProvider.conditionsFromItem(Items.IRON_INGOT)). +// offerTo(exporter, Identifier.of("miteequilibrium","iron_pickaxe")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.MITHRIL_PICKAXE). + pattern("XXX"). + pattern(" Y "). + pattern(" Y "). + input('X', Metal.mithril). + input('Y',Items.STICK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.mithril)). + offerTo(exporter, Identifier.of("miteequilibrium","mithril_pickaxe")); + +// ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, Tools.GOLD_PICKAXE). +// pattern("XXX"). +// pattern(" Y "). +// pattern(" Y "). +// input('X', Metal.gold). +// input('Y',Items.STICK). +// criterion("has_item", RecipeProvider.conditionsFromItem(Metal.gold)). +// offerTo(exporter, Identifier.of("miteequilibrium","gold_pickaxe")); + + + + //nugget、ingot、block + + + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, ModBlocks.ADAMANTIUM_BLOCK). + pattern("XXX"). + pattern("XXX"). + pattern("XXX"). + input('X', Metal.adamantium). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.adamantium)). + offerTo(exporter, Identifier.of("miteequilibrium","adamantium_block")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, ModBlocks.COPPER_BLOCK). + pattern("XXX"). + pattern("XXX"). + pattern("XXX"). + input('X', Metal.copper). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.copper)). + offerTo(exporter, Identifier.of("miteequilibrium","copper_block")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, ModBlocks.SILVER_BLOCK). + pattern("XXX"). + pattern("XXX"). + pattern("XXX"). + input('X', Metal.silver). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.silver)). + offerTo(exporter, Identifier.of("miteequilibrium","silver_block")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, ModBlocks.MITHRIL_BLOCK). + pattern("XXX"). + pattern("XXX"). + pattern("XXX"). + input('X', Metal.mithril). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.mithril)). + offerTo(exporter, Identifier.of("miteequilibrium","mithril_block")); + + + + //nugget->ingot + + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC,Metal.adamantium). + pattern("XXX"). + pattern("XXX"). + pattern("XXX"). + input('X', Metal.adamantium_nugget). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.adamantium_nugget)). + offerTo(exporter, Identifier.of("miteequilibrium","adamantium")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, Metal.copper). + pattern("XXX"). + pattern("XXX"). + pattern("XXX"). + input('X', Metal.copper_nugget). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.copper)). + offerTo(exporter, Identifier.of("miteequilibrium","copper")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, Metal.silver_nugget). + pattern("XXX"). + pattern("XXX"). + pattern("XXX"). + input('X', Metal.silver_nugget). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.silver_nugget)). + offerTo(exporter, Identifier.of("miteequilibrium","silver")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC, Metal.mithril). + pattern("XXX"). + pattern("XXX"). + pattern("XXX"). + input('X', Metal.mithril_nugget). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.mithril)). + offerTo(exporter, Identifier.of("miteequilibrium","mithril")); + + //block->ingot + + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC,Metal.adamantium,9). + pattern("X"). + input('X', ModBlocks.ADAMANTIUM_BLOCK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.adamantium)). + offerTo(exporter, Identifier.of("miteequilibrium","adamantium_from_block")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC,Metal.mithril,9). + pattern("X"). + input('X', ModBlocks.MITHRIL_BLOCK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.mithril)). + offerTo(exporter, Identifier.of("miteequilibrium","mithril_from_block")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC,Metal.copper,9). + pattern("X"). + input('X', ModBlocks.COPPER_BLOCK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.copper)). + offerTo(exporter, Identifier.of("miteequilibrium","copper_from_block")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC,Metal.silver,9). + pattern("X"). + input('X', ModBlocks.SILVER_BLOCK). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.silver)). + offerTo(exporter, Identifier.of("miteequilibrium","silver_from_block")); + + + + + + + //ingot->nugget + + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC,Metal.adamantium_nugget,9). + pattern("X"). + input('X', Metal.adamantium). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.adamantium)). + offerTo(exporter, Identifier.of("miteequilibrium","adamantium_nugget")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC,Metal.mithril_nugget,9). + pattern("X"). + input('X', Metal.mithril). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.mithril)). + offerTo(exporter, Identifier.of("miteequilibrium","mithril_nugget")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC,Metal.copper_nugget,9). + pattern("X"). + input('X', Metal.copper). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.copper)). + offerTo(exporter, Identifier.of("miteequilibrium","copper_nugget")); + + ShapedRecipeJsonBuilder.create(RecipeCategory.MISC,Metal.silver,9). + pattern("X"). + input('X', Metal.silver). + criterion("has_item", RecipeProvider.conditionsFromItem(Metal.silver)). + offerTo(exporter, Identifier.of("miteequilibrium","silver_nugget")); } + + + + + + } diff --git a/src/main/java/com/equilibrium/gen/TagsProvider.java b/src/main/java/com/equilibrium/gen/TagsProvider.java index 0a8986a..53d1c5f 100644 --- a/src/main/java/com/equilibrium/gen/TagsProvider.java +++ b/src/main/java/com/equilibrium/gen/TagsProvider.java @@ -1,10 +1,8 @@ package com.equilibrium.gen; -import com.equilibrium.register.tags.ModItemTags; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; import net.minecraft.item.Items; -import net.minecraft.registry.RegistryKey; import net.minecraft.registry.RegistryWrapper; import net.minecraft.registry.tag.ItemTags; import org.jetbrains.annotations.Nullable; diff --git a/src/main/java/com/equilibrium/item/Metal.java b/src/main/java/com/equilibrium/item/Metal.java index 9bb7bc0..f1b7eb3 100644 --- a/src/main/java/com/equilibrium/item/Metal.java +++ b/src/main/java/com/equilibrium/item/Metal.java @@ -18,13 +18,23 @@ public class Metal { public static final Item mithril = new Item(new Item.Settings()); public static final Item silver = new Item(new Item.Settings()); + //maxCount = 32 + public static final Item adamantium_nugget= new Item(new Item.Settings().maxCount(64)); + public static final Item ancient_metal_nugget= new Item(new Item.Settings().maxCount(64)); + public static final Item copper_nugget = new Item(new Item.Settings().maxCount(64)); + public static final Item gold_nugget = new Item(new Item.Settings().maxCount(64)); + public static final Item mithril_nugget = new Item(new Item.Settings().maxCount(64)); + public static final Item silver_nugget = new Item(new Item.Settings().maxCount(64)); + + + public static final Item FLINT = new Item(new Item.Settings().maxCount(64)); + + + + + + - public static final Item adamantium_nugget= new Item(new Item.Settings()); - public static final Item ancient_metal_nugget= new Item(new Item.Settings()); - public static final Item copper_nugget = new Item(new Item.Settings()); - public static final Item gold_nugget = new Item(new Item.Settings()); - public static final Item mithril_nugget = new Item(new Item.Settings()); - public static final Item silver_nugget = new Item(new Item.Settings()); public static void registerModItemIngots() { Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","adamantium"), adamantium); @@ -33,6 +43,8 @@ public static void registerModItemIngots() { Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","gold"), gold); Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","mithril"), mithril); Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","silver"), silver); + + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","flint"), FLINT); } public static void registerModItemNuggets(){ Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","adamantium_nugget"), adamantium_nugget); diff --git a/src/main/java/com/equilibrium/item/ModItemGroup.java b/src/main/java/com/equilibrium/item/ModItemGroup.java index 2a9bb81..3243b30 100644 --- a/src/main/java/com/equilibrium/item/ModItemGroup.java +++ b/src/main/java/com/equilibrium/item/ModItemGroup.java @@ -31,9 +31,8 @@ public class ModItemGroup { //工具栏 public static final ItemGroup modTools = Registry.register(Registries.ITEM_GROUP, Identifier.of(MITEequilibrium.MOD_ID,"toolsgroup"), FabricItemGroup.builder().displayName(Text.translatable("itemgroup.toolsgroup")) - .icon(()->new ItemStack(Tools.adamantium_axe)).entries((displayContext, entries) -> + .icon(()->new ItemStack(Tools.ADAMANTIUM_AXE)).entries((displayContext, entries) -> { - entries.add(Tools.adamantium_axe); } ).build()); @@ -48,6 +47,7 @@ public class ModItemGroup { entries.add(Metal.gold); entries.add(Metal.mithril); entries.add(Metal.silver); + entries.add(Metal.FLINT); entries.add(Metal.adamantium_nugget); entries.add(Metal.ancient_metal_nugget); @@ -70,6 +70,45 @@ public class ModItemGroup { entries.add(ModBlocks.SILVER_ORE); entries.add(Tools.FLINT_HATCHET); + entries.add(Tools.FLINT_AXE); + entries.add(Tools.FLINT_KNIFE); + entries.add(Tools.FLINT_SHOVEL); + + entries.add(Tools.ADAMANTIUM_AXE); + entries.add(Tools.COPPER_AXE); + entries.add(Tools.GOLD_AXE); + entries.add(Tools.MITHRIL_AXE); + entries.add(Tools.SILVER_AXE); + entries.add(Tools.IRON_AXE); + + entries.add(Tools.ADMANTIUM_HOE); + entries.add(Tools.COPPER_HOE); + entries.add(Tools.GOLD_HOE); + entries.add(Tools.MITHRIL_HOE); + entries.add(Tools.SILVER_HOE); + entries.add(Tools.IRON_HOE); + + entries.add(Tools.ADMANTIUM_SHOVEL); + entries.add(Tools.COPPER_SHOVEL); + entries.add(Tools.GOLD_SHOVEL); + entries.add(Tools.MITHRIL_SHOVEL); + entries.add(Tools.SILVER_SHOVEL); + entries.add(Tools.IRON_SHOVEL); + + entries.add(Tools.ADMANTIUM_SWORD); + entries.add(Tools.COPPER_SWORD); + entries.add(Tools.GOLD_SWORD); + entries.add(Tools.MITHRIL_SWORD); + entries.add(Tools.SILVER_SWORD); + entries.add(Tools.IRON_SWORD); + + entries.add(Tools.ADMANTIUM_PICKAXE); + entries.add(Tools.GOLD_PICKAXE); + entries.add(Tools.COPPER_PICKAXE); + entries.add(Tools.IRON_PICKAXE); + entries.add(Tools.MITHRIL_PICKAXE); + entries.add(Tools.SILVER_PICKAXE); + } ).build()); diff --git a/src/main/java/com/equilibrium/item/Tools.java b/src/main/java/com/equilibrium/item/Tools.java index 0fa5fe7..d9982f0 100644 --- a/src/main/java/com/equilibrium/item/Tools.java +++ b/src/main/java/com/equilibrium/item/Tools.java @@ -1,39 +1,196 @@ package com.equilibrium.item; -import com.equilibrium.item.tools.FlintHatchet; -import com.equilibrium.item.tools.ModToolMaterials; -import net.minecraft.item.Item; -import net.minecraft.item.PickaxeItem; -import net.minecraft.item.ShovelItem; -import net.minecraft.item.ToolMaterials; +import com.equilibrium.item.tools_attribute.flint.FlintAxeOrHatchet; +import com.equilibrium.item.tools_attribute.flint.FlintKnife; +import com.equilibrium.item.tools_attribute.ModToolMaterials; +import com.equilibrium.item.tools_attribute.flint.FlintShovel; +import com.equilibrium.item.tools_attribute.metal.*; +import net.minecraft.item.*; +import net.minecraft.network.packet.c2s.play.UpdateSignC2SPacket; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; +import net.minecraft.registry.tag.BlockTags; import net.minecraft.util.Identifier; public class Tools { + //一个完整的工具注册流程 + + //1、把它放进标签里,用于实体交互距离增益上以及附魔选取上 + //2、为它注册枚举类中的基础伤害和耐久 + //3、继承工具类,确定伤害实体和方块所消耗的耐久值如何 + //4、物品注册,模型注册,放置贴图 + + + + + + //以下开始添加物品: - public static final Item adamantium_axe= new Item(new Item.Settings()); - public static final Item adamantium_battle_axe = new Item(new Item.Settings()); - public static final Item adamantium_dagger = new Item(new Item.Settings()); - public static final Item adamantium_hatchet = new Item(new Item.Settings()); - public static final Item FLINT_HATCHET = new FlintHatchet(ModToolMaterials.FLINT_HATCHET,new Item.Settings().attributeModifiers(FlintHatchet.createAttributeModifiers(ModToolMaterials.FLINT_HATCHET,3,1.0f))); + public static final Item FLINT_HATCHET =createFlintAxeOrHatchetItem(ModToolMaterials.FLINT_HATCHET,4,1f); + public static final Item FLINT_AXE =createFlintAxeOrHatchetItem(ModToolMaterials.FLINT_HATCHET,5,1f); + public static final Item FLINT_KNIFE =createFlintKnifeItem(ModToolMaterials.FLINT_KNIFE,3,2f); + public static final Item FLINT_SHOVEL =createFlintShovelItem(ModToolMaterials.FLINT_SHOVEL,2,2f); + + + + + public static final Item COPPER_AXE =createMetalAxeItem(ModToolMaterials.COPPER_AXE,8,0.7f); + public static final Item GOLD_AXE = createMetalAxeItem(ModToolMaterials.GOLD_AXE,5,0.5f); + public static final Item SILVER_AXE = createMetalAxeItem(ModToolMaterials.SILVER_AXE,8,0.7f); + public static final Item IRON_AXE = createMetalAxeItem(ModToolMaterials.IRON_AXE,9,0.7f); + public static final Item MITHRIL_AXE = createMetalAxeItem(ModToolMaterials.ADAMANTIUM_AXE,10,0.8f); + public static final Item ADAMANTIUM_AXE = createMetalAxeItem(ModToolMaterials.ADAMANTIUM_AXE,10,1f); + + + public static final Item COPPER_PICKAXE = createMetalPickAxeItem(ModToolMaterials.COOPER_PICKAXE,5,2f); + public static final Item GOLD_PICKAXE = createMetalPickAxeItem(ModToolMaterials.GOLD_PICKAXE,5,2f); + public static final Item SILVER_PICKAXE = createMetalPickAxeItem(ModToolMaterials.SILVER_PICKAXE,5,2f); + public static final Item IRON_PICKAXE = createMetalPickAxeItem(ModToolMaterials.IRON_PICKAXE,6,2f); + public static final Item MITHRIL_PICKAXE = createMetalPickAxeItem(ModToolMaterials.MITHRIL_PICKAXE,7,2f); + public static final Item ADMANTIUM_PICKAXE = createMetalPickAxeItem(ModToolMaterials.ADAMANTIUM_PICKAXE,8,2f); + + public static final Item COPPER_HOE = createMetalHoeItem(ModToolMaterials.COOPER_HOE,4,3f); + public static final Item GOLD_HOE = createMetalHoeItem(ModToolMaterials.GOLD_HOE,4,3f); + public static final Item SILVER_HOE = createMetalHoeItem(ModToolMaterials.SILVER_HOE,4,3f); + public static final Item IRON_HOE = createMetalHoeItem(ModToolMaterials.IRON_HOE,5,3f); + public static final Item MITHRIL_HOE = createMetalHoeItem(ModToolMaterials.MITHRIL_HOE,6,3f); + public static final Item ADMANTIUM_HOE =createMetalHoeItem(ModToolMaterials.ADAMANTIUM_HOE,7,3f); + + + public static final Item COPPER_SHOVEL = createMetalShovelItem(ModToolMaterials.COOPER_SHOVEL,3,4f); + public static final Item GOLD_SHOVEL = createMetalShovelItem(ModToolMaterials.GOLD_SHOVEL,3,4f); + public static final Item SILVER_SHOVEL = createMetalShovelItem(ModToolMaterials.SILVER_SHOVEL,3,4f); + public static final Item IRON_SHOVEL = createMetalShovelItem(ModToolMaterials.IRON_SHOVEL,4,4f); + public static final Item MITHRIL_SHOVEL = createMetalShovelItem(ModToolMaterials.MITHRIL_SHOVEL,5,4f); + public static final Item ADMANTIUM_SHOVEL =createMetalShovelItem(ModToolMaterials.ADAMANTIUM_SHOVEL,6,4f); + + public static final Item COPPER_SWORD = createMetalSwordItem(ModToolMaterials.COOPER_SWORD,7,3f); + public static final Item GOLD_SWORD = createMetalSwordItem(ModToolMaterials.GOLD_SWORD,7,3f); + public static final Item SILVER_SWORD = createMetalSwordItem(ModToolMaterials.SILVER_SWORD,7,3f); + public static final Item IRON_SWORD = createMetalSwordItem(ModToolMaterials.IRON_SWORD,8,3f); + public static final Item MITHRIL_SWORD = createMetalSwordItem(ModToolMaterials.MITHRIL_SWORD,9,3f); + public static final Item ADMANTIUM_SWORD =createMetalSwordItem(ModToolMaterials.ADAMANTIUM_SHOVEL,10,3f); + + public static final Item COPPER_DAGGER = createMetalSwordItem(ModToolMaterials.COOPER_DAGGER,6,4f); + public static final Item GOLD_DAGGER = createMetalSwordItem(ModToolMaterials.GOLD_DAGGER,6,4f); + public static final Item SILVER_DAGGER = createMetalSwordItem(ModToolMaterials.SILVER_DAGGER,6,4f); + public static final Item IRON_DAGGER = createMetalSwordItem(ModToolMaterials.IRON_DAGGER,7,4f); + public static final Item MITHRIL_DAGGER = createMetalSwordItem(ModToolMaterials.MITHRIL_DAGGER,8,4f); + public static final Item ADMANTIUM_DAGGER =createMetalSwordItem(ModToolMaterials.ADAMANTIUM_DAGGER,9,4f); + + + + + + + public static Item createFlintShovelItem(ToolMaterial material, int finalDamage,float finalDamageSpeed){ + return new FlintShovel(material,new Item.Settings(). + attributeModifiers(MiningToolItem.createAttributeModifiers(material,-1+finalDamage,-4+finalDamageSpeed)) + ); + } + + public static Item createFlintKnifeItem(ToolMaterial material, int finalDamage,float finalDamageSpeed){ + return new FlintKnife(material,new Item.Settings(). + attributeModifiers(MiningToolItem.createAttributeModifiers(material,-1+finalDamage,-4+finalDamageSpeed)) + ); + } + + + + + public static Item createFlintAxeOrHatchetItem(ToolMaterial material, int finalDamage,float finalDamageSpeed){ + return new FlintAxeOrHatchet(material,new Item.Settings(). + attributeModifiers(MiningToolItem.createAttributeModifiers(material,-1+finalDamage,-4+finalDamageSpeed)) + ); + } + public static Item createMetalAxeItem(ToolMaterial material, int finalDamage,float finalDamageSpeed){ + return new MetalAxe(material,new Item.Settings(). + attributeModifiers(MiningToolItem.createAttributeModifiers(material,-1+finalDamage,-4+finalDamageSpeed)) + ); + } + public static Item createMetalHoeItem(ToolMaterial material, int finalDamage,float finalDamageSpeed){ + return new MetalHoe(material,new Item.Settings(). + attributeModifiers(MiningToolItem.createAttributeModifiers(material,-1+finalDamage,-4+finalDamageSpeed)) + ); + } + public static Item createMetalShovelItem(ToolMaterial material, int finalDamage,float finalDamageSpeed){ + return new MetalShovel(material,new Item.Settings(). + attributeModifiers(MiningToolItem.createAttributeModifiers(material,-1+finalDamage,-4+finalDamageSpeed)) + ); + } + + + public static Item createMetalPickAxeItem(ToolMaterial material, int finalDamage,float finalDamageSpeed){ + return new MetalPickAxe(material,BlockTags.PICKAXE_MINEABLE,new Item.Settings(). + attributeModifiers(MiningToolItem.createAttributeModifiers(material,-1+finalDamage,-4+finalDamageSpeed)) + ); + } + public static Item createMetalSwordItem(ToolMaterial material, int finalDamage,float finalDamageSpeed){ + + return new MetalSword(material,new Item.Settings(). + attributeModifiers(MiningToolItem.createAttributeModifiers(material,-1+finalDamage,-4+finalDamageSpeed)) + ); + } + + public static void registerModItemTools() { - Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","adamantium_axe"), adamantium_axe); - Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","adamantium_battle_axe"), adamantium_battle_axe); - Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","adamantium_dagger"), adamantium_dagger); - Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","adamantium_hatchet"), adamantium_hatchet); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","adamantium_axe"), ADAMANTIUM_AXE); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","mithril_axe"), MITHRIL_AXE); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","iron_axe"),IRON_AXE); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","copper_axe"),COPPER_AXE); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","silver_axe"),SILVER_AXE); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","gold_axe"),GOLD_AXE); - Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","flint_hatchet"),FLINT_HATCHET); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","adamantium_hoe"),ADMANTIUM_HOE); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","mithril_hoe"), MITHRIL_HOE); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","iron_hoe"),IRON_HOE); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","copper_hoe"),COPPER_HOE); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","silver_hoe"),SILVER_HOE); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","gold_hoe"),GOLD_HOE); + + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","adamantium_pickaxe"), ADMANTIUM_PICKAXE); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","mithril_pickaxe"), MITHRIL_PICKAXE); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","iron_pickaxe"),IRON_PICKAXE); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","copper_pickaxe"),COPPER_PICKAXE); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","silver_pickaxe"),SILVER_PICKAXE); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","gold_pickaxe"),GOLD_PICKAXE); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","adamantium_sword"), ADMANTIUM_SWORD); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","mithril_sword"), MITHRIL_SWORD); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","iron_sword"),IRON_SWORD); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","copper_sword"),COPPER_SWORD); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","silver_sword"),SILVER_SWORD); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","gold_sword"),GOLD_SWORD); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","adamantium_shovel"), ADMANTIUM_SHOVEL); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","mithril_shovel"), MITHRIL_SHOVEL); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","iron_shovel"),IRON_SHOVEL); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","copper_shovel"),COPPER_SHOVEL); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","silver_shovel"),SILVER_SHOVEL); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","gold_shovel"),GOLD_SHOVEL); + + + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","adamantium_dagger"), ADMANTIUM_DAGGER); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","mithril_dagger"), MITHRIL_DAGGER); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","iron_dagger"),IRON_DAGGER); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","copper_dagger"),COPPER_DAGGER); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","silver_dagger"),SILVER_DAGGER); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","gold_dagger"),GOLD_DAGGER); + + + + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","flint_hatchet"),FLINT_HATCHET); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","flint_axe"),FLINT_AXE); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","flint_knife"), FLINT_KNIFE); + Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","flint_shovel"),FLINT_SHOVEL); } } diff --git a/src/main/java/com/equilibrium/item/tools/FlintHatchet.java b/src/main/java/com/equilibrium/item/tools/FlintHatchet.java deleted file mode 100644 index b51279a..0000000 --- a/src/main/java/com/equilibrium/item/tools/FlintHatchet.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.equilibrium.item.tools; - -import com.equilibrium.MITEequilibrium; -import com.equilibrium.mixin.MITEequilibriumMixin; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.item.MiningToolItem; -import net.minecraft.item.ToolMaterial; -import net.minecraft.registry.tag.BlockTags; -import net.minecraft.registry.tag.TagKey; - -public class FlintHatchet extends MiningToolItem { - public FlintHatchet(ToolMaterial material,Settings settings) { - super(material, BlockTags.AXE_MINEABLE, settings); - } - -} diff --git a/src/main/java/com/equilibrium/item/tools/ModToolMaterials.java b/src/main/java/com/equilibrium/item/tools/ModToolMaterials.java deleted file mode 100644 index b700f5a..0000000 --- a/src/main/java/com/equilibrium/item/tools/ModToolMaterials.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.equilibrium.item.tools; - -import com.equilibrium.register.tags.ModBlockTags; -import com.google.common.base.Suppliers; -import net.minecraft.block.Block; -import net.minecraft.item.*; -import net.minecraft.recipe.Ingredient; -import net.minecraft.registry.tag.BlockTags; -import net.minecraft.registry.tag.ItemTags; -import net.minecraft.registry.tag.TagKey; - -import java.util.function.Supplier; - -public enum ModToolMaterials implements ToolMaterial { - - - FLINT_HATCHET(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 320, 2.0F, 0.0F, 15, () -> Ingredient.ofItems(Items.FLINT)); - - - private final TagKey inverseTag; - private final int itemDurability; - private final float miningSpeed; - private final float attackDamage; - private final int enchantability; - private final Supplier repairIngredient; - - private ModToolMaterials( - final TagKey inverseTag, - final int itemDurability, - final float miningSpeed, - final float attackDamage, - final int enchantability, - final Supplier repairIngredient - ) { - this.inverseTag = inverseTag; - this.itemDurability = itemDurability; - this.miningSpeed = miningSpeed; - this.attackDamage = attackDamage; - this.enchantability = enchantability; - this.repairIngredient = Suppliers.memoize(repairIngredient::get); - } - - @Override - public int getDurability() { - return this.itemDurability; - } - - @Override - public float getMiningSpeedMultiplier() { - return this.miningSpeed; - } - - @Override - public float getAttackDamage() { - return this.attackDamage; - } - - @Override - public TagKey getInverseTag() { - return this.inverseTag; - } - - @Override - public int getEnchantability() { - return this.enchantability; - } - - @Override - public Ingredient getRepairIngredient() { - return (Ingredient)this.repairIngredient.get(); - } -} diff --git a/src/main/java/com/equilibrium/item/tools_attribute/ModToolMaterials.java b/src/main/java/com/equilibrium/item/tools_attribute/ModToolMaterials.java new file mode 100644 index 0000000..7b16cb5 --- /dev/null +++ b/src/main/java/com/equilibrium/item/tools_attribute/ModToolMaterials.java @@ -0,0 +1,121 @@ +package com.equilibrium.item.tools_attribute; + +import com.equilibrium.item.Metal; +import com.google.common.base.Suppliers; +import net.minecraft.block.Block; +import net.minecraft.item.*; +import net.minecraft.recipe.Ingredient; +import net.minecraft.registry.tag.BlockTags; +import net.minecraft.registry.tag.TagKey; + +import java.util.function.Supplier; + +public enum ModToolMaterials implements ToolMaterial { + + //燧石武器无法附魔 + FLINT_HATCHET(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 360, 2.0F, 0.0F, 0, () -> Ingredient.ofItems(Items.FLINT)), + FLINT_AXE(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 1200, 8.0F, 0.0F, 0, () -> Ingredient.ofItems(Items.FLINT)), + FLINT_SHOVEL(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 360, 2F, 0.0F, 0, () -> Ingredient.ofItems(Items.FLINT)), + FLINT_KNIFE(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 360, 4.0F, 0.0F, 0, () -> Ingredient.ofItems(Items.FLINT)), + + COPPER_AXE(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 4800, 12.0F, 0.0F, 15, () -> Ingredient.ofItems(Metal.copper)), + COOPER_SHOVEL(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 1600, 4.0F, 0.0F, 15, () -> Ingredient.ofItems(Metal.copper)), + COOPER_DAGGER(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 1600, 12.0F, 0.0F, 15, () -> Ingredient.ofItems(Metal.copper)), + COOPER_PICKAXE(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 4800, 12.0F, 0.0F, 15, () -> Ingredient.ofItems(Metal.copper)), + COOPER_SWORD(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 3200, 12.0F, 0.0F, 15, () -> Ingredient.ofItems(Metal.copper)), + COOPER_HOE(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 3200, 12.0F, 0.0F, 15, () -> Ingredient.ofItems(Metal.copper)), + + SILVER_AXE(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 4800, 12.0F, 0.0F, 15, () -> Ingredient.ofItems(Metal.silver)), + SILVER_SHOVEL(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 1600, 4.0F, 0.0F, 15, () -> Ingredient.ofItems(Metal.silver)), + SILVER_DAGGER(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 1600, 12.0F, 0.0F, 15, () -> Ingredient.ofItems(Metal.silver)), + SILVER_PICKAXE(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 4800, 12.0F, 0.0F, 15, () -> Ingredient.ofItems(Metal.silver)), + SILVER_SWORD(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 3200, 12.0F, 0.0F, 15, () -> Ingredient.ofItems(Metal.silver)), + SILVER_HOE(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 3200, 12.0F, 0.0F, 15, () -> Ingredient.ofItems(Metal.silver)), + + + + + //金武器更容易获得高级附魔,采集速度也更快 + GOLD_AXE(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 4800, 18.0F, 0.0F, 25, () -> Ingredient.ofItems(Metal.gold)), + GOLD_SHOVEL(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 1600, 6.0F, 0.0F, 25, () -> Ingredient.ofItems(Metal.gold)), + GOLD_DAGGER(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 1600, 18.0F, 0.0F, 25, () -> Ingredient.ofItems(Metal.gold)), + GOLD_PICKAXE(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 4800, 18.0F, 0.0F, 25, () -> Ingredient.ofItems(Metal.gold)), + GOLD_SWORD(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 3200, 18.0F, 0.0F, 25, () -> Ingredient.ofItems(Metal.gold)), + GOLD_HOE(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 3200, 18.0F, 0.0F, 25, () -> Ingredient.ofItems(Metal.gold)), + + + IRON_AXE(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 9600, 16.0F, 0.0F, 15, () -> Ingredient.ofItems(Items.IRON_INGOT)), + IRON_SHOVEL(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 3200, 8.0F, 0.0F, 15, () -> Ingredient.ofItems(Items.IRON_INGOT)), + IRON_DAGGER(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 3200, 16.0F, 0.0F, 15, () -> Ingredient.ofItems(Items.IRON_INGOT)), + IRON_PICKAXE(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 9600, 16.0F, 0.0F, 15, () -> Ingredient.ofItems(Items.IRON_INGOT)), + IRON_SWORD(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 6400, 16.0F, 0.0F, 15, () -> Ingredient.ofItems(Items.IRON_INGOT)), + IRON_HOE(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 6400, 16.0F, 0.0F, 15, () -> Ingredient.ofItems(Items.IRON_INGOT)), + + MITHRIL_AXE(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 76800, 32.0F, 0.0F, 25, () -> Ingredient.ofItems(Metal.mithril)), + MITHRIL_SHOVEL(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 25600, 12.0F, 0.0F, 25, () -> Ingredient.ofItems(Metal.mithril)), + MITHRIL_DAGGER(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 25600, 32.0F, 0.0F, 25, () -> Ingredient.ofItems(Metal.mithril)), + MITHRIL_PICKAXE(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 76800, 32.0F, 0.0F, 25, () -> Ingredient.ofItems(Metal.mithril)), + MITHRIL_SWORD(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 51200, 32.0F, 0.0F, 25, () -> Ingredient.ofItems(Metal.mithril)), + MITHRIL_HOE(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 51200, 32.0F, 0.0F, 25, () -> Ingredient.ofItems(Metal.mithril)), + + + ADAMANTIUM_AXE(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 309600, 32.0F, 0.0F, 25, () -> Ingredient.ofItems(Metal.adamantium)), + ADAMANTIUM_SHOVEL(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 102400, 16.0F, 0.0F, 25, () -> Ingredient.ofItems(Metal.adamantium)), + ADAMANTIUM_DAGGER(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 102400, 32.0F, 0.0F, 25, () -> Ingredient.ofItems(Metal.adamantium)), + ADAMANTIUM_PICKAXE(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 309600, 32.0F, 0.0F, 25, () -> Ingredient.ofItems(Metal.adamantium)), + ADAMANTIUM_SWORD(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 204800, 32.0F, 0.0F, 25, () -> Ingredient.ofItems(Metal.adamantium)), + ADAMANTIUM_HOE(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 204800, 32.0F, 0.0F, 25, () -> Ingredient.ofItems(Metal.adamantium)); + + private final TagKey inverseTag; + private final int itemDurability; + private final float miningSpeed; + private final float attackDamage; + private final int enchantability; + private final Supplier repairIngredient; + + private ModToolMaterials( + final TagKey inverseTag, + final int itemDurability, + final float miningSpeed, + final float attackDamage, + final int enchantability, + final Supplier repairIngredient + ) { + this.inverseTag = inverseTag; + this.itemDurability = itemDurability; + this.miningSpeed = miningSpeed; + this.attackDamage = attackDamage; + this.enchantability = enchantability; + this.repairIngredient = Suppliers.memoize(repairIngredient::get); + } + + @Override + public int getDurability() { + return this.itemDurability; + } + + @Override + public float getMiningSpeedMultiplier() { + return this.miningSpeed; + } + + @Override + public float getAttackDamage() { + return this.attackDamage; + } + + @Override + public TagKey getInverseTag() { + return this.inverseTag; + } + + @Override + public int getEnchantability() { + return this.enchantability; + } + + @Override + public Ingredient getRepairIngredient() { + return (Ingredient)this.repairIngredient.get(); + } +} diff --git a/src/main/java/com/equilibrium/item/tools_attribute/flint/FlintAxeOrHatchet.java b/src/main/java/com/equilibrium/item/tools_attribute/flint/FlintAxeOrHatchet.java new file mode 100644 index 0000000..4e16454 --- /dev/null +++ b/src/main/java/com/equilibrium/item/tools_attribute/flint/FlintAxeOrHatchet.java @@ -0,0 +1,124 @@ +package com.equilibrium.item.tools_attribute.flint; + +import com.google.common.collect.BiMap; +import com.google.common.collect.ImmutableMap; +import net.minecraft.advancement.criterion.Criteria; +import net.minecraft.block.*; +import net.minecraft.entity.EquipmentSlot; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.*; +import net.minecraft.registry.tag.BlockTags; +import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.sound.SoundCategory; +import net.minecraft.sound.SoundEvents; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Hand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.World; +import net.minecraft.world.WorldEvents; +import net.minecraft.world.event.GameEvent; +import org.jetbrains.annotations.Nullable; + +import java.util.Map; +import java.util.Optional; + +public class FlintAxeOrHatchet extends MiningToolItem { + protected static final Map STRIPPED_BLOCKS = new ImmutableMap.Builder() + .put(Blocks.OAK_WOOD, Blocks.STRIPPED_OAK_WOOD) + .put(Blocks.OAK_LOG, Blocks.STRIPPED_OAK_LOG) + .put(Blocks.DARK_OAK_WOOD, Blocks.STRIPPED_DARK_OAK_WOOD) + .put(Blocks.DARK_OAK_LOG, Blocks.STRIPPED_DARK_OAK_LOG) + .put(Blocks.ACACIA_WOOD, Blocks.STRIPPED_ACACIA_WOOD) + .put(Blocks.ACACIA_LOG, Blocks.STRIPPED_ACACIA_LOG) + .put(Blocks.CHERRY_WOOD, Blocks.STRIPPED_CHERRY_WOOD) + .put(Blocks.CHERRY_LOG, Blocks.STRIPPED_CHERRY_LOG) + .put(Blocks.BIRCH_WOOD, Blocks.STRIPPED_BIRCH_WOOD) + .put(Blocks.BIRCH_LOG, Blocks.STRIPPED_BIRCH_LOG) + .put(Blocks.JUNGLE_WOOD, Blocks.STRIPPED_JUNGLE_WOOD) + .put(Blocks.JUNGLE_LOG, Blocks.STRIPPED_JUNGLE_LOG) + .put(Blocks.SPRUCE_WOOD, Blocks.STRIPPED_SPRUCE_WOOD) + .put(Blocks.SPRUCE_LOG, Blocks.STRIPPED_SPRUCE_LOG) + .put(Blocks.WARPED_STEM, Blocks.STRIPPED_WARPED_STEM) + .put(Blocks.WARPED_HYPHAE, Blocks.STRIPPED_WARPED_HYPHAE) + .put(Blocks.CRIMSON_STEM, Blocks.STRIPPED_CRIMSON_STEM) + .put(Blocks.CRIMSON_HYPHAE, Blocks.STRIPPED_CRIMSON_HYPHAE) + .put(Blocks.MANGROVE_WOOD, Blocks.STRIPPED_MANGROVE_WOOD) + .put(Blocks.MANGROVE_LOG, Blocks.STRIPPED_MANGROVE_LOG) + .put(Blocks.BAMBOO_BLOCK, Blocks.STRIPPED_BAMBOO_BLOCK) + .build(); + + public FlintAxeOrHatchet(ToolMaterial material, Settings settings) { + super(material, BlockTags.AXE_MINEABLE, settings); + } + @Override + public ActionResult useOnBlock(ItemUsageContext context) { + World world = context.getWorld(); + BlockPos blockPos = context.getBlockPos(); + PlayerEntity playerEntity = context.getPlayer(); + if (shouldCancelStripAttempt(context)) { + return ActionResult.PASS; + } else { + Optional optional = this.tryStrip(world, blockPos, playerEntity, world.getBlockState(blockPos)); + if (optional.isEmpty()) { + return ActionResult.PASS; + } else { + ItemStack itemStack = context.getStack(); + if (playerEntity instanceof ServerPlayerEntity) { + Criteria.ITEM_USED_ON_BLOCK.trigger((ServerPlayerEntity)playerEntity, blockPos, itemStack); + } + + world.setBlockState(blockPos, (BlockState)optional.get(), Block.NOTIFY_ALL_AND_REDRAW); + world.emitGameEvent(GameEvent.BLOCK_CHANGE, blockPos, GameEvent.Emitter.of(playerEntity, (BlockState)optional.get())); + if (playerEntity != null) { + itemStack.damage(1, playerEntity, LivingEntity.getSlotForHand(context.getHand())); + } + + return ActionResult.success(world.isClient); + } + } + } + + private static boolean shouldCancelStripAttempt(ItemUsageContext context) { + PlayerEntity playerEntity = context.getPlayer(); + return context.getHand().equals(Hand.MAIN_HAND) && playerEntity.getOffHandStack().isOf(Items.SHIELD) && !playerEntity.shouldCancelInteraction(); + } + + private Optional tryStrip(World world, BlockPos pos, @Nullable PlayerEntity player, BlockState state) { + Optional optional = this.getStrippedState(state); + if (optional.isPresent()) { + world.playSound(player, pos, SoundEvents.ITEM_AXE_STRIP, SoundCategory.BLOCKS, 1.0F, 1.0F); + return optional; + } else { + Optional optional2 = Oxidizable.getDecreasedOxidationState(state); + if (optional2.isPresent()) { + world.playSound(player, pos, SoundEvents.ITEM_AXE_SCRAPE, SoundCategory.BLOCKS, 1.0F, 1.0F); + world.syncWorldEvent(player, WorldEvents.BLOCK_SCRAPED, pos, 0); + return optional2; + } else { + Optional optional3 = Optional.ofNullable((Block)((BiMap)HoneycombItem.WAXED_TO_UNWAXED_BLOCKS.get()).get(state.getBlock())) + .map(block -> block.getStateWithProperties(state)); + if (optional3.isPresent()) { + world.playSound(player, pos, SoundEvents.ITEM_AXE_WAX_OFF, SoundCategory.BLOCKS, 1.0F, 1.0F); + world.syncWorldEvent(player, WorldEvents.WAX_REMOVED, pos, 0); + return optional3; + } else { + return Optional.empty(); + } + } + } + } + + private Optional getStrippedState(BlockState state) { + return Optional.ofNullable((Block)STRIPPED_BLOCKS.get(state.getBlock())) + .map(block -> block.getDefaultState().with(PillarBlock.AXIS, (Direction.Axis)state.get(PillarBlock.AXIS))); + } + + + + @Override + public void postDamageEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) { + stack.damage(150, attacker, EquipmentSlot.MAINHAND); + } +} diff --git a/src/main/java/com/equilibrium/item/tools_attribute/flint/FlintKnife.java b/src/main/java/com/equilibrium/item/tools_attribute/flint/FlintKnife.java new file mode 100644 index 0000000..37bb2cd --- /dev/null +++ b/src/main/java/com/equilibrium/item/tools_attribute/flint/FlintKnife.java @@ -0,0 +1,71 @@ +package com.equilibrium.item.tools_attribute.flint; + +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.component.DataComponentTypes; +import net.minecraft.component.type.AttributeModifierSlot; +import net.minecraft.component.type.AttributeModifiersComponent; +import net.minecraft.component.type.ToolComponent; +import net.minecraft.entity.EquipmentSlot; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.attribute.EntityAttributeModifier; +import net.minecraft.entity.attribute.EntityAttributes; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ToolItem; +import net.minecraft.item.ToolMaterial; +import net.minecraft.registry.tag.BlockTags; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import java.util.List; + +public class FlintKnife extends ToolItem { + public FlintKnife(ToolMaterial toolMaterial, Item.Settings settings) { + super(toolMaterial, settings.component(DataComponentTypes.TOOL, createToolComponent())); + } + + private static ToolComponent createToolComponent() { + return new ToolComponent( + List.of(ToolComponent.Rule.ofAlwaysDropping(List.of(Blocks.COBWEB), 15.0F), ToolComponent.Rule.of(BlockTags.SWORD_EFFICIENT, 1.5F)), 1.0F, 2 + ); + } + + public static AttributeModifiersComponent createAttributeModifiers(ToolMaterial material, int baseAttackDamage, float attackSpeed) { + return AttributeModifiersComponent.builder() + .add( + EntityAttributes.GENERIC_ATTACK_DAMAGE, + new EntityAttributeModifier( + BASE_ATTACK_DAMAGE_MODIFIER_ID, (double)((float)baseAttackDamage + material.getAttackDamage()), EntityAttributeModifier.Operation.ADD_VALUE + ), + AttributeModifierSlot.MAINHAND + ) + .add( + EntityAttributes.GENERIC_ATTACK_SPEED, + new EntityAttributeModifier(BASE_ATTACK_SPEED_MODIFIER_ID, (double)attackSpeed, EntityAttributeModifier.Operation.ADD_VALUE), + AttributeModifierSlot.MAINHAND + ) + .build(); + } + + @Override + public boolean canMine(BlockState state, World world, BlockPos pos, PlayerEntity miner) { + return !miner.isCreative(); + } + + @Override + public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker) { + return true; + } + + @Override + public void postDamageEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) { + stack.damage(50, attacker, EquipmentSlot.MAINHAND); + } + + @Override + public ItemStack finishUsing(ItemStack stack, World world, LivingEntity user) { + return super.finishUsing(stack, world, user); + } +} \ No newline at end of file diff --git a/src/main/java/com/equilibrium/item/tools_attribute/flint/FlintShovel.java b/src/main/java/com/equilibrium/item/tools_attribute/flint/FlintShovel.java new file mode 100644 index 0000000..73eb34a --- /dev/null +++ b/src/main/java/com/equilibrium/item/tools_attribute/flint/FlintShovel.java @@ -0,0 +1,83 @@ +package com.equilibrium.item.tools_attribute.flint; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Maps; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.block.CampfireBlock; +import net.minecraft.entity.EquipmentSlot; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.*; +import net.minecraft.registry.tag.BlockTags; +import net.minecraft.sound.SoundCategory; +import net.minecraft.sound.SoundEvents; +import net.minecraft.util.ActionResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.World; +import net.minecraft.world.WorldEvents; +import net.minecraft.world.event.GameEvent; + +import java.util.Map; + +public class FlintShovel extends MiningToolItem { + protected static final Map PATH_STATES = Maps.newHashMap( + new ImmutableMap.Builder() + .put(Blocks.GRASS_BLOCK, Blocks.DIRT_PATH.getDefaultState()) + .put(Blocks.DIRT, Blocks.DIRT_PATH.getDefaultState()) + .put(Blocks.PODZOL, Blocks.DIRT_PATH.getDefaultState()) + .put(Blocks.COARSE_DIRT, Blocks.DIRT_PATH.getDefaultState()) + .put(Blocks.MYCELIUM, Blocks.DIRT_PATH.getDefaultState()) + .put(Blocks.ROOTED_DIRT, Blocks.DIRT_PATH.getDefaultState()) + .build() + ); + + public FlintShovel(ToolMaterial toolMaterial, Item.Settings settings) { + super(toolMaterial, BlockTags.SHOVEL_MINEABLE, settings); + } + + @Override + public ActionResult useOnBlock(ItemUsageContext context) { + World world = context.getWorld(); + BlockPos blockPos = context.getBlockPos(); + BlockState blockState = world.getBlockState(blockPos); + if (context.getSide() == Direction.DOWN) { + return ActionResult.PASS; + } else { + PlayerEntity playerEntity = context.getPlayer(); + BlockState blockState2 = (BlockState)PATH_STATES.get(blockState.getBlock()); + BlockState blockState3 = null; + if (blockState2 != null && world.getBlockState(blockPos.up()).isAir()) { + world.playSound(playerEntity, blockPos, SoundEvents.ITEM_SHOVEL_FLATTEN, SoundCategory.BLOCKS, 1.0F, 1.0F); + blockState3 = blockState2; + } else if (blockState.getBlock() instanceof CampfireBlock && (Boolean)blockState.get(CampfireBlock.LIT)) { + if (!world.isClient()) { + world.syncWorldEvent(null, WorldEvents.FIRE_EXTINGUISHED, blockPos, 0); + } + + CampfireBlock.extinguish(context.getPlayer(), world, blockPos, blockState); + blockState3 = blockState.with(CampfireBlock.LIT, Boolean.valueOf(false)); + } + + if (blockState3 != null) { + if (!world.isClient) { + world.setBlockState(blockPos, blockState3, Block.NOTIFY_ALL_AND_REDRAW); + world.emitGameEvent(GameEvent.BLOCK_CHANGE, blockPos, GameEvent.Emitter.of(playerEntity, blockState3)); + if (playerEntity != null) { + context.getStack().damage(1, playerEntity, LivingEntity.getSlotForHand(context.getHand())); + } + } + + return ActionResult.success(world.isClient); + } else { + return ActionResult.PASS; + } + } + } + @Override + public void postDamageEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) { + stack.damage(150, attacker, EquipmentSlot.MAINHAND); + } +} diff --git a/src/main/java/com/equilibrium/item/tools_attribute/metal/MetalAxe.java b/src/main/java/com/equilibrium/item/tools_attribute/metal/MetalAxe.java new file mode 100644 index 0000000..3bdb89f --- /dev/null +++ b/src/main/java/com/equilibrium/item/tools_attribute/metal/MetalAxe.java @@ -0,0 +1,124 @@ +package com.equilibrium.item.tools_attribute.metal; + +import com.google.common.collect.BiMap; +import com.google.common.collect.ImmutableMap; +import net.minecraft.advancement.criterion.Criteria; +import net.minecraft.block.*; +import net.minecraft.entity.EquipmentSlot; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.*; +import net.minecraft.registry.tag.BlockTags; +import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.sound.SoundCategory; +import net.minecraft.sound.SoundEvents; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Hand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.World; +import net.minecraft.world.WorldEvents; +import net.minecraft.world.event.GameEvent; +import org.jetbrains.annotations.Nullable; + +import java.util.Map; +import java.util.Optional; + +public class MetalAxe extends MiningToolItem { + protected static final Map STRIPPED_BLOCKS = new ImmutableMap.Builder() + .put(Blocks.OAK_WOOD, Blocks.STRIPPED_OAK_WOOD) + .put(Blocks.OAK_LOG, Blocks.STRIPPED_OAK_LOG) + .put(Blocks.DARK_OAK_WOOD, Blocks.STRIPPED_DARK_OAK_WOOD) + .put(Blocks.DARK_OAK_LOG, Blocks.STRIPPED_DARK_OAK_LOG) + .put(Blocks.ACACIA_WOOD, Blocks.STRIPPED_ACACIA_WOOD) + .put(Blocks.ACACIA_LOG, Blocks.STRIPPED_ACACIA_LOG) + .put(Blocks.CHERRY_WOOD, Blocks.STRIPPED_CHERRY_WOOD) + .put(Blocks.CHERRY_LOG, Blocks.STRIPPED_CHERRY_LOG) + .put(Blocks.BIRCH_WOOD, Blocks.STRIPPED_BIRCH_WOOD) + .put(Blocks.BIRCH_LOG, Blocks.STRIPPED_BIRCH_LOG) + .put(Blocks.JUNGLE_WOOD, Blocks.STRIPPED_JUNGLE_WOOD) + .put(Blocks.JUNGLE_LOG, Blocks.STRIPPED_JUNGLE_LOG) + .put(Blocks.SPRUCE_WOOD, Blocks.STRIPPED_SPRUCE_WOOD) + .put(Blocks.SPRUCE_LOG, Blocks.STRIPPED_SPRUCE_LOG) + .put(Blocks.WARPED_STEM, Blocks.STRIPPED_WARPED_STEM) + .put(Blocks.WARPED_HYPHAE, Blocks.STRIPPED_WARPED_HYPHAE) + .put(Blocks.CRIMSON_STEM, Blocks.STRIPPED_CRIMSON_STEM) + .put(Blocks.CRIMSON_HYPHAE, Blocks.STRIPPED_CRIMSON_HYPHAE) + .put(Blocks.MANGROVE_WOOD, Blocks.STRIPPED_MANGROVE_WOOD) + .put(Blocks.MANGROVE_LOG, Blocks.STRIPPED_MANGROVE_LOG) + .put(Blocks.BAMBOO_BLOCK, Blocks.STRIPPED_BAMBOO_BLOCK) + .build(); + + public MetalAxe(ToolMaterial material, Settings settings) { + super(material, BlockTags.AXE_MINEABLE, settings); + } + @Override + public ActionResult useOnBlock(ItemUsageContext context) { + World world = context.getWorld(); + BlockPos blockPos = context.getBlockPos(); + PlayerEntity playerEntity = context.getPlayer(); + if (shouldCancelStripAttempt(context)) { + return ActionResult.PASS; + } else { + Optional optional = this.tryStrip(world, blockPos, playerEntity, world.getBlockState(blockPos)); + if (optional.isEmpty()) { + return ActionResult.PASS; + } else { + ItemStack itemStack = context.getStack(); + if (playerEntity instanceof ServerPlayerEntity) { + Criteria.ITEM_USED_ON_BLOCK.trigger((ServerPlayerEntity)playerEntity, blockPos, itemStack); + } + + world.setBlockState(blockPos, (BlockState)optional.get(), Block.NOTIFY_ALL_AND_REDRAW); + world.emitGameEvent(GameEvent.BLOCK_CHANGE, blockPos, GameEvent.Emitter.of(playerEntity, (BlockState)optional.get())); + if (playerEntity != null) { + itemStack.damage(1, playerEntity, LivingEntity.getSlotForHand(context.getHand())); + } + + return ActionResult.success(world.isClient); + } + } + } + + private static boolean shouldCancelStripAttempt(ItemUsageContext context) { + PlayerEntity playerEntity = context.getPlayer(); + return context.getHand().equals(Hand.MAIN_HAND) && playerEntity.getOffHandStack().isOf(Items.SHIELD) && !playerEntity.shouldCancelInteraction(); + } + + private Optional tryStrip(World world, BlockPos pos, @Nullable PlayerEntity player, BlockState state) { + Optional optional = this.getStrippedState(state); + if (optional.isPresent()) { + world.playSound(player, pos, SoundEvents.ITEM_AXE_STRIP, SoundCategory.BLOCKS, 1.0F, 1.0F); + return optional; + } else { + Optional optional2 = Oxidizable.getDecreasedOxidationState(state); + if (optional2.isPresent()) { + world.playSound(player, pos, SoundEvents.ITEM_AXE_SCRAPE, SoundCategory.BLOCKS, 1.0F, 1.0F); + world.syncWorldEvent(player, WorldEvents.BLOCK_SCRAPED, pos, 0); + return optional2; + } else { + Optional optional3 = Optional.ofNullable((Block)((BiMap)HoneycombItem.WAXED_TO_UNWAXED_BLOCKS.get()).get(state.getBlock())) + .map(block -> block.getStateWithProperties(state)); + if (optional3.isPresent()) { + world.playSound(player, pos, SoundEvents.ITEM_AXE_WAX_OFF, SoundCategory.BLOCKS, 1.0F, 1.0F); + world.syncWorldEvent(player, WorldEvents.WAX_REMOVED, pos, 0); + return optional3; + } else { + return Optional.empty(); + } + } + } + } + + private Optional getStrippedState(BlockState state) { + return Optional.ofNullable((Block)STRIPPED_BLOCKS.get(state.getBlock())) + .map(block -> block.getDefaultState().with(PillarBlock.AXIS, (Direction.Axis)state.get(PillarBlock.AXIS))); + } + + + + @Override + public void postDamageEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) { + stack.damage(150, attacker, EquipmentSlot.MAINHAND); + } +} diff --git a/src/main/java/com/equilibrium/item/tools_attribute/metal/MetalDagger.java b/src/main/java/com/equilibrium/item/tools_attribute/metal/MetalDagger.java new file mode 100644 index 0000000..e761f5e --- /dev/null +++ b/src/main/java/com/equilibrium/item/tools_attribute/metal/MetalDagger.java @@ -0,0 +1,68 @@ +package com.equilibrium.item.tools_attribute.metal; + +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.component.DataComponentTypes; +import net.minecraft.component.type.AttributeModifierSlot; +import net.minecraft.component.type.AttributeModifiersComponent; +import net.minecraft.component.type.ToolComponent; +import net.minecraft.entity.EquipmentSlot; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.attribute.EntityAttributeModifier; +import net.minecraft.entity.attribute.EntityAttributes; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.*; +import net.minecraft.registry.tag.BlockTags; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import java.util.List; + +public class MetalDagger extends ToolItem { + public MetalDagger(ToolMaterial toolMaterial, Item.Settings settings) { + super(toolMaterial, settings.component(DataComponentTypes.TOOL, createToolComponent())); + } + + private static ToolComponent createToolComponent() { + return new ToolComponent( + List.of(ToolComponent.Rule.ofAlwaysDropping(List.of(Blocks.COBWEB), 15.0F), ToolComponent.Rule.of(BlockTags.SWORD_EFFICIENT, 1.5F)), 1.0F, 2 + ); + } + + public static AttributeModifiersComponent createAttributeModifiers(ToolMaterial material, int baseAttackDamage, float attackSpeed) { + return AttributeModifiersComponent.builder() + .add( + EntityAttributes.GENERIC_ATTACK_DAMAGE, + new EntityAttributeModifier( + BASE_ATTACK_DAMAGE_MODIFIER_ID, (double)((float)baseAttackDamage + material.getAttackDamage()), EntityAttributeModifier.Operation.ADD_VALUE + ), + AttributeModifierSlot.MAINHAND + ) + .add( + EntityAttributes.GENERIC_ATTACK_SPEED, + new EntityAttributeModifier(BASE_ATTACK_SPEED_MODIFIER_ID, (double)attackSpeed, EntityAttributeModifier.Operation.ADD_VALUE), + AttributeModifierSlot.MAINHAND + ) + .build(); + } + + @Override + public boolean canMine(BlockState state, World world, BlockPos pos, PlayerEntity miner) { + return !miner.isCreative(); + } + + @Override + public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker) { + return true; + } + + @Override + public void postDamageEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) { + stack.damage(50, attacker, EquipmentSlot.MAINHAND); + } + + @Override + public ItemStack finishUsing(ItemStack stack, World world, LivingEntity user) { + return super.finishUsing(stack, world, user); + } +} diff --git a/src/main/java/com/equilibrium/item/tools_attribute/metal/MetalHoe.java b/src/main/java/com/equilibrium/item/tools_attribute/metal/MetalHoe.java new file mode 100644 index 0000000..e04cdda --- /dev/null +++ b/src/main/java/com/equilibrium/item/tools_attribute/metal/MetalHoe.java @@ -0,0 +1,119 @@ +package com.equilibrium.item.tools_attribute.metal; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Maps; +import com.mojang.datafixers.util.Pair; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.entity.EquipmentSlot; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.*; +import net.minecraft.registry.tag.BlockTags; +import net.minecraft.sound.SoundCategory; +import net.minecraft.sound.SoundEvents; +import net.minecraft.util.ActionResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.World; +import net.minecraft.world.event.GameEvent; + +import java.util.Map; +import java.util.function.Consumer; +import java.util.function.Predicate; + +public class MetalHoe extends MiningToolItem{ + /** + * A map of input blocks to predicate-consumer action pairs. + * + *

Tilling works so that if the predicate succeeds, the consumer (the real action) + * is executed, and the hoe is damaged. + */ + protected static final Map, Consumer>> TILLING_ACTIONS = Maps., Consumer>>newHashMap( + ImmutableMap.of( + Blocks.GRASS_BLOCK, + Pair.of(HoeItem::canTillFarmland, createTillAction(Blocks.FARMLAND.getDefaultState())), + Blocks.DIRT_PATH, + Pair.of(HoeItem::canTillFarmland, createTillAction(Blocks.FARMLAND.getDefaultState())), + Blocks.DIRT, + Pair.of(HoeItem::canTillFarmland, createTillAction(Blocks.FARMLAND.getDefaultState())), + Blocks.COARSE_DIRT, + Pair.of(HoeItem::canTillFarmland, createTillAction(Blocks.DIRT.getDefaultState())), + Blocks.ROOTED_DIRT, + Pair.of(itemUsageContext -> true, createTillAndDropAction(Blocks.DIRT.getDefaultState(), Items.HANGING_ROOTS)) + ) + ); + + public MetalHoe(ToolMaterial toolMaterial, Item.Settings settings) { + super(toolMaterial, BlockTags.HOE_MINEABLE, settings); + } + + @Override + public ActionResult useOnBlock(ItemUsageContext context) { + World world = context.getWorld(); + BlockPos blockPos = context.getBlockPos(); + Pair, Consumer> pair = (Pair, Consumer>)TILLING_ACTIONS.get( + world.getBlockState(blockPos).getBlock() + ); + if (pair == null) { + return ActionResult.PASS; + } else { + Predicate predicate = pair.getFirst(); + Consumer consumer = pair.getSecond(); + if (predicate.test(context)) { + PlayerEntity playerEntity = context.getPlayer(); + world.playSound(playerEntity, blockPos, SoundEvents.ITEM_HOE_TILL, SoundCategory.BLOCKS, 1.0F, 1.0F); + if (!world.isClient) { + consumer.accept(context); + if (playerEntity != null) { + context.getStack().damage(1, playerEntity, LivingEntity.getSlotForHand(context.getHand())); + } + } + + return ActionResult.success(world.isClient); + } else { + return ActionResult.PASS; + } + } + } + + /** + * {@return a tilling action that sets a block state} + * + * @param result the tilled block state + */ + public static Consumer createTillAction(BlockState result) { + return context -> { + context.getWorld().setBlockState(context.getBlockPos(), result, Block.NOTIFY_ALL_AND_REDRAW); + context.getWorld().emitGameEvent(GameEvent.BLOCK_CHANGE, context.getBlockPos(), GameEvent.Emitter.of(context.getPlayer(), result)); + }; + } + + /** + * {@return a tilling action that sets a block state and drops an item} + * + * @param droppedItem the item to drop + * @param result the tilled block state + */ + public static Consumer createTillAndDropAction(BlockState result, ItemConvertible droppedItem) { + return context -> { + context.getWorld().setBlockState(context.getBlockPos(), result, Block.NOTIFY_ALL_AND_REDRAW); + context.getWorld().emitGameEvent(GameEvent.BLOCK_CHANGE, context.getBlockPos(), GameEvent.Emitter.of(context.getPlayer(), result)); + Block.dropStack(context.getWorld(), context.getBlockPos(), context.getSide(), new ItemStack(droppedItem)); + }; + } + + /** + * {@return whether the used block can be tilled into farmland} + * This method is used as the tilling predicate for most vanilla blocks except rooted dirt. + */ + public static boolean canTillFarmland(ItemUsageContext context) { + return context.getSide() != Direction.DOWN && context.getWorld().getBlockState(context.getBlockPos().up()).isAir(); + } + + @Override + public void postDamageEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) { + stack.damage(150, attacker, EquipmentSlot.MAINHAND); + } +} diff --git a/src/main/java/com/equilibrium/item/tools_attribute/metal/MetalPickAxe.java b/src/main/java/com/equilibrium/item/tools_attribute/metal/MetalPickAxe.java new file mode 100644 index 0000000..59db3bd --- /dev/null +++ b/src/main/java/com/equilibrium/item/tools_attribute/metal/MetalPickAxe.java @@ -0,0 +1,20 @@ +package com.equilibrium.item.tools_attribute.metal; + +import net.minecraft.block.Block; +import net.minecraft.entity.EquipmentSlot; +import net.minecraft.entity.LivingEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.MiningToolItem; +import net.minecraft.item.ToolMaterial; +import net.minecraft.registry.tag.TagKey; + +public class MetalPickAxe extends MiningToolItem { + + public MetalPickAxe(ToolMaterial material, TagKey effectiveBlocks, Settings settings) { + super(material, effectiveBlocks, settings); + } + @Override + public void postDamageEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) { + stack.damage(150, attacker, EquipmentSlot.MAINHAND); + } +} diff --git a/src/main/java/com/equilibrium/item/tools_attribute/metal/MetalShovel.java b/src/main/java/com/equilibrium/item/tools_attribute/metal/MetalShovel.java new file mode 100644 index 0000000..2b9a7b5 --- /dev/null +++ b/src/main/java/com/equilibrium/item/tools_attribute/metal/MetalShovel.java @@ -0,0 +1,86 @@ +package com.equilibrium.item.tools_attribute.metal; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Maps; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.block.CampfireBlock; +import net.minecraft.entity.EquipmentSlot; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemUsageContext; +import net.minecraft.item.MiningToolItem; +import net.minecraft.item.ToolMaterial; +import net.minecraft.registry.tag.BlockTags; +import net.minecraft.sound.SoundCategory; +import net.minecraft.sound.SoundEvents; +import net.minecraft.util.ActionResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.World; +import net.minecraft.world.WorldEvents; +import net.minecraft.world.event.GameEvent; + +import java.util.Map; + +public class MetalShovel extends MiningToolItem { + protected static final Map PATH_STATES = Maps.newHashMap( + new ImmutableMap.Builder() + .put(Blocks.GRASS_BLOCK, Blocks.DIRT_PATH.getDefaultState()) + .put(Blocks.DIRT, Blocks.DIRT_PATH.getDefaultState()) + .put(Blocks.PODZOL, Blocks.DIRT_PATH.getDefaultState()) + .put(Blocks.COARSE_DIRT, Blocks.DIRT_PATH.getDefaultState()) + .put(Blocks.MYCELIUM, Blocks.DIRT_PATH.getDefaultState()) + .put(Blocks.ROOTED_DIRT, Blocks.DIRT_PATH.getDefaultState()) + .build() + ); + + public MetalShovel(ToolMaterial toolMaterial, Settings settings) { + super(toolMaterial, BlockTags.SHOVEL_MINEABLE, settings); + } + + @Override + public ActionResult useOnBlock(ItemUsageContext context) { + World world = context.getWorld(); + BlockPos blockPos = context.getBlockPos(); + BlockState blockState = world.getBlockState(blockPos); + if (context.getSide() == Direction.DOWN) { + return ActionResult.PASS; + } else { + PlayerEntity playerEntity = context.getPlayer(); + BlockState blockState2 = (BlockState)PATH_STATES.get(blockState.getBlock()); + BlockState blockState3 = null; + if (blockState2 != null && world.getBlockState(blockPos.up()).isAir()) { + world.playSound(playerEntity, blockPos, SoundEvents.ITEM_SHOVEL_FLATTEN, SoundCategory.BLOCKS, 1.0F, 1.0F); + blockState3 = blockState2; + } else if (blockState.getBlock() instanceof CampfireBlock && (Boolean)blockState.get(CampfireBlock.LIT)) { + if (!world.isClient()) { + world.syncWorldEvent(null, WorldEvents.FIRE_EXTINGUISHED, blockPos, 0); + } + + CampfireBlock.extinguish(context.getPlayer(), world, blockPos, blockState); + blockState3 = blockState.with(CampfireBlock.LIT, Boolean.valueOf(false)); + } + + if (blockState3 != null) { + if (!world.isClient) { + world.setBlockState(blockPos, blockState3, Block.NOTIFY_ALL_AND_REDRAW); + world.emitGameEvent(GameEvent.BLOCK_CHANGE, blockPos, GameEvent.Emitter.of(playerEntity, blockState3)); + if (playerEntity != null) { + context.getStack().damage(1, playerEntity, LivingEntity.getSlotForHand(context.getHand())); + } + } + + return ActionResult.success(world.isClient); + } else { + return ActionResult.PASS; + } + } + } + @Override + public void postDamageEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) { + stack.damage(150, attacker, EquipmentSlot.MAINHAND); + } +} diff --git a/src/main/java/com/equilibrium/item/tools_attribute/metal/MetalSword.java b/src/main/java/com/equilibrium/item/tools_attribute/metal/MetalSword.java new file mode 100644 index 0000000..487a9c7 --- /dev/null +++ b/src/main/java/com/equilibrium/item/tools_attribute/metal/MetalSword.java @@ -0,0 +1,70 @@ +package com.equilibrium.item.tools_attribute.metal; + +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.component.DataComponentTypes; +import net.minecraft.component.type.AttributeModifierSlot; +import net.minecraft.component.type.AttributeModifiersComponent; +import net.minecraft.component.type.ToolComponent; +import net.minecraft.entity.EquipmentSlot; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.attribute.EntityAttributeModifier; +import net.minecraft.entity.attribute.EntityAttributes; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ToolItem; +import net.minecraft.item.ToolMaterial; +import net.minecraft.registry.tag.BlockTags; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import java.util.List; + +public class MetalSword extends ToolItem { + public MetalSword(ToolMaterial toolMaterial, Settings settings) { + super(toolMaterial, settings.component(DataComponentTypes.TOOL, createToolComponent())); + } + + private static ToolComponent createToolComponent() { + return new ToolComponent( + List.of(ToolComponent.Rule.ofAlwaysDropping(List.of(Blocks.COBWEB), 15.0F), ToolComponent.Rule.of(BlockTags.SWORD_EFFICIENT, 1.5F)), 1.0F, 2 + ); + } + + public static AttributeModifiersComponent createAttributeModifiers(ToolMaterial material, int baseAttackDamage, float attackSpeed) { + return AttributeModifiersComponent.builder() + .add( + EntityAttributes.GENERIC_ATTACK_DAMAGE, + new EntityAttributeModifier( + BASE_ATTACK_DAMAGE_MODIFIER_ID, (double)((float)baseAttackDamage + material.getAttackDamage()), EntityAttributeModifier.Operation.ADD_VALUE + ), + AttributeModifierSlot.MAINHAND + ) + .add( + EntityAttributes.GENERIC_ATTACK_SPEED, + new EntityAttributeModifier(BASE_ATTACK_SPEED_MODIFIER_ID, (double)attackSpeed, EntityAttributeModifier.Operation.ADD_VALUE), + AttributeModifierSlot.MAINHAND + ) + .build(); + } + + @Override + public boolean canMine(BlockState state, World world, BlockPos pos, PlayerEntity miner) { + return !miner.isCreative(); + } + + @Override + public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker) { + return true; + } + + @Override + public void postDamageEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) { + stack.damage(50, attacker, EquipmentSlot.MAINHAND); + } + + @Override + public ItemStack finishUsing(ItemStack stack, World world, LivingEntity user) { + return super.finishUsing(stack, world, user); + } +} \ No newline at end of file diff --git a/src/main/java/com/equilibrium/mixin/EntitySpawner.java b/src/main/java/com/equilibrium/mixin/EntitySpawner.java new file mode 100644 index 0000000..8331f90 --- /dev/null +++ b/src/main/java/com/equilibrium/mixin/EntitySpawner.java @@ -0,0 +1,131 @@ +package com.equilibrium.mixin; + +import com.equilibrium.util.WorldMoonPhasesSelector; +import com.google.common.collect.Lists; +import net.minecraft.server.world.*; +import net.minecraft.text.Text; +import net.minecraft.util.Util; +import net.minecraft.util.math.ChunkPos; +import net.minecraft.util.profiler.Profiler; +import net.minecraft.world.*; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.ChunkManager; +import net.minecraft.world.chunk.ChunkStatus; +import net.minecraft.world.chunk.WorldChunk; +import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.ModifyArg; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.LocalCapture; + +import java.util.List; +import java.util.Objects; +import java.util.Random; +import java.util.function.Consumer; + +@Mixin(ServerChunkManager.class) +public abstract class EntitySpawner extends ChunkManager { + + @Shadow + @Final + ServerWorld world; + + @Shadow + @Final + public ServerChunkLoadingManager chunkLoadingManager; + @Shadow + private long lastMobSpawningTime; + @Shadow + private boolean spawnMonsters = true; + @Shadow + private boolean spawnAnimals = true; + @Shadow + @Final + private ChunkTicketManager ticketManager; + @Shadow + private SpawnHelper.Info spawnInfo; + + + @Shadow + private ChunkHolder getChunkHolder(long pos) { + return this.chunkLoadingManager.getChunkHolder(pos); + } + + @Shadow + private void ifChunkLoaded(long pos, Consumer chunkConsumer) { + ChunkHolder chunkHolder = this.getChunkHolder(pos); + if (chunkHolder != null) { + ((OptionalChunk) chunkHolder.getAccessibleFuture().getNow(ChunkHolder.UNLOADED_WORLD_CHUNK)).ifPresent(chunkConsumer); + } + } + + + @Shadow public abstract World getWorld(); + + Random random = new Random(); + + + + + + @Inject(method = "tickChunks", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Util;shuffle(Ljava/util/List;Lnet/minecraft/util/math/random/Random;)V", shift = At.Shift.AFTER), locals = LocalCapture.CAPTURE_FAILHARD, cancellable = true) + private void tickChunks(CallbackInfo ci, long l, long m, Profiler profiler, List list, int i, SpawnHelper.Info info, boolean bl) { + ci.cancel(); + + int j = 16 * this.world.getGameRules().getInt(GameRules.RANDOM_TICK_SPEED); + + boolean bl2 = this.world.getLevelProperties().getTime() % 400L == 0L; + + for (ServerChunkManager.ChunkWithHolder chunkWithHolder : list) { + WorldChunk worldChunk2 = chunkWithHolder.chunk; + ChunkPos chunkPos = worldChunk2.getPos(); + if (this.world.shouldTick(chunkPos) && this.chunkLoadingManager.shouldTick(chunkPos)) { + worldChunk2.increaseInhabitedTime(m); + if (bl && (this.spawnMonsters || this.spawnAnimals) && this.world.getWorldBorder().contains(chunkPos)) { + if(Objects.equals(WorldMoonPhasesSelector.setAndGetMoonType(this.world), "blueMoon")) + SpawnHelper.spawn(this.world, worldChunk2, info, this.spawnAnimals, false, bl2); + else + SpawnHelper.spawn(this.world, worldChunk2, info, false, this.spawnMonsters, bl2); + + } + if (this.world.shouldTickBlocksInChunk(chunkPos.toLong())) { + this.world.tickChunk(worldChunk2, j); + } + } + } + + + + + profiler.swap("customSpawners"); + if (bl) { + this.world.tickSpawners(this.spawnMonsters, this.spawnAnimals); + } + profiler.swap("broadcast"); + list.forEach(chunk -> chunk.holder.flushUpdates(chunk.chunk)); + profiler.pop(); + profiler.pop(); + + } + + +} + + + + + + + + + + + + + + + diff --git a/src/main/java/com/equilibrium/mixin/IdentifierMixin.java b/src/main/java/com/equilibrium/mixin/IdentifierMixin.java deleted file mode 100644 index 1cf73af..0000000 --- a/src/main/java/com/equilibrium/mixin/IdentifierMixin.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.equilibrium.mixin; -//实现注册自定义维度,后续生成自定义矿物 - -import net.minecraft.util.Identifier; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.Unique; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import java.util.Objects; - -import static net.minecraft.util.PathUtil.validatePath; - -@Mixin(Identifier.class) -public abstract class IdentifierMixin implements Comparable{ - @Inject(method = "ofVanilla", at = @At("HEAD")) - private static void ofVanilla(String path, CallbackInfoReturnable cir) { - //向Identifier类注入了一个条件 - }} - - diff --git a/src/main/java/com/equilibrium/mixin/ItemMixin.java b/src/main/java/com/equilibrium/mixin/ItemMixin.java new file mode 100644 index 0000000..20e8b86 --- /dev/null +++ b/src/main/java/com/equilibrium/mixin/ItemMixin.java @@ -0,0 +1,78 @@ +package com.equilibrium.mixin; + +import com.google.common.collect.Interner; +import com.google.common.collect.Interners; +import net.minecraft.component.ComponentMap; +import net.minecraft.component.ComponentType; +import net.minecraft.component.DataComponentTypes; +import net.minecraft.component.type.AttributeModifiersComponent; +import net.minecraft.component.type.ItemEnchantmentsComponent; +import net.minecraft.component.type.LoreComponent; +import net.minecraft.item.Item; +import net.minecraft.item.Items; +import net.minecraft.util.Rarity; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import static com.equilibrium.constant.MaxCount.vanillaMaxCount; +import static net.minecraft.component.DataComponentTypes.*; +import static net.minecraft.item.Items.register; + +@Mixin(Item.Settings.class) +public class ItemMixin { + + @Shadow private ComponentMap.Builder components; + @Shadow + private static final Interner COMPONENT_MAP_INTERNER = Interners.newStrongInterner(); + + ComponentMap DEFAULT_ITEM_COMPONENTS = vanillaMaxCount ? + + ComponentMap.builder() + .add(MAX_STACK_SIZE, 64) + .add(LORE, LoreComponent.DEFAULT) + .add(ENCHANTMENTS, ItemEnchantmentsComponent.DEFAULT) + .add(REPAIR_COST, 0) + .add(ATTRIBUTE_MODIFIERS, AttributeModifiersComponent.DEFAULT) + .add(RARITY, Rarity.COMMON) + .build() + + : + + ComponentMap.builder() + .add(MAX_STACK_SIZE, 16) + .add(LORE, LoreComponent.DEFAULT) + .add(ENCHANTMENTS, ItemEnchantmentsComponent.DEFAULT) + .add(REPAIR_COST, 0) + .add(ATTRIBUTE_MODIFIERS, AttributeModifiersComponent.DEFAULT) + .add(RARITY, Rarity.COMMON) + .build(); + + + @Shadow + public Item.Settings component(ComponentType type, T value) { + if (this.components == null) { + this.components = ComponentMap.builder().addAll(this.DEFAULT_ITEM_COMPONENTS); + } + this.components.add(type, value); + return (Item.Settings) this.components.build(); + } + + @Inject(method = "getComponents",at = @At(value = "HEAD"),cancellable = true) + private void getComponents(CallbackInfoReturnable cir) { + cir.cancel(); + cir.setReturnValue(this.components == null ? this.DEFAULT_ITEM_COMPONENTS : COMPONENT_MAP_INTERNER.intern(this.components.build())); + } + @Inject(method = "maxCount",at = @At(value = "HEAD"),cancellable = true) + public void maxCount(int maxCount, CallbackInfoReturnable cir) { + cir.cancel(); + if(maxCount>=16) + maxCount=maxCount/2; + cir.setReturnValue(this.component(DataComponentTypes.MAX_STACK_SIZE, maxCount)); + } + + + +} diff --git a/src/main/java/com/equilibrium/mixin/color/LightmapTextureManagerMixin.java b/src/main/java/com/equilibrium/mixin/color/LightmapTextureManagerMixin.java index 28fa6ca..869322a 100644 --- a/src/main/java/com/equilibrium/mixin/color/LightmapTextureManagerMixin.java +++ b/src/main/java/com/equilibrium/mixin/color/LightmapTextureManagerMixin.java @@ -146,8 +146,7 @@ public void update(float delta, CallbackInfo ci) { float v = this.client.options.getGamma().getValue().floatValue(); Vector3f vector3f5 = new Vector3f(this.easeOutQuart(vector3f2.x), this.easeOutQuart(vector3f2.y), this.easeOutQuart(vector3f2.z)); - //伽马值修正 - vector3f2.lerp(vector3f5, 0F); + //原来的代码: //vector3f2.lerp(vector3f5, Math.max(0.0F, v - i)); @@ -160,32 +159,46 @@ public void update(float delta, CallbackInfo ci) { LOGGER.info("moonType is null"); WorldMoonPhasesSelector.setMoonType(clientWorld.getTimeOfDay()); } + //夜视增益 + float nightVision = 0; + + //返回方块底色颜色浓淡的因子 float factor = MoonlightController.calculateFactor(clientWorld.getTimeOfDay()); // LOGGER.info("light factor is " +factor); if(Objects.equals(moonType, "blueMoon")|| Objects.equals(moonType, "haloMoon")){ //蓝色月亮渲染 + //伽马值修正 + vector3f2.lerp(vector3f5, 0.1F+nightVision); // LOGGER.info("Blue Moonlight rendering."); vector3f2.lerp(new Vector3f(0F, 0F, factor), 0.04F); } else if (Objects.equals(moonType, "harvestMoon")) { + //伽马值修正 + vector3f2.lerp(vector3f5, 0.1F+nightVision); //黄色月亮渲染 // LOGGER.info("Yellow Moonlight rendering."); vector3f2.lerp(new Vector3f(factor, factor, 0F), 0.04F); } else if (Objects.equals(moonType, "bloodMoon")) { + //伽马值修正 + vector3f2.lerp(vector3f5, 0F+nightVision); //红色月亮渲染 // LOGGER.info("Blood Moonlight rendering."); - vector3f2.lerp(new Vector3f(factor,0F, 0F), 0.04F); - }else { + vector3f2.lerp(new Vector3f(factor,0F, 0F), 0F);} + + else if (Objects.equals(moonType, "newMoon")) { + //伽马值修正 + vector3f2.lerp(vector3f5, 0F+nightVision); + //新月渲染 +// LOGGER.info("Blood Moonlight rendering."); + vector3f2.lerp(new Vector3f(factor,0F, 0F), 0F); + }else { + //伽马值修正 + vector3f2.lerp(vector3f5, 0.04F+nightVision); // LOGGER.info("Normal Moonlight rendering."); vector3f2.lerp(new Vector3f(0.75F, 0.75F, 0.75F), 0F); } - - - - - clamp(vector3f2); vector3f2.mul(255.0F); int w = 255; diff --git a/src/main/java/com/equilibrium/mixin/crafttime/MixinCraftingScreen.java b/src/main/java/com/equilibrium/mixin/crafttime/MixinCraftingScreen.java index 4adc6d7..463d424 100644 --- a/src/main/java/com/equilibrium/mixin/crafttime/MixinCraftingScreen.java +++ b/src/main/java/com/equilibrium/mixin/crafttime/MixinCraftingScreen.java @@ -85,7 +85,7 @@ public boolean keyPressed(int keyCode, int scanCode, int modifiers) { int l = (int) ((player.craftTime$getCraftTime() * 24.0F / player.craftTime$getCraftPeriod())); //一旦中途退出,就失去所有进度渲染,直到再次摆出正确配方而且点击了目标合成物 - MITEequilibrium.LOGGER.info(String.valueOf(l)); +// MITEequilibrium.LOGGER.info(String.valueOf(l)); if (stopRenderArrow){ return; diff --git a/src/main/java/com/equilibrium/mixin/entitymixin/HostileAttributesMixin.java b/src/main/java/com/equilibrium/mixin/entitymixin/HostileAttributesMixin.java new file mode 100644 index 0000000..3a1107f --- /dev/null +++ b/src/main/java/com/equilibrium/mixin/entitymixin/HostileAttributesMixin.java @@ -0,0 +1,21 @@ +package com.equilibrium.mixin.entitymixin; + +import net.minecraft.entity.attribute.DefaultAttributeContainer; +import net.minecraft.entity.attribute.EntityAttributes; +import net.minecraft.entity.mob.HostileEntity; +import net.minecraft.entity.mob.MobEntity; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(HostileEntity.class) +public abstract class HostileAttributesMixin { + @Inject(method = "createHostileAttributes",at = @At(value = "HEAD"),cancellable = true) + private static void createHostileAttributes(CallbackInfoReturnable cir) { + cir.cancel(); + cir.setReturnValue(MobEntity.createMobAttributes() + .add(EntityAttributes.GENERIC_ATTACK_DAMAGE) + .add(EntityAttributes.GENERIC_FOLLOW_RANGE, 64.0)); + } +} diff --git a/src/main/java/com/equilibrium/mixin/entitymixin/SkeletonEntityMixin.java b/src/main/java/com/equilibrium/mixin/entitymixin/SkeletonEntityMixin.java new file mode 100644 index 0000000..a77a245 --- /dev/null +++ b/src/main/java/com/equilibrium/mixin/entitymixin/SkeletonEntityMixin.java @@ -0,0 +1,58 @@ +package com.equilibrium.mixin.entitymixin; + +import net.minecraft.entity.EntityType; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.ai.RangedAttackMob; +import net.minecraft.entity.mob.AbstractSkeletonEntity; +import net.minecraft.entity.mob.HostileEntity; +import net.minecraft.entity.projectile.PersistentProjectileEntity; +import net.minecraft.entity.projectile.ProjectileUtil; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.sound.SoundEvents; +import net.minecraft.world.World; +import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(AbstractSkeletonEntity.class) +public abstract class SkeletonEntityMixin extends HostileEntity implements RangedAttackMob { + protected SkeletonEntityMixin(EntityType entityType, World world) { + super(entityType, world); + } + @Shadow + protected PersistentProjectileEntity createArrowProjectile(ItemStack arrow, float damageModifier, @Nullable ItemStack shotFrom) { + return ProjectileUtil.createArrowProjectile(this, arrow, damageModifier, shotFrom); + } + + @Inject(method = "getHardAttackInterval",at = @At(value = "HEAD"),cancellable = true) + protected void getHardAttackInterval(CallbackInfoReturnable cir) { + cir.cancel(); + cir.setReturnValue(15); + } + + @Inject(method = "getRegularAttackInterval",at = @At(value = "HEAD"),cancellable = true) + protected void getRegularAttackInterval(CallbackInfoReturnable cir) { + cir.cancel(); + cir.setReturnValue(30); + } + + @Inject(method = "shootAt",at = @At(value = "HEAD"),cancellable = true) + public void shootAt(LivingEntity target, float pullProgress, CallbackInfo ci) { + ci.cancel(); + ItemStack itemStack = this.getStackInHand(ProjectileUtil.getHandPossiblyHolding(this, Items.BOW)); + ItemStack itemStack2 = this.getProjectileType(itemStack); + PersistentProjectileEntity persistentProjectileEntity = this.createArrowProjectile(itemStack2, pullProgress, itemStack); + double d = target.getX() - this.getX(); + double e = target.getBodyY(0.3333333333333333) - persistentProjectileEntity.getY(); + double f = target.getZ() - this.getZ(); + double g = Math.sqrt(d * d + f * f); + persistentProjectileEntity.setVelocity(d, e + g * 0.2F, f, 2F, 0f); + this.playSound(SoundEvents.ENTITY_SKELETON_SHOOT, 1.0F, 1.0F / (this.getRandom().nextFloat() * 0.4F + 0.8F)); + this.getWorld().spawnEntity(persistentProjectileEntity); + } +} diff --git a/src/main/java/com/equilibrium/mixin/entitymixin/ZombieEntityMixin.java b/src/main/java/com/equilibrium/mixin/entitymixin/ZombieEntityMixin.java new file mode 100644 index 0000000..f756d0d --- /dev/null +++ b/src/main/java/com/equilibrium/mixin/entitymixin/ZombieEntityMixin.java @@ -0,0 +1,77 @@ +package com.equilibrium.mixin.entitymixin; + +import net.minecraft.block.Blocks; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.ai.goal.*; +import net.minecraft.entity.attribute.DefaultAttributeContainer; +import net.minecraft.entity.attribute.EntityAttributes; +import net.minecraft.entity.effect.StatusEffect; +import net.minecraft.entity.effect.StatusEffectInstance; +import net.minecraft.entity.effect.StatusEffects; +import net.minecraft.entity.mob.HostileEntity; +import net.minecraft.entity.mob.PathAwareEntity; +import net.minecraft.entity.mob.ZombieEntity; +import net.minecraft.entity.mob.ZombifiedPiglinEntity; +import net.minecraft.entity.passive.IronGolemEntity; +import net.minecraft.entity.passive.MerchantEntity; +import net.minecraft.entity.passive.TurtleEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.registry.tag.FluidTags; +import net.minecraft.sound.SoundCategory; +import net.minecraft.sound.SoundEvents; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.WorldAccess; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import java.util.Objects; + +import static com.equilibrium.util.WorldMoonPhasesSelector.setAndGetMoonType; + +@Mixin(ZombieEntity.class) +public abstract class ZombieEntityMixin extends HostileEntity { + protected ZombieEntityMixin(EntityType entityType, World world) { + super(entityType, world); + } + + @Inject(method = "createZombieAttributes", at = @At(value = "HEAD"), cancellable = true) + private static void createZombieAttributes(CallbackInfoReturnable cir) { + cir.cancel(); + cir.setReturnValue(HostileEntity.createHostileAttributes() + .add(EntityAttributes.GENERIC_FOLLOW_RANGE, 128.0) + .add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.30F) + .add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 3.0) + .add(EntityAttributes.GENERIC_ARMOR, 2.0) + .add(EntityAttributes.ZOMBIE_SPAWN_REINFORCEMENTS)); + } + + + @Inject(method = "initGoals", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/ai/goal/LookAtEntityGoal;(Lnet/minecraft/entity/mob/MobEntity;Ljava/lang/Class;F)V")) + protected void initGoals(CallbackInfo ci) { + this.goalSelector.add(5, new LookAtEntityGoal(this, PlayerEntity.class, 8.0F, 1)); + } + + StatusEffectInstance statusEffectInstance = new StatusEffectInstance(StatusEffects.STRENGTH, -1, 2, false, true, false); + + @Inject(method = "initCustomGoals", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/ai/goal/RevengeGoal;setGroupRevenge([Ljava/lang/Class;)Lnet/minecraft/entity/ai/goal/RevengeGoal;", shift = At.Shift.AFTER), cancellable = true) + protected void initCustomGoalss(CallbackInfo ci) { + ci.cancel(); + this.targetSelector.add(2, new ActiveTargetGoal(this, PlayerEntity.class, false)); + this.targetSelector.add(3, new ActiveTargetGoal(this, MerchantEntity.class, false)); + this.targetSelector.add(3, new ActiveTargetGoal(this, IronGolemEntity.class, true)); + this.targetSelector.add(5, new ActiveTargetGoal(this, TurtleEntity.class, 10, true, false, TurtleEntity.BABY_TURTLE_ON_LAND_FILTER)); + } + + @Inject(method = "tick", at = @At(value = "TAIL")) + public void tick(CallbackInfo ci) { + if (Objects.equals(setAndGetMoonType(this.getWorld()), "bloodMoon") && !this.hasStatusEffect(StatusEffects.STRENGTH)) { + this.addStatusEffect(statusEffectInstance); + } + } +} + diff --git a/src/main/java/com/equilibrium/mixin/entitymixin/goal_mixin/ArrowTargetMixin.java b/src/main/java/com/equilibrium/mixin/entitymixin/goal_mixin/ArrowTargetMixin.java new file mode 100644 index 0000000..ee71f61 --- /dev/null +++ b/src/main/java/com/equilibrium/mixin/entitymixin/goal_mixin/ArrowTargetMixin.java @@ -0,0 +1,4 @@ +package com.equilibrium.mixin.entitymixin.goal_mixin; + +public class ArrowTargetMixin { +} diff --git a/src/main/java/com/equilibrium/mixin/entitymixin/goal_mixin/LookAtEntityGoalMixin.java b/src/main/java/com/equilibrium/mixin/entitymixin/goal_mixin/LookAtEntityGoalMixin.java new file mode 100644 index 0000000..9c3141a --- /dev/null +++ b/src/main/java/com/equilibrium/mixin/entitymixin/goal_mixin/LookAtEntityGoalMixin.java @@ -0,0 +1,29 @@ +package com.equilibrium.mixin.entitymixin.goal_mixin; + +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.ai.TargetPredicate; +import net.minecraft.entity.ai.goal.Goal; +import net.minecraft.entity.ai.goal.LookAtEntityGoal; +import net.minecraft.entity.mob.MobEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.predicate.entity.EntityPredicates; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; + +import java.util.EnumSet; + +@Mixin(LookAtEntityGoal.class) +public abstract class LookAtEntityGoalMixin { + @Shadow + private int lookTime; + @Shadow + @Final + protected MobEntity mob; + @Shadow + @Final + protected float chance = 1; + +} diff --git a/src/main/java/com/equilibrium/mixin/oreGenerator/OreConfiguredModify.java b/src/main/java/com/equilibrium/mixin/oreGenerator/OreConfiguredModify.java deleted file mode 100644 index 3e879ee..0000000 --- a/src/main/java/com/equilibrium/mixin/oreGenerator/OreConfiguredModify.java +++ /dev/null @@ -1,194 +0,0 @@ -package com.equilibrium.mixin.oreGenerator; - - -import net.minecraft.block.Blocks; -import net.minecraft.registry.Registerable; -import net.minecraft.registry.RegistryKey; -import net.minecraft.registry.tag.BlockTags; -import net.minecraft.structure.rule.BlockMatchRuleTest; -import net.minecraft.structure.rule.RuleTest; -import net.minecraft.structure.rule.TagMatchRuleTest; -import net.minecraft.world.gen.feature.*; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import java.util.List; - -@Mixin(OreConfiguredFeatures.class) -public abstract class OreConfiguredModify { - @Shadow - public static final RegistryKey> ORE_MAGMA = ConfiguredFeatures.of("ore_magma"); - @Shadow - public static final RegistryKey> ORE_SOUL_SAND = ConfiguredFeatures.of("ore_soul_sand"); - @Shadow - public static final RegistryKey> ORE_NETHER_GOLD = ConfiguredFeatures.of("ore_nether_gold"); - @Shadow - public static final RegistryKey> ORE_QUARTZ = ConfiguredFeatures.of("ore_quartz"); - @Shadow - public static final RegistryKey> ORE_GRAVEL_NETHER = ConfiguredFeatures.of("ore_gravel_nether"); - @Shadow - public static final RegistryKey> ORE_BLACKSTONE = ConfiguredFeatures.of("ore_blackstone"); - @Shadow - public static final RegistryKey> ORE_DIRT = ConfiguredFeatures.of("ore_dirt"); - @Shadow - public static final RegistryKey> ORE_GRAVEL = ConfiguredFeatures.of("ore_gravel"); - @Shadow - public static final RegistryKey> ORE_GRANITE = ConfiguredFeatures.of("ore_granite"); - @Shadow - public static final RegistryKey> ORE_DIORITE = ConfiguredFeatures.of("ore_diorite"); - @Shadow - public static final RegistryKey> ORE_ANDESITE = ConfiguredFeatures.of("ore_andesite"); - @Shadow - public static final RegistryKey> ORE_TUFF = ConfiguredFeatures.of("ore_tuff"); - @Shadow - public static final RegistryKey> ORE_COAL = ConfiguredFeatures.of("ore_coal"); - @Shadow - public static final RegistryKey> ORE_COAL_BURIED = ConfiguredFeatures.of("ore_coal_buried"); - @Shadow - public static final RegistryKey> ORE_IRON = ConfiguredFeatures.of("ore_iron"); - @Shadow - public static final RegistryKey> ORE_IRON_SMALL = ConfiguredFeatures.of("ore_iron_small"); - @Shadow - public static final RegistryKey> ORE_GOLD = ConfiguredFeatures.of("ore_gold"); - @Shadow - public static final RegistryKey> ORE_GOLD_BURIED = ConfiguredFeatures.of("ore_gold_buried"); - @Shadow - public static final RegistryKey> ORE_REDSTONE = ConfiguredFeatures.of("ore_redstone"); - @Shadow - public static final RegistryKey> ORE_DIAMOND_SMALL = ConfiguredFeatures.of("ore_diamond_small"); - @Shadow - public static final RegistryKey> ORE_DIAMOND_MEDIUM = ConfiguredFeatures.of("ore_diamond_medium"); - @Shadow - public static final RegistryKey> ORE_DIAMOND_LARGE = ConfiguredFeatures.of("ore_diamond_large"); - @Shadow - public static final RegistryKey> ORE_DIAMOND_BURIED = ConfiguredFeatures.of("ore_diamond_buried"); - @Shadow - public static final RegistryKey> ORE_LAPIS = ConfiguredFeatures.of("ore_lapis"); - @Shadow - public static final RegistryKey> ORE_LAPIS_BURIED = ConfiguredFeatures.of("ore_lapis_buried"); - @Shadow - public static final RegistryKey> ORE_INFESTED = ConfiguredFeatures.of("ore_infested"); - @Shadow - public static final RegistryKey> ORE_EMERALD = ConfiguredFeatures.of("ore_emerald"); - @Shadow - public static final RegistryKey> ORE_ANCIENT_DEBRIS_LARGE = ConfiguredFeatures.of("ore_ancient_debris_large"); - @Shadow - public static final RegistryKey> ORE_ANCIENT_DEBRIS_SMALL = ConfiguredFeatures.of("ore_ancient_debris_small"); - @Shadow - public static final RegistryKey> ORE_COPPER_SMALL = ConfiguredFeatures.of("ore_copper_small"); - @Shadow - public static final RegistryKey> ORE_COPPER_LARGE = ConfiguredFeatures.of("ore_copper_large"); - @Shadow - public static final RegistryKey> ORE_CLAY = ConfiguredFeatures.of("ore_clay"); - - -@Inject(method = "bootstrap",at = @At(value = "HEAD"),cancellable = true) -private static void bootstrap(Registerable> featureRegisterable, CallbackInfo ci) { - ci.cancel(); - RuleTest ruleTest = new TagMatchRuleTest(BlockTags.BASE_STONE_OVERWORLD); - RuleTest ruleTest2 = new TagMatchRuleTest(BlockTags.STONE_ORE_REPLACEABLES); - RuleTest ruleTest3 = new TagMatchRuleTest(BlockTags.DEEPSLATE_ORE_REPLACEABLES); - RuleTest ruleTest4 = new BlockMatchRuleTest(Blocks.NETHERRACK); - RuleTest ruleTest5 = new TagMatchRuleTest(BlockTags.BASE_STONE_NETHER); - List list = List.of( - OreFeatureConfig.createTarget(ruleTest2, Blocks.IRON_ORE.getDefaultState()), - OreFeatureConfig.createTarget(ruleTest3, Blocks.DEEPSLATE_IRON_ORE.getDefaultState()) - ); - List list2 = List.of( - OreFeatureConfig.createTarget(ruleTest2, Blocks.GOLD_ORE.getDefaultState()), - OreFeatureConfig.createTarget(ruleTest3, Blocks.DEEPSLATE_GOLD_ORE.getDefaultState()) - ); - List list3 = List.of( - OreFeatureConfig.createTarget(ruleTest2, Blocks.DIAMOND_ORE.getDefaultState()), - OreFeatureConfig.createTarget(ruleTest3, Blocks.DEEPSLATE_DIAMOND_ORE.getDefaultState()) - ); - List list4 = List.of( - OreFeatureConfig.createTarget(ruleTest2, Blocks.LAPIS_ORE.getDefaultState()), - OreFeatureConfig.createTarget(ruleTest3, Blocks.DEEPSLATE_LAPIS_ORE.getDefaultState()) - ); - List list5 = List.of( - OreFeatureConfig.createTarget(ruleTest2, Blocks.COPPER_ORE.getDefaultState()), - OreFeatureConfig.createTarget(ruleTest3, Blocks.DEEPSLATE_COPPER_ORE.getDefaultState()) - ); - List list6 = List.of( - OreFeatureConfig.createTarget(ruleTest2, Blocks.COAL_ORE.getDefaultState()), - OreFeatureConfig.createTarget(ruleTest3, Blocks.DEEPSLATE_COAL_ORE.getDefaultState()) - ); - ConfiguredFeatures.register(featureRegisterable, ORE_MAGMA, Feature.ORE, new OreFeatureConfig(ruleTest4, Blocks.MAGMA_BLOCK.getDefaultState(), 33)); - ConfiguredFeatures.register(featureRegisterable, ORE_SOUL_SAND, Feature.ORE, new OreFeatureConfig(ruleTest4, Blocks.SOUL_SAND.getDefaultState(), 12)); - ConfiguredFeatures.register(featureRegisterable, ORE_NETHER_GOLD, Feature.ORE, new OreFeatureConfig(ruleTest4, Blocks.NETHER_GOLD_ORE.getDefaultState(), 10)); - ConfiguredFeatures.register(featureRegisterable, ORE_QUARTZ, Feature.ORE, new OreFeatureConfig(ruleTest4, Blocks.NETHER_QUARTZ_ORE.getDefaultState(), 14)); - ConfiguredFeatures.register(featureRegisterable, ORE_GRAVEL_NETHER, Feature.ORE, new OreFeatureConfig(ruleTest4, Blocks.GRAVEL.getDefaultState(), 33)); - ConfiguredFeatures.register(featureRegisterable, ORE_BLACKSTONE, Feature.ORE, new OreFeatureConfig(ruleTest4, Blocks.BLACKSTONE.getDefaultState(), 33)); - ConfiguredFeatures.register(featureRegisterable, ORE_DIRT, Feature.ORE, new OreFeatureConfig(ruleTest, Blocks.DIRT.getDefaultState(), 128)); - ConfiguredFeatures.register(featureRegisterable, ORE_GRAVEL, Feature.ORE, new OreFeatureConfig(ruleTest, Blocks.GRAVEL.getDefaultState(), 33)); - ConfiguredFeatures.register(featureRegisterable, ORE_GRANITE, Feature.ORE, new OreFeatureConfig(ruleTest, Blocks.GRANITE.getDefaultState(), 64)); - ConfiguredFeatures.register(featureRegisterable, ORE_DIORITE, Feature.ORE, new OreFeatureConfig(ruleTest, Blocks.DIORITE.getDefaultState(), 64)); - ConfiguredFeatures.register(featureRegisterable, ORE_ANDESITE, Feature.ORE, new OreFeatureConfig(ruleTest, Blocks.ANDESITE.getDefaultState(), 64)); - ConfiguredFeatures.register(featureRegisterable, ORE_TUFF, Feature.ORE, new OreFeatureConfig(ruleTest, Blocks.TUFF.getDefaultState(), 64)); - ConfiguredFeatures.register(featureRegisterable, ORE_COAL, Feature.ORE, new OreFeatureConfig(list6, 17)); - ConfiguredFeatures.register(featureRegisterable, ORE_COAL_BURIED, Feature.ORE, new OreFeatureConfig(list6, 17, 0.5F)); - ConfiguredFeatures.register(featureRegisterable, ORE_IRON, Feature.ORE, new OreFeatureConfig(list, 9)); - ConfiguredFeatures.register(featureRegisterable, ORE_IRON_SMALL, Feature.ORE, new OreFeatureConfig(list, 4)); - ConfiguredFeatures.register(featureRegisterable, ORE_GOLD, Feature.ORE, new OreFeatureConfig(list2, 9)); - ConfiguredFeatures.register(featureRegisterable, ORE_GOLD_BURIED, Feature.ORE, new OreFeatureConfig(list2, 9, 0.5F)); - ConfiguredFeatures.register( - featureRegisterable, - ORE_REDSTONE, - Feature.ORE, - new OreFeatureConfig( - List.of( - OreFeatureConfig.createTarget(ruleTest2, Blocks.REDSTONE_ORE.getDefaultState()), - OreFeatureConfig.createTarget(ruleTest3, Blocks.DEEPSLATE_REDSTONE_ORE.getDefaultState()) - ), - 8 - ) - ); - ConfiguredFeatures.register(featureRegisterable, ORE_DIAMOND_SMALL, Feature.ORE, new OreFeatureConfig(list3, 4, 0.5F)); - ConfiguredFeatures.register(featureRegisterable, ORE_DIAMOND_LARGE, Feature.ORE, new OreFeatureConfig(list3, 12, 0.7F)); - ConfiguredFeatures.register(featureRegisterable, ORE_DIAMOND_BURIED, Feature.ORE, new OreFeatureConfig(list3, 8, 1.0F)); - ConfiguredFeatures.register(featureRegisterable, ORE_DIAMOND_MEDIUM, Feature.ORE, new OreFeatureConfig(list3, 8, 0.5F)); - ConfiguredFeatures.register(featureRegisterable, ORE_LAPIS, Feature.ORE, new OreFeatureConfig(list4, 7)); - ConfiguredFeatures.register(featureRegisterable, ORE_LAPIS_BURIED, Feature.ORE, new OreFeatureConfig(list4, 7, 1.0F)); - ConfiguredFeatures.register( - featureRegisterable, - ORE_INFESTED, - Feature.ORE, - new OreFeatureConfig( - List.of( - OreFeatureConfig.createTarget(ruleTest2, Blocks.INFESTED_STONE.getDefaultState()), - OreFeatureConfig.createTarget(ruleTest3, Blocks.INFESTED_DEEPSLATE.getDefaultState()) - ), - 9 - ) - ); - ConfiguredFeatures.register( - featureRegisterable, - ORE_EMERALD, - Feature.ORE, - new OreFeatureConfig( - List.of( - OreFeatureConfig.createTarget(ruleTest2, Blocks.EMERALD_ORE.getDefaultState()), - OreFeatureConfig.createTarget(ruleTest3, Blocks.DEEPSLATE_EMERALD_ORE.getDefaultState()) - ), - 3 - ) - ); - ConfiguredFeatures.register( - featureRegisterable, ORE_ANCIENT_DEBRIS_LARGE, Feature.SCATTERED_ORE, new OreFeatureConfig(ruleTest5, Blocks.ANCIENT_DEBRIS.getDefaultState(), 3, 1.0F) - ); - ConfiguredFeatures.register( - featureRegisterable, ORE_ANCIENT_DEBRIS_SMALL, Feature.SCATTERED_ORE, new OreFeatureConfig(ruleTest5, Blocks.ANCIENT_DEBRIS.getDefaultState(), 2, 1.0F) - ); - ConfiguredFeatures.register(featureRegisterable, ORE_COPPER_SMALL, Feature.ORE, new OreFeatureConfig(list5, 10)); - ConfiguredFeatures.register(featureRegisterable, ORE_COPPER_LARGE, Feature.ORE, new OreFeatureConfig(list5, 20)); - ConfiguredFeatures.register(featureRegisterable, ORE_CLAY, Feature.ORE, new OreFeatureConfig(ruleTest, Blocks.CLAY.getDefaultState(), 33)); - } - - - - -} \ No newline at end of file diff --git a/src/main/java/com/equilibrium/mixin/oreGenerator/OrePlacedModifiy.java b/src/main/java/com/equilibrium/mixin/oreGenerator/OrePlacedModifiy.java deleted file mode 100644 index 99d6138..0000000 --- a/src/main/java/com/equilibrium/mixin/oreGenerator/OrePlacedModifiy.java +++ /dev/null @@ -1,302 +0,0 @@ -package com.equilibrium.mixin.oreGenerator; - -import net.minecraft.registry.Registerable; -import net.minecraft.registry.RegistryEntryLookup; -import net.minecraft.registry.RegistryKey; -import net.minecraft.registry.RegistryKeys; -import net.minecraft.registry.entry.RegistryEntry; -import net.minecraft.util.math.intprovider.UniformIntProvider; -import net.minecraft.world.gen.YOffset; -import net.minecraft.world.gen.feature.*; -import net.minecraft.world.gen.placementmodifier.*; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import java.util.List; - -@Mixin(OrePlacedFeatures.class) -public abstract class OrePlacedModifiy { - @Shadow - private static List modifiers(PlacementModifier countModifier, PlacementModifier heightModifier) { - return List.of(countModifier, SquarePlacementModifier.of(), heightModifier, BiomePlacementModifier.of()); - } - @Shadow - private static List modifiersWithCount(int count, PlacementModifier heightModifier) { - return modifiers(CountPlacementModifier.of(count), heightModifier); - } - @Shadow - private static List modifiersWithRarity(int chance, PlacementModifier heightModifier) { - return modifiers(RarityFilterPlacementModifier.of(chance), heightModifier); - } - @Shadow - public static final RegistryKey ORE_MAGMA = PlacedFeatures.of("ore_magma"); - @Shadow - public static final RegistryKey ORE_SOUL_SAND = PlacedFeatures.of("ore_soul_sand"); - @Shadow - public static final RegistryKey ORE_GOLD_DELTAS = PlacedFeatures.of("ore_gold_deltas"); - @Shadow - public static final RegistryKey ORE_QUARTZ_DELTAS = PlacedFeatures.of("ore_quartz_deltas"); - @Shadow - public static final RegistryKey ORE_GOLD_NETHER = PlacedFeatures.of("ore_gold_nether"); - @Shadow - public static final RegistryKey ORE_QUARTZ_NETHER = PlacedFeatures.of("ore_quartz_nether"); - @Shadow - public static final RegistryKey ORE_GRAVEL_NETHER = PlacedFeatures.of("ore_gravel_nether"); - @Shadow - public static final RegistryKey ORE_BLACKSTONE = PlacedFeatures.of("ore_blackstone"); - @Shadow - public static final RegistryKey ORE_DIRT = PlacedFeatures.of("ore_dirt"); - @Shadow - public static final RegistryKey ORE_GRAVEL = PlacedFeatures.of("ore_gravel"); - @Shadow - public static final RegistryKey ORE_GRANITE_UPPER = PlacedFeatures.of("ore_granite_upper"); - @Shadow - public static final RegistryKey ORE_GRANITE_LOWER = PlacedFeatures.of("ore_granite_lower"); - @Shadow - public static final RegistryKey ORE_DIORITE_UPPER = PlacedFeatures.of("ore_diorite_upper"); - @Shadow - public static final RegistryKey ORE_DIORITE_LOWER = PlacedFeatures.of("ore_diorite_lower"); - @Shadow - public static final RegistryKey ORE_ANDESITE_UPPER = PlacedFeatures.of("ore_andesite_upper"); - @Shadow - public static final RegistryKey ORE_ANDESITE_LOWER = PlacedFeatures.of("ore_andesite_lower"); - @Shadow - public static final RegistryKey ORE_TUFF = PlacedFeatures.of("ore_tuff"); - @Shadow - public static final RegistryKey ORE_COAL_UPPER = PlacedFeatures.of("ore_coal_upper"); - @Shadow - public static final RegistryKey ORE_COAL_LOWER = PlacedFeatures.of("ore_coal_lower"); - @Shadow - public static final RegistryKey ORE_IRON_UPPER = PlacedFeatures.of("ore_iron_upper"); - @Shadow - public static final RegistryKey ORE_IRON_MIDDLE = PlacedFeatures.of("ore_iron_middle"); - @Shadow - public static final RegistryKey ORE_IRON_SMALL = PlacedFeatures.of("ore_iron_small"); - @Shadow - public static final RegistryKey ORE_GOLD_EXTRA = PlacedFeatures.of("ore_gold_extra"); - @Shadow - public static final RegistryKey ORE_GOLD = PlacedFeatures.of("ore_gold"); - @Shadow - public static final RegistryKey ORE_GOLD_LOWER = PlacedFeatures.of("ore_gold_lower"); - @Shadow - public static final RegistryKey ORE_REDSTONE = PlacedFeatures.of("ore_redstone"); - @Shadow - public static final RegistryKey ORE_REDSTONE_LOWER = PlacedFeatures.of("ore_redstone_lower"); - @Shadow - public static final RegistryKey ORE_DIAMOND = PlacedFeatures.of("ore_diamond"); - @Shadow - public static final RegistryKey ORE_DIAMOND_MEDIUM = PlacedFeatures.of("ore_diamond_medium"); - @Shadow - public static final RegistryKey ORE_DIAMOND_LARGE = PlacedFeatures.of("ore_diamond_large"); - @Shadow - public static final RegistryKey ORE_DIAMOND_BURIED = PlacedFeatures.of("ore_diamond_buried"); - @Shadow - public static final RegistryKey ORE_LAPIS = PlacedFeatures.of("ore_lapis"); - @Shadow - public static final RegistryKey ORE_LAPIS_BURIED = PlacedFeatures.of("ore_lapis_buried"); - @Shadow - public static final RegistryKey ORE_INFESTED = PlacedFeatures.of("ore_infested"); - @Shadow - public static final RegistryKey ORE_EMERALD = PlacedFeatures.of("ore_emerald"); - @Shadow - public static final RegistryKey ORE_ANCIENT_DEBRIS_LARGE = PlacedFeatures.of("ore_ancient_debris_large"); - @Shadow - public static final RegistryKey ORE_DEBRIS_SMALL = PlacedFeatures.of("ore_debris_small"); - @Shadow - public static final RegistryKey ORE_COPPER = PlacedFeatures.of("ore_copper"); - @Shadow - public static final RegistryKey ORE_COPPER_LARGE = PlacedFeatures.of("ore_copper_large"); - @Shadow - public static final RegistryKey ORE_CLAY = PlacedFeatures.of("ore_clay"); - - - - - - - - - - @Inject(method = "bootstrap",at = @At(value = "HEAD"),cancellable = true) - private static void bootstrap(Registerable featureRegisterable, CallbackInfo ci) { - ci.cancel(); - RegistryEntryLookup> registryEntryLookup = featureRegisterable.getRegistryLookup(RegistryKeys.CONFIGURED_FEATURE); - RegistryEntry> registryEntry = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_MAGMA); - RegistryEntry> registryEntry2 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_SOUL_SAND); - RegistryEntry> registryEntry3 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_NETHER_GOLD); - RegistryEntry> registryEntry4 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_QUARTZ); - RegistryEntry> registryEntry5 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_GRAVEL_NETHER); - RegistryEntry> registryEntry6 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_BLACKSTONE); - RegistryEntry> registryEntry7 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_DIRT); - RegistryEntry> registryEntry8 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_GRAVEL); - RegistryEntry> registryEntry9 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_GRANITE); - RegistryEntry> registryEntry10 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_DIORITE); - RegistryEntry> registryEntry11 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_ANDESITE); - RegistryEntry> registryEntry12 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_TUFF); - RegistryEntry> registryEntry13 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_COAL); - RegistryEntry> registryEntry14 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_COAL_BURIED); - RegistryEntry> registryEntry15 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_IRON); - RegistryEntry> registryEntry16 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_IRON_SMALL); - RegistryEntry> registryEntry17 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_GOLD); - RegistryEntry> registryEntry18 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_GOLD_BURIED); - RegistryEntry> registryEntry19 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_REDSTONE); - RegistryEntry> registryEntry20 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_DIAMOND_SMALL); - RegistryEntry> registryEntry21 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_DIAMOND_MEDIUM); - RegistryEntry> registryEntry22 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_DIAMOND_LARGE); - RegistryEntry> registryEntry23 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_DIAMOND_BURIED); - RegistryEntry> registryEntry24 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_LAPIS); - RegistryEntry> registryEntry25 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_LAPIS_BURIED); - RegistryEntry> registryEntry26 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_INFESTED); - RegistryEntry> registryEntry27 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_EMERALD); - RegistryEntry> registryEntry28 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_ANCIENT_DEBRIS_LARGE); - RegistryEntry> registryEntry29 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_ANCIENT_DEBRIS_SMALL); - RegistryEntry> registryEntry30 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_COPPER_SMALL); - RegistryEntry> registryEntry31 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_COPPER_LARGE); - RegistryEntry> registryEntry32 = registryEntryLookup.getOrThrow(OreConfiguredFeatures.ORE_CLAY); - PlacedFeatures.register( - featureRegisterable, ORE_MAGMA, registryEntry, modifiersWithCount(4, HeightRangePlacementModifier.uniform(YOffset.fixed(27), YOffset.fixed(36))) - ); - PlacedFeatures.register( - featureRegisterable, ORE_SOUL_SAND, registryEntry2, modifiersWithCount(12, HeightRangePlacementModifier.uniform(YOffset.getBottom(), YOffset.fixed(31))) - ); - PlacedFeatures.register(featureRegisterable, ORE_GOLD_DELTAS, registryEntry3, modifiersWithCount(20, PlacedFeatures.TEN_ABOVE_AND_BELOW_RANGE)); - PlacedFeatures.register(featureRegisterable, ORE_QUARTZ_DELTAS, registryEntry4, modifiersWithCount(32, PlacedFeatures.TEN_ABOVE_AND_BELOW_RANGE)); - PlacedFeatures.register(featureRegisterable, ORE_GOLD_NETHER, registryEntry3, modifiersWithCount(10, PlacedFeatures.TEN_ABOVE_AND_BELOW_RANGE)); - PlacedFeatures.register(featureRegisterable, ORE_QUARTZ_NETHER, registryEntry4, modifiersWithCount(16, PlacedFeatures.TEN_ABOVE_AND_BELOW_RANGE)); - PlacedFeatures.register( - featureRegisterable, ORE_GRAVEL_NETHER, registryEntry5, modifiersWithCount(2, HeightRangePlacementModifier.uniform(YOffset.fixed(5), YOffset.fixed(41))) - ); - PlacedFeatures.register( - featureRegisterable, ORE_BLACKSTONE, registryEntry6, modifiersWithCount(2, HeightRangePlacementModifier.uniform(YOffset.fixed(5), YOffset.fixed(31))) - ); - PlacedFeatures.register( - featureRegisterable, ORE_DIRT, registryEntry7, modifiersWithCount(7, HeightRangePlacementModifier.uniform(YOffset.fixed(0), YOffset.fixed(160))) - ); - PlacedFeatures.register( - featureRegisterable, ORE_GRAVEL, registryEntry8, modifiersWithCount(14, HeightRangePlacementModifier.uniform(YOffset.getBottom(), YOffset.getTop())) - ); - PlacedFeatures.register( - featureRegisterable, ORE_GRANITE_UPPER, registryEntry9, modifiersWithRarity(6, HeightRangePlacementModifier.uniform(YOffset.fixed(64), YOffset.fixed(128))) - ); - PlacedFeatures.register( - featureRegisterable, ORE_GRANITE_LOWER, registryEntry9, modifiersWithCount(2, HeightRangePlacementModifier.uniform(YOffset.fixed(0), YOffset.fixed(60))) - ); - PlacedFeatures.register( - featureRegisterable, ORE_DIORITE_UPPER, registryEntry10, modifiersWithRarity(6, HeightRangePlacementModifier.uniform(YOffset.fixed(64), YOffset.fixed(128))) - ); - PlacedFeatures.register( - featureRegisterable, ORE_DIORITE_LOWER, registryEntry10, modifiersWithCount(2, HeightRangePlacementModifier.uniform(YOffset.fixed(0), YOffset.fixed(60))) - ); - PlacedFeatures.register( - featureRegisterable, - ORE_ANDESITE_UPPER, - registryEntry11, - modifiersWithRarity(6, HeightRangePlacementModifier.uniform(YOffset.fixed(64), YOffset.fixed(128))) - ); - PlacedFeatures.register( - featureRegisterable, ORE_ANDESITE_LOWER, registryEntry11, modifiersWithCount(2, HeightRangePlacementModifier.uniform(YOffset.fixed(0), YOffset.fixed(60))) - ); - PlacedFeatures.register( - featureRegisterable, ORE_TUFF, registryEntry12, modifiersWithCount(2, HeightRangePlacementModifier.uniform(YOffset.getBottom(), YOffset.fixed(0))) - ); - PlacedFeatures.register( - featureRegisterable, ORE_COAL_UPPER, registryEntry13, modifiersWithCount(30, HeightRangePlacementModifier.uniform(YOffset.fixed(136), YOffset.getTop())) - ); - PlacedFeatures.register( - featureRegisterable, ORE_COAL_LOWER, registryEntry14, modifiersWithCount(20, HeightRangePlacementModifier.trapezoid(YOffset.fixed(0), YOffset.fixed(192))) - ); - PlacedFeatures.register( - featureRegisterable, ORE_IRON_UPPER, registryEntry15, modifiersWithCount(90, HeightRangePlacementModifier.trapezoid(YOffset.fixed(80), YOffset.fixed(384))) - ); - PlacedFeatures.register( - featureRegisterable, ORE_IRON_MIDDLE, registryEntry15, modifiersWithCount(10, HeightRangePlacementModifier.trapezoid(YOffset.fixed(-24), YOffset.fixed(56))) - ); - PlacedFeatures.register( - featureRegisterable, ORE_IRON_SMALL, registryEntry16, modifiersWithCount(10, HeightRangePlacementModifier.uniform(YOffset.getBottom(), YOffset.fixed(72))) - ); - PlacedFeatures.register( - featureRegisterable, ORE_GOLD_EXTRA, registryEntry17, modifiersWithCount(50, HeightRangePlacementModifier.uniform(YOffset.fixed(32), YOffset.fixed(256))) - ); - PlacedFeatures.register( - featureRegisterable, ORE_GOLD, registryEntry18, modifiersWithCount(4, HeightRangePlacementModifier.trapezoid(YOffset.fixed(-64), YOffset.fixed(32))) - ); - PlacedFeatures.register( - featureRegisterable, - ORE_GOLD_LOWER, - registryEntry18, - modifiers(CountPlacementModifier.of(UniformIntProvider.create(0, 1)), HeightRangePlacementModifier.uniform(YOffset.fixed(-64), YOffset.fixed(-48))) - ); - PlacedFeatures.register( - featureRegisterable, ORE_REDSTONE, registryEntry19, modifiersWithCount(4, HeightRangePlacementModifier.uniform(YOffset.getBottom(), YOffset.fixed(15))) - ); - PlacedFeatures.register( - featureRegisterable, - ORE_REDSTONE_LOWER, - registryEntry19, - modifiersWithCount(8, HeightRangePlacementModifier.trapezoid(YOffset.aboveBottom(-32), YOffset.aboveBottom(32))) - ); - PlacedFeatures.register( - featureRegisterable, - ORE_DIAMOND, - registryEntry20, - modifiersWithCount(7, HeightRangePlacementModifier.trapezoid(YOffset.aboveBottom(-80), YOffset.aboveBottom(80))) - ); - PlacedFeatures.register( - featureRegisterable, ORE_DIAMOND_MEDIUM, registryEntry21, modifiersWithCount(2, HeightRangePlacementModifier.uniform(YOffset.fixed(-64), YOffset.fixed(-4))) - ); - PlacedFeatures.register( - featureRegisterable, - ORE_DIAMOND_LARGE, - registryEntry22, - modifiersWithRarity(9, HeightRangePlacementModifier.trapezoid(YOffset.aboveBottom(-80), YOffset.aboveBottom(80))) - ); - PlacedFeatures.register( - featureRegisterable, - ORE_DIAMOND_BURIED, - registryEntry23, - modifiersWithCount(4, HeightRangePlacementModifier.trapezoid(YOffset.aboveBottom(-80), YOffset.aboveBottom(80))) - ); - PlacedFeatures.register( - featureRegisterable, ORE_LAPIS, registryEntry24, modifiersWithCount(2, HeightRangePlacementModifier.trapezoid(YOffset.fixed(-32), YOffset.fixed(32))) - ); - PlacedFeatures.register( - featureRegisterable, ORE_LAPIS_BURIED, registryEntry25, modifiersWithCount(4, HeightRangePlacementModifier.uniform(YOffset.getBottom(), YOffset.fixed(64))) - ); - PlacedFeatures.register( - featureRegisterable, ORE_INFESTED, registryEntry26, modifiersWithCount(14, HeightRangePlacementModifier.uniform(YOffset.getBottom(), YOffset.fixed(63))) - ); - PlacedFeatures.register( - featureRegisterable, ORE_EMERALD, registryEntry27, modifiersWithCount(100, HeightRangePlacementModifier.trapezoid(YOffset.fixed(-16), YOffset.fixed(480))) - ); - PlacedFeatures.register( - featureRegisterable, - ORE_ANCIENT_DEBRIS_LARGE, - registryEntry28, - SquarePlacementModifier.of(), - HeightRangePlacementModifier.trapezoid(YOffset.fixed(8), YOffset.fixed(24)), - BiomePlacementModifier.of() - ); - PlacedFeatures.register( - featureRegisterable, - ORE_DEBRIS_SMALL, - registryEntry29, - SquarePlacementModifier.of(), - PlacedFeatures.EIGHT_ABOVE_AND_BELOW_RANGE, - BiomePlacementModifier.of() - ); - PlacedFeatures.register( - featureRegisterable, ORE_COPPER, registryEntry30, modifiersWithCount(16, HeightRangePlacementModifier.trapezoid(YOffset.fixed(-16), YOffset.fixed(112))) - ); - PlacedFeatures.register( - featureRegisterable, - ORE_COPPER_LARGE, - registryEntry31, - modifiersWithCount(16, HeightRangePlacementModifier.trapezoid(YOffset.fixed(-16), YOffset.fixed(112))) - ); - PlacedFeatures.register(featureRegisterable, ORE_CLAY, registryEntry32, modifiersWithCount(46, PlacedFeatures.BOTTOM_TO_120_RANGE)); - } - -} diff --git a/src/main/java/com/equilibrium/mixin/oreGenerator/PlacedFeaturesMixin.java b/src/main/java/com/equilibrium/mixin/oreGenerator/PlacedFeaturesMixin.java deleted file mode 100644 index e182e58..0000000 --- a/src/main/java/com/equilibrium/mixin/oreGenerator/PlacedFeaturesMixin.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.equilibrium.mixin.oreGenerator; - -import net.minecraft.registry.Registerable; -import net.minecraft.world.gen.feature.*; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(PlacedFeatures.class) -public abstract class PlacedFeaturesMixin { - @Inject(method = "bootstrap",at = @At(value = "HEAD"),cancellable = true) - private static void bootstrap(Registerable featureRegisterable, CallbackInfo ci) { - ci.cancel(); -// OceanPlacedFeatures.bootstrap(featureRegisterable); -// UndergroundPlacedFeatures.bootstrap(featureRegisterable); -// EndPlacedFeatures.bootstrap(featureRegisterable); -// MiscPlacedFeatures.bootstrap(featureRegisterable); -// NetherPlacedFeatures.bootstrap(featureRegisterable); -// OrePlacedFeatures.bootstrap(featureRegisterable); -// TreePlacedFeatures.bootstrap(featureRegisterable); -// VegetationPlacedFeatures.bootstrap(featureRegisterable); -// VillagePlacedFeatures.bootstrap(featureRegisterable); - } -} diff --git a/src/main/java/com/equilibrium/mixin/player/PlayerEntityMixin.java b/src/main/java/com/equilibrium/mixin/player/PlayerEntityMixin.java index a989732..56e5f2d 100644 --- a/src/main/java/com/equilibrium/mixin/player/PlayerEntityMixin.java +++ b/src/main/java/com/equilibrium/mixin/player/PlayerEntityMixin.java @@ -1,15 +1,16 @@ package com.equilibrium.mixin.player; -import com.equilibrium.register.tags.ModBlockTags; -import com.equilibrium.register.tags.ModItemTags; +import com.equilibrium.event.MoonPhaseEvent; +import com.equilibrium.tags.ModItemTags; import com.equilibrium.util.PlayerMaxHealthHelper; import com.equilibrium.util.PlayerMaxHungerHelper; import com.equilibrium.util.ShouldSentText; +import com.equilibrium.util.WorldMoonPhasesSelector; +import com.mojang.authlib.GameProfile; import net.minecraft.block.BlockState; +import net.minecraft.client.world.ClientWorld; import net.minecraft.component.type.FoodComponent; -import net.minecraft.entity.EntityType; -import net.minecraft.entity.EquipmentSlot; -import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.*; import net.minecraft.entity.attribute.DefaultAttributeContainer; import net.minecraft.entity.attribute.EntityAttributes; import net.minecraft.entity.damage.DamageSource; @@ -17,17 +18,31 @@ import net.minecraft.entity.effect.StatusEffectUtil; import net.minecraft.entity.effect.StatusEffects; import net.minecraft.entity.player.HungerManager; +import net.minecraft.entity.player.PlayerAbilities; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.entity.projectile.FishingBobberEntity; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.nbt.NbtCompound; -import net.minecraft.registry.tag.BlockTags; -import net.minecraft.registry.tag.ItemTags; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.tag.FluidTags; +import net.minecraft.server.MinecraftServer; import net.minecraft.server.world.ServerWorld; +import net.minecraft.sound.SoundCategory; +import net.minecraft.sound.SoundEvent; import net.minecraft.sound.SoundEvents; import net.minecraft.text.Text; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; +import net.minecraft.world.GameRules; import net.minecraft.world.World; +import net.minecraft.world.dimension.DimensionType; +import net.minecraft.world.dimension.DimensionTypes; +import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Unique; @@ -36,8 +51,13 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import java.util.Objects; + +import static com.equilibrium.event.MoonPhaseEvent.*; import static com.equilibrium.util.IsMinable.getBlockHarvertLevel; import static com.equilibrium.util.IsMinable.getItemHarvertLevel; +import static java.lang.Math.max; +import static net.minecraft.util.math.MathHelper.nextBetween; @Mixin(PlayerEntity.class) //和源码构造方式一致,继承谁这里也跟着继承 @@ -90,7 +110,8 @@ public void setMalnourishedForSlowHealing(float factor) { @Shadow public abstract boolean damage(DamageSource source, float amount); - @Shadow public abstract float getBlockBreakingSpeed(BlockState block); + @Shadow + public abstract float getBlockBreakingSpeed(BlockState block); @Unique public int getPhytonutrient() { @@ -102,6 +123,12 @@ public void setEntityInteractBonus(float bonus) { this.entityInteractBonus = bonus; } + @Inject(method = "canHarvest", at = @At(value = "HEAD"), cancellable = true) + public void canHarvest(BlockState state, CallbackInfoReturnable cir) { + cir.cancel(); + cir.setReturnValue(true); + } + @Inject(method = "eatFood", at = @At(value = "HEAD")) public void eatFood(World world, ItemStack stack, FoodComponent foodComponent, CallbackInfoReturnable cir) { @@ -123,15 +150,47 @@ public void writeCustomDataToNbt(NbtCompound nbt, CallbackInfo ci) { nbt.putInt("Phytonutrient", (int) this.phytonutrient); } + + @Shadow + public double getEntityInteractionRange() { + return this.getAttributeValue(EntityAttributes.PLAYER_ENTITY_INTERACTION_RANGE); + } + @Inject(method = "jump", at = @At("TAIL")) public void jump(CallbackInfo ci) { - this.getMainHandStack().damage((int) (this.getMainHandStack().getMaxDamage()*0.25),this, EquipmentSlot.MAINHAND); +// this.getMainHandStack().damage((int) (this.getMainHandStack().getMaxDamage() * 0.25), this, EquipmentSlot.MAINHAND); +// this.sendMessage(Text.of(""+this.getEntityInteractionRange())); // if (!this.getWorld().isClient) { // this.sendMessage(Text.of("" + getPhytonutrient())); +// } +// ZombieEntity zombieEntity = new ZombieEntity(this.getWorld()); + +// int i = this.random.nextBetween(16,32); +// BlockPos blockpos1 = BlockPos.ofFloored(this.getPos().add(i,0,i)); +// BlockPos blockpos2 = BlockPos.ofFloored(this.getPos().add(i,0,-i)); +// BlockPos blockpos3 = BlockPos.ofFloored(this.getPos().add(-i,0,i)); +// BlockPos blockpos4 = BlockPos.ofFloored(this.getPos().add(-i,0,-i)); +// +// int j =this.random.nextBetween(1,4); +// switch (j) { +// case 1: +// zombieEntity.setOnGround(true, Vec3d.of(blockpos1)); +// break; +// case 2: +// zombieEntity.setOnGround(true, Vec3d.of(blockpos2)); +// break; +// case 3: +// zombieEntity.setOnGround(true, Vec3d.of(blockpos3)); +// break; +// case 4: +// zombieEntity.setOnGround(true, Vec3d.of(blockpos4)); +// break; +// default:zombieEntity.setOnGround(true, Vec3d.of(blockpos1)); // } } + //以下是修改方块交互距离 @Inject(method = "getBlockInteractionRange", at = @At("HEAD"), cancellable = true) public void getBlockInteractionRange(CallbackInfoReturnable cir) { @@ -145,23 +204,27 @@ public void getEntityInteractionRange(CallbackInfoReturnable cir) { ItemStack itemstack = this.getMainHandStack(); if (itemstack.isEnchantable()) { - if (itemstack.isIn(ItemTags.SHOVELS)) { + if (itemstack.isIn(ModItemTags.SHOVELS)) { //铲子 setEntityInteractBonus(0.75f); - } else if (itemstack.isIn(ItemTags.PICKAXES)) { + } else if (itemstack.isIn(ModItemTags.PICKAXES)) { //镐子 setEntityInteractBonus(0.75f); - } else if (itemstack.isIn(ItemTags.AXES)) { + } else if (itemstack.isIn(ModItemTags.AXES)) { //斧子 setEntityInteractBonus(0.75f); - } else if (itemstack.isIn(ItemTags.SWORDS)) { + } else if (itemstack.isIn(ModItemTags.SWORDS)) { //剑 setEntityInteractBonus(0.75f); - } else if (itemstack.isIn(ItemTags.HOES)) { + } else if (itemstack.isIn(ModItemTags.HOES)) { //锄头 setEntityInteractBonus(0.75f); - } else if(itemstack.isIn(ModItemTags.HATCHET)){ + //手斧 + } else if (itemstack.isIn(ModItemTags.HATCHET)) { setEntityInteractBonus(0.5f); + } else if (itemstack.isIn(ModItemTags.DAGGERS)) { + //小刀、匕首 + setEntityInteractBonus(0.35f); } } else if (itemstack.isOf(Items.STICK) || itemstack.isOf(Items.BONE)) { @@ -200,27 +263,69 @@ private static void createPlayerAttributes(CallbackInfoReturnable cir) { - + cir.cancel(); ItemStack stack = this.getMainHandStack(); - this.itemHarvest=getItemHarvertLevel(stack); - this.blockHarvest=getBlockHarvertLevel(block); - if(this.itemHarvest>=this.blockHarvest){ - cir.setReturnValue(speed * (0.025F) * (1 + this.experienceLevel * 0.02F)); - }else{ + float f = this.inventory.getBlockBreakingSpeed(block); + if (f > 1.0F) { + f += (float) this.getAttributeValue(EntityAttributes.PLAYER_MINING_EFFICIENCY); + } + + if (StatusEffectUtil.hasHaste(this)) { + f *= 1.0F + (float) (StatusEffectUtil.getHasteAmplifier(this) + 1) * 0.2F; + } + + if (this.hasStatusEffect(StatusEffects.MINING_FATIGUE)) { + f *= switch (this.getStatusEffect(StatusEffects.MINING_FATIGUE).getAmplifier()) { + case 0 -> 0.3F; + case 1 -> 0.09F; + case 2 -> 0.0027F; + default -> 8.1E-4F; + }; + } + + f *= (float) this.getAttributeValue(EntityAttributes.PLAYER_BLOCK_BREAK_SPEED); + if (this.isSubmergedIn(FluidTags.WATER)) { + f *= (float) this.getAttributeInstance(EntityAttributes.PLAYER_SUBMERGED_MINING_SPEED).getValue(); + } + + if (!this.isOnGround()) { + f /= 5.0F; + } + + + if (stack.isSuitableFor(block)) { + f = f * 4; + + } + + this.itemHarvest = getItemHarvertLevel(stack); + this.blockHarvest = getBlockHarvertLevel(block); + if (this.itemHarvest >= this.blockHarvest) { + + cir.setReturnValue(f * (0.040F) * (1 + this.experienceLevel * 0.02F)); + } else { cir.setReturnValue(0f); } @@ -281,11 +386,23 @@ public void canFoodHeal(CallbackInfoReturnable cir) { } + + + + //获取时间,得到月相,决定是否触发月相事件 + + private String moonType; + + //随机刻增益持续时长,用世界时间来记录是否过去了增益时间 + private long randomTickBonusStart; + private long randomTickBonusShouldEnd; + + + @Inject(method = "tick", at = @At("HEAD")) public void tick(CallbackInfo ci) { //刷新上限值,和Hud保持同步,都是1s20次刷新 refreshPlayerFoodLevelAndMaxHealth(); - if (!this.isCreative()) { //在tick中加入生命回复任务 int maxHealth = PlayerMaxHealthHelper.getMaxHealthLevel(); @@ -297,6 +414,99 @@ public void tick(CallbackInfo ci) { // MITEequilibrium.LOGGER.info("Natural Regeneration +1 "); } } + + + + //最好不要无条件地重复执行gamerule + moonType = getMoonType(this.getWorld()); + + if(moonType!=null) { + //需要获得最新的世界数据,把worldRegistryKey放到tick里面来 + RegistryKey worldRegistryKey = this.getWorld().getRegistryKey(); + + //随机刻速度检查,不是黄月或者蓝月就恢复默认的随机刻速度 + + //不在主世界,一定不能获得随机刻增益 + if (worldRegistryKey!=World.OVERWORLD && !this.getWorld().isClient) { + if (this.getWorld().getGameRules().getInt(GameRules.RANDOM_TICK_SPEED) != 3){ + this.sendMessage(Text.of("随机刻应该修改为3")); + RandomTickModifier((ServerWorld) this.getWorld(), 3); + } + } + //月相事件,只在主世界进行 + if (worldRegistryKey == World.OVERWORLD && !this.getWorld().isClient) { + + //普通月相且无随机刻修改逻辑 + boolean randomTickMoonType = (moonType.equals("blueMoon")) || (moonType.equals("harvestMoon")) || (moonType.equals("haloMoon")); + if (!randomTickMoonType) + if(this.getWorld().getGameRules().getInt(GameRules.RANDOM_TICK_SPEED)!=3){ +// RandomTickModifier((ServerWorld) this.getWorld(), ((ServerWorld) this.getWorld()).getPlayers().getFirst(), 3); + this.sendMessage(Text.of("随机刻应该修改为3")); + RandomTickModifier((ServerWorld) this.getWorld(), 3);} + + + //不是特殊月相,以下不执行 + //改进,月相用枚举类 + + + + + if (moonType.equals("bloodMoon")) { + //this.getWorld()一定是服务器世界 + if (this.age % 100 == 0) { + //执行间隔事件 + spawnMobNearPlayer((ServerWorld)this.getWorld()); + this.sendMessage(Text.of("血月升起,怪物刷新一次")); + } + if (this.age % this.random.nextBetween(50,64) == 0) { + //执行间隔事件 + controlWeather((ServerWorld) this.getWorld()); + this.sendMessage(Text.of("雷电事件")); + } + } + + + + + + + if (moonType.equals("harvestMoon") || (moonType.equals("haloMoon"))) { + if(this.getWorld().getGameRules().getInt(GameRules.RANDOM_TICK_SPEED)!=4) + RandomTickModifier((ServerWorld) this.getWorld(), 4); + if (this.age % 100 == 0) { + //执行间隔事件 + this.sendMessage(Text.of("黄月/幻月升起,触发事件")); + + } + } + if (moonType.equals("fullMoon")) { + if (this.age % 100 == 0) + this.sendMessage(Text.of("满月升起,触发事件")); + } + if (moonType.equals("newMoon")) { + if (this.age % 100 == 0) + this.sendMessage(Text.of("新月升起,触发事件")); + } + if (moonType.equals("blueMoon")) { + if(this.getWorld().getGameRules().getInt(GameRules.RANDOM_TICK_SPEED)!=5) + RandomTickModifier((ServerWorld) this.getWorld(), 5); + if (this.age % 1200 == 0) { + this.sendMessage(Text.of("蓝月升起,触发事件")); + ServerWorld serverWorld = (ServerWorld) this.getWorld(); + //执行间隔事件 + spawnAnimalNearPlayer(serverWorld); + } + //应该是用world.找到所有玩家,这里无非就是避免客户端世界直接转服务器世界造成崩溃 + //待改进:应该是this.getWorld,如果不是客户端世界再执行spawnAnimal方法 + + } + + + } + } + + + ShouldSentText.count++; if (!this.getWorld().isClient) { this.phytonutrient--; @@ -305,14 +515,14 @@ public void tick(CallbackInfo ci) { //溢出判断,大于192000就为192000,否则不动 this.phytonutrient = this.phytonutrient > 192000 ? 192000 : this.phytonutrient; //施加饥饿效果 - if (this.phytonutrient<100) { - if(!this.hasStatusEffect(StatusEffects.HUNGER)){ - StatusEffectInstance statusEffectInstance1 = new StatusEffectInstance(StatusEffects.HUNGER, -1,1, false,false,false); - StatusEffectUtil.addEffectToPlayersWithinDistance((ServerWorld) this.getWorld(), this, this.getPos(), 4, statusEffectInstance1,-1); + if (this.phytonutrient < 100) { + if (!this.hasStatusEffect(StatusEffects.HUNGER)) { + StatusEffectInstance statusEffectInstance1 = new StatusEffectInstance(StatusEffects.HUNGER, -1, 1, false, false, false); + StatusEffectUtil.addEffectToPlayersWithinDistance((ServerWorld) this.getWorld(), this, this.getPos(), 4, statusEffectInstance1, -1); } - }else{ - if(this.hasStatusEffect(StatusEffects.HUNGER)){ + } else { + if (this.hasStatusEffect(StatusEffects.HUNGER)) { this.removeStatusEffect(StatusEffects.HUNGER); } } @@ -337,11 +547,6 @@ public void setHealth(float health) { } - - - - - } diff --git a/src/main/java/com/equilibrium/mixin/player/PlayerManagerMixin.java b/src/main/java/com/equilibrium/mixin/player/PlayerManagerMixin.java index adf7bb1..8f07458 100644 --- a/src/main/java/com/equilibrium/mixin/player/PlayerManagerMixin.java +++ b/src/main/java/com/equilibrium/mixin/player/PlayerManagerMixin.java @@ -1,5 +1,6 @@ package com.equilibrium.mixin.player; +import com.equilibrium.constant.MaxCount; import com.equilibrium.util.PlayerMaxHealthHelper; import com.equilibrium.util.PlayerMaxHungerHelper; import net.minecraft.entity.effect.StatusEffectInstance; @@ -38,6 +39,11 @@ public void onPlayerConnect(ClientConnection connection, ServerPlayerEntity play LOGGER.info("When finishing connect,the player health level is "+player.getHealth()); + if(player.experienceLevel>50) + MaxCount.vanillaMaxCount=true; + else + MaxCount.vanillaMaxCount=false; + int initializedMaxHealth = player.experienceLevel >=35 ? 20 : 6 +(int)(player.experienceLevel/5)*2; PlayerMaxHealthHelper.setMaxHealthLevel(initializedMaxHealth); diff --git a/src/main/java/com/equilibrium/mixin/recipeModifier.java b/src/main/java/com/equilibrium/mixin/recipeModifier.java index 0803fa0..ccb4cee 100644 --- a/src/main/java/com/equilibrium/mixin/recipeModifier.java +++ b/src/main/java/com/equilibrium/mixin/recipeModifier.java @@ -1,6 +1,7 @@ package com.equilibrium.mixin; -import com.equilibrium.register.BlockInit; +import com.equilibrium.item.Tools; +import com.equilibrium.tags.ModItemTags; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.inventory.CraftingResultInventory; import net.minecraft.inventory.RecipeInputInventory; @@ -48,33 +49,53 @@ private static void updateResult( } } //合成表过滤器,按照物品频率排序 - if(itemStack.isOf(Items.WOODEN_SWORD)){ - itemStack = ItemStack.EMPTY; - } - if(itemStack.isOf(Items.WOODEN_AXE)){ - itemStack = ItemStack.EMPTY; - } - if(itemStack.isOf(Items.WOODEN_HOE)){ - itemStack = ItemStack.EMPTY; - } - if(itemStack.isOf(Items.WOODEN_PICKAXE)){ - itemStack = ItemStack.EMPTY; - } - if(itemStack.isOf(Items.STONE_SWORD)){ + + //先删除要移除的物品 + if(itemStack.isIn(ModItemTags.REMOVEITEM)) itemStack = ItemStack.EMPTY; + + + + + //斧子中,替换铁,金 + if(itemStack.isIn(ModItemTags.AXES)){ + if(itemStack.isOf(Items.IRON_AXE)) + itemStack = Tools.IRON_AXE.getDefaultStack(); + + if(itemStack.isOf(Items.GOLDEN_AXE)) + itemStack = Tools.GOLD_AXE.getDefaultStack(); } - if(itemStack.isOf(Items.STONE_PICKAXE)){ - itemStack = ItemStack.EMPTY; + + if(itemStack.isIn(ModItemTags.HOES)){ + if(itemStack.isOf(Items.IRON_HOE)) + itemStack = Tools.IRON_HOE.getDefaultStack(); + + if(itemStack.isOf(Items.GOLDEN_HOE)) + itemStack = Tools.GOLD_HOE.getDefaultStack(); } - if(itemStack.isOf(Items.STONE_AXE)){ - itemStack = ItemStack.EMPTY; + + if(itemStack.isIn(ModItemTags.SHOVELS)){ + if(itemStack.isOf(Items.IRON_SHOVEL)) + itemStack = Tools.IRON_AXE.getDefaultStack(); + + if(itemStack.isOf(Items.GOLDEN_SHOVEL)) + itemStack = Tools.GOLD_SHOVEL.getDefaultStack(); } - if(itemStack.isOf(Items.STONE_HOE)){ - itemStack = ItemStack.EMPTY; + + if(itemStack.isIn(ModItemTags.SWORDS)){ + if(itemStack.isOf(Items.IRON_SWORD)) + itemStack = Tools.IRON_SWORD.getDefaultStack(); + + if(itemStack.isOf(Items.GOLDEN_SWORD)) + itemStack = Tools.GOLD_SWORD.getDefaultStack(); } - if(itemStack.isOf(Items.STONE_SHOVEL)){ - itemStack = ItemStack.EMPTY; + if(itemStack.isIn(ModItemTags.PICKAXES)){ + if(itemStack.isOf(Items.IRON_PICKAXE)) + itemStack = Tools.IRON_PICKAXE.getDefaultStack(); + + if(itemStack.isOf(Items.GOLDEN_PICKAXE)) + itemStack = Tools.GOLD_PICKAXE.getDefaultStack(); } @@ -82,6 +103,7 @@ private static void updateResult( + resultInventory.setStack(0, itemStack); handler.setPreviousTrackedSlot(0, itemStack); serverPlayerEntity.networkHandler.sendPacket(new ScreenHandlerSlotUpdateS2CPacket(handler.syncId, handler.nextRevision(), 0, itemStack)); diff --git a/src/main/java/com/equilibrium/mixin/tables/AbstractFurnaceEntityMixin.java b/src/main/java/com/equilibrium/mixin/tables/AbstractFurnaceEntityMixin.java index ea4bc48..af172d0 100644 --- a/src/main/java/com/equilibrium/mixin/tables/AbstractFurnaceEntityMixin.java +++ b/src/main/java/com/equilibrium/mixin/tables/AbstractFurnaceEntityMixin.java @@ -2,8 +2,8 @@ import com.equilibrium.config.CommonConfig; -import com.equilibrium.register.BlockInit; -import com.equilibrium.worklevel.FurnaceIngredients; +import com.equilibrium.craft_time_register.BlockInit; +import com.equilibrium.craft_time_worklevel.FurnaceIngredients; import com.google.common.collect.Maps; import net.minecraft.SharedConstants; import net.minecraft.block.Block; diff --git a/src/main/java/com/equilibrium/mixin/tables/CraftingScreenHandlerMixin.java b/src/main/java/com/equilibrium/mixin/tables/CraftingScreenHandlerMixin.java index 360b750..dbd84b4 100644 --- a/src/main/java/com/equilibrium/mixin/tables/CraftingScreenHandlerMixin.java +++ b/src/main/java/com/equilibrium/mixin/tables/CraftingScreenHandlerMixin.java @@ -1,8 +1,8 @@ package com.equilibrium.mixin.tables; import com.equilibrium.config.CommonConfig; -import com.equilibrium.register.BlockInit; -import com.equilibrium.worklevel.CraftingIngredients; +import com.equilibrium.craft_time_register.BlockInit; +import com.equilibrium.craft_time_worklevel.CraftingIngredients; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.block.CraftingTableBlock; import net.minecraft.entity.player.PlayerEntity; diff --git a/src/main/java/com/equilibrium/mixin/tables/PlayerScreenHandlerMixin.java b/src/main/java/com/equilibrium/mixin/tables/PlayerScreenHandlerMixin.java index 21ed6a4..91f052e 100644 --- a/src/main/java/com/equilibrium/mixin/tables/PlayerScreenHandlerMixin.java +++ b/src/main/java/com/equilibrium/mixin/tables/PlayerScreenHandlerMixin.java @@ -1,10 +1,9 @@ package com.equilibrium.mixin.tables; -import com.equilibrium.register.BlockInit; +import com.equilibrium.craft_time_register.BlockInit; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.block.PillarBlock; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.inventory.CraftingInventory; import net.minecraft.inventory.CraftingResultInventory; import net.minecraft.inventory.Inventory; import net.minecraft.inventory.RecipeInputInventory; @@ -26,8 +25,6 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; import java.util.Optional; diff --git a/src/main/java/com/equilibrium/mixin/tool/PickaxeItemMixin.java b/src/main/java/com/equilibrium/mixin/tool/PickaxeItemMixin.java deleted file mode 100644 index 7c5306a..0000000 --- a/src/main/java/com/equilibrium/mixin/tool/PickaxeItemMixin.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.equilibrium.mixin.tool; - -import net.minecraft.block.Block; -import net.minecraft.enchantment.effect.entity.DamageEntityEnchantmentEffect; -import net.minecraft.entity.Entity; -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.damage.DamageSource; -import net.minecraft.item.*; -import net.minecraft.recipe.Ingredient; -import net.minecraft.registry.tag.BlockTags; -import net.minecraft.registry.tag.TagKey; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.Unique; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import static com.equilibrium.MITEequilibrium.LOGGER; - -@Mixin(PickaxeItem.class) -public abstract class PickaxeItemMixin extends MiningToolItem { - public PickaxeItemMixin(ToolMaterial toolMaterial, TagKey effectiveBlocks, Settings settings) { - super(toolMaterial, effectiveBlocks, settings); - } - - -} diff --git a/src/main/java/com/equilibrium/mixin/tool/ToolMaterialDurabilityMixin.java b/src/main/java/com/equilibrium/mixin/tool/ToolMaterialDurabilityMixin.java index d9983f7..da9a0d4 100644 --- a/src/main/java/com/equilibrium/mixin/tool/ToolMaterialDurabilityMixin.java +++ b/src/main/java/com/equilibrium/mixin/tool/ToolMaterialDurabilityMixin.java @@ -52,7 +52,7 @@ public abstract class ToolMaterialDurabilityMixin { @Inject(method = "getDurability",at = @At(value = "HEAD"),cancellable = true) public void getDurability(CallbackInfoReturnable cir) { - LOGGER.info(String.valueOf(this.inverseTag)); +// LOGGER.info(String.valueOf(this.inverseTag)); if (Objects.equals(String.valueOf(this.inverseTag), "TagKey[minecraft:block / minecraft:incorrect_for_wooden_tool]")) cir.setReturnValue(160); else if (Objects.equals(String.valueOf(this.inverseTag),"TagKey[minecraft:block / minecraft:incorrect_for_gold_tool]")) diff --git a/src/main/java/com/equilibrium/mixin/world/EditGameRulesScreenMixin.java b/src/main/java/com/equilibrium/mixin/world/EditGameRulesScreenMixin.java new file mode 100644 index 0000000..17d2781 --- /dev/null +++ b/src/main/java/com/equilibrium/mixin/world/EditGameRulesScreenMixin.java @@ -0,0 +1,59 @@ +package com.equilibrium.mixin.world; + +import com.google.common.collect.Sets; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.screen.world.EditGameRulesScreen; +import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.client.gui.widget.ClickableWidget; +import net.minecraft.client.gui.widget.DirectionalLayoutWidget; +import net.minecraft.client.gui.widget.ThreePartsLayoutWidget; +import net.minecraft.screen.ScreenTexts; +import net.minecraft.text.Text; +import net.minecraft.world.GameRules; +import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.*; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.util.Optional; +import java.util.Set; +import java.util.function.Consumer; + +@Mixin(EditGameRulesScreen.class) +public class EditGameRulesScreenMixin extends Screen { + @Shadow + private static final Text TITLE = Text.translatable("editGamerule.title"); + @Shadow + final ThreePartsLayoutWidget layout = new ThreePartsLayoutWidget(this); + @Shadow + @Final + private Consumer> ruleSaver; + @Shadow + @Final + private final Set invalidRuleWidgets = Sets.newHashSet(); + @Shadow + @Final + private GameRules gameRules; + @Shadow + private ButtonWidget doneButton; + @Shadow + private EditGameRulesScreen.RuleListWidget ruleListWidget; + protected EditGameRulesScreenMixin(Text title) { + super(title); + } + + + @Inject(method = "init",at = @At(value = "HEAD"), cancellable = true) + protected void init(CallbackInfo ci) { + ci.cancel(); + this.layout.addHeader(TITLE, this.textRenderer); + DirectionalLayoutWidget directionalLayoutWidget = this.layout.addFooter(DirectionalLayoutWidget.horizontal().spacing(8)); + this.doneButton = directionalLayoutWidget.add(ButtonWidget.builder(ScreenTexts.DONE, button -> this.ruleSaver.accept(Optional.of(this.gameRules))).build()); + directionalLayoutWidget.add(ButtonWidget.builder(ScreenTexts.CANCEL, button -> this.close()).build()); + this.layout.forEachChild(child -> { + ClickableWidget var10000 = this.addDrawableChild(child); + }); + this.initTabNavigation(); + } +} diff --git a/src/main/java/com/equilibrium/mixin/world/ServerWorldMixin.java b/src/main/java/com/equilibrium/mixin/world/ServerWorldMixin.java new file mode 100644 index 0000000..8f8dfce --- /dev/null +++ b/src/main/java/com/equilibrium/mixin/world/ServerWorldMixin.java @@ -0,0 +1,38 @@ +package com.equilibrium.mixin.world; + +import net.fabricmc.fabric.api.attachment.v1.AttachmentTarget; +import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents; +import net.minecraft.registry.DynamicRegistryManager; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.entry.RegistryEntry; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.util.profiler.Profiler; +import net.minecraft.world.GameRules; +import net.minecraft.world.MutableWorldProperties; +import net.minecraft.world.StructureWorldAccess; +import net.minecraft.world.World; +import net.minecraft.world.dimension.DimensionType; +import org.jetbrains.annotations.Nullable; +import org.objectweb.asm.Opcodes; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.util.function.BooleanSupplier; +import java.util.function.Supplier; + +@Mixin(ServerWorld.class) +public abstract class ServerWorldMixin extends World implements StructureWorldAccess, AttachmentTarget { + protected ServerWorldMixin(MutableWorldProperties properties, RegistryKey registryRef, DynamicRegistryManager registryManager, RegistryEntry dimensionEntry, Supplier profiler, boolean isClient, boolean debugWorld, long biomeAccess, int maxChainedNeighborUpdates) { + super(properties, registryRef, registryManager, dimensionEntry, profiler, isClient, debugWorld, biomeAccess, maxChainedNeighborUpdates); + + } + public void test(){ + + } + +} diff --git a/src/main/java/com/equilibrium/worldgen/ModPlacementGenerator.java b/src/main/java/com/equilibrium/ore_generator/ModPlacementGenerator.java similarity index 98% rename from src/main/java/com/equilibrium/worldgen/ModPlacementGenerator.java rename to src/main/java/com/equilibrium/ore_generator/ModPlacementGenerator.java index b18e984..304d06a 100644 --- a/src/main/java/com/equilibrium/worldgen/ModPlacementGenerator.java +++ b/src/main/java/com/equilibrium/ore_generator/ModPlacementGenerator.java @@ -1,7 +1,6 @@ -package com.equilibrium.worldgen; +package com.equilibrium.ore_generator; import net.fabricmc.fabric.api.biome.v1.BiomeModifications; -import net.fabricmc.fabric.api.biome.v1.BiomeSelectors; import net.minecraft.registry.RegistryKey; import net.minecraft.registry.RegistryKeys; import net.minecraft.util.Identifier; diff --git a/src/main/java/com/equilibrium/worldgen/UnderWorldDimensionOptions.java b/src/main/java/com/equilibrium/ore_generator/UnderWorldDimensionOptions.java similarity index 97% rename from src/main/java/com/equilibrium/worldgen/UnderWorldDimensionOptions.java rename to src/main/java/com/equilibrium/ore_generator/UnderWorldDimensionOptions.java index b0fad00..9630f15 100644 --- a/src/main/java/com/equilibrium/worldgen/UnderWorldDimensionOptions.java +++ b/src/main/java/com/equilibrium/ore_generator/UnderWorldDimensionOptions.java @@ -1,4 +1,4 @@ -package com.equilibrium.worldgen; +package com.equilibrium.ore_generator; import com.mojang.serialization.Codec; diff --git a/src/main/java/com/equilibrium/register/tags/ModItemTags.java b/src/main/java/com/equilibrium/register/tags/ModItemTags.java deleted file mode 100644 index 208cd2d..0000000 --- a/src/main/java/com/equilibrium/register/tags/ModItemTags.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.equilibrium.register.tags; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.registry.RegistryKeys; -import net.minecraft.registry.tag.ItemTags; -import net.minecraft.registry.tag.TagKey; -import net.minecraft.util.Identifier; - -public class ModItemTags { - - public static final TagKey HARVEST_ONE = of("tool_harvest_1"); - public static final TagKey HARVEST_TWO = of("tool_harvest_2"); - public static final TagKey HARVEST_THREE = of("tool_harvest_3"); - public static final TagKey HARVEST_FOUR = of("tool_harvest_4"); - - public static final TagKey HATCHET = of("hatchet"); - - public static final TagKey MINING_ENCHANTABLE = of("mining_enchantable"); - - - private static TagKey of(String id) { - return TagKey.of(RegistryKeys.ITEM, Identifier.of("miteequilibrium",id)); - } - - - public static void registerModItemTags(){ - } - -} diff --git a/src/main/java/com/equilibrium/register/tags/ModBlockTags.java b/src/main/java/com/equilibrium/tags/ModBlockTags.java similarity index 70% rename from src/main/java/com/equilibrium/register/tags/ModBlockTags.java rename to src/main/java/com/equilibrium/tags/ModBlockTags.java index 743eb05..8106432 100644 --- a/src/main/java/com/equilibrium/register/tags/ModBlockTags.java +++ b/src/main/java/com/equilibrium/tags/ModBlockTags.java @@ -1,4 +1,4 @@ -package com.equilibrium.register.tags; +package com.equilibrium.tags; import net.minecraft.block.Block; import net.minecraft.registry.RegistryKeys; @@ -9,20 +9,22 @@ public class ModBlockTags { public static final TagKey STONE_LIKE_240 = of("stone_like_240"); + public static final TagKey STONE_LIKE_360 = of("stone_like_360"); + public static final TagKey STONE_LIKE_480 = of("stone_like_480"); public static final TagKey LOG_120 = of("log_like_120"); - //1级采集等级,定义为原版可以空手采集但这里不行的方块 - public static final TagKey HARVEST_ONE = of("block_harvest_1"); - - + public static final TagKey NORMAL_60 = of("normal_60"); + public static final TagKey NORMAL_30 = of("normal_30"); + //1级采集等级,定义为原版可以空手采集但这里不行的方块 + public static final TagKey HARVEST_ONE = of("block_harvest_1"); public static final TagKey HARVEST_TWO = of("block_harvest_2"); public static final TagKey HARVEST_THREE = of("block_harvest_3"); public static final TagKey HARVEST_FOUR = of("block_harvest_4"); - + public static final TagKey HARVEST_FIVE = of("block_harvest_5"); private static TagKey of(String id) { return TagKey.of(RegistryKeys.BLOCK, Identifier.of("miteequilibrium",id)); } diff --git a/src/main/java/com/equilibrium/tags/ModItemTags.java b/src/main/java/com/equilibrium/tags/ModItemTags.java new file mode 100644 index 0000000..50221ed --- /dev/null +++ b/src/main/java/com/equilibrium/tags/ModItemTags.java @@ -0,0 +1,55 @@ +package com.equilibrium.tags; + +import net.minecraft.item.Item; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.tag.TagKey; +import net.minecraft.util.Identifier; + +public class ModItemTags { + + public static final TagKey HARVEST_ONE = of("tool_harvest_1"); + public static final TagKey HARVEST_TWO = of("tool_harvest_2"); + public static final TagKey HARVEST_THREE = of("tool_harvest_3"); + public static final TagKey HARVEST_FOUR = of("tool_harvest_4"); + public static final TagKey HARVEST_FIVE = of("tool_harvest_5"); + + + + + + + public static final TagKey HATCHET = of("hatchet"); + public static final TagKey AXES = of("axe"); + public static final TagKey PICKAXES = of("pickaxe"); + public static final TagKey SWORDS = of("sword"); + public static final TagKey HOES = of("hoe"); + public static final TagKey SHOVELS = of("shovel"); + public static final TagKey DAGGERS = of("dagger"); + + public static final TagKey REMOVEITEM = of("remove_item"); + + + + + public static final TagKey MINING_ENCHANTABLE = of("mining_enchantable"); + + public static final TagKey UNBREAKING = of("unbreaking"); + public static final TagKey UNBREAKING_ENCHANTABLE = of("unbreaking_enchantable"); + + //铁砧上可以生效的 + public static final TagKey FORTUNE = of("fortune"); + //只能在附魔台附魔的,应该是铁砧的子集 + public static final TagKey FORTUNE_ENCHANTABLE = of("fortune_enchantable"); + + public static final TagKey SILKTOUCH = of("silktouch.json"); + + + private static TagKey of(String id) { + return TagKey.of(RegistryKeys.ITEM, Identifier.of("miteequilibrium",id)); + } + + + public static void registerModItemTags(){ + } + +} diff --git a/src/main/java/com/equilibrium/util/CraftingDifficultyHelper.java b/src/main/java/com/equilibrium/util/CraftingDifficultyHelper.java index 1c01bb0..f12e7af 100644 --- a/src/main/java/com/equilibrium/util/CraftingDifficultyHelper.java +++ b/src/main/java/com/equilibrium/util/CraftingDifficultyHelper.java @@ -72,27 +72,27 @@ public static ArrayList getItemFromMatrix(AbstractRecipeScreenHandler