Particles dont play in stealth games.

This commit is contained in:
Chiss 2014-08-10 01:04:53 +10:00
parent 53221e267e
commit 3533ce1b7e
12 changed files with 39 additions and 6 deletions

View File

@ -151,4 +151,9 @@ public class CosmeticManager extends MiniPlugin
_mountManager.DisableAll();
_petManager.DisableAll();
}
public void setHideParticles(boolean b)
{
_gadgetManager.setHideParticles(b);
}
}

View File

@ -50,6 +50,8 @@ public class GadgetManager extends MiniPlugin
private NautHashMap<Player, Long> _lastMove = new NautHashMap<Player, Long>();
private NautHashMap<Player, NautHashMap<GadgetType, Gadget>> _playerActiveGadgetMap = new NautHashMap<Player, NautHashMap<GadgetType, Gadget>>();
private boolean _hideParticles = false;
public GadgetManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager,
MountManager mountManager, PetManager petManager, PreferencesManager preferencesManager,
DisguiseManager disguiseManager, BlockRestore blockRestore)
@ -310,4 +312,14 @@ public class GadgetManager extends MiniPlugin
_playerActiveGadgetMap.get(player).remove(gadget.getGadgetType());
}
public void setHideParticles(boolean b)
{
_hideParticles = b;
}
public boolean hideParticles()
{
return _hideParticles;
}
}

View File

@ -36,7 +36,7 @@ public class ParticleEnchant extends ParticleGadget
for (Player player : GetActive())
{
if (player.getGameMode() != GameMode.SURVIVAL)
if (shouldDisplay(player))
continue;
if (Manager.isMoving(player))

View File

@ -37,7 +37,7 @@ public class ParticleFireRings extends ParticleGadget
for (Player player : GetActive())
{
if (player.getGameMode() != GameMode.SURVIVAL)
if (shouldDisplay(player))
continue;
if (Manager.isMoving(player))

View File

@ -55,7 +55,7 @@ public class ParticleFoot extends ParticleGadget
for (Player player : GetActive())
{
if (player.getGameMode() != GameMode.SURVIVAL)
if (shouldDisplay(player))
continue;
if (!Manager.isMoving(player))

View File

@ -37,7 +37,7 @@ public class ParticleGreen extends ParticleGadget
for (Player player : GetActive())
{
if (player.getGameMode() != GameMode.SURVIVAL)
if (shouldDisplay(player))
continue;
if (Manager.isMoving(player))

View File

@ -37,7 +37,7 @@ public class ParticleHelix extends ParticleGadget
for (Player player : GetActive())
{
if (player.getGameMode() != GameMode.SURVIVAL)
if (shouldDisplay(player))
continue;
if (Manager.isMoving(player))

View File

@ -38,7 +38,7 @@ public class ParticleRain extends ParticleGadget
for (Player player : GetActive())
{
if (player.getGameMode() != GameMode.SURVIVAL)
if (shouldDisplay(player))
continue;
if (Manager.isMoving(player))

View File

@ -1,5 +1,6 @@
package mineplex.core.gadget.types;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.entity.Player;
@ -30,4 +31,15 @@ public abstract class ParticleGadget extends Gadget
if (_active.remove(player))
UtilPlayer.message(player, F.main("Gadget", "You unsummoned " + F.elem(GetName()) + "."));
}
public boolean shouldDisplay(Player player)
{
if (player.getGameMode() != GameMode.SURVIVAL)
return false;
if (Manager.hideParticles())
return false;
return true;
}
}

View File

@ -149,6 +149,7 @@ public class HideSeek extends TeamGame
Manager.GetExplosion().SetRegenerate(true);
Manager.GetExplosion().SetTNTSpread(false);
Manager.getCosmeticManager().setHideParticles(true);
}
public Material GetItemEquivilent(Material mat)

View File

@ -70,6 +70,8 @@ public class SneakyAssassins extends SoloGame
this.CompassEnabled = true;
this.CompassGiveItem = false;
Manager.getCosmeticManager().setHideParticles(true);
}
@Override

View File

@ -151,6 +151,7 @@ public class GameCreationManager implements Listener
Manager.GetExplosion().SetRegenerate(false);
Manager.GetExplosion().SetTNTSpread(true);
Manager.GetAntiStack().SetEnabled(true);
Manager.getCosmeticManager().setHideParticles(false);
HashMap<String, ChatColor> pastTeams = null;