mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-18 05:51:12 +00:00
Implement crouching and sprinting
This commit is contained in:
parent
4f3b073e40
commit
fb0ab0ef95
1 changed files with 34 additions and 0 deletions
|
|
@ -8,4 +8,38 @@ function inject(serv, player)
|
|||
animation: 0
|
||||
});
|
||||
});
|
||||
|
||||
player._client.on("entity_action", function(packet) {
|
||||
if(packet.actionId == 3) {
|
||||
player.entity.metadata = [{"key":0,"type":"byte","value": 0x08}];
|
||||
player._writeOthers("entity_metadata", {
|
||||
entityId: player.entity.id,
|
||||
metadata: player.entity.metadata
|
||||
});
|
||||
}
|
||||
|
||||
if(packet.actionId == 4) {
|
||||
player.entity.metadata = [{"key":0,"type":"byte","value": 0x00}];
|
||||
player._writeOthers("entity_metadata", {
|
||||
entityId: player.entity.id,
|
||||
metadata: player.entity.metadata
|
||||
});
|
||||
}
|
||||
|
||||
if(packet.actionId == 0) {
|
||||
player.entity.metadata = [{"key":0,"type":"byte","value": 0x02}];
|
||||
player._writeOthers("entity_metadata", {
|
||||
entityId: player.entity.id,
|
||||
metadata: player.entity.metadata
|
||||
});
|
||||
}
|
||||
|
||||
if(packet.actionId == 1) {
|
||||
player.entity.metadata = [{"key":0,"type":"byte","value": 0x00}];
|
||||
player._writeOthers("entity_metadata", {
|
||||
entityId: player.entity.id,
|
||||
metadata: player.entity.metadata
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
Loading…
Reference in a new issue