Search in sources :

Example 1 with EntityAero

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

the class MagicAero 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_Aero));
    World world = player.world;
    if (!world.isRemote) {
        switch(player.getCapability(ModCapabilities.MAGIC_STATE, null).getMagicLevel(Strings.Spell_Aero)) {
            case 1:
                world.spawnEntity(new EntityAero(world, player, player.posX, player.posY, player.posZ));
                PacketDispatcher.sendToAllAround(new SpawnAeroParticles(player, 1), player, 64.0D);
                break;
            case 2:
                world.spawnEntity(new EntityAerora(world, player, player.posX, player.posY, player.posZ));
                PacketDispatcher.sendToAllAround(new SpawnAeroParticles(player, 2), player, 64.0D);
                break;
            case 3:
                world.spawnEntity(new EntityAeroga(world, player, player.posX, player.posY, player.posZ));
                PacketDispatcher.sendToAllAround(new SpawnAeroParticles(player, 3), player, 64.0D);
                break;
        }
        PacketDispatcher.sendTo(new SyncMagicData(player.getCapability(ModCapabilities.MAGIC_STATE, null), player.getCapability(ModCapabilities.PLAYER_STATS, null)), (EntityPlayerMP) player);
    }
}
Also used : EntityAero(uk.co.wehavecookies56.kk.common.entity.magic.EntityAero) EntityAeroga(uk.co.wehavecookies56.kk.common.entity.magic.EntityAeroga) SpawnAeroParticles(uk.co.wehavecookies56.kk.common.network.packet.client.SpawnAeroParticles) EntityAerora(uk.co.wehavecookies56.kk.common.entity.magic.EntityAerora) SyncMagicData(uk.co.wehavecookies56.kk.common.network.packet.client.SyncMagicData) World(net.minecraft.world.World)

Aggregations

World (net.minecraft.world.World)1 EntityAero (uk.co.wehavecookies56.kk.common.entity.magic.EntityAero)1 EntityAeroga (uk.co.wehavecookies56.kk.common.entity.magic.EntityAeroga)1 EntityAerora (uk.co.wehavecookies56.kk.common.entity.magic.EntityAerora)1 SpawnAeroParticles (uk.co.wehavecookies56.kk.common.network.packet.client.SpawnAeroParticles)1 SyncMagicData (uk.co.wehavecookies56.kk.common.network.packet.client.SyncMagicData)1