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:
@@ -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());
|
||||||
|
@@ -39,7 +39,7 @@ public class Commandfeed extends EssentialsCommand
|
|||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
feedPlayer(user, user);
|
feedPlayer(user, user.getBase());
|
||||||
}
|
}
|
||||||
catch (QuietAbortException e)
|
catch (QuietAbortException e)
|
||||||
{
|
{
|
||||||
|
@@ -40,7 +40,7 @@ public class Commandheal extends EssentialsCommand
|
|||||||
{
|
{
|
||||||
user.healCooldown();
|
user.healCooldown();
|
||||||
}
|
}
|
||||||
healPlayer(user);
|
healPlayer(user.getBase());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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
|
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;
|
||||||
|
Reference in New Issue
Block a user