Search in sources :

Example 1 with EntityLance

use of uk.co.wehavecookies56.kk.common.entity.projectiles.lances.EntityLance in project Kingdom-Keys-Re-Coded by Wehavecookies56.

the class ItemLances method onItemRightClick.

@Override
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) {
    Entity entity;
    switch(weapon) {
        /*case Strings.Ashes:
                entity = new EntityAshes(world, player);
                break;
            case Strings.BlazeofGlory:
                entity = new EntityBlazeofGlory(world, player);
                break;
            case Strings.EternalFlames:
                entity = new EntityEternalFlames(world, player);
                break;
            case Strings.Ifrit:
                entity = new EntityIfrit(world, player);
                break;
            case Strings.Prometheus:
                entity = new EntityPrometheus(world, player);
                break;
            case Strings.Prominence:
                entity = new EntityProminence(world, player);
                break;
            case Strings.MoulinRouge:
                entity = new EntityMoulinRouge(world, player);
                break;
            case Strings.FerrisWheel:
                entity = new EntityFerrisWheels(world, player);
                break;
            case Strings.Combustion:
                entity = new EntityCombustion(world, player);
                break;
            case Strings.Burnout:
                entity = new EntityBurnout(world, player);
                break;
            case Strings.OmegaTrinity:
                entity = new EntityOmegaTrinity(world, player);
                break;
            case Strings.Doldrums:
                entity = new EntityDoledrum(world, player);
                break;
            case Strings.Outbreak:
                entity = new EntityOutbreak(world, player);
                break;
            case Strings.Inferno:
                entity = new EntityInferno(world, player);
                break;
            case Strings.SizzlingEdge:
                entity= new EntitySizzlingEdge(world, player);
                break;
            case Strings.DoubleEdge:
                entity= new EntityDoubleEdge(world, player);
                break;*/
        default:
            entity = new EntityZephyr(world, player);
            break;
    }
    if (!player.getCapability(ModCapabilities.PLAYER_STATS, null).getRecharge()) {
        if (!player.isSneaking()) {
            world.playSound(player.posX, player.posY, player.posZ, SoundEvents.ENTITY_GHAST_SHOOT, SoundCategory.PLAYERS, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F), false);
            world.spawnEntity(entity);
            // setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, 0, 1f, 1);
            ((EntityLance) entity).setAim(player, 2, 0);
            if (!player.getCapability(ModCapabilities.CHEAT_MODE, null).getCheatMode())
                player.getCapability(ModCapabilities.PLAYER_STATS, null).remMP(7);
            player.swingArm(hand);
        }
        return ActionResult.newResult(EnumActionResult.SUCCESS, player.getHeldItemMainhand());
    }
    return ActionResult.newResult(EnumActionResult.FAIL, player.getHeldItemMainhand());
}
Also used : Entity(net.minecraft.entity.Entity) EntityLance(uk.co.wehavecookies56.kk.common.entity.projectiles.lances.EntityLance) EntityZephyr(uk.co.wehavecookies56.kk.common.entity.projectiles.lances.EntityZephyr)

Aggregations

Entity (net.minecraft.entity.Entity)1 EntityLance (uk.co.wehavecookies56.kk.common.entity.projectiles.lances.EntityLance)1 EntityZephyr (uk.co.wehavecookies56.kk.common.entity.projectiles.lances.EntityZephyr)1