Fixed bug with Projectile

Changed tp out of game to 1 per tick.
This commit is contained in:
Jonathan Williams 2014-08-21 02:07:54 -05:00
parent 830eeca835
commit 1398543490
14 changed files with 70 additions and 31 deletions

View File

@ -112,11 +112,11 @@ public class RopedArrow extends SkillActive
int level = getLevel(((Player)proj.getShooter()));
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);
//Action
UtilAction.velocity(proj.getShooter(), vec,
UtilAction.velocity((Entity)proj.getShooter(), vec,
0.4 + mult, false, 0, 0.3 * mult, 1.2 * mult, true);
//Effect

View File

@ -83,7 +83,7 @@ public class Sharpshooter extends Skill
_hitCount.put(player, limit);
//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 + ")" ) );
}
else

View File

@ -14,6 +14,7 @@ public class ItemSalesPackage extends SalesPackageBase
super("Champions " + item.GetName(), Material.BOOK, (byte)0, item.GetDesc(), item.GetGemCost());
Free = item.isFree();
KnownPackage = false;
CurrencyCostMap.put(CurrencyType.Gems, item.GetGemCost());
}
@Override

View File

@ -2,15 +2,55 @@ package org.bukkit.entity;
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
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
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);
}

View File

@ -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()
{
return _inventoryManager;

View File

@ -647,7 +647,7 @@ public class CastleSiege extends TeamGame
int damage = (int) (5 * (event.getEntity().getVelocity().length() / 3d));
//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,
null, GetName());

View File

@ -14,7 +14,9 @@ import org.bukkit.FireworkEffect.Type;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftFallingSand;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.FallingBlock;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.Slime;
@ -568,9 +570,9 @@ public class Gravity extends SoloGame
if (obj.Ent instanceof Player)
{
//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,
UtilEnt.getName(proj.getShooter()), "Sonic Blast");
UtilEnt.getName((Entity)proj.getShooter()), "Sonic Blast");
}

View File

@ -479,7 +479,7 @@ public class HideSeek extends TeamGame
if (eventEE.getDamager() instanceof Projectile)
{
proj = (Projectile)eventEE.getDamager();
damager = proj.getShooter();
damager = (LivingEntity)proj.getShooter();
}
else if (eventEE.getDamager() instanceof LivingEntity)
{

View File

@ -3,6 +3,7 @@ package nautilus.game.arcade.game.games.runner.kits;
import org.bukkit.EntityEffect;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Snowball;
import org.bukkit.event.EventHandler;
@ -52,6 +53,6 @@ public class KitFrosty extends Kit
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);
}
}

View File

@ -4,6 +4,7 @@ import java.util.HashMap;
import org.bukkit.Sound;
import org.bukkit.entity.Egg;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
@ -118,9 +119,9 @@ public class PerkEggGun extends Perk
Egg egg = (Egg)event.GetProjectile();
//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,
UtilEnt.getName(egg.getShooter()), GetName());
UtilEnt.getName((LivingEntity)egg.getShooter()), GetName());
event.GetDamageeEntity().setVelocity(new Vector(0,0,0));
}

View File

@ -7,6 +7,7 @@ import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.event.EventHandler;
@ -89,11 +90,11 @@ public class PerkRopedArrow extends Perk
if (!(proj.getShooter() instanceof Player))
return;
Vector vec = UtilAlg.getTrajectory(proj.getShooter(), proj);
Vector vec = UtilAlg.getTrajectory((LivingEntity)proj.getShooter(), proj);
double mult = (proj.getVelocity().length() / 3d);
//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);
//Effect

View File

@ -3,6 +3,7 @@ package nautilus.game.arcade.kit.perks;
import java.util.ArrayList;
import java.util.Iterator;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.ThrownPotion;
@ -25,7 +26,6 @@ import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.Perk;
public class PerkWitchPotion extends Perk
@ -89,9 +89,9 @@ public class PerkWitchPotion extends Perk
continue;
//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,
UtilEnt.getName(event.getEntity().getShooter()), GetName());
UtilEnt.getName((LivingEntity)event.getEntity().getShooter()), GetName());
}
}

View File

@ -132,7 +132,7 @@ public class PerkWitherSkull extends Perk
WitherSkull skull = (WitherSkull)event.getEntity();
Explode(skull, event.getLocation(), skull.getShooter());
Explode(skull, event.getLocation(), (LivingEntity)skull.getShooter());
}
@EventHandler(priority = EventPriority.LOWEST)

View File

@ -590,7 +590,7 @@ public class GameManager implements Listener
player.leaveVehicle();
player.teleport(Manager.GetLobby().GetSpawn());
}
}, i*3);
}, i);
}
}