mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
Implement legacy Farmer support updates
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/395596c2-cc40-4295-8100-a8408243f45b Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
This commit is contained in:
parent
8ba95c6140
commit
9549743c6d
7 changed files with 28 additions and 8 deletions
|
|
@ -73,7 +73,7 @@ namespace MinecraftClient.ChatBots
|
|||
|
||||
public override void Initialize()
|
||||
{
|
||||
if (GetProtocolVersion() < Protocol18Handler.MC_1_13_Version)
|
||||
if (GetProtocolVersion() < Protocol18Handler.MC_1_8_Version)
|
||||
{
|
||||
LogToConsole(Translations.bot_farmer_not_implemented);
|
||||
return;
|
||||
|
|
@ -626,6 +626,9 @@ namespace MinecraftClient.ChatBots
|
|||
{
|
||||
var protocolVersion = GetProtocolVersion();
|
||||
|
||||
if (protocolVersion < Protocol18Handler.MC_1_13_Version)
|
||||
return IsLegacyCropFullyGrown(block, cropType);
|
||||
|
||||
switch (cropType)
|
||||
{
|
||||
case CropType.Beetroot:
|
||||
|
|
@ -781,6 +784,21 @@ namespace MinecraftClient.ChatBots
|
|||
return false;
|
||||
}
|
||||
|
||||
private static bool IsLegacyCropFullyGrown(Block block, CropType cropType)
|
||||
{
|
||||
return cropType switch
|
||||
{
|
||||
CropType.Beetroot => block.BlockId == 207 && block.BlockMeta >= 3,
|
||||
CropType.Carrot => block.BlockId == 141 && block.BlockMeta >= 7,
|
||||
CropType.Melon => block.BlockId == 105 && block.BlockMeta >= 7,
|
||||
CropType.NetherWart => block.BlockId == 115 && block.BlockMeta >= 3,
|
||||
CropType.Pumpkin => block.BlockId == 104 && block.BlockMeta >= 7,
|
||||
CropType.Potato => block.BlockId == 142 && block.BlockMeta >= 7,
|
||||
CropType.Wheat => block.BlockId == 59 && block.BlockMeta >= 7,
|
||||
_ => false
|
||||
};
|
||||
}
|
||||
|
||||
// Yoinked from ReinforceZwei's AutoTree and adapted to search the whole of inventory in additon to the hotbar
|
||||
private bool SwitchToItem(ItemType itemType)
|
||||
{
|
||||
|
|
@ -854,4 +872,4 @@ namespace MinecraftClient.ChatBots
|
|||
else LogDebugToConsole(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -183,6 +183,7 @@ namespace MinecraftClient.Mapping.BlockPalettes
|
|||
{ 173, Material.CoalBlock },
|
||||
{ 174, Material.PackedIce },
|
||||
{ 175, Material.TallGrass }, // DoublePlant
|
||||
{ 207, Material.Beetroots }, // BeetrootBlock
|
||||
};
|
||||
|
||||
protected override Dictionary<int, Material> GetDict()
|
||||
|
|
|
|||
|
|
@ -5506,6 +5506,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
packet.Add(0); // cursorY
|
||||
packet.Add(0); // cursorZ
|
||||
|
||||
SendPacket(PacketTypesOut.PlayerBlockPlacement, packet);
|
||||
return true;
|
||||
case < MC_1_14_Version:
|
||||
packet.AddRange(dataTypes.GetLocation(location));
|
||||
|
|
|
|||
|
|
@ -521,7 +521,7 @@ cooldown: {6}</value>
|
|||
<value>The Farmer bot needs Terrain Handling in order to work, please enable it!</value>
|
||||
</data>
|
||||
<data name="bot.farmer.not_implemented" xml:space="preserve">
|
||||
<value>Not implemented bellow 1.13!</value>
|
||||
<value>Not implemented below 1.8!</value>
|
||||
</data>
|
||||
<data name="bot.farmer.radius" xml:space="preserve">
|
||||
<value>Radius</value>
|
||||
|
|
|
|||
|
|
@ -1957,7 +1957,7 @@ redirectFrom:
|
|||
|
||||
<div class="custom-container warning"><p class="custom-container-title">Warning</p>
|
||||
|
||||
**This a newly added bot, it is not perfect and was only tested in 1.19.2, there are some minor issues with it and you should treat it as an experimental bot.**
|
||||
**This bot is still experimental, has some known issues, and should be treated with extra caution on legacy versions.**
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -555,7 +555,7 @@ Coordinate = { x = 145, y = 64, z = 2045 }
|
|||
|
||||
<div class="custom-container warning"><p class="custom-container-title">Warning</p>
|
||||
|
||||
**This feature is currently not supported in `1.4.6 - 1.9`. But we are working on getting it supported in 1.8 and 1.9.**
|
||||
**This feature is currently supported on `1.8+` and is unavailable on `1.4.6 - 1.7.10`.**
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1016,7 +1016,7 @@ In scripts and remote control, no slash is needed to perform the command, eg. `q
|
|||
|
||||
<div class="custom-container warning"><p class="custom-container-title">Warning</p>
|
||||
|
||||
**The [Inventory Handling](configuration.md#inventoryhandling) is currently not supported in `1.4.6 - 1.9`**
|
||||
**The [Inventory Handling](configuration.md#inventoryhandling) is currently supported on `1.8+` and is unavailable on `1.4.6 - 1.7.10`.**
|
||||
|
||||
</div>
|
||||
|
||||
|
|
@ -1063,7 +1063,7 @@ In scripts and remote control, no slash is needed to perform the command, eg. `q
|
|||
|
||||
<div class="custom-container warning"><p class="custom-container-title">Warning</p>
|
||||
|
||||
**The [Inventory Handling](configuration.md#inventoryhandling) is currently not supported in `1.4.6 - 1.9`.**
|
||||
**The [Inventory Handling](configuration.md#inventoryhandling) is currently supported on `1.8+` and is unavailable on `1.4.6 - 1.7.10`.**
|
||||
|
||||
</div>
|
||||
|
||||
|
|
@ -1298,7 +1298,7 @@ In scripts and remote control, no slash is needed to perform the command, eg. `q
|
|||
|
||||
<div class="custom-container warning"><p class="custom-container-title">Warning</p>
|
||||
|
||||
**The [Inventory Handling](configuration.md#inventoryhandling) is currently not supported in `1.4.6 - 1.9`.**
|
||||
**The [Inventory Handling](configuration.md#inventoryhandling) is currently supported on `1.8+` and is unavailable on `1.4.6 - 1.7.10`.**
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue