Skip to content

Commit 9a8c283

Browse files
authored
Merge pull request #62 from PZDonny/develop
Fix parts appearing at incorrect position, again...
2 parents b281dd7 + 079f4ff commit 9a8c283

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

api/src/main/java/net/donnypz/displayentityutils/utils/DisplayEntities/PacketDisplayEntityGroup.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ public void setAutoShowCondition(@Nullable Predicate<Player> playerCondition){
853853
*/
854854
@Override
855855
public void showToPlayer(@NotNull Player player, @NotNull GroupSpawnedEvent.SpawnReason spawnReason) {
856-
showToPlayer(player, spawnReason, getLocation());
856+
showToPlayers(List.of(player), spawnReason);
857857
}
858858

859859
/**
@@ -864,14 +864,7 @@ public void showToPlayer(@NotNull Player player, @NotNull GroupSpawnedEvent.Spaw
864864
*/
865865
@Override
866866
public void showToPlayer(@NotNull Player player, GroupSpawnedEvent.@NotNull SpawnReason spawnReason, @NotNull Location location) {
867-
if (!sendShowEvent(List.of(player), spawnReason)) return;
868-
if (!masterPart.isTrackedBy(player)){
869-
for (PacketDisplayEntityPart part : groupParts.values()){
870-
part.showToPlayer(player, spawnReason, location);
871-
}
872-
setPassengers(player);
873-
}
874-
refreshVehicle(player);
867+
showToPlayers(List.of(player), spawnReason, location);
875868
}
876869

877870
/**

api/src/main/java/net/donnypz/displayentityutils/utils/DisplayEntities/PacketDisplayEntityPart.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ public void showToPlayer(@NotNull Player player, GroupSpawnedEvent.@NotNull Spaw
159159
return;
160160
}
161161
DEUUser.getOrCreateUser(player).trackPacketEntity(this);
162+
if (type == SpawnedDisplayEntityPart.PartType.INTERACTION && hasGroup()){
163+
Vector translation = getInteractionTranslation(group.getLocation());
164+
location = location.clone().add(translation);
165+
}
162166
attributeContainer.sendEntity(type, getEntityId(), player, location);
163167
}
164168

@@ -204,6 +208,10 @@ public void showToPlayers(@NotNull Collection<Player> players, GroupSpawnedEvent
204208
DEUUser.getOrCreateUser(player).trackPacketEntity(this);
205209
}
206210
}
211+
if (type == SpawnedDisplayEntityPart.PartType.INTERACTION && hasGroup()){
212+
Vector translation = getInteractionTranslation(group.getLocation());
213+
location = location.clone().add(translation);
214+
}
207215
attributeContainer.sendEntityUsingPlayers(type, getEntityId(), plrs, location);
208216
}
209217

0 commit comments

Comments
 (0)