Exemplo n.º 1
0
 @EventHandler(priority = EventPriority.LOWEST)
 public void PlayerEvent(PlayerBucketEmptyEvent e) {
   if (!plugin.isProtected()) return;
   Location check = e.getPlayer().getTargetBlock(null, 100).getLocation();
   check.add(0, 1, 0);
   if (plugin.checkBoxLarge(check)) e.setCancelled(true);
 }
Exemplo n.º 2
0
 @EventHandler(priority = EventPriority.LOWEST)
 public void onBlockPlace(BlockPlaceEvent e) {
   if (!plugin.isProtected()) return;
   if (plugin.checkBox(e.getBlock().getLocation())) {
     e.setCancelled(true);
     e.getPlayer().sendMessage("Cannot edit blocks in Town Warp zone");
   }
 }
Exemplo n.º 3
0
 public final void initEconomy() {
   RegisteredServiceProvider<Economy> economyProvider =
       plugin.getServer().getServicesManager().getRegistration(Economy.class);
   if (economyProvider != null) {
     economy = economyProvider.getProvider();
   }
   if (economy != null) {
     foundEconomy = true;
     economyName =
         plugin
             .getServer()
             .getServicesManager()
             .getRegistration(net.milkbowl.vault.economy.Economy.class)
             .getProvider()
             .getName();
     String message = "Hooked in to " + economyName + " via [Vault]!";
     plugin.getLogger().info(message);
   } else {
     plugin.getLogger().warning("No economy plugin found! Economy Options Disabled!");
   }
 }
Exemplo n.º 4
0
 @EventHandler(priority = EventPriority.LOWEST)
 public void onLiquid(BlockFromToEvent e) {
   if (!plugin.isProtected()) return;
   if (plugin.checkLiq(e.getToBlock().getLocation())) e.setCancelled(true);
 }