Tooltip support & Bug fix

This commit is contained in:
BruceChen 2022-12-11 13:00:19 +08:00
parent 892999ac98
commit 5e11ed3896
40 changed files with 8409 additions and 1987 deletions

View file

@ -44,12 +44,12 @@ namespace MinecraftClient.Commands
dispatcher.Register(l => l.Literal(CmdName)
.Executes(r => ListAllInventories(r.Source, handler))
.Then(l => l.Literal("creativegive")
.Then(l => l.Argument("Slot", Arguments.Integer(0, 89))
.Then(l => l.Argument("Slot", MccArguments.InventorySlot())
.Then(l => l.Argument("ItemType", MccArguments.ItemType())
.Then(l => l.Argument("Count", Arguments.Integer(min: 1))
.Executes(r => DoCreativeGive(r.Source, handler, Arguments.GetInteger(r, "Slot"), MccArguments.GetItemType(r, "ItemType"), Arguments.GetInteger(r, "Count")))))))
.Then(l => l.Literal("creativedelete")
.Then(l => l.Argument("Slot", Arguments.Integer(0, 89))
.Then(l => l.Argument("Slot", MccArguments.InventorySlot())
.Executes(r => DoCreativeDelete(r.Source, handler, Arguments.GetInteger(r, "Slot")))))
.Then(l => l.Literal("inventories")
.Executes(r => ListAvailableInventories(r.Source, handler)))
@ -64,12 +64,12 @@ namespace MinecraftClient.Commands
.Then(l => l.Literal("list")
.Executes(r => DoListAction(r.Source, handler, Arguments.GetInteger(r, "InventoryId"))))
.Then(l => l.Literal("click")
.Then(l => l.Argument("Slot", Arguments.Integer(0, 89))
.Then(l => l.Argument("Slot", MccArguments.InventorySlot())
.Executes(r => DoClickAction(r.Source, handler, Arguments.GetInteger(r, "InventoryId"), Arguments.GetInteger(r, "Slot"), WindowActionType.LeftClick))
.Then(l => l.Argument("Action", MccArguments.InventoryAction())
.Executes(r => DoClickAction(r.Source, handler, Arguments.GetInteger(r, "InventoryId"), Arguments.GetInteger(r, "Slot"), MccArguments.GetInventoryAction(r, "Action"))))))
.Then(l => l.Literal("drop")
.Then(l => l.Argument("Slot", Arguments.Integer(0, 89))
.Then(l => l.Argument("Slot", MccArguments.InventorySlot())
.Executes(r => DoDropAction(r.Source, handler, Arguments.GetInteger(r, "InventoryId"), Arguments.GetInteger(r, "Slot"), WindowActionType.DropItem))
.Then(l => l.Literal("all")
.Executes(r => DoDropAction(r.Source, handler, Arguments.GetInteger(r, "InventoryId"), Arguments.GetInteger(r, "Slot"), WindowActionType.DropItemStack))))))
@ -77,12 +77,12 @@ namespace MinecraftClient.Commands
.Then(l => l.Literal("list")
.Executes(r => DoListAction(r.Source, handler, inventoryId: 0)))
.Then(l => l.Literal("click")
.Then(l => l.Argument("Slot", Arguments.Integer(0, 45))
.Then(l => l.Argument("Slot", MccArguments.InventorySlot())
.Executes(r => DoClickAction(r.Source, handler, inventoryId: 0, Arguments.GetInteger(r, "Slot"), WindowActionType.LeftClick))
.Then(l => l.Argument("Action", MccArguments.InventoryAction())
.Executes(r => DoClickAction(r.Source, handler, inventoryId: 0, Arguments.GetInteger(r, "Slot"), MccArguments.GetInventoryAction(r, "Action"))))))
.Then(l => l.Literal("drop")
.Then(l => l.Argument("Slot", Arguments.Integer(0, 45))
.Then(l => l.Argument("Slot", MccArguments.InventorySlot())
.Executes(r => DoDropAction(r.Source, handler, inventoryId: 0, Arguments.GetInteger(r, "Slot"), WindowActionType.DropItem))
.Then(l => l.Literal("all")
.Executes(r => DoDropAction(r.Source, handler, inventoryId: 0, Arguments.GetInteger(r, "Slot"), WindowActionType.DropItemStack))))))
@ -92,12 +92,12 @@ namespace MinecraftClient.Commands
.Then(l => l.Literal("list")
.Executes(r => DoListAction(r.Source, handler, inventoryId: null)))
.Then(l => l.Literal("click")
.Then(l => l.Argument("Slot", Arguments.Integer(0, 89))
.Then(l => l.Argument("Slot", MccArguments.InventorySlot())
.Executes(r => DoClickAction(r.Source, handler, inventoryId: null, Arguments.GetInteger(r, "Slot"), WindowActionType.LeftClick))
.Then(l => l.Argument("Action", MccArguments.InventoryAction())
.Executes(r => DoClickAction(r.Source, handler, inventoryId: null, Arguments.GetInteger(r, "Slot"), MccArguments.GetInventoryAction(r, "Action"))))))
.Then(l => l.Literal("drop")
.Then(l => l.Argument("Slot", Arguments.Integer(0, 89))
.Then(l => l.Argument("Slot", MccArguments.InventorySlot())
.Executes(r => DoDropAction(r.Source, handler, inventoryId: null, Arguments.GetInteger(r, "Slot"), WindowActionType.DropItem))
.Then(l => l.Literal("all")
.Executes(r => DoDropAction(r.Source, handler, inventoryId: null, Arguments.GetInteger(r, "Slot"), WindowActionType.DropItemStack))))))