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

This commit is contained in:
Jonathan Williams 2014-04-07 22:25:08 -04:00
commit 9b4e1aa9eb
34 changed files with 300 additions and 147 deletions

View File

@ -95,7 +95,7 @@ public class Flash extends SkillActive
int charges = _flash.get(cur); int charges = _flash.get(cur);
int level = getLevel(cur); int level = getLevel(cur);
if (charges >= 1 + level) if (charges >= 2 + level)
continue; continue;
if (!mineplex.core.recharge.Recharge.Instance.use(cur, "Flash Recharge", 9000 - (1000 * level), false, false)) if (!mineplex.core.recharge.Recharge.Instance.use(cur, "Flash Recharge", 9000 - (1000 * level), false, false))

View File

@ -139,7 +139,7 @@ public class SmokeArrow extends SkillActive
event.AddMod(damager.getName(), GetName(), 0, true); event.AddMod(damager.getName(), GetName(), 0, true);
//Effect //Effect
UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, projectile.getLocation(), 0, 0, 0, 0, 1); UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, projectile.getLocation(), 0, 0, 0, 0, 1);
} }
@EventHandler @EventHandler

View File

@ -44,14 +44,14 @@ public class Stealth extends Skill
"Invisible, but also Slow #4#-1.", "Invisible, but also Slow #4#-1.",
"", "",
"Stealth ends if you an enemy comes", "Stealth ends if you an enemy comes",
"within #8#-2 Blocks of you, or you attack.", "within #10#-2 Blocks of you, or you attack.",
}); });
} }
@Override @Override
public String GetEnergyString() public String GetEnergyString()
{ {
return "Energy: 8 per Second"; return "Energy: #13#1 per Second";
} }
@EventHandler @EventHandler
@ -81,7 +81,7 @@ public class Stealth extends Skill
return; return;
} }
if (!UtilTime.elapsed(Factory.Combat().Get(player).LastCombat, 4000)) if (!UtilTime.elapsed(Factory.Combat().Get(player).GetLastCombat(), 4000))
{ {
UtilPlayer.message(player, F.main(GetClassType().name(), "You cannot use " + F.skill(GetName()) + " while in Combat.")); UtilPlayer.message(player, F.main(GetClassType().name(), "You cannot use " + F.skill(GetName()) + " while in Combat."));
return; return;
@ -222,7 +222,7 @@ public class Stealth extends Skill
continue; continue;
} }
if (!Factory.Energy().Use(cur, GetName(), 0.4, true, false)) if (!Factory.Energy().Use(cur, GetName(), 0.9 - (0.1 * getLevel(cur)), true, false))
{ {
Remove(cur, null); Remove(cur, null);
continue; continue;

View File

@ -22,7 +22,7 @@ public class ViperStrikes extends Skill
SetDesc(new String[] SetDesc(new String[]
{ {
"Your attacks give enemies", "Your attacks give enemies",
"Poison 1 for #0#2 seconds,", "Poison 1 for #1#2 seconds,",
"but deal #1#1 less damage." "but deal #1#1 less damage."
}); });
} }
@ -49,7 +49,7 @@ public class ViperStrikes extends Skill
if (damagee == null) return; if (damagee == null) return;
//Confuse //Confuse
Factory.Condition().Factory().Poison(GetName(), damagee, damager, 0 + 2*level, 0, false, false, false); Factory.Condition().Factory().Poison(GetName(), damagee, damager, 1 + 2*level, 0, false, false, false);
//Damage //Damage
event.AddMod(damager.getName(), GetName(), -1 - level, true); event.AddMod(damager.getName(), GetName(), -1 - level, true);

View File

@ -210,7 +210,7 @@ public class BlockToss extends SkillCharge implements IThrown
Player damager = event.GetDamagerPlayer(true); Player damager = event.GetDamagerPlayer(true);
if (damager == null) return; if (damager == null) return;
if (event.GetReason() != null && !event.GetReason().equals(GetName())) if (event.GetReason() == null || !event.GetReason().equals(GetName()))
return; return;
event.AddKnockback(GetName(), 1.5d); event.AddKnockback(GetName(), 1.5d);

View File

@ -108,15 +108,12 @@ public class SeismicSlam extends SkillActive
_live.remove(player); _live.remove(player);
//Action //Action
HashMap<LivingEntity, Double> targets = UtilEnt.getInRadius(player.getLocation(), 5 + level); HashMap<LivingEntity, Double> targets = UtilEnt.getInRadius(player.getLocation(), 5d + level);
for (LivingEntity cur : targets.keySet()) for (LivingEntity cur : targets.keySet())
{ {
if (cur.equals(player)) if (cur.equals(player))
continue; continue;
if (!UtilEnt.isGrounded(player))
continue;
//Damage Event //Damage Event
Factory.Damage().NewDamageEvent(cur, player, null, Factory.Damage().NewDamageEvent(cur, player, null,
DamageCause.CUSTOM, (3+level) * targets.get(cur) + 0.5, false, true, false, DamageCause.CUSTOM, (3+level) * targets.get(cur) + 0.5, false, true, false,

View File

@ -34,9 +34,13 @@ public class Resistance extends Skill
event.GetCondition().GetType() != ConditionType.BLINDNESS) event.GetCondition().GetType() != ConditionType.BLINDNESS)
return; return;
double reduction = (0.25 * getLevel(event.GetCondition().GetEnt())); int level = getLevel(event.GetCondition().GetEnt());
if (level <= 0)
return;
double reduction = -(0.25f * level);
event.GetCondition().ModifyTicks((int) (event.GetCondition().GetTicksTotal() * (1 - reduction))); event.GetCondition().ModifyTicks((int) (event.GetCondition().GetTicksTotal() * reduction));
} }
@Override @Override

View File

