Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-03 14:50:30 +01:00
Cancel global entity packet if not lightning
Dieser Commit ist enthalten in:
Ursprung
dbe8b6551a
Commit
bd2bd1cf32
@ -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
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren