Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.xghostkillerx.unlimitedlava;
- import org.bukkit.Material;
- import org.bukkit.entity.Player;
- import org.bukkit.event.player.PlayerBucketFillEvent;
- import org.bukkit.event.player.PlayerListener;
- import org.bukkit.inventory.ItemStack;
- /**
- * UnlimitedLavaPlayerListener
- * Handles the players activities!
- *
- * Refer to:
- * http://bit.ly/n1Wex2
- *
- * @author xGhOsTkiLLeRx
- * @thanks to loganwm for the help!!
- * @thanks to Edward Hand for the idea and original InfiniteLava plugin!
- *
- */
- public class UnlimitedLavaPlayerListener extends PlayerListener {
- public static UnlimitedLava plugin;
- public UnlimitedLavaPlayerListener(UnlimitedLava instance) {
- plugin = instance;
- }
- @SuppressWarnings("deprecation")
- public void onPlayerBucketFill(PlayerBucketFillEvent event) {
- Player player = event.getPlayer();
- if (plugin.permissions) {
- if (event.getBlockClicked().getTypeId() == 9) {
- return;
- }
- if (!player.hasPermission("unlimitedlava.use")) {
- player.setItemInHand(new ItemStack(Material.BOOK, 1));
- player.sendMessage("Debug, test message!");
- player.updateInventory();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment