mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-24 06:06:45 +01:00
Fix cat cotw on older versions
This commit is contained in:
parent
582a572272
commit
909c1f34d1
@ -402,6 +402,7 @@ public class TamingManager extends SkillManager {
|
|||||||
callOfWildEntity.setCustomName(LocaleLoader.getString("Taming.Summon.Name.Format", getPlayer().getName(), StringUtils.getPrettyEntityTypeString(EntityType.WOLF)));
|
callOfWildEntity.setCustomName(LocaleLoader.getString("Taming.Summon.Name.Format", getPlayer().getName(), StringUtils.getPrettyEntityTypeString(EntityType.WOLF)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
private void spawnCat(Location spawnLocation, EntityType entityType) {
|
private void spawnCat(Location spawnLocation, EntityType entityType) {
|
||||||
LivingEntity callOfWildEntity = (LivingEntity) getPlayer().getWorld().spawnEntity(spawnLocation, entityType);
|
LivingEntity callOfWildEntity = (LivingEntity) getPlayer().getWorld().spawnEntity(spawnLocation, entityType);
|
||||||
|
|
||||||
@ -414,15 +415,13 @@ public class TamingManager extends SkillManager {
|
|||||||
|
|
||||||
//Randomize the cat
|
//Randomize the cat
|
||||||
if (callOfWildEntity instanceof Ocelot) {
|
if (callOfWildEntity instanceof Ocelot) {
|
||||||
|
// Ocelot.Type is deprecated, but that's fine since this only runs on 1.13
|
||||||
int numberOfTypes = Ocelot.Type.values().length;
|
int numberOfTypes = Ocelot.Type.values().length;
|
||||||
((Ocelot) callOfWildEntity).setCatType(Ocelot.Type.values()[Misc.getRandom().nextInt(numberOfTypes)]);
|
((Ocelot) callOfWildEntity).setCatType(Ocelot.Type.values()[Misc.getRandom().nextInt(numberOfTypes)]);
|
||||||
((Ocelot) callOfWildEntity).setAdult();
|
|
||||||
} else if (callOfWildEntity instanceof Cat) {
|
|
||||||
int numberOfTypes = Cat.Type.values().length;
|
|
||||||
((Cat) callOfWildEntity).setCatType(Cat.Type.values()[Misc.getRandom().nextInt(numberOfTypes)]);
|
|
||||||
((Cat) callOfWildEntity).setAdult();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
((Ageable) callOfWildEntity).setAdult();
|
||||||
|
|
||||||
callOfWildEntity.setCustomName(LocaleLoader.getString("Taming.Summon.Name.Format", getPlayer().getName(), StringUtils.getPrettyEntityTypeString(entityType)));
|
callOfWildEntity.setCustomName(LocaleLoader.getString("Taming.Summon.Name.Format", getPlayer().getName(), StringUtils.getPrettyEntityTypeString(entityType)));
|
||||||
|
|
||||||
//Particle effect
|
//Particle effect
|
||||||
|
Loading…
Reference in New Issue
Block a user