mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fix Miner/Farmer addon scripts (#1047)
This commit is contained in:
parent
87302bafab
commit
09bfe92071
4 changed files with 17 additions and 17 deletions
|
|
@ -572,7 +572,7 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
case PacketIncomingType.ResourcePackSend:
|
case PacketIncomingType.ResourcePackSend:
|
||||||
string url = dataTypes.ReadNextString(packetData);
|
string url = dataTypes.ReadNextString(packetData);
|
||||||
string hash = dataTypes.ReadNextString(packetData);
|
string hash = dataTypes.ReadNextString(packetData);
|
||||||
// Ignore invalid length hash string
|
// Some server plugins may send invalid resource packs to probe the client and we need to ignore them (issue #1056)
|
||||||
if (hash.Length != 40)
|
if (hash.Length != 40)
|
||||||
break;
|
break;
|
||||||
//Send back "accepted" and "successfully loaded" responses for plugins making use of resource pack mandatory
|
//Send back "accepted" and "successfully loaded" responses for plugins making use of resource pack mandatory
|
||||||
|
|
|
||||||
|
|
@ -23,14 +23,14 @@ public class CobblestoneMiner: ChatBot
|
||||||
switch (blockType)
|
switch (blockType)
|
||||||
{
|
{
|
||||||
case Material.Stone:
|
case Material.Stone:
|
||||||
PlayerDigging(0, cobblestone, 1);
|
DigBlock(0, cobblestone, 1);
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
PlayerDigging(2, cobblestone, 1);
|
DigBlock(2, cobblestone, 1);
|
||||||
break;
|
break;
|
||||||
case Material.Cobblestone:
|
case Material.Cobblestone:
|
||||||
PlayerDigging(0, cobblestone, 1);
|
DigBlock(0, cobblestone, 1);
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
PlayerDigging(2, cobblestone, 1);
|
DigBlock(2, cobblestone, 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,9 @@ public class SugarCaneMiner : ChatBot
|
||||||
{
|
{
|
||||||
if (DetectSugarCane(sugarCane, fullHeight))
|
if (DetectSugarCane(sugarCane, fullHeight))
|
||||||
{
|
{
|
||||||
PlayerDigging(0, sugarCane, 1);
|
DigBlock(0, sugarCane, 1);
|
||||||
Thread.Sleep(1);
|
Thread.Sleep(1);
|
||||||
PlayerDigging(2, sugarCane, 1);
|
DigBlock(2, sugarCane, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,25 +26,25 @@ public class TreeFarmer : ChatBot
|
||||||
case Material.OakLog:
|
case Material.OakLog:
|
||||||
// Tree has grown, dig 4 blocks
|
// Tree has grown, dig 4 blocks
|
||||||
ChangeSlot(0);
|
ChangeSlot(0);
|
||||||
PlayerDigging(0, sapling, 1);
|
DigBlock(0, sapling, 1);
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
PlayerDigging(2, sapling, 1);
|
DigBlock(2, sapling, 1);
|
||||||
// 1
|
// 1
|
||||||
PlayerDigging(0, new Location(sapling.X, sapling.Y + 1, sapling.Z), 1);
|
DigBlock(0, new Location(sapling.X, sapling.Y + 1, sapling.Z), 1);
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
PlayerDigging(2, new Location(sapling.X, sapling.Y + 1, sapling.Z), 1);
|
DigBlock(2, new Location(sapling.X, sapling.Y + 1, sapling.Z), 1);
|
||||||
// 2
|
// 2
|
||||||
PlayerDigging(0, new Location(sapling.X, sapling.Y + 2, sapling.Z), 1);
|
DigBlock(0, new Location(sapling.X, sapling.Y + 2, sapling.Z), 1);
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
PlayerDigging(2, new Location(sapling.X, sapling.Y + 2, sapling.Z), 1);
|
DigBlock(2, new Location(sapling.X, sapling.Y + 2, sapling.Z), 1);
|
||||||
// 3
|
// 3
|
||||||
PlayerDigging(0, new Location(sapling.X, sapling.Y + 3, sapling.Z), 1);
|
DigBlock(0, new Location(sapling.X, sapling.Y + 3, sapling.Z), 1);
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
PlayerDigging(2, new Location(sapling.X, sapling.Y + 3, sapling.Z), 1);
|
DigBlock(2, new Location(sapling.X, sapling.Y + 3, sapling.Z), 1);
|
||||||
// 4
|
// 4
|
||||||
PlayerDigging(0, new Location(sapling.X, sapling.Y + 4, sapling.Z), 1);
|
DigBlock(0, new Location(sapling.X, sapling.Y + 4, sapling.Z), 1);
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
PlayerDigging(2, new Location(sapling.X, sapling.Y + 4, sapling.Z), 1);
|
DigBlock(2, new Location(sapling.X, sapling.Y + 4, sapling.Z), 1);
|
||||||
break;
|
break;
|
||||||
case Material.Air:
|
case Material.Air:
|
||||||
// No tree, plant something
|
// No tree, plant something
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue