initial commit

This commit is contained in:
AkmalFairuz
2024-12-31 20:57:21 +07:00
commit 0de5415f05
72 changed files with 20340 additions and 0 deletions

22
legacyver/bitset.go Normal file
View File

@@ -0,0 +1,22 @@
package legacyver
import "github.com/sandertv/gophertunnel/minecraft/protocol"
func fitBitset(b protocol.Bitset, size int) protocol.Bitset {
if b.Len() != size {
ret := protocol.NewBitset(size)
copySize := b.Len()
if copySize > size {
copySize = size
}
for i := 0; i < copySize; i++ {
if b.Load(i) {
ret.Set(i)
}
}
return ret
}
return b
}