The big one.
Alright... I will put the new features in a single list
- Auto-Broadcast (Sends different messages in a specific duration)
Code (Java):
Worlds
:
- world
Texts
:
- Hello World
! World Players
:
%world players
%
- Welcome to the server everyone
! Server Players
:
%server players
%
Time
:
60 # It
's in seconds
- System-Messages Editor (Changes the messages in the plugin)
Code (Java):
IPMessage
:
"&cDetected an IP from this message by &e%player%: &4%message%"
URLMessage
:
"&cDetected a URL from this message by &e%player%: &4%message%"
SwearDetected
:
"&cDetected %words_size% words from this message by &e%player%: &4%words%"
- And the big one for all my fellow developers -
WorldChatterAPI!
Now you can make addons and play with the code in the plugin itself
You have to add it as a library in your IDE
Code (Java):
public
final
class WorldChatter
extends JavaPlugin
implements Listener, CommandExecutor, WorldChatterListener
{
WCL wcl
;
@Override
public
void onEnable
(
)
{
this.
wcl
=
new WCL
(
this
)
;
wcl.
addListener
(
this
)
;
}
@Override
public
void onMessageDetected
(
Object detectedmessage, Player player, BlockType type
)
{
if
(type.
equals
(BlockType.
IP
)
)
Bukkit.
getConsoleSender
(
).
sendMessage
(ChatColor.
translateAlternateColorCodes
(
'&', Objects.
requireNonNull
(Others.
MessageConfig.
getString
(
"IPMessage"
)
).
replace
(
"%player%", player.
getName
(
)
).
replace
(
"%message%", detectedmessage.
toString
(
)
)
)
)
;
if
(type.
equals
(BlockType.
URL
)
)
Bukkit.
getConsoleSender
(
).
sendMessage
(ChatColor.
translateAlternateColorCodes
(
'&', Objects.
requireNonNull
(Others.
MessageConfig.
getString
(
"URLMessage"
)
).
replace
(
"%player%", player.
getName
(
)
).
replace
(
"%message%", detectedmessage.
toString
(
)
)
)
)
;
}
@Override
public
void onMessageSwear
(ArrayList
<String
> badwords, Player player
)
{
Bukkit.
getConsoleSender
(
).
sendMessage
(ChatColor.
translateAlternateColorCodes
(
'&', Objects.
requireNonNull
(Others.
MessageConfig.
getString
(
"SwearDetected"
)
).
replace
(
"%player%", player.
getName
(
)
).
replace
(
"%words%",
String.
join
(
", ", badwords
)
).
replace
(
"%words_size%",
String.
valueOf
(badwords.
size
(
)
)
)
)
)
;
}
@Override
public
void onChatLockToggle
(CommandSender sender,
Boolean isLocked
)
{
if
(isLocked
)
sender.
sendMessage
(ChatColor.
GREEN
+
"The Chat is now "
+ ChatColor.
YELLOW
+
"Locked!"
)
;
else
sender.
sendMessage
(ChatColor.
GREEN
+
"The Chat is now "
+ ChatColor.
YELLOW
+
"Unlocked!"
)
;
}
@Override
public
void onUpdateCheck
(
String oldversion,
String newversion, CommandSender sender
)
{
}
@Override
public
void onConfigReload
(CommandSender sender
)
{
sender.
sendMessage
(ChatColor.
GREEN
+
"Reloaded WorldChatter Config!"
)
;
}
}
Showing Code using API in WorldChatter
DELETE THE OLD CONFIG BEFORE UPDATING