Skip to content

Commit be6f0cd

Browse files
authored
Update and rename CONTRIBUTING.md to docs/CONTRIBUTING.md (#475)
1 parent 842e662 commit be6f0cd

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
[![Official Discord](https://img.shields.io/static/v1.svg?label=OFFICIAL&message=DISCORD&color=blue&logo=discord&style=for-the-badge)](https://discord.gg/GsEFRM8)
77

8-
Minecraft Bedrock Edition (aka MCPE) protocol library, supporting authentication and encryption. Help [contribute](CONTRIBUTING.md).
8+
Minecraft Bedrock Edition (aka MCPE) protocol library, supporting authentication and encryption. Help [contribute](docs/CONTRIBUTING.md).
99

1010
[Protocol doc](https://prismarinejs.github.io/minecraft-data/?v=bedrock_1.19.10&d=protocol)
1111

@@ -126,7 +126,7 @@ Through node.js, add `process.env.DEBUG = 'minecraft-protocol'` at the top of yo
126126

127127
## Contribute
128128

129-
Please read [CONTRIBUTING.md](CONTRIBUTING.md) and https://github.com/PrismarineJS/prismarine-contribute
129+
Please read [CONTRIBUTING.md](docs/CONTRIBUTING.md) and https://github.com/PrismarineJS/prismarine-contribute
130130

131131
## History
132132

CONTRIBUTING.md renamed to docs/CONTRIBUTING.md

+11-9
Original file line numberDiff line numberDiff line change
@@ -110,37 +110,39 @@ The above roughly translates to the following JavaScript code to read a packet:
110110
```js
111111
function read_position(stream) {
112112
const ret = {}
113-
ret.x = stream.readSignedInt32LE()
114-
ret.z = stream.readUnsignedInt32LE()
115-
ret.y = stream.readFloat32LE()
113+
ret.x = stream.readLI32()
114+
ret.z = stream.readLU32()
115+
ret.y = stream.readLF32()
116116
return ret
117117
}
118118

119119
function read_player_position(stream) {
120120
const ret = {}
121121
ret.on_ground = Boolean(stream.readU8())
122-
ret.position = read_player_position(stream)
122+
ret.position = read_position(stream)
123123
let __movement_reason = stream.readU8()
124124
let movement_reason = { 0: 'player_jump', 1: 'player_autojump', 2: 'player_sneak', 3: 'player_sprint', 4: 'player_fall' }[__movement_reason]
125125
switch (movement_reason) {
126126
case 'player_jump':
127127
case 'player_autojump':
128-
ret.original_position = read_player_position(stream)
129-
ret.jump_tick = stream.readInt64LE(stream)
128+
ret.original_position = read_position(stream)
129+
ret.jump_tick = stream.readLI64()
130130
break
131131
case 'player_fall':
132-
ret.original_position = read_player_position(stream)
132+
ret.original_position = read_position(stream)
133133
break
134134
default: break
135135
}
136136
ret.player_hunger = undefined
137137
if (movement_reason == 'player_sprint') ret.player_hunger = stream.readU8()
138138
ret.last_positions = []
139-
for (let i = 0; i < stream.readUnsignedVarInt(); i++) {
139+
let __latest_positions_len = stream.readUnsignedVarInt()
140+
for (let i = 0; i < __latest_positions_len; i++) {
140141
ret.last_positions.push(read_player_position(stream))
141142
}
142143
ret.keys_down = []
143-
for (let i = 0; i < stream.readZigZagVarInt(); i++) {
144+
let __keys_down_len = stream.readZigZagVarInt()
145+
for (let i = 0; i < __keys_down_len; i++) {
144146
const ret1 = {}
145147
ret1.up = Boolean(stream.readU8())
146148
ret1.down = Boolean(stream.readU8())

0 commit comments

Comments
 (0)