Search in sources :

Example 1 with ISpawner

use of simplepets.brainsynder.utils.ISpawner in project SimplePets by brainsynder-Dev.

the class PetSpawner method spawnPet.

public static IEntityPet spawnPet(Pet pet, Class<? extends IEntityPet> clazz) {
    ISpawner spawner = PetCore.get().getSpawner();
    String entity = clazz.getSimpleName().replaceFirst("I", "");
    if (spawner == null) {
        throw new SimplePetsException("An error occurred when trying to retrieve the PetSpawner Class");
    }
    return spawner.spawnEntityPet(pet, entity);
}
Also used : ISpawner(simplepets.brainsynder.utils.ISpawner) SimplePetsException(simplepets.brainsynder.errors.SimplePetsException)

Example 2 with ISpawner

use of simplepets.brainsynder.utils.ISpawner in project SimplePets by brainsynder-Dev.

the class PetSpawner method spawnPet.

public static IEntityPet spawnPet(Location location, Pet pet, Class<? extends IEntityPet> clazz) {
    ISpawner spawner = PetCore.get().getSpawner();
    String entity = clazz.getSimpleName().replaceFirst("I", "");
    if (spawner == null) {
        throw new SimplePetsException("An error occurred when trying to retrieve the PetSpawner Class");
    }
    return spawner.spawnEntityPet(location, pet, entity);
}
Also used : ISpawner(simplepets.brainsynder.utils.ISpawner) SimplePetsException(simplepets.brainsynder.errors.SimplePetsException)

Aggregations

SimplePetsException (simplepets.brainsynder.errors.SimplePetsException)2 ISpawner (simplepets.brainsynder.utils.ISpawner)2