Jump to content
  • Sign Up

All Activity

This stream auto-updates     

  1. Past hour
  2. Today
  3. The “requires latest version of MCGalaxy” comment is false as 1.9.5.0 is not even out yet, and to be more correct is to specify that it needs a development build which version themselves as 1.9.4.9 annoyingly. A minor nitpick but whatever…
  4. Thank you SO MUCH! I'll definitely use these changes and info!
  5. I made changes and comments explaining the reasoning: using System; using MCGalaxy; using MCGalaxy.Events.ServerEvents; using MCGalaxy.Events.PlayerEvents; // REQUIRES THE LATEST VERSION OF MCGALAXY!!!!!!!!!!!!!!!!!!!!!!!!!!! namespace PluginToneIndicators { public sealed class ToneIndicators : Plugin { public override string name { get { return "tones"; } } // This should indicate the earliest version of MCGalaxy the plugin is compatible with, rather than the plugin's version // Unfortunately we must use the current version because the development build of MCGalaxy hasn't incremented the version number public override string MCGalaxy_Version { get { return "1.9.4.9"; } } public override string creator { get { return "AllergenX"; } } public override void Load(bool startup) { OnChatEvent.Register(OnChat, Priority.High); } public override void Unload(bool shutdown) { OnChatEvent.Unregister(OnChat); } public static void OnChat(ChatScope scope, Player source, ref string msg, object arg, ref ChatMessageFilter filter, bool relay) { //The general criticism is that you have a lot of code that is copy-pasted and doing the same thing. //This can be a problem because if you have to fix or change something, you have to be able to accurately //copy and paste that change into many places, which can be a common source of mistakes. //For instance, your original code had this: // // else if (msg.CaselessContains("/srs")) // { // const string removeString = "/nsrs"; // //Beause of the copy pasting of each tone, you forgot to change the if /srs to if /nsrs //To solve this, we can write a function that handles the parts that were copy pasted before, //and pass arguments for the parts that are different, for much less repeated text. if (HandleTone("/j", "joking", ref msg)) { return; } if (HandleTone("/s", "sarcasm", ref msg)) { return; } if (HandleTone("/hj", "half-joking", ref msg)) { return; } if (HandleTone("/srs", "serious", ref msg)) { return; } if (HandleTone("/nsrs", "not-serious", ref msg)) { return; } if (HandleTone("/r", "romantic", ref msg)) { return; } if (HandleTone("/t", "teasing", ref msg)) { return; } //^ If the given tone was handled, we're done, so we can quit the function early with return. //You could also use else-if. It's a personal preference IMO } // Returns true if the tone was found and the message was modified, otherwise false public static bool HandleTone(string tone, string prefix, ref string msg) { int toneStart = FindTone(tone, msg); if (toneStart == -1) { return false; } string startOfString = msg.Substring(0, toneStart); string endOfString = msg.Substring(toneStart + tone.Length); // Remove a space to prevent double spaces when removing a tone if (endOfString.Length > 0 && endOfString[0] == ' ') { endOfString = endOfString.Substring(1); } string cleanString = startOfString + endOfString; msg = ("&7[&a"+prefix+"&7] " + cleanString); return true; } // Returns the index of a tone if it was found, -1 if not found public static int FindTone(string tone, string msg) { int toneStart = msg.IndexOf(tone); if (toneStart == -1) { return -1; } //We need to make sure the tone isn't part of another word or tone. //Both sides of the word must either be a space, or the start/end of the message bool leftSideClear = false; bool rightSideClear = false; // Bonus info: when using || in if statements to do "OR", as soon as one of the conditions is true, it skips over the remaining ones. // This means that we do not have to do string bounds checking when looking at index -1 because // it's guaranteed that toneStart is not zero if (toneStart == 0 || msg[toneStart-1] == ' ') { leftSideClear = true; } if (toneStart + tone.Length == msg.Length || msg[toneStart+tone.Length] == ' ') { rightSideClear = true; } if (leftSideClear && rightSideClear) { return toneStart; } else { return -1; } } } }
  6. I'd love constructive criticism on everything! This is my first plugin, so its probably not very great :) I also made them lowercase
  7. That's a cool idea. In my opinion it might look better if the tones within the brackets were lowercase Would you like constructive criticism on the code itself?
  8. Hey there! I made a simple tone indicators plugin. All it does is it takes tone indicators like /j or /s among others, and puts a little tag, like [JOKING], in front of your chat message. You can find the source code for it here: https://github.com/AllergenStudios/MCGalaxy-Plugins/blob/main/ToneIndicators.cs Use it for whatever server you want, no credit required. If you use it on your server, it would be cool to comment your server name so I can check it out!
  9. Yesterday
  10. To modify messages sent by players, use OnChatEvent and modify the ref "msg" argument. I believe you will need to be using the latest build of MCGalaxy to do this, though. You can find latest builds here: https://123dmwm.com/MCGalaxy/ https://github.com/ClassiCube/MCGalaxy/blob/master/MCGalaxy/Events/ServerEvents.cs#L107 For instance public static void OnChat(ChatScope scope, Player source, ref string msg, object arg, ref ChatMessageFilter filter, bool relay) { if (message.CaselessContains("sign")) msg += " I STEPPED ON THE SIGN!"; }
  11. p.cancelchat = true; This is how the chat event should be cancelled.
  12. I am trying to make a tone indicators plugin, where when people say something like '\j', it puts JOKING in their chat message But I can't figure out how to cancel events, since I don't want the player to send the chat message and instead have the server send it with the word "JOKING" in it. Here's my code incase needed: using System; using MCGalaxy; using MCGalaxy.Events.ServerEvents; using MCGalaxy.Events.PlayerEvents; namespace PluginToneIndicators { public sealed class ToneIndicators : Plugin { public override string name { get { return "ToneIndicators"; } } public override string MCGalaxy_Version { get { return "0.1"; } } public override string creator { get { return "AllergenX"; } } public override void Load(bool startup) { OnPlayerChatEvent.Register(HandlePlayerChat, Priority.High); } public override void Unload(bool shutdown) { OnPlayerChatEvent.Unregister(HandlePlayerChat); } static void HandlePlayerChat(Player p, string message) { if (message.Contains("\\j") == true) { // Cancel the event somehow // Ignore the rest of the code from this comment Chat.Message(ChatScope.Global, "&aJOKING", null, null, true); } } } }
  13. Last week
  14. Screenshot by 123DontMessWitMe A new lighting feature is planned for ClassiCube. With this new feature, called fancy lighting, bright blocks will cast a much wider range of light, allowing dark spaces in maps to be lit up. This new feature improves the builder's creative freedom and the player's experience by allowing a variety of light levels to be set throughout the map, much like Minecraft versions after Classic. This option will coexist with the current advanced lighting option, which is renamed to smooth lighting in the new branch. To try out the new feature, you'll use the ModernLighting branch. While you can build this version from source code yourself, there are built versions for Windows and Linux that can be downloaded from GitHub Actions using nightly.link, so here they are: https://nightly.link/ClassiCube/ClassiCube/workflows/build_windows/ModernLighting https://nightly.link/ClassiCube/ClassiCube/workflows/build_linux/ModernLighting Here's the source code for the ModernLighting branch of ClassiCube: https://github.com/ClassiCube/ClassiCube/tree/ModernLighting This branch may be updated frequently, so check back for a new version! You can see all of the changes on GitHub. I've also built a webclient version so more people can try it out. It's only singleplayer, and it is a bit finicky for me at least, but the new feature is all working: https://ctrl-c.club/~square/ I hope you find this new feature interesting!
  15. lol, I didn't know that that was a command, thank you!
  16. There is no way to set a command permission only in a specific level. Allowing players to make custom blocks without having access to /lb generally (along with many other commands) is what /os is for. Players can use /os lb to create blocks in their realms.
  17. Using MCGalaxy, is there a command to set a permission for a command in a certain level? I want to make it so in every created realm (they are created using message blocks) in a server makes it so that anybody can use the /levelblock command in it. Help always appreciated :D
  18. If it's a terrain.png, there's a website called garbage.loan that is for hosting classicube resource packs and skins. You can then use /os map texture <the link you copied to the uploaded texture> in-game.
  19. how to set the resourse pack if it`s a PICTURE? PLS HELP!!!
  20. how to set the resourse pack if it`s a PICTURE? PLS HELP!!!
  21. (I don't know if I put this in the wrong place, but its not a help question or anything like that so I think this is the right place, correct me if I'm wrong!) There is a server named "iwasntfound server", when I joined I tried to use a /goto command since I couldn't find how to get back to the lobby. One of the "levels match" recommendations that popped up was just a giant world name with tons of bad words (not just swear words, worse than that, wont be repeating). And then they also used impersonate commands to make it look like people were saying some bad things as well. I don't know if this warrants being removed from the server list, but it probably does.
  22. it has already been ported to phones and tablets, check the android and ios downloads
  23. In America, we have "maytag" washing machines, they have little screens, so theoretically, we could port classicube to one.
  24. Earlier
  25. /mb [block] /z tnt |/mark 0 0 0 |/mark 20 20 20
  26. I am trying to make a spleef gamemode, but am running into an issue. My goal is to use a message block with a cuboid command between two positions, and then fill it in with TNT. But it doesn't seem that it's possible to fill a cuboid with a command (like this: /cuboid tnt 0 0 0 20 20 20) Anyone know a way to achieve this goal? Help is appreciated :D
  27. I don't know if you are ignorant or purposefully rude, but the server is designed to be a fairly Vanilla experience. We use the Minecraft Alpha and Beta textures for all of our blocks. We have put effort into building the server and ensuring it is a safe and happy place where people can talk together and build. The server is intentionally and boldly Vanilla, so I think it is wholly unfair to say that the server is just an "effortless freebuild server."
  1. Load more activity
×
×
  • Create New...