3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-25 15:50:14 +01:00

Remove some unnecessary skin checks

Dieser Commit ist enthalten in:
Camotoy 2021-11-29 10:40:27 -05:00
Ursprung 2ae34b69af
Commit eb7d71017c
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F
2 geänderte Dateien mit 22 neuen und 28 gelöschten Zeilen

Datei anzeigen

@ -112,9 +112,7 @@ public class FakeHeadProvider {
try { try {
SkinProvider.SkinData mergedSkinData = MERGED_SKINS_LOADING_CACHE.get(new FakeHeadEntry(texturesProperty, fakeHeadSkinUrl, entity)); SkinProvider.SkinData mergedSkinData = MERGED_SKINS_LOADING_CACHE.get(new FakeHeadEntry(texturesProperty, fakeHeadSkinUrl, entity));
if (session.getUpstream().isInitialized()) { sendSkinPacket(session, entity, mergedSkinData);
sendSkinPacket(session, entity, mergedSkinData);
}
} catch (ExecutionException e) { } catch (ExecutionException e) {
GeyserImpl.getInstance().getLogger().error("Couldn't merge skin of " + entity.getUsername() + " with head skin url " + fakeHeadSkinUrl, e); GeyserImpl.getInstance().getLogger().error("Couldn't merge skin of " + entity.getUsername() + " with head skin url " + fakeHeadSkinUrl, e);
} }
@ -136,9 +134,7 @@ public class FakeHeadProvider {
return; return;
} }
if (session.getUpstream().isInitialized()) { sendSkinPacket(session, entity, skinData);
sendSkinPacket(session, entity, skinData);
}
}); });
} }

Datei anzeigen

@ -133,31 +133,29 @@ public class SkinManager {
SkinProvider.Cape cape = skinData.cape(); SkinProvider.Cape cape = skinData.cape();
SkinProvider.SkinGeometry geometry = skinData.geometry(); SkinProvider.SkinGeometry geometry = skinData.geometry();
if (session.getUpstream().isInitialized()) { PlayerListPacket.Entry updatedEntry = buildEntryManually(
PlayerListPacket.Entry updatedEntry = buildEntryManually( session,
session, entity.getUuid(),
entity.getUuid(), entity.getUsername(),
entity.getUsername(), entity.getGeyserId(),
entity.getGeyserId(), skin.getTextureUrl(),
skin.getTextureUrl(), skin.getSkinData(),
skin.getSkinData(), cape.getCapeId(),
cape.getCapeId(), cape.getCapeData(),
cape.getCapeData(), geometry
geometry );
);
PlayerListPacket playerAddPacket = new PlayerListPacket(); PlayerListPacket playerAddPacket = new PlayerListPacket();
playerAddPacket.setAction(PlayerListPacket.Action.ADD); playerAddPacket.setAction(PlayerListPacket.Action.ADD);
playerAddPacket.getEntries().add(updatedEntry); playerAddPacket.getEntries().add(updatedEntry);
session.sendUpstreamPacket(playerAddPacket); session.sendUpstreamPacket(playerAddPacket);
if (!entity.isPlayerList()) { if (!entity.isPlayerList()) {
PlayerListPacket playerRemovePacket = new PlayerListPacket(); PlayerListPacket playerRemovePacket = new PlayerListPacket();
playerRemovePacket.setAction(PlayerListPacket.Action.REMOVE); playerRemovePacket.setAction(PlayerListPacket.Action.REMOVE);
playerRemovePacket.getEntries().add(updatedEntry); playerRemovePacket.getEntries().add(updatedEntry);
session.sendUpstreamPacket(playerRemovePacket); session.sendUpstreamPacket(playerRemovePacket);
}
} }
} }