Implement free half door day
This commit is contained in:
parent
e51df71725
commit
606642e45e
@ -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());
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user