Search in sources :

Example 1 with EntityBlizzara

use of uk.co.wehavecookies56.kk.common.entity.magic.EntityBlizzara in project Kingdom-Keys-Re-Coded by Wehavecookies56.

the class MagicBlizzard method process.

@Override
public void process(EntityPlayer player, Side side) {
    if (!player.getCapability(ModCapabilities.CHEAT_MODE, null).getCheatMode())
        player.getCapability(ModCapabilities.PLAYER_STATS, null).remMP(Constants.getCost(Strings.Spell_Blizzard));
    World world = player.world;
    switch(player.getCapability(ModCapabilities.MAGIC_STATE, null).getMagicLevel(Strings.Spell_Blizzard)) {
        case 1:
            EntityBlizzard entityBlizzard = new EntityBlizzard(world, player);
            world.spawnEntity(entityBlizzard);
            entityBlizzard.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, 0, 1, 0);
            // PacketDispatcher.sendToAllAround(new SpawnBlizzardParticles(new EntityBlizzard(world), 1), player, 64.0D);
            break;
        case 2:
            EntityBlizzara entityBlizzara = new EntityBlizzara(world, player);
            world.spawnEntity(entityBlizzara);
            entityBlizzara.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, 0, 2, 0);
            // PacketDispatcher.sendToAllAround(new SpawnBlizzardParticles(new EntityBlizzara(world), 2), player, 64.0D);
            break;
        case 3:
            EntityBlizzaga entityBlizzaga = new EntityBlizzaga(world, player);
            world.spawnEntity(entityBlizzaga);
            entityBlizzaga.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, 0, 3, 0);
            // PacketDispatcher.sendToAllAround(new SpawnBlizzardParticles(new EntityBlizzaga(world), 3), player, 64.0D);
            break;
    }
    world.playSound(player.posX, player.posY, player.posZ, SoundEvents.BLOCK_GLASS_BREAK, SoundCategory.PLAYERS, 1, 1, false);
    PacketDispatcher.sendTo(new SyncMagicData(player.getCapability(ModCapabilities.MAGIC_STATE, null), player.getCapability(ModCapabilities.PLAYER_STATS, null)), (EntityPlayerMP) player);
}
Also used : EntityBlizzaga(uk.co.wehavecookies56.kk.common.entity.magic.EntityBlizzaga) SyncMagicData(uk.co.wehavecookies56.kk.common.network.packet.client.SyncMagicData) World(net.minecraft.world.World) EntityBlizzard(uk.co.wehavecookies56.kk.common.entity.magic.EntityBlizzard) EntityBlizzara(uk.co.wehavecookies56.kk.common.entity.magic.EntityBlizzara)

Aggregations

World (net.minecraft.world.World)1 EntityBlizzaga (uk.co.wehavecookies56.kk.common.entity.magic.EntityBlizzaga)1 EntityBlizzara (uk.co.wehavecookies56.kk.common.entity.magic.EntityBlizzara)1 EntityBlizzard (uk.co.wehavecookies56.kk.common.entity.magic.EntityBlizzard)1 SyncMagicData (uk.co.wehavecookies56.kk.common.network.packet.client.SyncMagicData)1