- Updated everything for Sigils and chiss
This commit is contained in:
parent
3212b75e4e
commit
6678dffb61
@ -217,7 +217,7 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
|
||||
Get(from).LastToTime = System.currentTimeMillis();
|
||||
|
||||
// Chiss or defek7
|
||||
if (to.getName().equals("Chiss") || to.getName().equals("defek7") || to.getName().equals("Phinary") || to.getName().equals("fooify") || to.getName().equals("sampepere"))
|
||||
if (to.getName().equals("Chiss") || to.getName().equals("defek7") || to.getName().equals("Phinary") || to.getName().equals("AlexTheCoder"))
|
||||
{
|
||||
UtilPlayer.message(from, C.cPurple + to.getName() + " is often AFK or minimized, due to plugin development.");
|
||||
UtilPlayer.message(from, C.cPurple + "Please be patient if he does not reply instantly.");
|
||||
|
@ -3,10 +3,10 @@ package nautilus.game.arcade.game.games.minecraftleague;
|
||||
public enum DataLoc
|
||||
{
|
||||
//Base
|
||||
RED_CRYSTAL("RED CRYSTAL"),
|
||||
RED_TOWER("RED TOWER"),
|
||||
BLUE_CRYSTAL("BLUE CRYSTAL"),
|
||||
BLUE_TOWER("BLUE TOWER"),
|
||||
RED_CRYSTAL(" RED CRYSTAL"),
|
||||
RED_TOWER(" RED TOWER"),
|
||||
BLUE_CRYSTAL(" BLUE CRYSTAL"),
|
||||
BLUE_TOWER(" BLUE TOWER"),
|
||||
VARIANT_BASE("GAMEMODE "),
|
||||
//RED_BEACON("PINK"),
|
||||
/*BLUE_*/BEACON("CYAN"),
|
||||
@ -18,7 +18,7 @@ public enum DataLoc
|
||||
|
||||
//Wither
|
||||
WITHER_WAYPOINT("PURPLE"),
|
||||
TOWER_WAYPOINT("$team$ TOWER $number$"),
|
||||
TOWER_WAYPOINT(" $team$ WITHER $number$"),
|
||||
WITHER_SKELETON("BLACK"),
|
||||
BLUE_ALTAR("LIME"),
|
||||
RED_ALTAR("YELLOW")
|
||||
|
@ -7,7 +7,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilItem;
|
||||
@ -32,11 +31,11 @@ import nautilus.game.arcade.game.TeamGame;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.commands.MinecraftLeagueCommand;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.commands.freeze.FreezeManager;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.data.BlockProtection;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.data.OreDeposit;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.data.PlayerRespawnPoint;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.data.MapZone;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.data.Spawner;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.data.TeamCrystal;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.data.TeamTower;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.data.TeamTowerBase;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.data.TowerAlert;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.data.TowerManager;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.data.map.ItemMapManager;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.kit.KitPlayer;
|
||||
@ -55,11 +54,9 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.CreatureType;
|
||||
import org.bukkit.entity.Enderman;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.ItemFrame;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Projectile;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -95,12 +92,12 @@ import com.google.common.base.Objects;
|
||||
|
||||
public class MinecraftLeague extends TeamGame
|
||||
{
|
||||
private ConcurrentHashMap<Player, PlayerRespawnPoint> _customRespawns = new ConcurrentHashMap<Player, PlayerRespawnPoint>();
|
||||
//private ConcurrentHashMap<Player, PlayerRespawnPoint> _customRespawns = new ConcurrentHashMap<Player, PlayerRespawnPoint>();
|
||||
//private ConcurrentHashMap<GameTeam, TeamMap> _maps = new ConcurrentHashMap<GameTeam, TeamMap>();
|
||||
private ConcurrentHashMap<Player, List<ItemStack>> _gear = new ConcurrentHashMap<Player, List<ItemStack>>();
|
||||
//private ConcurrentHashMap<GameTeam, TeamBeacon> _beacons = new ConcurrentHashMap<GameTeam, TeamBeacon>();
|
||||
private ConcurrentHashMap<Player, BlockProtection> _blockLock = new ConcurrentHashMap<Player, BlockProtection>();
|
||||
private ConcurrentHashMap<Player, Long> _spawnAllow = new ConcurrentHashMap<Player, Long>();
|
||||
//private ConcurrentHashMap<Player, Long> _spawnAllow = new ConcurrentHashMap<Player, Long>();
|
||||
private List<Spawner> _spawners = new ArrayList<Spawner>();
|
||||
|
||||
public ConcurrentHashMap<ExtraScoreboardData, GameVariation> ExtraSb = new ConcurrentHashMap<ExtraScoreboardData, GameVariation>();
|
||||
@ -110,15 +107,16 @@ public class MinecraftLeague extends TeamGame
|
||||
private long _lastIncrease;
|
||||
private boolean _yellow = false;
|
||||
|
||||
public List<OreDeposit> Ore = new ArrayList<OreDeposit>();
|
||||
public List<MapZone> MapZones = new ArrayList<MapZone>();
|
||||
public ItemMapManager MapManager;
|
||||
public boolean OverTime = false;
|
||||
|
||||
private VariationManager _vman;
|
||||
private FreezeManager _freeze;
|
||||
private TowerManager _tower;
|
||||
public TowerAlert Alert;
|
||||
|
||||
private final CreatureType[] _passive = new CreatureType[] {CreatureType.CHICKEN, CreatureType.COW, CreatureType.PIG, CreatureType.RABBIT, CreatureType.SHEEP};
|
||||
private final EntityType[] _passive = new EntityType[] {EntityType.CHICKEN, EntityType.COW, EntityType.PIG, EntityType.RABBIT, EntityType.SHEEP};
|
||||
|
||||
public MinecraftLeague(ArcadeManager manager)
|
||||
{
|
||||
@ -144,6 +142,7 @@ public class MinecraftLeague extends TeamGame
|
||||
this.WorldBoundaryKill = false;
|
||||
this.DeathDropItems = true;
|
||||
this.CreatureAllow = true;
|
||||
this.HungerSet = 20;
|
||||
|
||||
this.BlockBreak = true;
|
||||
this.BlockPlace = true;
|
||||
@ -171,7 +170,7 @@ public class MinecraftLeague extends TeamGame
|
||||
{
|
||||
"Respawn Crystals have 100 health per person in-game!",
|
||||
"The better the sword you have, the more damage you deal to Respawn Crystals!",
|
||||
"Right-click a bed in order to change your personal spawn location!",
|
||||
//"Right-click a bed in order to change your personal spawn location!",
|
||||
"Your map will display the locations of your enemies in OverTime!"
|
||||
};
|
||||
|
||||
@ -183,6 +182,7 @@ public class MinecraftLeague extends TeamGame
|
||||
_vman = new VariationManager(this);
|
||||
_freeze = new FreezeManager();
|
||||
_tower = new TowerManager(this);
|
||||
Alert = new TowerAlert();
|
||||
Bukkit.getPluginManager().registerEvents(_freeze, manager.getPlugin());
|
||||
}
|
||||
|
||||
@ -359,7 +359,7 @@ public class MinecraftLeague extends TeamGame
|
||||
if (getPickLevel(item) > level)
|
||||
{
|
||||
ret = item;
|
||||
level = getSwordLevel(item);
|
||||
level = getPickLevel(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -467,8 +467,26 @@ public class MinecraftLeague extends TeamGame
|
||||
|
||||
GameTeam red = GetTeam(ChatColor.RED);
|
||||
GameTeam blue = GetTeam(ChatColor.AQUA);
|
||||
TeamCrystal redc = (TeamCrystal) _tower.getTeamTowers(red).getLast();
|
||||
TeamCrystal bluec = (TeamCrystal) _tower.getTeamTowers(blue).getLast();
|
||||
TeamTowerBase redt = _tower.getVulnerable(red);
|
||||
TeamTowerBase bluet = _tower.getVulnerable(blue);
|
||||
String reds = "First Tower";
|
||||
String blues = "First Tower";
|
||||
|
||||
if (redt instanceof TeamTower)
|
||||
{
|
||||
if (((TeamTower)redt).Number > 1)
|
||||
reds = "Second Tower";
|
||||
}
|
||||
else
|
||||
reds = "Core";
|
||||
|
||||
if (bluet instanceof TeamTower)
|
||||
{
|
||||
if (((TeamTower)bluet).Number > 1)
|
||||
reds = "Second Tower";
|
||||
}
|
||||
else
|
||||
blues = "Core";
|
||||
|
||||
_liveTime = Math.max(System.currentTimeMillis() - GetStateTime(), 0);
|
||||
|
||||
@ -482,12 +500,12 @@ public class MinecraftLeague extends TeamGame
|
||||
|
||||
Scoreboard.WriteBlank();
|
||||
Scoreboard.Write(C.cRedB + "Red Team");
|
||||
Scoreboard.Write("Crystal: " + redc.formatHealth(redc.getHealth()));
|
||||
Scoreboard.Write(reds + ": " + redt.formatHealth(redt.getHealth()));
|
||||
Scoreboard.Write("Players Alive: " + red.GetPlayers(true).size());
|
||||
|
||||
Scoreboard.WriteBlank();
|
||||
Scoreboard.Write(C.cAquaB + "Blue Team");
|
||||
Scoreboard.Write("Crystal: " + bluec.formatHealth(bluec.getHealth()));
|
||||
Scoreboard.Write(blues + ": " + bluet.formatHealth(bluet.getHealth()));
|
||||
Scoreboard.Write("Players Alive: " + blue.GetPlayers(true).size());
|
||||
|
||||
int i = 1;
|
||||
@ -503,7 +521,7 @@ public class MinecraftLeague extends TeamGame
|
||||
Scoreboard.Draw();
|
||||
}
|
||||
|
||||
@Override
|
||||
/*@Override
|
||||
public void RespawnPlayerTeleport(Player player)
|
||||
{
|
||||
if (_customRespawns.containsKey(player))
|
||||
@ -516,7 +534,7 @@ public class MinecraftLeague extends TeamGame
|
||||
}
|
||||
|
||||
player.teleport(GetTeam(player).GetSpawn());
|
||||
}
|
||||
}*/
|
||||
|
||||
public boolean handleCommand(Player caller)
|
||||
{
|
||||
@ -609,10 +627,10 @@ public class MinecraftLeague extends TeamGame
|
||||
|
||||
if (event.getType() == UpdateType.SEC)
|
||||
{
|
||||
for (OreDeposit od : Ore)
|
||||
/*for (MapZone od : Ore)
|
||||
{
|
||||
od.update();
|
||||
}
|
||||
}*/
|
||||
|
||||
for (Player player : GetTeam(ChatColor.RED).GetPlayers(true))
|
||||
{
|
||||
@ -640,13 +658,13 @@ public class MinecraftLeague extends TeamGame
|
||||
}
|
||||
}
|
||||
|
||||
if (event.getType() == UpdateType.FASTER)
|
||||
/*if (event.getType() == UpdateType.FASTER)
|
||||
{
|
||||
for (GameTeam team : _teamList)
|
||||
{
|
||||
for (Location loc : team.GetSpawns())
|
||||
{
|
||||
for (LivingEntity near : UtilEnt.getInRadius(loc, 5).keySet())
|
||||
for (LivingEntity near : UtilEnt.getInRadius(loc, 2).keySet())
|
||||
{
|
||||
if (!(near instanceof Player))
|
||||
continue;
|
||||
@ -674,7 +692,7 @@ public class MinecraftLeague extends TeamGame
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
if (event.getType() == UpdateType.FASTEST)
|
||||
{
|
||||
@ -695,6 +713,8 @@ public class MinecraftLeague extends TeamGame
|
||||
beacon.update();
|
||||
}*/
|
||||
|
||||
Alert.update();
|
||||
|
||||
if (!OverTime)
|
||||
{
|
||||
if (UtilTime.elapsed(GetStateTime(), UtilTime.convert(15, TimeUnit.MINUTES, TimeUnit.MILLISECONDS)))
|
||||
@ -710,13 +730,13 @@ public class MinecraftLeague extends TeamGame
|
||||
this.DeathSpectateSecs = Math.max(0, this.DeathSpectateSecs + 2.5);
|
||||
}
|
||||
|
||||
for (Player player : _spawnAllow.keySet())
|
||||
/*for (Player player : _spawnAllow.keySet())
|
||||
{
|
||||
if (UtilTime.elapsed(_spawnAllow.get(player), UtilTime.convert(30, TimeUnit.SECONDS, TimeUnit.MINUTES)))
|
||||
if (UtilTime.elapsed(_spawnAllow.get(player), UtilTime.convert(30, TimeUnit.SECONDS, TimeUnit.MILLISECONDS)))
|
||||
{
|
||||
_spawnAllow.remove(player);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
for (Player player : _blockLock.keySet())
|
||||
{
|
||||
@ -769,7 +789,9 @@ public class MinecraftLeague extends TeamGame
|
||||
for (GameTeam team : GetTeamList())
|
||||
for (TeamTowerBase tow : _tower.getTeamTowers(team))
|
||||
{
|
||||
if (tower.isEntity(event.getEntity()))
|
||||
if (tow == null)
|
||||
continue;
|
||||
if (tow.isEntity(event.getEntity()))
|
||||
tower = tow;
|
||||
}
|
||||
|
||||
@ -798,7 +820,10 @@ public class MinecraftLeague extends TeamGame
|
||||
}
|
||||
|
||||
if (!tower.damage(event.getDamage() / 2, player))
|
||||
{
|
||||
player.playSound(tower.getLocation(), Sound.ORB_PICKUP, 100, 0);
|
||||
Alert.alert(tower.getTeam(), tower);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -818,7 +843,10 @@ public class MinecraftLeague extends TeamGame
|
||||
if (player.getItemInHand() == null || player.getItemInHand().getType() == Material.AIR)
|
||||
{
|
||||
if (!tower.damage(1, player))
|
||||
{
|
||||
player.playSound(tower.getLocation(), Sound.ZOMBIE_WOODBREAK, 1, 0);
|
||||
Alert.alert(tower.getTeam(), tower);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@ -827,7 +855,10 @@ public class MinecraftLeague extends TeamGame
|
||||
double damage = DamageAmount.getDamageAmount(type).getDamage(level, DamageType.getDamageType(type));
|
||||
|
||||
if (!tower.damage(damage, player))
|
||||
{
|
||||
player.playSound(tower.getLocation(), Sound.ZOMBIE_WOODBREAK, 1, 0);
|
||||
Alert.alert(tower.getTeam(), tower);
|
||||
}
|
||||
|
||||
if (DamageAmount.getDamageAmount(type) != DamageAmount.NONE)
|
||||
{
|
||||
@ -842,7 +873,7 @@ public class MinecraftLeague extends TeamGame
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
/*@EventHandler
|
||||
public void placeBed(PlayerInteractEvent event)
|
||||
{
|
||||
if (!IsLive())
|
||||
@ -864,7 +895,7 @@ public class MinecraftLeague extends TeamGame
|
||||
_customRespawns.get(player).overWrite(event.getClickedBlock().getLocation());
|
||||
else
|
||||
_customRespawns.put(player, new PlayerRespawnPoint(player, event.getClickedBlock().getLocation()));
|
||||
}
|
||||
}*/
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void lockBlock(BlockPlaceEvent event)
|
||||
@ -925,7 +956,7 @@ public class MinecraftLeague extends TeamGame
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
/*@EventHandler
|
||||
public void breakBed(BlockBreakEvent event)
|
||||
{
|
||||
if (!IsLive())
|
||||
@ -941,7 +972,7 @@ public class MinecraftLeague extends TeamGame
|
||||
if (point.breakBed(event.getBlock()))
|
||||
_customRespawns.remove(player);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
@EventHandler
|
||||
public void onRespawn(PlayerGameRespawnEvent event)
|
||||
@ -952,7 +983,7 @@ public class MinecraftLeague extends TeamGame
|
||||
Player player = event.GetPlayer();
|
||||
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 5 * 20, 3));
|
||||
_spawnAllow.put(player, System.currentTimeMillis());
|
||||
//_spawnAllow.put(player, System.currentTimeMillis());
|
||||
|
||||
/*if (!_crystals.get(GetTeam(player)).Alive)
|
||||
{
|
||||
@ -1138,7 +1169,6 @@ public class MinecraftLeague extends TeamGame
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@EventHandler
|
||||
public void controlMobRate(CreatureSpawnEvent event)
|
||||
{
|
||||
@ -1156,14 +1186,18 @@ public class MinecraftLeague extends TeamGame
|
||||
|
||||
EntityType et = event.getEntityType();
|
||||
|
||||
for (CreatureType pass : _passive)
|
||||
for (EntityType pass : _passive)
|
||||
{
|
||||
if (pass == event.getCreatureType())
|
||||
if (pass == event.getEntityType())
|
||||
et = EntityType.CHICKEN;
|
||||
}
|
||||
if (et == EntityType.ZOMBIE || et == EntityType.SKELETON || et == EntityType.CREEPER)
|
||||
et = EntityType.SPIDER;
|
||||
|
||||
event.setCancelled(true);
|
||||
|
||||
Manager.GetCreature().SpawnEntity(event.getLocation(), et);
|
||||
if (event.getCreatureType() == CreatureType.SPIDER)
|
||||
if (et == EntityType.SPIDER || et == EntityType.CHICKEN)
|
||||
{
|
||||
for (int i = 1; i <= 3; i++)
|
||||
Manager.GetCreature().SpawnEntity(event.getLocation(), EntityType.SPIDER);
|
||||
@ -1179,7 +1213,7 @@ public class MinecraftLeague extends TeamGame
|
||||
if (event.GetGame() != this)
|
||||
return;
|
||||
|
||||
int playercount = GetTeam(ChatColor.RED).GetPlayers(true).size() + GetTeam(ChatColor.AQUA).GetPlayers(true).size();
|
||||
int playercount = GetTeam(ChatColor.RED).GetPlayers(false).size() + GetTeam(ChatColor.AQUA).GetPlayers(false).size();
|
||||
_tower.prepareHealth(playercount, 50 * 2);
|
||||
}
|
||||
|
||||
@ -1218,18 +1252,24 @@ public class MinecraftLeague extends TeamGame
|
||||
{
|
||||
if (event.GetGame() != this)
|
||||
return;
|
||||
if (event.GetState() != GameState.Live)
|
||||
if (!(event.GetState() == GameState.Live || event.GetState() == GameState.Prepare))
|
||||
return;
|
||||
|
||||
if (event.GetState() == GameState.Prepare)
|
||||
{
|
||||
/*for (Player player : Bukkit.getOnlinePlayers())
|
||||
_spawnAllow.put(player, System.currentTimeMillis());*/
|
||||
return;
|
||||
}
|
||||
for (Player player : GetTeam(ChatColor.AQUA).GetPlayers(true))
|
||||
{
|
||||
player.getInventory().setHelmet(new ItemBuilder(Material.LEATHER_HELMET).setColor(Color.BLUE).build());
|
||||
player.getInventory().setChestplate(new ItemBuilder(Material.LEATHER_CHESTPLATE).setColor(Color.BLUE).build());
|
||||
player.getInventory().setLeggings(new ItemBuilder(Material.LEATHER_LEGGINGS).setColor(Color.BLUE).build());
|
||||
player.getInventory().setBoots(new ItemBuilder(Material.LEATHER_BOOTS).setColor(Color.BLUE).build());
|
||||
player.getInventory().addItem(new ItemStack(Material.WOOD_SWORD));
|
||||
player.getInventory().addItem(new ItemStack(Material.WOOD_PICKAXE));
|
||||
player.getInventory().addItem(new ItemStack(Material.COOKED_BEEF, 5));
|
||||
player.getInventory().addItem(new ItemStack(Material.STONE_SWORD));
|
||||
player.getInventory().addItem(new ItemStack(Material.STONE_PICKAXE));
|
||||
//player.getInventory().addItem(new ItemStack(Material.COOKED_BEEF, 5));
|
||||
_blockLock.put(player, new BlockProtection(this, player));
|
||||
}
|
||||
for (Player player : GetTeam(ChatColor.RED).GetPlayers(true))
|
||||
@ -1238,9 +1278,9 @@ public class MinecraftLeague extends TeamGame
|
||||
player.getInventory().setChestplate(new ItemBuilder(Material.LEATHER_CHESTPLATE).setColor(Color.RED).build());
|
||||
player.getInventory().setLeggings(new ItemBuilder(Material.LEATHER_LEGGINGS).setColor(Color.RED).build());
|
||||
player.getInventory().setBoots(new ItemBuilder(Material.LEATHER_BOOTS).setColor(Color.RED).build());
|
||||
player.getInventory().addItem(new ItemStack(Material.WOOD_SWORD));
|
||||
player.getInventory().addItem(new ItemStack(Material.WOOD_PICKAXE));
|
||||
player.getInventory().addItem(new ItemStack(Material.COOKED_BEEF, 5));
|
||||
player.getInventory().addItem(new ItemStack(Material.STONE_SWORD));
|
||||
player.getInventory().addItem(new ItemStack(Material.STONE_PICKAXE));
|
||||
//player.getInventory().addItem(new ItemStack(Material.COOKED_BEEF, 5));
|
||||
_blockLock.put(player, new BlockProtection(this, player));
|
||||
}
|
||||
}
|
||||
@ -1436,6 +1476,7 @@ public class MinecraftLeague extends TeamGame
|
||||
return;
|
||||
}
|
||||
}
|
||||
//_spawnAllow.put(player, System.currentTimeMillis() + UtilTime.convert((long) this.DeathSpectateSecs, TimeUnit.SECONDS, TimeUnit.MILLISECONDS));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -1465,6 +1506,30 @@ public class MinecraftLeague extends TeamGame
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void handlePlace(BlockPlaceEvent event)
|
||||
{
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
for (Location red : GetTeam(ChatColor.RED).GetSpawns())
|
||||
{
|
||||
if (UtilMath.offset(red, event.getBlock().getLocation()) < 5)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (Location blue : GetTeam(ChatColor.AQUA).GetSpawns())
|
||||
{
|
||||
if (UtilMath.offset(blue, event.getBlock().getLocation()) < 5)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void handleBreak(BlockBreakEvent event)
|
||||
{
|
||||
@ -1477,6 +1542,23 @@ public class MinecraftLeague extends TeamGame
|
||||
return;
|
||||
}
|
||||
|
||||
for (Location red : GetTeam(ChatColor.RED).GetSpawns())
|
||||
{
|
||||
if (UtilMath.offset(red, event.getBlock().getLocation()) < 5)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (Location blue : GetTeam(ChatColor.AQUA).GetSpawns())
|
||||
{
|
||||
if (UtilMath.offset(blue, event.getBlock().getLocation()) < 5)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (event.getBlock().getType() == Material.GRAVEL)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
|
@ -1,70 +0,0 @@
|
||||
package nautilus.game.arcade.game.games.minecraftleague.commands;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.command.CommandBase;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague.EditType;
|
||||
|
||||
public class DamageCommand extends CommandBase<ArcadeManager>
|
||||
{
|
||||
private MinecraftLeague _host;
|
||||
|
||||
public DamageCommand(ArcadeManager plugin, MinecraftLeague host)
|
||||
{
|
||||
super(plugin, Rank.DEVELOPER, new Rank[] {Rank.JNR_DEV}, "damage");
|
||||
_host = host;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Execute(Player caller, String[] args)
|
||||
{
|
||||
if (args.length < 2)
|
||||
{
|
||||
UtilPlayer.message(caller, F.help("/mcLeague damage <red/blue> <damage>", "Damages the red or blue Respawn Crystal for a specified amount", Rank.DEVELOPER));
|
||||
return;
|
||||
}
|
||||
|
||||
String team = args[0];
|
||||
|
||||
if (!team.equalsIgnoreCase("red") && !team.equalsIgnoreCase("blue"))
|
||||
{
|
||||
UtilPlayer.message(caller, F.help("/mcLeague damage <red/blue> <damage>", "Damages the red or blue Respawn Crystal for a specified amount", Rank.DEVELOPER));
|
||||
return;
|
||||
}
|
||||
|
||||
Double damage;
|
||||
try
|
||||
{
|
||||
damage = Double.parseDouble(args[1]);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
UtilPlayer.message(caller, F.help("/mcLeague damage <red/blue> <damage>", "Damages the red or blue Respawn Crystal for a specified amount", Rank.DEVELOPER));
|
||||
return;
|
||||
}
|
||||
|
||||
if (team.equalsIgnoreCase("red"))
|
||||
{
|
||||
if (_host.handleCommand(EditType.DAMAGE, _host.GetTeam(ChatColor.RED), caller, damage))
|
||||
return;
|
||||
UtilPlayer.message(caller, F.main(_host.GetName(), C.cRed + "That Crystal is dead!"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (team.equalsIgnoreCase("blue"))
|
||||
{
|
||||
if (_host.handleCommand(EditType.DAMAGE, _host.GetTeam(ChatColor.AQUA), caller, damage))
|
||||
return;
|
||||
UtilPlayer.message(caller, F.main(_host.GetName(), C.cRed + "That Crystal is dead!"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,59 +0,0 @@
|
||||
package nautilus.game.arcade.game.games.minecraftleague.commands;
|
||||
|
||||
import mineplex.core.command.CommandBase;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague.EditType;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class KillCommand extends CommandBase<ArcadeManager>
|
||||
{
|
||||
private MinecraftLeague _host;
|
||||
|
||||
public KillCommand(ArcadeManager plugin, MinecraftLeague host)
|
||||
{
|
||||
super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "kill");
|
||||
_host = host;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Execute(Player caller, String[] args)
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
UtilPlayer.message(caller, F.help("/mcLeague kill <red/blue>", "Kills the red or blue Respawn Crystal if spawned", Rank.ADMIN));
|
||||
return;
|
||||
}
|
||||
|
||||
String team = args[0];
|
||||
|
||||
if (!team.equalsIgnoreCase("red") && !team.equalsIgnoreCase("blue"))
|
||||
{
|
||||
UtilPlayer.message(caller, F.help("/mcLeague kill <red/blue>", "Kills the red or blue Respawn Crystal if spawned", Rank.ADMIN));
|
||||
return;
|
||||
}
|
||||
|
||||
if (team.equalsIgnoreCase("red"))
|
||||
{
|
||||
if (_host.handleCommand(EditType.KILL, _host.GetTeam(ChatColor.RED), caller, null))
|
||||
return;
|
||||
UtilPlayer.message(caller, F.main(_host.GetName(), C.cRed + "That Crystal is already killed!"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (team.equalsIgnoreCase("blue"))
|
||||
{
|
||||
if (_host.handleCommand(EditType.KILL, _host.GetTeam(ChatColor.AQUA), caller, null))
|
||||
return;
|
||||
UtilPlayer.message(caller, F.main(_host.GetName(), C.cRed + "That Crystal is already spawned!"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -20,9 +20,6 @@ public class MinecraftLeagueCommand extends MultiCommandBase<ArcadeManager>
|
||||
super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "mcLeague");
|
||||
AddCommand(new GUICommand(plugin, host));
|
||||
AddCommand(new FreezeCommand(plugin, host));
|
||||
AddCommand(new SpawnCommand(plugin, host));
|
||||
AddCommand(new KillCommand(plugin, host));
|
||||
AddCommand(new DamageCommand(plugin, host));
|
||||
AddCommand(new StatusCommand(plugin, host));
|
||||
_host = host;
|
||||
}
|
||||
@ -33,9 +30,6 @@ public class MinecraftLeagueCommand extends MultiCommandBase<ArcadeManager>
|
||||
UtilPlayer.message(caller, F.main(_host.GetName(), "Commands List:"));
|
||||
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 spawn <red/blue>", "Respawns the red or blue Respawn Crystal if killed", Rank.ADMIN));
|
||||
UtilPlayer.message(caller, F.help("/mcLeague kill <red/blue>", "Kills the red or blue Respawn Crystal if spawned", Rank.ADMIN));
|
||||
UtilPlayer.message(caller, F.help("/mcLeague damage <red/blue> <damage>", "Damages the red or blue Respawn Crystal for a specified amount", Rank.DEVELOPER));
|
||||
UtilPlayer.message(caller, F.help("/mcLeague status", "Gets statistics about both Respawn Crystals", Rank.DEVELOPER));
|
||||
}
|
||||
}
|
||||
|
@ -1,59 +0,0 @@
|
||||
package nautilus.game.arcade.game.games.minecraftleague.commands;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.command.CommandBase;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague.EditType;
|
||||
|
||||
public class SpawnCommand extends CommandBase<ArcadeManager>
|
||||
{
|
||||
private MinecraftLeague _host;
|
||||
|
||||
public SpawnCommand(ArcadeManager plugin, MinecraftLeague host)
|
||||
{
|
||||
super(plugin, Rank.ADMIN, new Rank[] {Rank.JNR_DEV}, "spawn");
|
||||
_host = host;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Execute(Player caller, String[] args)
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
UtilPlayer.message(caller, F.help("/mcLeague spawn <red/blue>", "Respawns the red or blue Respawn Crystal if killed", Rank.ADMIN));
|
||||
return;
|
||||
}
|
||||
|
||||
String team = args[0];
|
||||
|
||||
if (!team.equalsIgnoreCase("red") && !team.equalsIgnoreCase("blue"))
|
||||
{
|
||||
UtilPlayer.message(caller, F.help("/mcLeague spawn <red/blue>", "Respawns the red or blue Respawn Crystal if killed", Rank.ADMIN));
|
||||
return;
|
||||
}
|
||||
|
||||
if (team.equalsIgnoreCase("red"))
|
||||
{
|
||||
if (_host.handleCommand(EditType.SPAWN, _host.GetTeam(ChatColor.RED), caller, null))
|
||||
return;
|
||||
UtilPlayer.message(caller, F.main(_host.GetName(), C.cRed + "That Crystal is already spawned!"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (team.equalsIgnoreCase("blue"))
|
||||
{
|
||||
if (_host.handleCommand(EditType.SPAWN, _host.GetTeam(ChatColor.AQUA), caller, null))
|
||||
return;
|
||||
UtilPlayer.message(caller, F.main(_host.GetName(), C.cRed + "That Crystal is already spawned!"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -4,7 +4,6 @@ import mineplex.core.command.CommandBase;
|
||||
import mineplex.core.common.Rank;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague.EditType;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -21,7 +20,7 @@ public class StatusCommand extends CommandBase<ArcadeManager>
|
||||
@Override
|
||||
public void Execute(Player caller, String[] args)
|
||||
{
|
||||
_host.handleCommand(EditType.STATUS, null, caller, null);
|
||||
_host.handleCommand(caller);
|
||||
}
|
||||
|
||||
}
|
@ -12,8 +12,6 @@ import mineplex.core.updater.event.UpdateEvent;
|
||||
import nautilus.game.arcade.game.Game.GameState;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague.EditType;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.data.TeamCrystal;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -44,15 +42,15 @@ public class AdminPanel implements Listener
|
||||
_slots = new ConcurrentHashMap<GameTeam, Integer>();
|
||||
|
||||
ItemStack red = new ItemBuilder(MenuButton.CRYSTAL.getRepresentation())
|
||||
.setTitle(C.cRed + "Red Crystal")
|
||||
.setLore(C.cGray + "Alive: " + host.getCrystal(host.GetTeam(ChatColor.RED)).Alive,
|
||||
C.cGray + "Health: " + host.getCrystal(host.GetTeam(ChatColor.RED)).getHealth())
|
||||
.setTitle(C.cRed + "Red Tower")
|
||||
.setLore(C.cGray + "Alive: " + host.getActiveTower(host.GetTeam(ChatColor.RED)).Alive,
|
||||
C.cGray + "Health: " + host.getActiveTower(host.GetTeam(ChatColor.RED)).getHealth())
|
||||
.build();
|
||||
|
||||
ItemStack blue = new ItemBuilder(MenuButton.CRYSTAL.getRepresentation())
|
||||
.setTitle(C.cAqua + "Blue Crystal")
|
||||
.setLore(C.cGray + "Alive: " + host.getCrystal(host.GetTeam(ChatColor.AQUA)).Alive,
|
||||
C.cGray + "Health: " + host.getCrystal(host.GetTeam(ChatColor.AQUA)).getHealth())
|
||||
.setLore(C.cGray + "Alive: " + host.getActiveTower(host.GetTeam(ChatColor.AQUA)).Alive,
|
||||
C.cGray + "Health: " + host.getActiveTower(host.GetTeam(ChatColor.AQUA)).getHealth())
|
||||
.build();
|
||||
|
||||
_buttons.put(red, host.GetTeam(ChatColor.RED));
|
||||
@ -77,8 +75,8 @@ public class AdminPanel implements Listener
|
||||
GameTeam team = _buttons.get(item);
|
||||
ItemMeta im = item.getItemMeta();
|
||||
List<String> lore = new ArrayList<String>();
|
||||
lore.add(C.cGray + "Alive: " + _host.getCrystal(team).Alive);
|
||||
lore.add(C.cGray + "Health: " + _host.getCrystal(team).getHealth());
|
||||
lore.add(C.cGray + "Alive: " + _host.getActiveTower(team).Alive);
|
||||
lore.add(C.cGray + "Health: " + _host.getActiveTower(team).getHealth());
|
||||
im.setLore(lore);
|
||||
item.setItemMeta(im);
|
||||
_buttons.remove(item);
|
||||
@ -104,22 +102,7 @@ public class AdminPanel implements Listener
|
||||
if (event.getCurrentItem() == null)
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
GameTeam selectedT = _buttons.get(event.getCurrentItem());
|
||||
TeamCrystal selected = _host.getCrystal(selectedT);
|
||||
|
||||
if (selected.Alive)
|
||||
_host.handleCommand(EditType.KILL, selectedT, _admin, null);
|
||||
else
|
||||
_host.handleCommand(EditType.SPAWN, selectedT, _admin, null);
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return;
|
||||
}
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -1,23 +1,18 @@
|
||||
package nautilus.game.arcade.game.games.minecraftleague.data;
|
||||
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
public class OreDeposit
|
||||
public class MapZone
|
||||
{
|
||||
private Location _loc;
|
||||
private Material _ore;
|
||||
private int[] _rgb;
|
||||
private boolean _valid;
|
||||
|
||||
public OreDeposit(Location loc, Material type, int[] rgb)
|
||||
public MapZone(Location center, int[] rgb)
|
||||
{
|
||||
_loc = loc;
|
||||
_ore = type;
|
||||
_loc = center;
|
||||
_rgb = rgb;
|
||||
_valid = true;
|
||||
}
|
||||
|
||||
public boolean isValid()
|
||||
@ -31,7 +26,7 @@ public class OreDeposit
|
||||
int diffZ = Math.max(z, _loc.getBlockZ()) - Math.min(z, _loc.getBlockZ());
|
||||
|
||||
if (diffX <= 5)
|
||||
if (diffZ <= 10)
|
||||
if (diffZ <= 5)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@ -65,8 +60,18 @@ public class OreDeposit
|
||||
{
|
||||
return _rgb[2];
|
||||
}
|
||||
|
||||
public void setValid(boolean valid)
|
||||
{
|
||||
_valid = valid;
|
||||
}
|
||||
|
||||
public void update()
|
||||
public void setCenter(Location center)
|
||||
{
|
||||
_loc = center;
|
||||
}
|
||||
|
||||
/*public void update()
|
||||
{
|
||||
int found = 0;
|
||||
for (Block block : UtilBlock.getInSquare(_loc.getBlock(), 10))
|
||||
@ -76,5 +81,5 @@ public class OreDeposit
|
||||
}
|
||||
|
||||
_valid = found >= 1;
|
||||
}
|
||||
}*/
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package nautilus.game.arcade.game.games.minecraftleague.data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
@ -9,31 +10,20 @@ import org.bukkit.Material;
|
||||
|
||||
public class OreGenerator
|
||||
{
|
||||
private int _current;
|
||||
private int _total;
|
||||
private List<Location> _choices = new ArrayList<Location>();
|
||||
|
||||
public void generateOre(Material oreType, List<Location> possible, int amount)
|
||||
{
|
||||
_current = 0;
|
||||
_total = amount;
|
||||
while (_current < _total)
|
||||
{
|
||||
iterateOres(oreType, possible);
|
||||
}
|
||||
}
|
||||
|
||||
private void iterateOres(Material oreType, List<Location> possible)
|
||||
{
|
||||
_choices.clear();
|
||||
for (Location loc : possible)
|
||||
{
|
||||
if (loc.getBlock().getType() == oreType)
|
||||
continue;
|
||||
if (UtilMath.random.nextDouble() > .33)
|
||||
continue;
|
||||
if (_total <= _current)
|
||||
return;
|
||||
loc.getBlock().setType(oreType);
|
||||
_current++;
|
||||
loc.getBlock().setType(Material.STONE);
|
||||
_choices.add(loc);
|
||||
}
|
||||
for (int i = 0; i < (amount + 1); i++)
|
||||
{
|
||||
Location selected = _choices.remove(UtilMath.random.nextInt(_choices.size()));
|
||||
selected.getBlock().setType(oreType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ public abstract class TeamTowerBase
|
||||
_health = 11111D;
|
||||
_type = "Tower";
|
||||
if (this instanceof TeamCrystal)
|
||||
_type = "Crystal";
|
||||
_type = "Core";
|
||||
_name = new Hologram(_host.getArcadeManager().getHologramManager(), _spawn.clone().add(0, 3, 0), team.GetColor() + team.getDisplayName() + "'s " + _type);
|
||||
_healthTag = new Hologram(_host.getArcadeManager().getHologramManager(), _spawn.clone().add(0, 2, 0), formatHealth(_health));
|
||||
|
||||
@ -129,17 +129,21 @@ public abstract class TeamTowerBase
|
||||
|
||||
private void detonate()
|
||||
{
|
||||
UtilParticle.PlayParticleToAll(ParticleType.EXPLODE, _spawn, null, 0, 2, ViewDist.NORMAL);
|
||||
for (Block b : UtilBlock.getExplosionBlocks(_spawn, 1, false))
|
||||
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))
|
||||
{
|
||||
b.setType(Material.AIR);
|
||||
}
|
||||
for (LivingEntity le : UtilEnt.getInRadius(_spawn, 5).keySet())
|
||||
for (LivingEntity le : UtilEnt.getInRadius(_spawn, 18).keySet())
|
||||
{
|
||||
if (le instanceof Wither)
|
||||
le.damage(le.getHealth() / 2);
|
||||
le.setHealth(le.getHealth() / 2);
|
||||
else
|
||||
le.damage(6);
|
||||
{
|
||||
if (UtilMath.offset(le.getLocation(), _spawn) <= 5)
|
||||
le.damage(6);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,49 @@
|
||||
package nautilus.game.arcade.game.games.minecraftleague.data;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilTextBottom;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilTime.TimeUnit;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class TowerAlert
|
||||
{
|
||||
private ConcurrentHashMap<GameTeam, Long> _alerts = new ConcurrentHashMap<GameTeam, Long>();
|
||||
private ConcurrentHashMap<GameTeam, String> _alertType = new ConcurrentHashMap<GameTeam, String>();
|
||||
|
||||
public void alert(GameTeam team, TeamTowerBase tower)
|
||||
{
|
||||
_alerts.put(team, System.currentTimeMillis());
|
||||
if (tower instanceof TeamTower)
|
||||
{
|
||||
int number = ((TeamTower)tower).Number;
|
||||
if (number == 1)
|
||||
_alertType.put(team, "First Tower");
|
||||
else
|
||||
_alertType.put(team, "Second Tower");
|
||||
}
|
||||
else
|
||||
_alertType.put(team, "Crystal");
|
||||
}
|
||||
|
||||
public void update()
|
||||
{
|
||||
for (GameTeam team : _alerts.keySet())
|
||||
{
|
||||
for (Player player : team.GetPlayers(true))
|
||||
{
|
||||
UtilTextBottom.display(C.cRed + "Your " + _alertType.get(team) + " is under attack!", player);
|
||||
}
|
||||
|
||||
if (UtilTime.elapsed(_alerts.get(team), UtilTime.convert(5, TimeUnit.SECONDS, TimeUnit.MILLISECONDS)))
|
||||
{
|
||||
_alerts.remove(team);
|
||||
_alertType.remove(team);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,10 +1,12 @@
|
||||
package nautilus.game.arcade.game.games.minecraftleague.data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTextMiddle;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.DataLoc;
|
||||
@ -22,6 +24,7 @@ public class TowerManager implements Listener
|
||||
private ConcurrentHashMap<TeamTowerBase, GameTeam> _towers = new ConcurrentHashMap<TeamTowerBase, GameTeam>();
|
||||
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 OreGenerator _ore;
|
||||
|
||||
public TowerManager(MinecraftLeague host)
|
||||
@ -120,6 +123,8 @@ public class TowerManager implements Listener
|
||||
{
|
||||
GameTeam red = Host.GetTeam(ChatColor.RED);
|
||||
GameTeam blue = Host.GetTeam(ChatColor.AQUA);
|
||||
int[] redRGB = new int[] {255, 0, 0};
|
||||
int[] blueRGB = new int[] {0, 0, 255};
|
||||
|
||||
_towers.put(new TeamTower(Host, this, red, data.GetCustomLocs(DataLoc.RED_TOWER.getKey() + " 1").get(0), 1), red);
|
||||
_towers.put(new TeamTower(Host, this, red, data.GetCustomLocs(DataLoc.RED_TOWER.getKey() + " 2").get(0), 2), red);
|
||||
@ -132,6 +137,15 @@ public class TowerManager implements Listener
|
||||
for (TeamTowerBase tower : _towers.keySet())
|
||||
{
|
||||
_def.put(tower, new DefenderAI(this, tower));
|
||||
/*int[] rgb;
|
||||
if (tower.getTeam().GetColor() == red.GetColor())
|
||||
rgb = redRGB;
|
||||
else
|
||||
rgb = blueRGB;
|
||||
|
||||
MapZone zone = new MapZone(tower.getLocation(), rgb);
|
||||
Host.MapZones.add(zone);
|
||||
_mapZone.put(tower, zone);*/
|
||||
}
|
||||
|
||||
makeVulnerable(getTeamTowers(red).getFirst());
|
||||
@ -147,25 +161,28 @@ public class TowerManager implements Listener
|
||||
if (tower instanceof TeamCrystal)
|
||||
tower.setMaxHealth(players * multiplier);
|
||||
else
|
||||
tower.setMaxHealth((double)((int)((2/3)*multiplier)) * players);
|
||||
{
|
||||
double rawHealth = (.67 * multiplier) * players;
|
||||
Double health = new BigDecimal(rawHealth).intValue() * 1D;
|
||||
tower.setMaxHealth(health);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void handleTowerDeath(TeamTowerBase towerBase)
|
||||
{
|
||||
towerBase.setVulnerable(false);
|
||||
if (towerBase instanceof TeamCrystal)
|
||||
oreGen(towerBase.getTeam());
|
||||
Bukkit.getScheduler().runTaskLater(Host.Manager.getPlugin(), new Runnable()
|
||||
{
|
||||
oreGen(towerBase.getTeam());
|
||||
Bukkit.getScheduler().runTaskLater(Host.Manager.getPlugin(), new Runnable()
|
||||
public void run()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
UtilTextMiddle.display("", towerBase.getTeam().GetColor() + towerBase.getTeam().GetName() + " Team ores have been replenished!");
|
||||
}
|
||||
}, 20 * 5);
|
||||
UtilTextMiddle.display("", towerBase.getTeam().GetColor() + towerBase.getTeam().GetName() + " Team ores have been replenished!", UtilServer.getPlayers());
|
||||
}
|
||||
}, 20 * 5);
|
||||
//_mapZone.get(towerBase).setValid(false);
|
||||
if (towerBase instanceof TeamCrystal)
|
||||
return;
|
||||
}
|
||||
TeamTower tower = (TeamTower)towerBase;
|
||||
makeVulnerable(getTeamTowers(tower.getTeam()).get(tower.Number));
|
||||
}
|
||||
|
@ -1,10 +1,8 @@
|
||||
package nautilus.game.arcade.game.games.minecraftleague.data.map;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.data.OreDeposit;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.data.MapZone;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
@ -67,9 +65,9 @@ public class ItemMapRenderer extends MapRenderer
|
||||
color = (byte) 0;
|
||||
}
|
||||
|
||||
for (OreDeposit od : _host.Ore)
|
||||
for (MapZone od : _host.MapZones)
|
||||
{
|
||||
if (od.isInRadius(blockX - 20, blockZ + 15)) // TODO Some math to figure out if this pixel is going to be colored in for the circle or not.
|
||||
if (od.isInRadius(blockX, blockZ)) // TODO Some math to figure out if this pixel is going to be colored in for the circle or not.
|
||||
{
|
||||
if (od.isValid())
|
||||
color = MapPalette.matchColor(od.getRed(), od.getGreen(), od.getBlue());
|
||||
|
@ -237,10 +237,12 @@ public class WitherVariation extends GameVariation
|
||||
if (inside.containsKey(red.getLocation().getBlock()))
|
||||
{
|
||||
red.damage(dmg, null);
|
||||
Host.Alert.alert(red.getTeam(), red);
|
||||
}
|
||||
if (inside.containsKey(blue.getLocation().getBlock()))
|
||||
{
|
||||
blue.damage(dmg, null);
|
||||
Host.Alert.alert(blue.getTeam(), blue);
|
||||
}
|
||||
for (Block b : inside.keySet())
|
||||
{
|
||||
|
@ -22,6 +22,7 @@ import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.Game.GameState;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.data.MapZone;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.variation.wither.WitherVariation;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
@ -48,8 +49,6 @@ import org.bukkit.event.player.PlayerDropItemEvent;
|
||||
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.metadata.FixedMetadataValue;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
public class WitherMinionManager implements Listener
|
||||
{
|
||||
@ -64,6 +63,7 @@ public class WitherMinionManager implements Listener
|
||||
private ItemStack _witherItem;
|
||||
|
||||
private WitherSkeletonTimer _sbTimer;
|
||||
private MapZone _skellyZone;
|
||||
|
||||
private Block _cb;
|
||||
private Material _changed = Material.AIR;
|
||||
@ -81,6 +81,9 @@ public class WitherMinionManager implements Listener
|
||||
_witherItem = new ItemBuilder(Material.SKULL_ITEM).setTitle(C.cDRedB + "Wither Skeleton Head").setData((short) 1).setLore(C.cGray + "Bring this back", C.cGray + "to your team's Altar", C.cGray + "To summon a Wither!").build();
|
||||
_sbTimer = new WitherSkeletonTimer(host.Host.GetScoreboard());
|
||||
host.Host.ExtraSb.put(_sbTimer, host);
|
||||
_skellyZone = new MapZone(spawns.get(0), new int[] {0, 0, 0});
|
||||
_skellyZone.setValid(false);
|
||||
host.Host.MapZones.add(_skellyZone);
|
||||
|
||||
Bukkit.getPluginManager().registerEvents(this, host.Manager.getPlugin());
|
||||
}
|
||||
@ -117,14 +120,18 @@ public class WitherMinionManager implements Listener
|
||||
UtilEnt.ghost(e, true, false);
|
||||
UtilEnt.Vegetate(e);
|
||||
e.setCustomName(C.cRed + "Wither Skeleton");
|
||||
((Skeleton)e).setMaxHealth(100);
|
||||
((Skeleton)e).setHealth(100);
|
||||
((Skeleton)e).setMaxHealth(/*100*/65);
|
||||
((Skeleton)e).setHealth(/*100*/65);
|
||||
((CraftSkeleton)e).getEquipment().setChestplate(new ItemStack(Material.IRON_CHESTPLATE));
|
||||
((CraftSkeleton)e).getEquipment().setLeggings(new ItemStack(Material.IRON_LEGGINGS));
|
||||
((Skeleton)e).addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 9999999, 7));
|
||||
//((Skeleton)e).addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 9999999, 7));
|
||||
|
||||
if (!respawn)
|
||||
{
|
||||
UtilTextMiddle.display("", C.cGray + "A Wither Skeleton has spawned!");
|
||||
_skellyZone.setCenter(chosen);
|
||||
_skellyZone.setValid(true);
|
||||
}
|
||||
_selected = -1;
|
||||
_spawned = true;
|
||||
}
|
||||
@ -144,6 +151,7 @@ public class WitherMinionManager implements Listener
|
||||
_spawned = false;
|
||||
_entity.remove();
|
||||
_lastDied = System.currentTimeMillis();
|
||||
_skellyZone.setValid(false);
|
||||
_entity = null;
|
||||
}
|
||||
if (_cb != null)
|
||||
@ -220,6 +228,14 @@ public class WitherMinionManager implements Listener
|
||||
UtilParticle.PlayParticleToAll(ParticleType.PORTAL, loc, null, 0, 2, ViewDist.MAX);
|
||||
}
|
||||
}
|
||||
if (player.getInventory().getHelmet() != null)
|
||||
{
|
||||
if (UtilInv.IsItem(player.getInventory().getHelmet(), Material.SKULL_ITEM, (byte) 1))
|
||||
{
|
||||
player.getInventory().setHelmet(new ItemStack(Material.AIR));
|
||||
UtilInv.insert(player, _witherItem.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -244,7 +260,7 @@ public class WitherMinionManager implements Listener
|
||||
|
||||
if (_host.WitherSpawned || _witherBlocked)
|
||||
{
|
||||
_sbTimer.freezeTime(20);
|
||||
_sbTimer.freezeTime(-2);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -275,6 +291,7 @@ public class WitherMinionManager implements Listener
|
||||
event.getDrops().clear();
|
||||
event.getDrops().add(_witherItem.clone());
|
||||
event.setDroppedExp(10);
|
||||
_skellyZone.setValid(false);
|
||||
|
||||
_cb.setType(_changed);
|
||||
_cb = null;
|
||||
|
@ -8,6 +8,7 @@ import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilTime.TimeUnit;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.DataLoc;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.data.TeamTower;
|
||||
@ -38,6 +39,8 @@ public class WitherPathfinder
|
||||
|
||||
private boolean _startedJourney = false;
|
||||
|
||||
private double _health;
|
||||
|
||||
public WitherPathfinder(WitherVariation host, Wither ent, LinkedList<Location> waypoints, GameTeam team, GameTeam enemy, TowerManager towerManager)
|
||||
{
|
||||
_host = host;
|
||||
@ -49,6 +52,7 @@ public class WitherPathfinder
|
||||
_lastAttack = -1;
|
||||
_lastTowerAttack = -1;
|
||||
_pathData = new PathfinderData(ent, waypoints.getFirst());
|
||||
_health = ent.getHealth();
|
||||
}
|
||||
|
||||
private int getWaypointIndex(Location loc)
|
||||
@ -106,7 +110,7 @@ public class WitherPathfinder
|
||||
|
||||
if (target != null)
|
||||
{
|
||||
if (UtilTime.elapsed(_lastAttack, 2))
|
||||
if (UtilTime.elapsed(_lastAttack, UtilTime.convert(2, TimeUnit.SECONDS, TimeUnit.MILLISECONDS)))
|
||||
{
|
||||
_lastAttack = System.currentTimeMillis();
|
||||
shootAt(target.getLocation());
|
||||
@ -146,10 +150,16 @@ public class WitherPathfinder
|
||||
if (_ent.getHealth() < _ent.getMaxHealth())
|
||||
{
|
||||
if (!_startedJourney)
|
||||
{
|
||||
_health = _ent.getMaxHealth();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
_startedJourney = true;
|
||||
|
||||
_health = Math.min(_health, _ent.getHealth());
|
||||
_ent.setHealth(_health);
|
||||
|
||||
for (Entity e : UtilEnt.getAllInRadius(_ent.getLocation(), 3).keySet())
|
||||
{
|
||||
if (e instanceof Arrow)
|
||||
@ -183,7 +193,7 @@ public class WitherPathfinder
|
||||
finalize.setPitch(UtilAlg.GetPitch(UtilAlg.getTrajectory(_ent, eTower)));
|
||||
finalize.setYaw(UtilAlg.GetYaw(UtilAlg.getTrajectory(_ent, eTower)));
|
||||
_ent.teleport(finalize);
|
||||
if (UtilTime.elapsed(_lastTowerAttack, 5))
|
||||
if (UtilTime.elapsed(_lastTowerAttack, UtilTime.convert(5, TimeUnit.SECONDS, TimeUnit.MILLISECONDS)))
|
||||
{
|
||||
_lastTowerAttack = System.currentTimeMillis();
|
||||
shootAt(eTower.getLocation());
|
||||
|
@ -33,7 +33,10 @@ public class WitherSkeletonTimer extends ExtraScoreboardData
|
||||
Scoreboard.Write(C.cYellowB + "Wither Skeleton Spawn");
|
||||
if (_frozen != -1)
|
||||
{
|
||||
Scoreboard.Write(_frozen + " Seconds");
|
||||
if (_frozen == -2)
|
||||
Scoreboard.Write("WITHER ALIVE");
|
||||
else
|
||||
Scoreboard.Write(_frozen + " Seconds");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user