forked from GeyserMC/Geyser
Fixed fishing rod lines not connecting to other players (#580)
This commit is contained in:
parent
b4ecb88d49
commit
3220532083
1 changed files with 7 additions and 3 deletions
|
@ -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) {
|
public FishingHookEntity(long entityId, long geyserId, EntityType entityType, Vector3f position, Vector3f motion, Vector3f rotation, ProjectileData data) {
|
||||||
super(entityId, geyserId, entityType, position, motion, rotation);
|
super(entityId, geyserId, entityType, position, motion, rotation);
|
||||||
|
|
||||||
// TODO: Find a better way to do this
|
|
||||||
for (GeyserSession session : GeyserConnector.getInstance().getPlayers().values()) {
|
for (GeyserSession session : GeyserConnector.getInstance().getPlayers().values()) {
|
||||||
if (session.getPlayerEntity().getEntityId() == data.getOwnerId()) {
|
Entity entity = session.getEntityCache().getEntityByJavaId(data.getOwnerId());
|
||||||
this.metadata.put(EntityData.OWNER_EID, session.getPlayerEntity().getGeyserId());
|
if (entity == null && session.getPlayerEntity().getEntityId() == data.getOwnerId()) {
|
||||||
|
entity = session.getPlayerEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entity != null) {
|
||||||
|
this.metadata.put(EntityData.OWNER_EID, entity.getGeyserId());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue