Conversation
…all knowledge) allowing for better handling
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@api/src/main/java/me/tofaa/entitylib/wrapper/hologram/LegacyHologram.java`:
- Around line 234-240: LegacyHologram.setParent currently only attaches
lines.get(0) and does not store the parent, causing other lines to stop
following after show()/setLine()/removeLine(); change LegacyHologram to persist
the parent reference (e.g., a private WrapperEntity parent field) when
setParent(WrapperEntity) is called, attach the whole passenger chain similarly
to ModernHologram.setParent (rebind all existing lines to follow the parent, not
just lines.get(0)), and ensure show(), setLine(), and removeLine() reapply the
follow/attach logic from the stored parent so updates maintain the binding for
all lines.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f79638c0-036a-440a-8ff9-ed8ac7e128bc
📒 Files selected for processing (1)
api/src/main/java/me/tofaa/entitylib/wrapper/hologram/LegacyHologram.java
| public void setParent(@NotNull WrapperEntity parent) { | ||
| if (lines.isEmpty()) return; | ||
|
|
||
| WrapperEntity first = lines.get(0); | ||
| for (WrapperEntity e : lines) { | ||
| if (e.getUuid().equals(first.getUuid())) continue; | ||
| try { | ||
| first.addPassenger(e); | ||
| } catch (Exception ignored) {} | ||
| } | ||
| if (!first.getUuid().equals(parent.getUuid())) { | ||
| try { | ||
| parent.addPassenger(first); | ||
| } catch (Exception ignored) {} | ||
| parent.addPassenger(first); | ||
| } |
There was a problem hiding this comment.
Parent-following regresses to a single line.
setParent() now attaches only lines.get(0) and does not retain the parent anywhere. Compared with ModernHologram.setParent() in api/src/main/java/me/tofaa/entitylib/wrapper/hologram/ModernHologram.java:72-87, the rest of the hologram is never rebound after show(), setLine(), or removeLine(). If the parent moves, or the first line is replaced/removed, the remaining lines can be left behind. Please persist the parent and reapply whatever follow mechanism replaces the old passenger chain after structural updates.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@api/src/main/java/me/tofaa/entitylib/wrapper/hologram/LegacyHologram.java`
around lines 234 - 240, LegacyHologram.setParent currently only attaches
lines.get(0) and does not store the parent, causing other lines to stop
following after show()/setLine()/removeLine(); change LegacyHologram to persist
the parent reference (e.g., a private WrapperEntity parent field) when
setParent(WrapperEntity) is called, attach the whole passenger chain similarly
to ModernHologram.setParent (rebind all existing lines to follow the parent, not
just lines.get(0)), and ensure show(), setLine(), and removeLine() reapply the
follow/attach logic from the stored parent so updates maintain the binding for
all lines.
rewritten it to not depend on passenger stuff
Summary by CodeRabbit
Bug Fixes
Performance