1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-08 07:36:42 +02:00

Whoops, we shouldn't be leaking the user object.

This commit is contained in:
KHobbits
2013-07-07 11:40:20 +01:00
parent 817174e18f
commit 3f5e2ad85a
4 changed files with 3 additions and 8 deletions

View File

@@ -91,11 +91,6 @@ public enum Mob
return Collections.unmodifiableSet(hashMap.keySet()); 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 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()); final Entity entity = world.spawn(loc, (Class<? extends Entity>)this.bukkitType.getEntityClass());

View File

@@ -39,7 +39,7 @@ public class Commandfeed extends EssentialsCommand
} }
try try
{ {
feedPlayer(user, user); feedPlayer(user, user.getBase());
} }
catch (QuietAbortException e) catch (QuietAbortException e)
{ {

View File

@@ -40,7 +40,7 @@ public class Commandheal extends EssentialsCommand
{ {
user.healCooldown(); user.healCooldown();
} }
healPlayer(user); healPlayer(user.getBase());
} }
@Override @Override

View File

@@ -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 protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{ {
final Mob cat = Mob.OCELOT; 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) if (ocelot == null)
{ {
return; return;