Skip to content

Commit

Permalink
Shoot Urchin Dart with bamboo in offhand for faster speed
Browse files Browse the repository at this point in the history
  • Loading branch information
brnbrd committed Oct 4, 2024
1 parent e4c1f73 commit 0e65b20
Show file tree
Hide file tree
Showing 18 changed files with 60 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"minecraft:bamboo"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -20,9 +21,12 @@ public UrchinDartItem(Properties properties) {
}

@Override
public @NotNull InteractionResultHolder<ItemStack> use(@NotNull Level level, Player player, @NotNull InteractionHand hand) {
player.startUsingItem(hand);
return InteractionResultHolder.consume(player.getItemInHand(hand));
public @NotNull InteractionResultHolder<ItemStack> 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
Expand All @@ -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));
Expand Down
24 changes: 16 additions & 8 deletions src/main/java/net/brdle/collectorsreap/compat/JEIPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void registerRecipes(IRecipeRegistration registration) {
// Lime
String limeTranslationKey = "desc." + CollectorsReap.MODID + "." + Util.name(CRItems.LIME);
List<ItemStack> 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")
);
Expand All @@ -59,13 +59,21 @@ public void registerRecipes(IRecipeRegistration registration) {
// Pomegranate
String pomTranslationKey = "desc." + CollectorsReap.MODID + "." + Util.name(CRItems.POMEGRANATE);
List<ItemStack> 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")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class CRItemTags {
public static final TagKey<Item> GUMMIES = cr("gummies");
public static final TagKey<Item> LIME_OR_SLICE = cr("lime_or_slice");
public static final TagKey<Item> HOT_NETHER_FRUIT = cr("hot_nether_fruit");
public static final TagKey<Item> DART_SHOOTERS = cr("dart_shooters");

// Diet
public static final TagKey<Item> DIET_FRUITS = Util.it("diet", "fruits");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/collectorsreap/lang/es_es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/collectorsreap/lang/es_mx.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/collectorsreap/lang/ja_jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/collectorsreap/lang/ko_kr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/collectorsreap/lang/ru_ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "Летучесть",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/collectorsreap/lang/uk_ua.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "Невловимість",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/collectorsreap/lang/vi_vn.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/collectorsreap/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "挥溅",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
}
]
}

0 comments on commit 0e65b20

Please sign in to comment.