- Fixed proximity weapons not being able to detonate

This commit is contained in:
AlexTheCoder 2015-11-05 02:11:20 -05:00
parent 9c49ab0408
commit 61653347c7
5 changed files with 27 additions and 5 deletions

View File

@ -10,6 +10,7 @@ import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import org.bukkit.Bukkit;
import org.bukkit.Effect;
import org.bukkit.Sound;
import org.bukkit.entity.Entity;

View File

@ -16,6 +16,7 @@ import net.minecraft.server.v1_7_R4.MathHelper;
import net.minecraft.server.v1_7_R4.MovingObjectPosition;
import net.minecraft.server.v1_7_R4.Vec3D;
import org.bukkit.Bukkit;
import org.bukkit.Effect;
import org.bukkit.GameMode;
import org.bukkit.Sound;
@ -77,7 +78,7 @@ public class ProjectileUser
_thrower = thrower;
_callback = callback;
_expireTime = expireTime;
_expireTime = expireTime - System.currentTimeMillis();
_startTime = System.currentTimeMillis();
_hitPlayer = hitPlayer;
@ -116,7 +117,7 @@ public class ProjectileUser
_thrower = thrower;
_callback = callback;
_expireTime = expireTime;
_expireTime = expireTime - System.currentTimeMillis();
_startTime = System.currentTimeMillis();
_hitPlayer = hitPlayer;

View File

@ -69,13 +69,23 @@ public class ProximityExplosive extends ItemUsable
@Override
public void Collide(LivingEntity target, Block block, ProjectileUser data)
{
//Arm
_armed.put(data.GetThrown(), data.GetThrower());
//Effect
data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 7);
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f);
}
@Override
public void Idle(ProjectileUser data)
{
//Arm
_armed.put(data.GetThrown(), data.GetThrower());
//Effect
data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 7);
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f);
}
@Override

View File

@ -66,13 +66,23 @@ public class ProximityZapper extends ItemUsable
@Override
public void Collide(LivingEntity target, Block block, ProjectileUser data)
{
//Arm
_armed.put(data.GetThrown(), data.GetThrower());
//Effect
data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 7);
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f);
}
@Override
public void Idle(ProjectileUser data)
{
//Arm
_armed.put(data.GetThrown(), data.GetThrower());
//Effect
data.GetThrown().getWorld().playEffect(data.GetThrown().getLocation(), Effect.STEP_SOUND, 7);
data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.NOTE_PLING, 0.5f, 2f);
}
@Override

View File

@ -579,7 +579,7 @@ public class TurfForts extends TeamGame
@EventHandler(ignoreCancelled = true)
public void onSpawn(PlayerKitGiveEvent event)
{
Player player = event.GetPlayer();
Player player = event.getPlayer();
if (this.playersThatNeedBlocks.contains(player.getUniqueId()))
{
this.playersThatNeedBlocks.remove(player.getUniqueId());