Merge branch 'master' of ssh://dev.mineplex.com:7999/min/Mineplex

Conflicts:
	Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/uhc/UHC.java
This commit is contained in:
Jonathan Williams 2013-12-03 13:58:28 -08:00
commit 022c343a98
10 changed files with 151 additions and 278 deletions

Binary file not shown.

View File

@ -2,11 +2,11 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre7"/>
<classpathentry combineaccessrules="false" kind="src" path="/Nautilus.Core.CraftBukkit"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/httpcore-4.2.jar"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/httpclient-4.2.jar"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/bin/craftbukkit.jar"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/commons-codec-1.6.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.Core.Common"/>
<classpathentry combineaccessrules="false" kind="src" path="/Nautilus.Core.CraftBukkit"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -8,7 +8,7 @@
<classpathentry combineaccessrules="false" kind="src" path="/Core"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/craftbukkit.jar" sourcepath="/REPO_DIR/GitHubLibraries/CraftBukkit/src"/>
<classpathentry combineaccessrules="false" kind="src" path="/Nautilus.Core"/>
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.Core"/>
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.Minecraft.Game.ClassCombat"/>
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.Core"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -19,13 +19,18 @@ import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftPlayer;
import org.bukkit.entity.Chicken;
import org.bukkit.entity.Entity;
import org.bukkit.entity.IronGolem;
import org.bukkit.entity.Player;
import org.bukkit.entity.Skeleton;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.BlockBurnEvent;
import org.bukkit.event.block.BlockFadeEvent;
import org.bukkit.event.block.BlockSpreadEvent;
import org.bukkit.event.block.LeavesDecayEvent;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.player.PlayerQuitEvent;
@ -561,10 +566,84 @@ public class ArcadeManager extends MiniPlugin implements IRelation
event.setCancelled(true);
}
@EventHandler
//@EventHandler
public void MobSpawn(CreatureSpawnEvent event)
{
if (_game == null)
event.setCancelled(true);
}
@EventHandler//XXX
public void TEST(PlayerCommandPreprocessEvent event)
{
if (event.getMessage().equals("/test1"))
{
Chicken chicken = event.getPlayer().getWorld().spawn(event.getPlayer().getLocation(), Chicken.class);
chicken.setBaby();
Entity a = event.getPlayer().getWorld().spawnFallingBlock(event.getPlayer().getLocation().add(0, 5, 0), 42, (byte)0);
Entity b = event.getPlayer().getWorld().spawnFallingBlock(event.getPlayer().getLocation().add(0, 5, 0), 41, (byte)0);
chicken.setPassenger(a);
a.setPassenger(b);
}
if (event.getMessage().equals("/test2"))
{
Chicken chicken = event.getPlayer().getWorld().spawn(event.getPlayer().getLocation(), Chicken.class);
chicken.setBaby();
Entity a = event.getPlayer().getWorld().spawnFallingBlock(event.getPlayer().getLocation().add(0, 5, 0), 42, (byte)0);
Entity b = event.getPlayer().getWorld().spawnFallingBlock(event.getPlayer().getLocation().add(0, 5, 0), 41, (byte)0);
Chicken chickenb = event.getPlayer().getWorld().spawn(event.getPlayer().getLocation(), Chicken.class);
chickenb.setBaby();
chickenb.setCustomName("Dinnerbone");
chicken.setPassenger(chickenb);
chickenb.setPassenger(a);
a.setPassenger(b);
}
if (event.getMessage().equals("/test3"))
{
Chicken chicken = event.getPlayer().getWorld().spawn(event.getPlayer().getLocation(), Chicken.class);
chicken.setBaby();
Chicken chickenb = event.getPlayer().getWorld().spawn(event.getPlayer().getLocation(), Chicken.class);
chickenb.setBaby();
Chicken chickenc = event.getPlayer().getWorld().spawn(event.getPlayer().getLocation(), Chicken.class);
chickenc.setBaby();
Entity a = event.getPlayer().getWorld().spawnFallingBlock(event.getPlayer().getLocation().add(0, 5, 0), 42, (byte)0);
Entity b = event.getPlayer().getWorld().spawnFallingBlock(event.getPlayer().getLocation().add(0, 5, 0), 41, (byte)0);
chicken.setPassenger(chickenb);
chickenb.setPassenger(chickenc);
chickenc.setPassenger(a);
a.setPassenger(b);
}
if (event.getMessage().equals("/test4"))
{
Chicken chicken = event.getPlayer().getWorld().spawn(event.getPlayer().getLocation(), Chicken.class);
chicken.setBaby();
Chicken chickenb = event.getPlayer().getWorld().spawn(event.getPlayer().getLocation(), Chicken.class);
chickenb.setBaby();
Chicken chickenc = event.getPlayer().getWorld().spawn(event.getPlayer().getLocation(), Chicken.class);
chickenc.setBaby();
Chicken chickend = event.getPlayer().getWorld().spawn(event.getPlayer().getLocation(), Chicken.class);
chickend.setBaby();
Entity a = event.getPlayer().getWorld().spawnFallingBlock(event.getPlayer().getLocation().add(0, 5, 0), 42, (byte)0);
Entity b = event.getPlayer().getWorld().spawnFallingBlock(event.getPlayer().getLocation().add(0, 5, 0), 44, (byte)0);
Entity iron = event.getPlayer().getWorld().spawn(event.getPlayer().getLocation(), Skeleton.class);
chicken.setPassenger(chickenb);
chickenb.setPassenger(chickenc);
chickenc.setPassenger(chickend);
chickend.setPassenger(a);
a.setPassenger(iron);
iron.setPassenger(b);
}
}
}

