MCCTeam / Minecraft-Console-Client

Lightweight console for Minecraft chat and automated scripts
https://mccteam.github.io
Other
1.61k stars 390 forks source link

Fix ChatBots CobbleMiner, SugarCaneMiner new Direction #1077

Closed Nekiplay closed 4 years ago

Nekiplay commented 4 years ago

Prerequisites

Bug description

ORelio commented 4 years ago

About that, I'm wondering if we could automate the dig block mechanism to avoid managing the "dig start" / "dig end" stuff manually in the bots, which is not intuitive. I'm thinking that we would need to determine how long we need to dig for a block, then dig automatically, and send a "dig end" event to the ChatBot which could then move on to the next block, for instance.

Nekiplay commented 4 years ago

It’s necessary to somehow track the block in front of the player

Nekiplay commented 4 years ago

it seems to me better to create like Nuker for a certain type of block

ORelio commented 4 years ago

Ok, so according to https://wiki.vg/How_to_Write_a_Client#Digging we might be able to send "dig start" then immediately "dig end" then wait for "Acknowledge Player Digging" or "Block Change" from server.

Nekiplay commented 4 years ago

Now add it

ORelio commented 4 years ago

In that case please wait before working on a new pull request.

Nekiplay commented 4 years ago

image Heh, with this code, it breaks the block but not to the end and it does not drop out

Fixed image But it's still not what you need

ORelio commented 4 years ago

Please note that if we're both working on the same code, we won't be able to merge properly. At the moment I'm also attempting to implement that.

Nekiplay commented 4 years ago

this requires a cycle that determines that the unit is not air

ORelio commented 4 years ago

Weird. On my side I have something very similar and it's not breaking anything. Still looking at it.

Nekiplay commented 4 years ago

Perhaps the distance to the block is large, I have everything on 1.12.2, 1.15.2 everything is fine

ORelio commented 4 years ago

I'm standing right in front of the block, and even compared "dig block" packets sent by a vanilla 1.15.2 with packet sent by MCC, they're the same. I pushed the commit so you can look at it.

ORelio commented 4 years ago

Well, at least you have the idea of what I had in mind: leave only the "location" parameter and let McClient handle the complicated part so chatbot and command only need to tell which block they want the client to break. I'll stop editing the code for now.

Heh, with this code, it breaks the block but not to the end and it does not drop out

Yup, if you send dig start but never send dig end, you can run the dig animation forever :D