mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
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>
This commit is contained in:
parent
ee5199f760
commit
6bbb7236e3
21 changed files with 4296 additions and 988 deletions
|
|
@ -83,15 +83,18 @@ namespace MinecraftClient.ChatBots
|
|||
|
||||
public override void OnPlayerProperty(Dictionary<string, double> prop)
|
||||
{
|
||||
// adjust auto attack cooldown for maximum attack damage
|
||||
if (prop.ContainsKey("generic.attackSpeed"))
|
||||
foreach (var attackSpeedKey in new[] { "generic.attackSpeed", "minecraft:generic.attack_speed" })
|
||||
{
|
||||
if (attackSpeed != prop["generic.attackSpeed"])
|
||||
// adjust auto attack cooldown for maximum attack damage
|
||||
if (prop.ContainsKey(attackSpeedKey))
|
||||
{
|
||||
serverTPS = GetServerTPS();
|
||||
attackSpeed = prop["generic.attackSpeed"];
|
||||
attackCooldownSecond = 1 / attackSpeed * (serverTPS / 20.0); // server tps will affect the cooldown
|
||||
attackCooldown = Convert.ToInt32(Math.Truncate(attackCooldownSecond / 0.1) + 1);
|
||||
if (attackSpeed != prop[attackSpeedKey])
|
||||
{
|
||||
serverTPS = GetServerTPS();
|
||||
attackSpeed = prop[attackSpeedKey];
|
||||
attackCooldownSecond = 1 / attackSpeed * (serverTPS / 20.0); // server tps will affect the cooldown
|
||||
attackCooldown = Convert.ToInt32(Math.Truncate(attackCooldownSecond / 0.1) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue