Search in sources :

Example 1 with EntityKoaHunter

use of net.tropicraft.core.common.entity.passive.EntityKoaHunter in project Tropicraft by Tropicraft.

the class TownKoaVillage method spawnMemberAtSpawnLocation.

/*public void spawnEntityRel(String parType, int memberID) {
		
		BlockPos coords = listCoordsSpawn.get(memberID);
		
		BlockPos coords = BuildManager.rotateNew(new BlockPos(MathHelper.floor_double(parCoords.xCoord), MathHelper.floor_double(parCoords.yCoord), MathHelper.floor_double(parCoords.zCoord)), direction, 
				Vec3d.createVectorHelper(spawn.getX(), spawn.getY(), spawn.getZ()), 
				Vec3d.createVectorHelper(areaWidth, areaHeight, areaLength));
		
		EntityKoaBase ent = null;
		
		if (parType.equals("fisher")) {
			ent = new EntityKoaFisher(getWorld());
		} else if (parType.equals("hunter")) {
			ent = new EntityKoaHunter(getWorld());
		} else if (parType.equals("trader")) {
			ent = new EntityKoaTrader(getWorld());
		} else if (parType.equals("shaman")) {
			ent = new EntityKoaShaman(getWorld());
		}
		
		if (ent != null) {
			ent.getAIAgent().setManagedLocation(this);
			ent.setPosition(spawn.getX() + coords.getX() + 0.5F, spawn.getY() + coords.getY(), spawn.getZ() + coords.getZ() + 0.5F);
			//ent.setPosition(parCoords.xCoord + 0.5F, parCoords.yCoord, parCoords.zCoord + 0.5F);
			getWorld().spawnEntityInWorld(ent);
			addEntity(parType, ent);
			ent.onSpawnWithEgg(null);
		}
		
		//TODO: register entities with managedlocation, how are ids managed?
	}*/
@Override
public EntityLivingBase spawnMemberAtSpawnLocation(SpawnLocationData parData) {
    super.spawnMemberAtSpawnLocation(parData);
    EntityKoaBase ent = null;
    /*if (parData.type.equals("fisher")) {
			ent = new EntityKoaFisher(getWorld());
		} else if (parData.type.equals("hunter")) {
			ent = new EntityKoaHunter(getWorld());
		} else if (parData.type.equals("trader")) {
			ent = new EntityKoaTrader(getWorld());
		} else if (parData.type.equals("shaman")) {
			ent = new EntityKoaShaman(getWorld());
		}*/
    ent = new EntityKoaHunter(getWorld());
    if (ent != null) {
        // ent.getAIAgent().setManagedLocation(this);
        ent.setVillageID(this.locationID);
        ent.setPosition(spawn.getX() + parData.coords.getX() + 0.5F, spawn.getY() + parData.coords.getY(), spawn.getZ() + parData.coords.getZ() + 0.5F);
        // ent.setPosition(parCoords.xCoord + 0.5F, parCoords.yCoord, parCoords.zCoord + 0.5F);
        getWorld().spawnEntity(ent);
        parData.entityUUID = ent.getPersistentID();
        ent.onInitialSpawn(getWorld().getDifficultyForLocation(ent.getPosition()), null);
        ent.postSpawnGenderFix();
        addEntity(ent);
    }
    return ent;
}
Also used : EntityKoaBase(net.tropicraft.core.common.entity.passive.EntityKoaBase) EntityKoaHunter(net.tropicraft.core.common.entity.passive.EntityKoaHunter)

Example 2 with EntityKoaHunter

use of net.tropicraft.core.common.entity.passive.EntityKoaHunter in project Tropicraft by Tropicraft.

the class GuiTropicsLoading method eggWrap.

public Entity eggWrap(Entity e, int s) {
    if ((rand.nextInt(40) == 0 && s == 0) || isEgg) {
        EntityKoaHunter koa = new EntityKoaHunter(e.world);
        koa.setDancing(true);
        koa.setSneaking(true);
        koa.ticksExisted = rand.nextInt(50);
        isEgg = !isEgg;
        return koa;
    }
    return e;
}
Also used : EntityKoaHunter(net.tropicraft.core.common.entity.passive.EntityKoaHunter)

Aggregations

EntityKoaHunter (net.tropicraft.core.common.entity.passive.EntityKoaHunter)2 EntityKoaBase (net.tropicraft.core.common.entity.passive.EntityKoaBase)1