Comments (9)
There's a little bit of a gotcha with 0x38. If you look at protocol.js you can see that all those properties are namespaced under the "data" variable. Also those other length and count properties are implied from the meta array and the compressed chunk data buffer length. So if you're sending 0x38, you have to do something like this:
client.write(0x38, {data: {
skyLightSent: true,
compressedChunkData: world,
meta: []
}});
from node-minecraft-protocol.
Woah, didn't noticed! Still, it's failing with TypeError: Cannot read property 'length' of undefined
on the same line, so I guess my code to create the world it's broken. Is there any specific way to create the data for a world? Or any guideline to code something that generates the world? I've been reading http://wiki.vg/SMP_Map_Format but I don't really understand how should I translate the parameters there to the code
from node-minecraft-protocol.
did you set []
for meta
instead of null
?
from node-minecraft-protocol.
Yes, I did. Basically I copied the code example, changing variables, of course
from node-minecraft-protocol.
@mappum might be willing to provide a code example. I know he has a server using this module.
from node-minecraft-protocol.
That'd be great! I've seen his redstone.io project and seems really promising!
from node-minecraft-protocol.
Update: after fiddling around the code and searching on GH, I've managed to put this 0x38 function which doesn't crashes the server. If I fly a little I finally find a grass block. This is what it looks currently: http://d.pr/i/UrAg. I guess it's now time to see how to make the map bigger and all.
This is the code:
var buffer = new Buffer((4096 + 2048 + 2048 + 2048) * 4 + 256);
buffer.fill(0);
buffer.writeUInt8(2, 8192 + 273);
zlib.deflate(buffer, function(err, compressed) {
client.write(0x38, {data: {
skyLightSent: true,
compressedChunkData: compressed,
meta: [{
x: 0,
z: 0,
bitMap: parseInt('00111100', 2),
addBitMap: 0,
}]
}});
});
from node-minecraft-protocol.
Do you still need help, or may I close this issue?
from node-minecraft-protocol.
Nope, it's already fixed 😄
from node-minecraft-protocol.
Related Issues (20)
- Cannot read properties of undefined (reading 'overworld') HOT 1
- "Chunk size is 42 but only 2 was read" error HOT 7
- Inconsistent `playerChat` event data
- undefined nbt value HOT 2
- Some event handlers end up being called multiple times after going thru configuration state. HOT 1
- 1.20.4 Login event never triggered on Node 18 HOT 19
- versionChecking.js Bug HOT 3
- TypeError: RSA_PKCS1_PADDING is no longer supported for private decryption HOT 7
- Error: Failed to obtain profile data for X, does the account own minecraft?
- Ladders arent working HOT 3
- mc.createClient doesnt check for SRV dns records HOT 1
- Is there any way to modify the protocol on server side? (maybe using fabric or spigot) HOT 1
- pickRealm silently fails to connect HOT 6
- Entity Effect proxy
- Error: unsupported protocol version: 1.20.6
- Minecraft 1.21+ support HOT 2
- Read Packets from other sources HOT 4
- Problems with Deserializer HOT 3
- Player count modify HOT 1
- Vanilla client cannot connect to example server
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-minecraft-protocol.