fixed SG crash bug

This commit is contained in:
Chiss 2014-11-16 09:31:03 +11:00
parent 057594205e
commit 454deb03db
2 changed files with 18 additions and 16 deletions

View File

@ -22,6 +22,7 @@ import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.block.BlockSpreadEvent;
import org.bukkit.event.block.LeavesDecayEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.EntityShootBowEvent;
import org.bukkit.event.entity.ExplosionPrimeEvent;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
@ -1680,12 +1681,6 @@ public class SurvivalGames extends SoloGame
Scoreboard.Draw();
}
@Override
public boolean IsLive()
{
return super.IsLive() && !isDeathMatchAboutToStart();
}
public boolean isDeathMatchAboutToStart()
{
if (!_deathmatchLive)
@ -1696,4 +1691,11 @@ public class SurvivalGames extends SoloGame
return true;
}
@EventHandler
public void deathmatchBowShoot(EntityShootBowEvent event)
{
if (isDeathMatchAboutToStart())
event.getProjectile().remove();
}
}

View File

@ -357,16 +357,16 @@ public class WitherGame extends TeamGame implements IBlockRestorer
ArrayList<Location> collisions = new ArrayList<Location>();
//Fly Speed
if (player.getLocation().getY() > _yLimit)
{
player.setFlySpeed(0.06f);
}
else
{
double speed = (_yLimit - player.getLocation().getY()) * 0.075;
player.setFlySpeed(Math.max(0.015f, 0.06f - (float)speed));
}
double speed = 0.06 - (_yLimit - player.getLocation().getY()) * 0.075;
if (speed > 0.16)
speed = 0.16;
if (speed < 0.015)
speed = 0.015;
player.setFlySpeed((float)speed);
//Bump
for (Block block : UtilBlock.getInRadius(player.getLocation().add(0, 0.5, 0), 1.5d).keySet())