Files
src
build.gradle
settings.gradle
Code
7 261
src/main/java/com/kodari/localizedbroadcasts/LocalizedBroadcastsPlugin.java
package com.kodari.localizedbroadcasts;
import org.bukkit.plugin.java.JavaPlugin;
public final class LocalizedBroadcastsPlugin extends JavaPlugin {
private RadiusBroadcastService broadcasts;
@Override
public void onEnable() {
saveDefaultConfig();
int radiusChunks = Math.max(0, getConfig().getInt("radius-chunks", 16));
this.broadcasts = new RadiusBroadcastService(this, radiusChunks);
getServer().getPluginManager().registerEvents(
new LocalizedBroadcastListener(
broadcasts,
getConfig().getString("death-sound", "entity.wither.death"),
getConfig().getString("pet-death-message", "&c{owner}&7's {pet} died.")
),
this
);
}
/**
* Broadcasts a message to players within the configured radius of a location.
* Other plugins can use this instead of a global server broadcast when they
* have a meaningful world location for the message.
*/
public RadiusBroadcastService getBroadcasts() {
return broadcasts;
}
}