@ -61,7 +61,7 @@ public class Cleave extends Skill
//Splash //Splash
for (Player other : UtilPlayer.getNearby(damagee.getLocation(), 1.5 + (0.5 * level))) for (Player other : UtilPlayer.getNearby(damagee.getLocation(), 1.5 + (0.5 * level)))
{ {
if (!other.equals(damagee)) if (!other.equals(damagee) && !other.equals(damager))
if (Factory.Relation().CanHurt(damager, other)) if (Factory.Relation().CanHurt(damager, other))
{ {
//Damage Event //Damage Event

View File

@ -42,8 +42,8 @@ public class HoldPosition extends SkillActive
SetDesc(new String[] SetDesc(new String[]
{ {
"Hold your position, gaining", "Hold your position, gaining",
"Protection 4, Slow 4 and no", "Protection 4, Slow 3 and no",
"knockback for #3.5#1.5 seconds." "knockback for #2.5#1.5 seconds."
}); });
} }
@ -62,10 +62,10 @@ public class HoldPosition extends SkillActive
@Override @Override
public void Skill(Player player, int level) public void Skill(Player player, int level)
{ {
double duration = 3.5 + (1.5 * level); double duration = 3 + (1 * level);
//Action //Action
Factory.Condition().Factory().Slow(GetName(), player, player, duration, 3, false, true, false, true); Factory.Condition().Factory().Slow(GetName(), player, player, duration, 2, false, true, false, true);
Factory.Condition().Factory().Protection(GetName(), player, player, duration, 3, false, true, true); Factory.Condition().Factory().Protection(GetName(), player, player, duration, 3, false, true, true);
//Inform //Inform

View File

@ -127,7 +127,7 @@ public class Blizzard extends SkillActive
//Snow //Snow
if (target == null || target.getType() == Material.AIR || UtilMath.offset(target.getLocation(), cur.getLocation()) > 5) if (target == null || target.getType() == Material.AIR || UtilMath.offset(target.getLocation(), cur.getLocation()) > 5)
for (int i=0 ; i<4 ; i++) for (int i=0 ; i<1+level ; i++)
{ {
Projectile snow = cur.launchProjectile(Snowball.class); Projectile snow = cur.launchProjectile(Snowball.class);
double x = 0.2 - (UtilMath.r(40)/100d); double x = 0.2 - (UtilMath.r(40)/100d);

View File

@ -41,7 +41,7 @@ public class FireBlast extends SkillActive
{ {
"Launch a fireball which explodes on impact", "Launch a fireball which explodes on impact",
"dealing large knockback to enemies within", "dealing large knockback to enemies within",
"#3.5#1.5 Blocks range. Also ignites enemies", "#6#0.5 Blocks range. Also ignites enemies",
"for up to #2#2 seconds." "for up to #2#2 seconds."
}); });
} }
@ -98,20 +98,20 @@ public class FireBlast extends SkillActive
if (level == 0) return; if (level == 0) return;
//Velocity Players //Velocity Players
HashMap<Player,Double> hitMap = UtilPlayer.getInRadius(proj.getLocation(), 4 + (2 * level)); HashMap<Player,Double> hitMap = UtilPlayer.getInRadius(proj.getLocation(), 5.5 + (0.5 * level));
for (Player cur : hitMap.keySet()) for (Player cur : hitMap.keySet())
{ {
double range = hitMap.get(cur); double range = hitMap.get(cur);
//Damage Event //Damage Event
Factory.Condition().Factory().Ignite(GetName(), cur, player, (2 + (2 * level)) * range, false, false); Factory.Condition().Factory().Ignite(GetName(), cur, player, (2 + (1 * level)) * range, false, false);
//Condition //Condition
Factory.Condition().Factory().Falling(GetName(), cur, player, 10, false, true); Factory.Condition().Factory().Falling(GetName(), cur, player, 10, false, true);
//Velocity //Velocity
UtilAction.velocity(cur, UtilAlg.getTrajectory(proj.getLocation().add(0, -0.5, 0), cur.getEyeLocation()), UtilAction.velocity(cur, UtilAlg.getTrajectory(proj.getLocation().add(0, -0.5, 0), cur.getEyeLocation()),
0.5 + 1.5 * range, false, 0, 0.2 + 0.6 * range, 1.2, true); 1.6 * range, false, 0, 0.8 * range, 1.2, true);
} }
} }

View File

@ -54,7 +54,7 @@ public class MagmaBlade extends Skill
if (level == 0) return; if (level == 0) return;
//Damage //Damage
event.AddMod(damager.getName(), GetName(), level, true); event.AddMod(damager.getName(), GetName(), 1 + level, true);
//Effect //Effect
damager.getWorld().playSound(damager.getLocation(), Sound.FIZZ, 0.8f, 0f); damager.getWorld().playSound(damager.getLocation(), Sound.FIZZ, 0.8f, 0f);

View File

@ -60,7 +60,7 @@ public class Rupture extends SkillActiveCharge
{ {
"Hold Block to create a rupture", "Hold Block to create a rupture",
"at your feet. It will snake through", "at your feet. It will snake through",
"the ground with #1#0.1 velocity, moving" + "the ground with #1#0.1 velocity, moving",
"towards where you are looking,", "towards where you are looking,",
"giving Slow 2 to nearby opponents.", "giving Slow 2 to nearby opponents.",
"", "",

View File

@ -36,8 +36,8 @@ public class Void extends Skill
"Slow 3, take no knockback and", "Slow 3, take no knockback and",
"use no energy to swing weapons.", "use no energy to swing weapons.",
"", "",
"Reduces incoming damage by #2#1 , but", "Reduces incoming damage by #1#1 , but",
"burns #7#-1 Energy per 1 damage reduced." "burns #9#-1 Energy per 1 damage reduced."
}); });
} }
@ -129,7 +129,20 @@ public class Void extends Skill
//Energy //Energy
Factory.Energy().ModifyEnergy(cur, -0.3); Factory.Energy().ModifyEnergy(cur, -0.3);
}
}
@EventHandler
public void Conditions(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
return;
for (Player cur : _active)
{
if (cur.isDead())
continue;
//Condition //Condition
Factory.Condition().Factory().Invisible(GetName(), cur, cur, 1.9, 0, false, true, true); Factory.Condition().Factory().Invisible(GetName(), cur, cur, 1.9, 0, false, true, true);
Factory.Condition().Factory().Slow(GetName(), cur, cur, 1.9, 1, false, true, false, true); Factory.Condition().Factory().Slow(GetName(), cur, cur, 1.9, 1, false, true, false, true);
@ -151,7 +164,7 @@ public class Void extends Skill
int level = getLevel(damagee); int level = getLevel(damagee);
if (level == 0) return; if (level == 0) return;
double dmgToEnergy = 7 - level; double dmgToEnergy = 9 - level;
int dmgLower = 1 + level; int dmgLower = 1 + level;
int currentEnergy = (int)Factory.Energy().GetCurrent(damagee); int currentEnergy = (int)Factory.Energy().GetCurrent(damagee);

View File

@ -24,7 +24,7 @@ public class VitalitySpores extends Skill
{ {
"After #12#-2 seconds of not taking damage,", "After #12#-2 seconds of not taking damage,",
"forest spores surround you, giving", "forest spores surround you, giving",
"you Regeneration 1 for #4#2 seconds.", "you Regeneration 1 for #3#2 seconds.",
"", "",
"This remains until you take damage." "This remains until you take damage."
}); });
@ -40,11 +40,11 @@ public class VitalitySpores extends Skill
{ {
int level = getLevel(cur); int level = getLevel(cur);
if (level == 0) continue; if (level == 0) continue;
if (UtilTime.elapsed(Factory.Combat().Get(cur).LastDamaged, 10000)) if (UtilTime.elapsed(Factory.Combat().Get(cur).GetLastDamaged(), 12000 - 2000*level))
{ {
Factory.Condition().Factory().Regen(GetName(), cur, cur, 6.9, 0, false, true, true); Factory.Condition().Factory().Regen(GetName(), cur, cur, 3.9 + 2*level, 0, false, true, true);
UtilPlayer.health(cur, 1); UtilPlayer.health(cur, 0.5);
if (Recharge.Instance.use(cur, GetName(), 2000, false, false)) if (Recharge.Instance.use(cur, GetName(), 2000, false, false))
UtilParticle.PlayParticle(ParticleType.HEART, cur.getEyeLocation(), 0, 0.2f, 0, 0, 1); UtilParticle.PlayParticle(ParticleType.HEART, cur.getEyeLocation(), 0, 0.2f, 0, 0, 1);

View File

@ -72,7 +72,7 @@ public class WolfsFury extends SkillActive
_active.put(player, System.currentTimeMillis() + 8000); _active.put(player, System.currentTimeMillis() + 8000);
//Condition //Condition
Factory.Condition().Factory().Strength(GetName(), player, player, 2 + 2*level, 2, false, true, true); Factory.Condition().Factory().Strength(GetName(), player, player, 2 + 2*level, level-1, false, true, true);
//Inform //Inform
UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + ".")); UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + "."));

