First release of the 'redesign', organizing most features into components #54
6 changed files with 10 additions and 41 deletions
|
@ -1,13 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Maven: com.github.TBMCPlugins.ButtonCore:Towny:master-v1.0-g8d3b6b6-296">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/github/TBMCPlugins/ButtonCore/Towny/master-v1.0-g8d3b6b6-296/Towny-master-v1.0-g8d3b6b6-296.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/github/TBMCPlugins/ButtonCore/Towny/master-v1.0-g8d3b6b6-296/Towny-master-v1.0-g8d3b6b6-296-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/github/TBMCPlugins/ButtonCore/Towny/master-v1.0-g8d3b6b6-296/Towny-master-v1.0-g8d3b6b6-296-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
|
@ -1,13 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Maven: com.github.milkbowl:VaultAPI:master-c8cb88f27a-1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/github/milkbowl/VaultAPI/master-c8cb88f27a-1/VaultAPI-master-c8cb88f27a-1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/github/milkbowl/VaultAPI/master-c8cb88f27a-1/VaultAPI-master-c8cb88f27a-1-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/com/github/milkbowl/VaultAPI/master-c8cb88f27a-1/VaultAPI-master-c8cb88f27a-1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
|
@ -16,20 +16,13 @@ import javax.annotation.Nullable;
|
|||
*/
|
||||
@Getter
|
||||
public class TBMCChatEvent extends TBMCChatEventBase {
|
||||
public TBMCChatEvent(CommandSender sender, ChromaGamerBase user, Channel channel, String message, int score, boolean fromcmd, String groupid) {
|
||||
super(channel, message, score, groupid);
|
||||
this.sender = sender;
|
||||
this.fromcmd = fromcmd;
|
||||
this.ignoreSenderPermissions = false;
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public TBMCChatEvent(CommandSender sender, ChromaGamerBase user, Channel channel, String message, int score, boolean fromcmd, String groupid, boolean ignoreSenderPermissions) {
|
||||
public TBMCChatEvent(CommandSender sender, ChromaGamerBase user, Channel channel, String message, int score, boolean fromcmd, String groupid, boolean ignoreSenderPermissions, String origin) {
|
||||
super(channel, message, score, groupid);
|
||||
this.sender = sender;
|
||||
this.user = user;
|
||||
this.fromcmd = fromcmd;
|
||||
this.ignoreSenderPermissions = ignoreSenderPermissions;
|
||||
this.origin = origin;
|
||||
}
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
@ -37,7 +30,8 @@ public class TBMCChatEvent extends TBMCChatEventBase {
|
|||
private final CommandSender sender;
|
||||
private final boolean fromcmd;
|
||||
private final boolean ignoreSenderPermissions;
|
||||
private final ChromaGamerBase user;
|
||||
private final ChromaGamerBase user;
|
||||
private final String origin;
|
||||
// TODO: Message object with data?
|
||||
|
||||
/**
|
||||
|
|
|
@ -30,7 +30,8 @@ public class ChatMessage {
|
|||
*/
|
||||
private CommandSender permCheck;
|
||||
/**
|
||||
* The origin of the message, "minecraft" or "discord" for example.
|
||||
* The origin of the message, "Minecraft" or "Discord" for example. May be displayed to the user.<br>
|
||||
* <b>This is the user class capitalized folder name.</b>
|
||||
*/
|
||||
private final String origin;
|
||||
|
||||
|
@ -39,7 +40,7 @@ public class ChatMessage {
|
|||
}
|
||||
|
||||
@NonNull
|
||||
public static ChatMessageBuilder builder(Channel channel, CommandSender sender, ChromaGamerBase user, String message) {
|
||||
return builder().sender(sender).user(user).message(message);
|
||||
public static ChatMessageBuilder builder(CommandSender sender, ChromaGamerBase user, String message) {
|
||||
return builder().sender(sender).user(user).message(message).origin(user.getFolder().substring(0, 1).toUpperCase() + user.getFolder().substring(1));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -238,7 +238,7 @@ public class TBMCChatAPI {
|
|||
if (eventPre.isCancelled())
|
||||
return true;
|
||||
TBMCChatEvent event;
|
||||
event = new TBMCChatEvent(cm.getSender(), cm.getUser(), channel, eventPre.getMessage(), score, cm.isFromCommand(), rtr.groupID, permcheck != cm.getSender());
|
||||
event = new TBMCChatEvent(cm.getSender(), cm.getUser(), channel, eventPre.getMessage(), score, cm.isFromCommand(), rtr.groupID, permcheck != cm.getSender(), cm.getOrigin());
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
return event.isCancelled();
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import java.lang.annotation.*;
|
|||
@Inherited
|
||||
public @interface UserClass {
|
||||
/**
|
||||
* Indicates which folder should the player files be saved in.
|
||||
* Indicates which folder should the player files be saved in. Must be lowercase.
|
||||
*/
|
||||
String foldername();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue