- cleaned everything up
- renamed game
This commit is contained in:
parent
d8f5ac66fc
commit
b0d30a4ff4
@ -164,24 +164,24 @@ public enum Achievement
|
||||
new int[]{10},
|
||||
AchievementCategory.UHC),
|
||||
|
||||
//Minecraft League
|
||||
MINECRAFT_LEAGUE_STRIKE("First Strike", 600,
|
||||
new String[] {"Minecraft League.FirstStrike"},
|
||||
//MC League
|
||||
MC_LEAGUE_STRIKE("First Strike", 600,
|
||||
new String[] {"MC League.FirstStrike"},
|
||||
new String[] {"Earn 30 First Bloods"},
|
||||
new int[] {30},
|
||||
AchievementCategory.MINECRAFT_LEAGUE),
|
||||
AchievementCategory.MC_LEAGUE),
|
||||
|
||||
MINECRAFT_LEAGUE_HEAD("Head Hunter", 600,
|
||||
new String[] {"Minecraft League.HeadHunter"},
|
||||
MC_LEAGUE_HEAD("Head Hunter", 600,
|
||||
new String[] {"MC League.HeadHunter"},
|
||||
new String[] {"Grab 25 Wither Skulls"},
|
||||
new int[] {25},
|
||||
AchievementCategory.MINECRAFT_LEAGUE),
|
||||
AchievementCategory.MC_LEAGUE),
|
||||
|
||||
MINECRAFT_LEAGUE_ALTAR("Altar Builder", 600,
|
||||
new String[] {"Minecraft League.AltarBuilder"},
|
||||
MC_LEAGUE_ALTAR("Altar Builder", 600,
|
||||
new String[] {"MC League.AltarBuilder"},
|
||||
new String[] {"Place 50 Wither Skulls", "on your Altar"},
|
||||
new int[] {50},
|
||||
AchievementCategory.MINECRAFT_LEAGUE),
|
||||
AchievementCategory.MC_LEAGUE),
|
||||
|
||||
//UHC
|
||||
WIZARDS_WINS("Supreme Wizard", 600,
|
||||
|
@ -50,7 +50,7 @@ public enum AchievementCategory
|
||||
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
|
||||
Material.GOLDEN_APPLE, 0, GameCategory.SURVIVAL, "None"),
|
||||
|
||||
MINECRAFT_LEAGUE("Minecraft League", null,
|
||||
MC_LEAGUE("MC League", null,
|
||||
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
|
||||
Material.IRON_CHESTPLATE, 0, GameCategory.SURVIVAL, "None"),
|
||||
|
||||
|
@ -68,7 +68,7 @@ public enum GameDisplay
|
||||
|
||||
Lobbers("Bomb Lobbers", Material.FIREBALL, (byte) 0, GameCategory.ARCADE, 54),
|
||||
|
||||
Minecraft_League("Minecraft League", Material.DIAMOND_SWORD, (byte)0, GameCategory.SURVIVAL, 62),
|
||||
Minecraft_League("MC League", Material.DIAMOND_SWORD, (byte)0, GameCategory.SURVIVAL, 62),
|
||||
|
||||
ChampionsCTF("Champions CTF", "Champions", Material.BANNER, DyeColor.RED.getDyeData(), GameCategory.CHAMPIONS, 56),
|
||||
|
||||
|
@ -396,9 +396,9 @@ public class MinecraftLeague extends TeamGame
|
||||
return ids;
|
||||
}
|
||||
|
||||
//public TeamTowerBase getActiveTower(GameTeam team)
|
||||
public TeamTowerBase getActiveTower(GameTeam team)
|
||||
{
|
||||
//return _tower.getVulnerable(team);
|
||||
return _tower.getVulnerable(team);
|
||||
}
|
||||
|
||||
public TowerManager getTowerManager()
|
||||
@ -538,12 +538,6 @@ public class MinecraftLeague extends TeamGame
|
||||
|
||||
Scoreboard.Reset();
|
||||
|
||||
Scoreboard.WriteBlank();
|
||||
Scoreboard.Write(C.cYellowB + "Time Elapsed");
|
||||
Scoreboard.Write(UtilTime.MakeStr(_liveTime));
|
||||
if (OverTime)
|
||||
Scoreboard.Write(C.cDRedB + "Overtime");
|
||||
|
||||
Scoreboard.WriteBlank();
|
||||
Scoreboard.Write(C.cRedB + "Red Team");
|
||||
Scoreboard.Write("Towers: " + reds);
|
||||
@ -570,6 +564,12 @@ public class MinecraftLeague extends TeamGame
|
||||
i++;
|
||||
}
|
||||
|
||||
Scoreboard.WriteBlank();
|
||||
Scoreboard.Write(C.cYellowB + "Time Elapsed");
|
||||
Scoreboard.Write(UtilTime.MakeStr(_liveTime));
|
||||
if (OverTime)
|
||||
Scoreboard.Write(C.cDRedB + "Overtime");
|
||||
|
||||
Scoreboard.Draw();
|
||||
}
|
||||
|
||||
@ -797,7 +797,7 @@ public class MinecraftLeague extends TeamGame
|
||||
if (UtilTime.elapsed(GetStateTime(), UtilTime.convert(15, TimeUnit.MINUTES, TimeUnit.MILLISECONDS)))
|
||||
{
|
||||
OverTime = true;
|
||||
UtilTextMiddle.display(C.cGold + "Overtime", C.cGold + "Dying will now cause your crystal to lose 20 health!");
|
||||
UtilTextMiddle.display(C.cGold + "Overtime", C.cGold + "Dying will now cause your crystal to lose 50 health!");
|
||||
}
|
||||
}
|
||||
|
||||
@ -956,7 +956,7 @@ public class MinecraftLeague extends TeamGame
|
||||
{
|
||||
if (!tower.damage(1, player))
|
||||
{
|
||||
player.playSound(tower.getLocation(), Sound.ZOMBIE_WOODBREAK, 1, 0);
|
||||
player.getWorld().playSound(tower.getLocation(), Sound.ZOMBIE_METAL, 1, 1.5f);
|
||||
Alert.alert(tower.getTeam(), tower);
|
||||
}
|
||||
return;
|
||||
@ -968,7 +968,7 @@ public class MinecraftLeague extends TeamGame
|
||||
|
||||
if (!tower.damage(damage, player))
|
||||
{
|
||||
player.playSound(tower.getLocation(), Sound.ZOMBIE_WOODBREAK, 1, 0);
|
||||
player.getWorld().playSound(tower.getLocation(), Sound.ZOMBIE_METAL, 1, 1.5f);
|
||||
Alert.alert(tower.getTeam(), tower);
|
||||
}
|
||||
|
||||
@ -1325,7 +1325,7 @@ public class MinecraftLeague extends TeamGame
|
||||
}
|
||||
if (event.getInventory().getResult().getType() == Material.ARROW)
|
||||
{
|
||||
event.getInventory().setResult(new ItemStack(Material.ARROW, (event.getInventory().getResult().getAmount() * 4)));
|
||||
event.getInventory().setResult(new ItemStack(Material.ARROW, ((event.getInventory().getResult().getAmount() / 4) * 6)));
|
||||
}
|
||||
if (event.getInventory().getResult().getType() == Material.FLINT_AND_STEEL)
|
||||
{
|
||||
@ -1507,7 +1507,7 @@ public class MinecraftLeague extends TeamGame
|
||||
}
|
||||
}
|
||||
|
||||
if (UtilInv.getAmount(player, Material.FISHING_ROD) >= 1)
|
||||
/*if (UtilInv.getAmount(player, Material.FISHING_ROD) >= 1)
|
||||
{
|
||||
for (ItemStack poss : UtilInv.getItems(player))
|
||||
{
|
||||
@ -1517,16 +1517,16 @@ public class MinecraftLeague extends TeamGame
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
//int arrowsToAdd = UtilInv.getAmount(player, Material.ARROW) / 2;
|
||||
//while (arrowsToAdd >= 1)
|
||||
//{
|
||||
//int subtract = Math.min(64, arrowsToAdd);
|
||||
//gear.add(new ItemStack(Material.ARROW, subtract));
|
||||
//arrowsToAdd -= subtract;
|
||||
//}
|
||||
if (UtilInv.getAmount(player, Material.ARROW) >= 1)
|
||||
int arrowsToAdd = UtilInv.getAmount(player, Material.ARROW) / 2;
|
||||
while (arrowsToAdd >= 1)
|
||||
{
|
||||
int subtract = Math.min(64, arrowsToAdd);
|
||||
gear.add(new ItemStack(Material.ARROW, subtract));
|
||||
arrowsToAdd -= subtract;
|
||||
}
|
||||
/*if (UtilInv.getAmount(player, Material.ARROW) >= 1)
|
||||
{
|
||||
for (ItemStack arrow : UtilInv.getItems(player))
|
||||
{
|
||||
@ -1535,7 +1535,7 @@ public class MinecraftLeague extends TeamGame
|
||||
gear.add(arrow);
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
_gear.put(player, gear);
|
||||
}
|
||||
@ -1638,13 +1638,14 @@ public class MinecraftLeague extends TeamGame
|
||||
{
|
||||
if (tb.Alive)
|
||||
{
|
||||
tb.damage(20, null);
|
||||
tb.damage(50, null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (_tower.getAmountAlive(GetTeam(event.GetPlayer())) >= 1)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
UtilPlayer.message(event.GetPlayer(), F.main("Game", "Your Tower lost 50 HP on your Respawn!"));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -0,0 +1,23 @@
|
||||
package nautilus.game.arcade.game.games.minecraftleague.commands;
|
||||
|
||||
import mineplex.core.command.CommandBase;
|
||||
import mineplex.core.common.Rank;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class DebugCommand extends CommandBase<ArcadeManager>
|
||||
{
|
||||
public DebugCommand(ArcadeManager plugin)
|
||||
{
|
||||
super(plugin, Rank.DEVELOPER, new Rank[] {Rank.JNR_DEV}, "debug");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Execute(Player caller, String[] args)
|
||||
{
|
||||
caller.getWorld().spawnEntity(caller.getLocation(), EntityType.ENDER_CRYSTAL);
|
||||
}
|
||||
|
||||
}
|
@ -21,6 +21,7 @@ public class MinecraftLeagueCommand extends MultiCommandBase<ArcadeManager>
|
||||
AddCommand(new GUICommand(plugin, host));
|
||||
AddCommand(new FreezeCommand(plugin, host));
|
||||
AddCommand(new StatusCommand(plugin, host));
|
||||
AddCommand(new DebugCommand(plugin));
|
||||
_host = host;
|
||||
}
|
||||
|
||||
@ -31,5 +32,6 @@ public class MinecraftLeagueCommand extends MultiCommandBase<ArcadeManager>
|
||||
UtilPlayer.message(caller, F.help("/mcLeague gui", "Opens a GUI for controlling Respawn Crystals", Rank.ADMIN));
|
||||
UtilPlayer.message(caller, F.help("/mcLeague freeze <player>", "Freezes or unfreezes a player [for cheaters]", Rank.ADMIN));
|
||||
UtilPlayer.message(caller, F.help("/mcLeague status", "Gets statistics about both Respawn Crystals", Rank.DEVELOPER));
|
||||
UtilPlayer.message(caller, F.help("/mcLeague debug", "Spawns a Tower Mob at your position", Rank.DEVELOPER));
|
||||
}
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ public class DefenderAI
|
||||
private void drawBeam()
|
||||
{
|
||||
Location base = _base.clone().add(0, 10, 0);
|
||||
Location target = _manager.getTeamTowers(_tower.getTeam()).getLast().getLocation().clone().add(0, 10, 0);//_manager.getTeamTowers(_tower.getTeam()).get(_number).getLocation().clone().add(0, 10, 0);
|
||||
Location target = _manager.getTeamTowers(_tower.getTeam()).get(_number).getLocation().clone().add(0, 10, 0);
|
||||
Location display = base.clone();
|
||||
while (UtilMath.offset(base, target) > UtilMath.offset(base, display))
|
||||
{
|
||||
|
@ -35,16 +35,16 @@ public class TeamBeacon
|
||||
return false;
|
||||
}*/
|
||||
|
||||
/*public void setBlock(Block block)
|
||||
{
|
||||
_block = block;
|
||||
}*/
|
||||
|
||||
public Block getBlock()
|
||||
{
|
||||
return _block;
|
||||
}
|
||||
|
||||
/*public void setBlock(Block block)
|
||||
{
|
||||
_block = block;
|
||||
}*/
|
||||
|
||||
public void update()
|
||||
{
|
||||
if (_block.getType() != Material.BEACON)
|
||||
|
@ -48,7 +48,7 @@ public abstract class TeamTowerBase
|
||||
{
|
||||
_host = host;
|
||||
_manager = manager;
|
||||
_spawn = spawn.clone().add(-0.5, 1.2, -0.5);
|
||||
_spawn = spawn.clone().add(-0.5, 3.2, -0.5);
|
||||
_team = team;
|
||||
_maxHealth = 11111D;
|
||||
_health = 11111D;
|
||||
@ -74,9 +74,9 @@ public abstract class TeamTowerBase
|
||||
{
|
||||
String message = "";
|
||||
if (player != null)
|
||||
message = _host.GetTeam(player).GetColor() + player.getName() + _team.GetColor() + " has destroyed " + _team.getDisplayName() + "'s " + C.cDPurpleB + _type + _team.GetColor() + "!";
|
||||
message = _host.GetTeam(player).GetColor() + player.getName() + _team.GetColor() + " has destroyed " + _team.getDisplayName() + "'s " + _type + "!";
|
||||
else
|
||||
message = _team.GetColor() + _team.getDisplayName() + "'s " + C.cDPurpleB + _type + _team.GetColor() + " has been destroyed!";
|
||||
message = _team.GetColor() + _team.getDisplayName() + "'s " + _type + " has been destroyed!";
|
||||
|
||||
//Bukkit.broadcastMessage(message);
|
||||
UtilTextMiddle.display("", message);
|
||||
@ -131,7 +131,7 @@ public abstract class TeamTowerBase
|
||||
{
|
||||
UtilParticle.PlayParticleToAll(ParticleType.LARGE_EXPLODE, _spawn, null, 0, 2, ViewDist.NORMAL);
|
||||
_spawn.getWorld().playSound(_spawn, Sound.EXPLODE, 10, 0);
|
||||
for (Block b : UtilBlock.getExplosionBlocks(_spawn, 2, false))
|
||||
for (Block b : UtilBlock.getExplosionBlocks(_spawn, 5, false))
|
||||
{
|
||||
b.setType(Material.AIR);
|
||||
}
|
||||
|
@ -18,17 +18,15 @@ import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
public class TowerManager implements Listener
|
||||
{
|
||||
public MinecraftLeague Host;
|
||||
private ConcurrentHashMap<TeamTowerBase, GameTeam> _towers = new ConcurrentHashMap<TeamTowerBase, GameTeam>();
|
||||
//private ConcurrentHashMap<GameTeam, Integer> _vulnerableTower = new ConcurrentHashMap<GameTeam, Integer>();
|
||||
private ConcurrentHashMap<GameTeam, Integer> _vulnerableTower = new ConcurrentHashMap<GameTeam, Integer>();
|
||||
private ConcurrentHashMap<TeamTowerBase, DefenderAI> _def = new ConcurrentHashMap<TeamTowerBase, DefenderAI>();
|
||||
//private ConcurrentHashMap<TeamTowerBase, MapZone> _mapZone = new ConcurrentHashMap<TeamTowerBase, MapZone>();
|
||||
private ConcurrentHashMap<GameTeam, List<TeamBeacon>> _beacons = new ConcurrentHashMap<GameTeam, List<TeamBeacon>>();
|
||||
//private ConcurrentHashMap<TeamTowerBase, TeamBeacon> _beacons = new ConcurrentHashMap<TeamTowerBase, TeamBeacon>();
|
||||
private OreGenerator _ore;
|
||||
public boolean Attack = false;
|
||||
|
||||
@ -38,49 +36,22 @@ public class TowerManager implements Listener
|
||||
_ore = new OreGenerator();
|
||||
}
|
||||
|
||||
private void makeVulnerable(/*TeamTowerBase base*/GameTeam team, boolean core)
|
||||
private void makeVulnerable(TeamTowerBase base)
|
||||
{
|
||||
/*if (base instanceof TeamTower)
|
||||
if (base instanceof TeamTower)
|
||||
_vulnerableTower.put(base.getTeam(), ((TeamTower)base).Number);
|
||||
else
|
||||
_vulnerableTower.put(base.getTeam(), 3);*/
|
||||
_vulnerableTower.put(base.getTeam(), 3);
|
||||
|
||||
List<TeamBeacon> beacon = new ArrayList<TeamBeacon>();
|
||||
if (core)
|
||||
{
|
||||
for (TeamBeacon tb : _beacons.get(team))
|
||||
Host.Beacons.remove(tb.getBlock());
|
||||
_beacons.remove(team);
|
||||
}
|
||||
|
||||
for (TeamTowerBase base : getTeamTowers(team))
|
||||
{
|
||||
if (base instanceof TeamTower)
|
||||
{
|
||||
base.setVulnerable(!core);
|
||||
if (!core)
|
||||
{
|
||||
beacon.add(new TeamBeacon(team, base.getBeacon().getBlock()));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (core)
|
||||
{
|
||||
getTeamTowers(team).getLast().setVulnerable(true);
|
||||
beacon.add(new TeamBeacon(team, getTeamTowers(team).getLast().getBeacon().getBlock()));
|
||||
}
|
||||
_beacons.put(team, beacon);
|
||||
for (TeamBeacon tb : beacon)
|
||||
{
|
||||
Host.Beacons.put(tb.getBlock(), tb);
|
||||
}
|
||||
base.Vulnerable = true;
|
||||
//_beacons.get(base.getTeam()).setBlock(getVulnerable(base.getTeam()).getBeacon().getBlock());
|
||||
}
|
||||
|
||||
public void ironOreGen(GameTeam team, boolean start)
|
||||
{
|
||||
int amount = 20;
|
||||
if (start)
|
||||
amount = 40;
|
||||
amount = 80;
|
||||
|
||||
for (Location loc : Host.WorldData.GetCustomLocs(DataLoc.DIAMOND_ORE.getKey()))
|
||||
{
|
||||
@ -169,10 +140,10 @@ public class TowerManager implements Listener
|
||||
return i;
|
||||
}
|
||||
|
||||
/*public TeamTowerBase getVulnerable(GameTeam team)
|
||||
public TeamTowerBase getVulnerable(GameTeam team)
|
||||
{
|
||||
return getTeamTowers(team).get(_vulnerableTower.get(team) - 1);
|
||||
}*/
|
||||
}
|
||||
|
||||
public void parseTowers(WorldData data)
|
||||
{
|
||||
@ -203,12 +174,13 @@ public class TowerManager implements Listener
|
||||
_mapZone.put(tower, zone);*/
|
||||
}
|
||||
|
||||
makeVulnerable(red, false);
|
||||
makeVulnerable(blue, false);
|
||||
/*_beacons.put(red, new TeamBeacon(red, getTeamTowers(red).getFirst().getBeacon().getBlock()));
|
||||
_beacons.put(blue, new TeamBeacon(blue, getTeamTowers(blue).getFirst().getBeacon().getBlock()));
|
||||
Host.Beacons.put(red, _beacons.get(red));
|
||||
Host.Beacons.put(blue, _beacons.get(blue));*/
|
||||
makeVulnerable(getTeamTowers(red).getFirst());
|
||||
makeVulnerable(getTeamTowers(blue).getFirst());
|
||||
for (TeamTowerBase tb : _towers.keySet())
|
||||
{
|
||||
TeamBeacon b = new TeamBeacon(tb.getTeam(), tb.getBeacon().getBlock());
|
||||
Host.Beacons.put(b.getBlock(), b);
|
||||
}
|
||||
ironOreGen(red, true);
|
||||
ironOreGen(blue, true);
|
||||
}
|
||||
@ -231,12 +203,12 @@ public class TowerManager implements Listener
|
||||
|
||||
public void handleTowerDeath(TeamTowerBase towerBase)
|
||||
{
|
||||
//towerBase.setVulnerable(false);
|
||||
towerBase.setVulnerable(false);
|
||||
//ironOreGen(towerBase.getTeam());
|
||||
for (Player player : towerBase.getTeam().GetPlayers(true))
|
||||
/*for (Player player : towerBase.getTeam().GetPlayers(true))
|
||||
{
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 20 * 60, 1));
|
||||
}
|
||||
}*/
|
||||
/*Bukkit.getScheduler().runTaskLater(Host.Manager.getPlugin(), new Runnable()
|
||||
{
|
||||
public void run()
|
||||
@ -277,9 +249,7 @@ public class TowerManager implements Listener
|
||||
|
||||
return;
|
||||
}
|
||||
if (getTeamTowers(towerBase.getTeam()).getFirst().Alive || getTeamTowers(towerBase.getTeam()).get(1).Alive)
|
||||
return;
|
||||
makeVulnerable(towerBase.getTeam(), true);
|
||||
makeVulnerable(getTeamTowers(towerBase.getTeam()).get(_vulnerableTower.get(towerBase.getTeam())));
|
||||
}
|
||||
|
||||
public void toggleAttack()
|
||||
|
@ -80,7 +80,7 @@ public class WitherVariation extends GameVariation
|
||||
@Override
|
||||
public String[] getTeamScoreboardAdditions(GameTeam team)
|
||||
{
|
||||
String skulls = "☠ ☠ ☠";
|
||||
String skulls = "";
|
||||
for (int i = 1; i < 4; i++)
|
||||
{
|
||||
if (!skulls.equalsIgnoreCase(""))
|
||||
@ -92,7 +92,7 @@ public class WitherVariation extends GameVariation
|
||||
skulls = skulls + ChatColor.GRAY + "☠";
|
||||
}
|
||||
|
||||
return new String[] {"Altar Skulls: " + skulls};
|
||||
return new String[] {"Skulls: " + skulls};
|
||||
}
|
||||
|
||||
private Location getNearest(Location to, ConcurrentHashMap<Location, Double> options)
|
||||
|
@ -29,7 +29,6 @@ import nautilus.game.arcade.game.games.minecraftleague.variation.wither.WitherVa
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.FireworkEffect.Type;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@ -37,6 +36,7 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftSkeleton;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Skeleton;
|
||||
import org.bukkit.entity.Skeleton.SkeletonType;
|
||||
@ -47,6 +47,7 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDeathEvent;
|
||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||
@ -246,18 +247,11 @@ public class WitherMinionManager implements Listener
|
||||
{
|
||||
if (UtilInv.contains(player, Material.SKULL_ITEM, (byte) 1, 1))
|
||||
{
|
||||
for (Location loc : UtilShapes.getSphereBlocks(player.getLocation(), 3, 3, true))
|
||||
{
|
||||
UtilParticle.PlayParticleToAll(ParticleType.PORTAL, loc, null, 0, 2, ViewDist.MAX);
|
||||
}
|
||||
for (Location loc : UtilShapes.getCircle(player.getLocation(), true, 1))
|
||||
{
|
||||
UtilParticle.PlayParticleToAll(ParticleType.DRIP_LAVA, loc, null, 0, 1, ViewDist.MAX);
|
||||
}
|
||||
UtilParticle.PlayParticle(ParticleType.WITCH_MAGIC, player.getLocation(), new Random().nextFloat(), new Random().nextFloat(), new Random().nextFloat(), 0, 1, ViewDist.MAX);
|
||||
if (Recharge.Instance.usable(player, "FIREWORK_ALERT", false))
|
||||
{
|
||||
Recharge.Instance.use(player, "FIREWORK_ALERT", UtilTime.convert(5, TimeUnit.SECONDS, TimeUnit.MILLISECONDS), false, false);
|
||||
UtilFirework.playFirework(player.getEyeLocation().add(0, 3, 0), Type.BALL_LARGE, Color.PURPLE, false, true);
|
||||
Recharge.Instance.use(player, "FIREWORK_ALERT", UtilTime.convert(2, TimeUnit.SECONDS, TimeUnit.MILLISECONDS), false, false);
|
||||
UtilFirework.playFirework(player.getEyeLocation().add(0, 3, 0), Type.BURST, _host.Host.GetTeam(player).GetColorBase(), false, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -469,4 +463,22 @@ public class WitherMinionManager implements Listener
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void fixDamage(EntityDamageEvent event)
|
||||
{
|
||||
if (!_host.Host.IsLive())
|
||||
return;
|
||||
|
||||
if (_entity == null)
|
||||
return;
|
||||
if (event.getEntity().getEntityId() != _entity.getEntityId())
|
||||
return;
|
||||
|
||||
event.setCancelled(true);
|
||||
LivingEntity e = (LivingEntity)event.getEntity();
|
||||
double newHealth = Math.max(0, e.getHealth() - event.getDamage());
|
||||
newHealth = Math.min(e.getMaxHealth(), newHealth);
|
||||
e.setHealth(newHealth);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user