View File

@ -0,0 +1,5 @@
package nautilus.game.arcade.game.games.christmas;
public class Christmas {
}

View File

@ -139,17 +139,6 @@ public class Dragons extends SoloGame
if (_dragons.size() < 7)
{
if (_dragons.size() == 0)
{
for (Player player : UtilServer.getPlayers())
{
Location loc = player.getLocation();
loc.setPitch(UtilAlg.GetPitch(UtilAlg.getTrajectory(player.getLocation(), _dragonSpawns.get(0))));
loc.setYaw(UtilAlg.GetYaw(UtilAlg.getTrajectory(player.getLocation(), _dragonSpawns.get(0))));
player.teleport(loc);
}
}
CreatureAllowOverride = true;
EnderDragon ent = GetSpectatorLocation().getWorld().spawn(_dragonSpawns.get(0), EnderDragon.class);
UtilEnt.Vegetate(ent);

View File

@ -113,7 +113,7 @@ public class Draw extends SoloGame
"Book", "Swimming", "Horse", "Paper", "Toaster", "Television", "Hammer", "Piano", "Sleeping", "Yawn", "Sheep", "Night", "Chest", "Lamp", "Redstone",
"Grass", "Plane", "Ocean", "Lake", "Melon", "Pumpkin", "Gift", "Fishing", "Pirate", "Lightning", "Stomach", "Belly Button", "Fishing Rod",
"Iron Ore", "Diamonds", "Emeralds", "Nether Portal", "Ender Dragon", "Rabbit", "Harry Potter", "Miley Cyrus", "Torch", "Light", "Battery",
"Zombie Pigman", "Telephone", "Tent"
};
}
@ -638,61 +638,61 @@ public class Draw extends SoloGame
//Rounds
String out = C.cRed + " ";
_lastScoreboard.add(out);
if (out.length() >= 16)
out = out.substring(0, 15);
_lastScoreboard.add(out);
GetObjectiveSide().getScore(Bukkit.getOfflinePlayer(out)).setScore(index--);
out = C.cRed + " ";
_lastScoreboard.add(out);
if (out.length() >= 16)
out = out.substring(0, 15);
_lastScoreboard.add(out);
GetObjectiveSide().getScore(Bukkit.getOfflinePlayer(out)).setScore(index--);
out = C.cWhite + "Round:";
_lastScoreboard.add(out);
if (out.length() >= 16)
out = out.substring(0, 15);
_lastScoreboard.add(out);
GetObjectiveSide().getScore(Bukkit.getOfflinePlayer(out)).setScore(index--);
out = C.cYellow + Math.min(_roundCount+1, _roundMax) + " of " + _roundMax;
_lastScoreboard.add(out);
if (out.length() >= 16)
out = out.substring(0, 15);
_lastScoreboard.add(out);
GetObjectiveSide().getScore(Bukkit.getOfflinePlayer(out)).setScore(index--);
//Drawer
out = C.cRed + " ";
_lastScoreboard.add(out);
if (out.length() >= 16)
out = out.substring(0, 15);
_lastScoreboard.add(out);
GetObjectiveSide().getScore(Bukkit.getOfflinePlayer(out)).setScore(index--);
out = C.cWhite + "Drawer:";
_lastScoreboard.add(out);
if (out.length() >= 16)
out = out.substring(0, 15);
_lastScoreboard.add(out);
GetObjectiveSide().getScore(Bukkit.getOfflinePlayer(out)).setScore(index--);
out = C.cYellow + "None";
if (_round != null)
out = C.cYellow + _round.Drawer.getName();
_lastScoreboard.add(out);
if (out.length() >= 16)
out = out.substring(0, 15);
_lastScoreboard.add(out);
GetObjectiveSide().getScore(Bukkit.getOfflinePlayer(out)).setScore(index--);
out = C.cRed + " ";
_lastScoreboard.add(out);
if (out.length() >= 16)
out = out.substring(0, 15);
_lastScoreboard.add(out);
GetObjectiveSide().getScore(Bukkit.getOfflinePlayer(out)).setScore(index--);
//Scores
out = C.cWhite + "Scores:";
_lastScoreboard.add(out);
if (out.length() >= 16)
out = out.substring(0, 15);
_lastScoreboard.add(out);
GetObjectiveSide().getScore(Bukkit.getOfflinePlayer(out)).setScore(index--);
//Write New

