MCPcopy Create free account
hub / github.com/TyphoonMC/TyphoonCore / onCommand

Method onCommand

command.go:79–88  ·  view source on GitHub ↗
(player *Player, command string)

Source from the content-addressed store, hash-verified

77}
78
79func (c *Core) onCommand(player *Player, command string) {
80 args := strings.Split(command, " ")
81
82 node := &c.rootCommand
83 if !c.analyseCommand(player, args, node, 0) {
84 m := ChatMessage("Unknown command")
85 m.SetColor(&ChatColorRed)
86 player.SendMessage(m)
87 }
88}
89
90func (c *Core) analyseCommand(player *Player, args []string, node *CommandNode, step int) bool {
91 if len(args) > step {

Callers 1

HandleMethod · 0.80

Calls 4

analyseCommandMethod · 0.95
ChatMessageFunction · 0.85
SetColorMethod · 0.80
SendMessageMethod · 0.80

Tested by

no test coverage detected