View File

@ -190,10 +190,10 @@ public abstract class Skill implements ISkill, Listener
try try
{ {
double base = Double.parseDouble(numberToks[0]); float base = Float.parseFloat(numberToks[0]);
double bonus = Double.parseDouble(numberToks[1]); float bonus = Float.parseFloat(numberToks[1]);
double levelValue = base + ((double)level * bonus); float levelValue = base + (level * bonus);
String plusMinus = "+"; String plusMinus = "+";
if (bonus < 0) if (bonus < 0)
@ -211,7 +211,7 @@ public abstract class Skill implements ISkill, Listener
//Only display what you'd get with level 1 //Only display what you'd get with level 1
if (level == 0 ) if (level == 0 )
{ {
levelValue = base + ((double)1 * bonus); levelValue = base + (1f * bonus);
totalString = levelValue + ""; totalString = levelValue + "";
if (levelValue % 1 == 0) if (levelValue % 1 == 0)

View File

@ -154,7 +154,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
AddSkill(new Resistance(this, "Resistance", ClassType.Global, SkillType.GlobalPassive, 5, 3)); AddSkill(new Resistance(this, "Resistance", ClassType.Global, SkillType.GlobalPassive, 5, 3));
AddSkill(new Rations(this, "Rations", ClassType.Global, SkillType.GlobalPassive, 5, 2)); AddSkill(new Rations(this, "Rations", ClassType.Global, SkillType.GlobalPassive, 5, 2));
AddSkill(new Fitness(this, "Mana Pool", ClassType.Mage, SkillType.GlobalPassive, 5, 5)); AddSkill(new Fitness(this, "Mana Pool", ClassType.Mage, SkillType.GlobalPassive, 5, 3));
AddSkill(new Recharge(this, "Mana Regeneration", ClassType.Mage, SkillType.GlobalPassive, 5, 3)); AddSkill(new Recharge(this, "Mana Regeneration", ClassType.Mage, SkillType.GlobalPassive, 5, 3));
AddSkill(new Fitness(this, "Fitness", ClassType.Assassin, SkillType.GlobalPassive, 5, 3)); AddSkill(new Fitness(this, "Fitness", ClassType.Assassin, SkillType.GlobalPassive, 5, 3));
@ -418,7 +418,6 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
AddSkill(new Void(this, "Void", ClassType.Mage, SkillType.PassiveA, 5, 3)); AddSkill(new Void(this, "Void", ClassType.Mage, SkillType.PassiveA, 5, 3));
AddSkill(new LifeBonds(this, "Life Bonds", ClassType.Mage, SkillType.PassiveA, 5, 3)); AddSkill(new LifeBonds(this, "Life Bonds", ClassType.Mage, SkillType.PassiveA, 5, 3));
//Passive B //Passive B
AddSkill(new GlacialBlade(this, "Glacial Blade", ClassType.Mage, SkillType.PassiveB, AddSkill(new GlacialBlade(this, "Glacial Blade", ClassType.Mage, SkillType.PassiveB,
5, 3, 5, 3,

View File

@ -3,6 +3,8 @@ package mineplex.minecraft.game.core.combat;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.WeakHashMap; import java.util.WeakHashMap;
import mineplex.core.common.util.UtilTime;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
public class ClientCombat public class ClientCombat
@ -13,7 +15,8 @@ public class ClientCombat
private WeakHashMap<LivingEntity, Long> _lastHurt = new WeakHashMap<LivingEntity, Long>(); private WeakHashMap<LivingEntity, Long> _lastHurt = new WeakHashMap<LivingEntity, Long>();
private WeakHashMap<LivingEntity, Long> _lastHurtBy = new WeakHashMap<LivingEntity, Long>(); private WeakHashMap<LivingEntity, Long> _lastHurtBy = new WeakHashMap<LivingEntity, Long>();
private long _lastHurtByWorld = 0;
public LinkedList<CombatLog> GetKills() public LinkedList<CombatLog> GetKills()
{ {
return _kills; return _kills;
@ -32,8 +35,18 @@ public class ClientCombat
public boolean CanBeHurtBy(LivingEntity damager) public boolean CanBeHurtBy(LivingEntity damager)
{ {
if (damager == null) if (damager == null)
return true; {
if (UtilTime.elapsed(_lastHurtByWorld, 250))
{
_lastHurtByWorld = System.currentTimeMillis();
return true;
}
else
{
return false;
}
}
if (!_lastHurtBy.containsKey(damager)) if (!_lastHurtBy.containsKey(damager))
{ {
_lastHurtBy.put(damager, System.currentTimeMillis()); _lastHurtBy.put(damager, System.currentTimeMillis());

View File

@ -23,8 +23,8 @@ public class CombatLog
private String _killerColor = ChatColor.YELLOW + ""; private String _killerColor = ChatColor.YELLOW + "";
protected CombatComponent LastDamager; protected CombatComponent LastDamager;
public long LastDamaged; protected long _lastDamaged;
public long LastCombat; protected long _lastCombat;
public CombatLog(Player player, long expireTime) public CombatLog(Player player, long expireTime)
{ {
@ -49,11 +49,11 @@ public class CombatLog
CombatComponent comp = GetEnemy(damagerName, damagerEnt); CombatComponent comp = GetEnemy(damagerName, damagerEnt);
comp.AddDamage(attackName, damage); comp.AddDamage(attackName, damage);
// Set Last // Set Last
LastDamager = comp; LastDamager = comp;
LastDamaged = System.currentTimeMillis(); _lastDamaged = System.currentTimeMillis();
LastCombat = System.currentTimeMillis(); _lastCombat = System.currentTimeMillis();
} }
public CombatComponent GetEnemy(String name, LivingEntity ent) public CombatComponent GetEnemy(String name, LivingEntity ent)
@ -133,6 +133,21 @@ public class CombatLog
{ {
return LastDamager; return LastDamager;
} }
public long GetLastDamaged()
{
return _lastDamaged;
}
public long GetLastCombat()
{
return _lastCombat;
}
public void SetLastCombat(long time)
{
_lastCombat = time;
}
public long GetDeathTime() public long GetDeathTime()
{ {
@ -163,4 +178,6 @@ public class CombatLog
{ {
_killerColor = color; _killerColor = color;
} }
} }

View File

@ -79,7 +79,7 @@ public class CombatManager extends MiniPlugin
if (damagerEnt != null) if (damagerEnt != null)
{ {
if (damagerEnt instanceof Player) if (damagerEnt instanceof Player)
Get((Player)damagerEnt).LastCombat = System.currentTimeMillis(); Get((Player)damagerEnt).SetLastCombat(System.currentTimeMillis());
Get(damagee).Attacked( Get(damagee).Attacked(
UtilEnt.getName(damagerEnt), UtilEnt.getName(damagerEnt),
@ -226,7 +226,7 @@ public class CombatManager extends MiniPlugin
} }
if (event.GetDamagerEntity(true) instanceof Player) if (event.GetDamagerEntity(true) instanceof Player)
Get((Player)event.GetDamagerEntity(true)).LastCombat = System.currentTimeMillis(); Get((Player)event.GetDamagerEntity(true)).SetLastCombat(System.currentTimeMillis());
Get(event.GetDamageePlayer()).Attacked( Get(event.GetDamageePlayer()).Attacked(
UtilEnt.getName(event.GetDamagerEntity(true)), UtilEnt.getName(event.GetDamagerEntity(true)),
@ -521,7 +521,10 @@ public class CombatManager extends MiniPlugin
public CombatLog Get(Player player) public CombatLog Get(Player player)
{ {
if (!_active.containsKey(player)) if (!_active.containsKey(player))
{
Add(player); Add(player);
}
return _active.get(player); return _active.get(player);
} }

View File

@ -339,6 +339,7 @@ public class ConditionEffect implements Listener
event.SetDamager(condition.GetSource()); event.SetDamager(condition.GetSource());
event.AddMod(UtilEnt.getName(condition.GetSource()), condition.GetReason(), 0, true); event.AddMod(UtilEnt.getName(condition.GetSource()), condition.GetReason(), 0, true);
event.SetIgnoreArmor(true); event.SetIgnoreArmor(true);
event.SetKnockback(false);
} }
@EventHandler @EventHandler

View File

@ -139,7 +139,7 @@ public class DamageManager extends MiniPlugin
public void NewDamageEvent(LivingEntity damagee, LivingEntity damager, Projectile proj, public void NewDamageEvent(LivingEntity damagee, LivingEntity damager, Projectile proj,
DamageCause cause, double damage, boolean knockback, boolean ignoreRate, boolean ignoreArmor, DamageCause cause, double damage, boolean knockback, boolean ignoreRate, boolean ignoreArmor,
String source, String reason, boolean cancelled) String source, String reason, boolean cancelled)
{ {
_plugin.getServer().getPluginManager().callEvent( _plugin.getServer().getPluginManager().callEvent(
new CustomDamageEvent(damagee, damager, proj, cause, damage, new CustomDamageEvent(damagee, damager, proj, cause, damage,
knockback, ignoreRate, ignoreArmor, knockback, ignoreRate, ignoreArmor,
@ -166,12 +166,12 @@ public class DamageManager extends MiniPlugin
return; return;
} }
//Limit World Damage Rate //Limit Mob/World Damage Rate
if (!event.IgnoreRate()) if (!event.IgnoreRate())
{ {
if (!_combatManager.Get(damagee.getName()).CanBeHurtBy(event.GetDamagerEntity(true))) if (!_combatManager.Get(damagee.getName()).CanBeHurtBy(event.GetDamagerEntity(true)))
{ {
event.SetCancelled("Damage Rate"); event.SetCancelled("World/Monster Damage Rate");
return; return;
} }
} }
@ -192,7 +192,7 @@ public class DamageManager extends MiniPlugin
if (!event.IgnoreRate()) if (!event.IgnoreRate())
if (!_combatManager.Get(damager.getName()).CanHurt(event.GetDamageeEntity())) if (!_combatManager.Get(damager.getName()).CanHurt(event.GetDamageeEntity()))
{ {
event.SetCancelled("Damage Rate"); event.SetCancelled("PvP Damage Rate");
return; return;
} }
} }
@ -545,4 +545,9 @@ public class DamageManager extends MiniPlugin
{ {
_enabled = var; _enabled = var;
} }
public CombatManager GetCombatManager()
{
return _combatManager;
}
} }

View File

@ -144,7 +144,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
if (serverConfig.GameList.contains(GameType.Dominate)) if (serverConfig.GameList.contains(GameType.Dominate))
{ {
_skillFactory = new SkillFactory(plugin, damageManager, this, new CombatManager(plugin), conditionManager, _projectileManager, _blockRestore, _fire, new Movement(plugin), teleport, new Energy(plugin), webAddress); _skillFactory = new SkillFactory(plugin, damageManager, this, _damageManager.GetCombatManager(), conditionManager, _projectileManager, _blockRestore, _fire, new Movement(plugin), teleport, new Energy(plugin), webAddress);
_classManager = new ClassManager(plugin, clientManager, donationManager, _skillFactory, webAddress); _classManager = new ClassManager(plugin, clientManager, donationManager, _skillFactory, webAddress);
_classShopManager = new ClassShopManager(_plugin, _classManager, _skillFactory, new ItemPackFactory(_plugin)); _classShopManager = new ClassShopManager(_plugin, _classManager, _skillFactory, new ItemPackFactory(_plugin));

View File

@ -22,9 +22,7 @@ public class StopCommand extends CommandBase<ArcadeManager>
return; return;
HandlerList.unregisterAll(Plugin.GetGame()); HandlerList.unregisterAll(Plugin.GetGame());
Plugin.GetGame().SetState(GameState.Dead); Plugin.GetGame().SetState(GameState.End);
Plugin.GetGame().WorldData.Uninitialize();
Plugin.SetGame(null);
caller.sendMessage("Stopped Game!"); caller.sendMessage("Stopped Game!");
} }

View File

@ -17,6 +17,7 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.combat.DeathMessageType;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType; import nautilus.game.arcade.GameType;
@ -33,8 +34,8 @@ import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.KitAvailability;
public class Dominate extends TeamGame public class Dominate extends TeamGame
{ {
//Map Data //Map Data
private ArrayList<CapturePoint> _points = new ArrayList<CapturePoint>(); private ArrayList<CapturePoint> _points = new ArrayList<CapturePoint>();
private ArrayList<Emerald> _emerald = new ArrayList<Emerald>(); private ArrayList<Emerald> _emerald = new ArrayList<Emerald>();
private ArrayList<Resupply> _resupply = new ArrayList<Resupply>(); private ArrayList<Resupply> _resupply = new ArrayList<Resupply>();
@ -51,39 +52,49 @@ public class Dominate extends TeamGame
{ {
super(manager, GameType.Dominate, super(manager, GameType.Dominate,
new Kit[] new Kit[]
{ {
new KitBrute(manager), new KitBrute(manager),
new KitRanger(manager), new KitRanger(manager),
new KitKnight(manager), new KitKnight(manager),
new KitMage(manager), new KitMage(manager),
new KitAssassin(manager), new KitAssassin(manager),
}, },
new String[] new String[]
{ {
"Capture Beacons for Points", "Capture Beacons for Points",
"+500 Points for Emerald Powerups", "+500 Points for Emerald Powerups",
"+200 Point for Kills", "+50 Points for Kills",
"First team to 15000 Points wins" "First team to 15000 Points wins"
}); });
_help = new String[]
{
"Capture Beacons faster with more people!",
};
this.DeathOut = false; this.DeathOut = false;
this.PrepareFreeze = false; this.PrepareFreeze = false;
this.HungerSet = 20; this.HungerSet = 20;
this.WorldTimeSet = 2000;
this.DeathSpectateSecs = 10; this.DeathSpectateSecs = 10;
this.Manager.GetDamage().UseSimpleWeaponDamage = false;
} }
@Override @Override
public void ParseData() public void ParseData()
{ {
for (String pointName : WorldData.GetAllCustomLocs().keySet()) for (String pointName : WorldData.GetAllCustomLocs().keySet())
{ {
_points.add(new CapturePoint(this, pointName, WorldData.GetAllCustomLocs().get(pointName).get(0))); _points.add(new CapturePoint(this, pointName, WorldData.GetAllCustomLocs().get(pointName).get(0)));
} }
for (Location loc : WorldData.GetDataLocs("YELLOW")) for (Location loc : WorldData.GetDataLocs("YELLOW"))
{ {
_resupply.add(new Resupply(this, loc)); _resupply.add(new Resupply(this, loc));
@ -173,7 +184,7 @@ public class Dominate extends TeamGame
if (killerTeam.equals(killedTeam)) if (killerTeam.equals(killedTeam))
return; return;
AddScore(killerTeam, 200); AddScore(killerTeam, 50);
} }
public void AddScore(GameTeam team, int score) public void AddScore(GameTeam team, int score)
@ -245,12 +256,12 @@ public class Dominate extends TeamGame
_lastScoreboard.add(out); _lastScoreboard.add(out);
GetObjectiveSide().getScore(Bukkit.getOfflinePlayer(out)).setScore(5 - i); GetObjectiveSide().getScore(Bukkit.getOfflinePlayer(out)).setScore(5 - i);
} }
} }
public void EndCheckScore() public void EndCheckScore()
{ {
GameTeam winner = null; GameTeam winner = null;
if (_redScore >= _victoryScore) if (_redScore >= _victoryScore)
winner = GetTeam(ChatColor.RED); winner = GetTeam(ChatColor.RED);
else if (_blueScore >= _victoryScore) else if (_blueScore >= _victoryScore)
@ -258,7 +269,7 @@ public class Dominate extends TeamGame
if (winner == null) if (winner == null)
return; return;
ScoreboardWrite(); ScoreboardWrite();
//Announce //Announce
@ -276,7 +287,7 @@ public class Dominate extends TeamGame
if (player.isOnline()) if (player.isOnline())
AddGems(player, 10, "Participation", false); AddGems(player, 10, "Participation", false);
} }
//End //End
SetState(GameState.End); SetState(GameState.End);
} }
@ -284,7 +295,7 @@ public class Dominate extends TeamGame
@Override @Override
public double GetKillsGems(Player killer, Player killed, boolean assist) public double GetKillsGems(Player killer, Player killed, boolean assist)
{ {
return 1; return 1;
} }
@Override @Override
@ -292,7 +303,7 @@ public class Dominate extends TeamGame
{ {
// NOTHING // NOTHING
} }
@EventHandler @EventHandler
public void InventoryLock(InventoryClickEvent event) public void InventoryLock(InventoryClickEvent event)
{ {
@ -302,4 +313,10 @@ public class Dominate extends TeamGame
event.getWhoClicked().closeInventory(); event.getWhoClicked().closeInventory();
} }
} }
@Override
public DeathMessageType GetDeathMessageType()
{
return DeathMessageType.Detailed;
}
} }

View File

@ -72,4 +72,10 @@ public class KitAssassin extends Kit
ent.getEquipment().setLeggings(new ItemStack(Material.LEATHER_LEGGINGS)); ent.getEquipment().setLeggings(new ItemStack(Material.LEATHER_LEGGINGS));
ent.getEquipment().setBoots(new ItemStack(Material.LEATHER_BOOTS)); ent.getEquipment().setBoots(new ItemStack(Material.LEATHER_BOOTS));
} }
@Override
public void DisplayDesc(Player player)
{
}
} }

View File

@ -72,4 +72,10 @@ public class KitBrute extends Kit
ent.getEquipment().setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS)); ent.getEquipment().setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));
ent.getEquipment().setBoots(new ItemStack(Material.DIAMOND_BOOTS)); ent.getEquipment().setBoots(new ItemStack(Material.DIAMOND_BOOTS));
} }
@Override
public void DisplayDesc(Player player)
{
}
} }

