Skip to content

Commit

Permalink
Added getEntityId method to allow additional packet manipulation thro…
Browse files Browse the repository at this point in the history
…ugh the API (#189)
  • Loading branch information
OakLoaf authored Jan 31, 2025
1 parent a517cc6 commit 34e39c2
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ public String getName() {
return this.data;
}

/**
* Returns the entity id of this hologram
* This id is for packet use only as the entity is not registered to the server
* @return entity id
*/
public abstract int getEntityId();

/**
* Returns the Display entity of this Hologram object.
* The entity is not registered in the world or server.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ public Hologram1_19_4(@NotNull final HologramData data) {
super(data);
}

@Override
public int getEntityId() {
return display.getId();
}

@Override
public @Nullable org.bukkit.entity.Display getDisplayEntity() {
return display != null ? (org.bukkit.entity.Display) display.getBukkitEntity() : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ public Hologram1_20_1(@NotNull final HologramData data) {
super(data);
}

@Override
public int getEntityId() {
return display.getId();
}

@Override
public @Nullable org.bukkit.entity.Display getDisplayEntity() {
return display != null ? (org.bukkit.entity.Display) display.getBukkitEntity() : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ public Hologram1_20_2(@NotNull final HologramData data) {
super(data);
}

@Override
public int getEntityId() {
return display.getId();
}

@Override
public @Nullable org.bukkit.entity.Display getDisplayEntity() {
return display != null ? (org.bukkit.entity.Display) display.getBukkitEntity() : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ public Hologram1_20_4(@NotNull final HologramData data) {
super(data);
}

@Override
public int getEntityId() {
return display.getId();
}

@Override
public @Nullable org.bukkit.entity.Display getDisplayEntity() {
return display != null ? (org.bukkit.entity.Display) display.getBukkitEntity() : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public HologramImpl(@NotNull final HologramData data) {
super(data);
}

@Override
public int getEntityId() {
return fsDisplay.getId();
}

@Override
public @Nullable org.bukkit.entity.Display getDisplayEntity() {
return null;
Expand Down

0 comments on commit 34e39c2

Please sign in to comment.