Fixed fishing rod lines not connecting to other players (#580)

This commit is contained in:
rtm516 2020-05-17 05:57:18 +01:00 committed by GitHub
parent b4ecb88d49
commit 3220532083
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -37,10 +37,14 @@ public class FishingHookEntity extends Entity {
public FishingHookEntity(long entityId, long geyserId, EntityType entityType, Vector3f position, Vector3f motion, Vector3f rotation, ProjectileData data) {
super(entityId, geyserId, entityType, position, motion, rotation);
// TODO: Find a better way to do this
for (GeyserSession session : GeyserConnector.getInstance().getPlayers().values()) {
if (session.getPlayerEntity().getEntityId() == data.getOwnerId()) {
this.metadata.put(EntityData.OWNER_EID, session.getPlayerEntity().getGeyserId());
Entity entity = session.getEntityCache().getEntityByJavaId(data.getOwnerId());
if (entity == null && session.getPlayerEntity().getEntityId() == data.getOwnerId()) {
entity = session.getPlayerEntity();
}
if (entity != null) {
this.metadata.put(EntityData.OWNER_EID, entity.getGeyserId());
return;
}
}