diff --git a/src/main/java/us/camin/JoinListener.java b/src/main/java/us/camin/JoinListener.java index e819418..9b62e1d 100644 --- a/src/main/java/us/camin/JoinListener.java +++ b/src/main/java/us/camin/JoinListener.java @@ -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()); } } diff --git a/src/main/java/us/camin/Plugin.java b/src/main/java/us/camin/Plugin.java index 374f35d..4b072ab 100644 --- a/src/main/java/us/camin/Plugin.java +++ b/src/main/java/us/camin/Plugin.java @@ -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 { diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 6827040..03949e3 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -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