View File

@ -412,14 +412,14 @@ public class HungerGames extends SoloGame
for (int i = 0; i < 30; i++) _baseChestLoot.add(new ItemStack(Material.WEB, 2));
//Food
for (int i = 0; i < 30; i++) _baseChestLoot.add(new ItemStack(Material.MUSHROOM_SOUP));
for (int i = 0; i < 40; i++) _baseChestLoot.add(new ItemStack(Material.COOKED_CHICKEN));
for (int i = 0; i < 50; i++) _baseChestLoot.add(new ItemStack(Material.RAW_BEEF));
for (int i = 0; i < 40; i++) _baseChestLoot.add(new ItemStack(Material.GRILLED_PORK));
for (int i = 0; i < 45; i++) _baseChestLoot.add(new ItemStack(Material.BREAD));
for (int i = 0; i < 40; i++) _baseChestLoot.add(new ItemStack(Material.MUSHROOM_SOUP));
for (int i = 0; i < 50; i++) _baseChestLoot.add(new ItemStack(Material.COOKED_CHICKEN));
for (int i = 0; i < 80; i++) _baseChestLoot.add(new ItemStack(Material.RAW_BEEF));
for (int i = 0; i < 50; i++) _baseChestLoot.add(new ItemStack(Material.GRILLED_PORK));
for (int i = 0; i < 100; i++) _baseChestLoot.add(new ItemStack(Material.BREAD));
for (int i = 0; i < 40; i++) _baseChestLoot.add(new ItemStack(Material.PUMPKIN_PIE));
for (int i = 0; i < 50; i++) _baseChestLoot.add(new ItemStack(Material.COOKIE));
for (int i = 0; i < 50; i++) _baseChestLoot.add(new ItemStack(Material.ROTTEN_FLESH));
for (int i = 0; i < 80; i++) _baseChestLoot.add(new ItemStack(Material.COOKIE));
for (int i = 0; i < 90; i++) _baseChestLoot.add(new ItemStack(Material.ROTTEN_FLESH));
for (int i = 0; i < 80; i++) _baseChestLoot.add(new ItemStack(Material.WHEAT, 6));

View File

