Memo - Really basic offline messaging Version 1.0 - Download JAR Required dependencies: OffLine A bit late but here it is - An input layer for players to send messages using OffLine, and it also doubles as the example plugin (see below for source code). If you want something more advanced for offline message handling (inboxes, outboxes, long-term message storage, etc.) I'm pretty sure there are a couple of other plugins, go look for them. Features Allows players to send private messages to players who may be offline. Very simple, absolutely no extras. Uses my OffLine plugin for message delivery. Installation (Move your mouse to reveal the content) Installation (open) Installation (close) Installation Put Memo.jar and OffLine.jar in the plugins folder and restart/reload your server. That's all! How to use (Move your mouse to reveal the content) How to use (open) How to use (close) How to use This plugin provides only one command. /memo PLAYERNAME MESSAGE Sends a MESSAGE from you to user PLAYERNAME via OffLine. If the user is online he receives it immediately, otherwise it is stored for later delivery. If you're the server owner you can change the message formatting string in config.yml (for example if you want to add colors). The default is: Code: msg-format: '<%sender%> %msg%' The complete source code (Move your mouse to reveal the content) The complete source code (open) The complete source code (close) Code: package net.myshelter.minecraft.memo; import java.util.logging.Logger; import net.myshelter.minecraft.OffLine; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; class MessengerSet implements Runnable { Memo plugin; MessengerSet(Memo plugin) { this.plugin = plugin; } public void run() { plugin.offline = (OffLine)plugin.getServer().getPluginManager().getPlugin("OffLine"); if (plugin.offline == null) Memo.dolog("WARNING: Plugin not loaded! Messages will not be sent!"); } } public class Memo extends JavaPlugin { protected static Logger log = Logger.getLogger("Minecraft"); protected static void dolog(String msg) { log.info("[Memo] " + msg); } String msgFormat = null; protected OffLine offline = null; protected final void prepareMessenger() { getServer().getScheduler().scheduleSyncDelayedTask(this, new MessengerSet(this)); } public boolean msg(String player, String message) { if (offline == null) return false; return offline.msg(getDescription().getName(), player, message); } public void onEnable() { prepareMessenger(); msgFormat = getConfiguration().getString("msg-format"); if (msgFormat == null) msgFormat = "<%sender%> %msg%"; dolog("Enabled! Version is " + getDescription().getVersion()); } public void onDisable() { dolog("Disabled..."); } public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) { if (!(sender instanceof Player)) return false; Player player = (Player)sender; if (command.getName().equalsIgnoreCase("memo")) { if (args.length < 2) { player.sendMessage("Syntax: /memo PLAYER MESSAGE"); return true; } if (args[0].equals(player.getName())) { player.sendMessage("You're right there!"); return true; } String message = args[1]; for (int i = 2; i < args.length; i++) message = message + " " + args[i]; msg(args[0], msgFormat.replace("%sender%", player.getName()).replace("%msg%", message)); player.sendMessage("Message for " + args[0] + " sent."); dolog(player.getName() + " sent a message for " + args[0]); return true; } return false; } } Changelog v1.0The first!
Applebule: I'll leave /mail free for other plugins to use. Also, I think conceptually speaking a mail should be something you can keep in your inbox.
As you can see from the source code, everyone can use it; If it's being restricted it's another plugin doing it. Or one of the server owners modified the source code to filter out non-ops.