hub stuff
This commit is contained in:
parent
aa13bcf5c6
commit
bd2c9aa5e6
@ -3,16 +3,20 @@ package mineplex.hub.modules;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
|
||||
import org.bukkit.EntityEffect;
|
||||
import org.bukkit.FireworkEffect.Type;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Bat;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Slime;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.event.player.PlayerVelocityEvent;
|
||||
@ -349,6 +353,12 @@ public class SoccerManager extends MiniPlugin
|
||||
|
||||
if (_ball != null && _ball.equals(ent))
|
||||
continue;
|
||||
|
||||
if (ent instanceof Bat)
|
||||
{
|
||||
ent.remove();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (inPlayerArena(ent))
|
||||
{
|
||||
@ -491,4 +501,30 @@ public class SoccerManager extends MiniPlugin
|
||||
{
|
||||
_active.remove(event.getPlayer());
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void allowDamage(EntityDamageByEntityEvent event)
|
||||
{
|
||||
if (!(event.getEntity() instanceof Player) || !(event.getDamager() instanceof Player))
|
||||
return;
|
||||
|
||||
Player damager = (Player)event.getDamager();
|
||||
Player damagee = (Player)event.getEntity();
|
||||
|
||||
if (!_active.contains(damager) || !_active.contains(damagee))
|
||||
return;
|
||||
|
||||
if (getTeamColor(damager) == null || getTeamColor(damagee) == null)
|
||||
return;
|
||||
|
||||
if (getTeamColor(damager) == getTeamColor(damagee))
|
||||
return;
|
||||
|
||||
if (Recharge.Instance.use(damagee, "Football Damage", 800, false, false))
|
||||
{
|
||||
UtilAction.velocity(damagee, UtilAlg.getTrajectory2d(damager, damagee), 0.6, false, 0, 0.3, 1, true);
|
||||
|
||||
damagee.playEffect(EntityEffect.HURT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user