Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onEntityExplode(EntityExplodeEvent e){
- if(e.getEntity().getType() == EntityType.PRIMED_TNT && e.blockList().size() > 0){
- Iterator<Block> iter = e.blockList().iterator();
- while (iter.hasNext()) {
- Block b = iter.next();
- Bukkit.broadcastMessage("§cDEBUG 001");
- if(b.getType() != Material.OBSIDIAN) { continue; }
- Bukkit.broadcastMessage("§cDEBUG 002");
- if(!cube.contains(b.getLocation())){Bukkit.broadcastMessage("§cLocation no CONTAINS"); return;}
- if(!bl.containsKey(b)) {bl.put(b, 3); Bukkit.broadcastMessage(b.getType() + " ajout a la liste"); iter.remove();}
- bl.replace(b, bl.get(b) - 1);
- Bukkit.broadcastMessage(bl.get(b) + " : a la liste");
- iter.remove();
- if(bl.get(b) == 0){
- Bukkit.broadcastMessage("DELETE");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement