Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ? @EventHandler
- public void onProjectileHit(ProjectileHitEvent event) throws NotRegisteredException{
- if(((Player) event.getEntity().getShooter()).hasPermission("valkyriebows.tnt.shoot") || ((Player) event.getEntity().getShooter()).hasPermission("senseless.permission")){
- Projectile projectile = event.getEntity();
- Player p = (Player) projectile.getShooter();
- Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin("WorldGuard");
- Location location = new Location(projectile.getLocation().getWorld(), projectile.getLocation().getX(), projectile.getLocation().getY(), projectile.getLocation().getZ()) ;
- ConfigurationManager cfg = plugin.getGlobalStateManager(); //eclipse says i need to cast this to object. What did i do wrong?
- World world = location.getWorld();
- WorldConfiguration wcfg = cfg.get(world);
- if(explosiveArrayList.contains(projectile)){
- if(!wcfg.blockOtherExplosions){
- projectile.getWorld().createExplosion(projectile.getLocation(), 2.0F);
- explosiveArrayList.remove(projectile);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement