mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Add submodule MinecraftProtocolLibrary
This commit is contained in:
parent
87026e1bfb
commit
3f1de66af3
62 changed files with 1093 additions and 450 deletions
|
|
@ -1,41 +0,0 @@
|
|||
namespace MinecraftClient.Inventory
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a Minecraft effects
|
||||
/// </summary>
|
||||
public enum Effects
|
||||
{
|
||||
Speed = 1,
|
||||
Slowness = 2,
|
||||
Haste = 3,
|
||||
MiningFatigue = 4,
|
||||
Strength = 5,
|
||||
InstantHealth = 6,
|
||||
InstantDamage = 7,
|
||||
JumpBoost = 8,
|
||||
Nausea = 9,
|
||||
Regeneration = 10,
|
||||
Resistance = 11,
|
||||
FireResistance = 12,
|
||||
WaterBreathing = 13,
|
||||
Invisibility = 14,
|
||||
Blindness = 15,
|
||||
NightVision = 16,
|
||||
Hunger = 17,
|
||||
Weakness = 18,
|
||||
Poison = 19,
|
||||
Wither = 20,
|
||||
HealthBoost = 21,
|
||||
Absorption = 22,
|
||||
Saturation = 23,
|
||||
Glowing = 24,
|
||||
Levitation = 25,
|
||||
Luck = 26,
|
||||
BadLuck = 27,
|
||||
SlowFalling = 28,
|
||||
ConduitPower = 29,
|
||||
DolphinsGrace = 30,
|
||||
BadOmen = 31,
|
||||
HerooftheVillage = 32,
|
||||
}
|
||||
}
|
||||
|
|
@ -39,8 +39,8 @@ namespace MinecraftClient.Inventory
|
|||
if (ValidateSlots(source, dest, destContainer) &&
|
||||
HasItem(source) &&
|
||||
((destContainer != null && !HasItem(dest, destContainer)) || (destContainer == null && !HasItem(dest))))
|
||||
return mc.DoWindowAction(c.ID, source, WindowActionType.LeftClick).Result
|
||||
&& mc.DoWindowAction(destContainer == null ? c.ID : destContainer.ID, dest, WindowActionType.LeftClick).Result;
|
||||
return mc.DoWindowActionAsync(c.ID, source, WindowActionType.LeftClick).Result
|
||||
&& mc.DoWindowActionAsync(destContainer == null ? c.ID : destContainer.ID, dest, WindowActionType.LeftClick).Result;
|
||||
else return false;
|
||||
}
|
||||
|
||||
|
|
@ -57,9 +57,9 @@ namespace MinecraftClient.Inventory
|
|||
if (ValidateSlots(slot1, slot2, destContainer) &&
|
||||
HasItem(slot1) &&
|
||||
(destContainer != null && HasItem(slot2, destContainer) || (destContainer == null && HasItem(slot2))))
|
||||
return mc.DoWindowAction(c.ID, slot1, WindowActionType.LeftClick).Result
|
||||
&& mc.DoWindowAction(destContainer == null ? c.ID : destContainer.ID, slot2, WindowActionType.LeftClick).Result
|
||||
&& mc.DoWindowAction(c.ID, slot1, WindowActionType.LeftClick).Result;
|
||||
return mc.DoWindowActionAsync(c.ID, slot1, WindowActionType.LeftClick).Result
|
||||
&& mc.DoWindowActionAsync(destContainer == null ? c.ID : destContainer.ID, slot2, WindowActionType.LeftClick).Result
|
||||
&& mc.DoWindowActionAsync(c.ID, slot1, WindowActionType.LeftClick).Result;
|
||||
else return false;
|
||||
}
|
||||
|
||||
|
|
@ -104,14 +104,14 @@ namespace MinecraftClient.Inventory
|
|||
break;
|
||||
}
|
||||
}
|
||||
mc.DoWindowAction(c.ID, source, WindowActionType.LeftClick).Wait(); // grab item
|
||||
mc.DoWindowAction(c.ID, -999, startDragging).Wait();
|
||||
mc.DoWindowActionAsync(c.ID, source, WindowActionType.LeftClick).Wait(); // grab item
|
||||
mc.DoWindowActionAsync(c.ID, -999, startDragging).Wait();
|
||||
foreach (var slot in availableSlots)
|
||||
{
|
||||
mc.DoWindowAction(c.ID, slot, addDragging).Wait();
|
||||
mc.DoWindowActionAsync(c.ID, slot, addDragging).Wait();
|
||||
}
|
||||
mc.DoWindowAction(c.ID, -999, endDragging).Wait();
|
||||
mc.DoWindowAction(c.ID, source, WindowActionType.LeftClick).Wait(); // put down item left (if any)
|
||||
mc.DoWindowActionAsync(c.ID, -999, endDragging).Wait();
|
||||
mc.DoWindowActionAsync(c.ID, source, WindowActionType.LeftClick).Wait(); // put down item left (if any)
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue