From cc8ff58283381e185473bc14f97b2b54d1f774b7 Mon Sep 17 00:00:00 2001 From: iron431 <34083081+iron431@users.noreply.github.com> Date: Wed, 28 Feb 2024 20:46:42 -0600 Subject: [PATCH 1/3] add additional tooltip index qualifier fixes #331 --- .../redspace/ironsspellbooks/player/ClientPlayerEvents.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/redspace/ironsspellbooks/player/ClientPlayerEvents.java b/src/main/java/io/redspace/ironsspellbooks/player/ClientPlayerEvents.java index 12923e7a0..ae9b77e70 100644 --- a/src/main/java/io/redspace/ironsspellbooks/player/ClientPlayerEvents.java +++ b/src/main/java/io/redspace/ironsspellbooks/player/ClientPlayerEvents.java @@ -179,7 +179,7 @@ public static void imbuedWeaponTooltips(ItemTooltipEvent event) { //Keybind notification additionalLines.add(Component.literal(" ").append(Component.translatable("tooltip.irons_spellbooks.press_to_cast_active", Component.keybind("key.use")).withStyle(ChatFormatting.GOLD))); int i = event.getFlags().isAdvanced() ? TooltipsUtils.indexOfAdvancedText(lines, stack) : lines.size(); - lines.addAll(i, additionalLines); + lines.addAll(i < 0 ? lines.size() : i, additionalLines); } } else if (ISpellContainer.isSpellContainer(stack) && !(stack.getItem() instanceof SpellBook)) { var spellContainer = ISpellContainer.get(stack); @@ -195,7 +195,7 @@ public static void imbuedWeaponTooltips(ItemTooltipEvent event) { }); //Add header to sword tooltip additionalLines.add(1, Component.translatable("tooltip.irons_spellbooks.imbued_tooltip").withStyle(ChatFormatting.GRAY)); - lines.addAll(i, additionalLines); + lines.addAll(i < 0 ? lines.size() : i, additionalLines); } // if (spellContainer.getActiveSpellCount() < spellContainer.getMaxSpellCount()) { // var component = Component.translatable("tooltip.irons_spellbooks.can_be_imbued", spellContainer.getActiveSpellCount(), spellContainer.getMaxSpellCount()); From 000ecca5302882af8e552221e6887a8fe8774d6e Mon Sep 17 00:00:00 2001 From: iron431 <34083081+iron431@users.noreply.github.com> Date: Wed, 28 Feb 2024 20:49:27 -0600 Subject: [PATCH 2/3] fix arrow volley owner fixes #332 --- .../ironsspellbooks/entity/spells/ArrowVolleyEntity.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/io/redspace/ironsspellbooks/entity/spells/ArrowVolleyEntity.java b/src/main/java/io/redspace/ironsspellbooks/entity/spells/ArrowVolleyEntity.java index 24fcf9b55..24f3014c1 100644 --- a/src/main/java/io/redspace/ironsspellbooks/entity/spells/ArrowVolleyEntity.java +++ b/src/main/java/io/redspace/ironsspellbooks/entity/spells/ArrowVolleyEntity.java @@ -44,6 +44,7 @@ public void tick() { var spawn = this.position().add(orth.scale(distance)); arrow.setPos(spawn); arrow.shoot(motion.add(Utils.getRandomVec3(.04f))); + arrow.setOwner(this.getOwner()); level.addFreshEntity(arrow); MagicManager.spawnParticles(level, ParticleTypes.FIREWORK, spawn.x, spawn.y, spawn.z, 2, .1, .1, .1, .05, false); } From 9eb791dbf4b69e8d95cb5363e1d4b81ebaaf08c5 Mon Sep 17 00:00:00 2001 From: iron431 <34083081+iron431@users.noreply.github.com> Date: Wed, 28 Feb 2024 20:51:44 -0600 Subject: [PATCH 3/3] Update LATEST_CHANGES.MD --- LATEST_CHANGES.MD | 2 ++ 1 file changed, 2 insertions(+) diff --git a/LATEST_CHANGES.MD b/LATEST_CHANGES.MD index e410c9a19..fdb960d4a 100644 --- a/LATEST_CHANGES.MD +++ b/LATEST_CHANGES.MD @@ -11,6 +11,8 @@ - Fixed Projectiles not being able to go through portals - Fixed client crash caused by upgrading curio items on a dedicated server - Fixed mismatched Russian translations between versions +- Fixed tooltip index operation potentially being out of bounds with other mod's editing the tooltip at the same time +- Fixed Arrow Volley spell's sub-arrows not keeping track of the original caster ### API -