Guest User

Untitled

a guest
Apr 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. public void onBlockBreak(BlockBreakEvent event) { // to erase bounty if can't afford
  2. Player p = event.getPlayer();
  3. Block block = event.getBlock();
  4. Sign sign = (Sign) event.getBlock();
  5.  
  6. if(block.getType() == Material.SIGN || block.getType() == Material.WALL_SIGN)
  7.  
  8. {
  9. if(sign.getLine(0).equalsIgnoreCase("[Bounty]")) {
  10. Set<String> list = Bounty.bounty.getKeys(true); //This gets a List of all the Nodes which are Directly in the file, so every username
  11.  
  12. for(Iterator<String> iter = list.iterator(); iter.hasNext(); ) //A loop for iterate through these names
  13. {
  14. String key = iter.next(); //This gets the next object on the list
  15. if(key.equals(sign.getLine(2)))
  16. {
  17. //Not sure how to start over here to delete it
  18. }
  19.  
  20. }
  21.  
  22. }
  23. }
  24.  
  25. }
Add Comment
Please, Sign In to add comment