Skip to content

Commit

Permalink
Fix for #22.
Browse files Browse the repository at this point in the history
  • Loading branch information
Xezard committed Aug 14, 2022
1 parent c1f8822 commit 66b9800
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions api/src/main/java/ru/xezard/glow/GlowAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,8 @@ public void onPacketSending(PacketEvent event) {
Entity entity = packet.getEntityModifier(event).read(0);

GlowsManager.getInstance().getGlowByEntity(entity).ifPresent((glow) -> {
if (!glow.sees(event.getPlayer())) {
return;
}

packet.getIntegers().write(0, entity.getEntityId());
packet.getWatchableCollectionModifier().write(0,
GlowProcessor.getInstance().createDataWatcher(entity, true)
GlowProcessor.getInstance().createDataWatcher(entity, glow.sees(event.getPlayer()))
.getWatchableObjects());

event.setPacket(packet);
Expand All @@ -82,4 +77,4 @@ public void onPacketSending(PacketEvent event) {

ProtocolLibrary.getProtocolManager().addPacketListener(adapter);
}
}
}

0 comments on commit 66b9800

Please sign in to comment.