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
public void onPlayerJoin(PlayerJoinEvent event) {
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.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.inventory.ItemStack;
import java.util.HashMap;
import java.util.logging.Logger;
import java.io.IOException;
@ -62,6 +63,14 @@ public class Plugin extends JavaPlugin {
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) {
String[] motd = null;
try {

View File

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