Fixed bug with Projectile
Changed tp out of game to 1 per tick.
This commit is contained in:
parent
830eeca835
commit
1398543490
@ -112,11 +112,11 @@ public class RopedArrow extends SkillActive
|
|||||||
int level = getLevel(((Player)proj.getShooter()));
|
int level = getLevel(((Player)proj.getShooter()));
|
||||||
if (level == 0) return;
|
if (level == 0) return;
|
||||||
|
|
||||||
Vector vec = UtilAlg.getTrajectory(proj.getShooter(), proj);
|
Vector vec = UtilAlg.getTrajectory((Entity)proj.getShooter(), proj);
|
||||||
double mult = (proj.getVelocity().length() / 3d);
|
double mult = (proj.getVelocity().length() / 3d);
|
||||||
|
|
||||||
//Action
|
//Action
|
||||||
UtilAction.velocity(proj.getShooter(), vec,
|
UtilAction.velocity((Entity)proj.getShooter(), vec,
|
||||||
0.4 + mult, false, 0, 0.3 * mult, 1.2 * mult, true);
|
0.4 + mult, false, 0, 0.3 * mult, 1.2 * mult, true);
|
||||||
|
|
||||||
//Effect
|
//Effect
|
||||||
|
@ -83,7 +83,7 @@ public class Sharpshooter extends Skill
|
|||||||
_hitCount.put(player, limit);
|
_hitCount.put(player, limit);
|
||||||
|
|
||||||
//Inform
|
//Inform
|
||||||
UtilPlayer.message(projectile.getShooter(), F.main(GetClassType().name(), GetName() + ": " +
|
UtilPlayer.message((Entity)projectile.getShooter(), F.main(GetClassType().name(), GetName() + ": " +
|
||||||
F.elem(_hitCount.get(player) + " Consecutive Hits") + C.cGray + " (" + F.skill("+"+ (limit * 2) + "Damage" ) + C.cGray + ")" ) );
|
F.elem(_hitCount.get(player) + " Consecutive Hits") + C.cGray + " (" + F.skill("+"+ (limit * 2) + "Damage" ) + C.cGray + ")" ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -14,6 +14,7 @@ public class ItemSalesPackage extends SalesPackageBase
|
|||||||
super("Champions " + item.GetName(), Material.BOOK, (byte)0, item.GetDesc(), item.GetGemCost());
|
super("Champions " + item.GetName(), Material.BOOK, (byte)0, item.GetDesc(), item.GetGemCost());
|
||||||
Free = item.isFree();
|
Free = item.isFree();
|
||||||
KnownPackage = false;
|
KnownPackage = false;
|
||||||
|
CurrencyCostMap.put(CurrencyType.Gems, item.GetGemCost());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -2,15 +2,55 @@ package org.bukkit.entity;
|
|||||||
|
|
||||||
import org.bukkit.projectiles.ProjectileSource;
|
import org.bukkit.projectiles.ProjectileSource;
|
||||||
|
|
||||||
public abstract interface Projectile extends Entity
|
/**
|
||||||
{
|
* Represents a shootable entity.
|
||||||
|
*/
|
||||||
|
public interface Projectile extends Entity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method exists for legacy reasons to provide backwards
|
||||||
|
* compatibility. It will not exist at runtime and should not be used
|
||||||
|
* under any circumstances.
|
||||||
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public abstract LivingEntity getShooter();
|
public LivingEntity _INVALID_getShooter();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the shooter of this projectile.
|
||||||
|
*
|
||||||
|
* @return the {@link ProjectileSource} that shot this projectile
|
||||||
|
*/
|
||||||
|
public ProjectileSource getShooter();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method exists for legacy reasons to provide backwards
|
||||||
|
* compatibility. It will not exist at runtime and should not be used
|
||||||
|
* under any circumstances.
|
||||||
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public abstract void setShooter(LivingEntity paramLivingEntity);
|
public void _INVALID_setShooter(LivingEntity shooter);
|
||||||
|
|
||||||
public abstract boolean doesBounce();
|
/**
|
||||||
|
* Set the shooter of this projectile.
|
||||||
|
*
|
||||||
|
* @param source the {@link ProjectileSource} that shot this projectile
|
||||||
|
*/
|
||||||
|
public void setShooter(ProjectileSource source);
|
||||||
|
|
||||||
public abstract void setBounce(boolean paramBoolean);
|
/**
|
||||||
|
* Determine if this projectile should bounce or not when it hits.
|
||||||
|
* <p>
|
||||||
|
* If a small fireball does not bounce it will set the target on fire.
|
||||||
|
*
|
||||||
|
* @return true if it should bounce.
|
||||||
|
*/
|
||||||
|
public boolean doesBounce();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set whether or not this projectile should bounce or not when it hits
|
||||||
|
* something.
|
||||||
|
*
|
||||||
|
* @param doesBounce whether or not it should bounce.
|
||||||
|
*/
|
||||||
|
public void setBounce(boolean doesBounce);
|
||||||
}
|
}
|
@ -810,13 +810,6 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void TeleportLog(PlayerTeleportEvent event)
|
|
||||||
{
|
|
||||||
System.out.println("Teleporting: " + event.getPlayer().getName() + " to "
|
|
||||||
+ event.getTo().getWorld().getWorldFolder().getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
public InventoryManager getInventoryManager()
|
public InventoryManager getInventoryManager()
|
||||||
{
|
{
|
||||||
return _inventoryManager;
|
return _inventoryManager;
|
||||||
|
@ -647,7 +647,7 @@ public class CastleSiege extends TeamGame
|
|||||||
int damage = (int) (5 * (event.getEntity().getVelocity().length() / 3d));
|
int damage = (int) (5 * (event.getEntity().getVelocity().length() / 3d));
|
||||||
|
|
||||||
//Damage Event
|
//Damage Event
|
||||||
Manager.GetDamage().NewDamageEvent(player, event.getEntity().getShooter(), event.getEntity(),
|
Manager.GetDamage().NewDamageEvent(player, (LivingEntity)event.getEntity().getShooter(), event.getEntity(),
|
||||||
DamageCause.CUSTOM, damage, true, false, false,
|
DamageCause.CUSTOM, damage, true, false, false,
|
||||||
null, GetName());
|
null, GetName());
|
||||||
|
|
||||||
|
@ -14,7 +14,9 @@ import org.bukkit.FireworkEffect.Type;
|
|||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftFallingSand;
|
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftFallingSand;
|
||||||
import org.bukkit.entity.Arrow;
|
import org.bukkit.entity.Arrow;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.FallingBlock;
|
import org.bukkit.entity.FallingBlock;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Projectile;
|
import org.bukkit.entity.Projectile;
|
||||||
import org.bukkit.entity.Slime;
|
import org.bukkit.entity.Slime;
|
||||||
@ -568,9 +570,9 @@ public class Gravity extends SoloGame
|
|||||||
if (obj.Ent instanceof Player)
|
if (obj.Ent instanceof Player)
|
||||||
{
|
{
|
||||||
//Damage Event
|
//Damage Event
|
||||||
Manager.GetDamage().NewDamageEvent((Player)obj.Ent, proj.getShooter(), null,
|
Manager.GetDamage().NewDamageEvent((Player)obj.Ent, (LivingEntity)proj.getShooter(), null,
|
||||||
DamageCause.CUSTOM, 1, false, true, true,
|
DamageCause.CUSTOM, 1, false, true, true,
|
||||||
UtilEnt.getName(proj.getShooter()), "Sonic Blast");
|
UtilEnt.getName((Entity)proj.getShooter()), "Sonic Blast");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -479,7 +479,7 @@ public class HideSeek extends TeamGame
|
|||||||
if (eventEE.getDamager() instanceof Projectile)
|
if (eventEE.getDamager() instanceof Projectile)
|
||||||
{
|
{
|
||||||
proj = (Projectile)eventEE.getDamager();
|
proj = (Projectile)eventEE.getDamager();
|
||||||
damager = proj.getShooter();
|
damager = (LivingEntity)proj.getShooter();
|
||||||
}
|
}
|
||||||
else if (eventEE.getDamager() instanceof LivingEntity)
|
else if (eventEE.getDamager() instanceof LivingEntity)
|
||||||
{
|
{
|
||||||
|
@ -3,6 +3,7 @@ package nautilus.game.arcade.game.games.runner.kits;
|
|||||||
import org.bukkit.EntityEffect;
|
import org.bukkit.EntityEffect;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Snowball;
|
import org.bukkit.entity.Snowball;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -52,6 +53,6 @@ public class KitFrosty extends Kit
|
|||||||
|
|
||||||
event.GetDamageeEntity().playEffect(EntityEffect.HURT);
|
event.GetDamageeEntity().playEffect(EntityEffect.HURT);
|
||||||
|
|
||||||
Manager.GetCondition().Factory().Slow("Snowball Slow", event.GetDamageeEntity(), event.GetProjectile().getShooter(), 2, 1, false, false, true, false);
|
Manager.GetCondition().Factory().Slow("Snowball Slow", event.GetDamageeEntity(), (LivingEntity)event.GetProjectile().getShooter(), 2, 1, false, false, true, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import java.util.HashMap;
|
|||||||
|
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Egg;
|
import org.bukkit.entity.Egg;
|
||||||
|
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.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
@ -118,9 +119,9 @@ public class PerkEggGun extends Perk
|
|||||||
Egg egg = (Egg)event.GetProjectile();
|
Egg egg = (Egg)event.GetProjectile();
|
||||||
|
|
||||||
//Damage Event
|
//Damage Event
|
||||||
Manager.GetDamage().NewDamageEvent(event.GetDamageeEntity(), egg.getShooter(), egg,
|
Manager.GetDamage().NewDamageEvent(event.GetDamageeEntity(), (LivingEntity)egg.getShooter(), egg,
|
||||||
DamageCause.PROJECTILE, 1, true, true, false,
|
DamageCause.PROJECTILE, 1, true, true, false,
|
||||||
UtilEnt.getName(egg.getShooter()), GetName());
|
UtilEnt.getName((LivingEntity)egg.getShooter()), GetName());
|
||||||
|
|
||||||
event.GetDamageeEntity().setVelocity(new Vector(0,0,0));
|
event.GetDamageeEntity().setVelocity(new Vector(0,0,0));
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.entity.Arrow;
|
import org.bukkit.entity.Arrow;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Projectile;
|
import org.bukkit.entity.Projectile;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -89,11 +90,11 @@ public class PerkRopedArrow extends Perk
|
|||||||
if (!(proj.getShooter() instanceof Player))
|
if (!(proj.getShooter() instanceof Player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Vector vec = UtilAlg.getTrajectory(proj.getShooter(), proj);
|
Vector vec = UtilAlg.getTrajectory((LivingEntity)proj.getShooter(), proj);
|
||||||
double mult = (proj.getVelocity().length() / 3d);
|
double mult = (proj.getVelocity().length() / 3d);
|
||||||
|
|
||||||
//Action
|
//Action
|
||||||
UtilAction.velocity(proj.getShooter(), vec,
|
UtilAction.velocity((LivingEntity)proj.getShooter(), vec,
|
||||||
0.4 + mult * _power, false, 0, 0.6 * mult * _power, 1.2 * mult * _power, true);
|
0.4 + mult * _power, false, 0, 0.6 * mult * _power, 1.2 * mult * _power, true);
|
||||||
|
|
||||||
//Effect
|
//Effect
|
||||||
|
@ -3,6 +3,7 @@ package nautilus.game.arcade.kit.perks;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Projectile;
|
import org.bukkit.entity.Projectile;
|
||||||
import org.bukkit.entity.ThrownPotion;
|
import org.bukkit.entity.ThrownPotion;
|
||||||
@ -25,7 +26,6 @@ import mineplex.core.recharge.Recharge;
|
|||||||
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.damage.CustomDamageEvent;
|
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||||
|
|
||||||
import nautilus.game.arcade.kit.Perk;
|
import nautilus.game.arcade.kit.Perk;
|
||||||
|
|
||||||
public class PerkWitchPotion extends Perk
|
public class PerkWitchPotion extends Perk
|
||||||
@ -89,9 +89,9 @@ public class PerkWitchPotion extends Perk
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
//Damage Event
|
//Damage Event
|
||||||
Manager.GetDamage().NewDamageEvent(player, event.getEntity().getShooter(), null,
|
Manager.GetDamage().NewDamageEvent(player, (LivingEntity)event.getEntity().getShooter(), null,
|
||||||
DamageCause.CUSTOM, 5, true, true, false,
|
DamageCause.CUSTOM, 5, true, true, false,
|
||||||
UtilEnt.getName(event.getEntity().getShooter()), GetName());
|
UtilEnt.getName((LivingEntity)event.getEntity().getShooter()), GetName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ public class PerkWitherSkull extends Perk
|
|||||||
|
|
||||||
WitherSkull skull = (WitherSkull)event.getEntity();
|
WitherSkull skull = (WitherSkull)event.getEntity();
|
||||||
|
|
||||||
Explode(skull, event.getLocation(), skull.getShooter());
|
Explode(skull, event.getLocation(), (LivingEntity)skull.getShooter());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
|
@ -590,7 +590,7 @@ public class GameManager implements Listener
|
|||||||
player.leaveVehicle();
|
player.leaveVehicle();
|
||||||
player.teleport(Manager.GetLobby().GetSpawn());
|
player.teleport(Manager.GetLobby().GetSpawn());
|
||||||
}
|
}
|
||||||
}, i*3);
|
}, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user