From bd83d6c4e3c1a6ac3abd099b63df7c0c5f414895 Mon Sep 17 00:00:00 2001 From: Leo Lezury <68064905+LeoLezury@users.noreply.github.com> Date: Wed, 17 Jul 2024 12:19:23 +0800 Subject: [PATCH] mace --- gradle.properties | 2 +- .../1bda0eb39dbc3800081e5f8528c492e5d2ac1dc9 | 4 +- .../2db82bc4898868f7eec79958ed07d46c99c9af46 | 8 +- .../9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e | 22 +++-- .../aec9b27ab4b41731e7cef8638cc084f67472833b | 3 + .../b9473a7920e150f1fd90d60adffdd8557dd85fef | 11 ++- .../e31f75891746f095f78065a964298b59b7cd2c16 | 4 +- .../assets/assorted_armaments/lang/en_us.json | 11 ++- .../assets/assorted_armaments/lang/zh_cn.json | 13 ++- .../models/item/diamond_mace.json | 6 ++ .../models/item/golden_mace.json | 6 ++ .../models/item/iron_mace.json | 6 ++ .../models/item/netherite_mace.json | 6 ++ .../models/item/stone_mace.json | 6 ++ .../models/item/wooden_mace.json | 6 ++ .../recipes/combat/diamond_mace.json | 32 ++++++++ .../recipes/combat/golden_mace.json | 32 ++++++++ .../advancement/recipes/combat/iron_mace.json | 32 ++++++++ .../combat/netherite_mace_smithing.json | 32 ++++++++ .../recipes/combat/stone_mace.json | 32 ++++++++ .../recipes/combat/wooden_mace.json | 32 ++++++++ .../misc/gold_nugget_from_smelting.json | 13 ++- .../misc/iron_nugget_from_smelting.json | 13 ++- .../recipe/diamond_mace.json | 21 +++++ .../recipe/gold_nugget_from_smelting.json | 11 ++- .../recipe/golden_mace.json | 21 +++++ .../assorted_armaments/recipe/iron_mace.json | 21 +++++ .../recipe/iron_nugget_from_smelting.json | 11 ++- .../recipe/netherite_mace_smithing.json | 16 ++++ .../assorted_armaments/recipe/stone_mace.json | 21 +++++ .../recipe/wooden_mace.json | 21 +++++ .../tags/entity_type/piglins.json | 7 ++ .../tags/entity_type/zombies.json | 7 ++ .../tags/item/armor_based_damage.json | 5 ++ .../disabled_when_disabling_blocking.json | 6 ++ .../item/disables_blocking_on_attack.json | 5 ++ .../tags/item/extra_knockback.json | 5 ++ .../assorted_armaments/tags/item/maces.json | 10 +++ .../tags/item/piglins_can_use.json | 6 ++ .../tags/item/zombies_can_use.json | 6 ++ .../tags/item/enchantable/sword.json | 5 ++ .../minecraft/tags/item/piglin_loved.json | 6 ++ .../assortedarmaments/AACommonConfig.java | 28 +++++-- .../data/gen/AARecipeProvider.java | 37 ++++++++- .../data/gen/DataGenerators.java | 2 + .../gen/lang/AAChineseLanguageProvider.java | 14 +++- .../gen/lang/AAEnglishLanguageProvider.java | 12 ++- .../data/gen/model/AAItemModelProvider.java | 7 ++ .../data/gen/tags/AAEntityTagsProvider.java | 31 +++++++ .../data/gen/tags/AAItemTagsProvider.java | 26 ++++++ .../event/AACommonEvents.java | 77 ++++++++++++++++-- .../assortedarmaments/item/MaceItem.java | 44 ++++++++++ .../mixin/ItemStackMixin.java | 7 ++ .../mixin/LivingEntityMixin.java | 28 +++++++ .../assortedarmaments/network/AANetwork.java | 24 ++++++ .../network/UpdateBlockAbilityPayload.java | 25 ++++++ .../assortedarmaments/registry/AAItems.java | 9 ++ .../tags/AAEntityTypeTags.java | 15 ++++ .../assortedarmaments/tags/AAItemTags.java | 12 ++- .../textures/item/diamond_mace.png | Bin 0 -> 219 bytes .../textures/item/golden_mace.png | Bin 0 -> 304 bytes .../textures/item/iron_mace.png | Bin 0 -> 306 bytes .../textures/item/netherite_mace.png | Bin 0 -> 228 bytes .../textures/item/stone_mace.png | Bin 0 -> 216 bytes .../textures/item/wooden_mace.png | Bin 0 -> 216 bytes .../resources/assorted_armaments.mixins.json | 1 + 66 files changed, 901 insertions(+), 41 deletions(-) create mode 100644 src/generated/resources/.cache/aec9b27ab4b41731e7cef8638cc084f67472833b create mode 100644 src/generated/resources/assets/assorted_armaments/models/item/diamond_mace.json create mode 100644 src/generated/resources/assets/assorted_armaments/models/item/golden_mace.json create mode 100644 src/generated/resources/assets/assorted_armaments/models/item/iron_mace.json create mode 100644 src/generated/resources/assets/assorted_armaments/models/item/netherite_mace.json create mode 100644 src/generated/resources/assets/assorted_armaments/models/item/stone_mace.json create mode 100644 src/generated/resources/assets/assorted_armaments/models/item/wooden_mace.json create mode 100644 src/generated/resources/data/assorted_armaments/advancement/recipes/combat/diamond_mace.json create mode 100644 src/generated/resources/data/assorted_armaments/advancement/recipes/combat/golden_mace.json create mode 100644 src/generated/resources/data/assorted_armaments/advancement/recipes/combat/iron_mace.json create mode 100644 src/generated/resources/data/assorted_armaments/advancement/recipes/combat/netherite_mace_smithing.json create mode 100644 src/generated/resources/data/assorted_armaments/advancement/recipes/combat/stone_mace.json create mode 100644 src/generated/resources/data/assorted_armaments/advancement/recipes/combat/wooden_mace.json create mode 100644 src/generated/resources/data/assorted_armaments/recipe/diamond_mace.json create mode 100644 src/generated/resources/data/assorted_armaments/recipe/golden_mace.json create mode 100644 src/generated/resources/data/assorted_armaments/recipe/iron_mace.json create mode 100644 src/generated/resources/data/assorted_armaments/recipe/netherite_mace_smithing.json create mode 100644 src/generated/resources/data/assorted_armaments/recipe/stone_mace.json create mode 100644 src/generated/resources/data/assorted_armaments/recipe/wooden_mace.json create mode 100644 src/generated/resources/data/assorted_armaments/tags/entity_type/piglins.json create mode 100644 src/generated/resources/data/assorted_armaments/tags/entity_type/zombies.json create mode 100644 src/generated/resources/data/assorted_armaments/tags/item/armor_based_damage.json create mode 100644 src/generated/resources/data/assorted_armaments/tags/item/disabled_when_disabling_blocking.json create mode 100644 src/generated/resources/data/assorted_armaments/tags/item/disables_blocking_on_attack.json create mode 100644 src/generated/resources/data/assorted_armaments/tags/item/extra_knockback.json create mode 100644 src/generated/resources/data/assorted_armaments/tags/item/maces.json create mode 100644 src/generated/resources/data/assorted_armaments/tags/item/piglins_can_use.json create mode 100644 src/generated/resources/data/assorted_armaments/tags/item/zombies_can_use.json create mode 100644 src/generated/resources/data/minecraft/tags/item/enchantable/sword.json create mode 100644 src/generated/resources/data/minecraft/tags/item/piglin_loved.json create mode 100644 src/main/java/team/leomc/assortedarmaments/data/gen/tags/AAEntityTagsProvider.java create mode 100644 src/main/java/team/leomc/assortedarmaments/item/MaceItem.java create mode 100644 src/main/java/team/leomc/assortedarmaments/mixin/LivingEntityMixin.java create mode 100644 src/main/java/team/leomc/assortedarmaments/network/AANetwork.java create mode 100644 src/main/java/team/leomc/assortedarmaments/network/UpdateBlockAbilityPayload.java create mode 100644 src/main/java/team/leomc/assortedarmaments/tags/AAEntityTypeTags.java create mode 100644 src/main/resources/assets/assorted_armaments/textures/item/diamond_mace.png create mode 100644 src/main/resources/assets/assorted_armaments/textures/item/golden_mace.png create mode 100644 src/main/resources/assets/assorted_armaments/textures/item/iron_mace.png create mode 100644 src/main/resources/assets/assorted_armaments/textures/item/netherite_mace.png create mode 100644 src/main/resources/assets/assorted_armaments/textures/item/stone_mace.png create mode 100644 src/main/resources/assets/assorted_armaments/textures/item/wooden_mace.png diff --git a/gradle.properties b/gradle.properties index 94967c4..ab63166 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,7 +17,7 @@ minecraft_version=1.21 # as they do not follow standard versioning conventions. minecraft_version_range=[1.21,1.21.1) # The Neo version must agree with the Minecraft version to get a valid artifact -neo_version=21.0.83-beta +neo_version=21.0.98-beta # The Neo version range can use any version of Neo as bounds neo_version_range=[21.0.0-beta,) # The loader version range can only use the major version of FML as bounds diff --git a/src/generated/resources/.cache/1bda0eb39dbc3800081e5f8528c492e5d2ac1dc9 b/src/generated/resources/.cache/1bda0eb39dbc3800081e5f8528c492e5d2ac1dc9 index af20d89..d0c05a8 100644 --- a/src/generated/resources/.cache/1bda0eb39dbc3800081e5f8528c492e5d2ac1dc9 +++ b/src/generated/resources/.cache/1bda0eb39dbc3800081e5f8528c492e5d2ac1dc9 @@ -1,2 +1,2 @@ -// 1.21 2024-07-16T16:21:56.201976 Languages: en_us for mod: assorted_armaments -6beeaf1d42adffcf0691421959cc88dddc19151e assets/assorted_armaments/lang/en_us.json +// 1.21 2024-07-17T12:14:30.3571186 Languages: en_us for mod: assorted_armaments +d3fb1c68605db5a46811a4d0dd8fba3e7c56e2c1 assets/assorted_armaments/lang/en_us.json diff --git a/src/generated/resources/.cache/2db82bc4898868f7eec79958ed07d46c99c9af46 b/src/generated/resources/.cache/2db82bc4898868f7eec79958ed07d46c99c9af46 index 09628dc..a3b48a4 100644 --- a/src/generated/resources/.cache/2db82bc4898868f7eec79958ed07d46c99c9af46 +++ b/src/generated/resources/.cache/2db82bc4898868f7eec79958ed07d46c99c9af46 @@ -1,19 +1,25 @@ -// 1.21 2024-07-16T14:37:17.2193294 Item Models: assorted_armaments +// 1.21 2024-07-17T09:50:46.8654472 Item Models: assorted_armaments 9f5ce353cc483273242470fac8e74e0999b4efeb assets/assorted_armaments/models/item/diamond_claymore.json 1f15a0020d5f44de2b673f75da3664427b52ccfe assets/assorted_armaments/models/item/diamond_claymore_blocking.json 1c2ff54384d1ded71022bea0c27159a13a41fc6c assets/assorted_armaments/models/item/diamond_claymore_inventory.json +fc9a049ff14b2552e31856d2e8981cd6835c6b22 assets/assorted_armaments/models/item/diamond_mace.json 9619c9e457df4c09222ac0940dd12ec577d2bff9 assets/assorted_armaments/models/item/golden_claymore.json 6665a03a5233a294963319da5b68eb95cd00ce5c assets/assorted_armaments/models/item/golden_claymore_blocking.json b99081f7ea7c7ec428b2ccc0d4484c0cd3e7eeda assets/assorted_armaments/models/item/golden_claymore_inventory.json +0f7a9420d0630c951c4de44697a6d753aebc65c5 assets/assorted_armaments/models/item/golden_mace.json 71d39dc9a3105364a3ea8c92880c32a4597529c4 assets/assorted_armaments/models/item/iron_claymore.json f13d51ffd2add96ae573fd701fd90bfcc310f59d assets/assorted_armaments/models/item/iron_claymore_blocking.json f7c7b38356c450a067560d6cd48dd062150f3958 assets/assorted_armaments/models/item/iron_claymore_inventory.json +48e82205f3e84627c516a2393790171080a68f4f assets/assorted_armaments/models/item/iron_mace.json c315f5bf8d2372b2719696373384ad59b3c5a431 assets/assorted_armaments/models/item/netherite_claymore.json eda89a2e4667f95ec719a18a4b3ec377fff48948 assets/assorted_armaments/models/item/netherite_claymore_blocking.json 110a66c24c32b3bd29f9777efe19d9cc769230b4 assets/assorted_armaments/models/item/netherite_claymore_inventory.json +3dc57528b72903e8c4fff3cb6fa3739e11f3e279 assets/assorted_armaments/models/item/netherite_mace.json daed45eaf2b96d5097c98791f81946fd672a1f95 assets/assorted_armaments/models/item/stone_claymore.json ef0be2fb9c4a35f869878cf4aae153891db53764 assets/assorted_armaments/models/item/stone_claymore_blocking.json f81ac86f2a25cecb4949bb78e65e487895f14150 assets/assorted_armaments/models/item/stone_claymore_inventory.json +26c4850fd8bb36666f6e16b090a7a306b0e536d8 assets/assorted_armaments/models/item/stone_mace.json fff5e484d6ed448fd747ae1d9c5f191f9f42997f assets/assorted_armaments/models/item/wooden_claymore.json 1d4ebe2e7400716b793444ec422fbcbad50de24a assets/assorted_armaments/models/item/wooden_claymore_blocking.json 7769febb5b9173a3405449255fcfb26b53ad50f9 assets/assorted_armaments/models/item/wooden_claymore_inventory.json +ae00e6edfec471f1ba4e9955a3293ff8e01f4603 assets/assorted_armaments/models/item/wooden_mace.json diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index a3c7f2f..f49bcce 100644 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,17 +1,29 @@ -// 1.21 2024-07-16T14:37:17.2203559 Recipes +// 1.21 2024-07-17T09:50:46.867599 Recipes 8382164a2d614e6d69b66ab944401aed13df5831 data/assorted_armaments/advancement/recipes/combat/diamond_claymore.json +7c1fd99c1a811bcdab5562b1d6e932fa4430548a data/assorted_armaments/advancement/recipes/combat/diamond_mace.json a25b61df6c6c33ceaf2b1e6d730bb61fc1f5aadb data/assorted_armaments/advancement/recipes/combat/golden_claymore.json +a8836313ab3bf6735fbb927a5dd4c67ef4526026 data/assorted_armaments/advancement/recipes/combat/golden_mace.json d276fd5fe3a0cf9a48f116fb2353e476df18cdf9 data/assorted_armaments/advancement/recipes/combat/iron_claymore.json +54f050e3fc332ab970e960c69bc78e6c5612ed51 data/assorted_armaments/advancement/recipes/combat/iron_mace.json 94b7e274b64f185c8aa46f4aaa24f7ad95a804d5 data/assorted_armaments/advancement/recipes/combat/netherite_claymore_smithing.json +c34cf7505b8bca841090a5f3a9fc107f78e2f493 data/assorted_armaments/advancement/recipes/combat/netherite_mace_smithing.json d5b1ed1a87e63b2059a8821f54fd7ba7570bda29 data/assorted_armaments/advancement/recipes/combat/stone_claymore.json +90af859f0da35a3909d4f49ab6303c49230fab52 data/assorted_armaments/advancement/recipes/combat/stone_mace.json e267c8093a149c569a1227905ee2e23025e6ab85 data/assorted_armaments/advancement/recipes/combat/wooden_claymore.json -6d3eb532fa3814b720e492f80e56d8d6c6863055 data/assorted_armaments/advancement/recipes/misc/gold_nugget_from_smelting.json -e630d1b2597084f5f8ac5f12fa8a9cac702a3479 data/assorted_armaments/advancement/recipes/misc/iron_nugget_from_smelting.json +59a87bd4615a4c274604b516efc35f801184fc11 data/assorted_armaments/advancement/recipes/combat/wooden_mace.json +c48d79d5652d0e747990dfe43fc2f46be397627d data/assorted_armaments/advancement/recipes/misc/gold_nugget_from_smelting.json +d808a492db6370f1094cb5a84e6d3722aa88e93b data/assorted_armaments/advancement/recipes/misc/iron_nugget_from_smelting.json 89885995711164134674b09c5c192288a98ad311 data/assorted_armaments/recipe/diamond_claymore.json +4af12ab4812ba46e9bdddf6c05a20f68a960136c data/assorted_armaments/recipe/diamond_mace.json 1f376c743e9f88e2522e2edfa796660d3027ddc8 data/assorted_armaments/recipe/golden_claymore.json -920c1b220a31335de25b45b0438096c8baa73649 data/assorted_armaments/recipe/gold_nugget_from_smelting.json +2e8951cb4ec1204c3664ea98322ef4308d19da50 data/assorted_armaments/recipe/golden_mace.json +892627d8d6f0230d03d8ec9189094b40c54713d6 data/assorted_armaments/recipe/gold_nugget_from_smelting.json fafac210004fce3a6e958ef1a6381bbf514a11f4 data/assorted_armaments/recipe/iron_claymore.json -d70254e5653eb4c529b7cca4de20a5e5de3bacf3 data/assorted_armaments/recipe/iron_nugget_from_smelting.json +9275ad993c351adda5dff035a938fa5559b35735 data/assorted_armaments/recipe/iron_mace.json +78c59f001b85fa1b7d22163f18264247b57ad008 data/assorted_armaments/recipe/iron_nugget_from_smelting.json b6326c23d1e52445305c6f16aaa53182fc9b24f8 data/assorted_armaments/recipe/netherite_claymore_smithing.json +7551916980100fff882ee33c4fcb01e653fbcf2c data/assorted_armaments/recipe/netherite_mace_smithing.json 9f2127f283804e7057a5a3dd37ddf82945936563 data/assorted_armaments/recipe/stone_claymore.json +a9a907d3354f90e04bdc86e05d0fa0359700eb66 data/assorted_armaments/recipe/stone_mace.json e9077c25852fc3e140f1cdf3649abfe7c05b0ed1 data/assorted_armaments/recipe/wooden_claymore.json +1bb60273a91347a571b324968622d0a37149fe91 data/assorted_armaments/recipe/wooden_mace.json diff --git a/src/generated/resources/.cache/aec9b27ab4b41731e7cef8638cc084f67472833b b/src/generated/resources/.cache/aec9b27ab4b41731e7cef8638cc084f67472833b new file mode 100644 index 0000000..296b17c --- /dev/null +++ b/src/generated/resources/.cache/aec9b27ab4b41731e7cef8638cc084f67472833b @@ -0,0 +1,3 @@ +// 1.21 2024-07-17T11:58:43.1606745 Tags for minecraft:entity_type mod id assorted_armaments +cfed4d980bbfe7f6653b455d9609e16cf8f43921 data/assorted_armaments/tags/entity_type/piglins.json +b2164b5ee879d6acc660ac00dfb3a822a2da2ad8 data/assorted_armaments/tags/entity_type/zombies.json diff --git a/src/generated/resources/.cache/b9473a7920e150f1fd90d60adffdd8557dd85fef b/src/generated/resources/.cache/b9473a7920e150f1fd90d60adffdd8557dd85fef index 1338501..0a2d5b4 100644 --- a/src/generated/resources/.cache/b9473a7920e150f1fd90d60adffdd8557dd85fef +++ b/src/generated/resources/.cache/b9473a7920e150f1fd90d60adffdd8557dd85fef @@ -1,6 +1,15 @@ -// 1.21 2024-07-16T16:07:37.0090101 Tags for minecraft:item mod id assorted_armaments +// 1.21 2024-07-17T12:10:52.6461927 Tags for minecraft:item mod id assorted_armaments +2339775d05f0f18b3a4b0442182b2947a8d21dac data/assorted_armaments/tags/item/armor_based_damage.json d500bd43e88c70df0ec4054b266d05b7df7e221e data/assorted_armaments/tags/item/can_block.json f24a559480a18b444e7f297e1003e8167bc0f39a data/assorted_armaments/tags/item/claymores.json +7afce92566460028195e030448653863cf8cdad4 data/assorted_armaments/tags/item/disabled_when_disabling_blocking.json +2339775d05f0f18b3a4b0442182b2947a8d21dac data/assorted_armaments/tags/item/disables_blocking_on_attack.json d500bd43e88c70df0ec4054b266d05b7df7e221e data/assorted_armaments/tags/item/efficient_sweep.json +2339775d05f0f18b3a4b0442182b2947a8d21dac data/assorted_armaments/tags/item/extra_knockback.json +49d8eba27c3286414774334db28149d1407fa619 data/assorted_armaments/tags/item/maces.json +7077b1b5725e080525035c20f8566479b8e6bd11 data/assorted_armaments/tags/item/piglins_can_use.json d500bd43e88c70df0ec4054b266d05b7df7e221e data/assorted_armaments/tags/item/two_handed.json +98f49f4247d9fd93ce70a45c22a636e58c22225d data/assorted_armaments/tags/item/zombies_can_use.json +2339775d05f0f18b3a4b0442182b2947a8d21dac data/minecraft/tags/item/enchantable/sword.json +7077b1b5725e080525035c20f8566479b8e6bd11 data/minecraft/tags/item/piglin_loved.json d500bd43e88c70df0ec4054b266d05b7df7e221e data/minecraft/tags/item/swords.json diff --git a/src/generated/resources/.cache/e31f75891746f095f78065a964298b59b7cd2c16 b/src/generated/resources/.cache/e31f75891746f095f78065a964298b59b7cd2c16 index 1bbec89..00131d9 100644 --- a/src/generated/resources/.cache/e31f75891746f095f78065a964298b59b7cd2c16 +++ b/src/generated/resources/.cache/e31f75891746f095f78065a964298b59b7cd2c16 @@ -1,2 +1,2 @@ -// 1.21 2024-07-16T16:21:56.2009386 Languages: zh_cn for mod: assorted_armaments -6d82e65aec7095c92891f7f41d3218dedec54ef5 assets/assorted_armaments/lang/zh_cn.json +// 1.21 2024-07-17T12:14:30.3551141 Languages: zh_cn for mod: assorted_armaments +015041856bad326a9835b6521d55d40485265e40 assets/assorted_armaments/lang/zh_cn.json diff --git a/src/generated/resources/assets/assorted_armaments/lang/en_us.json b/src/generated/resources/assets/assorted_armaments/lang/en_us.json index 04beba4..a528e19 100644 --- a/src/generated/resources/assets/assorted_armaments/lang/en_us.json +++ b/src/generated/resources/assets/assorted_armaments/lang/en_us.json @@ -1,13 +1,22 @@ { + "desc.assorted_armaments.armor_based_damage": "Deals extra damage to enemies with armor", "desc.assorted_armaments.can_block": "Can be used to block melee damage that is equal to half of the weapon's damage", - "desc.assorted_armaments.efficient_sweep": "On a sweeping attack, all targets in range take 100% damage", + "desc.assorted_armaments.disables_blocking_on_attack": "Disables the target's ability to block", + "desc.assorted_armaments.efficient_sweep": "All targets in range on a sweeping attack take the same damage as a direct melee attack", + "desc.assorted_armaments.extra_knockback": "Deals extra knockback", "desc.assorted_armaments.shift": "Hold [SHIFT] for more information", "desc.assorted_armaments.two_handed": "Disables offhand items when held in main hand", "item.assorted_armaments.diamond_claymore": "Diamond Claymore", + "item.assorted_armaments.diamond_mace": "Diamond Mace", "item.assorted_armaments.golden_claymore": "Golden Claymore", + "item.assorted_armaments.golden_mace": "Golden Mace", "item.assorted_armaments.iron_claymore": "Iron Claymore", + "item.assorted_armaments.iron_mace": "Iron Mace", "item.assorted_armaments.netherite_claymore": "Netherite Claymore", + "item.assorted_armaments.netherite_mace": "Netherite Mace", "item.assorted_armaments.stone_claymore": "Stone Claymore", + "item.assorted_armaments.stone_mace": "Stone Mace", "item.assorted_armaments.wooden_claymore": "Wooden Claymore", + "item.assorted_armaments.wooden_mace": "Wooden Mace", "name.assorted_armaments": "Assorted Armaments" } \ No newline at end of file diff --git a/src/generated/resources/assets/assorted_armaments/lang/zh_cn.json b/src/generated/resources/assets/assorted_armaments/lang/zh_cn.json index a177172..394b06b 100644 --- a/src/generated/resources/assets/assorted_armaments/lang/zh_cn.json +++ b/src/generated/resources/assets/assorted_armaments/lang/zh_cn.json @@ -1,13 +1,22 @@ { + "desc.assorted_armaments.armor_based_damage": "对有护甲的敌人造成额外伤害", "desc.assorted_armaments.can_block": "可以格挡武器伤害一半大小的近战伤害", - "desc.assorted_armaments.efficient_sweep": "横扫攻击时,范围内所有目标受到100%的伤害", + "desc.assorted_armaments.disables_blocking_on_attack": "攻击被格挡时使目标失去格挡能力", + "desc.assorted_armaments.efficient_sweep": "横扫攻击时范围内所有目标受到与直接攻击一致的伤害", + "desc.assorted_armaments.extra_knockback": "可造成额外击退", "desc.assorted_armaments.shift": "按[SHIFT]查看更多信息", - "desc.assorted_armaments.two_handed": "拿在主手时,禁用副手物品", + "desc.assorted_armaments.two_handed": "拿在主手时禁用副手物品", "item.assorted_armaments.diamond_claymore": "钻石大剑", + "item.assorted_armaments.diamond_mace": "钻石钉头锤", "item.assorted_armaments.golden_claymore": "金大剑", + "item.assorted_armaments.golden_mace": "金钉头锤", "item.assorted_armaments.iron_claymore": "铁大剑", + "item.assorted_armaments.iron_mace": "铁钉头锤", "item.assorted_armaments.netherite_claymore": "下界合金大剑", + "item.assorted_armaments.netherite_mace": "下界合金钉头锤", "item.assorted_armaments.stone_claymore": "石大剑", + "item.assorted_armaments.stone_mace": "石钉头锤", "item.assorted_armaments.wooden_claymore": "木大剑", + "item.assorted_armaments.wooden_mace": "木钉头锤", "name.assorted_armaments": "百般武艺" } \ No newline at end of file diff --git a/src/generated/resources/assets/assorted_armaments/models/item/diamond_mace.json b/src/generated/resources/assets/assorted_armaments/models/item/diamond_mace.json new file mode 100644 index 0000000..85a7eb2 --- /dev/null +++ b/src/generated/resources/assets/assorted_armaments/models/item/diamond_mace.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "assorted_armaments:item/diamond_mace" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/assorted_armaments/models/item/golden_mace.json b/src/generated/resources/assets/assorted_armaments/models/item/golden_mace.json new file mode 100644 index 0000000..9be9f53 --- /dev/null +++ b/src/generated/resources/assets/assorted_armaments/models/item/golden_mace.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "assorted_armaments:item/golden_mace" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/assorted_armaments/models/item/iron_mace.json b/src/generated/resources/assets/assorted_armaments/models/item/iron_mace.json new file mode 100644 index 0000000..f4e3421 --- /dev/null +++ b/src/generated/resources/assets/assorted_armaments/models/item/iron_mace.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "assorted_armaments:item/iron_mace" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/assorted_armaments/models/item/netherite_mace.json b/src/generated/resources/assets/assorted_armaments/models/item/netherite_mace.json new file mode 100644 index 0000000..99f9d8d --- /dev/null +++ b/src/generated/resources/assets/assorted_armaments/models/item/netherite_mace.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "assorted_armaments:item/netherite_mace" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/assorted_armaments/models/item/stone_mace.json b/src/generated/resources/assets/assorted_armaments/models/item/stone_mace.json new file mode 100644 index 0000000..4bb51dd --- /dev/null +++ b/src/generated/resources/assets/assorted_armaments/models/item/stone_mace.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "assorted_armaments:item/stone_mace" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/assorted_armaments/models/item/wooden_mace.json b/src/generated/resources/assets/assorted_armaments/models/item/wooden_mace.json new file mode 100644 index 0000000..b71cddc --- /dev/null +++ b/src/generated/resources/assets/assorted_armaments/models/item/wooden_mace.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "assorted_armaments:item/wooden_mace" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/assorted_armaments/advancement/recipes/combat/diamond_mace.json b/src/generated/resources/data/assorted_armaments/advancement/recipes/combat/diamond_mace.json new file mode 100644 index 0000000..1ac5ba1 --- /dev/null +++ b/src/generated/resources/data/assorted_armaments/advancement/recipes/combat/diamond_mace.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_diamond": { + "conditions": { + "items": [ + { + "items": "minecraft:diamond" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "assorted_armaments:diamond_mace" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_diamond" + ] + ], + "rewards": { + "recipes": [ + "assorted_armaments:diamond_mace" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/assorted_armaments/advancement/recipes/combat/golden_mace.json b/src/generated/resources/data/assorted_armaments/advancement/recipes/combat/golden_mace.json new file mode 100644 index 0000000..a8dc7cc --- /dev/null +++ b/src/generated/resources/data/assorted_armaments/advancement/recipes/combat/golden_mace.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_gold_ingot": { + "conditions": { + "items": [ + { + "items": "minecraft:gold_ingot" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "assorted_armaments:golden_mace" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_gold_ingot" + ] + ], + "rewards": { + "recipes": [ + "assorted_armaments:golden_mace" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/assorted_armaments/advancement/recipes/combat/iron_mace.json b/src/generated/resources/data/assorted_armaments/advancement/recipes/combat/iron_mace.json new file mode 100644 index 0000000..9b86c7d --- /dev/null +++ b/src/generated/resources/data/assorted_armaments/advancement/recipes/combat/iron_mace.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_iron_ingot": { + "conditions": { + "items": [ + { + "items": "minecraft:iron_ingot" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "assorted_armaments:iron_mace" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_iron_ingot" + ] + ], + "rewards": { + "recipes": [ + "assorted_armaments:iron_mace" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/assorted_armaments/advancement/recipes/combat/netherite_mace_smithing.json b/src/generated/resources/data/assorted_armaments/advancement/recipes/combat/netherite_mace_smithing.json new file mode 100644 index 0000000..012a476 --- /dev/null +++ b/src/generated/resources/data/assorted_armaments/advancement/recipes/combat/netherite_mace_smithing.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_netherite_ingot": { + "conditions": { + "items": [ + { + "items": "minecraft:netherite_ingot" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "assorted_armaments:netherite_mace_smithing" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_netherite_ingot" + ] + ], + "rewards": { + "recipes": [ + "assorted_armaments:netherite_mace_smithing" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/assorted_armaments/advancement/recipes/combat/stone_mace.json b/src/generated/resources/data/assorted_armaments/advancement/recipes/combat/stone_mace.json new file mode 100644 index 0000000..fbd06a6 --- /dev/null +++ b/src/generated/resources/data/assorted_armaments/advancement/recipes/combat/stone_mace.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": "#minecraft:stone_tool_materials" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "assorted_armaments:stone_mace" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "assorted_armaments:stone_mace" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/assorted_armaments/advancement/recipes/combat/wooden_mace.json b/src/generated/resources/data/assorted_armaments/advancement/recipes/combat/wooden_mace.json new file mode 100644 index 0000000..90f4fc6 --- /dev/null +++ b/src/generated/resources/data/assorted_armaments/advancement/recipes/combat/wooden_mace.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_item": { + "conditions": { + "items": [ + { + "items": "#minecraft:planks" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "assorted_armaments:wooden_mace" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_item" + ] + ], + "rewards": { + "recipes": [ + "assorted_armaments:wooden_mace" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/assorted_armaments/advancement/recipes/misc/gold_nugget_from_smelting.json b/src/generated/resources/data/assorted_armaments/advancement/recipes/misc/gold_nugget_from_smelting.json index 1acb002..2239fcd 100644 --- a/src/generated/resources/data/assorted_armaments/advancement/recipes/misc/gold_nugget_from_smelting.json +++ b/src/generated/resources/data/assorted_armaments/advancement/recipes/misc/gold_nugget_from_smelting.json @@ -11,6 +11,16 @@ }, "trigger": "minecraft:inventory_changed" }, + "has_golden_mace": { + "conditions": { + "items": [ + { + "items": "assorted_armaments:golden_mace" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, "has_the_recipe": { "conditions": { "recipe": "assorted_armaments:gold_nugget_from_smelting" @@ -21,7 +31,8 @@ "requirements": [ [ "has_the_recipe", - "has_golden_claymore" + "has_golden_claymore", + "has_golden_mace" ] ], "rewards": { diff --git a/src/generated/resources/data/assorted_armaments/advancement/recipes/misc/iron_nugget_from_smelting.json b/src/generated/resources/data/assorted_armaments/advancement/recipes/misc/iron_nugget_from_smelting.json index 87b3ce5..3305d21 100644 --- a/src/generated/resources/data/assorted_armaments/advancement/recipes/misc/iron_nugget_from_smelting.json +++ b/src/generated/resources/data/assorted_armaments/advancement/recipes/misc/iron_nugget_from_smelting.json @@ -11,6 +11,16 @@ }, "trigger": "minecraft:inventory_changed" }, + "has_iron_mace": { + "conditions": { + "items": [ + { + "items": "assorted_armaments:iron_mace" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, "has_the_recipe": { "conditions": { "recipe": "assorted_armaments:iron_nugget_from_smelting" @@ -21,7 +31,8 @@ "requirements": [ [ "has_the_recipe", - "has_iron_claymore" + "has_iron_claymore", + "has_iron_mace" ] ], "rewards": { diff --git a/src/generated/resources/data/assorted_armaments/recipe/diamond_mace.json b/src/generated/resources/data/assorted_armaments/recipe/diamond_mace.json new file mode 100644 index 0000000..df02471 --- /dev/null +++ b/src/generated/resources/data/assorted_armaments/recipe/diamond_mace.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "equipment", + "key": { + "#": { + "tag": "c:rods/wooden" + }, + "X": { + "item": "minecraft:diamond" + } + }, + "pattern": [ + "X#X", + "X#X", + " # " + ], + "result": { + "count": 1, + "id": "assorted_armaments:diamond_mace" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/assorted_armaments/recipe/gold_nugget_from_smelting.json b/src/generated/resources/data/assorted_armaments/recipe/gold_nugget_from_smelting.json index 4ee91b5..1ccbde0 100644 --- a/src/generated/resources/data/assorted_armaments/recipe/gold_nugget_from_smelting.json +++ b/src/generated/resources/data/assorted_armaments/recipe/gold_nugget_from_smelting.json @@ -3,9 +3,14 @@ "category": "misc", "cookingtime": 200, "experience": 0.1, - "ingredient": { - "item": "assorted_armaments:golden_claymore" - }, + "ingredient": [ + { + "item": "assorted_armaments:golden_claymore" + }, + { + "item": "assorted_armaments:golden_mace" + } + ], "result": { "count": 1, "id": "minecraft:gold_nugget" diff --git a/src/generated/resources/data/assorted_armaments/recipe/golden_mace.json b/src/generated/resources/data/assorted_armaments/recipe/golden_mace.json new file mode 100644 index 0000000..ff3bd89 --- /dev/null +++ b/src/generated/resources/data/assorted_armaments/recipe/golden_mace.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "equipment", + "key": { + "#": { + "tag": "c:rods/wooden" + }, + "X": { + "item": "minecraft:gold_ingot" + } + }, + "pattern": [ + "X#X", + "X#X", + " # " + ], + "result": { + "count": 1, + "id": "assorted_armaments:golden_mace" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/assorted_armaments/recipe/iron_mace.json b/src/generated/resources/data/assorted_armaments/recipe/iron_mace.json new file mode 100644 index 0000000..f6f5d85 --- /dev/null +++ b/src/generated/resources/data/assorted_armaments/recipe/iron_mace.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "equipment", + "key": { + "#": { + "tag": "c:rods/wooden" + }, + "X": { + "item": "minecraft:iron_ingot" + } + }, + "pattern": [ + "X#X", + "X#X", + " # " + ], + "result": { + "count": 1, + "id": "assorted_armaments:iron_mace" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/assorted_armaments/recipe/iron_nugget_from_smelting.json b/src/generated/resources/data/assorted_armaments/recipe/iron_nugget_from_smelting.json index 20ebeca..0486b0e 100644 --- a/src/generated/resources/data/assorted_armaments/recipe/iron_nugget_from_smelting.json +++ b/src/generated/resources/data/assorted_armaments/recipe/iron_nugget_from_smelting.json @@ -3,9 +3,14 @@ "category": "misc", "cookingtime": 200, "experience": 0.1, - "ingredient": { - "item": "assorted_armaments:iron_claymore" - }, + "ingredient": [ + { + "item": "assorted_armaments:iron_claymore" + }, + { + "item": "assorted_armaments:iron_mace" + } + ], "result": { "count": 1, "id": "minecraft:iron_nugget" diff --git a/src/generated/resources/data/assorted_armaments/recipe/netherite_mace_smithing.json b/src/generated/resources/data/assorted_armaments/recipe/netherite_mace_smithing.json new file mode 100644 index 0000000..80632ff --- /dev/null +++ b/src/generated/resources/data/assorted_armaments/recipe/netherite_mace_smithing.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:smithing_transform", + "addition": { + "item": "minecraft:netherite_ingot" + }, + "base": { + "item": "assorted_armaments:diamond_mace" + }, + "result": { + "count": 1, + "id": "assorted_armaments:netherite_mace" + }, + "template": { + "item": "minecraft:netherite_upgrade_smithing_template" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/assorted_armaments/recipe/stone_mace.json b/src/generated/resources/data/assorted_armaments/recipe/stone_mace.json new file mode 100644 index 0000000..8e42625 --- /dev/null +++ b/src/generated/resources/data/assorted_armaments/recipe/stone_mace.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "equipment", + "key": { + "#": { + "tag": "c:rods/wooden" + }, + "X": { + "tag": "minecraft:stone_tool_materials" + } + }, + "pattern": [ + "X#X", + "X#X", + " # " + ], + "result": { + "count": 1, + "id": "assorted_armaments:stone_mace" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/assorted_armaments/recipe/wooden_mace.json b/src/generated/resources/data/assorted_armaments/recipe/wooden_mace.json new file mode 100644 index 0000000..71abd1b --- /dev/null +++ b/src/generated/resources/data/assorted_armaments/recipe/wooden_mace.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "equipment", + "key": { + "#": { + "tag": "c:rods/wooden" + }, + "X": { + "tag": "minecraft:planks" + } + }, + "pattern": [ + "X#X", + "X#X", + " # " + ], + "result": { + "count": 1, + "id": "assorted_armaments:wooden_mace" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/assorted_armaments/tags/entity_type/piglins.json b/src/generated/resources/data/assorted_armaments/tags/entity_type/piglins.json new file mode 100644 index 0000000..bdf692b --- /dev/null +++ b/src/generated/resources/data/assorted_armaments/tags/entity_type/piglins.json @@ -0,0 +1,7 @@ +{ + "values": [ + "minecraft:zombified_piglin", + "minecraft:piglin", + "minecraft:piglin_brute" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/assorted_armaments/tags/entity_type/zombies.json b/src/generated/resources/data/assorted_armaments/tags/entity_type/zombies.json new file mode 100644 index 0000000..ca24a0c --- /dev/null +++ b/src/generated/resources/data/assorted_armaments/tags/entity_type/zombies.json @@ -0,0 +1,7 @@ +{ + "values": [ + "minecraft:zombie", + "minecraft:husk", + "minecraft:drowned" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/assorted_armaments/tags/item/armor_based_damage.json b/src/generated/resources/data/assorted_armaments/tags/item/armor_based_damage.json new file mode 100644 index 0000000..2ca3edd --- /dev/null +++ b/src/generated/resources/data/assorted_armaments/tags/item/armor_based_damage.json @@ -0,0 +1,5 @@ +{ + "values": [ + "#assorted_armaments:maces" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/assorted_armaments/tags/item/disabled_when_disabling_blocking.json b/src/generated/resources/data/assorted_armaments/tags/item/disabled_when_disabling_blocking.json new file mode 100644 index 0000000..a19c19b --- /dev/null +++ b/src/generated/resources/data/assorted_armaments/tags/item/disabled_when_disabling_blocking.json @@ -0,0 +1,6 @@ +{ + "values": [ + "#assorted_armaments:can_block", + "#c:tools/shield" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/assorted_armaments/tags/item/disables_blocking_on_attack.json b/src/generated/resources/data/assorted_armaments/tags/item/disables_blocking_on_attack.json new file mode 100644 index 0000000..2ca3edd --- /dev/null +++ b/src/generated/resources/data/assorted_armaments/tags/item/disables_blocking_on_attack.json @@ -0,0 +1,5 @@ +{ + "values": [ + "#assorted_armaments:maces" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/assorted_armaments/tags/item/extra_knockback.json b/src/generated/resources/data/assorted_armaments/tags/item/extra_knockback.json new file mode 100644 index 0000000..2ca3edd --- /dev/null +++ b/src/generated/resources/data/assorted_armaments/tags/item/extra_knockback.json @@ -0,0 +1,5 @@ +{ + "values": [ + "#assorted_armaments:maces" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/assorted_armaments/tags/item/maces.json b/src/generated/resources/data/assorted_armaments/tags/item/maces.json new file mode 100644 index 0000000..8a85093 --- /dev/null +++ b/src/generated/resources/data/assorted_armaments/tags/item/maces.json @@ -0,0 +1,10 @@ +{ + "values": [ + "assorted_armaments:wooden_mace", + "assorted_armaments:stone_mace", + "assorted_armaments:iron_mace", + "assorted_armaments:diamond_mace", + "assorted_armaments:golden_mace", + "assorted_armaments:netherite_mace" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/assorted_armaments/tags/item/piglins_can_use.json b/src/generated/resources/data/assorted_armaments/tags/item/piglins_can_use.json new file mode 100644 index 0000000..572cbd1 --- /dev/null +++ b/src/generated/resources/data/assorted_armaments/tags/item/piglins_can_use.json @@ -0,0 +1,6 @@ +{ + "values": [ + "assorted_armaments:golden_claymore", + "assorted_armaments:golden_mace" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/assorted_armaments/tags/item/zombies_can_use.json b/src/generated/resources/data/assorted_armaments/tags/item/zombies_can_use.json new file mode 100644 index 0000000..112c34e --- /dev/null +++ b/src/generated/resources/data/assorted_armaments/tags/item/zombies_can_use.json @@ -0,0 +1,6 @@ +{ + "values": [ + "assorted_armaments:iron_claymore", + "assorted_armaments:iron_mace" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/item/enchantable/sword.json b/src/generated/resources/data/minecraft/tags/item/enchantable/sword.json new file mode 100644 index 0000000..2ca3edd --- /dev/null +++ b/src/generated/resources/data/minecraft/tags/item/enchantable/sword.json @@ -0,0 +1,5 @@ +{ + "values": [ + "#assorted_armaments:maces" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/item/piglin_loved.json b/src/generated/resources/data/minecraft/tags/item/piglin_loved.json new file mode 100644 index 0000000..572cbd1 --- /dev/null +++ b/src/generated/resources/data/minecraft/tags/item/piglin_loved.json @@ -0,0 +1,6 @@ +{ + "values": [ + "assorted_armaments:golden_claymore", + "assorted_armaments:golden_mace" + ] +} \ No newline at end of file diff --git a/src/main/java/team/leomc/assortedarmaments/AACommonConfig.java b/src/main/java/team/leomc/assortedarmaments/AACommonConfig.java index 084c321..c4e45b9 100644 --- a/src/main/java/team/leomc/assortedarmaments/AACommonConfig.java +++ b/src/main/java/team/leomc/assortedarmaments/AACommonConfig.java @@ -9,16 +9,34 @@ public class AACommonConfig { private static final ModConfigSpec.Builder BUILDER = new ModConfigSpec.Builder(); - private static final ModConfigSpec.DoubleValue WEAPON_BLOCK_WALK_SPEED_MODIFIER = BUILDER - .comment("Player's walk speed when blocking with a weapon = (1 - weaponBlockWalkSpeedModifier) * originalSpeed") - .defineInRange("weaponBlockWalkSpeedModifier", 0.25, 0, 1); + private static final ModConfigSpec.DoubleValue BLOCK_WALK_SPEED_MODIFIER = BUILDER + .comment("Player's walk speed when blocking with a weapon = (1 - blockWalkSpeedModifier) * originalSpeed") + .defineInRange("blockWalkSpeedModifier", 0.25, 0, 1); + + private static final ModConfigSpec.DoubleValue ARMOR_BASED_ATTACK_DAMAGE_PERCENTAGE = BUILDER + .comment("Damage caused when attacking with a weapon that deals damage according to the target's armor value = originalDamage + armorBasedAttackDamagePercentage * target's armorValue") + .defineInRange("armorBasedAttackDamagePercentage", 0.25, 0, Integer.MAX_VALUE); + + private static final ModConfigSpec.DoubleValue ZOMBIE_USE_WEAPON_CHANCE = BUILDER + .comment("What is the probability that a zombie will use a weapon from assorted armaments?") + .defineInRange("zombieUseWeaponChance", 0.1, 0, 1); + + private static final ModConfigSpec.DoubleValue PIGLIN_USE_WEAPON_CHANCE = BUILDER + .comment("What is the probability that a piglin will use a weapon from assorted armaments?") + .defineInRange("piglinUseWeaponChance", 0.1, 0, 1); public static final ModConfigSpec SPEC = BUILDER.build(); - public static double weaponBlockWalkSpeedModifier; + public static double blockWalkSpeedModifier; + public static double armorBasedAttackDamagePercentage; + public static double zombieUseWeaponChance; + public static double piglinUseWeaponChance; @SubscribeEvent private static void onLoad(final ModConfigEvent event) { - weaponBlockWalkSpeedModifier = WEAPON_BLOCK_WALK_SPEED_MODIFIER.get(); + blockWalkSpeedModifier = BLOCK_WALK_SPEED_MODIFIER.get(); + armorBasedAttackDamagePercentage = ARMOR_BASED_ATTACK_DAMAGE_PERCENTAGE.get(); + zombieUseWeaponChance = ZOMBIE_USE_WEAPON_CHANCE.get(); + piglinUseWeaponChance = PIGLIN_USE_WEAPON_CHANCE.get(); } } diff --git a/src/main/java/team/leomc/assortedarmaments/data/gen/AARecipeProvider.java b/src/main/java/team/leomc/assortedarmaments/data/gen/AARecipeProvider.java index 2763968..df0bd9e 100644 --- a/src/main/java/team/leomc/assortedarmaments/data/gen/AARecipeProvider.java +++ b/src/main/java/team/leomc/assortedarmaments/data/gen/AARecipeProvider.java @@ -29,15 +29,26 @@ protected void buildRecipes(RecipeOutput recipeOutput) { claymore(recipeOutput, AAItems.GOLDEN_CLAYMORE.get(), Items.GOLD_INGOT); netheriteSmithing(recipeOutput, AAItems.DIAMOND_CLAYMORE.get(), RecipeCategory.COMBAT, AAItems.NETHERITE_CLAYMORE.get()); + mace(recipeOutput, AAItems.WOODEN_MACE.get(), ItemTags.PLANKS); + mace(recipeOutput, AAItems.STONE_MACE.get(), ItemTags.STONE_TOOL_MATERIALS); + mace(recipeOutput, AAItems.IRON_MACE.get(), Items.IRON_INGOT); + mace(recipeOutput, AAItems.DIAMOND_MACE.get(), Items.DIAMOND); + mace(recipeOutput, AAItems.GOLDEN_MACE.get(), Items.GOLD_INGOT); + netheriteSmithing(recipeOutput, AAItems.DIAMOND_MACE.get(), RecipeCategory.COMBAT, AAItems.NETHERITE_MACE.get()); + SimpleCookingRecipeBuilder.smelting(Ingredient.of( - AAItems.GOLDEN_CLAYMORE.get() + AAItems.GOLDEN_CLAYMORE.get(), + AAItems.GOLDEN_MACE.get() ), RecipeCategory.MISC, Items.GOLD_NUGGET, 0.1F, 200) .unlockedBy("has_golden_claymore", has(AAItems.GOLDEN_CLAYMORE.get())) + .unlockedBy("has_golden_mace", has(AAItems.GOLDEN_MACE.get())) .save(recipeOutput, AssortedArmaments.id(getSmeltingRecipeName(Items.GOLD_NUGGET))); SimpleCookingRecipeBuilder.smelting(Ingredient.of( - AAItems.IRON_CLAYMORE.get() + AAItems.IRON_CLAYMORE.get(), + AAItems.IRON_MACE.get() ), RecipeCategory.MISC, Items.IRON_NUGGET, 0.1F, 200) .unlockedBy("has_iron_claymore", has(AAItems.IRON_CLAYMORE.get())) + .unlockedBy("has_iron_mace", has(AAItems.IRON_MACE.get())) .save(recipeOutput, AssortedArmaments.id(getSmeltingRecipeName(Items.IRON_NUGGET))); } @@ -66,4 +77,26 @@ protected void claymore(RecipeOutput recipeOutput, ItemLike output, ItemLike inp .unlockedBy(getHasName(input), has(input)) .save(recipeOutput); } + + protected void mace(RecipeOutput recipeOutput, ItemLike output, TagKey input) { + ShapedRecipeBuilder.shaped(RecipeCategory.COMBAT, output) + .define('#', Tags.Items.RODS_WOODEN) + .define('X', input) + .pattern("X#X") + .pattern("X#X") + .pattern(" # ") + .unlockedBy("has_item", has(input)) + .save(recipeOutput); + } + + protected void mace(RecipeOutput recipeOutput, ItemLike output, ItemLike input) { + ShapedRecipeBuilder.shaped(RecipeCategory.COMBAT, output) + .define('#', Tags.Items.RODS_WOODEN) + .define('X', input) + .pattern("X#X") + .pattern("X#X") + .pattern(" # ") + .unlockedBy(getHasName(input), has(input)) + .save(recipeOutput); + } } diff --git a/src/main/java/team/leomc/assortedarmaments/data/gen/DataGenerators.java b/src/main/java/team/leomc/assortedarmaments/data/gen/DataGenerators.java index 1b155ca..b326cde 100644 --- a/src/main/java/team/leomc/assortedarmaments/data/gen/DataGenerators.java +++ b/src/main/java/team/leomc/assortedarmaments/data/gen/DataGenerators.java @@ -12,6 +12,7 @@ import team.leomc.assortedarmaments.data.gen.lang.AAEnglishLanguageProvider; import team.leomc.assortedarmaments.data.gen.model.AAItemModelProvider; import team.leomc.assortedarmaments.data.gen.tags.AABlockTagsProvider; +import team.leomc.assortedarmaments.data.gen.tags.AAEntityTagsProvider; import team.leomc.assortedarmaments.data.gen.tags.AAItemTagsProvider; import java.util.concurrent.CompletableFuture; @@ -33,6 +34,7 @@ public static void onGatherData(GatherDataEvent event) { AABlockTagsProvider blockTags = new AABlockTagsProvider(output, lookupProvider, helper); generator.addProvider(event.includeServer(), blockTags); generator.addProvider(event.includeServer(), new AAItemTagsProvider(output, lookupProvider, blockTags.contentsGetter(), helper)); + generator.addProvider(event.includeServer(), new AAEntityTagsProvider(output, lookupProvider, helper)); generator.addProvider(event.includeServer(), new AARecipeProvider(output, lookupProvider)); } } diff --git a/src/main/java/team/leomc/assortedarmaments/data/gen/lang/AAChineseLanguageProvider.java b/src/main/java/team/leomc/assortedarmaments/data/gen/lang/AAChineseLanguageProvider.java index 6f3bc9f..5f4c364 100644 --- a/src/main/java/team/leomc/assortedarmaments/data/gen/lang/AAChineseLanguageProvider.java +++ b/src/main/java/team/leomc/assortedarmaments/data/gen/lang/AAChineseLanguageProvider.java @@ -16,8 +16,11 @@ protected void addTranslations() { add("desc." + AssortedArmaments.ID + ".shift", "按[SHIFT]查看更多信息"); add("desc." + AssortedArmaments.ID + ".can_block", "可以格挡武器伤害一半大小的近战伤害"); - add("desc." + AssortedArmaments.ID + ".efficient_sweep", "横扫攻击时,范围内所有目标受到100%的伤害"); - add("desc." + AssortedArmaments.ID + ".two_handed", "拿在主手时,禁用副手物品"); + add("desc." + AssortedArmaments.ID + ".efficient_sweep", "横扫攻击时范围内所有目标受到与直接攻击一致的伤害"); + add("desc." + AssortedArmaments.ID + ".two_handed", "拿在主手时禁用副手物品"); + add("desc." + AssortedArmaments.ID + ".armor_based_damage", "对有护甲的敌人造成额外伤害"); + add("desc." + AssortedArmaments.ID + ".disables_blocking_on_attack", "攻击被格挡时使目标失去格挡能力"); + add("desc." + AssortedArmaments.ID + ".extra_knockback", "可造成额外击退"); add(AAItems.WOODEN_CLAYMORE.get(), "木大剑"); add(AAItems.STONE_CLAYMORE.get(), "石大剑"); @@ -25,5 +28,12 @@ protected void addTranslations() { add(AAItems.DIAMOND_CLAYMORE.get(), "钻石大剑"); add(AAItems.GOLDEN_CLAYMORE.get(), "金大剑"); add(AAItems.NETHERITE_CLAYMORE.get(), "下界合金大剑"); + + add(AAItems.WOODEN_MACE.get(), "木钉头锤"); + add(AAItems.STONE_MACE.get(), "石钉头锤"); + add(AAItems.IRON_MACE.get(), "铁钉头锤"); + add(AAItems.DIAMOND_MACE.get(), "钻石钉头锤"); + add(AAItems.GOLDEN_MACE.get(), "金钉头锤"); + add(AAItems.NETHERITE_MACE.get(), "下界合金钉头锤"); } } diff --git a/src/main/java/team/leomc/assortedarmaments/data/gen/lang/AAEnglishLanguageProvider.java b/src/main/java/team/leomc/assortedarmaments/data/gen/lang/AAEnglishLanguageProvider.java index 634d48e..1505ae4 100644 --- a/src/main/java/team/leomc/assortedarmaments/data/gen/lang/AAEnglishLanguageProvider.java +++ b/src/main/java/team/leomc/assortedarmaments/data/gen/lang/AAEnglishLanguageProvider.java @@ -16,8 +16,11 @@ protected void addTranslations() { add("desc." + AssortedArmaments.ID + ".shift", "Hold [SHIFT] for more information"); add("desc." + AssortedArmaments.ID + ".can_block", "Can be used to block melee damage that is equal to half of the weapon's damage"); - add("desc." + AssortedArmaments.ID + ".efficient_sweep", "On a sweeping attack, all targets in range take 100% damage"); + add("desc." + AssortedArmaments.ID + ".efficient_sweep", "All targets in range on a sweeping attack take the same damage as a direct melee attack"); add("desc." + AssortedArmaments.ID + ".two_handed", "Disables offhand items when held in main hand"); + add("desc." + AssortedArmaments.ID + ".armor_based_damage", "Deals extra damage to enemies with armor"); + add("desc." + AssortedArmaments.ID + ".disables_blocking_on_attack", "Disables the target's ability to block"); + add("desc." + AssortedArmaments.ID + ".extra_knockback", "Deals extra knockback"); add(AAItems.WOODEN_CLAYMORE.get(), "Wooden Claymore"); add(AAItems.STONE_CLAYMORE.get(), "Stone Claymore"); @@ -25,5 +28,12 @@ protected void addTranslations() { add(AAItems.DIAMOND_CLAYMORE.get(), "Diamond Claymore"); add(AAItems.GOLDEN_CLAYMORE.get(), "Golden Claymore"); add(AAItems.NETHERITE_CLAYMORE.get(), "Netherite Claymore"); + + add(AAItems.WOODEN_MACE.get(), "Wooden Mace"); + add(AAItems.STONE_MACE.get(), "Stone Mace"); + add(AAItems.IRON_MACE.get(), "Iron Mace"); + add(AAItems.DIAMOND_MACE.get(), "Diamond Mace"); + add(AAItems.GOLDEN_MACE.get(), "Golden Mace"); + add(AAItems.NETHERITE_MACE.get(), "Netherite Mace"); } } diff --git a/src/main/java/team/leomc/assortedarmaments/data/gen/model/AAItemModelProvider.java b/src/main/java/team/leomc/assortedarmaments/data/gen/model/AAItemModelProvider.java index 7c6b517..edde5b3 100644 --- a/src/main/java/team/leomc/assortedarmaments/data/gen/model/AAItemModelProvider.java +++ b/src/main/java/team/leomc/assortedarmaments/data/gen/model/AAItemModelProvider.java @@ -31,6 +31,13 @@ protected void registerModels() { inventoryModel(AAItems.GOLDEN_CLAYMORE.get()); claymore(AAItems.NETHERITE_CLAYMORE.get()); inventoryModel(AAItems.NETHERITE_CLAYMORE.get()); + + handheld(AAItems.WOODEN_MACE.get()); + handheld(AAItems.STONE_MACE.get()); + handheld(AAItems.IRON_MACE.get()); + handheld(AAItems.DIAMOND_MACE.get()); + handheld(AAItems.GOLDEN_MACE.get()); + handheld(AAItems.NETHERITE_MACE.get()); } private void claymore(Item item) { diff --git a/src/main/java/team/leomc/assortedarmaments/data/gen/tags/AAEntityTagsProvider.java b/src/main/java/team/leomc/assortedarmaments/data/gen/tags/AAEntityTagsProvider.java new file mode 100644 index 0000000..1790d59 --- /dev/null +++ b/src/main/java/team/leomc/assortedarmaments/data/gen/tags/AAEntityTagsProvider.java @@ -0,0 +1,31 @@ +package team.leomc.assortedarmaments.data.gen.tags; + +import net.minecraft.core.HolderLookup; +import net.minecraft.data.PackOutput; +import net.minecraft.data.tags.EntityTypeTagsProvider; +import net.minecraft.world.entity.EntityType; +import net.neoforged.neoforge.common.data.ExistingFileHelper; +import team.leomc.assortedarmaments.AssortedArmaments; +import team.leomc.assortedarmaments.tags.AAEntityTypeTags; + +import java.util.concurrent.CompletableFuture; + +public class AAEntityTagsProvider extends EntityTypeTagsProvider { + public AAEntityTagsProvider(PackOutput output, CompletableFuture future, ExistingFileHelper helper) { + super(output, future, AssortedArmaments.ID, helper); + } + + @Override + protected void addTags(HolderLookup.Provider lookupProvider) { + tag(AAEntityTypeTags.ZOMBIES).add( + EntityType.ZOMBIE, + EntityType.HUSK, + EntityType.DROWNED + ); + tag(AAEntityTypeTags.PIGLINS).add( + EntityType.ZOMBIFIED_PIGLIN, + EntityType.PIGLIN, + EntityType.PIGLIN_BRUTE + ); + } +} diff --git a/src/main/java/team/leomc/assortedarmaments/data/gen/tags/AAItemTagsProvider.java b/src/main/java/team/leomc/assortedarmaments/data/gen/tags/AAItemTagsProvider.java index f56aed6..66e73ca 100644 --- a/src/main/java/team/leomc/assortedarmaments/data/gen/tags/AAItemTagsProvider.java +++ b/src/main/java/team/leomc/assortedarmaments/data/gen/tags/AAItemTagsProvider.java @@ -5,6 +5,7 @@ import net.minecraft.data.tags.ItemTagsProvider; import net.minecraft.tags.ItemTags; import net.minecraft.world.level.block.Block; +import net.neoforged.neoforge.common.Tags; import net.neoforged.neoforge.common.data.ExistingFileHelper; import team.leomc.assortedarmaments.AssortedArmaments; import team.leomc.assortedarmaments.registry.AAItems; @@ -27,9 +28,34 @@ protected void addTags(HolderLookup.Provider lookupProvider) { AAItems.GOLDEN_CLAYMORE.get(), AAItems.NETHERITE_CLAYMORE.get() ); + tag(AAItemTags.MACES).add( + AAItems.WOODEN_MACE.get(), + AAItems.STONE_MACE.get(), + AAItems.IRON_MACE.get(), + AAItems.DIAMOND_MACE.get(), + AAItems.GOLDEN_MACE.get(), + AAItems.NETHERITE_MACE.get() + ); tag(AAItemTags.TWO_HANDED).addTag(AAItemTags.CLAYMORES); tag(AAItemTags.CAN_BLOCK).addTag(AAItemTags.CLAYMORES); tag(AAItemTags.EFFICIENT_SWEEP).addTag(AAItemTags.CLAYMORES); + tag(AAItemTags.ARMOR_BASED_DAMAGE).addTag(AAItemTags.MACES); + tag(AAItemTags.DISABLES_BLOCKING_ON_ATTACK).addTag(AAItemTags.MACES); + tag(AAItemTags.DISABLED_WHEN_DISABLING_BLOCKING).addTag(AAItemTags.CAN_BLOCK).addTag(Tags.Items.TOOLS_SHIELD); + tag(AAItemTags.EXTRA_KNOCKBACK).addTag(AAItemTags.MACES); + tag(AAItemTags.ZOMBIES_CAN_USE).add( + AAItems.IRON_CLAYMORE.get(), + AAItems.IRON_MACE.get() + ); + tag(AAItemTags.PIGLINS_CAN_USE).add( + AAItems.GOLDEN_CLAYMORE.get(), + AAItems.GOLDEN_MACE.get() + ); tag(ItemTags.SWORDS).addTag(AAItemTags.CLAYMORES); + tag(ItemTags.SWORD_ENCHANTABLE).addTag(AAItemTags.MACES); + tag(ItemTags.PIGLIN_LOVED).add( + AAItems.GOLDEN_CLAYMORE.get(), + AAItems.GOLDEN_MACE.get() + ); } } diff --git a/src/main/java/team/leomc/assortedarmaments/event/AACommonEvents.java b/src/main/java/team/leomc/assortedarmaments/event/AACommonEvents.java index e84abc9..d2b55c9 100644 --- a/src/main/java/team/leomc/assortedarmaments/event/AACommonEvents.java +++ b/src/main/java/team/leomc/assortedarmaments/event/AACommonEvents.java @@ -1,8 +1,14 @@ package team.leomc.assortedarmaments.event; import net.minecraft.ChatFormatting; +import net.minecraft.core.Holder; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerPlayer; import net.minecraft.tags.TagKey; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.effect.MobEffectInstance; +import net.minecraft.world.effect.MobEffects; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.ai.attributes.AttributeInstance; import net.minecraft.world.entity.ai.attributes.AttributeModifier; @@ -13,34 +19,91 @@ import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.fml.loading.FMLLoader; +import net.neoforged.neoforge.event.entity.EntityJoinLevelEvent; +import net.neoforged.neoforge.event.entity.living.LivingIncomingDamageEvent; import net.neoforged.neoforge.event.entity.living.LivingShieldBlockEvent; import net.neoforged.neoforge.event.entity.player.ItemTooltipEvent; import net.neoforged.neoforge.event.tick.EntityTickEvent; +import net.neoforged.neoforge.network.PacketDistributor; import team.leomc.assortedarmaments.AACommonConfig; import team.leomc.assortedarmaments.AssortedArmaments; +import team.leomc.assortedarmaments.network.UpdateBlockAbilityPayload; +import team.leomc.assortedarmaments.tags.AAEntityTypeTags; import team.leomc.assortedarmaments.tags.AAItemTags; +import java.util.Optional; + @EventBusSubscriber(modid = AssortedArmaments.ID) public class AACommonEvents { + public static final String TAG_BLOCKING_ABILITY_DISABLED = "blocking_ability_disabled"; + public static final String TAG_BLOCKING_DISABLED_TIME = "blocking_disabled_time"; + + @SubscribeEvent + private static void onJoinLevel(EntityJoinLevelEvent event) { + if (event.getEntity() instanceof LivingEntity living) { + if (living.getType().is(AAEntityTypeTags.ZOMBIES) && living.getRandom().nextFloat() < AACommonConfig.zombieUseWeaponChance) { + Optional> weapon = BuiltInRegistries.ITEM.getRandomElementOf(AAItemTags.ZOMBIES_CAN_USE, living.getRandom()); + if (weapon.isPresent() && weapon.get().isBound()) { + living.setItemInHand(InteractionHand.MAIN_HAND, weapon.get().value().getDefaultInstance()); + } + } + if (living.getType().is(AAEntityTypeTags.PIGLINS) && living.getRandom().nextFloat() < AACommonConfig.piglinUseWeaponChance) { + Optional> weapon = BuiltInRegistries.ITEM.getRandomElementOf(AAItemTags.PIGLINS_CAN_USE, living.getRandom()); + if (weapon.isPresent() && weapon.get().isBound()) { + living.setItemInHand(InteractionHand.MAIN_HAND, weapon.get().value().getDefaultInstance()); + } + } + } + } + + @SubscribeEvent + private static void onIncomingDamage(LivingIncomingDamageEvent event) { + LivingEntity victim = event.getEntity(); + if (event.getSource().getDirectEntity() instanceof LivingEntity living) { + if (living.getWeaponItem().is(AAItemTags.ARMOR_BASED_DAMAGE)) { + event.setAmount((float) (event.getAmount() + victim.getArmorValue() * AACommonConfig.armorBasedAttackDamagePercentage)); + } + } + } + @SubscribeEvent private static void onShieldBlock(LivingShieldBlockEvent event) { - if (event.getEntity().isUsingItem() && event.getEntity().getUseItem().is(AAItemTags.CAN_BLOCK)) { - double damage = 0; - AttributeInstance damageInstance = event.getEntity().getAttribute(Attributes.ATTACK_DAMAGE); - if (damageInstance != null) { - damage = damageInstance.getValue(); + if (event.getOriginalBlock()) { + LivingEntity blocker = event.getEntity(); + if (blocker.isUsingItem() && blocker.getUseItem().is(AAItemTags.CAN_BLOCK)) { + double damage = 0; + AttributeInstance damageInstance = blocker.getAttribute(Attributes.ATTACK_DAMAGE); + if (damageInstance != null) { + damage = damageInstance.getValue(); + } + event.setBlockedDamage(event.getDamageSource().getDirectEntity() instanceof LivingEntity ? (float) (damage / 2) : 0); + } + if (event.getDamageSource().getDirectEntity() instanceof LivingEntity living && blocker instanceof ServerPlayer serverPlayer) { + if (living.getWeaponItem().is(AAItemTags.DISABLES_BLOCKING_ON_ATTACK)) { + blocker.stopUsingItem(); + blocker.getPersistentData().putBoolean(TAG_BLOCKING_ABILITY_DISABLED, true); + blocker.getPersistentData().putInt(TAG_BLOCKING_DISABLED_TIME, 40); + blocker.addEffect(new MobEffectInstance(MobEffects.DIG_SLOWDOWN, 40, 1)); + PacketDistributor.sendToPlayer(serverPlayer, new UpdateBlockAbilityPayload(true)); + } } - event.setBlockedDamage(event.getDamageSource().getDirectEntity() instanceof LivingEntity ? (float) (damage / 2) : 0); } } public static AttributeModifier getBlockSpeedModifier() { - return new AttributeModifier(AssortedArmaments.id("block_speed"), -AACommonConfig.weaponBlockWalkSpeedModifier, AttributeModifier.Operation.ADD_MULTIPLIED_TOTAL); + return new AttributeModifier(AssortedArmaments.id("block_speed"), -AACommonConfig.blockWalkSpeedModifier, AttributeModifier.Operation.ADD_MULTIPLIED_TOTAL); } @SubscribeEvent private static void onPostEntityTick(EntityTickEvent.Post event) { if (event.getEntity() instanceof LivingEntity living && !living.level().isClientSide) { + if (living instanceof ServerPlayer serverPlayer) { + if (living.getPersistentData().getInt(TAG_BLOCKING_DISABLED_TIME) == 1) { + living.getPersistentData().putBoolean(TAG_BLOCKING_ABILITY_DISABLED, false); + PacketDistributor.sendToPlayer(serverPlayer, new UpdateBlockAbilityPayload(false)); + } + living.getPersistentData().putInt(TAG_BLOCKING_DISABLED_TIME, Math.max(living.getPersistentData().getInt(TAG_BLOCKING_DISABLED_TIME) - 1, 0)); + } AttributeInstance speedInstance = living.getAttribute(Attributes.MOVEMENT_SPEED); if (speedInstance != null) { if (living.isUsingItem() && living.getUseItem().is(AAItemTags.CAN_BLOCK)) { diff --git a/src/main/java/team/leomc/assortedarmaments/item/MaceItem.java b/src/main/java/team/leomc/assortedarmaments/item/MaceItem.java new file mode 100644 index 0000000..dddaa08 --- /dev/null +++ b/src/main/java/team/leomc/assortedarmaments/item/MaceItem.java @@ -0,0 +1,44 @@ +package team.leomc.assortedarmaments.item; + +import net.minecraft.core.component.DataComponents; +import net.minecraft.tags.BlockTags; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.EquipmentSlotGroup; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.ai.attributes.AttributeModifier; +import net.minecraft.world.entity.ai.attributes.Attributes; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Tier; +import net.minecraft.world.item.TieredItem; +import net.minecraft.world.item.component.ItemAttributeModifiers; +import net.minecraft.world.item.component.Tool; + +import java.util.List; + +public class MaceItem extends TieredItem { + public MaceItem(Tier tier, Item.Properties properties) { + super(tier, properties.component(DataComponents.TOOL, createToolProperties(tier))); + } + + public static Tool createToolProperties(Tier tier) { + return new Tool(List.of(Tool.Rule.deniesDrops(tier.getIncorrectBlocksForDrops()), Tool.Rule.minesAndDrops(BlockTags.MINEABLE_WITH_PICKAXE, Math.max(tier.getSpeed() / 2f, 1.0f))), 1.0F, 1); + } + + public static ItemAttributeModifiers createAttributes(Tier tier, float attackDamage, float attackSpeed) { + return ItemAttributeModifiers.builder() + .add(Attributes.ATTACK_DAMAGE, new AttributeModifier(BASE_ATTACK_DAMAGE_ID, attackDamage + tier.getAttackDamageBonus(), AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND) + .add(Attributes.ATTACK_SPEED, new AttributeModifier(BASE_ATTACK_SPEED_ID, attackSpeed, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND) + .build(); + } + + @Override + public boolean hurtEnemy(ItemStack stack, LivingEntity target, LivingEntity attacker) { + return true; + } + + @Override + public void postHurtEnemy(ItemStack stack, LivingEntity target, LivingEntity attacker) { + stack.hurtAndBreak(1, attacker, EquipmentSlot.MAINHAND); + } +} diff --git a/src/main/java/team/leomc/assortedarmaments/mixin/ItemStackMixin.java b/src/main/java/team/leomc/assortedarmaments/mixin/ItemStackMixin.java index eaf1be0..19717f9 100644 --- a/src/main/java/team/leomc/assortedarmaments/mixin/ItemStackMixin.java +++ b/src/main/java/team/leomc/assortedarmaments/mixin/ItemStackMixin.java @@ -11,12 +11,16 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import team.leomc.assortedarmaments.event.AACommonEvents; import team.leomc.assortedarmaments.tags.AAItemTags; @Mixin(ItemStack.class) public abstract class ItemStackMixin { @Inject(method = "use", at = @At("HEAD"), cancellable = true) private void use(Level level, Player player, InteractionHand usedHand, CallbackInfoReturnable> cir) { + if (player.getPersistentData().getBoolean(AACommonEvents.TAG_BLOCKING_ABILITY_DISABLED) && player.getItemInHand(usedHand).is(AAItemTags.DISABLED_WHEN_DISABLING_BLOCKING)) { + cir.setReturnValue(InteractionResultHolder.pass(player.getItemInHand(usedHand))); + } if (player.getMainHandItem().is(AAItemTags.TWO_HANDED) && usedHand == InteractionHand.OFF_HAND) { cir.setReturnValue(InteractionResultHolder.pass(player.getOffhandItem())); } @@ -24,6 +28,9 @@ private void use(Level level, Player player, InteractionHand usedHand, CallbackI @Inject(method = "useOn", at = @At("HEAD"), cancellable = true) private void useOn(UseOnContext context, CallbackInfoReturnable cir) { + if (context.getPlayer() != null && context.getPlayer().getPersistentData().getBoolean(AACommonEvents.TAG_BLOCKING_ABILITY_DISABLED) && context.getPlayer().getItemInHand(context.getHand()).is(AAItemTags.DISABLED_WHEN_DISABLING_BLOCKING)) { + cir.setReturnValue(InteractionResult.PASS); + } if (context.getPlayer() != null && context.getPlayer().getMainHandItem().is(AAItemTags.TWO_HANDED) && context.getHand() == InteractionHand.OFF_HAND) { cir.setReturnValue(InteractionResult.PASS); } diff --git a/src/main/java/team/leomc/assortedarmaments/mixin/LivingEntityMixin.java b/src/main/java/team/leomc/assortedarmaments/mixin/LivingEntityMixin.java new file mode 100644 index 0000000..7ea3c62 --- /dev/null +++ b/src/main/java/team/leomc/assortedarmaments/mixin/LivingEntityMixin.java @@ -0,0 +1,28 @@ +package team.leomc.assortedarmaments.mixin; + +import net.minecraft.world.damagesource.DamageSource; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ItemStack; +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 team.leomc.assortedarmaments.tags.AAItemTags; + +import javax.annotation.Nonnull; + +@Mixin(LivingEntity.class) +public abstract class LivingEntityMixin { + @Shadow + @Nonnull + public abstract ItemStack getWeaponItem(); + + @Inject(method = "getKnockback", at = @At("RETURN"), cancellable = true) + private void getKnockback(Entity target, DamageSource damageSource, CallbackInfoReturnable cir) { + if (getWeaponItem().is(AAItemTags.EXTRA_KNOCKBACK)) { + cir.setReturnValue(cir.getReturnValue() + 1); + } + } +} diff --git a/src/main/java/team/leomc/assortedarmaments/network/AANetwork.java b/src/main/java/team/leomc/assortedarmaments/network/AANetwork.java new file mode 100644 index 0000000..332fa99 --- /dev/null +++ b/src/main/java/team/leomc/assortedarmaments/network/AANetwork.java @@ -0,0 +1,24 @@ +package team.leomc.assortedarmaments.network; + +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.EventBusSubscriber; +import net.neoforged.neoforge.network.event.RegisterPayloadHandlersEvent; +import net.neoforged.neoforge.network.handling.DirectionalPayloadHandler; +import net.neoforged.neoforge.network.registration.PayloadRegistrar; +import team.leomc.assortedarmaments.AssortedArmaments; + +@EventBusSubscriber(modid = AssortedArmaments.ID, bus = EventBusSubscriber.Bus.MOD) +public class AANetwork { + @SubscribeEvent + public static void register(RegisterPayloadHandlersEvent event) { + PayloadRegistrar registrar = event.registrar("1"); + registrar.playToClient( + UpdateBlockAbilityPayload.TYPE, + UpdateBlockAbilityPayload.STREAM_CODEC, + new DirectionalPayloadHandler<>( + UpdateBlockAbilityPayload::handle, + UpdateBlockAbilityPayload::handle + ) + ); + } +} diff --git a/src/main/java/team/leomc/assortedarmaments/network/UpdateBlockAbilityPayload.java b/src/main/java/team/leomc/assortedarmaments/network/UpdateBlockAbilityPayload.java new file mode 100644 index 0000000..b9b9ed3 --- /dev/null +++ b/src/main/java/team/leomc/assortedarmaments/network/UpdateBlockAbilityPayload.java @@ -0,0 +1,25 @@ +package team.leomc.assortedarmaments.network; + +import com.mojang.serialization.Codec; +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.codec.ByteBufCodecs; +import net.minecraft.network.codec.StreamCodec; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.neoforged.neoforge.network.handling.IPayloadContext; +import team.leomc.assortedarmaments.AssortedArmaments; +import team.leomc.assortedarmaments.event.AACommonEvents; + +public record UpdateBlockAbilityPayload(boolean disabled) implements CustomPacketPayload { + public static final Type TYPE = new Type<>(AssortedArmaments.id("update_block_ability")); + public static final Codec CODEC = Codec.BOOL.xmap(UpdateBlockAbilityPayload::new, UpdateBlockAbilityPayload::disabled); + public static final StreamCodec STREAM_CODEC = ByteBufCodecs.fromCodecWithRegistries(CODEC); + + public static void handle(UpdateBlockAbilityPayload payload, IPayloadContext context) { + context.player().getPersistentData().putBoolean(AACommonEvents.TAG_BLOCKING_ABILITY_DISABLED, payload.disabled()); + } + + @Override + public Type type() { + return TYPE; + } +} diff --git a/src/main/java/team/leomc/assortedarmaments/registry/AAItems.java b/src/main/java/team/leomc/assortedarmaments/registry/AAItems.java index 35a8c8c..4938c3a 100644 --- a/src/main/java/team/leomc/assortedarmaments/registry/AAItems.java +++ b/src/main/java/team/leomc/assortedarmaments/registry/AAItems.java @@ -6,6 +6,7 @@ import net.neoforged.neoforge.registries.DeferredRegister; import team.leomc.assortedarmaments.AssortedArmaments; import team.leomc.assortedarmaments.item.ClaymoreItem; +import team.leomc.assortedarmaments.item.MaceItem; public class AAItems { public static final DeferredRegister.Items ITEMS = DeferredRegister.createItems(AssortedArmaments.ID); @@ -17,4 +18,12 @@ public class AAItems { public static final DeferredItem DIAMOND_CLAYMORE = ITEMS.register("diamond_claymore", () -> new ClaymoreItem(Tiers.DIAMOND, new Item.Properties().attributes(ClaymoreItem.createAttributes(Tiers.DIAMOND, 5f, -2.9f, 0.5f)))); public static final DeferredItem GOLDEN_CLAYMORE = ITEMS.register("golden_claymore", () -> new ClaymoreItem(Tiers.GOLD, new Item.Properties().attributes(ClaymoreItem.createAttributes(Tiers.GOLD, 5f, -2.9f, 0.5f)))); public static final DeferredItem NETHERITE_CLAYMORE = ITEMS.register("netherite_claymore", () -> new ClaymoreItem(Tiers.NETHERITE, new Item.Properties().attributes(ClaymoreItem.createAttributes(Tiers.NETHERITE, 5f, -2.9f, 0.5f)))); + + // maces + public static final DeferredItem WOODEN_MACE = ITEMS.register("wooden_mace", () -> new MaceItem(Tiers.WOOD, new Item.Properties().attributes(MaceItem.createAttributes(Tiers.WOOD, 4.5f, -3f)))); + public static final DeferredItem STONE_MACE = ITEMS.register("stone_mace", () -> new MaceItem(Tiers.STONE, new Item.Properties().attributes(MaceItem.createAttributes(Tiers.STONE, 4.5f, -3f)))); + public static final DeferredItem IRON_MACE = ITEMS.register("iron_mace", () -> new MaceItem(Tiers.IRON, new Item.Properties().attributes(MaceItem.createAttributes(Tiers.IRON, 4.5f, -3f)))); + public static final DeferredItem DIAMOND_MACE = ITEMS.register("diamond_mace", () -> new MaceItem(Tiers.DIAMOND, new Item.Properties().attributes(MaceItem.createAttributes(Tiers.DIAMOND, 4.5f, -3f)))); + public static final DeferredItem GOLDEN_MACE = ITEMS.register("golden_mace", () -> new MaceItem(Tiers.GOLD, new Item.Properties().attributes(MaceItem.createAttributes(Tiers.GOLD, 4.5f, -3f)))); + public static final DeferredItem NETHERITE_MACE = ITEMS.register("netherite_mace", () -> new MaceItem(Tiers.NETHERITE, new Item.Properties().attributes(MaceItem.createAttributes(Tiers.NETHERITE, 4.5f, -3f)))); } diff --git a/src/main/java/team/leomc/assortedarmaments/tags/AAEntityTypeTags.java b/src/main/java/team/leomc/assortedarmaments/tags/AAEntityTypeTags.java new file mode 100644 index 0000000..ff20882 --- /dev/null +++ b/src/main/java/team/leomc/assortedarmaments/tags/AAEntityTypeTags.java @@ -0,0 +1,15 @@ +package team.leomc.assortedarmaments.tags; + +import net.minecraft.core.registries.Registries; +import net.minecraft.tags.TagKey; +import net.minecraft.world.entity.EntityType; +import team.leomc.assortedarmaments.AssortedArmaments; + +public class AAEntityTypeTags { + public static final TagKey> ZOMBIES = create("zombies"); + public static final TagKey> PIGLINS = create("piglins"); + + private static TagKey> create(String id) { + return TagKey.create(Registries.ENTITY_TYPE, AssortedArmaments.id(id)); + } +} diff --git a/src/main/java/team/leomc/assortedarmaments/tags/AAItemTags.java b/src/main/java/team/leomc/assortedarmaments/tags/AAItemTags.java index 1e9da12..75d69f5 100644 --- a/src/main/java/team/leomc/assortedarmaments/tags/AAItemTags.java +++ b/src/main/java/team/leomc/assortedarmaments/tags/AAItemTags.java @@ -11,12 +11,22 @@ public class AAItemTags { public static final TagKey TWO_HANDED = create("two_handed"); public static final TagKey CAN_BLOCK = create("can_block"); public static final TagKey EFFICIENT_SWEEP = create("efficient_sweep"); + public static final TagKey ARMOR_BASED_DAMAGE = create("armor_based_damage"); + public static final TagKey DISABLES_BLOCKING_ON_ATTACK = create("disables_blocking_on_attack"); + public static final TagKey DISABLED_WHEN_DISABLING_BLOCKING = create("disabled_when_disabling_blocking"); + public static final TagKey EXTRA_KNOCKBACK = create("extra_knockback"); public static final TagKey CLAYMORES = create("claymores"); + public static final TagKey MACES = create("maces"); + public static final TagKey ZOMBIES_CAN_USE = create("zombies_can_use"); + public static final TagKey PIGLINS_CAN_USE = create("piglins_can_use"); public static final List> TOOLTIP_TAGS = List.of( TWO_HANDED, CAN_BLOCK, - EFFICIENT_SWEEP + EFFICIENT_SWEEP, + ARMOR_BASED_DAMAGE, + DISABLES_BLOCKING_ON_ATTACK, + EXTRA_KNOCKBACK ); private static TagKey create(String id) { diff --git a/src/main/resources/assets/assorted_armaments/textures/item/diamond_mace.png b/src/main/resources/assets/assorted_armaments/textures/item/diamond_mace.png new file mode 100644 index 0000000000000000000000000000000000000000..9866870583f31d2d1a6731864a18532082f682e9 GIT binary patch literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~l>na*S0K%2 zZ^ogjVEp>@lD{9ckFSyIDi=)-&G3`+G!xa3Sh1K#dyW%DB}X4!3>_RelF{r5}E)R C?@jIi literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/assorted_armaments/textures/item/golden_mace.png b/src/main/resources/assets/assorted_armaments/textures/item/golden_mace.png new file mode 100644 index 0000000000000000000000000000000000000000..b77499bd219c26b238418312e9dc31bcba0c1c96 GIT binary patch literal 304 zcmV-00nh%4P)Px#>PbXFR5*>*k|A%xP!xqv3+^Qdnod5;Qw)Xe>}DrMmXP534=^}f|3Gymwx$?J zrl&SFM8$$Dj6z6|>T}?2{z3*k#~1sHC86VzM1g(0j>YBfxUqL6p?-`uJy- zo`%jbT_>lZLnVb-4JE}tFby4^UgWC0W{tz{1CPx#>`6pHR5*>*k|9pSU=W30Hz<&#$*4_GCHW1inuIYGi|7e(khHx-9T(^k>e>@D z6OMps(n?lgkOcWK{2SO1`d9MQjQHN<%}j(qsVaRv3`6AWlTZTy$nzZII068VjTWby z8H=KznbFKBB3veqU@zZ`2sa@n(=?%~szcv(9h`FjfIkgXl|FZpB$($JWm&>Ghq|r- z0EmnV`|^`VGGRCm=CvGiU^ygp{nxxITzu_`-GRvIG61hedd2RT00O#lD@07*qoM6N<$ Ef~22=s{jB1 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/assorted_armaments/textures/item/netherite_mace.png b/src/main/resources/assets/assorted_armaments/textures/item/netherite_mace.png new file mode 100644 index 0000000000000000000000000000000000000000..a1a07c4c0c2e4d0986466c8b9ef77f164eb3fe45 GIT binary patch literal 228 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~tpJ}8S0LS1 z-ByrZ5E~X-?CKoo;^%K;mtbOKZE5YL>0qR;uCJ)1EFdJtA@bs-^J<`KzLFrnV21xl zfT7C6WF}C?&(p;*L}KdPes4YpMGj`}6}&CK=YOvi*@0y-+jK-u5nmi%VDD+$;AF?#=R1t$qb&Z KelF{r5}E+3v{2mu literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/assorted_armaments/textures/item/stone_mace.png b/src/main/resources/assets/assorted_armaments/textures/item/stone_mace.png new file mode 100644 index 0000000000000000000000000000000000000000..f008d122ffb7469f01bedd1aef7eae62f4c13dd7 GIT binary patch literal 216 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~#Q>iWS0KH4 zkWutGx;o_VaXc z43U^Rx8G6dfB^@SX!eCa{}1NshZgH>cV%ar=&zF6@gXr#_QbhmT>9;7q1$!JS`}X_ ze{|V$CZhA6;Pq*7KR5k(zV~`z`k7v#%R3l92s3V8IAyOD&}0TrS3j3^P6iWS0LS) zuHKfaRvMw0;U^dAEa_<`>TV`tt|_1)$E_g2wR08o9H1iZk|4iehW~I-TUL7&DD3Cy z;us<^wYJ}pkHwLLsn=xUhyU#P^UDlo@|e4dtTfJ%J`Oc)I$ztaD0e0sy!Y BOAr76 literal 0 HcmV?d00001 diff --git a/src/main/resources/assorted_armaments.mixins.json b/src/main/resources/assorted_armaments.mixins.json index 7032311..545fbad 100644 --- a/src/main/resources/assorted_armaments.mixins.json +++ b/src/main/resources/assorted_armaments.mixins.json @@ -6,6 +6,7 @@ "refmap": "bcs_expedition_world.refmap.json", "mixins": [ "ItemStackMixin", + "LivingEntityMixin", "PlayerMixin" ], "client": [