Cuberite Forum
Essentials for MCServer - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html)
+--- Thread: Essentials for MCServer (/thread-1433.html)

Pages: 1 2


Essentials for MCServer - LO1ZB - 04-05-2014

I try do make a "Essentials" plugin for MCServer, but i´m new to LUA,
so I think, that i´ll need many hours to get basic commands working.
You can find my github for it there:
https://github.com/LO1ZB/EssentialsMCS
Tell me in this thread, when I should add anything andy I maby try to add it, if it fits into the Plugin.

Features:
- commands:
-- /burn <player> <time>
-- /fly [Player] <Speed>
-- /feed [Player]
-- /heal [Player]

<> = required argumend
[] = optional argumend


RE: Essentials for MCServer - tonibm19 - 04-05-2014

Thanks for trying to do this. I can help you if you want Smile

You've a PR from me Smile


RE: Essentials for MCServer - tigerw - 04-05-2014

Thank you for using the SendMessageXXX() functions!

xoft, the standards will prevail! Hopefully!


RE: Essentials for MCServer - gv1222 - 04-05-2014

(04-05-2014, 07:48 AM)tigerw Wrote: Thank you for using the SendMessageXXX() functions!

xoft, the standards will prevail! Hopefully!

I messed around with it at first and wasn't completely sold on it.. but now I am starting to like them much more Smile


RE: Essentials for MCServer - xoft - 04-05-2014

I believe having N functions for what could be a single function and a parameter is stupid.
And now it is a single function with an extra parameter (only with an extra constructor):
a_Player:SendMessage(cCompositeChat("Message, like, whatever", mtInfo))
And it can be easily extended to include further parts, url or clickable commands:
a_Player:SendMessage(cCompositeChat("Usage: ", mtInfo)
  :AddSuggestCommandPart("/cmd verb1 verb2", "/cmd verb1 verb2", "u@b")
  :AddTextPart(" Param1 Param2", "@2")
)
Currently only GalExport is using this construct to its full potential, but I expect to implement it in WE and Gallery, too.
https://github.com/madmaxoft/GalExport/blob/master/GameCmdHandlers.lua#L152-L154
Or even more advanced example:
https://github.com/madmaxoft/GalExport/blob/master/GameCmdHandlers.lua#L415-L425


RE: Essentials for MCServer - tigerw - 04-07-2014

Oh, that looks okay. If only you'd done the cCompoChat bit before SendMsg.

Remove the individual functions and submit PRs to plugins who are using them to fix, I guess.

I can't find code in cCompoChat that actually does anything based on the eMessageType, is this actually the case?


RE: Essentials for MCServer - bearbin - 04-07-2014

Don't remove the old functions, leave them in for compatibility and also because they are shorter and convey the message a bit better.


RE: Essentials for MCServer - xoft - 04-07-2014

The composite chat doesn't currently do anything with the message type; the idea is that later a cChatMessageDecorator class will be instantiated for each player and that class will take each chat message sent to the player and decorate it with the prefixes, or colorize it, or do nothing, based on the player's preferences.


RE: Essentials for MCServer - pikachu784 - 04-16-2014

Great job! I hope this really takes off, it will convert a lot of people from Bukkit!


RE: Essentials for MCServer - LO1ZB - 04-18-2014

(04-16-2014, 04:09 PM)pikachu784 Wrote: Great job! I hope this really takes off, it will convert a lot of people from Bukkit!
Thats exactly the reason, wherefore I started the plugin projekt. Wink
Anyone who is interested in adding something, is invited to add functions, or even join the github repository.