added announcement logging

fixed creeper explosion disable for uhc
fixed player logout thing for UHC?
This commit is contained in:
Chiss 2013-09-14 12:27:40 +10:00
parent e49b92d280
commit 34c333dac9
4 changed files with 19 additions and 9 deletions

View File

@ -56,6 +56,9 @@ public class Creature extends MiniPlugin
@EventHandler @EventHandler
public void Spawn(CreatureSpawnEvent event) public void Spawn(CreatureSpawnEvent event)
{ {
if (_disableCustom)
return;
if (event.getEntity() instanceof LivingEntity) if (event.getEntity() instanceof LivingEntity)
((LivingEntity)event.getEntity()).setCanPickupItems(false); ((LivingEntity)event.getEntity()).setCanPickupItems(false);
@ -239,6 +242,9 @@ public class Creature extends MiniPlugin
@EventHandler @EventHandler
public void CustomCreeperExplode(EntityExplodeEvent event) public void CustomCreeperExplode(EntityExplodeEvent event)
{ {
if (_disableCustom)
return;
if (!(event.getEntity() instanceof Creeper)) if (!(event.getEntity() instanceof Creeper))
return; return;

View File

@ -929,6 +929,8 @@ public abstract class Game implements Listener
UtilPlayer.message(player, message); UtilPlayer.message(player, message);
} }
System.out.println("[Announcement] " + message);
} }
public boolean AdvertiseText(GameLobbyManager gameLobbyManager, int _advertiseStage) public boolean AdvertiseText(GameLobbyManager gameLobbyManager, int _advertiseStage)

View File

@ -551,13 +551,16 @@ public class UHC extends TeamGame
Announce(team.GetColor() + C.Bold + player.getName() + " was killed for disconnecting during combat."); Announce(team.GetColor() + C.Bold + player.getName() + " was killed for disconnecting during combat.");
player.damage(5000); player.damage(5000);
team.RemovePlayer(player);
//team.SetPlayerState(player, PlayerState.OUT); return;
} }
if (!team.IsAlive(player)) if (!team.IsAlive(player))
{
team.RemovePlayer(player);
return; return;
}
_rejoinTime.put(player, System.currentTimeMillis()); _rejoinTime.put(player, System.currentTimeMillis());
GetLocationStore().put(player.getName(), player.getLocation()); GetLocationStore().put(player.getName(), player.getLocation());
@ -1069,10 +1072,12 @@ public class UHC extends TeamGame
String health = " - " + col; String health = " - " + col;
if (((int)player.getHealth()) % 2 == 0) int hp = (int)(player.getHealth() + 0.9999999999);
health += (int)(player.getHealth()/2);
if (hp % 2 == 0)
health += (int)(hp/2);
else else
health += UtilMath.trim(1, player.getHealth()/2d); health += UtilMath.trim(1, hp/2d);
String name = team.GetColor() + player.getName(); String name = team.GetColor() + player.getName();
@ -1122,7 +1127,6 @@ public class UHC extends TeamGame
*/ */
} }
@Override @Override
public boolean CanJoinTeam(GameTeam team) public boolean CanJoinTeam(GameTeam team)
{ {

View File

@ -23,7 +23,6 @@ import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
@ -34,7 +33,6 @@ import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.CreatureSpawnEvent; import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.inventory.InventoryOpenEvent;
import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerMoveEvent;