Guest User

Untitled

a guest
Jun 23rd, 2015
52
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.ibc2244.boomcraftMain.commands;
  2.  
  3. import org.bukkit.Effect;
  4. import org.bukkit.Location;
  5. import org.bukkit.Material;
  6. import org.bukkit.World;
  7. import org.bukkit.block.Block;
  8. import org.bukkit.command.Command;
  9. import org.bukkit.command.CommandExecutor;
  10. import org.bukkit.command.CommandSender;
  11. import org.bukkit.entity.Player;
  12.  
  13. import com.ibc2244.boomcraftMain.Main;
  14.  
  15. public class SetBlock implements CommandExecutor {
  16.  
  17. Main plugin;
  18.  
  19. public SetBlock(Main passedPlugin) {
  20. this.plugin = passedPlugin;
  21. }
  22.  
  23. @Override
  24. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  25. Player player = (Player) sender;
  26. Location loc = player.getLocation();
  27. World world = player.getWorld();
  28. Block block = world.getBlockAt(loc);
  29.  
  30. block.setType(Material.WORKBENCH);
  31. world.playEffect(loc, Effect.ITEM_BREAK, 0);
  32.  
  33.  
  34. return true;
  35. }
  36.  
  37. }
RAW Paste Data