@ -9,7 +9,6 @@ import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Chunk;
import org.bukkit.Difficulty;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
@ -18,9 +17,7 @@ import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
import org.bukkit.craftbukkit.v1_6_R3.CraftWorld;
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftPlayer;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.CaveSpider;
import org.bukkit.entity.EnderDragon;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
@ -28,13 +25,13 @@ import org.bukkit.entity.Ghast;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Monster;
import org.bukkit.entity.Player;
import org.bukkit.entity.Skeleton.SkeletonType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntityCreatePortalEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
@ -43,7 +40,6 @@ import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
import org.bukkit.event.inventory.PrepareItemCraftEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerItemConsumeEvent;
import org.bukkit.event.player.PlayerKickEvent;
import org.bukkit.event.player.PlayerLoginEvent;
@ -65,30 +61,21 @@ import mineplex.core.common.util.MapUtil;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.disguise.disguises.DisguiseChicken;
import mineplex.core.disguise.disguises.DisguiseCreeper;
import mineplex.core.disguise.disguises.DisguisePig;
import mineplex.core.disguise.disguises.DisguiseSkeleton;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.map.Map;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.combat.CombatLog;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
import nautilus.game.arcade.ArcadeFormat;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.TeamGame;
import nautilus.game.arcade.game.GameTeam.PlayerState;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.GameLobbyManager;
@ -101,6 +88,8 @@ public class UHC extends TeamGame
private NautHashMap<String, Long> _combatTime = new NautHashMap<String, Long>();
private int _borders = 1000;
private int _gameMinutes = 0;
private long _lastMinute = System.currentTimeMillis();
@ -124,7 +113,6 @@ public class UHC extends TeamGame
new String[] {
"20 minutes of no PvP",
"Borders at -1250 and 1250",
"No default health regeneration",
"Last player/team alive wins!"
});
@ -172,13 +160,15 @@ public class UHC extends TeamGame
@Override
public void ParseData()
{
WorldData.World.setDifficulty(Difficulty.HARD);
_portalBlock = WorldData.GetDataLocs("YELLOW");
_portal = WorldData.GetDataLocs("BLACK");
//Set Portal Blocks
for (int i=0 ; i<_portalBlock.size() ; i++)
{
if (i<6)
if (i<9)
_portalBlock.get(i).getBlock().setTypeIdAndData(Material.ENDER_PORTAL_FRAME.getId(), (byte)4, true);
else
_portalBlock.get(i).getBlock().setTypeIdAndData(Material.ENDER_PORTAL_FRAME.getId(), (byte)0, true);
@ -330,7 +320,7 @@ public class UHC extends TeamGame
if (from.getX() >= WorldData.MaxX) from.setX(WorldData.MaxX - 1);
if (from.getX() < WorldData.MinX) from.setX(WorldData.MinX + 1);
if (from.getZ() >= WorldData.MaxZ) from.setZ(WorldData.MaxZ - 1);
if (from.getZ() < WorldData.MaxZ) from.setZ(WorldData.MinZ + 1);
if (from.getZ() < WorldData.MinZ) from.setZ(WorldData.MinZ + 1);
event.setTo(event.getFrom());
@ -343,65 +333,24 @@ public class UHC extends TeamGame
if (event.GetState() != GameState.Recruit)
return;
if (_soloGame)
{
this.WorldData.MinX = -1250;
this.WorldData.MaxX = 1250;
this.WorldData.MinZ = -1250;
this.WorldData.MaxZ = 1250;
long time = System.currentTimeMillis();
for (int x=-79 ; x<=78 ; x++)
{
WorldBoundaryRed(WorldData.World.getChunkAt(x, 78));
WorldBoundaryRed(WorldData.World.getChunkAt(x, -79));
}
this.WorldData.MinX = -_borders;
this.WorldData.MaxX = _borders;
this.WorldData.MinZ = -_borders;
this.WorldData.MaxZ = _borders;
for (int z=-79 ; z<=78 ; z++)
for (int y=0 ; y<128 ; y++)
for (int x=-_borders ; x<_borders ; x++)
for (int z=-_borders ; z<_borders ; z++)
{
WorldBoundaryRed(WorldData.World.getChunkAt(78, z));
WorldBoundaryRed(WorldData.World.getChunkAt(-79, z));
}
}
else
if (x == -_borders || x == _borders-1 || z == -_borders || z == _borders-1)
{
this.WorldData.MinX = -1000;
this.WorldData.MaxX = 1000;
this.WorldData.MinZ = -1000;
this.WorldData.MaxZ = 1000;
for (int x=-63 ; x<=62 ; x++)
{
WorldBoundaryRed(WorldData.World.getChunkAt(x, 62));
WorldBoundaryRed(WorldData.World.getChunkAt(x, -63));
}
for (int z=-63 ; z<=62 ; z++)
{
WorldBoundaryRed(WorldData.World.getChunkAt(62, z));
WorldBoundaryRed(WorldData.World.getChunkAt(-63, z));
}
MapUtil.QuickChangeBlockAt(WorldData.World, x, y, z , 159, (byte)14);
}
}
public void WorldBoundaryRed(Chunk chunk)
{
Block block;
for (int x=0 ; x<16 ; x++)
for (int z=0 ; z<16 ; z++)
for (int y=0 ; y<256 ; y++)
{
block = chunk.getBlock(x, y, z);
if (
block.getX() < WorldData.MaxX &&
block.getX() >= WorldData.MinX &&
block.getZ() < WorldData.MaxZ &&
block.getZ() >= WorldData.MinZ)
continue;
if (block.getTypeId() != 0 || block.getY() <= 128)
MapUtil.QuickChangeBlockAt(block.getLocation(), 159, (byte)14);
}
System.out.println("Time: " + UtilTime.MakeStr(System.currentTimeMillis() - time));
}
@EventHandler
@ -652,11 +601,10 @@ public class UHC extends TeamGame
team.RemovePlayer(player);
if (team.GetColor() == ChatColor.DARK_GRAY)
return;
if (player.isDead())
return;
/* XXX
if (true)
{
@ -774,7 +722,7 @@ public class UHC extends TeamGame
ArrayList<Entity> entList = ents.get(type);
int count = 0;
while (entList.size() > 300)
while (entList.size() > 400)
{
Entity ent = entList.remove(UtilMath.r(entList.size()));
ent.remove();
@ -825,6 +773,7 @@ public class UHC extends TeamGame
return;
}
/*
//Owner Bypass
if (Manager.GetClients().Get(event.getPlayer()).GetRank().Has(Rank.OWNER))
return;
@ -832,6 +781,7 @@ public class UHC extends TeamGame
//Disallow
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, ChatColor.YELLOW + "You cannot join this UHC.");
*/
}
private void CraftRecipes()
@ -1037,82 +987,6 @@ public class UHC extends TeamGame
}
}
@EventHandler
public void SpecialCommand(PlayerCommandPreprocessEvent event)
{
if (event.getMessage().startsWith("/superchissburger"))
{
Player player = event.getPlayer();
if (GetTeam(player) != null)
{
if (GetTeam(player).GetColor() == ChatColor.DARK_GRAY)
{
GetTeam(player).RemovePlayer(player);
}
else
{
return;
}
}
GameTeam special = null;
for (GameTeam team : this.GetTeamList())
{
if (team.GetColor() == ChatColor.DARK_GRAY)
{
special = team;
break;
}
}
if (special == null)
{
special = new GameTeam("Herobrine", ChatColor.DARK_GRAY, GetTeamList().get(0).GetSpawns());
AddTeam(special);
}
special.AddPlayer(player);
((CraftPlayer)player).getHandle().spectating = false;
((CraftPlayer)player).getHandle().m = true;
Manager.GetCondition().EndCondition(player, ConditionType.CLOAK, null);
if (event.getMessage().contains("chicken"))
{
DisguiseChicken disguise = new DisguiseChicken(player);
Manager.GetDisguise().disguise(disguise);
player.sendMessage("You are a Chicken!");
}
else if (event.getMessage().contains("creeper"))
{
DisguiseCreeper disguise = new DisguiseCreeper(player);
Manager.GetDisguise().disguise(disguise);
player.sendMessage("You are a Creeper!");
}
else if (event.getMessage().contains("pig"))
{
DisguisePig disguise = new DisguisePig(player);
Manager.GetDisguise().disguise(disguise);
player.sendMessage("You are a Pig!");
}
else
{
DisguiseSkeleton disguise = new DisguiseSkeleton(player);
disguise.SetSkeletonType(SkeletonType.WITHER);
Manager.GetDisguise().disguise(disguise);
player.sendMessage("You are a Wither Skeleton!");
}
UtilInv.Clear(player);
UtilInv.insert(player, new ItemStack(Material.IRON_SWORD));
event.setCancelled(true);
}
}
@EventHandler
public void RejoinCommand(PlayerCommandPreprocessEvent event)
{
@ -1146,63 +1020,6 @@ public class UHC extends TeamGame
event.setCancelled(false);
}
@EventHandler
public void SpecialDamage(EntityDamageEvent event)
{
if (event.isCancelled())
return;
//Damager
LivingEntity damagerEnt = UtilEvent.GetDamagerEntity(event, true);
if (damagerEnt != null)
{
if (damagerEnt instanceof Player)
{
Player damager = (Player)damagerEnt;
GameTeam team = GetTeam(damager);
if (team != null && team.GetColor() == ChatColor.DARK_GRAY)
{
event.setCancelled(true);
return;
}
}
}
//Damagee
if (event.getEntity() instanceof Player)
{
Player damagee = (Player)event.getEntity();
GameTeam team = GetTeam(damagee);
if (team != null && team.GetColor() == ChatColor.DARK_GRAY)
{
event.setCancelled(true);
return;
}
}
}
@EventHandler
public void SpecialCloak(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
GameTeam team = GetTeam(ChatColor.DARK_GRAY);
if (team == null) return;
for (Player player : team.GetPlayers(true))
{
if (!UtilGear.isMat(player.getItemInHand(), Material.IRON_SWORD))
Manager.GetCondition().Factory().Cloak("Special Cloak", player, player, 1.9, false, false);
else
Manager.GetCondition().EndCondition(player, ConditionType.CLOAK, null);
}
}
@EventHandler
public void TabHealth(UpdateEvent event)
{
@ -1216,22 +1033,6 @@ public class UHC extends TeamGame
{
GameTeam team = GetTeam(player);
if (team.GetColor() == ChatColor.DARK_GRAY)
{
if (player.getName().equalsIgnoreCase("chiss"))
player.setPlayerListName(" ");
else if (player.getName().equalsIgnoreCase("defek7"))
player.setPlayerListName(" ");
else if (player.getName().equalsIgnoreCase("spu_"))
player.setPlayerListName(" ");
else if (player.getName().equalsIgnoreCase("sterling_"))
player.setPlayerListName(" ");
else
player.setPlayerListName(" ");
continue;
}
ChatColor col = ChatColor.GREEN;
if (player.getHealth() <= 12) col = ChatColor.YELLOW;
if (player.getHealth() <= 6) col = ChatColor.RED;
@ -1427,12 +1228,11 @@ public class UHC extends TeamGame
GameTeam team = GetTeam(damager);
if (team != null && team.GetColor() == ChatColor.DARK_GRAY)
if (team != null)
{
if (_lastDragonDamager == null || !_lastDragonDamager.equals(team))
{
_lastDragonDamager = team;
Announce(team.GetColor() + C.Bold + team.GetName() + " are attacking the Ender Dragon!");
}
}
}
@ -1451,6 +1251,9 @@ public class UHC extends TeamGame
if (_lastDragonDamager == null)
return;
if (!(event.getEntity() instanceof EnderDragon))
return;
AnnounceEnd(_lastDragonDamager);
_ended = true;
}
@ -1502,4 +1305,11 @@ public class UHC extends TeamGame
if (event.getBlock().getType() == Material.ENDER_PORTAL_FRAME)
event.setCancelled(true);
}
@Override
@EventHandler
public void ScoreboardUpdate(UpdateEvent event)
{
}
}

View File

@ -67,16 +67,6 @@ public class GameChatManager implements Listener
if (ownsUltra && !rank.Has(Rank.ULTRA))
rankStr = Rank.ULTRA.GetTag(true, true) + " ";
if (Manager.GetGame() != null && Manager.GetGame().GetType() == GameType.UHC)
{
ChatColor col = ChatColor.GREEN;
if (sender.getHealth() <= 12) col = ChatColor.YELLOW;
if (sender.getHealth() <= 6) col = ChatColor.RED;
event.setFormat(dead + rankStr + col + "%1$s > " + C.cWhite + "%2$s");
return;
}
//Base Format
event.setFormat(dead + rankStr + Manager.GetColor(sender) + "%1$s " + ChatColor.WHITE + "%2$s");