Add broadcasts, drop essentials
This commit is contained in:
1 parent
7435532bcf
commit
f119f733bc
6 files changed
+121
-14
No files matched your search
@@ -31,10 +31,6 @@ import org.bukkit.entity.Player
|
||||
class EssentialsHook {
|
||||
val essentials = Bukkit.getServer().pluginManager.getPlugin("Essentials") as IEssentials
|
||||
|
||||
fun isAfk(player: Player): Boolean {
|
||||
return user(player).isAfk
|
||||
}
|
||||
|
||||
fun isVanished(player: Player): Boolean {
|
||||
return user(player).isVanished
|
||||
}
|
||||
|
||||
@@ -216,6 +216,7 @@ class ConfigManager(
|
||||
saveBundledResource("main.conf", mainConfigPath)
|
||||
saveBundledResource("first-join.conf", firstJoinConfigPath)
|
||||
saveBundledResource("join-quit-configs/default.conf", dataDirectory.resolve("join-quit-configs/default.conf"))
|
||||
saveBundledResource("message-configs/announcements.conf", dataDirectory.resolve("message-configs/announcements.conf"))
|
||||
saveBundledResource("message-configs/demo.conf", dataDirectory.resolve("message-configs/demo.conf"))
|
||||
}
|
||||
|
||||
|
||||
@@ -221,13 +221,6 @@ class MessageConfig : SelfSavable<CommentedConfigurationNode>, KoinComponent {
|
||||
|
||||
private fun broadcast(message: Message) {
|
||||
for (onlinePlayer in Bukkit.getOnlinePlayers().toList()) {
|
||||
if (announcerPlus.essentials != null) {
|
||||
if (announcerPlus.essentials!!.isAfk(onlinePlayer) &&
|
||||
announcerPlus.hasPermission(onlinePlayer, "${announcerPlus.name}.messages.$name.afk")
|
||||
) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
if (announcerPlus.hasPermission(onlinePlayer, "${announcerPlus.name}.messages.$name")) {
|
||||
with(message) {
|
||||
val audience = announcerPlus.audiences().player(onlinePlayer)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# v1.4.5-SNAPSHOT+98cb9bd
|
||||
|
||||
# Set whether to check for updates on startup
|
||||
check-for-updates=true
|
||||
check-for-updates=false
|
||||
# Here you can define custom placeholders for use in plugin messages
|
||||
# These placeholders can be used like "{placeholder}", i.e. "{nick}" or "{r}rainbow text{rc}"
|
||||
custom-placeholders {
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
# For a player to get these messages give them the announcerplus.messages.announcements permission.
|
||||
|
||||
messages=[
|
||||
{
|
||||
message-text=[
|
||||
"<dark_gray>-----------------------------------------------------",
|
||||
"{prefix1} <yellow>Death piles and XP are protected from the 30-minute cleanup. Use <white>/cleanupin</white> to check the timer.",
|
||||
"<dark_gray>-----------------------------------------------------"
|
||||
]
|
||||
},
|
||||
{
|
||||
message-text=[
|
||||
"<dark_gray>-----------------------------------------------------",
|
||||
"{prefix1} <green>Block drops become pickup-ready after 5 ticks instead of the usual 10.",
|
||||
"<dark_gray>-----------------------------------------------------"
|
||||
]
|
||||
},
|
||||
{
|
||||
message-text=[
|
||||
"<dark_gray>-----------------------------------------------------",
|
||||
"{prefix1} <aqua>Enchanting uses classic-style rolls with modern enchants, automatic lapis, and no anvil Too Expensive limit.",
|
||||
"<dark_gray>-----------------------------------------------------"
|
||||
]
|
||||
},
|
||||
{
|
||||
message-text=[
|
||||
"<dark_gray>-----------------------------------------------------",
|
||||
"{prefix1} <gold>Standing pets can follow you after teleports when their old chunks unload. Less lost pet drama.",
|
||||
"<dark_gray>-----------------------------------------------------"
|
||||
]
|
||||
},
|
||||
{
|
||||
message-text=[
|
||||
"<dark_gray>-----------------------------------------------------",
|
||||
"{prefix1} <red>Most mobs have a 2.5% head drop chance. Charged creepers are rarer at 1.25%.",
|
||||
"<dark_gray>-----------------------------------------------------"
|
||||
]
|
||||
},
|
||||
{
|
||||
message-text=[
|
||||
"<dark_gray>-----------------------------------------------------",
|
||||
"{prefix1} <gold>Lost, stuck, or ready to head back? Use <white><click:run_command:'/spawn'>/spawn</click></white> to return to server spawn.",
|
||||
"<dark_gray>-----------------------------------------------------"
|
||||
]
|
||||
},
|
||||
{
|
||||
message-text=[
|
||||
"<dark_gray>-----------------------------------------------------",
|
||||
"{prefix1} <aqua>Use <white>/deposit all</white> to store your diamonds before you head back out.",
|
||||
"<dark_gray>-----------------------------------------------------"
|
||||
]
|
||||
},
|
||||
{
|
||||
message-text=[
|
||||
"<dark_gray>-----------------------------------------------------",
|
||||
"{prefix1} <aqua>Use <white>/pay player amount</white> to send diamonds directly to another player.",
|
||||
"<dark_gray>-----------------------------------------------------"
|
||||
]
|
||||
},
|
||||
{
|
||||
message-text=[
|
||||
"<dark_gray>-----------------------------------------------------",
|
||||
"{prefix1} <green>Extra homes unlock through long-term progression. Use <white><click:run_command:'/claimquest'>/claimquest</click></white> when ready.",
|
||||
"<dark_gray>-----------------------------------------------------"
|
||||
]
|
||||
},
|
||||
{
|
||||
message-text=[
|
||||
"<dark_gray>-----------------------------------------------------",
|
||||
"{prefix1} <yellow>Use <white>/playtime</white> to see how long you have been adventuring here.",
|
||||
"<dark_gray>-----------------------------------------------------"
|
||||
]
|
||||
},
|
||||
{
|
||||
message-text=[
|
||||
"<dark_gray>-----------------------------------------------------",
|
||||
"{prefix1} <light_purple>Use <white>/msg player message</white> to send a private message without leaving chat.",
|
||||
"<dark_gray>-----------------------------------------------------"
|
||||
]
|
||||
},
|
||||
{
|
||||
message-text=[
|
||||
"<dark_gray>-----------------------------------------------------",
|
||||
"{prefix1} <green>Use <white>/togglephantoms</white> to choose whether phantoms can spawn for you.",
|
||||
"<dark_gray>-----------------------------------------------------"
|
||||
]
|
||||
},
|
||||
{
|
||||
message-text=[
|
||||
"<dark_gray>-----------------------------------------------------",
|
||||
"{prefix1} <red>Use <white>/bounty top</white> to see active bounties. Claims have a 50% chance to drop the target's head.",
|
||||
"<dark_gray>-----------------------------------------------------"
|
||||
]
|
||||
},
|
||||
{
|
||||
message-text=[
|
||||
"<dark_gray>-----------------------------------------------------",
|
||||
"{prefix1} <gold>Chest shops work without normal gameplay commands: create shops by interacting with shop containers.",
|
||||
"<dark_gray>-----------------------------------------------------"
|
||||
]
|
||||
},
|
||||
{
|
||||
message-text=[
|
||||
"<dark_gray>-----------------------------------------------------",
|
||||
"{prefix1} <yellow>Mining a spawner with Silk Touch has a 50% chance to drop it. Bring the right pickaxe.",
|
||||
"<dark_gray>-----------------------------------------------------"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
every-broadcast-commands=[]
|
||||
every-broadcast-per-player-commands=[]
|
||||
every-broadcast-as-player-commands=[]
|
||||
interval-time="10 minutes"
|
||||
startup-delay="1 minute"
|
||||
random-message-order=true
|
||||
remove-duplicate-comments=true
|
||||
remove-disabled-message-elements=true
|
||||
version=1
|
||||
@@ -1,6 +1,4 @@
|
||||
# For a player to get these messages give them the announcerplus.messages.demo permission
|
||||
# If EssentialsX is installed, then giving a player the announcerplus.messages.demo.afk permission
|
||||
# will stop them from receiving these messages while afk
|
||||
|
||||
# The list of messages for a config
|
||||
messages=[
|
||||
|
||||
Reference in new issue
Block a user