mirror of
https://github.com/garbagemule/MobArena.git
synced 2025-02-27 18:02:34 +01:00
address github issue #247 (sit pets before teleporting) and include cats/ocelots as pets
This commit is contained in:
parent
3b88b889d6
commit
f81921efcd
@ -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