Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static HashMap<Location, Material> blocks = new HashMap<Location, Material>();
- @EventHandler
- public void onProjecitle(ProjectileHitEvent event){
- if(event.getEntity().getType() == EntityType.ENDER_PEARL){
- Block block = event.getEntity().getLocation().getBlock();
- for (int z = -1; z <= 1; z++) {
- for (int x = -1; x <= 1; x++) {
- for (int y = -1; y <= 1; y++) {
- final Location loc = block.getRelative(x, y, z).getLocation();
- if(loc.getBlock().getType() != Material.AIR){
- Aure.blocks.put(loc.getBlock().getLocation(), block.getType());
- loc.getBlock().setType(Material.WOOL);
- Bukkit.getScheduler().runTaskLater(plugin, new Runnable(){
- @Override
- public void run() {
- loc.getBlock().setType(Aure.blocks.get(loc.getBlock().getLocation()));
- }
- }, 40L);
- }
- }
- }
- }
- }
- }
- Location theRealBlock = event.getEntity().getLocation().substract(0.0D, 1.0D, 0.0D);
- event.getEntity().getLocation();
- Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
- Bukkit.getScheduler().runTaskLater(plugin, new Runnable(){
- Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
- public void run(){
- loc.getBlock().setType(Aure.blocks.get(loc)); //no need to use loc.getBlock().getLocation(), same thing as just using loc
- }
- }, 40L);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement