Skip to content

Commit d00df90

Browse files
committed
-minor logic fixes for infinity
1 parent 12fb7a3 commit d00df90

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

common/src/main/java/smartin/miapi/item/modular/items/ExampleModularBowItem.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ public void onStoppedUsing(ItemStack bowStack, World world, LivingEntity user, i
4242
return;
4343
}
4444
PlayerEntity playerEntity = (PlayerEntity) user;
45-
boolean consumeArrow = !(playerEntity.getAbilities().creativeMode || EnchantmentHelper.getLevel(Enchantments.INFINITY, bowStack) > 0);
45+
boolean consumeArrow = !playerEntity.getAbilities().creativeMode;
4646
ItemStack projectileStack = playerEntity.getProjectileType(bowStack);
47-
if (projectileStack.isEmpty() && consumeArrow) {
47+
if(EnchantmentHelper.getLevel(Enchantments.INFINITY, bowStack) > 0 &&(projectileStack.isEmpty() || (projectileStack.getItem() instanceof ArrowItem && projectileStack.getOrCreateNbt().isEmpty()))){
48+
consumeArrow = false;
49+
projectileStack = new ItemStack(Items.ARROW);
50+
}
51+
if (projectileStack.isEmpty() && consumeArrow && !betterInfinity) {
4852
return;
4953
}
5054
if (projectileStack.isEmpty()) {

common/src/main/java/smartin/miapi/modules/abilities/util/ItemProjectile/ItemProjectile.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ protected boolean tryPickup(PlayerEntity player) {
215215
case DISALLOWED:
216216
yield false;
217217
case ALLOWED: {
218-
player.getInventory().getStack(slotId);
219218
yield tryInsertAtSlot(player.getInventory(),this.asItemStack(),slotId);
220219
}
221220
case CREATIVE_ONLY: {

common/src/main/resources/data/miapi/modules/bow/string/normal_bow_string.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"attributes": [
2727
{
2828
"attribute": "miapi:generic.projectile_speed",
29-
"value": "2.0",
29+
"value": "3.5",
3030
"operation": "+",
3131
"slot": "mainhand",
3232
"uuid": "AAAAAAAA-4180-4865-B01B-BCCE9785ACA3"

0 commit comments

Comments
 (0)