Merge remote-tracking branch 'origin/master' into dev

This commit is contained in:
Nassim Jahnke 2021-10-20 13:52:34 +02:00
commit 431f773b77
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B

View File

@ -163,13 +163,18 @@ public class EntityPackets {
public void registerMap() {
handler(wrapper -> {
int entityId = wrapper.passthrough(Type.VAR_INT);
byte type = wrapper.read(Type.BYTE);
if (type != 1) {
// Cancel if not lightning/invalid id
wrapper.cancel();
return;
}
wrapper.user().getEntityTracker(Protocol1_16To1_15_2.class).addEntity(entityId, Entity1_16Types.LIGHTNING_BOLT);
wrapper.write(Type.UUID, UUID.randomUUID()); // uuid
wrapper.write(Type.VAR_INT, Entity1_16Types.LIGHTNING_BOLT.getId()); // entity type
wrapper.read(Type.BYTE); // remove type
wrapper.passthrough(Type.DOUBLE); // x
wrapper.passthrough(Type.DOUBLE); // y
wrapper.passthrough(Type.DOUBLE); // z