From 41dbc21a86cc787f1d297a766e655248df6ace6f Mon Sep 17 00:00:00 2001 From: YipKei <53115298+YipKei@users.noreply.github.com> Date: Fri, 19 Jul 2024 22:46:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96Mixin=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=8F=90=E9=AB=98=E5=8F=AF=E8=AF=BB=E6=80=A7=EF=BC=8C=E5=AE=9E?= =?UTF-8?q?=E8=A3=85=E5=89=AA=E5=88=80=E5=AF=B9=E8=98=91=E8=8F=87=E7=89=9B?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../3513c90cf19585ba85dce4bb4961dfc418764cbe | 2 +- .../4455c36134312040c3981d1a65d87410e591c38c | 2 +- .../46608147a03287dfdb8e0fa4f9102c4e2889225f | 3 +- .../4f22e9d501004ea65aac67eb84f633ec54fdd9e2 | 4 +- .../52b837f51544eeb314a89d0baa50276126ed9e15 | 2 +- .../6a7e12ea7cf1015f5401221fbb1c9800a2881825 | 2 +- .../cf36120aef76dfc9135b307737d1c5e76a54edb4 | 6 +- .../e764169a5e6dc427a404f8b7f74fc0c7b162a4f2 | 34 +++--- .../mixin/MooshroomEntityMixin.java | 105 ++---------------- .../mixin/PumpkinBlockMixin.java | 64 +++-------- .../mixin/SheepEntityMixin.java | 49 ++------ .../mixin/SpawnHelperMixin.java | 31 +++--- .../com/yipkei/vanilladdition/util/Head.java | 1 - .../resources/vanilla-addition.mixins.json | 2 + 14 files changed, 75 insertions(+), 232 deletions(-) diff --git a/src/main/generated/.cache/3513c90cf19585ba85dce4bb4961dfc418764cbe b/src/main/generated/.cache/3513c90cf19585ba85dce4bb4961dfc418764cbe index 60030af..c99b3d8 100644 --- a/src/main/generated/.cache/3513c90cf19585ba85dce4bb4961dfc418764cbe +++ b/src/main/generated/.cache/3513c90cf19585ba85dce4bb4961dfc418764cbe @@ -1,2 +1,2 @@ -// 1.21 2024-07-18T22:50:12.5410735 Vanilla Addition/Language (zh_hk) +// 1.21 2024-07-19T22:40:25.2626649 Vanilla Addition/Language (zh_hk) 35847c3e36eda9931f90170959ff99f57efb8a85 assets\vanilla-addition\lang\zh_hk.json diff --git a/src/main/generated/.cache/4455c36134312040c3981d1a65d87410e591c38c b/src/main/generated/.cache/4455c36134312040c3981d1a65d87410e591c38c index 22a9c6d..b226fc3 100644 --- a/src/main/generated/.cache/4455c36134312040c3981d1a65d87410e591c38c +++ b/src/main/generated/.cache/4455c36134312040c3981d1a65d87410e591c38c @@ -1,2 +1,2 @@ -// 1.21 2024-07-18T22:50:12.5540733 Vanilla Addition/Language (zh_cn) +// 1.21 2024-07-19T22:40:25.2724448 Vanilla Addition/Language (zh_cn) 169bffffdd54116a6725ebc958c12b2e11622de0 assets\vanilla-addition\lang\zh_cn.json diff --git a/src/main/generated/.cache/46608147a03287dfdb8e0fa4f9102c4e2889225f b/src/main/generated/.cache/46608147a03287dfdb8e0fa4f9102c4e2889225f index a570374..3463414 100644 --- a/src/main/generated/.cache/46608147a03287dfdb8e0fa4f9102c4e2889225f +++ b/src/main/generated/.cache/46608147a03287dfdb8e0fa4f9102c4e2889225f @@ -1,5 +1,6 @@ -// 1.21 2024-07-18T22:50:12.5390737 Vanilla Addition/Tags for minecraft:block +// 1.21 2024-07-19T22:40:25.2606633 Vanilla Addition/Tags for minecraft:block ff6f92a3e9ef8e4d51485509dae9a528c14c76a0 data\vanilla-addition\tags\block\nether_bricks.json +f8c69575215863c835f560299feeb75712ce6683 data\vanilla-addition\tags\block\bone_meal_drops_extra.json 34969052b498f41eaf578b7489231a8dd5ec55a2 data\minecraft\tags\block\beacon_base_blocks.json 96122621230a2112253efc3723f65deb6ee0fb48 data\vanilla-addition\tags\block\obsidian.json 714c14c7070725695cd2e6bb37596f00cedb300d data\vanilla-addition\tags\block\magical_girls_affectable.json diff --git a/src/main/generated/.cache/4f22e9d501004ea65aac67eb84f633ec54fdd9e2 b/src/main/generated/.cache/4f22e9d501004ea65aac67eb84f633ec54fdd9e2 index 980c377..756c551 100644 --- a/src/main/generated/.cache/4f22e9d501004ea65aac67eb84f633ec54fdd9e2 +++ b/src/main/generated/.cache/4f22e9d501004ea65aac67eb84f633ec54fdd9e2 @@ -1,4 +1,4 @@ -// 1.21 2024-07-18T22:50:12.5360735 Vanilla Addition/Block Loot Tables +// 1.21 2024-07-19T22:40:25.2577441 Vanilla Addition/Block Loot Tables 65582469a7435f6364ca0c189e06cc7497e76075 data\vanilla-addition\loot_table\blocks\ice_stairs.json 1a98f88a25643465c0404911c7ed52ac7b4c2d05 data\vanilla-addition\loot_table\blocks\magenta_concrete_stairs.json 8b11a61582f4250ff65fd05bb8861fa422d474c1 data\vanilla-addition\loot_table\blocks\packed_ice_slab.json @@ -114,8 +114,8 @@ cfa2395d19a6027aa08115446e03ed1110635a36 data\vanilla-addition\loot_table\blocks 42cadc72895dbf2b677f02c38ee18d7aa8cdb24e data\vanilla-addition\loot_table\blocks\netherrack_wall.json 26e3fb8a5c3375ef950836dea2dc3de3b94f4665 data\vanilla-addition\loot_table\blocks\lime_terracotta_stairs.json fa4f56668cd8730df5461f20903fd302092febc4 data\vanilla-addition\loot_table\blocks\blue_ice_stairs.json -dd809ebf9c33b91a7c6563bcd4109f671a6134b1 data\vanilla-addition\loot_table\blocks\polished_granite_wall.json b5247073b06ac3e33e65b2fb7bb23d4280698e7a data\vanilla-addition\loot_table\blocks\red_concrete_stairs.json +dd809ebf9c33b91a7c6563bcd4109f671a6134b1 data\vanilla-addition\loot_table\blocks\polished_granite_wall.json 553730d6f78c631cff8c4f99af162a17d8b887ae data\vanilla-addition\loot_table\blocks\lime_terracotta_wall.json 0c3b56d6187256b1981d85dbfd699e92bcdf6571 data\vanilla-addition\loot_table\blocks\light_gray_stairs.json 1997b34147da5083a55802457d5f1638e59a8c46 data\vanilla-addition\loot_table\blocks\cyan_concrete_wall.json diff --git a/src/main/generated/.cache/52b837f51544eeb314a89d0baa50276126ed9e15 b/src/main/generated/.cache/52b837f51544eeb314a89d0baa50276126ed9e15 index 7338b3e..f3384a6 100644 --- a/src/main/generated/.cache/52b837f51544eeb314a89d0baa50276126ed9e15 +++ b/src/main/generated/.cache/52b837f51544eeb314a89d0baa50276126ed9e15 @@ -1,2 +1,2 @@ -// 1.21 2024-07-18T22:50:12.5420738 Vanilla Addition/Language (en_us) +// 1.21 2024-07-19T22:40:25.2626649 Vanilla Addition/Language (en_us) ae6199d23e8ce566962a48aa70c9fd41823c46f6 assets\vanilla-addition\lang\en_us.json diff --git a/src/main/generated/.cache/6a7e12ea7cf1015f5401221fbb1c9800a2881825 b/src/main/generated/.cache/6a7e12ea7cf1015f5401221fbb1c9800a2881825 index 84a865a..8181d30 100644 --- a/src/main/generated/.cache/6a7e12ea7cf1015f5401221fbb1c9800a2881825 +++ b/src/main/generated/.cache/6a7e12ea7cf1015f5401221fbb1c9800a2881825 @@ -1,4 +1,4 @@ -// 1.21 2024-07-18T22:50:12.5470737 Vanilla Addition/Recipes +// 1.21 2024-07-19T22:40:25.2665606 Vanilla Addition/Recipes eaa9bfa0fc0031b7242c08fc7a9d2e7b5a83c5ea data\vanilla-addition\recipe\arms_up_pottery_sherd_prototype_from_arms_up_pottery_sherd_blueprint.json e5a0f5b8e7ff2d91d2f87e2d0cc175ce9572a468 data\vanilla-addition\advancement\recipes\misc\diamond_shovel_recycling_by_stone_hammer.json 84d107d13f3be57332a21a096fd8dac6db00c386 data\vanilla-addition\advancement\recipes\building_blocks\dark_oak_slab_from_stripped_dark_oak_log_stonecutting.json diff --git a/src/main/generated/.cache/cf36120aef76dfc9135b307737d1c5e76a54edb4 b/src/main/generated/.cache/cf36120aef76dfc9135b307737d1c5e76a54edb4 index 0a52ef7..3422b09 100644 --- a/src/main/generated/.cache/cf36120aef76dfc9135b307737d1c5e76a54edb4 +++ b/src/main/generated/.cache/cf36120aef76dfc9135b307737d1c5e76a54edb4 @@ -1,9 +1,9 @@ -// 1.21 2024-07-18T22:50:12.5400732 Vanilla Addition/Tags for minecraft:item +// 1.21 2024-07-19T22:40:25.2616703 Vanilla Addition/Tags for minecraft:item fdab8ddd5529ae14b26bc1853b004131135318a4 data\vanilla-addition\tags\item\diamond_like_ingredients.json f7c5163386ca4f6f59c115f8a2488784b9f15ce3 data\minecraft\tags\item\axes.json 8aa3f06d6014ada9ee223e82b5bd922b5de15818 data\minecraft\tags\item\chest_armor.json -c8dff9260a0d1578661497e8fa33098aa108664b data\minecraft\tags\item\swords.json 235f3bf8614616b6cd50b21268354ae7443870ea data\minecraft\tags\item\hoes.json +c8dff9260a0d1578661497e8fa33098aa108664b data\minecraft\tags\item\swords.json 0a1bbfa3dbf3eb7b01f833c956293490a7c7496f data\minecraft\tags\item\foot_armor.json 2829b3b7dd8fa4a1416f1dadb5b8763a96653ef3 data\vanilla-addition\tags\item\steel_tools.json 8cda0614724ff2d3771cb9987e19759dd204f0a6 data\minecraft\tags\item\shovels.json @@ -12,6 +12,6 @@ c8dff9260a0d1578661497e8fa33098aa108664b data\minecraft\tags\item\swords.json bda7abbcd04b86a26a7215fff613bbe542d39f18 data\vanilla-addition\tags\item\shears.json 877f533d26c14af5a05b6a1796a793825ec75b58 data\minecraft\tags\item\beacon_payment_items.json cf9cfe7cdb60b294c6438346aac9de5c1b3b0465 data\vanilla-addition\tags\item\quartz_block.json -fdc7d20edf8f651cff035db202810f5b2777b2d7 data\minecraft\tags\item\leg_armor.json afffedbfe1c369d27976e1b6f99618c5a6e2ae69 data\minecraft\tags\item\head_armor.json +fdc7d20edf8f651cff035db202810f5b2777b2d7 data\minecraft\tags\item\leg_armor.json 0da5cb7319d7dd28a8ef2167022fd35fae155a4d data\minecraft\tags\item\enchantable\durability.json diff --git a/src/main/generated/.cache/e764169a5e6dc427a404f8b7f74fc0c7b162a4f2 b/src/main/generated/.cache/e764169a5e6dc427a404f8b7f74fc0c7b162a4f2 index 3694787..fbe9c45 100644 --- a/src/main/generated/.cache/e764169a5e6dc427a404f8b7f74fc0c7b162a4f2 +++ b/src/main/generated/.cache/e764169a5e6dc427a404f8b7f74fc0c7b162a4f2 @@ -1,4 +1,4 @@ -// 1.21 2024-07-18T22:50:12.5420738 Vanilla Addition/Model Definitions +// 1.21 2024-07-19T22:40:25.2626649 Vanilla Addition/Model Definitions 28b4faa5e5d0a06aca9d634390b7f4a68e33e10d assets\vanilla-addition\models\block\yellow_terracotta_wall_inventory.json b267da6f5f6a2c11266371de6e944af2d1b5cf0b assets\vanilla-addition\models\block\orange_terracotta_stairs.json 7506a0f6edd24cc5b6b95a590d9a5ef5b1bbc82d assets\vanilla-addition\models\block\purple_terracotta_wall_inventory.json @@ -72,15 +72,15 @@ a9388fa86827109f1694904f6eec206801d422e1 assets\vanilla-addition\models\block\bl 40dcde349ea28e969e21e3add68fa77a0824e4c3 assets\vanilla-addition\blockstates\pink_terracotta_wall.json 183873f708661d6683be6b888746a52168e2b04f assets\vanilla-addition\models\item\pink_concrete_stairs.json 7a5ede0ddaa78c4dc65b3258ce9a3d7eee51bdfb assets\vanilla-addition\models\item\black_concrete_wall.json -0bb7c294da97e87e912cd328fc78bee6f0d0e608 assets\vanilla-addition\models\item\burn_pottery_sherd_blueprint.json 7c24538a2ee9baa37c0895f8a22b2abec5c56bee assets\vanilla-addition\models\block\amethyst_wall_inventory.json +0bb7c294da97e87e912cd328fc78bee6f0d0e608 assets\vanilla-addition\models\item\burn_pottery_sherd_blueprint.json 193db4b9ce920fca3c3a873c052390b8e04df2b4 assets\vanilla-addition\models\block\red_terracotta_stairs_inner.json 3e46dcb5b1fc4e873f4f0b03e1f288d255d59091 assets\vanilla-addition\models\item\smooth_stone_stairs.json f63999a085e1ab451819b0a0da12ab4a68660620 assets\vanilla-addition\models\item\amethyst_slab.json 4660a9f7724a32f01b6fffee3431043f328df9c4 assets\vanilla-addition\blockstates\light_blue_concrete_slab.json 523738775ab63e1de0381ef4a97ff736392bcba9 assets\vanilla-addition\models\item\orange_concrete_stairs.json -1aab1325f27ee155d1e9fc48655062fa8208e298 assets\vanilla-addition\models\item\white_concrete_slab.json caeb68098db97af1ca97d9ee36db882e8d27fa74 assets\minecraft\blockstates\light_blue_terracotta.json +1aab1325f27ee155d1e9fc48655062fa8208e298 assets\vanilla-addition\models\item\white_concrete_slab.json 8c3ceca15e012f8d41a79f10b7a435bed5849fb9 assets\vanilla-addition\models\item\light_gray_concrete_wall.json 28ea05d9fe441c8202a758b7449f150d0458ef9b assets\vanilla-addition\models\block\netherrack_wall_side.json a7a774263239c8c059614448c74e3fbe479d1dfe assets\vanilla-addition\models\block\glowstone_slab.json @@ -105,8 +105,8 @@ ddc8c7f23e2d5ed7715379c0bdb24b4efc2e08e5 assets\vanilla-addition\blockstates\pin a82c3a22dc27324df7a342127b74721091a28422 assets\vanilla-addition\models\item\yellow_concrete_slab.json 8c122a183c2cfd853640d5fb2b60cc25b7e98e89 assets\vanilla-addition\models\item\white_terracotta_stairs.json 8d3f7c4dfa0e96f1ec2edd7cc79409c0cd5e02f2 assets\vanilla-addition\models\block\smooth_sandstone_wall_side.json -d2db9cfc20c34b4afb99a37cc9001d54f8a3817d assets\minecraft\blockstates\purpur_block.json a88794da1e5de9bd1bc68aded34b055587fecd7c assets\vanilla-addition\blockstates\gray_terracotta_slab.json +d2db9cfc20c34b4afb99a37cc9001d54f8a3817d assets\minecraft\blockstates\purpur_block.json 62899f50db4484d080af1a1269ef6e5895f9def0 assets\vanilla-addition\models\block\cyan_concrete_wall_post.json 7ebfc4d1374507daa195c3bb72f8b2df0a79df49 assets\vanilla-addition\models\block\gray_concrete_slab.json 12d4dbe12cd11e1aa806ed6e18a749d3450af00b assets\vanilla-addition\models\block\light_gray_concrete_wall_side_tall.json @@ -186,8 +186,8 @@ ae9fa36a44293ed30092d1c4cafcfdb071024340 assets\vanilla-addition\models\item\cal 1119889c6614242d08661ff177ac2ed6d7b49dc0 assets\minecraft\blockstates\green_concrete.json c00dde6b416dbc740ebf10ce5fbf319b5f26cc14 assets\vanilla-addition\models\block\cyan_terracotta_stairs.json b4a6c06ba56331ff83de41558dd9efb48ddb9887 assets\vanilla-addition\models\block\amethyst_wall_post.json -e9ea8cd2c6109163c88cb39b3478de67c5308b7c assets\vanilla-addition\blockstates\blue_ice_stairs.json 561b0c0edfae957b611c0b93bce2b7b9cf0fe92f assets\vanilla-addition\blockstates\amethyst_slab.json +e9ea8cd2c6109163c88cb39b3478de67c5308b7c assets\vanilla-addition\blockstates\blue_ice_stairs.json 5f2f67ac2902b2aaefb8899ee18a822a7a3ede70 assets\vanilla-addition\models\item\blue_terracotta_slab.json eb01d2a403b631fff3d5d9df529c6dbbeddf57a4 assets\vanilla-addition\models\block\glowstone_wall_post.json fa0c24a440e1866ee12af1d493c642c3ab108ed2 assets\vanilla-addition\models\block\glowstone_stairs.json @@ -209,8 +209,8 @@ c0e411613d08f49967a09d82ac7499271823d340 assets\vanilla-addition\models\block\ma 5fc40396999843148d1944c9e08919c68402c711 assets\vanilla-addition\models\item\diamond_upgraded_axe.json 379fec45212dd09ca8bc3703bb4943380707feac assets\vanilla-addition\models\item\light_gray_slab.json 971f9effc0d72a0c9ec3d2ee55e83eb003eba0cd assets\vanilla-addition\models\block\polished_diorite_wall_inventory.json -8c38d6df02596fb2006e793f649f3af93052a05d assets\vanilla-addition\blockstates\light_gray_terracotta_stairs.json 80d39a1d91895445379dbb07ab16bcf4136603fa assets\vanilla-addition\blockstates\green_concrete_wall.json +8c38d6df02596fb2006e793f649f3af93052a05d assets\vanilla-addition\blockstates\light_gray_terracotta_stairs.json 6e9d18adcb3401c8cf681fafae3467d19e58991a assets\vanilla-addition\models\item\glass_pickaxe.json 0809079f37716853902a651c5ae1c4e90ea76ceb assets\vanilla-addition\models\block\gray_concrete_wall_post.json e66f874ee21bb21ec4c23dfb2dee3fa8787463f8 assets\vanilla-addition\models\item\glass_pickaxe_prototype.json @@ -349,10 +349,10 @@ af6b3c3b1eafa803722cc044ac68bbe50ef15059 assets\vanilla-addition\models\block\bl 529839c6c99b72ee31ef73b945d35f0fc6e92c16 assets\vanilla-addition\blockstates\red_terracotta_slab.json 9eda8233665c8520595b00f96fb9fdbc59446f66 assets\vanilla-addition\models\item\scrape_pottery_sherd_prototype.json 07bed14c0ddf48ac02caba43b55cbde84e9a217e assets\vanilla-addition\models\item\smooth_red_sandstone_wall.json -0b6d43f210446a333f36f2c8ea2e6c66e62b2bff assets\vanilla-addition\models\block\green_terracotta_stairs_outer.json 17e07ff7944c936ae97b95b9b9c974501017eaa5 assets\vanilla-addition\models\item\brown_terracotta_slab.json -b793ef4d57318f5aeaeefbcdee92d97bf7b53360 assets\vanilla-addition\blockstates\yellow_concrete_stairs.json +0b6d43f210446a333f36f2c8ea2e6c66e62b2bff assets\vanilla-addition\models\block\green_terracotta_stairs_outer.json c7606bce3beeffc3118ca1352a128476f6d132a2 assets\vanilla-addition\models\item\howl_pottery_sherd_blueprint.json +b793ef4d57318f5aeaeefbcdee92d97bf7b53360 assets\vanilla-addition\blockstates\yellow_concrete_stairs.json f949f998a4809c9d54b2da47a12e70885cdd3ab8 assets\vanilla-addition\models\block\blue_concrete_slab.json 963f355384501f20f01724ec2442d29e1c63cb17 assets\vanilla-addition\models\item\sheaf_pottery_sherd_blueprint.json b529042baabea3ccd077c4831b652bc5c6081ade assets\minecraft\blockstates\smooth_quartz.json @@ -370,8 +370,8 @@ a330d1c3f3b6ea5e6bb35e0d4a54ae2e1ba01c90 assets\vanilla-addition\models\block\gr f4d25b3dbdcdffc02a3109a6646c19a6f2007554 assets\minecraft\models\block\calcite.json ca981ae5cf5b80716e56fbf3d3c428dc9a40b2f2 assets\vanilla-addition\models\block\white_terracotta_wall_side_tall.json c73d6edcedd418d4929d180fb3a32dcac2d28fce assets\vanilla-addition\models\item\scrape_pottery_sherd_blueprint.json -1519a7670a4d4dc84774d0224d558017282c148f assets\vanilla-addition\models\block\stone_wall_side.json 205f90b0224cf03801fa1b25f8ed99e393e1b8d2 assets\vanilla-addition\models\block\magenta_concrete_slab_top.json +1519a7670a4d4dc84774d0224d558017282c148f assets\vanilla-addition\models\block\stone_wall_side.json 2dc69411663dadb9313c814294f40ecf7236855b assets\vanilla-addition\models\block\light_blue_concrete_wall_side_tall.json 7be9ea9a11d9113f29deed0c92a646011070c711 assets\vanilla-addition\models\block\gray_terracotta_stairs_outer.json 40dde9c8444326c3b6de61a2c609935b8e3421f3 assets\vanilla-addition\models\item\black_terracotta_slab.json @@ -469,8 +469,8 @@ dfb44029766b0dc44106a5fbcac6a59a2bc663c8 assets\vanilla-addition\models\block\cr c4acb0e0f69d80b70d8b63d38dbf7a5ed15f77a0 assets\minecraft\models\block\purpur_block.json 68adfe3d0b30d6ce92fd2dab0561bc4659accf51 assets\minecraft\blockstates\amethyst_block.json 8cceedc7099b0cf1e5b67a70df6cb1511bca35bc assets\vanilla-addition\models\block\clay_slab_top.json -3c43a9c78d0e84eff2d483cc01a1b68438c10f6b assets\minecraft\blockstates\orange_concrete.json 2c6f34826fb31dd21f7bedecf3c0eb178e6b9604 assets\minecraft\blockstates\light_gray_concrete.json +3c43a9c78d0e84eff2d483cc01a1b68438c10f6b assets\minecraft\blockstates\orange_concrete.json 836c73ecab7336a47e0640c9df5b8be912ae9189 assets\vanilla-addition\models\item\miner_pottery_sherd_prototype.json 4f8cbefd7818402667b7cebe67867d8fd36d54fa assets\vanilla-addition\models\block\crying_obsidian_wall_side_tall.json a88cbe2a3ae38508b8f1d75d30b4a745d70cde2c assets\vanilla-addition\models\item\steel_hoe.json @@ -573,8 +573,8 @@ dbfb0ce8b4a51343e28334d955d73099fc96b478 assets\vanilla-addition\models\block\pr 94a9cb6479e1f634d08c1b56234d4db685d7cc4d assets\vanilla-addition\blockstates\orange_concrete_stairs.json 05b813a6e99050f83114010231737dd60dc8f830 assets\vanilla-addition\models\block\blue_ice_wall_post.json b3f0453a0d359c575b6d8e890d28dddc652844ef assets\vanilla-addition\models\block\amethyst_stairs.json -905cc26da029394b931fafe285080e4bcb43d87b assets\vanilla-addition\models\block\light_blue_concrete_wall_post.json 6f2499ffd5ef9de273cd2b392fcf7822bbbe3a5c assets\vanilla-addition\models\item\roasted_rotten_flesh.json +905cc26da029394b931fafe285080e4bcb43d87b assets\vanilla-addition\models\block\light_blue_concrete_wall_post.json 3689c495a5e01a2e9d8cf058370c9153f228d559 assets\vanilla-addition\models\item\smooth_stone_wall.json a69acd7dabf8272cb19f4982e869ffa0531c2023 assets\vanilla-addition\models\block\blue_concrete_wall_side_tall.json 13f095b1a7578872db25ab6b7dd02254f4204926 assets\vanilla-addition\models\block\red_concrete_slab_top.json @@ -600,8 +600,8 @@ e7fde58f223e29300c1e24c86adfca00c8c3ca02 assets\vanilla-addition\models\item\red 16e6192019ed46f494a845f91fe8333ea5a3073f assets\vanilla-addition\models\block\stone_wall_side_tall.json 19daadb303c1ac651e33866a8cd695316bec347e assets\minecraft\blockstates\red_terracotta.json f1b3ec27ad761742a0af86b090118219a35d1f90 assets\vanilla-addition\models\item\angler_pottery_sherd_prototype.json -a0728eaee824b51f937fca5caf79d7c5ba282b9f assets\vanilla-addition\models\block\gray_terracotta_slab.json 38401973c70611783d2f103fc3b89ee693b90bb0 assets\vanilla-addition\models\block\packed_ice_slab_top.json +a0728eaee824b51f937fca5caf79d7c5ba282b9f assets\vanilla-addition\models\block\gray_terracotta_slab.json b7f69fad8306e79ddaff7a795797ea135ee51b1d assets\vanilla-addition\models\block\smooth_quartz_wall_side_tall.json 47d12c789398dded710e9586cac24eaf1862764b assets\minecraft\blockstates\pink_terracotta.json 41455f4365443458c7040e2e30f2b094c8a285d5 assets\vanilla-addition\models\block\brown_concrete_slab_top.json @@ -631,8 +631,8 @@ a7db9fc43c757944a211c0ca487785c3308895a7 assets\vanilla-addition\models\block\mu 7c8c6cc735a5e37d968b3f0fe583dc855b3137cf assets\vanilla-addition\models\block\yellow_concrete_stairs.json 869e5684189683e5ba7597ef55cb62dccd1a8e82 assets\vanilla-addition\models\block\smooth_basalt_stairs_outer.json e4e836df521c2a8c4dbb78702c9e1fc050bbc4f2 assets\vanilla-addition\models\block\packed_ice_stairs_outer.json -383e1074624f4b647e90230881f96b3cdfd463e7 assets\vanilla-addition\models\block\light_gray_terracotta_wall_post.json 8e930ee59442d6738a2799270360f96513df9475 assets\vanilla-addition\models\block\white_concrete_wall_post.json +383e1074624f4b647e90230881f96b3cdfd463e7 assets\vanilla-addition\models\block\light_gray_terracotta_wall_post.json b87d75a3c3d9705a48ceb06a5a54402017e5011e assets\minecraft\blockstates\mud.json e4fbb551b4440371c4e3d9f77382b096a404839f assets\vanilla-addition\models\item\ancient_prototype.json 309e5b520475828a723f0d16356c27bf3f1010e7 assets\minecraft\models\block\light_blue_terracotta.json @@ -665,8 +665,8 @@ c4eb954e1e2214c56446d752264575e2d031afa6 assets\vanilla-addition\models\item\lim 0d6e71e277377651c58822439ee0fba5d95aeeb8 assets\vanilla-addition\models\block\smooth_stone_stairs_inner.json a73be6114321412178ec2c0d608415bf4e42a3ad assets\vanilla-addition\models\block\magenta_concrete_wall_side_tall.json 24a4cc6d1014638853c619b710d95895536d7689 assets\vanilla-addition\models\item\gray_terracotta_slab.json -4a17c92ac0c239c80c967d51891901768877dae0 assets\vanilla-addition\blockstates\white_concrete_stairs.json fadbeb7e0d982f7badc18f828acc8901d93b249e assets\vanilla-addition\blockstates\amethyst_stairs.json +4a17c92ac0c239c80c967d51891901768877dae0 assets\vanilla-addition\blockstates\white_concrete_stairs.json f97d97c8471e81515686d2d6277117eaddde8dfd assets\vanilla-addition\models\block\purple_terracotta_slab_top.json 24546f395ccb02abc8027d86234449e5ced3afa2 assets\vanilla-addition\models\block\smooth_basalt_wall_side.json 39a761f695eece2a439a700344445df4b526b9de assets\vanilla-addition\models\item\pink_concrete_slab.json @@ -832,12 +832,12 @@ de0b5b78bad9fb5b8f8a8a749336326abda4f63b assets\vanilla-addition\models\block\pi df81d9ec8462d16cf11d6964e56d98cc12c35310 assets\vanilla-addition\models\block\smooth_sandstone_wall_inventory.json f97fbb9c9de58e0d48a99f80775afb7100166e48 assets\vanilla-addition\models\block\orange_concrete_stairs_inner.json a8fc46a7c6eb8e79e7e777c1bb107174466761a7 assets\vanilla-addition\models\block\blue_terracotta_wall_post.json -14f96b3b81db89a8572551e552f2701041ede3d5 assets\vanilla-addition\models\block\light_gray_terracotta_stairs_inner.json ab8fc9e7e5c2f4e2ba5704474d90ef370ca18706 assets\vanilla-addition\models\block\cyan_terracotta_slab_top.json +14f96b3b81db89a8572551e552f2701041ede3d5 assets\vanilla-addition\models\block\light_gray_terracotta_stairs_inner.json 818a256292b5a28e34231664ecfd2b1dc9b2f1d9 assets\vanilla-addition\models\item\suspicious_prototype.json 5a3b6e960dc48950cd453c970d1ebc5412a900d8 assets\vanilla-addition\models\block\lime_terracotta_wall_post.json -4bbcd09bc87b0980aef93ca2242d4980178cca5c assets\minecraft\blockstates\red_concrete.json 076b0cc6948d5fdbd575f001c8cba29daed31b45 assets\vanilla-addition\blockstates\lime_concrete_stairs.json +4bbcd09bc87b0980aef93ca2242d4980178cca5c assets\minecraft\blockstates\red_concrete.json 7f2f30e6d8f3000781578d3aba25690fcb3a32e3 assets\vanilla-addition\models\item\magenta_concrete_stairs.json 41eb2774c0aea65baa0c7c8280fa83192932cf96 assets\vanilla-addition\models\item\light_gray_terracotta_wall.json bcb6708e30f1f24702d77c6c2ab0bbcd9fd31509 assets\vanilla-addition\models\block\light_blue_concrete_wall_side.json @@ -902,8 +902,8 @@ b1c8ce9e3bdb0d74cf8a753386cc2bebd25f3794 assets\vanilla-addition\models\item\bla 35691fa9c475c606089423ef849d2d318bc2a14f assets\vanilla-addition\models\item\purple_concrete_stairs.json f4663460093cfe4f4184669326eb2253c893a84c assets\vanilla-addition\models\block\white_concrete_stairs_inner.json 44fb46bcf9bb05db083f6cfb05ce8ff34e6dff75 assets\vanilla-addition\blockstates\lime_terracotta_wall.json -879e6c9349b8937fd84a19aae66bba3c660eee5e assets\vanilla-addition\blockstates\clay_slab.json 018a4a7fc6c85d59c22d9b743803868267ca779c assets\vanilla-addition\blockstates\ice_wall.json +879e6c9349b8937fd84a19aae66bba3c660eee5e assets\vanilla-addition\blockstates\clay_slab.json 90c9637daa8d39f54be6b18e5232e684a0103fb5 assets\vanilla-addition\models\block\brown_terracotta_stairs_inner.json 47b7c3820b4efba4eb10f15e02396d7f14eb3576 assets\vanilla-addition\blockstates\yellow_concrete_wall.json e640b5b57b090ea9936476687e184a6078fe307c assets\minecraft\models\block\mud.json diff --git a/src/main/java/com/yipkei/vanilladdition/mixin/MooshroomEntityMixin.java b/src/main/java/com/yipkei/vanilladdition/mixin/MooshroomEntityMixin.java index 7d2ffb7..51e909b 100644 --- a/src/main/java/com/yipkei/vanilladdition/mixin/MooshroomEntityMixin.java +++ b/src/main/java/com/yipkei/vanilladdition/mixin/MooshroomEntityMixin.java @@ -1,115 +1,26 @@ package com.yipkei.vanilladdition.mixin; +import com.llamalad7.mixinextras.sugar.Local; +import com.llamalad7.mixinextras.sugar.ref.LocalRef; import com.yipkei.vanilladdition.util.ModTags; -import net.minecraft.entity.EntityType; -import net.minecraft.entity.Shearable; -import net.minecraft.entity.VariantHolder; -import net.minecraft.entity.passive.CowEntity; import net.minecraft.entity.passive.MooshroomEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; -import net.minecraft.sound.SoundCategory; +import net.minecraft.item.Items; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; -import net.minecraft.world.World; -import net.minecraft.world.event.GameEvent; 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; -@Deprecated @Mixin(MooshroomEntity.class) -public abstract class MooshroomEntityMixin extends CowEntity - implements Shearable, VariantHolder { - protected MooshroomEntityMixin(EntityType entityType, World world) { - super(entityType, world); - } - - - - @Shadow - public abstract boolean isShearable(); +public abstract class MooshroomEntityMixin{ - @Shadow public abstract void sheared(SoundCategory shearedSoundCategory); - - - @Inject(method = "interactMob", at = @At("HEAD"), cancellable = true) - private void checkSteelShears(PlayerEntity player, Hand hand, CallbackInfoReturnable ci){ - ItemStack itemStack = player.getStackInHand(hand); - if (itemStack.isIn(ModTags.Items.SHEARS) && this.isShearable()){ - this.sheared(SoundCategory.PLAYERS); - this.emitGameEvent(GameEvent.SHEAR, player); - if (!this.getWorld().isClient) { - itemStack.damage(1, player, getSlotForHand(hand)); - } - ci.setReturnValue(ActionResult.success(this.getWorld().isClient)); + @Inject(method = "interactMob", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;isOf(Lnet/minecraft/item/Item;)Z")) + private void changeShears(PlayerEntity player, Hand hand, CallbackInfoReturnable cir, @Local LocalRef itemStackLocalRef){ + if (itemStackLocalRef.get().isIn(ModTags.Items.SHEARS)){ + itemStackLocalRef.set(new ItemStack(Items.SHEARS)); } } - -// /** -// * @author YipKei -// * @reason The original method cannot accept custom Shears. -// */ -// @Overwrite -// public ActionResult interactMob(PlayerEntity player, Hand hand) { -// ItemStack itemStack = player.getStackInHand(hand); -// if (itemStack.isOf(Items.BOWL) && !this.isBaby()) { -// boolean bl = false; -// ItemStack itemStack2; -// if (this.stewEffects != null) { -// bl = true; -// itemStack2 = new ItemStack(Items.SUSPICIOUS_STEW); -// itemStack2.set(DataComponentTypes.SUSPICIOUS_STEW_EFFECTS, this.stewEffects); -// this.stewEffects = null; -// } else { -// itemStack2 = new ItemStack(Items.MUSHROOM_STEW); -// } -// -// ItemStack itemStack3 = ItemUsage.exchangeStack(itemStack, player, itemStack2, false); -// player.setStackInHand(hand, itemStack3); -// SoundEvent soundEvent; -// if (bl) { -// soundEvent = SoundEvents.ENTITY_MOOSHROOM_SUSPICIOUS_MILK; -// } else { -// soundEvent = SoundEvents.ENTITY_MOOSHROOM_MILK; -// } -// -// this.playSound(soundEvent, 1.0F, 1.0F); -// return ActionResult.success(this.getWorld().isClient); -// } else if (itemStack.isIn(ModTags.Items.SHEARS) && this.isShearable()) { -// this.sheared(SoundCategory.PLAYERS); -// this.emitGameEvent(GameEvent.SHEAR, player); -// if (!this.getWorld().isClient) { -// itemStack.damage(1, player, getSlotForHand(hand)); -// } -// -// return ActionResult.success(this.getWorld().isClient); -// } else if (this.getVariant() == MooshroomEntity.Type.BROWN && itemStack.isIn(ItemTags.SMALL_FLOWERS)) { -// if (this.stewEffects != null) { -// for(int i = 0; i < 2; ++i) { -// this.getWorld().addParticle(ParticleTypes.SMOKE, this.getX() + this.random.nextDouble() / 2.0, this.getBodyY(0.5), this.getZ() + this.random.nextDouble() / 2.0, 0.0, this.random.nextDouble() / 5.0, 0.0); -// } -// } else { -// Optional optional = this.getStewEffectFrom(itemStack); -// if (optional.isEmpty()) { -// return ActionResult.PASS; -// } -// -// itemStack.decrementUnlessCreative(1, player); -// -// for(int j = 0; j < 4; ++j) { -// this.getWorld().addParticle(ParticleTypes.EFFECT, this.getX() + this.random.nextDouble() / 2.0, this.getBodyY(0.5), this.getZ() + this.random.nextDouble() / 2.0, 0.0, this.random.nextDouble() / 5.0, 0.0); -// } -// -// this.stewEffects = (SuspiciousStewEffectsComponent)optional.get(); -// this.playSound(SoundEvents.ENTITY_MOOSHROOM_EAT, 2.0F, 1.0F); -// } -// -// return ActionResult.success(this.getWorld().isClient); -// } else { -// return super.interactMob(player, hand); -// } -// } } diff --git a/src/main/java/com/yipkei/vanilladdition/mixin/PumpkinBlockMixin.java b/src/main/java/com/yipkei/vanilladdition/mixin/PumpkinBlockMixin.java index 5ff7c67..339252f 100644 --- a/src/main/java/com/yipkei/vanilladdition/mixin/PumpkinBlockMixin.java +++ b/src/main/java/com/yipkei/vanilladdition/mixin/PumpkinBlockMixin.java @@ -1,75 +1,39 @@ package com.yipkei.vanilladdition.mixin; +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; import com.yipkei.vanilladdition.util.ModTags; import net.minecraft.block.*; -import net.minecraft.entity.ItemEntity; -import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; -import net.minecraft.item.Items; -import net.minecraft.sound.SoundCategory; -import net.minecraft.sound.SoundEvents; -import net.minecraft.stat.Stats; import net.minecraft.util.Hand; import net.minecraft.util.ItemActionResult; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; import net.minecraft.world.World; -import net.minecraft.world.event.GameEvent; 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(PumpkinBlock.class) -public abstract class PumpkinBlockMixin extends Block { +public abstract class PumpkinBlockMixin extends Block{ + public PumpkinBlockMixin(Settings settings) { super(settings); } - @Inject(method = "onUseWithItem",at = @At("HEAD"), cancellable = true) - private void checkSteelShears(ItemStack stack, BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit, CallbackInfoReturnable ci){ - if (stack.isIn(ModTags.Items.SHEARS)){ - if (world.isClient){ - ci.setReturnValue(ItemActionResult.success(world.isClient)); - } - Direction direction = hit.getSide(); - Direction direction2 = direction.getAxis() == Direction.Axis.Y ? player.getHorizontalFacing().getOpposite() : direction; - world.playSound(null, pos, SoundEvents.BLOCK_PUMPKIN_CARVE, SoundCategory.BLOCKS, 1.0f, 1.0f); - world.setBlockState(pos, Blocks.CARVED_PUMPKIN.getDefaultState().with(CarvedPumpkinBlock.FACING, direction2), Block.NOTIFY_ALL_AND_REDRAW); - ItemEntity itemEntity = new ItemEntity(world, (double)pos.getX() + 0.5 + (double)direction2.getOffsetX() * 0.65, (double)pos.getY() + 0.1, (double)pos.getZ() + 0.5 + (double)direction2.getOffsetZ() * 0.65, new ItemStack(Items.PUMPKIN_SEEDS, 4)); - itemEntity.setVelocity(0.05 * (double)direction2.getOffsetX() + world.random.nextDouble() * 0.02, 0.05, 0.05 * (double)direction2.getOffsetZ() + world.random.nextDouble() * 0.02); - world.spawnEntity(itemEntity); - stack.damage(1, player, LivingEntity.getSlotForHand(hand)); - world.emitGameEvent(player, GameEvent.SHEAR, pos); - player.incrementStat(Stats.USED.getOrCreateStat(Items.SHEARS)); - ci.setReturnValue(ItemActionResult.success(world.isClient)); + @Inject(method = "onUseWithItem", at = @At("HEAD"), cancellable = true) + private void checkCorrectItem(ItemStack stack, BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit, CallbackInfoReturnable cir){ + if (!stack.isIn(ModTags.Items.SHEARS)){ + cir.setReturnValue(super.onUseWithItem(stack, state, world, pos, player, hand, hit)); } } -// /** -// * @author YipKei -// * @reason The original method cannot accept custom Shears. -// */ -// @Overwrite -// public ItemActionResult onUseWithItem(ItemStack stack, BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { -// if (!stack.isIn(ModTags.Items.SHEARS)) { -// return super.onUseWithItem(stack, state, world, pos, player, hand, hit); -// } -// if (world.isClient) { -// return ItemActionResult.success(world.isClient); -// } -// Direction direction = hit.getSide(); -// Direction direction2 = direction.getAxis() == Direction.Axis.Y ? player.getHorizontalFacing().getOpposite() : direction; -// world.playSound(null, pos, SoundEvents.BLOCK_PUMPKIN_CARVE, SoundCategory.BLOCKS, 1.0f, 1.0f); -// world.setBlockState(pos, Blocks.CARVED_PUMPKIN.getDefaultState().with(CarvedPumpkinBlock.FACING, direction2), Block.NOTIFY_ALL_AND_REDRAW); -// ItemEntity itemEntity = new ItemEntity(world, (double)pos.getX() + 0.5 + (double)direction2.getOffsetX() * 0.65, (double)pos.getY() + 0.1, (double)pos.getZ() + 0.5 + (double)direction2.getOffsetZ() * 0.65, new ItemStack(Items.PUMPKIN_SEEDS, 4)); -// itemEntity.setVelocity(0.05 * (double)direction2.getOffsetX() + world.random.nextDouble() * 0.02, 0.05, 0.05 * (double)direction2.getOffsetZ() + world.random.nextDouble() * 0.02); -// world.spawnEntity(itemEntity); -// stack.damage(1, player, LivingEntity.getSlotForHand(hand)); -// world.emitGameEvent(player, GameEvent.SHEAR, pos); -// player.incrementStat(Stats.USED.getOrCreateStat(Items.SHEARS)); -// return ItemActionResult.success(world.isClient); -// } + @ModifyExpressionValue( + method = "onUseWithItem", + at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;isOf(Lnet/minecraft/item/Item;)Z") + ) + private boolean replaceCheck(boolean isShears){ + return true; + } } diff --git a/src/main/java/com/yipkei/vanilladdition/mixin/SheepEntityMixin.java b/src/main/java/com/yipkei/vanilladdition/mixin/SheepEntityMixin.java index 944fffc..c715053 100644 --- a/src/main/java/com/yipkei/vanilladdition/mixin/SheepEntityMixin.java +++ b/src/main/java/com/yipkei/vanilladdition/mixin/SheepEntityMixin.java @@ -1,19 +1,16 @@ package com.yipkei.vanilladdition.mixin; +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; import com.yipkei.vanilladdition.util.ModTags; import net.minecraft.entity.EntityType; import net.minecraft.entity.Shearable; import net.minecraft.entity.passive.AnimalEntity; import net.minecraft.entity.passive.SheepEntity; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.item.ItemStack; -import net.minecraft.sound.SoundCategory; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; import net.minecraft.world.World; -import net.minecraft.world.event.GameEvent; 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; @@ -21,48 +18,20 @@ @Mixin(SheepEntity.class) public abstract class SheepEntityMixin extends AnimalEntity implements Shearable { - - @Shadow public abstract boolean isShearable(); - - @Shadow public abstract void sheared(SoundCategory shearedSoundCategory); - protected SheepEntityMixin(EntityType entityType, World world) { super(entityType, world); } - - @Inject(method = "interactMob", at = @At( value = "HEAD" ), cancellable = true) - private void checkSteelShears(PlayerEntity player, Hand hand, CallbackInfoReturnable ci){ - ItemStack itemStack = player.getStackInHand(hand); - if (itemStack.isIn(ModTags.Items.SHEARS)){ - if (!this.getWorld().isClient && this.isShearable()){ - this.sheared(SoundCategory.PLAYERS); - this.emitGameEvent(GameEvent.SHEAR, player); - itemStack.damage(1, player, getSlotForHand(hand)); - ci.setReturnValue(ActionResult.SUCCESS); - } + private void checkCorrectItem(PlayerEntity player, Hand hand, CallbackInfoReturnable ci){ + if (!player.getStackInHand(hand).isIn(ModTags.Items.SHEARS)){ + ci.setReturnValue(super.interactMob(player,hand)); } } -// /** -// * @author YipKei -// * @reason The original method cannot accept custom Shears. -// */ -// @Overwrite -// public ActionResult interactMob(PlayerEntity player, Hand hand){ -// ItemStack itemStack = player.getStackInHand(hand); -// if (itemStack.isIn(ModTags.Items.SHEARS)) { -// if (!this.getWorld().isClient && this.isShearable()) { -// this.sheared(SoundCategory.PLAYERS); -// this.emitGameEvent(GameEvent.SHEAR, player); -// itemStack.damage(1, player, getSlotForHand(hand)); -// return ActionResult.SUCCESS; -// } else { -// return ActionResult.CONSUME; -// } -// } else { -// return super.interactMob(player, hand); -// } -// } + @ModifyExpressionValue(method = "interactMob", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;isOf(Lnet/minecraft/item/Item;)Z")) + private boolean replaceCheck(boolean isShears){ + return true; + } + } diff --git a/src/main/java/com/yipkei/vanilladdition/mixin/SpawnHelperMixin.java b/src/main/java/com/yipkei/vanilladdition/mixin/SpawnHelperMixin.java index cbf189a..bd65b85 100644 --- a/src/main/java/com/yipkei/vanilladdition/mixin/SpawnHelperMixin.java +++ b/src/main/java/com/yipkei/vanilladdition/mixin/SpawnHelperMixin.java @@ -1,33 +1,30 @@ package com.yipkei.vanilladdition.mixin; +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; import com.yipkei.vanilladdition.util.ModTags; import net.minecraft.entity.SpawnGroup; -import net.minecraft.registry.RegistryKeys; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; import net.minecraft.world.SpawnHelper; import net.minecraft.world.gen.StructureAccessor; -import net.minecraft.world.gen.structure.Structure; -import net.minecraft.world.gen.structure.StructureKeys; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(SpawnHelper.class) public class SpawnHelperMixin { - /** - * @author YipKei - * @reason Add NetherFortress Spawn Blocks - */ - @Overwrite - public static boolean shouldUseNetherFortressSpawns(BlockPos pos, ServerWorld world, SpawnGroup spawnGroup, StructureAccessor structureAccessor) { - if (spawnGroup != SpawnGroup.MONSTER || !world.getBlockState(pos.down()).isIn(ModTags.Blocks.NETHER_BRICKS)) { - return false; + @Inject(method = "shouldUseNetherFortressSpawns",at = @At("HEAD"), cancellable = true) + private static void addNewJudgment(BlockPos pos, ServerWorld world, SpawnGroup spawnGroup, StructureAccessor structureAccessor, CallbackInfoReturnable cir){ + if (spawnGroup != SpawnGroup.MONSTER || !world.getBlockState(pos.down()).isIn(ModTags.Blocks.NETHER_FORTRESS_CAN_SPAWNS)) { + cir.setReturnValue(false); } - Structure structure = structureAccessor.getRegistryManager().get(RegistryKeys.STRUCTURE).get(StructureKeys.FORTRESS); - if (structure == null) { - return false; - } - return structureAccessor.getStructureAt(pos, structure).hasChildren(); } + + @ModifyExpressionValue(method = "shouldUseNetherFortressSpawns", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BlockState;isOf(Lnet/minecraft/block/Block;)Z")) + private static boolean replaceCheck(boolean isNetherBricks){ + return true; + } + } diff --git a/src/main/java/com/yipkei/vanilladdition/util/Head.java b/src/main/java/com/yipkei/vanilladdition/util/Head.java index 9676592..6a9f31e 100644 --- a/src/main/java/com/yipkei/vanilladdition/util/Head.java +++ b/src/main/java/com/yipkei/vanilladdition/util/Head.java @@ -6,7 +6,6 @@ import com.mojang.authlib.yggdrasil.ProfileResult; import net.minecraft.block.Block; import net.minecraft.block.BlockState; -import net.minecraft.block.Blocks; import net.minecraft.component.DataComponentTypes; import net.minecraft.component.type.ProfileComponent; import net.minecraft.item.ItemStack; diff --git a/src/main/resources/vanilla-addition.mixins.json b/src/main/resources/vanilla-addition.mixins.json index df8dbf4..7421f8d 100644 --- a/src/main/resources/vanilla-addition.mixins.json +++ b/src/main/resources/vanilla-addition.mixins.json @@ -3,7 +3,9 @@ "package": "com.yipkei.vanilladdition.mixin", "compatibilityLevel": "JAVA_21", "mixins": [ + "BoneMealItemMixin", "EnderDragonFightMixin", + "MooshroomEntityMixin", "PumpkinBlockMixin", "SheepEntityMixin", "SpawnHelperMixin"