[Brute/BlockToss] Increase recharge time and fix the held block hitbox blocking the holder from getting attacked. [PC-338]

This commit is contained in:
Ben 2016-05-21 00:22:57 +01:00
parent 55b0ed8eb5
commit b1933eddc7

View File

@ -9,35 +9,36 @@ import org.bukkit.Effect;
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.entity.Entity;
import org.bukkit.entity.FallingBlock; import org.bukkit.entity.FallingBlock;
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;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityChangeBlockEvent; import org.bukkit.event.entity.EntityChangeBlockEvent;
import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.classcombat.Skill.SkillCharge; import mineplex.minecraft.game.classcombat.Skill.SkillCharge;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import mineplex.minecraft.game.classcombat.Skill.event.BlockTossEvent;
import mineplex.minecraft.game.classcombat.Skill.event.BlockTossExpireEvent; import mineplex.minecraft.game.classcombat.Skill.event.BlockTossExpireEvent;
import mineplex.minecraft.game.classcombat.Skill.event.BlockTossLandEvent; import mineplex.minecraft.game.classcombat.Skill.event.BlockTossLandEvent;
import mineplex.minecraft.game.classcombat.Skill.event.SkillEvent; import mineplex.minecraft.game.classcombat.Skill.event.SkillEvent;
@ -91,7 +92,7 @@ public class BlockToss extends SkillCharge implements IThrown
@Override @Override
public String GetRechargeString() public String GetRechargeString()
{ {
return "Recharge: " + "#4#-0.5 Seconds"; return "Recharge: " + "#5.5#-0.5 Seconds";
} }
@EventHandler @EventHandler
@ -194,7 +195,22 @@ public class BlockToss extends SkillCharge implements IThrown
//Effect //Effect
player.getWorld().playEffect(event.getClickedBlock().getLocation(), Effect.STEP_SOUND, block.getMaterial().getId()); player.getWorld().playEffect(event.getClickedBlock().getLocation(), Effect.STEP_SOUND, block.getMaterial().getId());
} }
@EventHandler
public void Damage(EntityDamageByEntityEvent event)
{
Entity entity = event.getEntity();
if (entity.getVehicle() != null && _holding.containsKey(entity.getVehicle()))
{
Player attacker = (Player) event.getDamager();
//Forward Damage
Factory.Damage().NewDamageEvent((Player) entity.getVehicle(), attacker, Factory.Damage().GetProjectile(event),
event.getCause(), event.getDamage(), true, false, false, null, null, event.isCancelled());
}
}
@EventHandler @EventHandler
public void Throw(UpdateEvent event) public void Throw(UpdateEvent event)
{ {