timbru31

Untitled

Aug 25th, 2011
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.11 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.     public void onPlayerBucketFill(PlayerBucketFillEvent event, Player player, ItemStack itemInHand) {
  31.         if (plugin.permissions = true) {
  32.             event.getItemStack();
  33.             if (event.getBlockClicked().getTypeId() == 9) {
  34.                 return;
  35.             }
  36.             if (!player.hasPermission("unlimitedlava.use")) {
  37.                 event.setItemStack(new ItemStack (Material.BOOK, 1));
  38.                 player.sendMessage("Debug, test message!");
  39.             }
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment