2015-01-15 20:56:13 +01:00
package com.sekwah.advancedportals ;
import org.bukkit.command.CommandSender ;
public class PluginMessages {
2016-08-02 05:51:16 +02:00
private AdvancedPortalsPlugin plugin ;
public boolean useCustomPrefix = false ;
public static String customPrefix = " \ u00A7a[ \ u00A7eAdvancedPortals \ u00A7a] " ;
public static String customPrefixFail = " \ u00A7c[ \ u00A77AdvancedPortals \ u00A7c] " ;
public PluginMessages ( AdvancedPortalsPlugin plugin ) {
this . plugin = plugin ;
ConfigAccessor config = new ConfigAccessor ( this . plugin , " config.yml " ) ;
this . useCustomPrefix = config . getConfig ( ) . getBoolean ( " UseCustomPrefix " ) ;
if ( useCustomPrefix ) {
2017-11-20 21:45:19 +01:00
PluginMessages . customPrefix = config . getConfig ( ) . getString ( " CustomPrefix " ) . replaceAll ( " & " , " \ u00A7 " ) ;
2016-08-02 05:51:16 +02:00
PluginMessages . customPrefixFail = config . getConfig ( ) . getString ( " CustomPrefixFail " ) . replaceAll ( " & " , " \ u00A7 " ) ;
}
}
2015-01-15 20:56:13 +01:00
2016-03-29 13:38:03 +02:00
// This class is so then the common messages in commands or just messages over the commands are the same and can be
// easily changed.
public static void UnknownCommand ( CommandSender sender , String command ) {
2016-08-02 05:51:16 +02:00
sender . sendMessage ( customPrefixFail + " You need to type something after / " + command + " \ n " ) ;
2016-03-29 13:38:03 +02:00
sender . sendMessage ( " \ u00A7cIf you do not know what you can put or would like some help with the commands please type \ u00A7e " + '"' + " \ u00A7e/ " + command + " help " + '"' + " \ u00A7c \ n " ) ;
}
public static void NoPermission ( CommandSender sender , String command ) {
2016-08-02 05:51:16 +02:00
sender . sendMessage ( customPrefixFail + " You do not have permission to perform that command! " ) ;
2016-03-29 13:38:03 +02:00
}
2015-01-15 20:56:13 +01:00
}