mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-23 11:06:14 +01:00
Merge pull request #329 from slipcor/pets-2
Make pets (ocelots included) sit before teleporting players to the lobby. Fixes #247
This commit is contained in:
commit
bc7c321d28
@ -586,11 +586,11 @@ public class ArenaImpl implements Arena
|
||||
}
|
||||
}
|
||||
|
||||
MAUtils.sitPets(p);
|
||||
movePlayerToLobby(p);
|
||||
takeFee(p);
|
||||
storePlayerData(p, loc);
|
||||
removePotionEffects(p);
|
||||
MAUtils.sitPets(p);
|
||||
setHealth(p, p.getMaxHealth());
|
||||
p.setFoodLevel(20);
|
||||
if (settings.getBoolean("display-timer-as-level", false)) {
|
||||
|
@ -21,6 +21,7 @@ import org.bukkit.Material;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Ocelot;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Wolf;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -113,12 +114,15 @@ public class MAUtils
|
||||
List<Entity> entities = p.getNearbyEntities(80, 40, 80);
|
||||
for (Entity e : entities)
|
||||
{
|
||||
if (!(e instanceof Wolf))
|
||||
continue;
|
||||
|
||||
Wolf w = (Wolf) e;
|
||||
if (w.isTamed() && w.getOwner() != null && w.getOwner().equals(p))
|
||||
w.setSitting(true);
|
||||
if (e instanceof Wolf) {
|
||||
Wolf w = (Wolf) e;
|
||||
if (w.isTamed() && w.getOwner() != null && w.getOwner().equals(p))
|
||||
w.setSitting(true);
|
||||
} else if (e instanceof Ocelot) {
|
||||
Ocelot o = (Ocelot) e;
|
||||
if (o.isTamed() && o.getOwner() != null && o.getOwner().equals(p))
|
||||
o.setSitting(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user