Implement free half door day

This commit is contained in:
Trever Fischer 2012-04-01 15:09:52 -04:00
parent e51df71725
commit 606642e45e
3 changed files with 14 additions and 0 deletions

View File

@ -65,5 +65,6 @@ public class JoinListener implements Listener {
@EventHandler @EventHandler
public void onPlayerJoin(PlayerJoinEvent event) { public void onPlayerJoin(PlayerJoinEvent event) {
m_plugin.sendMOTD(event.getPlayer()); m_plugin.sendMOTD(event.getPlayer());
m_plugin.checkFreeHalfDoorDay(event.getPlayer());
} }
} }

View File

@ -24,6 +24,7 @@ import org.bukkit.entity.Player;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.inventory.ItemStack;
import java.util.HashMap; import java.util.HashMap;
import java.util.logging.Logger; import java.util.logging.Logger;
import java.io.IOException; import java.io.IOException;
@ -62,6 +63,14 @@ public class Plugin extends JavaPlugin {
log.info("[Caminus] Plugin enabled"); log.info("[Caminus] Plugin enabled");
} }
public void checkFreeHalfDoorDay(Player sender) {
if (sender.hasPermission("caminus.freedoorday")) {
ItemStack stack = new ItemStack(64); // Wooden door block
sender.getInventory().addItem(stack);
sender.sendMessage("Happy mandatory free half door day!");
}
}
public void sendMOTD(CommandSender sender) { public void sendMOTD(CommandSender sender) {
String[] motd = null; String[] motd = null;
try { try {

View File

@ -13,6 +13,10 @@ permissions:
description: Allows use of all caminus permissions description: Allows use of all caminus permissions
children: children:
caminus.whitelisted: true caminus.whitelisted: true
caminus.freedoorday: true
caminus.freedoorday:
default: false
description: Enables free half door day
caminus.whitelisted: caminus.whitelisted:
default: op default: op
description: Allows user to bypass caminus API whitelisting description: Allows user to bypass caminus API whitelisting