fixed some errors ;o

This commit is contained in:
Chiss 2014-12-18 12:47:00 +11:00
parent 679f7909b0
commit 60f567a3fb
4 changed files with 132 additions and 4 deletions

View File

@ -0,0 +1,128 @@
package mineplex.core.blood;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class BloodEvent extends Event implements Cancellable
{
private static final HandlerList handlers = new HandlerList();
private boolean _cancelled = false;
private Player _player;
private Location _loc;
private int _particles;
private double _velMult;
private Sound _sound;
private float _soundVol;
private float _soundPitch;
private Material _type;
private byte _data;
private int _ticks;
private boolean _bloodStep;
public BloodEvent(Player player, Location loc, int particles, double velMult, Sound sound,
float soundVol, float soundPitch, Material type, byte data,
int ticks, boolean bloodStep)
{
_player = player;
_loc = loc;
_particles = particles;
_velMult = velMult;
_sound = sound;
_soundVol = soundVol;
_soundPitch = soundPitch;
_type = type;
_data = data;
_ticks = ticks;
_bloodStep = bloodStep;
}
@Override
public boolean isCancelled()
{
return _cancelled;
}
@Override
public void setCancelled(boolean var)
{
_cancelled = var;
}
public HandlerList getHandlers()
{
return handlers;
}
public static HandlerList getHandlerList()
{
return handlers;
}
public Player getPlayer()
{
return _player;
}
public Location getLocation()
{
return _loc;
}
public int getParticles()
{
return _particles;
}
public double getVelocityMult()
{
return _velMult;
}
public Sound getSound()
{
return _sound;
}
public float getSoundVolume()
{
return _soundVol;
}
public float getSoundPitch()
{
return _soundPitch;
}
public Material getMaterial()
{
return _type;
}
public byte getMaterialData()
{
return _data;
}
public int getTicks()
{
return _ticks;
}
public boolean getBloodStep()
{
return _bloodStep;
}
public void setItem(Material mat, byte data)
{
_type = mat;
_data = data;
}
}

View File

@ -73,7 +73,7 @@ public class PerkBoneExplosion extends Perk
UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + "."));
//Effect
Manager.GetBlood().Effects(player.getLocation().add(0, 0.5, 0), 48, 0.8, Sound.SKELETON_HURT, 2f, 1.2f, Material.BONE, (byte)0, 40, false);
Manager.GetBlood().Effects(null, player.getLocation().add(0, 0.5, 0), 48, 0.8, Sound.SKELETON_HURT, 2f, 1.2f, Material.BONE, (byte)0, 40, false);
}
@EventHandler

View File

@ -310,7 +310,7 @@ public class PerkSlimeRocket extends Perk implements IThrown
{
slime.setTicksLived(1);
Manager.GetBlood().Effects(slime.getLocation(), 6 + 6 * slime.getSize(), 0.2 + 0.1 * slime.getSize(), null, 1f, 1f, Material.SLIME_BALL, (byte)0, 15, false);
Manager.GetBlood().Effects(null, slime.getLocation(), 6 + 6 * slime.getSize(), 0.2 + 0.1 * slime.getSize(), null, 1f, 1f, Material.SLIME_BALL, (byte)0, 15, false);
if (slime.getSize() <= 1)
slime.remove();

View File

@ -159,7 +159,7 @@ public class PerkWitherImage extends Perk
if (!player.isValid() || !skel.isValid() || skel.getTicksLived() > 160)
{
//Effect
Manager.GetBlood().Effects(skel.getLocation().add(0, 0.5, 0), 12, 0.3, Sound.WITHER_HURT, 1f, 0.75f, Material.BONE, (byte)0, 40, false);
Manager.GetBlood().Effects(null, skel.getLocation().add(0, 0.5, 0), 12, 0.3, Sound.WITHER_HURT, 1f, 0.75f, Material.BONE, (byte)0, 40, false);
playerIterator.remove();
skel.remove();
@ -176,7 +176,7 @@ public class PerkWitherImage extends Perk
if (skel != null)
{
//Effect
Manager.GetBlood().Effects(skel.getLocation().add(0, 0.5, 0), 12, 0.3, Sound.WITHER_HURT, 1f, 0.75f, Material.BONE, (byte)0, 40, false);
Manager.GetBlood().Effects(null, skel.getLocation().add(0, 0.5, 0), 12, 0.3, Sound.WITHER_HURT, 1f, 0.75f, Material.BONE, (byte)0, 40, false);
skel.remove();
}