mirror of
https://github.com/songoda/EpicBosses.git
synced 2024-09-27 21:12:42 +02:00
No spawning babies.
This commit is contained in:
parent
73c5ec1efd
commit
50847321ad
@ -8,6 +8,7 @@ import com.songoda.epicbosses.holder.ActiveBossHolder;
|
|||||||
import com.songoda.epicbosses.mechanics.IBossMechanic;
|
import com.songoda.epicbosses.mechanics.IBossMechanic;
|
||||||
import com.songoda.epicbosses.utils.Debug;
|
import com.songoda.epicbosses.utils.Debug;
|
||||||
import com.songoda.epicbosses.utils.EntityFinder;
|
import com.songoda.epicbosses.utils.EntityFinder;
|
||||||
|
import org.bukkit.entity.Ageable;
|
||||||
import org.bukkit.entity.AnimalTamer;
|
import org.bukkit.entity.AnimalTamer;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Tameable;
|
import org.bukkit.entity.Tameable;
|
||||||
@ -47,10 +48,6 @@ public class EntityTypeMechanic implements IBossMechanic {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lowerLivingEntity instanceof Tameable) {
|
|
||||||
((Tameable) lowerLivingEntity).setTamed(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
lowerLivingEntity.setPassenger(livingEntity);
|
lowerLivingEntity.setPassenger(livingEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import com.songoda.epicbosses.holder.ActiveMinionHolder;
|
|||||||
import com.songoda.epicbosses.mechanics.IMinionMechanic;
|
import com.songoda.epicbosses.mechanics.IMinionMechanic;
|
||||||
import com.songoda.epicbosses.utils.Debug;
|
import com.songoda.epicbosses.utils.Debug;
|
||||||
import com.songoda.epicbosses.utils.EntityFinder;
|
import com.songoda.epicbosses.utils.EntityFinder;
|
||||||
|
import org.bukkit.entity.Ageable;
|
||||||
import org.bukkit.entity.AnimalTamer;
|
import org.bukkit.entity.AnimalTamer;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Tameable;
|
import org.bukkit.entity.Tameable;
|
||||||
@ -48,10 +49,6 @@ public class EntityTypeMechanic implements IMinionMechanic {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lowerLivingEntity instanceof Tameable) {
|
|
||||||
((Tameable) lowerLivingEntity).setTamed(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
lowerLivingEntity.setPassenger(livingEntity);
|
lowerLivingEntity.setPassenger(livingEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,10 @@ package com.songoda.epicbosses.utils;
|
|||||||
import com.songoda.epicbosses.utils.entity.ICustomEntityHandler;
|
import com.songoda.epicbosses.utils.entity.ICustomEntityHandler;
|
||||||
import com.songoda.epicbosses.utils.entity.handlers.*;
|
import com.songoda.epicbosses.utils.entity.handlers.*;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.Ageable;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.bukkit.entity.Tameable;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -132,6 +134,14 @@ public enum EntityFinder {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (livingEntity instanceof Tameable) {
|
||||||
|
((Tameable) livingEntity).setTamed(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (livingEntity instanceof Ageable) {
|
||||||
|
((Ageable) livingEntity).setAdult();
|
||||||
|
}
|
||||||
|
|
||||||
return livingEntity;
|
return livingEntity;
|
||||||
} else {
|
} else {
|
||||||
return (LivingEntity) location.getWorld().spawnEntity(location, getEntityType());
|
return (LivingEntity) location.getWorld().spawnEntity(location, getEntityType());
|
||||||
|
Loading…
Reference in New Issue
Block a user