Disable auto event now while location and abilities are tweaked
This commit is contained in:
parent
76a1f2b1f0
commit
e34324b864
@ -32,6 +32,7 @@ import mineplex.core.status.ServerStatusManager;
|
||||
import mineplex.core.teleport.Teleport;
|
||||
import mineplex.core.updater.FileUpdater;
|
||||
import mineplex.core.updater.Updater;
|
||||
import mineplex.core.visibility.VisibilityManager;
|
||||
import mineplex.game.clans.clans.ClansManager;
|
||||
import mineplex.game.clans.clans.worldevent.WorldEventManager;
|
||||
import mineplex.game.clans.items.GearManager;
|
||||
@ -66,7 +67,8 @@ public class Clans extends JavaPlugin
|
||||
CommandCenter.Instance.setClientManager(_clientManager);
|
||||
|
||||
ItemStackFactory.Initialize(this, false);
|
||||
Recharge.Initialize(this);
|
||||
Recharge.Initialize(this);
|
||||
VisibilityManager.Initialize(this);
|
||||
|
||||
_donationManager = new DonationManager(this, _clientManager, webServerAddress);
|
||||
|
||||
@ -83,7 +85,6 @@ public class Clans extends JavaPlugin
|
||||
Portal portal = new Portal(this, _clientManager, serverStatusManager.getCurrentServerName());
|
||||
new FileUpdater(this, portal, serverStatusManager.getCurrentServerName(), serverStatusManager.getRegion());
|
||||
|
||||
|
||||
Punish punish = new Punish(this, webServerAddress, _clientManager);
|
||||
AntiHack.Initialize(this, punish, portal, preferenceManager, _clientManager);
|
||||
AntiHack.Instance.setKick(false);
|
||||
|
@ -58,7 +58,7 @@ public class WorldEventManager extends MiniPlugin implements ScoreboardElement
|
||||
_factory = new ConcreteWorldEventFactory(this);
|
||||
_events = new LinkedList<WorldEvent>();
|
||||
_lastEventEnd = System.currentTimeMillis();
|
||||
_nextEventStart = System.currentTimeMillis() + 30000;
|
||||
updateNextEventTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -95,29 +95,29 @@ public class WorldEventManager extends MiniPlugin implements ScoreboardElement
|
||||
|
||||
if (removed && _events.size() == 0)
|
||||
{
|
||||
_nextEventStart = generateNextEventTime();
|
||||
updateNextEventTime();
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void startEvent(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.SEC)
|
||||
return;
|
||||
|
||||
if (_events.size() == 0 && System.currentTimeMillis() > _nextEventStart)
|
||||
{
|
||||
if (UtilServer.getPlayers().length > 0)
|
||||
{
|
||||
Bukkit.broadcastMessage("Starting new event from random...");
|
||||
startRandomEvent();
|
||||
}
|
||||
else
|
||||
{
|
||||
_nextEventStart = generateNextEventTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
// @EventHandler
|
||||
// public void startEvent(UpdateEvent event)
|
||||
// {
|
||||
// if (event.getType() != UpdateType.SEC)
|
||||
// return;
|
||||
//
|
||||
// if (_events.size() == 0 && System.currentTimeMillis() > _nextEventStart)
|
||||
// {
|
||||
// if (UtilServer.getPlayers().length > 0)
|
||||
// {
|
||||
// Bukkit.broadcastMessage("Starting new event from random...");
|
||||
// startRandomEvent();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// updateNextEventTime();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
private void startRandomEvent()
|
||||
{
|
||||
@ -161,7 +161,7 @@ public class WorldEventManager extends MiniPlugin implements ScoreboardElement
|
||||
iterator.remove();
|
||||
}
|
||||
|
||||
_nextEventStart = generateNextEventTime();
|
||||
updateNextEventTime();
|
||||
}
|
||||
|
||||
public ClansManager getClans()
|
||||
@ -180,11 +180,11 @@ public class WorldEventManager extends MiniPlugin implements ScoreboardElement
|
||||
addCommand(new WorldEventCommand(this));
|
||||
}
|
||||
|
||||
private long generateNextEventTime()
|
||||
private void updateNextEventTime()
|
||||
{
|
||||
// 45 Minutes + 0 - 15 Minutes
|
||||
long waitTime = 2700000L + _random.nextInt(900000);
|
||||
return System.currentTimeMillis() + waitTime;
|
||||
_nextEventStart = System.currentTimeMillis() + waitTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,7 +45,6 @@ public class AbsorbAbility extends SlimeAbility
|
||||
|
||||
private void pulse()
|
||||
{
|
||||
Bukkit.broadcastMessage("Pulse");
|
||||
HashMap<Player, Double> playerMap = UtilPlayer.getInRadius(getSlime().getEntity().getLocation(), _maxDistance);
|
||||
|
||||
for (Map.Entry<Player, Double> entry : playerMap.entrySet())
|
||||
|
@ -102,7 +102,7 @@ public class RocketAbility extends SlimeAbility implements IThrown
|
||||
|
||||
ProjectileManager pm = getSlime().getEvent().getEventManager().getClans().getProjectile();
|
||||
pm.AddThrow(projectile, getSlime().getEntity(), this, -1, true, true, true, null, 0, 0, UtilParticle.ParticleType.SLIME, UpdateType.FASTEST, 1F);
|
||||
Bukkit.broadcastMessage("Shot Slime at target " + target);
|
||||
// Bukkit.broadcastMessage("Shot Slime at target " + target);
|
||||
|
||||
_rocketsFired++;
|
||||
}
|
||||
@ -110,7 +110,7 @@ public class RocketAbility extends SlimeAbility implements IThrown
|
||||
@Override
|
||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||
{
|
||||
Bukkit.broadcastMessage("COLLIDE " + target);
|
||||
// Bukkit.broadcastMessage("COLLIDE " + target);
|
||||
UtilParticle.PlayParticle(UtilParticle.ParticleType.LARGE_EXPLODE, data.GetThrown().getLocation(), 0, 0, 0, 0, 1, UtilParticle.ViewDist.LONG, UtilServer.getPlayers());
|
||||
target.getLocation().getWorld().playSound(target.getLocation(), Sound.SPLASH, 1, 2);
|
||||
getSlime().getEvent().getDamageManager().NewDamageEvent(target, getSlime().getEntity(), null,
|
||||
|
Loading…
Reference in New Issue
Block a user