PrismarineJS / prismarine-world

The core implementation of worlds for prismarine
http://prismarine.js.org/prismarine-world/
34 stars 32 forks source link

What should happen for y>256 or y<0 #15

Open rom1504 opened 8 years ago

rom1504 commented 8 years ago

Maybe return air for getters but return an error for setters ?

Maybe this should happen in prismarine-chunk and we just shouldn't do modulus 256 there https://github.com/PrismarineJS/prismarine-world/blob/master/src/world.js#L11

dcbartlett commented 8 years ago

what if the build limit is configured higher than 256?

rom1504 commented 8 years ago

That's not possible with Minecraft protocol AFAIK, the chunk packet only support up to 16 sections.

dcbartlett commented 8 years ago

hum, i know with the java server and client, i was able to make 512 build limits

roblabla commented 8 years ago

@rom1504 vanilla server has an option to make a higher build limit. 256 is just the default IIRC.

rom1504 commented 8 years ago

Hmm really ? I don't understand how would http://wiki.vg/Protocol#Chunk_Data work then, it takes the bitmap as an unsigned short, so 2 byte, 16bits, 16 sections (=256 max) Would they change the datatype used for the bitmap automatically ?

Need to experiment about that with the vanilla server + nmp proxy to see what happens

(edit: this issue is related to https://github.com/mhsjlw/flying-squid/issues/119#issuecomment-159319424 )

roblabla commented 8 years ago

@rom1504 I suppose it either always sends it or never sends it...

rom1504 commented 8 years ago

"always sends it or never sends it" send what ? the bitmap ? it's not optional

Maybe the solution they use is setting "Ground-Up Continuous" to false. ("This is true if the packet represents all sections in this vertical column, where the Primary Bit Mask specifies exactly which sections are included, and which are air")

roblabla commented 8 years ago

The content. Not the bitmap. Bitmap defines whether the content is sent or not, so my guess is, if bitmap is too small, the content that couldn't fit in bitmap is either always sent, or never sent. We'd need ot check.

rom1504 commented 8 years ago

Ah yeah, I see what you mean.

rom1504 commented 8 years ago

15:42 <+Thinkofname> you can't go bigger than 256 15:48 < rom1504> so server property max-build-height does nothing ? 15:50 < Fenhl> it does nothing when you set it above 256, yes

Not sure who to believe, I guess it needs testing

Saiv46 commented 3 years ago

Now Mojang going to break things with y>-64 and y<319 in 1.18

mevenG commented 1 year ago

Uh-oh, looks like 256 isn't enough now .. and the height is hard written, maybe try to get it from bot.game.height, and same for bot.game.minY