Search in sources :

Example 1 with SpawnKH1FireParticles

use of uk.co.wehavecookies56.kk.common.network.packet.client.SpawnKH1FireParticles in project Kingdom-Keys-Re-Coded by Wehavecookies56.

the class EntityKH1Firaga method onUpdate.

@Override
public void onUpdate() {
    if (shootingEntity == null)
        return;
    int rotation = 0;
    if (!world.isRemote)
        PacketDispatcher.sendToAllAround(new SpawnKH1FireParticles(this, 1), shootingEntity, 64.0D);
    if (LockOn.target != null) {
        EntityLiving target = (EntityLiving) InputHandler.lockOn;
        setThrowableHeading(target.posX - this.posX, target.posY - this.posY + target.height, target.posZ - this.posZ, 1.5f, 0);
    }
    this.world.spawnParticle(EnumParticleTypes.FLAME, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
    this.rotationYaw = (rotation + 1) % 360;
    if (ticksExisted > 60)
        setDead();
    super.onUpdate();
}
Also used : SpawnKH1FireParticles(uk.co.wehavecookies56.kk.common.network.packet.client.SpawnKH1FireParticles) EntityLiving(net.minecraft.entity.EntityLiving)

Example 2 with SpawnKH1FireParticles

use of uk.co.wehavecookies56.kk.common.network.packet.client.SpawnKH1FireParticles in project Kingdom-Keys-Re-Coded by Wehavecookies56.

the class MagicKH1Fire 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_Fire));
    World world = player.world;
    switch(player.getCapability(ModCapabilities.MAGIC_STATE, null).getMagicLevel(Strings.Spell_Fire)) {
        case 1:
            EntityKH1Fire entityKH1Fire = new EntityKH1Fire(world, player);
            world.spawnEntity(entityKH1Fire);
            entityKH1Fire.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, 0, 1, 0);
            PacketDispatcher.sendToAllAround(new SpawnKH1FireParticles(new EntityKH1Fire(world), 1), player, 64.0D);
            break;
        case 2:
            EntityKH1Fira entityKH1Fira = new EntityKH1Fira(world, player);
            world.spawnEntity(entityKH1Fira);
            entityKH1Fira.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, 0, 1, 0);
            PacketDispatcher.sendToAllAround(new SpawnKH1FireParticles(new EntityKH1Fira(world), 1), player, 64.0D);
            break;
        case 3:
            EntityKH1Firaga entityKH1Firaga = new EntityKH1Firaga(world, player);
            world.spawnEntity(entityKH1Firaga);
            entityKH1Firaga.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, 0, 1, 0);
            PacketDispatcher.sendToAllAround(new SpawnKH1FireParticles(new EntityKH1Firaga(world), 1), player, 64.0D);
            break;
    }
    PacketDispatcher.sendTo(new SyncMagicData(player.getCapability(ModCapabilities.MAGIC_STATE, null), player.getCapability(ModCapabilities.PLAYER_STATS, null)), (EntityPlayerMP) player);
}
Also used : SpawnKH1FireParticles(uk.co.wehavecookies56.kk.common.network.packet.client.SpawnKH1FireParticles) EntityKH1Fira(uk.co.wehavecookies56.kk.common.entity.magic.EntityKH1Fira) EntityKH1Firaga(uk.co.wehavecookies56.kk.common.entity.magic.EntityKH1Firaga) SyncMagicData(uk.co.wehavecookies56.kk.common.network.packet.client.SyncMagicData) World(net.minecraft.world.World) EntityKH1Fire(uk.co.wehavecookies56.kk.common.entity.magic.EntityKH1Fire)

Example 3 with SpawnKH1FireParticles

use of uk.co.wehavecookies56.kk.common.network.packet.client.SpawnKH1FireParticles in project Kingdom-Keys-Re-Coded by Wehavecookies56.

the class EntityKH1Fira method onUpdate.

@Override
public void onUpdate() {
    if (shootingEntity == null)
        return;
    int rotation = 0;
    if (!world.isRemote)
        PacketDispatcher.sendToAllAround(new SpawnKH1FireParticles(this, 1), shootingEntity, 64.0D);
    if (LockOn.target != null) {
        EntityLiving target = (EntityLiving) InputHandler.lockOn;
        setThrowableHeading(target.posX - this.posX, target.posY - this.posY + target.height, target.posZ - this.posZ, 1.5f, 0);
    }
    this.world.spawnParticle(EnumParticleTypes.FLAME, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
    this.rotationYaw = (rotation + 1) % 360;
    if (ticksExisted > 60)
        setDead();
    super.onUpdate();
}
Also used : SpawnKH1FireParticles(uk.co.wehavecookies56.kk.common.network.packet.client.SpawnKH1FireParticles) EntityLiving(net.minecraft.entity.EntityLiving)

Example 4 with SpawnKH1FireParticles

use of uk.co.wehavecookies56.kk.common.network.packet.client.SpawnKH1FireParticles in project Kingdom-Keys-Re-Coded by Wehavecookies56.

the class EntityKH1Fire method onUpdate.

@Override
public void onUpdate() {
    if (shootingEntity == null)
        return;
    if (shootingEntity instanceof EntityPlayer) {
        if (!world.isRemote)
            PacketDispatcher.sendToAllAround(new SpawnKH1FireParticles(this, 1), (EntityPlayer) shootingEntity, 64.0D);
        if (LockOn.target != null) {
            EntityLiving target = (EntityLiving) LockOn.target;
            setThrowableHeading(target.posX - this.posX, target.posY - this.posY + target.height, target.posZ - this.posZ, 1.5f, 0);
        }
    } else {
        if (!world.isRemote)
            PacketDispatcher.sendToAllAround(new SpawnKH1FireParticles(this, 1), dimension, this.posX, this.posY, this.posZ, 64D);
    }
    if (ticksExisted > 60)
        setDead();
    super.onUpdate();
}
Also used : SpawnKH1FireParticles(uk.co.wehavecookies56.kk.common.network.packet.client.SpawnKH1FireParticles) EntityLiving(net.minecraft.entity.EntityLiving) EntityPlayer(net.minecraft.entity.player.EntityPlayer)

Aggregations

SpawnKH1FireParticles (uk.co.wehavecookies56.kk.common.network.packet.client.SpawnKH1FireParticles)4 EntityLiving (net.minecraft.entity.EntityLiving)3 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 World (net.minecraft.world.World)1 EntityKH1Fira (uk.co.wehavecookies56.kk.common.entity.magic.EntityKH1Fira)1 EntityKH1Firaga (uk.co.wehavecookies56.kk.common.entity.magic.EntityKH1Firaga)1 EntityKH1Fire (uk.co.wehavecookies56.kk.common.entity.magic.EntityKH1Fire)1 SyncMagicData (uk.co.wehavecookies56.kk.common.network.packet.client.SyncMagicData)1