Skip to content

Commit

Permalink
Removed: Redundant code in the EntityMetadataListener
Browse files Browse the repository at this point in the history
  • Loading branch information
Bram1903 committed May 2, 2024
1 parent 82e10a5 commit 608a9f9
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,10 @@ public void onPacketSend(PacketSendEvent event) {
if (!event.getPacketType().equals(PacketType.Play.Server.ENTITY_METADATA)) return;

WrapperPlayServerEntityMetadata packet = new WrapperPlayServerEntityMetadata(event);
int entityId = packet.getEntityId();
User user = event.getUser();

if (event.getUser().getEntityId() == packet.getEntityId()) return;
if (entityId == user.getEntityId()) return;

if (allowBypassEnabled) {
if (platform.hasPermission(user.getUUID(), "AntiHealthIndicator.Bypass")) return;
Expand All @@ -109,8 +110,6 @@ public void onPacketSend(PacketSendEvent event) {
if (cacheManager.isUserPassenger(packet.getEntityId(), user.getEntityId())) return;
}

int entityId = packet.getEntityId();

LivingEntityData livingEntityData = cacheManager.getLivingEntityData(entityId).orElse(null);
if (livingEntityData == null) return;
EntityType entityType = livingEntityData.getEntityType();
Expand Down

0 comments on commit 608a9f9

Please sign in to comment.