Are you a server owner? if you are then youve probably wanted a specific event or just a msg or a event Well coming soon Will Be ServerCore Server core like most plugins will have a Config file to disable and enable features and a broad number of features with enable/disable and some with Input messages If you are intrusted in this plugin Please Give me ideas in the comments!
Plugin is going to have many commands handled in chat (i like chat commands more)
Release of stable versions will be labled: (Tested: Stable) in changlog
I am planning to have ServerCore running by The release of sponge maybe a bit later
(Current builds and release Dates)
Servercore Most recent changlogs or downloads
The âIm back Baby!â Update
Servercore-Compiled Build 2.1
API Running: Yes
Structure: Yes
Working?: Yes
dev/beta/release/alpha: Release
Downloads: On the website
Source Code on Website
Changlog:
ChatBot: Finished
Commands: Handled under chat
Events - Done
Stable: Yes
waiting on sponge
What the hell? Whatâs the point of it being open source then? You are limiting distribution, and give credit to the library just for using it. You must never have heard of the OSS foundation, no? You should look at what defines open source.
The reason i dont have source code up is becouse its still being worked on to get to a basic and every one of the files can be built apon as a api but dev would just be optimized for it thats why its my last priority
That chatevent . Is the best Object orientated code I ever have seen.
Omfg I keep clicking it, just to check if I am not dreaming⌠. Not that I code good, but still ⌠. Not even main.java. Well at the possitive side, he has a git and its open-source.
These bukkit plugins he included donât exist or are private onces. And I donât believe he maded this: Overview - Core Updates - Bukkit Plugins - Projects - Bukkit. Because it includes a .project. For me it is clear he isnât using any IDE at allâŚ
Thereâs still more work to do to become better, first do as suggested by @Exstar.
Have you read the code you have posted? Itâs very difficult to read.
The formatting is terrible. Remove those blank lines, use proper indentation and structure your code in a logical order.
If you use eclipse, press Ctrl+Shift -> F to format nicely.
What sort of method name is chatbo4264323532534513551614t2t?!
I will not say any more now, as it is difficult to work out whatâs going on.
Updated github with the rewrite and note: chatbo4264323532534513551614t2t is just a random name i typed with my keyboard by pressing buttons so i could get more done
Making methods like that, will not help you getting things done. Its better to give them a good name, so you know what they are doing. I see you are making different behaviours for chat. Wouldnât it be better if you made something like this:
public interface ChatBehaviour{
void analyse(AsyncPlayerChatEvent event);
}
public class ChatManager{
private List<ChatBehaviour> chatBehaviours = new ArrayList<ChatBehaviour>();
public void registerBehaviour(ChatBehaviour behaviour){
chatBehaviours.add(behaviour);
}
@Subscribe
public void AnalyzeChat(AsyncPlayerChatEvent event){
for (ChatBehaviour behaviour : chatBehaviours)
behaviour.analyse(event)
}
}
//In your plugin main method
ChatManager manager = new ChatManager();
manager.registerBehaviour(new ChatBehaviour(){
public void analyse(AsyncPlayerChatEvent event){
if (event.getMessage().contains("fuck")){
event.getPlayer().kick("Don't curse please");
event.setCancelled(true);
}
}
}); //In java 8 this could be done more nicely but yea where still on 6...
IMO it seems a bit counter-productive to do that. Not to mention it also reduces the readability of your code, making people less likely to submit a PR ;).
Judging by whatâs in your repository, it would also be a good idea to brush up on your Java skills while the Sponge API is still under development. That way youâre ready for when we have something more complete to work with. If youâre not into books, thereâs plenty of documentation out on the internet for you to read :).