Fixing needler, projectiles in SW and "Banannas...".
This commit is contained in:
parent
aaf4991737
commit
de4d0a7dc3
@ -83,11 +83,13 @@ import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.block.BlockSpreadEvent;
|
||||
import org.bukkit.event.block.LeavesDecayEvent;
|
||||
import org.bukkit.event.entity.EntityCombustEvent;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.entity.EntityDeathEvent;
|
||||
import org.bukkit.event.entity.EntityTargetLivingEntityEvent;
|
||||
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
||||
import org.bukkit.event.entity.ItemDespawnEvent;
|
||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||
@ -962,6 +964,9 @@ public abstract class Skywars extends Game
|
||||
if (event.GetDamage() >= 1)
|
||||
return;
|
||||
|
||||
if(GetTeam(event.GetDamagerPlayer(true)) == GetTeam(event.GetDamageePlayer()))
|
||||
return;
|
||||
|
||||
if (event.GetProjectile() instanceof Egg || event.GetProjectile() instanceof Snowball)
|
||||
{
|
||||
event.SetCancelled("Egg/Snowball");
|
||||
@ -982,6 +987,25 @@ public abstract class Skywars extends Game
|
||||
event.GetDamageeEntity().setVelocity(vel);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void projectile(EntityDamageByEntityEvent event)
|
||||
{
|
||||
if(event.getDamager() instanceof Snowball || event.getDamager() instanceof Egg || event.getDamager() instanceof EnderPearl)
|
||||
{
|
||||
Projectile prj = (Projectile) event.getDamager();
|
||||
if(prj.getShooter() instanceof Player)
|
||||
{
|
||||
if(event.getEntity() instanceof Player)
|
||||
{
|
||||
if(GetTeam((Player) prj.getShooter()) == GetTeam((Player) event.getEntity()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void fillChest(Player looter, Block block)
|
||||
{
|
||||
|
@ -134,7 +134,7 @@ public class TeamSkywars extends Skywars
|
||||
private enum TeamColors
|
||||
{
|
||||
|
||||
YELLOW(ChatColor.YELLOW, new String[]{"Bananna", "Sunshine", "Custard", "Sponge", "Star", "Giraffe", "Lego", "Light"}),
|
||||
YELLOW(ChatColor.YELLOW, new String[]{"Banana", "Sunshine", "Custard", "Sponge", "Star", "Giraffe", "Lego", "Light"}),
|
||||
GREEN(ChatColor.GREEN, new String[]{"Creepers", "Alien", "Seaweed", "Emerald", "Grinch", "Shrub", "Snake", "Leaf"}),
|
||||
AQUA(ChatColor.AQUA, new String[]{"Diamond", "Ice", "Pool", "Kraken", "Aquatic", "Ocean"}),
|
||||
RED(ChatColor.RED, new String[]{"Heart", "Tomato", "Ruby", "Jam", "Rose", "Apple", "TNT"}),
|
||||
|
@ -153,7 +153,7 @@ public class TeamSuperSmash extends SuperSmash
|
||||
private enum TeamColors
|
||||
{
|
||||
|
||||
YELLOW(ChatColor.YELLOW, new String[]{"Bananna", "Sunshine", "Custard", "Sponge", "Star", "Giraffe", "Lego", "Light"}),
|
||||
YELLOW(ChatColor.YELLOW, new String[]{"Banana", "Sunshine", "Custard", "Sponge", "Star", "Giraffe", "Lego", "Light"}),
|
||||
GREEN(ChatColor.GREEN, new String[]{"Creepers", "Alien", "Seaweed", "Emerald", "Grinch", "Shrub", "Snake", "Leaf"}),
|
||||
AQUA(ChatColor.AQUA, new String[]{"Diamond", "Ice", "Pool", "Kraken", "Aquatic", "Ocean"}),
|
||||
RED(ChatColor.RED, new String[]{"Heart", "Tomato", "Ruby", "Jam", "Rose", "Apple", "TNT"}),
|
||||
|
@ -106,7 +106,7 @@ public class TeamSurvivalGames extends SurvivalGames
|
||||
private enum TeamColors
|
||||
{
|
||||
|
||||
YELLOW(ChatColor.YELLOW, new String[]{"Bananna", "Sunshine", "Custard", "Sponge", "Star", "Giraffe", "Lego", "Light"}),
|
||||
YELLOW(ChatColor.YELLOW, new String[]{"Banana", "Sunshine", "Custard", "Sponge", "Star", "Giraffe", "Lego", "Light"}),
|
||||
GREEN(ChatColor.GREEN, new String[]{"Creepers", "Alien", "Seaweed", "Emerald", "Grinch", "Shrub", "Snake", "Leaf"}),
|
||||
AQUA(ChatColor.AQUA, new String[]{"Diamond", "Ice", "Pool", "Kraken", "Aquatic", "Ocean"}),
|
||||
RED(ChatColor.RED, new String[]{"Heart", "Tomato", "Ruby", "Jam", "Rose", "Apple", "TNT"}),
|
||||
|
@ -131,7 +131,10 @@ public class PerkNeedler extends SmashPerk
|
||||
DamageCause.THORNS, 1.1, true, true, false,
|
||||
damager.getName(), GetName());
|
||||
|
||||
Manager.GetCondition().Factory().Poison(GetName(), event.GetDamageeEntity(), damager, 2, 0, false, false, false);
|
||||
if(Manager.GetGame().GetTeam(event.GetDamageePlayer()) != Manager.GetGame().GetTeam(damager))
|
||||
{
|
||||
Manager.GetCondition().Factory().Poison(GetName(), event.GetDamageeEntity(), damager, 2, 0, false, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
Loading…
Reference in New Issue
Block a user