View File

@ -72,4 +72,10 @@ public class KitKnight extends Kit
ent.getEquipment().setLeggings(new ItemStack(Material.IRON_LEGGINGS)); ent.getEquipment().setLeggings(new ItemStack(Material.IRON_LEGGINGS));
ent.getEquipment().setBoots(new ItemStack(Material.IRON_BOOTS)); ent.getEquipment().setBoots(new ItemStack(Material.IRON_BOOTS));
} }
@Override
public void DisplayDesc(Player player)
{
}
} }

View File

@ -72,4 +72,10 @@ public class KitMage extends Kit
ent.getEquipment().setLeggings(new ItemStack(Material.GOLD_LEGGINGS)); ent.getEquipment().setLeggings(new ItemStack(Material.GOLD_LEGGINGS));
ent.getEquipment().setBoots(new ItemStack(Material.GOLD_BOOTS)); ent.getEquipment().setBoots(new ItemStack(Material.GOLD_BOOTS));
} }
@Override
public void DisplayDesc(Player player)
{
}
} }

View File

@ -72,4 +72,10 @@ public class KitRanger extends Kit
ent.getEquipment().setLeggings(new ItemStack(Material.CHAINMAIL_LEGGINGS)); ent.getEquipment().setLeggings(new ItemStack(Material.CHAINMAIL_LEGGINGS));
ent.getEquipment().setBoots(new ItemStack(Material.CHAINMAIL_BOOTS)); ent.getEquipment().setBoots(new ItemStack(Material.CHAINMAIL_BOOTS));
} }
@Override
public void DisplayDesc(Player player)
{
}
} }

