made recharge look nicer for 1.7

added missing files
This commit is contained in:
Chiss 2014-11-29 09:14:33 +11:00
parent ca34ac4e02
commit b3beadf8b5
8 changed files with 198 additions and 6 deletions

View File

@ -55,10 +55,10 @@ public class UtilTextBottom
//Send to Player
for (Player player : players)
{
//1.7
//1.7 - Add Color
if (!UtilPlayer.is1_8(player))
{
UtilTextTop.displayProgress((prefix == null ? "" : prefix) + (suffix == null ? "" : ChatColor.RESET + C.Bold + " - " + ChatColor.RESET + suffix),
UtilTextTop.displayProgress((prefix == null ? "" : C.cYellow + C.Bold + prefix) + (suffix == null ? "" : ChatColor.RESET + C.Bold + " - " + C.cGreen + C.Bold + suffix),
amount, player);
}
//1.8

View File

@ -22,7 +22,7 @@ public class BenefitManager extends MiniDbClientPlugin<BenefitData>
private BenefitManagerRepository _repository;
private List<BenefitBase> _benefits = new ArrayList<BenefitBase>();
public BenefitManager(JavaPlugin plugin, CoreClientManager clientManager, InventoryManager inventoryManager)
{
super("Benefit Manager", plugin, clientManager);

View File

@ -10,7 +10,7 @@ public class HereCommand extends CommandBase<Teleport>
{
public HereCommand(Teleport plugin)
{
super(plugin, Rank.ADMIN, "here", "h");
super(plugin, Rank.ADMIN, "here", "h");
}
@Override

View File

@ -0,0 +1,52 @@
package mineplex.core.teleport.event;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class MineplexTeleportEvent extends Event
{
private static final HandlerList handlers = new HandlerList();
private Player _entity;
private Location _loc;
private boolean _cancelled = false;
public MineplexTeleportEvent(Player entity, Location loc)
{
_entity = entity;
_loc = loc;
}
public HandlerList getHandlers()
{
return handlers;
}
public static HandlerList getHandlerList()
{
return handlers;
}
public Player getPlayer()
{
return _entity;
}
public Location getLocation()
{
return _loc;
}
public void setCancelled(boolean cancel)
{
_cancelled = cancel;
}
public boolean isCancelled()
{
return _cancelled;
}
}

View File

@ -0,0 +1,133 @@
package mineplex.minecraft.game.classcombat.Skill.Brute;
import java.util.HashMap;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.core.common.util.F;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.minecraft.game.classcombat.Skill.SkillActive;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
public class Taunt extends SkillActive
{
private HashMap<LivingEntity, Long> _live = new HashMap<LivingEntity, Long>();
public Taunt(SkillFactory skills, String name, ClassType classType, SkillType skillType,
int cost, int levels,
int energy, int energyMod,
long recharge, long rechargeMod, boolean rechargeInform,
Material[] itemArray,
Action[] actionArray)
{
super(skills, name, classType, skillType,
cost, levels,
energy, energyMod,
recharge, rechargeMod, rechargeInform,
itemArray,
actionArray);
SetDesc(new String[]
{
"Shout a taunt that forces all",
"enemies within #6#0 blocks to",
"run towards you for #1.5#0.5 seconds."
});
this.setAchievementSkill(true);
}
@Override
public boolean CustomCheck(Player player, int level)
{
if (player.getLocation().getBlock().getTypeId() == 8 || player.getLocation().getBlock().getTypeId() == 9)
{
UtilPlayer.message(player, F.main("Skill", "You cannot use " + F.skill(GetName()) + " in water."));
return false;
}
return true;
}
@Override
public void Skill(Player player, int level)
{
//Record
_live.put(player, System.currentTimeMillis());
//Inform
UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + "."));
}
@EventHandler
public void End(UpdateEvent event)
{
if (event.getType() != UpdateType.FASTEST)
return;
//End
for (Player player : GetUsers())
{
if (!UtilEnt.isGrounded(player))
continue;
if (!_live.containsKey(player))
continue;
int level = getLevel(player);
if (level == 0) continue;
if (!UtilTime.elapsed(_live.get(player), 1500 + 500*level))
continue;
_live.remove(player);
}
//Collide
for (Player player : GetUsers())
if (_live.containsKey(player))
for (Player other : player.getWorld().getPlayers())
if (other.getGameMode() == GameMode.SURVIVAL)
if (!other.equals(player))
if (Factory.Relation().CanHurt(player, other))
if (UtilMath.offset(player, other) < 7 && UtilMath.offset(player, other) > 2)
{
UtilAction.velocity(other, UtilAlg.getTrajectory(other, player), 0.4, false, 0, 0, 0.4, false);
}
}
@EventHandler
public void Particle(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Entity ent : _live.keySet())
{
UtilParticle.PlayParticle(ParticleType.ENCHANTMENT_TABLE, ent.getLocation().add(0, 2, 0),
0, 0, 0, 6f, 8);
}
}
@Override
public void Reset(Player player)
{
_live.remove(player);
}
}

View File

@ -267,6 +267,13 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
30000, -3000, true,
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
AddSkill(new Taunt(this, "Battle Taunt", ClassType.Brute, SkillType.Axe,
1, 5,
0, 0,
30000, -2000, true,
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
//Passive A
AddSkill(new Stampede(this, "Stampede", ClassType.Brute, SkillType.PassiveA, 1, 3));

View File

@ -48,7 +48,7 @@ public class ClassShopManager extends MiniPlugin
public boolean hasAchievements(Player player)
{
if (_clientManager.Get(player).GetRank().Has(Rank.MODERATOR))
if (_clientManager.Get(player).GetRank().Has(Rank.HELPER))
return true;
return _achievementManager.hasCategory(player, new Achievement[]

View File

@ -868,7 +868,7 @@ public class GameFlagManager implements Listener
}
}
}
}
}
@EventHandler(priority = EventPriority.MONITOR)
public void StaffDisqualify(MineplexTeleportEvent event)