From 0e65b203a87aa7fc665e1f7a8340eed621d8c368 Mon Sep 17 00:00:00 2001 From: brnbrd Date: Thu, 3 Oct 2024 22:37:28 -0700 Subject: [PATCH] Shoot Urchin Dart with bamboo in offhand for faster speed --- .../2e975a526352ade1ad4fb90b352cd5fb8d2e73d8 | 3 +- .../c622617f6fabf890a00b9275cd5f643584a8a2c8 | 4 +-- .../assets/collectorsreap/lang/en_us.json | 1 + .../tags/items/dart_shooters.json | 5 ++++ .../common/item/UrchinDartItem.java | 14 +++++++--- .../collectorsreap/compat/JEIPlugin.java | 24 ++++++++++------ .../brdle/collectorsreap/data/CRItemTags.java | 1 + .../data/gen/CRItemTagProvider.java | 2 ++ .../data/gen/CRLanguageProvider.java | 1 + .../assets/collectorsreap/lang/es_es.json | 1 + .../assets/collectorsreap/lang/es_mx.json | 1 + .../assets/collectorsreap/lang/ja_jp.json | 1 + .../assets/collectorsreap/lang/ko_kr.json | 1 + .../assets/collectorsreap/lang/ru_ru.json | 1 + .../assets/collectorsreap/lang/uk_ua.json | 1 + .../assets/collectorsreap/lang/vi_vn.json | 1 + .../assets/collectorsreap/lang/zh_cn.json | 1 + .../models/item/urchin_dart.json | 28 ++++++++----------- 18 files changed, 60 insertions(+), 31 deletions(-) create mode 100644 src/generated/resources/data/collectorsreap/tags/items/dart_shooters.json diff --git a/src/generated/resources/.cache/2e975a526352ade1ad4fb90b352cd5fb8d2e73d8 b/src/generated/resources/.cache/2e975a526352ade1ad4fb90b352cd5fb8d2e73d8 index 05cec6d0..cca53781 100644 --- a/src/generated/resources/.cache/2e975a526352ade1ad4fb90b352cd5fb8d2e73d8 +++ b/src/generated/resources/.cache/2e975a526352ade1ad4fb90b352cd5fb8d2e73d8 @@ -1,7 +1,8 @@ -// 1.20.1 2024-09-29T06:53:48.3346164 Tags for minecraft:item mod id collectorsreap +// 1.20.1 2024-10-03T14:37:57.8359469 Tags for minecraft:item mod id collectorsreap ae7e08f92dd075f34544c04d30c8a274b27bd792 data/atmospheric/tags/items/aloe_leaves.json b1c02044b6eb4060b19a0ed4f40cbeaca19822c9 data/atmospheric/tags/items/passion_fruit.json a740abeb613a7024a35910efe912a50a6ee62045 data/atmospheric/tags/items/yucca_fruit.json +578dd629e6c69bf5641983afdf5f54ca2d3b5882 data/collectorsreap/tags/items/dart_shooters.json 22441868a2c5fde8be95de5573f16aacdf8fecb2 data/collectorsreap/tags/items/gummies.json 88055c196d1b1d1dc8d81f028dba0bb58d473524 data/collectorsreap/tags/items/hot_nether_fruit.json 3aadbf88623a2fde7e33b2e4942a79d1e72c9cbf data/collectorsreap/tags/items/lime_or_slice.json diff --git a/src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 b/src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 index c20c2ca3..71ff1ee7 100644 --- a/src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 +++ b/src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8 @@ -1,2 +1,2 @@ -// 1.20.1 2024-10-03T09:17:39.3339556 Languages: en_us -319c349574e4de43eb9d3148e21f34c2749bd77c assets/collectorsreap/lang/en_us.json +// 1.20.1 2024-10-03T15:29:45.2211148 Languages: en_us +18437320b812c58bf74bea81c12dd6acba1ccff1 assets/collectorsreap/lang/en_us.json diff --git a/src/generated/resources/assets/collectorsreap/lang/en_us.json b/src/generated/resources/assets/collectorsreap/lang/en_us.json index 79021513..e7cec1ed 100644 --- a/src/generated/resources/assets/collectorsreap/lang/en_us.json +++ b/src/generated/resources/assets/collectorsreap/lang/en_us.json @@ -64,6 +64,7 @@ "desc.collectorsreap.pomegranate.pollination": "A flowering Pomegranate Bush will grow fruit in the Overworld when pollinated by a Bee.", "desc.collectorsreap.portobello": "Portobellos can be rarely found in meadows.", "desc.collectorsreap.stygian_pomegranate": "Stygian Pomegranates are a dangerous variant that can be rarely picked from Pomegranate Bushes growing on Resurgent Soil.", + "desc.collectorsreap.urchin_dart": "Urchin Darts are throwable projectiles that poison enemies for five seconds upon contact. Holding a bamboo in your offhand shoots a faster dart.", "effect.collectorsreap.corrosion": "Corrosion", "effect.collectorsreap.corrosion.description": "Provides the user a defensive acid shield, corroding projectiles and damaging attack weapons.", "effect.collectorsreap.volatility": "Volatility", diff --git a/src/generated/resources/data/collectorsreap/tags/items/dart_shooters.json b/src/generated/resources/data/collectorsreap/tags/items/dart_shooters.json new file mode 100644 index 00000000..acf1b10b --- /dev/null +++ b/src/generated/resources/data/collectorsreap/tags/items/dart_shooters.json @@ -0,0 +1,5 @@ +{ + "values": [ + "minecraft:bamboo" + ] +} \ No newline at end of file diff --git a/src/main/java/net/brdle/collectorsreap/common/item/UrchinDartItem.java b/src/main/java/net/brdle/collectorsreap/common/item/UrchinDartItem.java index 7e87ee3f..d9437e80 100644 --- a/src/main/java/net/brdle/collectorsreap/common/item/UrchinDartItem.java +++ b/src/main/java/net/brdle/collectorsreap/common/item/UrchinDartItem.java @@ -2,6 +2,7 @@ import net.brdle.collectorsreap.common.CRSoundEvents; import net.brdle.collectorsreap.common.entity.UrchinDart; +import net.brdle.collectorsreap.data.CRItemTags; import net.minecraft.sounds.SoundSource; import net.minecraft.stats.Stats; import net.minecraft.world.InteractionHand; @@ -20,9 +21,12 @@ public UrchinDartItem(Properties properties) { } @Override - public @NotNull InteractionResultHolder use(@NotNull Level level, Player player, @NotNull InteractionHand hand) { - player.startUsingItem(hand); - return InteractionResultHolder.consume(player.getItemInHand(hand)); + public @NotNull InteractionResultHolder use(@NotNull Level level, @NotNull Player player, @NotNull InteractionHand hand) { + if (hand == InteractionHand.MAIN_HAND) { + player.startUsingItem(hand); + return InteractionResultHolder.consume(player.getItemInHand(hand)); + } + return super.use(level, player, hand); } @Override @@ -42,8 +46,10 @@ public void releaseUsing(@NotNull ItemStack stack, @NotNull Level level, @NotNul level.playSound(null, player.getX(), player.getY(), player.getZ(), CRSoundEvents.URCHIN_DART_THROW.get(), SoundSource.NEUTRAL, 0.5F, 0.4F / (level.getRandom().nextFloat() * 0.4F + 0.8F)); player.getCooldowns().addCooldown(this, 20); if (!level.isClientSide()) { + float velocity = player.getItemInHand(InteractionHand.OFF_HAND).is(CRItemTags.DART_SHOOTERS) ? + 2.8F : 2.1F; UrchinDart dart = new UrchinDart(player, level); - dart.shootFromRotation(player, player.getXRot(), player.getYRot(), 0.0F, 2.1F, 1.0F); + dart.shootFromRotation(player, player.getXRot(), player.getYRot(), 0.0F, velocity, 1.0F); level.addFreshEntity(dart); } player.awardStat(Stats.ITEM_USED.get(this)); diff --git a/src/main/java/net/brdle/collectorsreap/compat/JEIPlugin.java b/src/main/java/net/brdle/collectorsreap/compat/JEIPlugin.java index 6aa6ff3c..df2aeb61 100644 --- a/src/main/java/net/brdle/collectorsreap/compat/JEIPlugin.java +++ b/src/main/java/net/brdle/collectorsreap/compat/JEIPlugin.java @@ -48,7 +48,7 @@ public void registerRecipes(IRecipeRegistration registration) { // Lime String limeTranslationKey = "desc." + CollectorsReap.MODID + "." + Util.name(CRItems.LIME); List limeStack = List.of(Util.gs(CRItems.LIME), Util.gs(CRItems.LIME_SLICE)); - if (CRConfig.LIME_POLLINATION.get()) { + if (CRConfig.verify(CRItems.LIME) && CRConfig.LIME_POLLINATION.get()) { registration.addItemStackInfo(limeStack, Component.translatable(limeTranslationKey), Component.translatable(limeTranslationKey + ".pollination") ); @@ -59,13 +59,21 @@ public void registerRecipes(IRecipeRegistration registration) { // Pomegranate String pomTranslationKey = "desc." + CollectorsReap.MODID + "." + Util.name(CRItems.POMEGRANATE); List pomStack = List.of(Util.gs(CRItems.POMEGRANATE), Util.gs(CRItems.POMEGRANATE_SLICE)); - if (CRConfig.POMEGRANATE_POLLINATION.get()) { - registration.addItemStackInfo(pomStack, - Component.translatable(pomTranslationKey), - Component.translatable(pomTranslationKey + ".pollination") - ); - } else { - registration.addItemStackInfo(pomStack, Component.translatable(pomTranslationKey)); + if (CRConfig.verify(CRItems.POMEGRANATE)) { + if (CRConfig.POMEGRANATE_POLLINATION.get()) { + registration.addItemStackInfo(pomStack, + Component.translatable(pomTranslationKey), + Component.translatable(pomTranslationKey + ".pollination") + ); + } else { + registration.addItemStackInfo(pomStack, Component.translatable(pomTranslationKey)); + } + } + + // Urchin Dart + String dartTranslationKey = "desc." + CollectorsReap.MODID + "." + Util.name(CRItems.URCHIN_DART); + if (CRConfig.verify(CRItems.URCHIN_DART)) { + registration.addItemStackInfo(Util.gs(CRItems.URCHIN_DART), Component.translatable(dartTranslationKey)); } if (ModList.get().isLoaded("mynethersdelight")) { diff --git a/src/main/java/net/brdle/collectorsreap/data/CRItemTags.java b/src/main/java/net/brdle/collectorsreap/data/CRItemTags.java index d35acfc8..c570d2bf 100644 --- a/src/main/java/net/brdle/collectorsreap/data/CRItemTags.java +++ b/src/main/java/net/brdle/collectorsreap/data/CRItemTags.java @@ -37,6 +37,7 @@ public class CRItemTags { public static final TagKey GUMMIES = cr("gummies"); public static final TagKey LIME_OR_SLICE = cr("lime_or_slice"); public static final TagKey HOT_NETHER_FRUIT = cr("hot_nether_fruit"); + public static final TagKey DART_SHOOTERS = cr("dart_shooters"); // Diet public static final TagKey DIET_FRUITS = Util.it("diet", "fruits"); diff --git a/src/main/java/net/brdle/collectorsreap/data/gen/CRItemTagProvider.java b/src/main/java/net/brdle/collectorsreap/data/gen/CRItemTagProvider.java index 14e095fe..2de7879d 100644 --- a/src/main/java/net/brdle/collectorsreap/data/gen/CRItemTagProvider.java +++ b/src/main/java/net/brdle/collectorsreap/data/gen/CRItemTagProvider.java @@ -139,6 +139,8 @@ public void addTags(HolderLookup.@NotNull Provider provider) { .addOptional(Util.rl("deep_aether", "quail_egg")); this.tag(ForgeTags.EGGS) .addTag(CRItemTags.EGGS_BIRD); + this.tag(CRItemTags.DART_SHOOTERS) + .add(Items.BAMBOO); // Neapolitan this.addSelf(CRItemTags.BANANA); diff --git a/src/main/java/net/brdle/collectorsreap/data/gen/CRLanguageProvider.java b/src/main/java/net/brdle/collectorsreap/data/gen/CRLanguageProvider.java index baf52692..a768ae7d 100644 --- a/src/main/java/net/brdle/collectorsreap/data/gen/CRLanguageProvider.java +++ b/src/main/java/net/brdle/collectorsreap/data/gen/CRLanguageProvider.java @@ -46,6 +46,7 @@ private void addText() { add("desc." + CollectorsReap.MODID + "." + Util.name(CRItems.POMEGRANATE), "Pomegranates can be found as a wild bush in warped forests."); add("desc." + CollectorsReap.MODID + "." + Util.name(CRItems.POMEGRANATE) + ".pollination", "A flowering Pomegranate Bush will grow fruit in the Overworld when pollinated by a Bee."); add("desc." + CollectorsReap.MODID + "." + Util.name(CRItems.STYGIAN_POMEGRANATE), "Stygian Pomegranates are a dangerous variant that can be rarely picked from Pomegranate Bushes growing on Resurgent Soil."); + add("desc." + CollectorsReap.MODID + "." + Util.name(CRItems.URCHIN_DART), "Urchin Darts are throwable projectiles that poison enemies for five seconds upon contact. Holding a bamboo in your offhand shoots a faster dart."); add("config.jade.plugin_" + CollectorsReap.MODID + ".crop_progress", "Crop Progress"); add(CollectorsReap.MODID + ".subtitle.urchin_dart.throw", "Urchin Dart thrown"); add(CollectorsReap.MODID + ".subtitle.urchin_dart.hit", "Urchin Dart hits"); diff --git a/src/main/resources/assets/collectorsreap/lang/es_es.json b/src/main/resources/assets/collectorsreap/lang/es_es.json index d5ce8a0c..94beb7de 100644 --- a/src/main/resources/assets/collectorsreap/lang/es_es.json +++ b/src/main/resources/assets/collectorsreap/lang/es_es.json @@ -64,6 +64,7 @@ "desc.collectorsreap.pomegranate.pollination": "A flowering Pomegranate Bush will grow fruit in the Overworld when pollinated by a Bee.", "desc.collectorsreap.portobello": "Encontrado en prados.", "desc.collectorsreap.stygian_pomegranate": "Stygian Pomegranates are a dangerous variant that can be occasionally picked from Pomegranate Bushes growing on Resurgent Soil.", + "desc.collectorsreap.urchin_dart": "Urchin Darts are throwable projectiles that poison enemies for five seconds upon contact. Holding a bamboo in your offhand shoots a faster dart.", "effect.collectorsreap.corrosion": "Corrosión", "effect.collectorsreap.corrosion.description": "Provee al usuario un escudo de ácido defensivo, corroyendo proyectiles y dañando las armas de ataque.", "effect.collectorsreap.volatility": "Volatilidad", diff --git a/src/main/resources/assets/collectorsreap/lang/es_mx.json b/src/main/resources/assets/collectorsreap/lang/es_mx.json index 9eab9d8e..f87817e8 100644 --- a/src/main/resources/assets/collectorsreap/lang/es_mx.json +++ b/src/main/resources/assets/collectorsreap/lang/es_mx.json @@ -64,6 +64,7 @@ "desc.collectorsreap.pomegranate.pollination": "A flowering Pomegranate Bush will grow fruit in the Overworld when pollinated by a Bee.", "desc.collectorsreap.portobello": "Encontrado en prados.", "desc.collectorsreap.stygian_pomegranate": "Stygian Pomegranates are a dangerous variant that can be occasionally picked from Pomegranate Bushes growing on Resurgent Soil.", + "desc.collectorsreap.urchin_dart": "Urchin Darts are throwable projectiles that poison enemies for five seconds upon contact. Holding a bamboo in your offhand shoots a faster dart.", "effect.collectorsreap.corrosion": "Corrosión", "effect.collectorsreap.corrosion.description": "Provee al usuario un escudo de ácido defensivo, corroyendo proyectiles y dañando las armas de ataque.", "effect.collectorsreap.volatility": "Volatilidad", diff --git a/src/main/resources/assets/collectorsreap/lang/ja_jp.json b/src/main/resources/assets/collectorsreap/lang/ja_jp.json index 44d3ac54..88eec742 100644 --- a/src/main/resources/assets/collectorsreap/lang/ja_jp.json +++ b/src/main/resources/assets/collectorsreap/lang/ja_jp.json @@ -64,6 +64,7 @@ "desc.collectorsreap.pomegranate.pollination": "A flowering Pomegranate Bush will grow fruit in the Overworld when pollinated by a Bee.", "desc.collectorsreap.portobello": "Found in Meadows.", "desc.collectorsreap.stygian_pomegranate": "Stygian Pomegranates are a dangerous variant that can be occasionally picked from Pomegranate Bushes growing on Resurgent Soil.", + "desc.collectorsreap.urchin_dart": "Urchin Darts are throwable projectiles that poison enemies for five seconds upon contact. Holding a bamboo in your offhand shoots a faster dart.", "effect.collectorsreap.corrosion": "Corrosion", "effect.collectorsreap.corrosion.description": "Provides the user a defensive acid shield, corroding projectiles and damaging attack weapons.", "effect.collectorsreap.volatility": "Volatility", diff --git a/src/main/resources/assets/collectorsreap/lang/ko_kr.json b/src/main/resources/assets/collectorsreap/lang/ko_kr.json index e8dc70d1..b91e0c21 100644 --- a/src/main/resources/assets/collectorsreap/lang/ko_kr.json +++ b/src/main/resources/assets/collectorsreap/lang/ko_kr.json @@ -64,6 +64,7 @@ "desc.collectorsreap.pomegranate.pollination": "A flowering Pomegranate Bush will grow fruit in the Overworld when pollinated by a Bee.", "desc.collectorsreap.portobello": "목초지에서 발견할 수 있습니다.", "desc.collectorsreap.stygian_pomegranate": "Stygian Pomegranates are a dangerous variant that can be occasionally picked from Pomegranate Bushes growing on Resurgent Soil.", + "desc.collectorsreap.urchin_dart": "Urchin Darts are throwable projectiles that poison enemies for five seconds upon contact. Holding a bamboo in your offhand shoots a faster dart.", "effect.collectorsreap.corrosion": "Corrosion", "effect.collectorsreap.corrosion.description": "Provides the user a defensive acid shield, corroding projectiles and damaging attack weapons.", "effect.collectorsreap.volatility": "Volatility", diff --git a/src/main/resources/assets/collectorsreap/lang/ru_ru.json b/src/main/resources/assets/collectorsreap/lang/ru_ru.json index 2bb9dc1a..3b335196 100644 --- a/src/main/resources/assets/collectorsreap/lang/ru_ru.json +++ b/src/main/resources/assets/collectorsreap/lang/ru_ru.json @@ -64,6 +64,7 @@ "desc.collectorsreap.pomegranate.pollination": "A flowering Pomegranate Bush will grow fruit in the Overworld when pollinated by a Bee.", "desc.collectorsreap.portobello": "Можно найти на лугах.", "desc.collectorsreap.stygian_pomegranate": "Stygian Pomegranates are a dangerous variant that can be occasionally picked from Pomegranate Bushes growing on Resurgent Soil.", + "desc.collectorsreap.urchin_dart": "Urchin Darts are throwable projectiles that poison enemies for five seconds upon contact. Holding a bamboo in your offhand shoots a faster dart.", "effect.collectorsreap.corrosion": "Коррозия", "effect.collectorsreap.corrosion.description": "Даёт игроку защитный кислотный щит, который разъедает снаряды и атакующее оружие.", "effect.collectorsreap.volatility": "Летучесть", diff --git a/src/main/resources/assets/collectorsreap/lang/uk_ua.json b/src/main/resources/assets/collectorsreap/lang/uk_ua.json index d9f3ad22..39942130 100644 --- a/src/main/resources/assets/collectorsreap/lang/uk_ua.json +++ b/src/main/resources/assets/collectorsreap/lang/uk_ua.json @@ -64,6 +64,7 @@ "desc.collectorsreap.pomegranate.pollination": "A flowering Pomegranate Bush will grow fruit in the Overworld when pollinated by a Bee.", "desc.collectorsreap.portobello": "Можна знайти на Луках.", "desc.collectorsreap.stygian_pomegranate": "Stygian Pomegranates are a dangerous variant that can be occasionally picked from Pomegranate Bushes growing on Resurgent Soil.", + "desc.collectorsreap.urchin_dart": "Urchin Darts are throwable projectiles that poison enemies for five seconds upon contact. Holding a bamboo in your offhand shoots a faster dart.", "effect.collectorsreap.corrosion": "Корозія", "effect.collectorsreap.corrosion.description": "Дає гравцеві захисний, кислотний щит, що роз'їдає снаряди та пошкоджує атакуючу зброю.", "effect.collectorsreap.volatility": "Невловимість", diff --git a/src/main/resources/assets/collectorsreap/lang/vi_vn.json b/src/main/resources/assets/collectorsreap/lang/vi_vn.json index db38467c..c53f8a7c 100644 --- a/src/main/resources/assets/collectorsreap/lang/vi_vn.json +++ b/src/main/resources/assets/collectorsreap/lang/vi_vn.json @@ -64,6 +64,7 @@ "desc.collectorsreap.pomegranate.pollination": "A flowering Pomegranate Bush will grow fruit in the Overworld when pollinated by a Bee.", "desc.collectorsreap.portobello": "Tìm Trong Đồng Cỏ.", "desc.collectorsreap.stygian_pomegranate": "Stygian Pomegranates are a dangerous variant that can be occasionally picked from Pomegranate Bushes growing on Resurgent Soil.", + "desc.collectorsreap.urchin_dart": "Urchin Darts are throwable projectiles that poison enemies for five seconds upon contact. Holding a bamboo in your offhand shoots a faster dart.", "effect.collectorsreap.corrosion": "Ăn Mòn", "effect.collectorsreap.corrosion.description": "Cung Cấp Axit Phòng Thủ.", "effect.collectorsreap.volatility": "Biến Động", diff --git a/src/main/resources/assets/collectorsreap/lang/zh_cn.json b/src/main/resources/assets/collectorsreap/lang/zh_cn.json index 467bfdf2..f0452426 100644 --- a/src/main/resources/assets/collectorsreap/lang/zh_cn.json +++ b/src/main/resources/assets/collectorsreap/lang/zh_cn.json @@ -64,6 +64,7 @@ "desc.collectorsreap.pomegranate.pollination": "开花的石榴树丛在蜜蜂授粉后会在主世界中长出果实。", "desc.collectorsreap.portobello": "可在草甸中找到。", "desc.collectorsreap.stygian_pomegranate": "Stygian Pomegranates are a dangerous variant that can be occasionally picked from Pomegranate Bushes growing on Resurgent Soil.", + "desc.collectorsreap.urchin_dart": "Urchin Darts are throwable projectiles that poison enemies for five seconds upon contact. Holding a bamboo in your offhand shoots a faster dart.", "effect.collectorsreap.corrosion": "酸蚀护盾", "effect.collectorsreap.corrosion.description": "为效果持有者提供一个防御性的酸性护盾,护盾将抵消效果持有者受到的弹射物伤害和爆炸伤害", "effect.collectorsreap.volatility": "挥溅", diff --git a/src/main/resources/assets/collectorsreap/models/item/urchin_dart.json b/src/main/resources/assets/collectorsreap/models/item/urchin_dart.json index c8333774..2c064e4f 100644 --- a/src/main/resources/assets/collectorsreap/models/item/urchin_dart.json +++ b/src/main/resources/assets/collectorsreap/models/item/urchin_dart.json @@ -5,21 +5,17 @@ }, "display": { "thirdperson_righthand": { - "rotation": [ - 0, - 45, - -90 - ], - "translation": [ - 0, - 3, - 1 - ], - "scale": [ - 0.55, - 0.55, - 0.55 - ] + "rotation": [0, 90, -135], + "translation": [0, 0.75, -0.25], + "scale": [0.55, 0.55, 0.55] } - } + }, + "groups": [ + { + "name": "urchin_dart", + "origin": [8, 8, 8], + "color": 0, + "children": [] + } + ] } \ No newline at end of file