mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-23 17:47:34 +01:00
Whoops, we shouldn't be leaking the user object.
This commit is contained in:
parent
817174e18f
commit
3f5e2ad85a
@ -91,11 +91,6 @@ public enum Mob
|
||||
return Collections.unmodifiableSet(hashMap.keySet());
|
||||
}
|
||||
|
||||
public Entity spawn(final Player player, final Server server, final Location loc) throws MobException
|
||||
{
|
||||
return spawn(player.getWorld(), server, loc);
|
||||
}
|
||||
|
||||
public Entity spawn(final World world, final Server server, final Location loc) throws MobException
|
||||
{
|
||||
final Entity entity = world.spawn(loc, (Class<? extends Entity>)this.bukkitType.getEntityClass());
|
||||
|
@ -39,7 +39,7 @@ public class Commandfeed extends EssentialsCommand
|
||||
}
|
||||
try
|
||||
{
|
||||
feedPlayer(user, user);
|
||||
feedPlayer(user, user.getBase());
|
||||
}
|
||||
catch (QuietAbortException e)
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ public class Commandheal extends EssentialsCommand
|
||||
{
|
||||
user.healCooldown();
|
||||
}
|
||||
healPlayer(user);
|
||||
healPlayer(user.getBase());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,7 +21,7 @@ public class Commandkittycannon extends EssentialsCommand
|
||||
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
final Mob cat = Mob.OCELOT;
|
||||
final Ocelot ocelot = (Ocelot)cat.spawn(user, server, user.getEyeLocation());
|
||||
final Ocelot ocelot = (Ocelot)cat.spawn(user.getWorld(), server, user.getEyeLocation());
|
||||
if (ocelot == null)
|
||||
{
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user