Search in sources :

Example 6 with PlayAudioMessage

use of com.minecolonies.coremod.network.messages.client.PlayAudioMessage in project minecolonies by Minecolonies.

the class EgyptianRaidEvent method onStart.

@Override
public void onStart() {
    super.onStart();
    PlayAudioMessage.sendToAll(getColony(), true, false, new PlayAudioMessage(RaidSounds.DESERT_RAID_WARNING));
}
Also used : PlayAudioMessage(com.minecolonies.coremod.network.messages.client.PlayAudioMessage)

Example 7 with PlayAudioMessage

use of com.minecolonies.coremod.network.messages.client.PlayAudioMessage in project minecolonies by Minecolonies.

the class EgyptianRaidEvent method onUpdate.

@Override
public void onUpdate() {
    super.onUpdate();
    if (--musicCooldown <= 0) {
        PlayAudioMessage.sendToAll(getColony(), true, true, new PlayAudioMessage(RaidSounds.DESERT_RAID));
        musicCooldown = 12;
    }
}
Also used : PlayAudioMessage(com.minecolonies.coremod.network.messages.client.PlayAudioMessage)

Example 8 with PlayAudioMessage

use of com.minecolonies.coremod.network.messages.client.PlayAudioMessage in project minecolonies by ldtteam.

the class HordeRaidEvent method onStart.

@Override
public void onStart() {
    if (spawnPathResult.isDone()) {
        final Path path = spawnPathResult.getPath();
        if (path != null && path.canReach()) {
            spawnPoint = path.getEndNode().asBlockPos();
        }
        this.wayPoints = ShipBasedRaiderUtils.createWaypoints(colony.getWorld(), path, WAYPOINT_SPACING);
    }
    final BlockPos spawnPos = ShipBasedRaiderUtils.getLoadedPositionTowardsCenter(spawnPoint, colony, MAX_SPAWN_DEVIATION, spawnPoint, MIN_CENTER_DISTANCE, 10);
    if (spawnPos == null) {
        status = EventStatus.CANCELED;
        return;
    }
    status = EventStatus.PREPARING;
    spawnCampFires(spawnPos);
    final double dist = colony.getCenter().distSqr(spawnPos);
    if (dist < MIN_CENTER_DISTANCE * MIN_CENTER_DISTANCE) {
        campFireTime = 6;
    } else {
        campFireTime = 3;
    }
    spawnHorde(spawnPos, colony, id, horde.numberOfBosses, horde.numberOfArchers, horde.numberOfRaiders);
    updateRaidBar();
    LanguageHandler.sendPlayersMessage(colony.getImportantMessageEntityPlayers(), RAID_EVENT_MESSAGE + horde.getMessageID(), BlockPosUtil.calcDirection(colony.getCenter(), spawnPoint), colony.getName());
    PlayAudioMessage audio = new PlayAudioMessage(horde.initialSize <= SMALL_HORDE_SIZE ? RaidSounds.WARNING_EARLY : RaidSounds.WARNING, SoundCategory.RECORDS);
    PlayAudioMessage.sendToAll(getColony(), false, false, audio);
}
Also used : Path(net.minecraft.pathfinding.Path) PlayAudioMessage(com.minecolonies.coremod.network.messages.client.PlayAudioMessage) BlockPos(net.minecraft.util.math.BlockPos)

Example 9 with PlayAudioMessage

use of com.minecolonies.coremod.network.messages.client.PlayAudioMessage in project minecolonies by ldtteam.

the class AmazonRaidEvent method onUpdate.

@Override
public void onUpdate() {
    super.onUpdate();
    if (--musicCooldown <= 0) {
        PlayAudioMessage.sendToAll(getColony(), true, true, new PlayAudioMessage(RaidSounds.AMAZON_RAID));
        musicCooldown = 20;
    }
}
Also used : PlayAudioMessage(com.minecolonies.coremod.network.messages.client.PlayAudioMessage)

Example 10 with PlayAudioMessage

use of com.minecolonies.coremod.network.messages.client.PlayAudioMessage in project minecolonies by ldtteam.

the class EgyptianRaidEvent method onUpdate.

@Override
public void onUpdate() {
    super.onUpdate();
    if (--musicCooldown <= 0) {
        PlayAudioMessage.sendToAll(getColony(), true, true, new PlayAudioMessage(RaidSounds.DESERT_RAID));
        musicCooldown = 12;
    }
}
Also used : PlayAudioMessage(com.minecolonies.coremod.network.messages.client.PlayAudioMessage)

Aggregations

PlayAudioMessage (com.minecolonies.coremod.network.messages.client.PlayAudioMessage)10 IColonyEvent (com.minecolonies.api.colony.colonyEvents.IColonyEvent)2 Path (net.minecraft.pathfinding.Path)2 BlockPos (net.minecraft.util.math.BlockPos)2