Commit graph

133 commits

Author SHA1 Message Date
BruceChen
5e11ed3896 Tooltip support & Bug fix 2022-12-11 13:00:19 +08:00
BruceChen
892999ac98 Merge into master 2022-12-06 20:32:46 +08:00
BruceChen
84cf749344 Implement command completion suggestions. 2022-12-06 15:50:17 +08:00
BruceChen
28827b720a Support downloading updates via command. 2022-12-01 22:55:48 +08:00
BruceChen
3713fa2dbe Update Tomlet to 5.0.1 2022-11-30 22:29:55 +08:00
BruceChen
2331590588 Store the text resources of the setting file separately. 2022-11-30 16:22:48 +08:00
BruceChen
f2f88ac009 Merge master into brigadier-dev 2022-10-29 11:44:54 +08:00
BruceChen
077e3a5e9f
Crowdin localization support (#2310)
* Switching to use resource files

* Update Crowdin configuration file

* Code cleanup
2022-10-28 11:13:20 +08:00
Milutinke
0468bde434 Added 2 new example chat bots, removed a really old one which was useless. 2022-10-26 21:31:31 +02:00
BruceChen
f8aefaf129 init 2022-10-26 08:54:54 +08:00
BruceChen
4925689496
Revert "Added the Web Socket Chat Bot" 2022-10-25 16:23:25 +08:00
Anon
477da50fe0
Merge branch 'master' into rpc 2022-10-24 20:45:40 +00:00
Milutinke
1272ffda0b Added a Telegram Bridge chat bot. 2022-10-24 15:35:24 +02:00
Milutinke
d8c9e1587b Added Resizing back to the Map Chat bot and added an option to send rendered images to Discord via Discord Bridge chat bot. 2022-10-21 20:25:48 +02:00
Milutinke
ec27ec53d7 Implemented the Discord Bridge Chat Bot. TODO: Translate 2022-10-21 02:29:47 +02:00
Milutinke
ed910aa9c7 Added the Web Socket Chat Bot. 2022-10-20 19:29:35 +02:00
BruceChen
16c1d1fd77 Refactoring Settings.cs 2022-10-05 15:02:30 +08:00
BruceChen
1d52d1eadd
Fix all warnings & Trim (#2226)
* Fix AutoFishing crash
* Fix all warnings
* Remove DotNetZip.
* Fix the usage of HttpClient.
2022-10-02 18:31:08 +08:00
Milutinke
77da611411 Added a command that executes other command if a condition is met. 2022-09-11 22:35:26 +02:00
Milutinke
d900824d6a Updated the Proxy library 2022-09-06 19:13:23 +02:00
BruceChen
75e7b0e37d Fix issue #2119 2022-08-28 16:18:29 +08:00
Booquefius
613f52d3ae
AuotoAttack: add support for multiple interact modes (#2044)
* Adds support for multiple interact modes
* Entity interaction: Implement enum

Co-authored-by: ORelio <ORelio@users.noreply.github.com>
2022-08-15 23:31:17 +02:00
breadbyte
fd7f79402f
Scripting Hotfix for .NET (#2061)
* fix scripting being broken

scripting got broken due to being compiled as a single file application.

* move invoke to a helper function

also move MinecraftClient assembly fetch into the main assembly fetch loop

* Downgrade version of SingleFileExtractor

1.1.0 changed their internal API, so we use 1.0.1 to reduce the amount of reflection we need to do

* add exception messages
2022-08-15 18:30:56 +02:00
breadbyte
ea6788278d
Fix automated build for .NET releases (#2059)
* Fix automated build for .NET releases
* Update build-and-release.yml
* update submodule for building
* Update build-and-release.yml
* update consoleinteractive build
* Update build-and-release.yml
* set PublishSingleFile as true by default
* update csproj file to include compile flag

setting IncludeNativeLibrariesForSelfExtract to true removes the sni.dll output file.

* update build instructions on README
* move compile flags into env variable

- disable compilation of PDB files
- enable OSX builds
2022-08-15 18:20:25 +02:00
breadbyte
d9f1a77ac2
.NET 5+ Support (#1674)
Implement changes to support .NET 5 onwards.
Co-authored-by: ReinforceZwei <39955851+ReinforceZwei@users.noreply.github.com>
Co-authored-by: ORelio <ORelio@users.noreply.github.com>
2022-07-03 22:34:07 +08:00
Daenges
381b8ea7d1
Add setrnd command (#1846)
* Add setrnd command

* Make rand private

* Add console-like argument behaviour

* Remove unused using declarations

* Add german and english translations

* Improve translation, Add notice to config README, Add check wheather arguments are provided

* Add some comments

* Remove typo

* Add %player% constant to setrnd

* Remove test variable and add comments

* Remove typo

* Reverse changes

* Remove translations
2021-12-15 18:51:16 +08:00
ReinforceZwei
fdc3069083
Microsoft Sign-in: Migrate to our own client Id (#1827)
* Microsoft Sign-in: Migrate to our own client Id

- Drop support of "mcc" sign-in method
- Add nuget packages for decoding JWT

* Remove JWT nuget package

* Remove client secret

It is not needed after changing application type in Azure

* Change token validation method to expiration time

* Revert changes of dropping mcc sign-in method

* Add email pre-fill for browser sign-in
2021-12-04 19:15:58 +08:00
ReinforceZwei
9a9245f193
Update version to 1.18 (#1836) 2021-12-02 21:07:57 +08:00
Daenges
6a361ed674
Integration of the Mojang API (#1709)
* Add Mojang API integration

* Addition in MinecraftClient.csproj

* Move Mojang API to Protocol namespace

* Add changes of MinecraftClient.csproj

* Add rate limit warning

* Improve rate limit warning
2021-08-06 14:25:46 +08:00
Daenges
b3b9a26288
Add script for excavating cubes (#1677)
* Add MineCube.cs

* Clear unused comments and using directives

* Move the command to a chatbot class

* Set a maximum sleep time for block mining

* Add tool selection function

* Improve the block - tool detection

* Improve naming and comments

* Add missing blocktypes

* Add block-tool assertion and tool switching in hotbar

* Remove unused using declaratives and improve coordinate handling

* Move Material2Tool in the Mapping folder

* Add function to let the bot mine up to 5 blocks above its head

* Remove obsolete function to detect breakability

* Implement mineup command
Users can dig out a 2 high square manually. The client will walk through it
mining everything that is reachable above, while avoiding falling blocks and liquids.

* Refactor big parts of the code
Move the function for obtaining cubes to a seperate file.
Sort Unbreakables alphabetically.
Change the distance to wait in the mine function back to 2.

* Fix suggestions from review
Change several parts of the code according to the review
Add credits

* Convert the bot into a script file and move it to config folder
Adjust the script to be loadable with /script
Remove unnecessary code
Add public modifier to material2tool

* Add checking for lava and water for normal mining

* Remove MineCube.cs from chatbots

* Code re-format

Rename variables
Fix indentation

Co-authored-by: ReinforceZwei <39955851+ReinforceZwei@users.noreply.github.com>
2021-08-03 13:25:43 +08:00
alex-huff
8bd221c248
Add support for 1.17 (#1630)
* fix caps

* implement 1.17 without terrain

* properly switch order of Tracking Position and Locked for 1.17

* Update MinecraftClient/Protocol/Handlers/PacketTypesIn.cs

Co-authored-by: ReinforceZwei <39955851+ReinforceZwei@users.noreply.github.com>

Co-authored-by: ReinforceZwei <39955851+ReinforceZwei@users.noreply.github.com>
2021-06-11 21:45:33 +08:00
ORelio
f16e9e87dd Add support for inventory layout as ASCII art (#906)
Inventory art mostly made by Mhowser
TODO: Implement remaining inventory types
2021-05-29 15:21:38 +02:00
ORelio
9af9fe78ee Realms: Allow direct server ID, handle invalid ID (#1533) 2021-05-20 19:09:41 +02:00
ORelio
95d6318350 Implement thread-safe ChatBot API (#1510, #1579)
+ Rework task scheduling in chatbots
+ Switch back terrain processing to tasks
2021-05-15 17:36:16 +02:00
ReinforceZwei
f848495243
Implement schedule main thread task with return value (#1579)
* Implement schedule main thread task with return value

* Revert change of TestBot.cs
2021-05-12 12:20:13 +08:00
ReinforceZwei
1cd7c098c3
Add command for dropping items from inventory (#1581)
* Add command for dropping items from inventory
* Allow other container to be used
2021-05-10 20:27:18 +02:00
ReinforceZwei
0400ad89ac
Add ability to perform clean-up code before quitting (#1561)
* Add ability to perform clean-up code before quitting
* Move to WinAPI namespace
2021-05-01 16:56:31 +02:00
ReinforceZwei
240468ad22
Implement log to file logger (#1494)
* Implement log to file

Logger moved to it's own namespace

* Add lock to log file
2021-03-07 14:23:26 +08:00
ReinforceZwei
38a890f840
Implement new logger (#1426)
* Implement multi-channel logger

* Implement chat filter

* Improve a bit

* Improvement

* Add debug message filter and filter mode

* Avoid duplicate debug prefix string

Co-authored-by: ORelio <ORelio@users.noreply.github.com>
2021-01-29 07:45:18 +08:00
ReinforceZwei
c04c597aba
Implement Microsoft account login (#1397)
* Implement Microsoft account login
* Create proxied web request class
* Whole bunch of code that doesn't work
* I finally FIXED IT
It took me 2 hours to resolve the problem
* Fill the missed method summary
* Remove some unused code
* Revert http version
* Remove JSON parsing bug workaround
Not needed anymore as per e06438b582
* Remove comment asking about clientID
Client ID is used for session token refreshes. Random UUID without hyphens
Co-authored-by: ORelio <ORelio@users.noreply.github.com>
2021-01-06 21:14:51 +01:00
ReinforceZwei
53bd56100f
1.16+ Terrain and Movement support (#1353)
* First implementation
* Improve chunk reading performance
* Fix indentation
* Remove debug information
* Update MultiBlockChange packet
* Move skip varint to a method
* Fix crash when not using block palette
* Fix DataTypes.cs not compiling on .NET 4.0
Binary (0b) values not handled so converted to Hexadecimal (0x)
* Use the 1.16 chunk parsing code for 1.15 too
Document the differences in padding and factor the code
Co-authored-by: ORelio <ORelio@users.noreply.github.com>
2020-11-28 20:48:35 +01:00
mexiscool
28f47cc532
Adds support for villager trading (#1316)
* adds villager trading support
Adds handler for tradeList packet and selectTrade packet
* added extra line at end
* removed tab; removed size and hasSecondItem
removed a mistakenly added tab instead of 4 spaces. SelectTrade was already added in 1.13. Removed unnecessary size and hasSecondItem from trade dataType.
* Added VillagerInfo class and capitalized vars in Trade class
* Update VillagerInfo.cs
* Small formatting/naming adjustments
Co-authored-by: ORelio <ORelio@users.noreply.github.com>
2020-11-08 23:39:07 +01:00
DanisDGK
bea5161d6f
Add support for 1.16.4 (#1311) 2020-11-03 19:04:34 +01:00
ReinforceZwei
2017d5d652
Add support of language files (#1273)
* Basic support of language file
Only mapped main part of MCC.
* Translations function imporve
* Change translation file naming
* Fix default translation file naming
* Complete translation file mapping for main part
Command and ChatBot not done yet
* Complete translation mapping for commands
Except Entitycmd
* Complete translation mapping for ChatBots
* Add new method for replacing translation key
Just for Entitycmd. Be proud of yourself. We have a convenient method now.
* Complete all translation mapping
* Add default config and translation file to resource
* Remove untranslatable messages from default translation file
2020-10-17 13:41:31 +02:00
ReinforceZwei
7e20e409a8
Add support for creating replay mod capture files (#1246)
* Add test replay handler
* Fix incorrect built raw packet
* Fix incorrect built raw packet
* Add filter
* Add not working zip lib
* Add dotNetZip lib and complete basic function
* Update ReplayHandler.cs
* Complete Replay handler
Without client player handling
* Complete replay mod
- New ChatBot OnNetworkPacket event
* Add auto-backup and command for Replay Mod
* Add ReplayMod description to readme
* Small naming changes, fix compile error on .NET4.0
* ReplayHandler slight optimizations
Use Path.Combine to automatically use Windows '\' or Linux '/'
Move re-usable common parts outside the Replay handler
Small optimizations in building JSON strings
Co-authored-by: ORelio <oreliogitantispam.l0gin@spamgourmet.com>
2020-09-06 21:51:42 +02:00
ReinforceZwei
cd1badb9d6
Add item moving helper class (#1243)
* Create item moving helper class
* Change the method calling order for joined game
 Dispatch bot after things are initialized such as inventories
* Add GetItemMovingHelper ChatBot method
2020-08-29 17:53:29 +02:00
ReinforceZwei
3434d95b81
Add packet palettes (#1236)
* Add packet type palette
* Fix
* test new palette
* Fix 1.16.2 palette
* Add packet ID dumper
* Add document
* Update naming
* Delete old implementation of packet type
* Rename PacketTypeHandler to PacketType18Handler
* Fix packet type namespace
* Add dump to file method for packet type
* Rename packet palette version number
* Replace unknown packet type to explicit type name
Prevent duplicated key while creating reverse mapping
* Include packets ID in packet palette
Add packet palette helper class
* Remove packet ID dumper methods
As packets ID are included in source code now
2020-08-26 19:19:59 +02:00
Рома Данилов
c2e2e85063
Add Entity.Item, Entity.CustomName, OnEntityMetadata event (#1222)
* Add New Event
* new Event
* Add OnEntityMetadaTa
* Update ChatBot.cs
* Update Protocol18.cs
* Update Entity.cs
* EntityCMD Update
* Update IMinecraftComHandler.cs
* Update Protocol18.cs
* Update IMinecraftComHandler.cs
* Update McClient.cs
* Update IMinecraftComHandler.cs
* Update McClient.cs
* Update McClient.cs
* Update McClient.cs
* Update McClient.cs
* Update ChatBot.cs
* Update McClient.cs
* Update Entity.cs
* Create EntityPose.cs
* Update MinecraftClient.csproj
* Update McClient.cs
* Update EntityPose.cs
* Update Entity.cs
* Update McClient.cs
* Remove debug line
* Update Entitycmd.cs
* Update Entity.cs
* Update McClient.cs
* Update Entity.cs
* Update McClient.cs
* Update McClient.cs
* Update Entity.cs
* Update McClient.cs
* Update Entitycmd.cs
* Update Entitycmd.cs
* Update McClient.cs
* Update Entitycmd.cs
* Update Entitycmd.cs
* Update Entity.cs
* Update McClient.cs
* Update Entitycmd.cs
* Update Entitycmd.cs
* Update Entitycmd.cs
* Update Entitycmd.cs
* Update Entitycmd.cs
* Update Entitycmd.cs
* Crash Fix on Item
* Crashes Fix
* Update McClient.cs
* Crashes fix
* Update McClient.cs
* Update Entity.cs
* Update Entity.cs
* Update McClient.cs
* Update McClient.cs
* Update McClient.cs
* Update McClient.cs
* Update McClient.cs
* Update McClient.cs
* Update McClient.cs
* Update ChatBot.cs
* Update IMinecraftComHandler.cs
* Update McClient.cs
* Update Protocol18.cs
* Update ChatBot.cs
* Update IMinecraftComHandler.cs
* Update Protocol18.cs
* Update McClient.cs
* Fix unaddressed issues
Co-authored-by: ORelio <oreliogitantispam.l0gin@spamgourmet.com>
2020-08-20 18:36:50 +02:00
ReinforceZwei
6bbb7236e3
Add support for Minecraft 1.16.2 (#1214)
* Implement MC version 1.16.2 basic support
All packets ID update done
Tested in 1.16.2 craftbukkit server
* Implement MC 1.16.2 entity handling
New EntityPalette
* Add back protocol version checking for entity handling
Was removed during testing and forgot to add it back
* Implement inventory handling for MC 1.16+
Item ID got changed in 1.16+ so a palette is needed.
* Fix ChangeSlot command
What a joke
* Handle 1.16 new entity properties name
Convert new naming style to old style
* Revert "Handle 1.16 new entity properties name"
This reverts commit 52c7d29062.
* Update AutoAttack to use the new entity properties key
* Fix item type to ID conversion
* Sort item types by name
* Remove ZombiePigmanSpawnEgg
User ZombifiedPiglinSpawnEgg instead (new name for same item)
* Add missing 1.16.2 version strings
* Remove old ItemTypeGenerator
* Sort entity types by name
* Palette loading, instructions, NotImplemented err
Co-authored-by: ORelio <ORelio@users.noreply.github.com>
2020-08-17 17:08:50 +02:00
ReinforceZwei
236e077e44
Add TPS command and improve the calculation of TPS (#1210)
* Add tps command
* Improve tps calculation and tps command
* Remove debug log line
* Improve if-else statement
2020-08-17 11:40:06 +02:00