Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-27 08:30:12 +01:00
Only send metadata update once per Java metadata packet (#1022)
While this doesn't fix any bugs, it may be a slight performance enhancement as we aren't sending multiple packets per one Java entity metadata packet.
Dieser Commit ist enthalten in:
Ursprung
9097f8547b
Commit
a4339be212
@ -262,6 +262,11 @@ public class Entity {
|
||||
session.sendUpstreamPacket(updateAttributesPacket);
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies the Java metadata to the local Bedrock metadata copy
|
||||
* @param entityMetadata the Java entity metadata
|
||||
* @param session GeyserSession
|
||||
*/
|
||||
public void updateBedrockMetadata(EntityMetadata entityMetadata, GeyserSession session) {
|
||||
switch (entityMetadata.getId()) {
|
||||
case 0:
|
||||
@ -366,10 +371,12 @@ public class Entity {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
updateBedrockMetadata(session);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the Bedrock metadata to the client
|
||||
* @param session GeyserSession
|
||||
*/
|
||||
public void updateBedrockMetadata(GeyserSession session) {
|
||||
if (!valid) return;
|
||||
|
||||
|
@ -47,5 +47,7 @@ public class JavaEntityMetadataTranslator extends PacketTranslator<ServerEntityM
|
||||
for (EntityMetadata metadata : packet.getMetadata()) {
|
||||
entity.updateBedrockMetadata(metadata, session);
|
||||
}
|
||||
|
||||
entity.updateBedrockMetadata(session);
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren