Skip to content

new legacy hologram#53

Open
InstantlyMoist wants to merge 2 commits intoTofaa2:masterfrom
InstantlyMoist:fix/legacy-hologram
Open

new legacy hologram#53
InstantlyMoist wants to merge 2 commits intoTofaa2:masterfrom
InstantlyMoist:fix/legacy-hologram

Conversation

@InstantlyMoist
Copy link
Copy Markdown
Contributor

@InstantlyMoist InstantlyMoist commented Apr 15, 2026

rewritten it to not depend on passenger stuff

Summary by CodeRabbit

  • Bug Fixes

    • Marker states now consistently apply to all hologram lines and trigger position updates when needed.
    • Teleport ordering and offset calculations corrected for consistent line placement.
    • Removing lines now preserves hologram alignment when displayed.
    • Parent/passenger handling improved for stable grouping behavior.
  • Performance

    • In-place line updates optimized to avoid unnecessary respawns.
  • Chore

    • Project version updated to 3.2.3.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a3f896e1-5932-4dfe-85a0-862a20dbfb50

📥 Commits

Reviewing files that changed from the base of the PR and between 9dfa0a7 and e79280f.

📒 Files selected for processing (1)
  • build.gradle.kts
✅ Files skipped from review due to trivial changes (1)
  • build.gradle.kts

📝 Walkthrough

Walkthrough

Updates to LegacyHologram adjust marker propagation, teleport positioning and line management, add an in-place fast-path for line updates, change passenger assignment, and tweak offset constants; additionally, project version was bumped from 3.2.2 to 3.2.3 in build.gradle.kts.

Changes

Hologram Logic Updates

Layer / File(s) Summary
Behavior / Constants
api/src/main/java/me/tofaa/entitylib/wrapper/hologram/LegacyHologram.java
Adjusted lineOffset and markerOffset constants; removed an unused import.
Marker & State Propagation
api/src/main/java/.../LegacyHologram.java
setMarker now propagates marker flag to existing armor-stand line entities and triggers re-teleport when already spawned.
Teleport Positioning
api/src/main/java/.../LegacyHologram.java
teleport iteration order changed to first→last, computes per-line Y offsets using index multiplication for marker and non-marker modes, and no longer calls setParent(getEntity()) after teleport.
Line Management Fast Path
api/src/main/java/.../LegacyHologram.java
setLine adds an in-bounds fast path that updates a line's custom name without spawning a new entity; slow path spawns only when needed and invokes full teleport only if spawned is true.
Removal Behavior
api/src/main/java/.../LegacyHologram.java
removeLine now re-teleports after removal when spawned and remaining lines exist.
Passenger Assignment
api/src/main/java/.../LegacyHologram.java
s etParent simplified to add only the first line as passenger and removed redundant try/catch and multi-line passenger logic.

Build Version Bump

Layer / File(s) Summary
Version Constant
build.gradle.kts
fullVersion updated from "3.2.2""3.2.3", affecting derived version, ext["versionBeta"], and ext["versionNoHash"].

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I nudged the lines to find their place,
I hopped through offsets, changed their pace,
Markers ripple, names align,
Teleports march in ordered line,
A rabbit cheers — the code looks ace.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'new legacy hologram' is vague and generic, using non-descriptive language that doesn't convey the specific nature of the changes (refactoring to remove passenger mechanics dependency). Consider a more descriptive title such as 'Refactor LegacyHologram to remove passenger dependency' that better captures the main technical change and intent.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 35ea12d and 9dfa0a7.

📒 Files selected for processing (1)
  • api/src/main/java/me/tofaa/entitylib/wrapper/hologram/LegacyHologram.java

Comment on lines 234 to 240
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);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant