timbru31

Untitled

Aug 25th, 2011
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.15 KB | None | 0 0
  1. package de.xghostkillerx.unlimitedlava;
  2.  
  3. import org.bukkit.Material;
  4. import org.bukkit.entity.Player;
  5. import org.bukkit.event.player.PlayerBucketFillEvent;
  6. import org.bukkit.event.player.PlayerListener;
  7. import org.bukkit.inventory.ItemStack;
  8.  
  9. /**
  10.  * UnlimitedLavaPlayerListener
  11.  * Handles the players activities!
  12.  *
  13.  * Refer to:
  14.  * http://bit.ly/n1Wex2
  15.  *
  16.  * @author xGhOsTkiLLeRx
  17.  * @thanks to loganwm for the help!!
  18.  * @thanks to Edward Hand for the idea and original InfiniteLava plugin!
  19.  *
  20.  */
  21.  
  22. public class UnlimitedLavaPlayerListener extends PlayerListener {
  23.  
  24.     public static UnlimitedLava plugin;
  25.    
  26.     public UnlimitedLavaPlayerListener(UnlimitedLava instance) {
  27.         plugin = instance;
  28.     }
  29.  
  30.     @SuppressWarnings("deprecation")
  31.     public void onPlayerBucketFill(PlayerBucketFillEvent event) {
  32.         Player player = event.getPlayer();
  33.         if (plugin.permissions) {
  34.             if (event.getBlockClicked().getTypeId() == 9) {
  35.                 return;
  36.             }
  37.             if (!player.hasPermission("unlimitedlava.use")) {
  38.                 player.setItemInHand(new ItemStack(Material.BOOK, 1));
  39.                 player.sendMessage("Debug, test message!");
  40.                 player.updateInventory();
  41.             }
  42.         }
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment