Fixed game flag for not allowing inventory opens

Removed some redundant flags in game
Lots of MineStrike updates
Fixed NPE in WinWithoutLosingTeammateStatTracker
This commit is contained in:
Chiss 2014-09-12 11:47:39 +10:00
parent 092e9ba479
commit 0dff0412d1
25 changed files with 238 additions and 77 deletions

View File

@ -133,7 +133,7 @@ public class UtilDisplay
sendPacket(player, destroyEntityPacket);
Location loc = player.getEyeLocation().add(player.getLocation().getDirection().multiply(18));
Location loc = player.getEyeLocation().add(player.getLocation().getDirection().multiply(24));
/*
//Downward

View File

@ -2,13 +2,17 @@ package mineplex.core.blockrestore;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import mineplex.core.MiniPlugin;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilMath;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
@ -89,6 +93,32 @@ public class BlockRestore extends MiniPlugin
_blocks.remove(block).restore();
}
public HashSet<Location> RestoreBlockAround(Material type, Location location, int radius)
{
HashSet<Location> restored = new HashSet<Location>();
Iterator<Block> blockIterator = _blocks.keySet().iterator();
while (blockIterator.hasNext())
{
Block block = blockIterator.next();
if (block.getType() != type)
continue;
if (UtilMath.offset(block.getLocation().add(0.5, 0.5, 0.5), location) > radius)
continue;
restored.add(block.getLocation().add(0.5, 0.5, 0.5));
_blocks.get(block).restore();
blockIterator.remove();
}
return restored;
}
public void Add(Block block, int toID, byte toData, long expireTime)
{
@ -168,4 +198,6 @@ public class BlockRestore extends MiniPlugin
{
return _blocks;
}
}

View File

@ -467,7 +467,11 @@ public class ArcadeManager extends MiniPlugin implements IRelation
{
String extrainformation = "|" + _serverConfig.ServerType + "|" + (_game == null ? "Unknown" : _game.GetName())
+ "|" + ((_game == null || _game.WorldData == null) ? "Unknown" : _game.WorldData.MapName);
if (_game.JoinInProgress)
{
event.setMotd(ChatColor.GREEN + "Recruiting" + extrainformation);
}
if (_game == null || _game.GetState() == GameState.Recruit)
{
if (_game != null && _game.GetCountdown() != -1)
@ -478,7 +482,6 @@ public class ArcadeManager extends MiniPlugin implements IRelation
{
event.setMotd(ChatColor.GREEN + "Recruiting" + extrainformation);
}
}
else
{

View File

@ -139,7 +139,8 @@ public abstract class Game implements Listener
public HashSet<Integer> ItemDropAllow = new HashSet<Integer>();
public HashSet<Integer> ItemDropDeny = new HashSet<Integer>();
public boolean InventoryOpen = false;
public boolean InventoryOpenBlock = false;
public boolean InventoryOpenChest = false;
public boolean InventoryClick = false;
public boolean PrivateBlocks = false;
@ -151,7 +152,7 @@ public abstract class Game implements Listener
public boolean QuitOut = true;
public boolean IdleKick = true;
public boolean IdleKickz = true;
public boolean CreatureAllow = false;
public boolean CreatureAllowOverride = false;
@ -181,11 +182,9 @@ public abstract class Game implements Listener
public boolean DisplayLobbySide = true;
//Tourney
public boolean AutoBalance = true;
public boolean AutoStart = true;
public GameState KitRegisterState = GameState.Live;
public boolean JoinInProgress = false;
//Addons
public boolean CompassEnabled = false;
@ -821,7 +820,7 @@ public abstract class Game implements Listener
public boolean CanJoinTeam(GameTeam team)
{
return (AutoBalance && Manager.IsTeamBalance()) ? team.GetSize() < Math.max(1, UtilServer.getPlayers().length/GetTeamList().size()) : true;
return Manager.IsTeamBalance() ? team.GetSize() < Math.max(1, UtilServer.getPlayers().length/GetTeamList().size()) : true;
}
public GameTeam GetTeamPreference(Player player)

View File

@ -159,7 +159,8 @@ public class Bridge extends TeamGame implements OreObsfucation
BlockBreak = true;
BlockPlace = true;
InventoryOpen = true;
InventoryOpenBlock = true;
InventoryOpenChest = true;
WorldTimeSet = 2000;

View File

@ -53,6 +53,8 @@ public class ChampionsDominate extends Domination
Manager.GetDamage().UseSimpleWeaponDamage = false;
InventoryOpenChest = true;
EloRanking = false;
EloStart = 1000;

View File

@ -54,6 +54,8 @@ public class ChampionsTDM extends TeamDeathmatch
this.Manager.GetDamage().UseSimpleWeaponDamage = false;
InventoryOpenChest = true;
registerStatTrackers(
new WinWithoutLosingTeammateStatTracker(this, "FlawlessVictory"),
new KillAllOpposingStatTracker(this),

View File

@ -206,7 +206,6 @@ public class HideSeek extends TeamGame
this.DamageSelf = false;
this.DeathOut = false;
this.InventoryOpen = false;
this.HungerSet = 20;
this.PrepareFreeze = false;

View File

@ -87,6 +87,7 @@ import nautilus.game.arcade.game.games.minestrike.data.Bomb;
import nautilus.game.arcade.game.games.minestrike.data.Bullet;
import nautilus.game.arcade.game.games.minestrike.items.StrikeItem;
import nautilus.game.arcade.game.games.minestrike.items.StrikeItemType;
import nautilus.game.arcade.game.games.minestrike.items.equipment.DefusalKit;
import nautilus.game.arcade.game.games.minestrike.items.equipment.armor.Armor;
import nautilus.game.arcade.game.games.minestrike.items.grenades.Grenade;
import nautilus.game.arcade.game.games.minestrike.items.guns.Gun;
@ -131,6 +132,8 @@ public class MineStrike extends TeamGame
private HashMap<Entity, Bullet> _bullets = new HashMap<Entity, Bullet>();
private HashMap<Entity, Grenade> _grenadesThrown = new HashMap<Entity, Grenade>();
private HashSet<Entity> _defusalDropped = new HashSet<Entity>();
private HashMap<Location, Long> _incendiary = new HashMap<Location, Long>();
private Bomb _bomb = null;
@ -181,6 +184,8 @@ public class MineStrike extends TeamGame
this.ItemDrop = true;
this.InventoryClick = true;
this.JoinInProgress = true;
this._help = new String[]
{
@ -618,6 +623,7 @@ public class MineStrike extends TeamGame
@EventHandler(priority = EventPriority.LOWEST)
public void deathDrop(PlayerDeathEvent event)
{
_scoped.remove(event.getEntity());
dropInventory(event.getEntity());
}
@ -691,6 +697,12 @@ public class MineStrike extends TeamGame
item.drop(this, player, true, false);
}
//Defuse Kit
if (stack.getType() == Material.SHEARS)
{
_defusalDropped.add(player.getWorld().dropItemNaturally(player.getEyeLocation(), stack));
}
//Bomb
if (stack.getType() == Material.GOLD_SWORD)
{
@ -723,6 +735,7 @@ public class MineStrike extends TeamGame
if (gun != null)
{
gun.pickup(this, event.getPlayer());
event.getItem().remove();
}
//Grenades
@ -730,6 +743,25 @@ public class MineStrike extends TeamGame
if (grenade != null)
{
grenade.pickup(this, event.getPlayer());
event.getItem().remove();
}
//Defusal
if (UtilGear.isMat(event.getItem().getItemStack(), Material.SHEARS))
{
if (GetTeam(event.getPlayer()).GetColor() == ChatColor.RED)
return;
if (UtilInv.contains(event.getPlayer(), Material.SHEARS, (byte)0, 1))
return;
event.getPlayer().getInventory().setItem(8, event.getItem().getItemStack());
UtilPlayer.message(event.getPlayer(), F.main("Game", "You equipped Defusal Kit."));
event.getPlayer().playSound(event.getPlayer().getLocation(), Sound.HORSE_ARMOR, 1.5f, 1f);
event.getItem().remove();
}
//Bomb
@ -739,6 +771,18 @@ public class MineStrike extends TeamGame
}
}
@EventHandler
public void reloadCancel(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Gun gun : _gunsEquipped.keySet())
{
gun.cancelReloadCheck(_gunsEquipped.get(gun), this);
}
}
@EventHandler
public void rechargeWeapons(RechargedEvent event)
{
@ -1717,6 +1761,10 @@ public class MineStrike extends TeamGame
if (GetKit(player) != null)
GetKit(player).ApplyKit(player);
}
//Remove Scope
for (Player player : GetPlayers(false))
removeScope(player);
//Prepare Sound
for (Player player : GetPlayers(false))
@ -1840,6 +1888,11 @@ public class MineStrike extends TeamGame
for (Entity ent : _bullets.keySet())
ent.remove();
_bullets.clear();
//Bullets
for (Entity ent : _defusalDropped)
ent.remove();
_defusalDropped.clear();
//Incendiary
_incendiary.clear();
@ -1987,7 +2040,9 @@ public class MineStrike extends TeamGame
if (gun.getGunType() == GunType.SNIPER)
{
event.getPlayer().getWorld().playSound(event.getPlayer().getEyeLocation(), Sound.GHAST_DEATH, 0.8f, 1f);
Manager.GetCondition().Factory().Blind("Scope Blind", event.getPlayer(), null, 1, 1, false, false, false);
//if (Manager.GetCondition().GetActiveCondition(event.getPlayer(), ConditionType.BLINDNESS) == null)
Manager.GetCondition().Factory().Blind("Scope Blind", event.getPlayer(), null, 1, 0, false, false, false);
}
}
else
@ -2020,7 +2075,11 @@ public class MineStrike extends TeamGame
public void removeScope(Player player)
{
if (!_scoped.containsKey(player))
return;
ItemStack stack = _scoped.remove(player);
player.getInventory().setHelmet(stack);
Manager.GetCondition().EndCondition(player, null, "Scope");
@ -2243,6 +2302,9 @@ public class MineStrike extends TeamGame
if (_bullets.containsKey(ent))
continue;
if (_defusalDropped.contains(ent))
continue;
if (_bombItem != null && _bombItem.equals(ent))
continue;
@ -2269,6 +2331,9 @@ public class MineStrike extends TeamGame
else if (_grenadesThrown.containsKey(event.getEntity()))
event.setCancelled(true);
else if (_defusalDropped.contains(event.getEntity()))
event.setCancelled(true);
else if (_bombItem != null && _bombItem.equals(event.getEntity()))
event.setCancelled(true);

View File

@ -14,6 +14,10 @@ public class Bomb
public long BombTime = 45000;
public Block Block;
public Material Type;
public byte Data;
public long StartTime;
public long LastBeep;
@ -27,6 +31,10 @@ public class Bomb
Planter = planter;
Block = planter.getLocation().getBlock();
Type = Block.getType();
Data = Block.getData();
Block.setType(Material.DAYLIGHT_DETECTOR);
StartTime = System.currentTimeMillis();
@ -49,7 +57,7 @@ public class Bomb
if (UtilTime.elapsed(StartTime, BombTime))
{
Block.setType(Material.AIR);
clean();
//Effect
UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, Block.getLocation(), 10f, 10f, 10f, 0, 30);
@ -73,7 +81,7 @@ public class Bomb
public void defuse()
{
Block.setType(Material.AIR);
clean();
//Effect
UtilParticle.PlayParticle(ParticleType.CLOUD, Block.getLocation().add(0.5, 0.5, 0.5), 0, 0, 0, 0, 1);
@ -81,6 +89,7 @@ public class Bomb
public void clean()
{
Block.setType(Material.AIR);
Block.setType(Type);
Block.setData(Data);
}
}

View File

@ -26,7 +26,7 @@ public abstract class FireGrenadeBase extends Grenade
{
},
price, gemCost, Material.PORK, 1);
price, gemCost, skin, 1);
_baseTime = burnTime;
}
@ -56,7 +56,7 @@ public abstract class FireGrenadeBase extends Grenade
final HashMap<Block, Double> blocks = UtilBlock.getInRadius(loc, 3.5d);
for (final Block block : blocks.keySet())
{
if (block.getType() != Material.AIR)
if (block.getType() != Material.AIR && !block.getType().name().toLowerCase().contains("step"))
continue;
if (!UtilBlock.solid(block.getRelative(BlockFace.DOWN)))

View File

@ -4,6 +4,7 @@ import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
import nautilus.game.arcade.game.games.minestrike.MineStrike;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Entity;
@ -24,10 +25,15 @@ public class Smoke extends Grenade
{
if (ent.getTicksLived() > 60)
{
UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, ent.getLocation(), 0, 0, 0, 0, 1);
UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, ent.getLocation(), 0.3f, 0.3f, 0.3f, 0, 1);
ent.getWorld().playSound(ent.getLocation(), Sound.FIZZ, 0.1f, 0.1f);
for (Location loc : game.Manager.GetBlockRestore().RestoreBlockAround(Material.FIRE, ent.getLocation(), 5))
{
loc.getWorld().playSound(loc, Sound.FIZZ, 1f, 1f);
}
return false;
}

View File

@ -3,6 +3,7 @@ package nautilus.game.arcade.game.games.minestrike.items.guns;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilDisplay;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilMath;
@ -51,6 +52,8 @@ public abstract class Gun extends StrikeItem
protected double _coneIncreaseRate;
protected boolean _scope = false;
protected boolean _reloading = false;
//Active Data
@ -102,6 +105,9 @@ public abstract class Gun extends StrikeItem
public void shoot(final Player player, final MineStrike game)
{
if (_reloading)
return;
//Standard (300) RPM
shootOnce(player, game);
@ -157,6 +163,10 @@ public abstract class Gun extends StrikeItem
loc.add(UtilAlg.getDown(player.getLocation().getDirection()).multiply(0.3));
UtilParticle.PlayParticle(ParticleType.EXPLODE, loc, 0, 0, 0, 0, 1);
//Unscope
if (_gunType == GunType.SNIPER)
game.removeScope(player);
game.registerBullet(fireBullet(player, game));
}
@ -260,27 +270,22 @@ public abstract class Gun extends StrikeItem
{
if (_loadedAmmo == _clipSize)
return;
int ammo = _reserveAmmo + _loadedAmmo;
if (ammo == 0)
if (ammo == 0 || _reserveAmmo == 0)
{
UtilPlayer.message(player, F.main("Gun", "You have no ammo for " + F.name(getName()) + "."));
UtilPlayer.message(player, F.main("Gun", "You have no more ammo for " + F.name(getName()) + "."));
return;
}
_loadedAmmo = Math.min(ammo, _clipSize);
_reserveAmmo = Math.max(0, ammo - _clipSize);
//Recharge
Recharge.Instance.useForce(player, getName() + " Shoot", getReloadTime());
Recharge.Instance.use(player, getName() + " Reload", getReloadTime(), false, true);
//Sound
soundReload(player.getLocation());
//Update
updateWeaponName(player);
_reloading = true;
}
@Override
@ -321,9 +326,39 @@ public abstract class Gun extends StrikeItem
loc.getWorld().playSound(loc, Sound.PISTON_RETRACT, 1f, 0.8f);
}
public void soundReloaded(Location loc)
public void cancelReloadCheck(Player player, MineStrike game)
{
loc.getWorld().playSound(loc, Sound.PISTON_EXTEND, 1f, 1.6f);
if (!_reloading)
return;
if (!isHolding(player))
{
_reloading = false;
Recharge.Instance.recharge(player, getName() + " Reload");
UtilDisplay.displayTextBar(game.Manager.GetPlugin(), player, 1, C.cRed + C.Bold + getName() + " Reload");
return;
}
}
public void handleReloaded(Player player)
{
if (!_reloading)
return;
_reloading = false;
//Update Ammo
int ammo = _reserveAmmo + _loadedAmmo;
_loadedAmmo = Math.min(ammo, _clipSize);
_reserveAmmo = Math.max(0, ammo - _clipSize);
//Update
updateWeaponName(player);
//Sound
player.getWorld().playSound(player.getEyeLocation(), Sound.PISTON_EXTEND, 1f, 1.6f);
}
public void soundRefire(Location loc)
@ -353,7 +388,7 @@ public abstract class Gun extends StrikeItem
{
_cone = Math.max(_coneMin, _cone - (_coneReduceRate / 20d));
}
public void reloadEvent(RechargedEvent event)
{
if (!isHolding(event.GetPlayer()))
@ -365,7 +400,7 @@ public abstract class Gun extends StrikeItem
}
else if (event.GetAbility().equals(getName() + " Reload"))
{
soundReloaded(event.GetPlayer().getEyeLocation());
handleReloaded(event.GetPlayer());
}
}

View File

@ -34,6 +34,9 @@ public abstract class Shotgun extends Gun
@Override
public void shoot(Player player, MineStrike game)
{
if (_reloading)
return;
//Check Ammo
if (!ammoCheck(player))
return;
@ -78,6 +81,8 @@ public abstract class Shotgun extends Gun
@Override
public long getReloadTime()
{
return _reloadTime * Math.min(_reserveAmmo, _clipSize - _loadedAmmo);
long time = _reloadTime + _reloadTime * Math.min(_reserveAmmo, _clipSize - _loadedAmmo);
return time;
}
}

View File

@ -17,9 +17,9 @@ public class Nova extends Shotgun
},
1200, 5000, //Cost, Gem Cost
8, 4, //Clip Size, Spare Ammo
1000, 800, //ROF, Reload Time
1000, 600, //ROF, Reload Time
26, 0.01, 0.5, //Damage, Dropoff, Armor Penetration
0.15, 0.15, //COF Min, COF Max
0.1, 0.1, //COF Min, COF Max
0, 0, //COF Inc per Bullet, COF Dec per Second
Material.GOLD_AXE, Sound.BLAZE_DEATH, 9);
}

View File

@ -17,9 +17,9 @@ public class XM1014 extends Shotgun
},
2000, 5000, //Cost, Gem Cost
7, 4, //Clip Size, Spare Ammo
260, 800, //ROF, Reload Time
260, 600, //ROF, Reload Time
20, 0.01, 0.8, //Damage, Dropoff, Armor Penetration
0.15, 0.15, //COF Min, COF Max
0.12, 0.12, //COF Min, COF Max
0, 0, //COF Inc per Bullet, COF Dec per Second
Material.DIAMOND_AXE, Sound.SKELETON_DEATH, 6);
}

View File

@ -19,7 +19,7 @@ public class P90 extends Gun
2350, 5000, //Cost, Gem Cost
50, 2, //Clip Size, Spare Ammo
35, 3300, //ROF, Reload Time
22, 0.006, 0.65, //Damage, Dropoff, Armor Penetration
17, 0.006, 0.65, //Damage, Dropoff, Armor Penetration
0, 0.25, //COF Min, COF Max
0.022, 0.3, //COF Inc per Bullet, COF Dec per Second
Material.STONE_AXE, Sound.CREEPER_DEATH);

View File

@ -84,8 +84,9 @@ public class MineWare extends SoloGame
this.ItemDrop = true;
this.ItemPickup = true;
this.InventoryOpen = true;
this.InventoryClick = true;
InventoryOpenBlock = true;
InventoryOpenChest = true;
InventoryClick = true;
PopulateOrders();
}

View File

@ -86,9 +86,7 @@ public class SuperSmash extends SoloGame
this.CompassEnabled = true;
this.SpawnDistanceRequirement = 16;
this.InventoryOpen = false;
// Add stat table here
// Example
//Manager.GetStatsManager().addTable("SuperSmashMobStats", "Kills", "Deaths", "Wins", "Losses");

View File

@ -87,8 +87,6 @@ public class SuperSmashTeam extends TeamGame
this.SpawnDistanceRequirement = 16;
this.InventoryOpen = false;
this.TeamArmorHotbar = true;
}

View File

@ -110,8 +110,9 @@ public class UHC extends TeamGame
this.BlockBreak = true;
this.BlockPlace = true;
this.InventoryOpen = true;
this.InventoryOpenBlock = true;
this.InventoryOpenChest = true;
this.DeathOut = true;
this.QuitOut = false;
@ -125,8 +126,6 @@ public class UHC extends TeamGame
this.SoupEnabled = false;
this.IdleKick = true;
this.AutoStart = true;
this.CompassEnabled = true;
this.WorldBoundaryKill = false;
@ -143,10 +142,6 @@ public class UHC extends TeamGame
_scoreObj = Scoreboard.GetScoreboard().registerNewObjective("Health", "health");
_scoreObj.setDisplaySlot(DisplaySlot.PLAYER_LIST);
//Tournament
this.AutoBalance = false;
this.AutoStart = false;
}
@Override
@ -287,8 +282,6 @@ public class UHC extends TeamGame
if (Math.abs(player.getLocation().getX()) + 16 < _borderSize && Math.abs(player.getLocation().getZ()) + 16 < _borderSize)
return;
long time = System.currentTimeMillis();
//X Wall
if (Math.abs(player.getLocation().getX()) + 16 >= _borderSize)
{
@ -340,8 +333,6 @@ public class UHC extends TeamGame
}
}
}
System.out.println("Far: " + (System.currentTimeMillis() - time));
}
public void VisualBoundaryClose(Player player)
@ -350,8 +341,6 @@ public class UHC extends TeamGame
if (Math.abs(player.getLocation().getX()) + 5 < _borderSize && Math.abs(player.getLocation().getZ()) + 5 < _borderSize)
return;
long time = System.currentTimeMillis();
for (Block block : UtilBlock.getInRadius(player.getLocation(), 5d).keySet())
{
if (Math.random() > 0.80)
@ -365,8 +354,6 @@ public class UHC extends TeamGame
UtilParticle.PlayParticle(player, ParticleType.LAVA, block.getLocation().add(0.5, 0.5, 0.5), 0.5f, 0.5f, 0.5f, 0, 1);
}
System.out.println("Close: " + (System.currentTimeMillis() - time));
}
@EventHandler

View File

@ -44,6 +44,7 @@ import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryOpenEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerInteractEvent;
@ -229,9 +230,9 @@ public class GameFlagManager implements Listener
}
}
}
@EventHandler(priority = EventPriority.LOWEST)
public void InventoryOpen(PlayerInteractEvent event)
public void InventoryOpen(InventoryOpenEvent event)
{
Game game = Manager.GetGame();
if (game == null)
@ -240,16 +241,34 @@ public class GameFlagManager implements Listener
if (!game.InProgress())
return;
if (game.InventoryOpen)
return;
if (!game.InventoryOpenBlock)
{
if (event.getInventory().getType() == InventoryType.ANVIL ||
event.getInventory().getType() == InventoryType.BEACON ||
event.getInventory().getType() == InventoryType.BREWING ||
event.getInventory().getType() == InventoryType.DISPENSER ||
event.getInventory().getType() == InventoryType.DROPPER ||
event.getInventory().getType() == InventoryType.ENCHANTING ||
event.getInventory().getType() == InventoryType.FURNACE ||
event.getInventory().getType() == InventoryType.HOPPER ||
event.getInventory().getType() == InventoryType.MERCHANT ||
event.getInventory().getType() == InventoryType.ENDER_CHEST ||
event.getInventory().getType() == InventoryType.WORKBENCH)
{
event.setCancelled(true);
event.getPlayer().closeInventory();
}
}
if (event.getClickedBlock() == null)
return;
if (!UtilBlock.usable(event.getClickedBlock()))
return;
event.setCancelled(true);
if (!game.InventoryOpenChest)
{
if (event.getInventory().getType() == InventoryType.CHEST)
{
event.setCancelled(true);
event.getPlayer().closeInventory();
}
}
}
@EventHandler(priority = EventPriority.LOWEST)

View File

@ -123,7 +123,7 @@ public class GameManager implements Listener
if (game.GetCountdown() != -1)
StateCountdown(game, -1, false);
else if (game.AutoStart && Manager.IsGameAutoStart())
else if (Manager.IsGameAutoStart())
{
if (UtilServer.getPlayers().length >= Manager.GetPlayerFull())
StateCountdown(game, 20, false);

View File

@ -46,9 +46,6 @@ public class IdleManager implements Listener
if (Manager.GetGame() == null)
return;
if (Manager.GetGame() != null && !Manager.GetGame().IdleKick)
return;
for (Player player : UtilServer.getPlayers())
{
if (!_yaw.containsKey(player) || !_idle.containsKey(player))

View File

@ -22,6 +22,9 @@ public class WinWithoutLosingTeammateStatTracker extends StatTracker<TeamGame>
{
GameTeam winner = getGame().WinnerTeam;
if (winner == null)
return;
if (winner.GetPlayers(false).size() < 4)
return;