Search in sources :

Example 1 with EntityRevolvershot

use of blusunrize.immersiveengineering.common.entities.EntityRevolvershot in project ImmersiveEngineering by BluSunrize.

the class TileEntityBalloon method onEntityCollision.

@Override
public void onEntityCollision(World world, Entity entity) {
    if (entity instanceof EntityArrow || entity instanceof EntityRevolvershot) {
        Vec3d pos = new Vec3d(getPos()).add(.5, .5, .5);
        world.playSound(null, pos.x, pos.y, pos.z, SoundEvents.ENTITY_FIREWORK_BLAST, SoundCategory.BLOCKS, 1.5f, 0.7f);
        world.setBlockToAir(getPos());
        world.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, pos.x, pos.y, pos.z, 0, .05, 0);
        Triple<ItemStack, ShaderRegistryEntry, ShaderCase> shader = ShaderRegistry.getStoredShaderAndCase(this.shader);
        if (shader != null)
            shader.getMiddle().getEffectFunction().execute(world, shader.getLeft(), null, shader.getRight().getShaderType(), pos, null, .375f);
    }
}
Also used : EntityArrow(net.minecraft.entity.projectile.EntityArrow) ShaderRegistryEntry(blusunrize.immersiveengineering.api.shader.ShaderRegistry.ShaderRegistryEntry) ShaderCase(blusunrize.immersiveengineering.api.shader.ShaderCase) ItemStack(net.minecraft.item.ItemStack) Vec3d(net.minecraft.util.math.Vec3d) EntityRevolvershot(blusunrize.immersiveengineering.common.entities.EntityRevolvershot)

Example 2 with EntityRevolvershot

use of blusunrize.immersiveengineering.common.entities.EntityRevolvershot in project ImmersiveEngineering by BluSunrize.

the class ItemRevolver method getBullet.

/* ------------- BULLET UTILITY ------------- */
EntityRevolvershot getBullet(EntityPlayer player, Vec3d vecSpawn, Vec3d vecDir, String type, ItemStack stack, boolean electro) {
    EntityRevolvershot bullet = new EntityRevolvershot(player.world, player, vecDir.x * 1.5, vecDir.y * 1.5, vecDir.z * 1.5, type, stack);
    bullet.motionX = vecDir.x * 2;
    bullet.motionY = vecDir.y * 2;
    bullet.motionZ = vecDir.z * 2;
    bullet.bulletElectro = electro;
    return bullet;
}
Also used : EntityRevolvershot(blusunrize.immersiveengineering.common.entities.EntityRevolvershot)

Example 3 with EntityRevolvershot

use of blusunrize.immersiveengineering.common.entities.EntityRevolvershot in project ImmersiveEngineering by BluSunrize.

the class TileEntityTurretGun method getBulletEntity.

EntityRevolvershot getBulletEntity(World world, Vec3d vecDir, IBullet type) {
    Vec3d gunPos = getGunPosition();
    EntityRevolvershot bullet = new EntityRevolvershot(world, gunPos.x + vecDir.x, gunPos.y + vecDir.y, gunPos.z + vecDir.z, 0, 0, 0, type);
    bullet.motionX = vecDir.x;
    bullet.motionY = vecDir.y;
    bullet.motionZ = vecDir.z;
    return bullet;
}
Also used : Vec3d(net.minecraft.util.math.Vec3d) EntityRevolvershot(blusunrize.immersiveengineering.common.entities.EntityRevolvershot)

Aggregations

EntityRevolvershot (blusunrize.immersiveengineering.common.entities.EntityRevolvershot)3 Vec3d (net.minecraft.util.math.Vec3d)2 ShaderCase (blusunrize.immersiveengineering.api.shader.ShaderCase)1 ShaderRegistryEntry (blusunrize.immersiveengineering.api.shader.ShaderRegistry.ShaderRegistryEntry)1 EntityArrow (net.minecraft.entity.projectile.EntityArrow)1 ItemStack (net.minecraft.item.ItemStack)1