Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug for download filled map. #3487

Open
shved255 opened this issue Oct 27, 2024 · 35 comments
Open

Bug for download filled map. #3487

shved255 opened this issue Oct 27, 2024 · 35 comments
Labels
possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f

Comments

@shved255
Copy link

Hello everyone, please help, I have a problem with the filled map. My bot logs into the server, I instruct it to download the image from the map that is in the frame. It seems that it is possible to pump out, but all the cards are turned over and downloaded randomly. If anyone knows, please help how to download images from the filled map normally, not upside down? And how can you implement the download of maps so that they are not downloaded randomly, for example, from left to right? Probably a bug of MineFlayer itself, if not, sorry. I've tried using the item-map-downloader plugin, but it's still the same. I went through many forums, did not find an answer. On github, I found one code that can be used to download maps. I edited it a little, I also tried and it didn't work out to download the map normally, here is his link: https://pastebin.com/jE3KF5XL I will be very grateful for your help, thank you. I tried using different versions of the bot, it didn't work either. Image filled maps:

изображение

@shved255 shved255 added possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f labels Oct 27, 2024
@rom1504
Copy link
Member

rom1504 commented Oct 27, 2024 via email

@shved255
Copy link
Author

shved255 commented Oct 27, 2024

map_0
map_1
map_2
map_3
map_4
map_5
map_6
map_7
map_8
map_9
map_10
map_11

I tried to combine them through canvas, it turned out to be nonsense. I launched the bot into the local world and put the filled map in the frame, and there was an upside-down image.

@shved255
Copy link
Author

Please help, I really need a bug fix

@rom1504
Copy link
Member

rom1504 commented Oct 28, 2024

https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/latest/proto.yml#L1878

This is the definition of this packet

You need the use the other fields, not only data

@rom1504
Copy link
Member

rom1504 commented Oct 28, 2024

Also see https://wiki.vg/Protocol#Map_Data

This packet updates a part of a map. It is sent many times, you need to all the values to assemble the image.

@rom1504
Copy link
Member

rom1504 commented Oct 28, 2024

Would welcome a PR implementing this directly in mineflayer

@shved255
Copy link
Author

thanks, but I don't understand how to use it. Maybe there are examples?

@rom1504
Copy link
Member

rom1504 commented Oct 28, 2024

There's nothing to use, new code needs to be written.

You can try it out, maybe you can ask chatgpt for help (giving it existing code and API doc as context)

@shved255
Copy link
Author

Thank you very much, I'll try, I'll write what yes

@shved255
Copy link
Author

Thats workd! Thanks you veru much. But how do you get the coordinates of the frame whose data you received? I used MapData and x, y, z methods, also used PosY, PosX, writes for instead of the first case 1 in all maps, in the other one completely undefined. Please tell me how to get the coordinates of the frame, and whether there is such a thing at all. I use the event bot._client.on('map'....

@rom1504
Copy link
Member

rom1504 commented Oct 29, 2024

You need to keep track using the map id

@shved255
Copy link
Author

Of course, I'm embarrassed to ask, but what functions or methods should I use? The neural network does not help me ;(

@shved255
Copy link
Author

Without a coordinate function, you get something like this:
combined_map

@rom1504
Copy link
Member

rom1504 commented Oct 29, 2024

Can you log the map packets you get (without the data field) and send them here ?
It'll be easier to help that way

@shved255
Copy link
Author

Thats map data:

itemDamage: 83,
scale: 0,
locked: false,
icons: undefined,
columns: 128,
rows: 128,
x: 0,
y: 0,
data: <Buffer 22 3a 22 3a 22 3a 22 3a 22 3a 22 3a 22 3a 22 3a 22 3a 22 3a 22 3a 22 3a 22 3a 22 3a 22 3a 22 3a 22 3a 22 3a 22 3a 22 3a 22 3a 22 3a 22 3a 22 3a 22 3a ... 16334 more bytes>

@shved255
Copy link
Author

shved255 commented Oct 29, 2024

but all maps are x and y this 0 code: https://pastebin.com/raw/S9EvZkWX on "Данные карты" - this is map data.

@rom1504
Copy link
Member

rom1504 commented Oct 29, 2024

Can you send the other ones

@shved255
Copy link
Author

yes, this code on English:

https://pastebin.com/p80WJZUP

@shved255
Copy link
Author

Sorry for the long wait

@rom1504
Copy link
Member

rom1504 commented Oct 29, 2024

No I am asking for the other map packets logs

@shved255
Copy link
Author

I didn't understand what kind of data, it seems that's all there is.

@shved255
Copy link
Author

I got it, I'm going to do it now

@shved255
Copy link
Author

https://pastebin.com/DBUZiEX1

I have shortened the bytes of the cards,
packet_log.txt
since pastebin does not accept them. The full logs will be below:

@rom1504
Copy link
Member

rom1504 commented Oct 29, 2024

This seems to contain every packet.

What I am asking is all the map packets you receive

@shved255
Copy link
Author

shved255 commented Oct 29, 2024

map_logs.txt

Most likely it is, or I do not know which logs to issue. I just started working with mineflayer recently, sorry.

@rom1504
Copy link
Member

rom1504 commented Oct 29, 2024 via email

@shved255
Copy link
Author

and how to analyze it? item Damage has only 1 digit, but the coordinate axes are 3.

@rom1504
Copy link
Member

rom1504 commented Oct 29, 2024 via email

@rom1504
Copy link
Member

rom1504 commented Oct 29, 2024

https://github.com/IceTank/mineflayer-item-map-downloader/blob/master/index.js#L68 seems to think this damage field is the map id.

Maybe the position information is in entity metadata

@rom1504
Copy link
Member

rom1504 commented Oct 29, 2024

Yeah looking at your log above, I believe the information is present in objectData field. Will need a bit of code to piece it all together

@shved255
Copy link
Author

thanks, I'll try this.

@shved255
Copy link
Author

of course, I also noticed that map Data X and Y are empty only on verification. And with the help of item Damage, random numbers just appear, that is, they are similar, but in fact this is nonsense, for example, I have X = 0, Y = 2, the next card is X = 64, Y = -128.

@shved255
Copy link
Author

shved255 commented Oct 30, 2024

Here's an example of a map if you go to the Bukkit core and its forks:

Received map data: {
Element damage: 0,
Scale: 0,
Tracking position: true,
blocked: false,
icons: [ { type: 1, x: -63, z: -93, direction: 4, display name: undefined } ],
columns: -128,
rows: -128,
x: 0,
y: 0,
Data: <Buffer 36 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 ... another 16334 bytes>
}

X and Z has numbers. Although the coordinates are in icons, they are also true. If you go to the verification server, then ICONS will be zero there.

@GefestM
Copy link

GefestM commented Dec 11, 2024

Have you solved this somehow? If yes, write to me

@shved255
Copy link
Author

https://github.com/ImPhoba/FlayerCaptcha

Have you solved this somehow? If yes, write to me

i solved this by FlayerCaptcha plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f
Projects
None yet
Development

No branches or pull requests

3 participants