View File

@ -71,6 +71,25 @@ public class CapturePoint
floor.setType(Material.WOOL); floor.setType(Material.WOOL);
_floor.add(floor); _floor.add(floor);
} }
else
{
Block block = loc.getBlock().getRelative(x, -1, z);
block.setType(Material.BEACON);
}
}
//Glass
if (Math.abs(x) <= 2 && Math.abs(z) <= 2)
{
Block block = loc.getBlock().getRelative(x, -1, z);
block.setType(Material.GLASS);
}
//Iron
if (Math.abs(x) <= 1 && Math.abs(z) <= 1)
{
Block block = loc.getBlock().getRelative(x, -3, z);
block.setType(Material.IRON_BLOCK);
} }
} }
} }

View File

@ -34,6 +34,7 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.event.player.PlayerRespawnEvent;
@ -260,6 +261,9 @@ public class GamePlayerManager implements Listener
@EventHandler @EventHandler
public void KitDamage(CustomDamageEvent event) public void KitDamage(CustomDamageEvent event)
{ {
if (event.GetCause() != DamageCause.ENTITY_ATTACK)
return;
Player player = event.GetDamagerPlayer(false); Player player = event.GetDamagerPlayer(false);
if (player == null) return; if (player == null) return;

View File

@ -7,10 +7,13 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import mineplex.core.common.util.UtilWorld;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.block.Sign;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.material.Wool; import org.bukkit.material.Wool;
@ -19,7 +22,7 @@ public class WorldParser
public void Parse(Player caller, String[] args) public void Parse(Player caller, String[] args)
{ {
HashSet<Integer> dataId = new HashSet<Integer>(); HashSet<Integer> dataId = new HashSet<Integer>();
if (args != null) if (args != null)
for (String arg : args) for (String arg : args)
{ {
@ -32,11 +35,11 @@ public class WorldParser
caller.sendMessage("Invalid Data ID: " + arg); caller.sendMessage("Invalid Data ID: " + arg);
} }
} }
HashMap<String, ArrayList<Location>> TeamLocs = new HashMap<String, ArrayList<Location>>(); HashMap<String, ArrayList<Location>> TeamLocs = new HashMap<String, ArrayList<Location>>();
HashMap<String, ArrayList<Location>> DataLocs = new HashMap<String, ArrayList<Location>>(); HashMap<String, ArrayList<Location>> DataLocs = new HashMap<String, ArrayList<Location>>();
HashMap<String, ArrayList<Location>> CustomLocs = new HashMap<String, ArrayList<Location>>(); HashMap<String, ArrayList<Location>> CustomLocs = new HashMap<String, ArrayList<Location>>();
Location cornerA = null; Location cornerA = null;
Location cornerB = null; Location cornerB = null;
@ -57,15 +60,45 @@ public class WorldParser
if (dataId.contains(block.getTypeId())) if (dataId.contains(block.getTypeId()))
{ {
String key = ""+block.getTypeId(); String key = ""+block.getTypeId();
if (!CustomLocs.containsKey(key)) if (!CustomLocs.containsKey(key))
CustomLocs.put(key, new ArrayList<Location>()); CustomLocs.put(key, new ArrayList<Location>());
CustomLocs.get(key).add(block.getLocation()); CustomLocs.get(key).add(block.getLocation());
continue; continue;
} }
//Sign Post > Spawns //Signs
if (block.getType() == Material.SIGN_POST || block.getType() == Material.WALL_SIGN)
{
if (block.getRelative(BlockFace.DOWN).getType() == Material.SPONGE)
{
Sign s = (Sign) block.getState();
String name = "";
try
{
name = s.getLine(0);
}
catch (Exception e)
{
caller.sendMessage("Invalid Sign Data: " + UtilWorld.locToStr(block.getLocation()));
}
//Add
if (!CustomLocs.containsKey(name))
CustomLocs.put(name, new ArrayList<Location>());
CustomLocs.get(name).add(block.getRelative(BlockFace.DOWN).getLocation());
//Remove Blocks
block.setTypeId(0);
block.getRelative(BlockFace.DOWN).setTypeId(0);
}
}
//Spawns
if (block.getTypeId() == 147) if (block.getTypeId() == 147)
{ {
Block wool = block.getRelative(BlockFace.DOWN); Block wool = block.getRelative(BlockFace.DOWN);
@ -78,200 +111,200 @@ public class WorldParser
{ {
if (!TeamLocs.containsKey("Red")) if (!TeamLocs.containsKey("Red"))
TeamLocs.put("Red", new ArrayList<Location>()); TeamLocs.put("Red", new ArrayList<Location>());
TeamLocs.get("Red").add(wool.getLocation()); TeamLocs.get("Red").add(wool.getLocation());
//Remove Blocks //Remove Blocks
block.setTypeId(0); block.setTypeId(0);
wool.setTypeId(0); wool.setTypeId(0);
} }
if (wool.getData() == 4) //RED > Spawn if (wool.getData() == 4) //RED > Spawn
{ {
if (!TeamLocs.containsKey("Yellow")) if (!TeamLocs.containsKey("Yellow"))
TeamLocs.put("Yellow", new ArrayList<Location>()); TeamLocs.put("Yellow", new ArrayList<Location>());
TeamLocs.get("Yellow").add(wool.getLocation()); TeamLocs.get("Yellow").add(wool.getLocation());
//Remove Blocks //Remove Blocks
block.setTypeId(0); block.setTypeId(0);
wool.setTypeId(0); wool.setTypeId(0);
} }
if (wool.getData() == 13) //RED > Spawn if (wool.getData() == 13) //RED > Spawn
{ {
if (!TeamLocs.containsKey("Green")) if (!TeamLocs.containsKey("Green"))
TeamLocs.put("Green", new ArrayList<Location>()); TeamLocs.put("Green", new ArrayList<Location>());
TeamLocs.get("Green").add(wool.getLocation()); TeamLocs.get("Green").add(wool.getLocation());
//Remove Blocks //Remove Blocks
block.setTypeId(0); block.setTypeId(0);
wool.setTypeId(0); wool.setTypeId(0);
} }
if (wool.getData() == 11) //RED > Spawn if (wool.getData() == 11) //RED > Spawn
{ {
if (!TeamLocs.containsKey("Blue")) if (!TeamLocs.containsKey("Blue"))
TeamLocs.put("Blue", new ArrayList<Location>()); TeamLocs.put("Blue", new ArrayList<Location>());
TeamLocs.get("Blue").add(wool.getLocation()); TeamLocs.get("Blue").add(wool.getLocation());
//Remove Blocks //Remove Blocks
block.setTypeId(0); block.setTypeId(0);
wool.setTypeId(0); wool.setTypeId(0);
} }
if (wool.getData() == 1) if (wool.getData() == 1)
{ {
if (!TeamLocs.containsKey("Orange")) if (!TeamLocs.containsKey("Orange"))
TeamLocs.put("Orange", new ArrayList<Location>()); TeamLocs.put("Orange", new ArrayList<Location>());
TeamLocs.get("Orange").add(wool.getLocation()); TeamLocs.get("Orange").add(wool.getLocation());
//Remove Blocks //Remove Blocks
block.setTypeId(0); block.setTypeId(0);
wool.setTypeId(0); wool.setTypeId(0);
} }
if (wool.getData() == 2) if (wool.getData() == 2)
{ {
if (!TeamLocs.containsKey("Magenta")) if (!TeamLocs.containsKey("Magenta"))
TeamLocs.put("Magenta", new ArrayList<Location>()); TeamLocs.put("Magenta", new ArrayList<Location>());
TeamLocs.get("Magenta").add(wool.getLocation()); TeamLocs.get("Magenta").add(wool.getLocation());
//Remove Blocks //Remove Blocks
block.setTypeId(0); block.setTypeId(0);
wool.setTypeId(0); wool.setTypeId(0);
} }
if (wool.getData() == 3) if (wool.getData() == 3)
{ {
if (!TeamLocs.containsKey("Sky")) if (!TeamLocs.containsKey("Sky"))
TeamLocs.put("Sky", new ArrayList<Location>()); TeamLocs.put("Sky", new ArrayList<Location>());
TeamLocs.get("Sky").add(wool.getLocation()); TeamLocs.get("Sky").add(wool.getLocation());
//Remove Blocks //Remove Blocks
block.setTypeId(0); block.setTypeId(0);
wool.setTypeId(0); wool.setTypeId(0);
} }
if (wool.getData() == 5) if (wool.getData() == 5)
{ {
if (!TeamLocs.containsKey("Lime")) if (!TeamLocs.containsKey("Lime"))
TeamLocs.put("Lime", new ArrayList<Location>()); TeamLocs.put("Lime", new ArrayList<Location>());
TeamLocs.get("Lime").add(wool.getLocation()); TeamLocs.get("Lime").add(wool.getLocation());
//Remove Blocks //Remove Blocks
block.setTypeId(0); block.setTypeId(0);
wool.setTypeId(0); wool.setTypeId(0);
} }
if (wool.getData() == 6) if (wool.getData() == 6)
{ {
if (!TeamLocs.containsKey("Pink")) if (!TeamLocs.containsKey("Pink"))
TeamLocs.put("Pink", new ArrayList<Location>()); TeamLocs.put("Pink", new ArrayList<Location>());
TeamLocs.get("Pink").add(wool.getLocation()); TeamLocs.get("Pink").add(wool.getLocation());
//Remove Blocks //Remove Blocks
block.setTypeId(0); block.setTypeId(0);
wool.setTypeId(0); wool.setTypeId(0);
} }
if (wool.getData() == 7) if (wool.getData() == 7)
{ {
if (!TeamLocs.containsKey("Gray")) if (!TeamLocs.containsKey("Gray"))
TeamLocs.put("Gray", new ArrayList<Location>()); TeamLocs.put("Gray", new ArrayList<Location>());
TeamLocs.get("Gray").add(wool.getLocation()); TeamLocs.get("Gray").add(wool.getLocation());
//Remove Blocks //Remove Blocks
block.setTypeId(0); block.setTypeId(0);
wool.setTypeId(0); wool.setTypeId(0);
} }
if (wool.getData() == 8) if (wool.getData() == 8)
{ {
if (!TeamLocs.containsKey("LGray")) if (!TeamLocs.containsKey("LGray"))
TeamLocs.put("LGray", new ArrayList<Location>()); TeamLocs.put("LGray", new ArrayList<Location>());
TeamLocs.get("LGray").add(wool.getLocation()); TeamLocs.get("LGray").add(wool.getLocation());
//Remove Blocks //Remove Blocks
block.setTypeId(0); block.setTypeId(0);
wool.setTypeId(0); wool.setTypeId(0);
} }
if (wool.getData() == 9) if (wool.getData() == 9)
{ {
if (!TeamLocs.containsKey("Cyan")) if (!TeamLocs.containsKey("Cyan"))
TeamLocs.put("Cyan", new ArrayList<Location>()); TeamLocs.put("Cyan", new ArrayList<Location>());
TeamLocs.get("Cyan").add(wool.getLocation()); TeamLocs.get("Cyan").add(wool.getLocation());
//Remove Blocks //Remove Blocks
block.setTypeId(0); block.setTypeId(0);
wool.setTypeId(0); wool.setTypeId(0);
} }
if (wool.getData() == 10) if (wool.getData() == 10)
{ {
if (!TeamLocs.containsKey("Purple")) if (!TeamLocs.containsKey("Purple"))
TeamLocs.put("Purple", new ArrayList<Location>()); TeamLocs.put("Purple", new ArrayList<Location>());
TeamLocs.get("Purple").add(wool.getLocation()); TeamLocs.get("Purple").add(wool.getLocation());
//Remove Blocks //Remove Blocks
block.setTypeId(0); block.setTypeId(0);
wool.setTypeId(0); wool.setTypeId(0);
} }
if (wool.getData() == 11) if (wool.getData() == 11)
{ {
if (!TeamLocs.containsKey("DBlue")) if (!TeamLocs.containsKey("DBlue"))
TeamLocs.put("DBlue", new ArrayList<Location>()); TeamLocs.put("DBlue", new ArrayList<Location>());
TeamLocs.get("DBlue").add(wool.getLocation()); TeamLocs.get("DBlue").add(wool.getLocation());
//Remove Blocks //Remove Blocks
block.setTypeId(0); block.setTypeId(0);
wool.setTypeId(0); wool.setTypeId(0);
} }
if (wool.getData() == 12) if (wool.getData() == 12)
{ {
if (!TeamLocs.containsKey("Brown")) if (!TeamLocs.containsKey("Brown"))
TeamLocs.put("Brown", new ArrayList<Location>()); TeamLocs.put("Brown", new ArrayList<Location>());
TeamLocs.get("Brown").add(wool.getLocation()); TeamLocs.get("Brown").add(wool.getLocation());
//Remove Blocks //Remove Blocks
block.setTypeId(0); block.setTypeId(0);
wool.setTypeId(0); wool.setTypeId(0);
} }
if (wool.getData() == 15) if (wool.getData() == 15)
{ {
if (!TeamLocs.containsKey("Black")) if (!TeamLocs.containsKey("Black"))
TeamLocs.put("Black", new ArrayList<Location>()); TeamLocs.put("Black", new ArrayList<Location>());
TeamLocs.get("Black").add(wool.getLocation()); TeamLocs.get("Black").add(wool.getLocation());
//Remove Blocks //Remove Blocks
block.setTypeId(0); block.setTypeId(0);
wool.setTypeId(0); wool.setTypeId(0);
} }
if (wool.getData() == 0) //WHITE > Corner if (wool.getData() == 0) //WHITE > Corner
{ {
if (cornerA == null) cornerA = wool.getLocation(); if (cornerA == null) cornerA = wool.getLocation();
else if (cornerB == null) cornerB = wool.getLocation(); else if (cornerB == null) cornerB = wool.getLocation();
else caller.sendMessage("More than 2 Corner Locations found!"); else caller.sendMessage("More than 2 Corner Locations found!");
//Remove Blocks //Remove Blocks
block.setTypeId(0); block.setTypeId(0);
wool.setTypeId(0); wool.setTypeId(0);
@ -288,16 +321,16 @@ public class WorldParser
if (wool.getType() != Material.WOOL) if (wool.getType() != Material.WOOL)
continue; continue;
Wool woolData = new Wool(wool.getType(), wool.getData()); Wool woolData = new Wool(wool.getType(), wool.getData());
String dataType = woolData.getColor().name(); String dataType = woolData.getColor().name();
if (!DataLocs.containsKey(dataType)) if (!DataLocs.containsKey(dataType))
DataLocs.put(dataType, new ArrayList<Location>()); DataLocs.put(dataType, new ArrayList<Location>());
DataLocs.get(dataType).add(wool.getLocation()); DataLocs.get(dataType).add(wool.getLocation());
//Remove Blocks //Remove Blocks
block.setTypeId(0); block.setTypeId(0);
wool.setTypeId(0); wool.setTypeId(0);
@ -341,7 +374,7 @@ public class WorldParser
out.write("\n"); out.write("\n");
out.write("MAX_Y:"+Math.max(cornerA.getBlockY(), cornerB.getBlockY())); out.write("MAX_Y:"+Math.max(cornerA.getBlockY(), cornerB.getBlockY()));
} }
//Teams //Teams
for (String team : TeamLocs.keySet()) for (String team : TeamLocs.keySet())
{ {
@ -351,7 +384,7 @@ public class WorldParser
out.write("\n"); out.write("\n");
out.write("TEAM_SPAWNS:" + LocationsToString(TeamLocs.get(team))); out.write("TEAM_SPAWNS:" + LocationsToString(TeamLocs.get(team)));
} }
//Data //Data
for (String data : DataLocs.keySet()) for (String data : DataLocs.keySet())
{ {
@ -371,7 +404,7 @@ public class WorldParser
out.write("\n"); out.write("\n");
out.write("CUSTOM_LOCS:" + LocationsToString(CustomLocs.get(data))); out.write("CUSTOM_LOCS:" + LocationsToString(CustomLocs.get(data)));
} }
out.close(); out.close();
} }
catch (Exception e) catch (Exception e)
@ -392,7 +425,7 @@ public class WorldParser
return out; return out;
} }
public String LocationSignsToString(HashMap<Location, String> locs) public String LocationSignsToString(HashMap<Location, String> locs)
{ {
String out = ""; String out = "";